embedoc 0.14.10 → 0.14.11
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/README.md +2 -0
- package/cli-contract.yaml +1 -1
- package/dist/core/dependency.js +2 -2
- package/dist/core/dependency.js.map +1 -1
- package/dist/core/parser.d.ts +24 -2
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +76 -6
- package/dist/core/parser.js.map +1 -1
- package/dist/core/processor.d.ts.map +1 -1
- package/dist/core/processor.js +5 -3
- package/dist/core/processor.js.map +1 -1
- package/dist/embedoc.bundle.mjs +98 -97
- package/dist/embedoc.bundle.mjs.map +3 -3
- package/dist/generated/contract.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/docs/api/README.md +2 -2
- package/docs/cli-reference.md +1 -1
- package/package.json +1 -1
package/dist/embedoc.bundle.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}displayWidth(e){return
|
|
4
|
+
var ad=Object.create;var qa=Object.defineProperty;var ld=Object.getOwnPropertyDescriptor;var cd=Object.getOwnPropertyNames;var ud=Object.getPrototypeOf,hd=Object.prototype.hasOwnProperty;var Ve=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var fd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cd(e))!hd.call(t,i)&&i!==r&&qa(t,i,{get:()=>e[i],enumerable:!(n=ld(e,i))||n.enumerable});return t};var Vi=(t,e,r)=>(r=t!=null?ad(ud(t)):{},fd(e||!t||!t.__esModule?qa(r,"default",{value:t,enumerable:!0}):r,t));var Tl=H((zw,ps)=>{var on=process||{},Ol=on.argv||[],sn=on.env||{},bd=!(sn.NO_COLOR||Ol.includes("--no-color"))&&(!!sn.FORCE_COLOR||Ol.includes("--color")||on.platform==="win32"||(on.stdout||{}).isTTY&&sn.TERM!=="dumb"||!!sn.CI),wd=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+vd(i,e,r,s)+e:t+i+e},vd=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},Pl=(t=bd)=>{let e=t?wd:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ps.exports=Pl();ps.exports.createColors=Pl});var br=H(As=>{var mn=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Es=class extends mn{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};As.CommanderError=mn;As.InvalidArgumentError=Es});var gn=H(Ps=>{var{InvalidArgumentError:mp}=br(),Os=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new mp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function gp(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ps.Argument=Os;Ps.humanReadableArgName=gp});var Is=H(Ds=>{var{humanReadableArgName:yp}=gn(),Ts=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>yp(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function s(h,p){return r.formatItem(h,n,p,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let l=r.visibleArguments(e).map(h=>s(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));l.length>0&&(o=o.concat([r.styleTitle("Arguments:"),...l,""]));let c=r.visibleOptions(e).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));if(c.length>0&&(o=o.concat([r.styleTitle("Options:"),...c,""])),r.showGlobalOptions){let h=r.visibleGlobalOptions(e).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));h.length>0&&(o=o.concat([r.styleTitle("Global Options:"),...h,""]))}let f=r.visibleCommands(e).map(h=>s(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));return f.length>0&&(o=o.concat([r.styleTitle("Commands:"),...f,""])),o.join(`
|
|
5
|
+
`)}displayWidth(e){return Zl(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let o=" ".repeat(2);if(!n)return o+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),l=2,f=(this.helpWidth??80)-r-l-2,h;return f<this.minWidthToWrap||i.preformatted(n)?h=n:h=i.boxWrap(n,f).replace(/\n/g,`
|
|
6
6
|
`+" ".repeat(r+l)),o+a+" ".repeat(l)+h.replace(/\n/g,`
|
|
7
|
-
${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let
|
|
8
|
-
`)}};function
|
|
7
|
+
${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let a=o.match(i);if(a===null){s.push("");return}let l=[a.shift()],c=this.displayWidth(l[0]);a.forEach(f=>{let h=this.displayWidth(f);if(c+h<=r){l.push(f),c+=h;return}s.push(l.join(""));let p=f.trimStart();l=[p],c=this.displayWidth(p)}),s.push(l.join(""))}),s.join(`
|
|
8
|
+
`)}};function Zl(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Ds.Help=Ts;Ds.stripColor=Zl});var Ms=H(Ns=>{var{InvalidArgumentError:_p}=br(),Rs=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=bp(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new _p(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Xl(this.name().replace(/^no-/,"")):Xl(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ls=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return r.negate===(s===e)}};function Xl(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function bp(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),i.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&i.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
|
|
9
9
|
- a short flag is a single dash and a single character
|
|
10
10
|
- either use a single dash and a single character (for a short flag)
|
|
11
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):
|
|
12
|
-
- too many short flags`):
|
|
11
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(o)?new Error(`${a}
|
|
12
|
+
- too many short flags`):i.test(o)?new Error(`${a}
|
|
13
13
|
- too many long flags`):new Error(`${a}
|
|
14
|
-
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}
|
|
15
|
-
(Did you mean one of ${
|
|
16
|
-
(Did you mean ${
|
|
17
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new
|
|
18
|
-
Expecting one of '${
|
|
19
|
-
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=
|
|
20
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,
|
|
21
|
-
- if '${
|
|
14
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Ns.Option=Rs;Ns.DualOptions=Ls});var tc=H(ec=>{function wp(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let s=1;t[i-1]===e[n-1]?s=0:s=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+s),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function vp(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let n=[],i=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=wp(t,o),l=Math.max(t.length,o.length);(l-a)/l>s&&(a<i?(i=a,n=[o]):a===i&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
|
|
15
|
+
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
16
|
+
(Did you mean ${n[0]}?)`:""}ec.suggestSimilar=vp});var sc=H($s=>{var Sp=Ve("node:events").EventEmitter,Fs=Ve("node:child_process"),at=Ve("node:path"),yn=Ve("node:fs"),J=Ve("node:process"),{Argument:xp,humanReadableArgName:Cp}=gn(),{CommanderError:Bs}=br(),{Help:kp,stripColor:Ep}=Is(),{Option:rc,DualOptions:Ap}=Ms(),{suggestSimilar:nc}=tc(),qs=class t extends Sp{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>J.stdout.write(r),writeErr:r=>J.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>J.stdout.isTTY?J.stdout.columns:void 0,getErrHelpWidth:()=>J.stderr.isTTY?J.stderr.columns:void 0,getOutHasColors:()=>Hs()??(J.stdout.isTTY&&J.stdout.hasColors?.()),getErrHasColors:()=>Hs()??(J.stderr.isTTY&&J.stderr.hasColors?.()),stripColor:r=>Ep(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return i&&(l.description(i),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new kp,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
17
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new xp(e,r)}argument(e,r,n,i){let s=this.createArgument(e,r);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),s=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),i&&o.arguments(i),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
18
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Bs(e,r,n)),J.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new rc(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
19
|
+
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let l=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,l,o):s!==null&&e.variadic&&(s=e._concatValue(s,l)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(e,r,n,i,s){if(typeof r=="object"&&r instanceof rc)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let a=i;i=(l,c)=>{let f=a.exec(l);return f?f[0]:c},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){J.versions?.electron&&(r.from="electron");let i=J.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=J.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":J.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
20
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(yn.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
|
|
21
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
22
22
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
23
|
-
- ${
|
|
23
|
+
- ${i}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(f,h){let p=at.resolve(f,h);if(yn.existsSync(p))return p;if(i.includes(at.extname(h)))return;let m=i.find(g=>yn.existsSync(`${p}${g}`));if(m)return`${p}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let f;try{f=yn.realpathSync(this._scriptPath)}catch{f=this._scriptPath}a=at.resolve(at.dirname(f),a)}if(a){let f=s(a,o);if(!f&&!e._executableFile&&this._scriptPath){let h=at.basename(this._scriptPath,at.extname(this._scriptPath));h!==this._name&&(f=s(a,`${h}-${e._name}`))}o=f||o}n=i.includes(at.extname(o));let l;J.platform!=="win32"?n?(r.unshift(o),r=ic(J.execArgv).concat(r),l=Fs.spawn(J.argv[0],r,{stdio:"inherit"})):l=Fs.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),r.unshift(o),r=ic(J.execArgv).concat(r),l=Fs.spawn(J.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{J.on(h,()=>{l.killed===!1&&l.exitCode===null&&l.kill(h)})});let c=this._exitCallback;l.on("close",f=>{f=f??1,c?c(new Bs(f,"commander.executeSubCommandAsync","(close)")):J.exit(f)}),l.on("error",f=>{if(f.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(f.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)J.exit(1);else{let h=new Bs(1,"commander.executeSubCommandAsync","(error)");h.nestedError=f,c(h)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,a)=>e(n,a,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,s=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;s.length;){let l=s.shift();if(l==="--"){i===n&&i.push(l),i.push(...s);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let c=this._findOption(l);if(c){if(c.required){let f=s.shift();f===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,f)}else if(c.optional){let f=null;s.length>0&&!o(s[0])&&(f=s.shift()),this.emit(`option:${c.name()}`,f)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let c=this._findOption(`-${l[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,l.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let c=l.indexOf("="),f=this._findOption(l.slice(0,c));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(c+1));continue}}if(o(l)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(l),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(l),s.length>0&&i.push(...s);break}i.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
24
24
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
25
25
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
26
|
-
`),this.outputHelp({error:!0}));let
|
|
27
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let
|
|
28
|
-
Expecting one of '${
|
|
29
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(
|
|
26
|
+
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in J.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,J.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ap(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),l=this.getOptionValue(a),c=this.options.find(h=>h.negate&&a===h.attributeName()),f=this.options.find(h=>!h.negate&&a===h.attributeName());return c&&(c.presetArg===void 0&&l===!1||c.presetArg!==void 0&&l===c.presetArg)?c:f||o},i=o=>{let a=n(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=nc(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=nc(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
27
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Cp(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=at.basename(e,at.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,s;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(J.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
28
|
+
Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
|
|
29
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ic(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],i=s[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Hs(){if(J.env.NO_COLOR||J.env.FORCE_COLOR==="0"||J.env.FORCE_COLOR==="false")return!1;if(J.env.FORCE_COLOR||J.env.CLICOLOR_FORCE!==void 0)return!0}$s.Command=qs;$s.useColor=Hs});var cc=H(Fe=>{var{Argument:oc}=gn(),{Command:js}=sc(),{CommanderError:Op,InvalidArgumentError:ac}=br(),{Help:Pp}=Is(),{Option:lc}=Ms();Fe.program=new js;Fe.createCommand=t=>new js(t);Fe.createOption=(t,e)=>new lc(t,e);Fe.createArgument=(t,e)=>new oc(t,e);Fe.Command=js;Fe.Option=lc;Fe.Argument=oc;Fe.Help=Pp;Fe.CommanderError=Op;Fe.InvalidArgumentError=ac;Fe.InvalidOptionArgumentError=ac});var ve=H(Ie=>{"use strict";Ie.__esModule=!0;Ie.extend=Xu;Ie.indexOf=ay;Ie.escapeExpression=ly;Ie.isEmpty=cy;Ie.createFrame=uy;Ie.blockParams=hy;Ie.appendContextPath=fy;var ny={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},iy=/[&<>"'`=]/g,sy=/[&<>"'`=]/;function oy(t){return ny[t]}function Xu(t){for(var e=1;e<arguments.length;e++)for(var r in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],r)&&(t[r]=arguments[e][r]);return t}var Bo=Object.prototype.toString;Ie.toString=Bo;var Fo=function(e){return typeof e=="function"};Fo(/x/)&&(Ie.isFunction=Fo=function(t){return typeof t=="function"&&Bo.call(t)==="[object Function]"});Ie.isFunction=Fo;var eh=Array.isArray||function(t){return t&&typeof t=="object"?Bo.call(t)==="[object Array]":!1};Ie.isArray=eh;function ay(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ly(t){if(typeof t!="string"){if(t&&typeof t.toHTML=="function")return t.toHTML();if(t==null)return"";if(!t)return t+"";t=""+t}return sy.test(t)?t.replace(iy,oy):t}function cy(t){return!t&&t!==0?!0:!!(eh(t)&&t.length===0)}function uy(t){var e=Xu({},t);return e._parent=t,e}function hy(t,e){return t.path=e,t}function fy(t,e){return(t?t+".":"")+e}});var He=H((ti,th)=>{"use strict";ti.__esModule=!0;var qo=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Ho(t,e){var r=e&&e.loc,n=void 0,i=void 0,s=void 0,o=void 0;r&&r.start&&(n=r.start.line,s=r.start.column,r.end&&(i=r.end.line,o=r.end.column),t+=" - "+n+":"+s);for(var a=Error.prototype.constructor.call(this,t),l=0;l<qo.length;l++)this[qo[l]]=a[qo[l]];Error.captureStackTrace&&Error.captureStackTrace(this,Ho);try{r&&(this.lineNumber=n,this.endLineNumber=i,Object.defineProperty?(Object.defineProperty(this,"column",{value:s,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:o,enumerable:!0})):(this.column=s,this.endColumn=o))}catch{}}Ho.prototype=new Error;ti.default=Ho;th.exports=ti.default});var nh=H((ri,rh)=>{"use strict";ri.__esModule=!0;var $o=ve();ri.default=function(t){t.registerHelper("blockHelperMissing",function(e,r){var n=r.inverse,i=r.fn;if(e===!0)return i(this);if(e===!1||e==null)return n(this);if($o.isArray(e))return e.length>0?(r.ids&&(r.ids=[r.name]),t.helpers.each(e,r)):n(this);if(r.data&&r.ids){var s=$o.createFrame(r.data);s.contextPath=$o.appendContextPath(r.data.contextPath,r.name),r={data:s}}return i(e,r)})};rh.exports=ri.default});var sh=H((ni,ih)=>{"use strict";ni.__esModule=!0;function dy(t){return t&&t.__esModule?t:{default:t}}var Kt=ve(),py=He(),my=dy(py);function gy(t){try{var e=t.return;Kt.isFunction(e)&&e.call(t)}catch{}}ni.default=function(t){t.registerHelper("each",function(e,r){if(!r)throw new my.default("Must pass iterator to #each");var n=r.fn,i=r.inverse,s=0,o="",a=void 0,l=void 0;r.data&&r.ids&&(l=Kt.appendContextPath(r.data.contextPath,r.ids[0])+"."),Kt.isFunction(e)&&(e=e.call(this)),r.data&&(a=Kt.createFrame(r.data));function c(g,_,O,b){a&&(a.key=g,a.index=_,a.first=_===0,a.last=!!O,l&&(a.contextPath=l+g)),o=o+n(b,{data:a,blockParams:Kt.blockParams([b,g],[l+g,null])})}if(e&&typeof e=="object")if(Kt.isArray(e))for(var f=e.length;s<f;s++)s in e&&c(s,s,s===e.length-1,e[s]);else if(typeof Symbol=="function"&&e[Symbol.iterator])for(var h=e[Symbol.iterator](),p=h.next();!p.done;){var m=h.next();try{c(s,s,m.done,p.value)}catch(g){throw m.done||gy(h),g}p=m,s++}else(function(){var g=void 0;Object.keys(e).forEach(function(_){g!==void 0&&c(g,s-1,!1,e[g]),g=_,s++}),g!==void 0&&c(g,s-1,!0,e[g])})();return s===0&&(o=i(this)),o})};ih.exports=ni.default});var ah=H((ii,oh)=>{"use strict";ii.__esModule=!0;function yy(t){return t&&t.__esModule?t:{default:t}}var _y=He(),by=yy(_y);ii.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new by.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};oh.exports=ii.default});var hh=H((si,uh)=>{"use strict";si.__esModule=!0;function wy(t){return t&&t.__esModule?t:{default:t}}var lh=ve(),vy=He(),ch=wy(vy);si.default=function(t){t.registerHelper("if",function(e,r){if(arguments.length!=2)throw new ch.default("#if requires exactly one argument");return lh.isFunction(e)&&(e=e.call(this)),!r.hash.includeZero&&!e||lh.isEmpty(e)?r.inverse(this):r.fn(this)}),t.registerHelper("unless",function(e,r){if(arguments.length!=2)throw new ch.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};uh.exports=si.default});var dh=H((oi,fh)=>{"use strict";oi.__esModule=!0;oi.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)e.push(arguments[n]);var i=1;r.hash.level!=null?i=r.hash.level:r.data&&r.data.level!=null&&(i=r.data.level),e[0]=i,t.log.apply(t,e)})};fh.exports=oi.default});var mh=H((ai,ph)=>{"use strict";ai.__esModule=!0;ai.default=function(t){t.registerHelper("lookup",function(e,r,n){return e&&n.lookupProperty(e,r)})};ph.exports=ai.default});var yh=H((li,gh)=>{"use strict";li.__esModule=!0;function Sy(t){return t&&t.__esModule?t:{default:t}}var qr=ve(),xy=He(),Cy=Sy(xy);li.default=function(t){t.registerHelper("with",function(e,r){if(arguments.length!=2)throw new Cy.default("#with requires exactly one argument");qr.isFunction(e)&&(e=e.call(this));var n=r.fn;if(qr.isEmpty(e))return r.inverse(this);var i=r.data;return r.data&&r.ids&&(i=qr.createFrame(r.data),i.contextPath=qr.appendContextPath(r.data.contextPath,r.ids[0])),n(e,{data:i,blockParams:qr.blockParams([e],[i&&i.contextPath])})})};gh.exports=li.default});var jo=H(ci=>{"use strict";ci.__esModule=!0;ci.registerDefaultHelpers=qy;ci.moveHelperToHooks=Hy;function Rt(t){return t&&t.__esModule?t:{default:t}}var ky=nh(),Ey=Rt(ky),Ay=sh(),Oy=Rt(Ay),Py=ah(),Ty=Rt(Py),Dy=hh(),Iy=Rt(Dy),Ry=dh(),Ly=Rt(Ry),Ny=mh(),My=Rt(Ny),Fy=yh(),By=Rt(Fy);function qy(t){Ey.default(t),Oy.default(t),Ty.default(t),Iy.default(t),Ly.default(t),My.default(t),By.default(t)}function Hy(t,e,r){t.helpers[e]&&(t.hooks[e]=t.helpers[e],r||(t.helpers[e]=void 0))}});var bh=H((ui,_h)=>{"use strict";ui.__esModule=!0;var $y=ve();ui.default=function(t){t.registerDecorator("inline",function(e,r,n,i){var s=e;return r.partials||(r.partials={},s=function(o,a){var l=n.partials;n.partials=$y.extend({},l,r.partials);var c=e(o,a);return n.partials=l,c}),r.partials[i.args[0]]=i.fn,s})};_h.exports=ui.default});var wh=H(Wo=>{"use strict";Wo.__esModule=!0;Wo.registerDefaultDecorators=zy;function jy(t){return t&&t.__esModule?t:{default:t}}var Wy=bh(),Vy=jy(Wy);function zy(t){Vy.default(t)}});var Vo=H((hi,vh)=>{"use strict";hi.__esModule=!0;var Uy=ve(),Jt={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var r=Uy.indexOf(Jt.methodMap,e.toLowerCase());r>=0?e=r:e=parseInt(e,10)}return e},log:function(e){if(e=Jt.lookupLevel(e),typeof console<"u"&&Jt.lookupLevel(Jt.level)<=e){var r=Jt.methodMap[e];console[r]||(r="log");for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];console[r].apply(console,i)}}};hi.default=Jt;vh.exports=hi.default});var zo=H(Qt=>{"use strict";Qt.__esModule=!0;Qt.createProtoAccessControl=Jy;Qt.resultIsAllowed=Qy;Qt.isPrototypeConstructor=Zy;Qt.resetLoggedProperties=e_;function Gy(t){return t&&t.__esModule?t:{default:t}}var Sh=ve(),Yy=Vo(),Ky=Gy(Yy),fi=Object.create(null);function Jy(t){var e=Object.create(null);e.__proto__=!1,Sh.extend(e,t.allowedProtoProperties);var r=Object.create(null);return r.constructor=!1,r.__defineGetter__=!1,r.__defineSetter__=!1,r.__lookupGetter__=!1,r.__lookupSetter__=!1,Sh.extend(r,t.allowedProtoMethods),{properties:{whitelist:e,defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:r,defaultValue:t.allowProtoMethodsByDefault}}}function Qy(t,e,r){return xh(typeof t=="function"?e.methods:e.properties,r)}function Zy(t,e,r){return e==="constructor"&&typeof r=="function"&&t===r.prototype}function xh(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(Xy(e),!1)}function Xy(t){fi[t]!==!0&&(fi[t]=!0,Ky.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent.
|
|
30
30
|
You can add a runtime option to disable the check or this warning:
|
|
31
|
-
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function
|
|
31
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function e_(){Object.keys(fi).forEach(function(t){delete fi[t]})}});var pi=H(rt=>{"use strict";rt.__esModule=!0;rt.HandlebarsEnvironment=Yo;function Ch(t){return t&&t.__esModule?t:{default:t}}var Lt=ve(),t_=He(),Uo=Ch(t_),r_=jo(),n_=wh(),i_=Vo(),di=Ch(i_),s_=zo(),o_="4.7.10";rt.VERSION=o_;var a_=8;rt.COMPILER_REVISION=a_;var l_=7;rt.LAST_COMPATIBLE_COMPILER_REVISION=l_;var c_={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"};rt.REVISION_CHANGES=c_;var Go="[object Object]";function Yo(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},r_.registerDefaultHelpers(this),n_.registerDefaultDecorators(this)}Yo.prototype={constructor:Yo,logger:di.default,log:di.default.log,registerHelper:function(e,r){if(Lt.toString.call(e)===Go){if(r)throw new Uo.default("Arg not supported with multiple helpers");Lt.extend(this.helpers,e)}else this.helpers[e]=r},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,r){if(Lt.toString.call(e)===Go)Lt.extend(this.partials,e);else{if(typeof r>"u")throw new Uo.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=r}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,r){if(Lt.toString.call(e)===Go){if(r)throw new Uo.default("Arg not supported with multiple decorators");Lt.extend(this.decorators,e)}else this.decorators[e]=r},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){s_.resetLoggedProperties()}};var u_=di.default.log;rt.log=u_;rt.createFrame=Lt.createFrame;rt.logger=di.default});var Eh=H((mi,kh)=>{"use strict";mi.__esModule=!0;function Ko(t){this.string=t}Ko.prototype.toString=Ko.prototype.toHTML=function(){return""+this.string};mi.default=Ko;kh.exports=mi.default});var Ah=H(Jo=>{"use strict";Jo.__esModule=!0;Jo.wrapHelper=h_;function h_(t,e){if(typeof t!="function")return t;var r=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)};return r}});var Ih=H(Ct=>{"use strict";Ct.__esModule=!0;Ct.checkRevision=y_;Ct.template=__;Ct.wrapProgram=gi;Ct.resolvePartial=b_;Ct.invokePartial=w_;Ct.noop=Th;function f_(t){return t&&t.__esModule?t:{default:t}}function d_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var p_=ve(),Nt=d_(p_),m_=He(),Ye=f_(m_),ht=pi(),Oh=jo(),g_=Ah(),Qo=zo();function y_(t){var e=t&&t[0]||1,r=ht.COMPILER_REVISION;if(!(e>=ht.LAST_COMPATIBLE_COMPILER_REVISION&&e<=ht.COMPILER_REVISION))if(e<ht.LAST_COMPATIBLE_COMPILER_REVISION){var n=ht.REVISION_CHANGES[r],i=ht.REVISION_CHANGES[e];throw new Ye.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+i+").")}else throw new Ye.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}function __(t,e){if(!e)throw new Ye.default("No environment passed to template");if(!t||!t.main)throw new Ye.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var r=t.compiler&&t.compiler[0]===7;function n(o,a,l){l.hash&&(a=Nt.extend({},a,l.hash),l.ids&&(l.ids[0]=!0)),o=e.VM.resolvePartial.call(this,o,a,l),l.hooks=this.hooks,l.protoAccessControl=this.protoAccessControl;var c=e.VM.invokePartial.call(this,o,a,l);if(c==null&&Nt.isFunction(o))throw new Ye.default("The partial "+l.name+" returned no output: partials must return a string");if(c==null&&e.compile){if(typeof o!="string")throw new Ye.default("The partial "+l.name+" could not be compiled: partials must be strings or functions returning strings");l.partials[l.name]=e.compile(o,t.compilerOptions,e),c=l.partials[l.name](a,l)}if(c!=null){if(l.indent){for(var f=c.split(`
|
|
32
32
|
`),h=0,p=f.length;h<p&&!(!f[h]&&h+1===p);h++)f[h]=l.indent+f[h];c=f.join(`
|
|
33
|
-
`)}return c}else throw new Ye.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")}var n={strict:function(a,l,c){if(!a||!(l in a))throw new Ye.default('"'+l+'" not defined in '+a,{loc:c});return n.lookupProperty(a,l)},lookupProperty:function(a,l){var c=a[l];if(c==null||Object.prototype.hasOwnProperty.call(a,l)&&!Jo.isPrototypeConstructor(a,l,c)||Jo.resultIsAllowed(c,n.protoAccessControl,l))return c},lookup:function(a,l){for(var c=a.length,f=0;f<c;f++){var h=a[f]&&n.lookupProperty(a[f],l);if(h!=null)return h}},lambda:function(a,l){return typeof a=="function"?a.call(l):a},escapeExpression:Nt.escapeExpression,invokePartial:i,fn:function(a){var l=t[a];return l.decorator=t[a+"_d"],l},programs:[],program:function(a,l,c,f,h){var p=this.programs[a],m=this.fn(a);return l||h||f||c?p=mn(this,a,m,l,c,f,h):p||(p=this.programs[a]=mn(this,a,m)),p},data:function(a,l){for(;a&&l--;)a=a._parent;return a},mergeIfNeeded:function(a,l){var c=a||l;return a&&l&&a!==l&&(c=Nt.extend({},l,a)),c},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function s(o){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],l=a.data;s._setup(a),!a.partial&&t.useData&&(l=y_(o,l));var c=void 0,f=t.useBlockParams?[]:void 0;t.useDepths&&(a.depths?c=o!=a.depths[0]?[o].concat(a.depths):a.depths:c=[o]);function h(p){return""+t.main(n,p,n.helpers,n.partials,l,f,c)}return h=Ah(t.main,h,n,a.depths||[],l,f),h(o,a)}return s.isTop=!0,s._setup=function(o){if(o.partial)n.protoAccessControl=o.protoAccessControl,n.helpers=o.helpers,n.partials=o.partials,n.decorators=o.decorators,n.hooks=o.hooks;else{var a={};kh(a,e.helpers,n),kh(a,o.helpers,n),n.helpers=a,t.usePartial&&(n.partials=n.mergeIfNeeded(o.partials,e.partials)),(t.usePartial||t.useDecorators)&&(n.decorators=Nt.extend({},e.decorators,o.decorators)),n.hooks={},n.protoAccessControl=Jo.createProtoAccessControl(o);var l=o.allowCallsToHelperMissing||r;Ch.moveHelperToHooks(n,"helperMissing",l),Ch.moveHelperToHooks(n,"blockHelperMissing",l)}},s._child=function(o,a,l,c){if(t.useBlockParams&&!l)throw new Ye.default("must pass block params");if(t.useDepths&&!c)throw new Ye.default("must pass parent depths");return mn(n,o,t[o],a,0,l,c)},s}function mn(t,e,r,i,n,s,o){function a(l){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],f=o;return o&&l!=o[0]&&!(l===t.nullContext&&o[0]===null)&&(f=[l].concat(o)),r(t,l,t.helpers,t.partials,c.data||i,s&&[c.blockParams].concat(s),f)}return a=Ah(r,a,t,o,i,s),a.program=e,a.depth=o?o.length:0,a.blockParams=n||0,a}function m_(t,e,r){return t?typeof t!="function"&&!r.name&&(r.name=t,t=gn(r.partials,t)):r.name==="@partial-block"?t=gn(r.data,"partial-block"):t=gn(r.partials,r.name),t}function g_(t,e,r){var i=gn(r.data,"partial-block");r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var n=void 0;if(r.fn&&r.fn!==Eh&&(function(){r.data=ht.createFrame(r.data);var s=r.fn;n=r.data["partial-block"]=function(a){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return l.data=ht.createFrame(l.data),l.data["partial-block"]=i,s(a,l)},s.partials&&(r.partials=Nt.extend({},r.partials,s.partials))})(),t===void 0&&n&&(t=n),t===void 0)throw new Ye.default("The partial "+r.name+" could not be found");if(t instanceof Function)return t(e,r)}function Eh(){return""}function gn(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e))return t[e]}function y_(t,e){return(!e||!("root"in e))&&(e=e?ht.createFrame(e):{},e.root=t),e}function Ah(t,e,r,i,n,s){if(t.decorator){var o={};e=t.decorator(e,o,r,i&&i[0],n,s,i),Nt.extend(e,o)}return e}function kh(t,e,r){e&&Object.keys(e).forEach(function(i){var n=e[i];t[i]=__(n,r)})}function __(t,e){var r=e.lookupProperty;return f_.wrapHelper(t,function(i){return i.lookupProperty=r,i})}});var Qo=H((yn,Ph)=>{"use strict";yn.__esModule=!0;yn.default=function(t){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}};Ph.exports=yn.default});var Lh=H((_n,Rh)=>{"use strict";_n.__esModule=!0;function Xo(t){return t&&t.__esModule?t:{default:t}}function ea(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var b_=dn(),Th=ea(b_),w_=Sh(),v_=Xo(w_),S_=He(),x_=Xo(S_),C_=ve(),Zo=ea(C_),k_=Oh(),Dh=ea(k_),E_=Qo(),A_=Xo(E_);function Ih(){var t=new Th.HandlebarsEnvironment;return Zo.extend(t,Th),t.SafeString=v_.default,t.Exception=x_.default,t.Utils=Zo,t.escapeExpression=Zo.escapeExpression,t.VM=Dh,t.template=function(e){return Dh.template(e,t)},t}var Hr=Ih();Hr.create=Ih;A_.default(Hr);Hr.default=Hr;_n.default=Hr;Rh.exports=_n.default});var ta=H((bn,Mh)=>{"use strict";bn.__esModule=!0;var Nh={helpers:{helperExpression:function(e){return e.type==="SubExpression"||(e.type==="MustacheStatement"||e.type==="BlockStatement")&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!Nh.helpers.scopedId(e)&&!e.depth}}};bn.default=Nh;Mh.exports=bn.default});var Bh=H((wn,Fh)=>{"use strict";wn.__esModule=!0;var O_=(function(){var t={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(n,s,o,a,l,c,f){var h=c.length-1;switch(l){case 1:return c[h-1];case 2:this.$=a.prepareProgram(c[h]);break;case 3:this.$=c[h];break;case 4:this.$=c[h];break;case 5:this.$=c[h];break;case 6:this.$=c[h];break;case 7:this.$=c[h];break;case 8:this.$=c[h];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(c[h]),strip:a.stripFlags(c[h],c[h]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:c[h],value:c[h],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(c[h-2],c[h-1],c[h],this._$);break;case 12:this.$={path:c[h-3],params:c[h-2],hash:c[h-1]};break;case 13:this.$=a.prepareBlock(c[h-3],c[h-2],c[h-1],c[h],!1,this._$);break;case 14:this.$=a.prepareBlock(c[h-3],c[h-2],c[h-1],c[h],!0,this._$);break;case 15:this.$={open:c[h-5],path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 16:this.$={path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 17:this.$={path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 18:this.$={strip:a.stripFlags(c[h-1],c[h-1]),program:c[h]};break;case 19:var p=a.prepareBlock(c[h-2],c[h-1],c[h],c[h],!1,this._$),m=a.prepareProgram([p],c[h-1].loc);m.chained=!0,this.$={strip:c[h-2].strip,program:m,chain:!0};break;case 20:this.$=c[h];break;case 21:this.$={path:c[h-1],strip:a.stripFlags(c[h-2],c[h])};break;case 22:this.$=a.prepareMustache(c[h-3],c[h-2],c[h-1],c[h-4],a.stripFlags(c[h-4],c[h]),this._$);break;case 23:this.$=a.prepareMustache(c[h-3],c[h-2],c[h-1],c[h-4],a.stripFlags(c[h-4],c[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:c[h-3],params:c[h-2],hash:c[h-1],indent:"",strip:a.stripFlags(c[h-4],c[h]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(c[h-2],c[h-1],c[h],this._$);break;case 26:this.$={path:c[h-3],params:c[h-2],hash:c[h-1],strip:a.stripFlags(c[h-4],c[h])};break;case 27:this.$=c[h];break;case 28:this.$=c[h];break;case 29:this.$={type:"SubExpression",path:c[h-3],params:c[h-2],hash:c[h-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:c[h],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(c[h-2]),value:c[h],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(c[h-1]);break;case 33:this.$=c[h];break;case 34:this.$=c[h];break;case 35:this.$={type:"StringLiteral",value:c[h],original:c[h],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(c[h]),original:Number(c[h]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:c[h]==="true",original:c[h]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=c[h];break;case 41:this.$=c[h];break;case 42:this.$=a.preparePath(!0,c[h],this._$);break;case 43:this.$=a.preparePath(!1,c[h],this._$);break;case 44:c[h-2].push({part:a.id(c[h]),original:c[h],separator:c[h-1]}),this.$=c[h-2];break;case 45:this.$=[{part:a.id(c[h]),original:c[h]}];break;case 46:this.$=[];break;case 47:c[h-1].push(c[h]);break;case 48:this.$=[];break;case 49:c[h-1].push(c[h]);break;case 50:this.$=[];break;case 51:c[h-1].push(c[h]);break;case 58:this.$=[];break;case 59:c[h-1].push(c[h]);break;case 64:this.$=[];break;case 65:c[h-1].push(c[h]);break;case 70:this.$=[];break;case 71:c[h-1].push(c[h]);break;case 78:this.$=[];break;case 79:c[h-1].push(c[h]);break;case 82:this.$=[];break;case 83:c[h-1].push(c[h]);break;case 86:this.$=[];break;case 87:c[h-1].push(c[h]);break;case 90:this.$=[];break;case 91:c[h-1].push(c[h]);break;case 94:this.$=[];break;case 95:c[h-1].push(c[h]);break;case 98:this.$=[c[h]];break;case 99:c[h-1].push(c[h]);break;case 100:this.$=[c[h]];break;case 101:c[h-1].push(c[h]);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(n,s){throw new Error(n)},parse:function(n){var s=this,o=[0],a=[null],l=[],c=this.table,f="",h=0,p=0,m=0,g=2,_=1;this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var O=this.lexer.yylloc;l.push(O);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function x(k){o.length=o.length-2*k,a.length=a.length-k,l.length=l.length-k}function I(){var k;return k=s.lexer.lex()||1,typeof k!="number"&&(k=s.symbols_[k]||k),k}for(var L,N,B,z,se,ae,X={},pe,ce,Oe,q;;){if(B=o[o.length-1],this.defaultActions[B]?z=this.defaultActions[B]:((L===null||typeof L>"u")&&(L=I()),z=c[B]&&c[B][L]),typeof z>"u"||!z.length||!z[0]){var Me="";if(!m){q=[];for(pe in c[B])this.terminals_[pe]&&pe>2&&q.push("'"+this.terminals_[pe]+"'");this.lexer.showPosition?Me="Parse error on line "+(h+1)+`:
|
|
33
|
+
`)}return c}else throw new Ye.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")}var i={strict:function(a,l,c){if(!a||!(l in a))throw new Ye.default('"'+l+'" not defined in '+a,{loc:c});return i.lookupProperty(a,l)},lookupProperty:function(a,l){var c=a[l];if(c==null||Object.prototype.hasOwnProperty.call(a,l)&&!Qo.isPrototypeConstructor(a,l,c)||Qo.resultIsAllowed(c,i.protoAccessControl,l))return c},lookup:function(a,l){for(var c=a.length,f=0;f<c;f++){var h=a[f]&&i.lookupProperty(a[f],l);if(h!=null)return h}},lambda:function(a,l){return typeof a=="function"?a.call(l):a},escapeExpression:Nt.escapeExpression,invokePartial:n,fn:function(a){var l=t[a];return l.decorator=t[a+"_d"],l},programs:[],program:function(a,l,c,f,h){var p=this.programs[a],m=this.fn(a);return l||h||f||c?p=gi(this,a,m,l,c,f,h):p||(p=this.programs[a]=gi(this,a,m)),p},data:function(a,l){for(;a&&l--;)a=a._parent;return a},mergeIfNeeded:function(a,l){var c=a||l;return a&&l&&a!==l&&(c=Nt.extend({},l,a)),c},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function s(o){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],l=a.data;s._setup(a),!a.partial&&t.useData&&(l=v_(o,l));var c=void 0,f=t.useBlockParams?[]:void 0;t.useDepths&&(a.depths?c=o!=a.depths[0]?[o].concat(a.depths):a.depths:c=[o]);function h(p){return""+t.main(i,p,i.helpers,i.partials,l,f,c)}return h=Dh(t.main,h,i,a.depths||[],l,f),h(o,a)}return s.isTop=!0,s._setup=function(o){if(o.partial)i.protoAccessControl=o.protoAccessControl,i.helpers=o.helpers,i.partials=o.partials,i.decorators=o.decorators,i.hooks=o.hooks;else{var a={};Ph(a,e.helpers,i),Ph(a,o.helpers,i),i.helpers=a,t.usePartial&&(i.partials=i.mergeIfNeeded(o.partials,e.partials)),(t.usePartial||t.useDecorators)&&(i.decorators=Nt.extend({},e.decorators,o.decorators)),i.hooks={},i.protoAccessControl=Qo.createProtoAccessControl(o);var l=o.allowCallsToHelperMissing||r;Oh.moveHelperToHooks(i,"helperMissing",l),Oh.moveHelperToHooks(i,"blockHelperMissing",l)}},s._child=function(o,a,l,c){if(t.useBlockParams&&!l)throw new Ye.default("must pass block params");if(t.useDepths&&!c)throw new Ye.default("must pass parent depths");return gi(i,o,t[o],a,0,l,c)},s}function gi(t,e,r,n,i,s,o){function a(l){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],f=o;return o&&l!=o[0]&&!(l===t.nullContext&&o[0]===null)&&(f=[l].concat(o)),r(t,l,t.helpers,t.partials,c.data||n,s&&[c.blockParams].concat(s),f)}return a=Dh(r,a,t,o,n,s),a.program=e,a.depth=o?o.length:0,a.blockParams=i||0,a}function b_(t,e,r){return t?typeof t!="function"&&!r.name&&(r.name=t,t=yi(r.partials,t)):r.name==="@partial-block"?t=yi(r.data,"partial-block"):t=yi(r.partials,r.name),t}function w_(t,e,r){var n=yi(r.data,"partial-block");r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var i=void 0;if(r.fn&&r.fn!==Th&&(function(){r.data=ht.createFrame(r.data);var s=r.fn;i=r.data["partial-block"]=function(a){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return l.data=ht.createFrame(l.data),l.data["partial-block"]=n,s(a,l)},s.partials&&(r.partials=Nt.extend({},r.partials,s.partials))})(),t===void 0&&i&&(t=i),t===void 0)throw new Ye.default("The partial "+r.name+" could not be found");if(t instanceof Function)return t(e,r)}function Th(){return""}function yi(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e))return t[e]}function v_(t,e){return(!e||!("root"in e))&&(e=e?ht.createFrame(e):{},e.root=t),e}function Dh(t,e,r,n,i,s){if(t.decorator){var o={};e=t.decorator(e,o,r,n&&n[0],i,s,n),Nt.extend(e,o)}return e}function Ph(t,e,r){e&&Object.keys(e).forEach(function(n){var i=e[n];t[n]=S_(i,r)})}function S_(t,e){var r=e.lookupProperty;return g_.wrapHelper(t,function(n){return n.lookupProperty=r,n})}});var Zo=H((_i,Rh)=>{"use strict";_i.__esModule=!0;_i.default=function(t){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}};Rh.exports=_i.default});var Bh=H((bi,Fh)=>{"use strict";bi.__esModule=!0;function ea(t){return t&&t.__esModule?t:{default:t}}function ta(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var x_=pi(),Lh=ta(x_),C_=Eh(),k_=ea(C_),E_=He(),A_=ea(E_),O_=ve(),Xo=ta(O_),P_=Ih(),Nh=ta(P_),T_=Zo(),D_=ea(T_);function Mh(){var t=new Lh.HandlebarsEnvironment;return Xo.extend(t,Lh),t.SafeString=k_.default,t.Exception=A_.default,t.Utils=Xo,t.escapeExpression=Xo.escapeExpression,t.VM=Nh,t.template=function(e){return Nh.template(e,t)},t}var Hr=Mh();Hr.create=Mh;D_.default(Hr);Hr.default=Hr;bi.default=Hr;Fh.exports=bi.default});var ra=H((wi,Hh)=>{"use strict";wi.__esModule=!0;var qh={helpers:{helperExpression:function(e){return e.type==="SubExpression"||(e.type==="MustacheStatement"||e.type==="BlockStatement")&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!qh.helpers.scopedId(e)&&!e.depth}}};wi.default=qh;Hh.exports=wi.default});var jh=H((vi,$h)=>{"use strict";vi.__esModule=!0;var I_=(function(){var t={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(i,s,o,a,l,c,f){var h=c.length-1;switch(l){case 1:return c[h-1];case 2:this.$=a.prepareProgram(c[h]);break;case 3:this.$=c[h];break;case 4:this.$=c[h];break;case 5:this.$=c[h];break;case 6:this.$=c[h];break;case 7:this.$=c[h];break;case 8:this.$=c[h];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(c[h]),strip:a.stripFlags(c[h],c[h]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:c[h],value:c[h],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(c[h-2],c[h-1],c[h],this._$);break;case 12:this.$={path:c[h-3],params:c[h-2],hash:c[h-1]};break;case 13:this.$=a.prepareBlock(c[h-3],c[h-2],c[h-1],c[h],!1,this._$);break;case 14:this.$=a.prepareBlock(c[h-3],c[h-2],c[h-1],c[h],!0,this._$);break;case 15:this.$={open:c[h-5],path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 16:this.$={path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 17:this.$={path:c[h-4],params:c[h-3],hash:c[h-2],blockParams:c[h-1],strip:a.stripFlags(c[h-5],c[h])};break;case 18:this.$={strip:a.stripFlags(c[h-1],c[h-1]),program:c[h]};break;case 19:var p=a.prepareBlock(c[h-2],c[h-1],c[h],c[h],!1,this._$),m=a.prepareProgram([p],c[h-1].loc);m.chained=!0,this.$={strip:c[h-2].strip,program:m,chain:!0};break;case 20:this.$=c[h];break;case 21:this.$={path:c[h-1],strip:a.stripFlags(c[h-2],c[h])};break;case 22:this.$=a.prepareMustache(c[h-3],c[h-2],c[h-1],c[h-4],a.stripFlags(c[h-4],c[h]),this._$);break;case 23:this.$=a.prepareMustache(c[h-3],c[h-2],c[h-1],c[h-4],a.stripFlags(c[h-4],c[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:c[h-3],params:c[h-2],hash:c[h-1],indent:"",strip:a.stripFlags(c[h-4],c[h]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(c[h-2],c[h-1],c[h],this._$);break;case 26:this.$={path:c[h-3],params:c[h-2],hash:c[h-1],strip:a.stripFlags(c[h-4],c[h])};break;case 27:this.$=c[h];break;case 28:this.$=c[h];break;case 29:this.$={type:"SubExpression",path:c[h-3],params:c[h-2],hash:c[h-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:c[h],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(c[h-2]),value:c[h],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(c[h-1]);break;case 33:this.$=c[h];break;case 34:this.$=c[h];break;case 35:this.$={type:"StringLiteral",value:c[h],original:c[h],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(c[h]),original:Number(c[h]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:c[h]==="true",original:c[h]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=c[h];break;case 41:this.$=c[h];break;case 42:this.$=a.preparePath(!0,c[h],this._$);break;case 43:this.$=a.preparePath(!1,c[h],this._$);break;case 44:c[h-2].push({part:a.id(c[h]),original:c[h],separator:c[h-1]}),this.$=c[h-2];break;case 45:this.$=[{part:a.id(c[h]),original:c[h]}];break;case 46:this.$=[];break;case 47:c[h-1].push(c[h]);break;case 48:this.$=[];break;case 49:c[h-1].push(c[h]);break;case 50:this.$=[];break;case 51:c[h-1].push(c[h]);break;case 58:this.$=[];break;case 59:c[h-1].push(c[h]);break;case 64:this.$=[];break;case 65:c[h-1].push(c[h]);break;case 70:this.$=[];break;case 71:c[h-1].push(c[h]);break;case 78:this.$=[];break;case 79:c[h-1].push(c[h]);break;case 82:this.$=[];break;case 83:c[h-1].push(c[h]);break;case 86:this.$=[];break;case 87:c[h-1].push(c[h]);break;case 90:this.$=[];break;case 91:c[h-1].push(c[h]);break;case 94:this.$=[];break;case 95:c[h-1].push(c[h]);break;case 98:this.$=[c[h]];break;case 99:c[h-1].push(c[h]);break;case 100:this.$=[c[h]];break;case 101:c[h-1].push(c[h]);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(i,s){throw new Error(i)},parse:function(i){var s=this,o=[0],a=[null],l=[],c=this.table,f="",h=0,p=0,m=0,g=2,_=1;this.lexer.setInput(i),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var O=this.lexer.yylloc;l.push(O);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function x(k){o.length=o.length-2*k,a.length=a.length-k,l.length=l.length-k}function I(){var k;return k=s.lexer.lex()||1,typeof k!="number"&&(k=s.symbols_[k]||k),k}for(var L,N,V,B,Q,ee,oe={},ae,pe,xe,q;;){if(V=o[o.length-1],this.defaultActions[V]?B=this.defaultActions[V]:((L===null||typeof L>"u")&&(L=I()),B=c[V]&&c[V][L]),typeof B>"u"||!B.length||!B[0]){var Me="";if(!m){q=[];for(ae in c[V])this.terminals_[ae]&&ae>2&&q.push("'"+this.terminals_[ae]+"'");this.lexer.showPosition?Me="Parse error on line "+(h+1)+`:
|
|
34
34
|
`+this.lexer.showPosition()+`
|
|
35
|
-
Expecting `+q.join(", ")+", got '"+(this.terminals_[L]||L)+"'":Me="Parse error on line "+(h+1)+": Unexpected "+(L==1?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(Me,{text:this.lexer.match,token:this.terminals_[L]||L,line:this.lexer.yylineno,loc:O,expected:q})}}if(
|
|
35
|
+
Expecting `+q.join(", ")+", got '"+(this.terminals_[L]||L)+"'":Me="Parse error on line "+(h+1)+": Unexpected "+(L==1?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(Me,{text:this.lexer.match,token:this.terminals_[L]||L,line:this.lexer.yylineno,loc:O,expected:q})}}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+L);switch(B[0]){case 1:o.push(L),a.push(this.lexer.yytext),l.push(this.lexer.yylloc),o.push(B[1]),L=null,N?(L=N,N=null):(p=this.lexer.yyleng,f=this.lexer.yytext,h=this.lexer.yylineno,O=this.lexer.yylloc,m>0&&m--);break;case 2:if(pe=this.productions_[B[1]][1],oe.$=a[a.length-pe],oe._$={first_line:l[l.length-(pe||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(pe||1)].first_column,last_column:l[l.length-1].last_column},b&&(oe._$.range=[l[l.length-(pe||1)].range[0],l[l.length-1].range[1]]),ee=this.performAction.call(oe,f,p,h,this.yy,B[1],a,l),typeof ee<"u")return ee;pe&&(o=o.slice(0,-1*pe*2),a=a.slice(0,-1*pe),l=l.slice(0,-1*pe)),o.push(this.productions_[B[1]][0]),a.push(oe.$),l.push(oe._$),xe=c[o[o.length-2]][o[o.length-1]],o.push(xe);break;case 3:return!0}}return!0}},e=(function(){var n={EOF:1,parseError:function(s,o){if(this.yy.parser)this.yy.parser.parseError(s,o);else throw new Error(s)},setInput:function(s){return this._input=s,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]),this.offset=0,this},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var o=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o-1),this.offset-=o;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var c=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===l.length?this.yylloc.first_column:0)+l[l.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-o]),this},more:function(){return this._more=!0,this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
36
36
|
`+o+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,o,a,l,c,f;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),p=0;p<h.length&&(a=this._input.match(this.rules[h[p]]),!(a&&(!o||a[0].length>o[0].length)&&(o=a,l=p,!this.options.flex)));p++);return o?(f=o[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],s=this.performAction.call(this,this.yy,this,h[l],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
37
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return typeof s<"u"?s:this.lex()},begin:function(s){this.conditionStack.push(s)},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(s){this.begin(s)}};return i.options={},i.performAction=function(s,o,a,l){function c(h,p){return o.yytext=o.yytext.substring(h,o.yyleng-p+h)}var f=l;switch(a){case 0:if(o.yytext.slice(-2)==="\\\\"?(c(0,1),this.begin("mu")):o.yytext.slice(-1)==="\\"?(c(0,1),this.begin("emu")):this.begin("mu"),o.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:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(c(5,9),"END_RAW_BLOCK");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(o.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 o.yytext=c(1,2).replace(/\\"/g,'"'),80;break;case 32:return o.yytext=c(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 o.yytext=o.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},i.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\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],i.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}},i})();t.lexer=e;function r(){this.yy={}}return r.prototype=t,t.Parser=r,new r})();wn.default=O_;Fh.exports=wn.default});var ia=H(ra=>{"use strict";ra.__esModule=!0;var P_=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];ra.NODE_TYPES=P_});var Cn=H((xn,jh)=>{"use strict";xn.__esModule=!0;function T_(t){return t&&t.__esModule?t:{default:t}}var D_=He(),na=T_(D_),I_=ve(),R_=ia();function Sn(){this.parents=[]}function qh(t,e){return I_.indexOf(R_.NODE_TYPES,e)!==-1||!(e in Sn.prototype)&&typeof t[e]=="function"}Sn.prototype={constructor:Sn,mutating:!1,acceptKey:function(e,r){var i=this.accept(e[r]);if(this.mutating){if(i&&!qh(this,i.type))throw new na.default('Unexpected node type "'+i.type+'" found when accepting '+r+" on "+e.type);e[r]=i}},acceptRequired:function(e,r){if(this.acceptKey(e,r),!e[r])throw new na.default(e.type+" requires "+r)},acceptArray:function(e){for(var r=0,i=e.length;r<i;r++)this.acceptKey(e,r),e[r]||(e.splice(r,1),r--,i--)},accept:function(e){if(e){if(!qh(this,e.type)||!this[e.type])throw new na.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var r=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return e}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:vn,Decorator:vn,BlockStatement:Hh,DecoratorBlock:Hh,PartialStatement:$h,PartialBlockStatement:function(e){$h.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:vn,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}};function vn(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function Hh(t){vn.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function $h(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}xn.default=Sn;jh.exports=xn.default});var Vh=H((kn,Wh)=>{"use strict";kn.__esModule=!0;function L_(t){return t&&t.__esModule?t:{default:t}}var N_=Cn(),M_=L_(N_);function it(){var t=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=t}it.prototype=new M_.default;it.prototype.Program=function(t){var e=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var i=t.body,n=0,s=i.length;n<s;n++){var o=i[n],a=this.accept(o);if(a){var l=sa(i,n,r),c=oa(i,n,r),f=a.openStandalone&&l,h=a.closeStandalone&&c,p=a.inlineStandalone&&l&&c;a.close&&Mt(i,n,!0),a.open&&kt(i,n,!0),e&&p&&(Mt(i,n),kt(i,n)&&o.type==="PartialStatement"&&(o.indent=/(?:^|[^ \t])([ \t]+)$/.exec(i[n-1].original)[1])),e&&f&&(Mt((o.program||o.inverse).body),kt(i,n)),e&&h&&(Mt(i,n),kt((o.inverse||o.program).body))}}return t};it.prototype.BlockStatement=it.prototype.DecoratorBlock=it.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,r=t.program&&t.inverse,i=r,n=r;if(r&&r.chained)for(i=r.body[0].program;n.chained;)n=n.body[n.body.length-1].program;var s={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:oa(e.body),closeStandalone:sa((i||e).body)};if(t.openStrip.close&&Mt(e.body,null,!0),r){var o=t.inverseStrip;o.open&&kt(e.body,null,!0),o.close&&Mt(i.body,null,!0),t.closeStrip.open&&kt(n.body,null,!0),!this.options.ignoreStandalone&&sa(e.body)&&oa(i.body)&&(kt(e.body),Mt(i.body))}else t.closeStrip.open&&kt(e.body,null,!0);return s};it.prototype.Decorator=it.prototype.MustacheStatement=function(t){return t.strip};it.prototype.PartialStatement=it.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}};function sa(t,e,r){e===void 0&&(e=t.length);var i=t[e-1],n=t[e-2];if(!i)return r;if(i.type==="ContentStatement")return(n||!r?/(?:^|\S)[^\S\n]*\n\s*$/:/^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(i.original)}function oa(t,e,r){e===void 0&&(e=-1);var i=t[e+1],n=t[e+2];if(!i)return r;if(i.type==="ContentStatement")return(n||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(i.original)}function Mt(t,e,r){var i=t[e==null?0:e+1];if(!(!i||i.type!=="ContentStatement"||!r&&i.rightStripped)){var n=i.value;i.value=i.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),i.rightStripped=i.value!==n}}function kt(t,e,r){var i=t[e==null?t.length-1:e-1];if(!(!i||i.type!=="ContentStatement"||!r&&i.leftStripped)){var n=i.value;return i.value=i.value.replace(r?/(^|\S)\s+$/:/(^|[^ \t])[ \t]+$/,"$1"),i.leftStripped=i.value!==n,i.leftStripped}}kn.default=it;Wh.exports=kn.default});var zh=H($e=>{"use strict";$e.__esModule=!0;$e.SourceLocation=q_;$e.id=H_;$e.stripFlags=$_;$e.stripComment=j_;$e.preparePath=W_;$e.prepareMustache=V_;$e.prepareRawBlock=z_;$e.prepareBlock=U_;$e.prepareProgram=G_;$e.preparePartialBlock=Y_;function F_(t){return t&&t.__esModule?t:{default:t}}var B_=He(),aa=F_(B_);function la(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var r={loc:t.path.loc};throw new aa.default(t.path.original+" doesn't match "+e,r)}}function q_(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function H_(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t}function $_(t,e){return{open:t.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function j_(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function W_(t,e,r){r=this.locInfo(r);for(var i=t?"@":"",n=[],s=0,o=0,a=e.length;o<a;o++){var l=e[o].part,c=e[o].original!==l;if(i+=(e[o].separator||"")+l,!c&&(l===".."||l==="."||l==="this")){if(n.length>0)throw new aa.default("Invalid path: "+i,{loc:r});l===".."&&s++}else n.push(l)}return{type:"PathExpression",data:t,depth:s,parts:n,original:i,loc:r}}function V_(t,e,r,i,n,s){var o=i.charAt(3)||i.charAt(2),a=o!=="{"&&o!=="&",l=/\*/.test(i);return{type:l?"Decorator":"MustacheStatement",path:t,params:e,hash:r,escaped:a,strip:n,loc:this.locInfo(s)}}function z_(t,e,r,i){la(t,r),i=this.locInfo(i);var n={type:"Program",body:e,strip:{},loc:i};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:i}}function U_(t,e,r,i,n,s){i&&i.path&&la(t,i);var o=/\*/.test(t.open);e.blockParams=t.blockParams;var a=void 0,l=void 0;if(r){if(o)throw new aa.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=i.strip),l=r.strip,a=r.program}return n&&(n=a,a=e,e=n),{type:o?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:a,openStrip:t.strip,inverseStrip:l,closeStrip:i&&i.strip,loc:this.locInfo(s)}}function G_(t,e){if(!e&&t.length){var r=t[0].loc,i=t[t.length-1].loc;r&&i&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:i.end.line,column:i.end.column}})}return{type:"Program",body:t,strip:{},loc:e}}function Y_(t,e,r,i){return la(t,r),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:r&&r.strip,loc:this.locInfo(i)}}});var Yh=H($r=>{"use strict";$r.__esModule=!0;$r.parseWithoutProcessing=Gh;$r.parse=rb;function K_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Uh(t){return t&&t.__esModule?t:{default:t}}var J_=Bh(),ca=Uh(J_),Q_=Vh(),Z_=Uh(Q_),X_=zh(),eb=K_(X_),tb=ve();$r.parser=ca.default;var En={};tb.extend(En,eb);function Gh(t,e){if(t.type==="Program")return t;ca.default.yy=En,En.locInfo=function(i){return new En.SourceLocation(e&&e.srcName,i)};var r=ca.default.parse(t);return r}function rb(t,e){var r=Gh(t,e),i=new Z_.default(e);return i.accept(r)}});var Xh=H(Wr=>{"use strict";Wr.__esModule=!0;Wr.Compiler=fa;Wr.precompile=ab;Wr.compile=lb;function Jh(t){return t&&t.__esModule?t:{default:t}}var ib=He(),Zt=Jh(ib),Et=ve(),nb=ta(),jr=Jh(nb),sb=ia(),ob=[].slice;function fa(){}fa.prototype={compiler:fa,equals:function(e){var r=this.opcodes.length;if(e.opcodes.length!==r)return!1;for(var i=0;i<r;i++){var n=this.opcodes[i],s=e.opcodes[i];if(n.opcode!==s.opcode||!Zh(n.args,s.args))return!1}r=this.children.length;for(var i=0;i<r;i++)if(!this.children[i].equals(e.children[i]))return!1;return!0},guid:0,compile:function(e,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Et.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(e)},compileProgram:function(e){var r=new this.compiler,i=r.compile(e,this.options),n=this.guid++;return this.usePartial=this.usePartial||i.usePartial,this.children[n]=i,this.useDepths=this.useDepths||i.useDepths,n},accept:function(e){if(Et.indexOf(sb.NODE_TYPES,e.type)===-1||!this[e.type])throw new Zt.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var r=this[e.type](e);return this.sourceNode.shift(),r},Program:function(e){cb(e),this.options.blockParams.unshift(e.blockParams);for(var r=e.body,i=r.length,n=0;n<i;n++)this.accept(r[n]);return this.options.blockParams.shift(),this.isSimple=i===1,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){Kh(e);var r=e.program,i=e.inverse;r=r&&this.compileProgram(r),i=i&&this.compileProgram(i);var n=this.classifySexpr(e);n==="helper"?this.helperSexpr(e,r,i):n==="simple"?(this.simpleSexpr(e),this.opcode("pushProgram",r),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,r,i),this.opcode("pushProgram",r),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var r=e.program&&this.compileProgram(e.program),i=this.setupFullMustacheParams(e,r,void 0),n=e.path;this.useDecorators=!0,this.opcode("registerDecorator",i.length,n.original)},PartialStatement:function(e){this.usePartial=!0;var r=e.program;r&&(r=this.compileProgram(e.program));var i=e.params;if(i.length>1)throw new Zt.default("Unsupported number of partial arguments: "+i.length,e);i.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):i.push({type:"PathExpression",parts:[],depth:0}));var n=e.name.original,s=e.name.type==="SubExpression";s&&this.accept(e.name),this.setupFullMustacheParams(e,r,void 0,!0);var o=e.indent||"";this.options.preventIndent&&o&&(this.opcode("appendContent",o),o=""),this.opcode("invokePartial",s,n,o),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){if(e.value!=null&&typeof e.value!="string")throw ft(e,"value must be a string");e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){Kh(e);var r=this.classifySexpr(e);r==="simple"?this.simpleSexpr(e):r==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,r,i){var n=e.path,s=n.parts[0],o=r!=null||i!=null;this.opcode("getContext",ua(n)),this.opcode("pushProgram",r),this.opcode("pushProgram",i),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",s,o)},simpleSexpr:function(e){var r=e.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,r,i){var n=this.setupFullMustacheParams(e,r,i),s=e.path,o=s.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new Zt.default("You specified knownHelpersOnly, but used the unknown helper "+o,e);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",n.length,s.original,jr.default.helpers.simpleId(s))}},PathExpression:function(e){var r=ua(e),i=ha(e);this.addDepth(r),this.opcode("getContext",r);var n=i[0],s=jr.default.helpers.scopedId(e),o=!r&&!s&&this.blockParamIndex(n);o?this.opcode("lookupBlockParam",o,i):n?e.data?(this.options.data=!0,this.opcode("lookupData",r,i,e.strict)):this.opcode("lookupOnContext",i,e.falsy,e.strict,s):this.opcode("pushContext")},StringLiteral:function(e){An(e),this.opcode("pushString",e.value)},NumberLiteral:function(e){An(e),this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){An(e),this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var r=e.pairs,i=0,n=void 0;if(!Et.isArray(r))throw ft(e,"pairs must be an array");n=r.length;for(var s=0;s<n;s++)if(!r[s]||typeof r[s].key!="string")throw ft(e,"pair keys must be strings");for(this.opcode("pushHash");i<n;i++)this.pushParam(r[i].value);for(;i--;)this.opcode("assignToHash",r[i].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:ob.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){ha(e.path);var r=jr.default.helpers.simpleId(e.path),i=r&&!!this.blockParamIndex(e.path.parts[0]),n=!i&&jr.default.helpers.helperExpression(e),s=!i&&(n||r);if(s&&!n){var o=e.path.parts[0],a=this.options;a.knownHelpers[o]?n=!0:a.knownHelpersOnly&&(s=!1)}return n?"helper":s?"ambiguous":"simple"},pushParams:function(e){for(var r=0,i=e.length;r<i;r++)this.pushParam(e[r])},pushParam:function(e){An(e);var r=e.value!=null?e.value:e.original||"",i=ua(e);if(this.stringParams)typeof r!="number"&&typeof r!="boolean"&&(r=String(r)),r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),i&&this.addDepth(i),this.opcode("getContext",i),this.opcode("pushStringParam",r,e.type),e.type==="SubExpression"&&this.accept(e);else{if(this.trackIds){var n=void 0;if(e.parts&&!jr.default.helpers.scopedId(e)&&!i&&(n=this.blockParamIndex(ha(e)[0])),n){var s=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,s)}else r=e.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,r)}this.accept(e)}},setupFullMustacheParams:function(e,r,i,n){var s=e.params;return this.pushParams(s),this.opcode("pushProgram",r),this.opcode("pushProgram",i),e.hash?this.accept(e.hash):this.opcode("emptyHash",n),s},blockParamIndex:function(e){for(var r=0,i=this.options.blockParams.length;r<i;r++){var n=this.options.blockParams[r],s=n&&Et.indexOf(n,e);if(n&&s>=0)return[r,s]}}};function ab(t,e,r){if(t==null||typeof t!="string"&&t.type!=="Program")throw new Zt.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var i=r.parse(t,e),n=new r.Compiler().compile(i,e);return new r.JavaScriptCompiler().compile(n,e)}function lb(t,e,r){if(e===void 0&&(e={}),t==null||typeof t!="string"&&t.type!=="Program")throw new Zt.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);e=Et.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var i=void 0;function n(){var o=r.parse(t,e),a=new r.Compiler().compile(o,e),l=new r.JavaScriptCompiler().compile(a,e,void 0,!0);return r.template(l)}function s(o,a){return i||(i=n()),i.call(this,o,a)}return s._setup=function(o){return i||(i=n()),i._setup(o)},s._child=function(o,a,l,c){return i||(i=n()),i._child(o,a,l,c)},s}function ft(t,e){return new Zt.default("Invalid AST: "+t.type+" "+e,t)}function ua(t){var e=t.depth;if(e==null)return 0;if(typeof e!="number"||!isFinite(e)||Math.floor(e)!==e||e<0)throw ft(t,"depth must be a non-negative integer");return e}function An(t){var e=t.value;if(t.type==="StringLiteral"&&typeof e!="string")throw ft(t,"value must be a string");if(t.type==="NumberLiteral"&&typeof e!="number")throw ft(t,"value must be a number");if(t.type==="BooleanLiteral"&&typeof e!="boolean")throw ft(t,"value must be a boolean")}function Qh(t,e,r){if(!Et.isArray(e))throw ft(t,r+" must be an array");for(var i=0;i<e.length;i++)if(typeof e[i]!="string")throw ft(t,r+" must only contain strings");return e}function ha(t){return Qh(t,t.parts,"parts")}function cb(t){t.blockParams!=null&&Qh(t,t.blockParams,"blockParams")}function Zh(t,e){if(t===e)return!0;if(Et.isArray(t)&&Et.isArray(e)&&t.length===e.length){for(var r=0;r<t.length;r++)if(!Zh(t[r],e[r]))return!1;return!0}}function Kh(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}});var tf=H(da=>{var ef="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");da.encode=function(t){if(0<=t&&t<ef.length)return ef[t];throw new TypeError("Must be between 0 and 63: "+t)};da.decode=function(t){var e=65,r=90,i=97,n=122,s=48,o=57,a=43,l=47,c=26,f=52;return e<=t&&t<=r?t-e:i<=t&&t<=n?t-i+c:s<=t&&t<=o?t-s+f:t==a?62:t==l?63:-1}});var ga=H(ma=>{var rf=tf(),pa=5,nf=1<<pa,sf=nf-1,of=nf;function ub(t){return t<0?(-t<<1)+1:(t<<1)+0}function hb(t){var e=(t&1)===1,r=t>>1;return e?-r:r}ma.encode=function(e){var r="",i,n=ub(e);do i=n&sf,n>>>=pa,n>0&&(i|=of),r+=rf.encode(i);while(n>0);return r};ma.decode=function(e,r,i){var n=e.length,s=0,o=0,a,l;do{if(r>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(l=rf.decode(e.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(l&of),l&=sf,s=s+(l<<o),o+=pa}while(a);i.value=hb(s),i.rest=r}});var tr=H(Se=>{function fb(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Se.getArg=fb;var af=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,db=/^data:.+\,.+$/;function Vr(t){var e=t.match(af);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Se.urlParse=Vr;function Xt(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Se.urlGenerate=Xt;function ya(t){var e=t,r=Vr(t);if(r){if(!r.path)return t;e=r.path}for(var i=Se.isAbsolute(e),n=e.split(/\/+/),s,o=0,a=n.length-1;a>=0;a--)s=n[a],s==="."?n.splice(a,1):s===".."?o++:o>0&&(s===""?(n.splice(a+1,o),o=0):(n.splice(a,2),o--));return e=n.join("/"),e===""&&(e=i?"/":"."),r?(r.path=e,Xt(r)):e}Se.normalize=ya;function lf(t,e){t===""&&(t="."),e===""&&(e=".");var r=Vr(e),i=Vr(t);if(i&&(t=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),Xt(r);if(r||e.match(db))return e;if(i&&!i.host&&!i.path)return i.host=e,Xt(i);var n=e.charAt(0)==="/"?e:ya(t.replace(/\/+$/,"")+"/"+e);return i?(i.path=n,Xt(i)):n}Se.join=lf;Se.isAbsolute=function(t){return t.charAt(0)==="/"||af.test(t)};function pb(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var i=t.lastIndexOf("/");if(i<0||(t=t.slice(0,i),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Se.relative=pb;var cf=(function(){var t=Object.create(null);return!("__proto__"in t)})();function uf(t){return t}function mb(t){return hf(t)?"$"+t:t}Se.toSetString=cf?uf:mb;function gb(t){return hf(t)?t.slice(1):t}Se.fromSetString=cf?uf:gb;function hf(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function yb(t,e,r){var i=er(t.source,e.source);return i!==0||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0||r)||(i=t.generatedColumn-e.generatedColumn,i!==0)||(i=t.generatedLine-e.generatedLine,i!==0)?i:er(t.name,e.name)}Se.compareByOriginalPositions=yb;function _b(t,e,r){var i=t.generatedLine-e.generatedLine;return i!==0||(i=t.generatedColumn-e.generatedColumn,i!==0||r)||(i=er(t.source,e.source),i!==0)||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0)?i:er(t.name,e.name)}Se.compareByGeneratedPositionsDeflated=_b;function er(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function bb(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=er(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:er(t.name,e.name)}Se.compareByGeneratedPositionsInflated=bb;function wb(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Se.parseSourceMapInput=wb;function vb(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var i=Vr(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}e=lf(Xt(i),e)}return ya(e)}Se.computeSourceURL=vb});var wa=H(ff=>{var _a=tr(),ba=Object.prototype.hasOwnProperty,Ft=typeof Map<"u";function dt(){this._array=[],this._set=Ft?new Map:Object.create(null)}dt.fromArray=function(e,r){for(var i=new dt,n=0,s=e.length;n<s;n++)i.add(e[n],r);return i};dt.prototype.size=function(){return Ft?this._set.size:Object.getOwnPropertyNames(this._set).length};dt.prototype.add=function(e,r){var i=Ft?e:_a.toSetString(e),n=Ft?this.has(e):ba.call(this._set,i),s=this._array.length;(!n||r)&&this._array.push(e),n||(Ft?this._set.set(e,s):this._set[i]=s)};dt.prototype.has=function(e){if(Ft)return this._set.has(e);var r=_a.toSetString(e);return ba.call(this._set,r)};dt.prototype.indexOf=function(e){if(Ft){var r=this._set.get(e);if(r>=0)return r}else{var i=_a.toSetString(e);if(ba.call(this._set,i))return this._set[i]}throw new Error('"'+e+'" is not in the set.')};dt.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};dt.prototype.toArray=function(){return this._array.slice()};ff.ArraySet=dt});var mf=H(pf=>{var df=tr();function Sb(t,e){var r=t.generatedLine,i=e.generatedLine,n=t.generatedColumn,s=e.generatedColumn;return i>r||i==r&&s>=n||df.compareByGeneratedPositionsInflated(t,e)<=0}function On(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}On.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};On.prototype.add=function(e){Sb(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};On.prototype.toArray=function(){return this._sorted||(this._array.sort(df.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};pf.MappingList=On});var va=H(gf=>{var zr=ga(),le=tr(),Pn=wa().ArraySet,xb=mf().MappingList;function je(t){t||(t={}),this._file=le.getArg(t,"file",null),this._sourceRoot=le.getArg(t,"sourceRoot",null),this._skipValidation=le.getArg(t,"skipValidation",!1),this._sources=new Pn,this._names=new Pn,this._mappings=new xb,this._sourcesContents=null}je.prototype._version=3;je.fromSourceMap=function(e){var r=e.sourceRoot,i=new je({file:e.file,sourceRoot:r});return e.eachMapping(function(n){var s={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(s.source=n.source,r!=null&&(s.source=le.relative(r,s.source)),s.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(s.name=n.name)),i.addMapping(s)}),e.sources.forEach(function(n){var s=n;r!==null&&(s=le.relative(r,n)),i._sources.has(s)||i._sources.add(s);var o=e.sourceContentFor(n);o!=null&&i.setSourceContent(n,o)}),i};je.prototype.addMapping=function(e){var r=le.getArg(e,"generated"),i=le.getArg(e,"original",null),n=le.getArg(e,"source",null),s=le.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,i,n,s),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:s})};je.prototype.setSourceContent=function(e,r){var i=e;this._sourceRoot!=null&&(i=le.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[le.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[le.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};je.prototype.applySourceMap=function(e,r,i){var n=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=e.file}var s=this._sourceRoot;s!=null&&(n=le.relative(s,n));var o=new Pn,a=new Pn;this._mappings.unsortedForEach(function(l){if(l.source===n&&l.originalLine!=null){var c=e.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,i!=null&&(l.source=le.join(i,l.source)),s!=null&&(l.source=le.relative(s,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var f=l.source;f!=null&&!o.has(f)&&o.add(f);var h=l.name;h!=null&&!a.has(h)&&a.add(h)},this),this._sources=o,this._names=a,e.sources.forEach(function(l){var c=e.sourceContentFor(l);c!=null&&(i!=null&&(l=le.join(i,l)),s!=null&&(l=le.relative(s,l)),this.setSourceContent(l,c))},this)};je.prototype._validateMapping=function(e,r,i,n){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new 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(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!i&&!n)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&i)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:i,original:r,name:n}))}};je.prototype._serializeMappings=function(){for(var e=0,r=1,i=0,n=0,s=0,o=0,a="",l,c,f,h,p=this._mappings.toArray(),m=0,g=p.length;m<g;m++){if(c=p[m],l="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)l+=";",r++;else if(m>0){if(!le.compareByGeneratedPositionsInflated(c,p[m-1]))continue;l+=","}l+=zr.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=zr.encode(h-o),o=h,l+=zr.encode(c.originalLine-1-n),n=c.originalLine-1,l+=zr.encode(c.originalColumn-i),i=c.originalColumn,c.name!=null&&(f=this._names.indexOf(c.name),l+=zr.encode(f-s),s=f)),a+=l}return a};je.prototype._generateSourcesContent=function(e,r){return e.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=le.relative(r,i));var n=le.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};je.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};je.prototype.toString=function(){return JSON.stringify(this.toJSON())};gf.SourceMapGenerator=je});var yf=H(Bt=>{Bt.GREATEST_LOWER_BOUND=1;Bt.LEAST_UPPER_BOUND=2;function Sa(t,e,r,i,n,s){var o=Math.floor((e-t)/2)+t,a=n(r,i[o],!0);return a===0?o:a>0?e-o>1?Sa(o,e,r,i,n,s):s==Bt.LEAST_UPPER_BOUND?e<i.length?e:-1:o:o-t>1?Sa(t,o,r,i,n,s):s==Bt.LEAST_UPPER_BOUND?o:t<0?-1:t}Bt.search=function(e,r,i,n){if(r.length===0)return-1;var s=Sa(-1,r.length,e,r,i,n||Bt.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&i(r[s],r[s-1],!0)===0;)--s;return s}});var bf=H(_f=>{function xa(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Cb(t,e){return Math.round(t+Math.random()*(e-t))}function Ca(t,e,r,i){if(r<i){var n=Cb(r,i),s=r-1;xa(t,n,i);for(var o=t[i],a=r;a<i;a++)e(t[a],o)<=0&&(s+=1,xa(t,s,a));xa(t,s+1,a);var l=s+1;Ca(t,e,r,l-1),Ca(t,e,l+1,i)}}_f.quickSort=function(t,e){Ca(t,e,0,t.length-1)}});var vf=H(Tn=>{var F=tr(),ka=yf(),rr=wa().ArraySet,kb=ga(),Ur=bf().quickSort;function Z(t,e){var r=t;return typeof t=="string"&&(r=F.parseSourceMapInput(t)),r.sections!=null?new Ke(r,e):new ge(r,e)}Z.fromSourceMap=function(t,e){return ge.fromSourceMap(t,e)};Z.prototype._version=3;Z.prototype.__generatedMappings=null;Object.defineProperty(Z.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Z.prototype.__originalMappings=null;Object.defineProperty(Z.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Z.prototype._charIsMappingSeparator=function(e,r){var i=e.charAt(r);return i===";"||i===","};Z.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Z.GENERATED_ORDER=1;Z.ORIGINAL_ORDER=2;Z.GREATEST_LOWER_BOUND=1;Z.LEAST_UPPER_BOUND=2;Z.prototype.eachMapping=function(e,r,i){var n=r||null,s=i||Z.GENERATED_ORDER,o;switch(s){case Z.GENERATED_ORDER:o=this._generatedMappings;break;case Z.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(l){var c=l.source===null?null:this._sources.at(l.source);return c=F.computeSourceURL(a,c,this._sourceMapURL),{source:c,generatedLine:l.generatedLine,generatedColumn:l.generatedColumn,originalLine:l.originalLine,originalColumn:l.originalColumn,name:l.name===null?null:this._names.at(l.name)}},this).forEach(e,n)};Z.prototype.allGeneratedPositionsFor=function(e){var r=F.getArg(e,"line"),i={source:F.getArg(e,"source"),originalLine:r,originalColumn:F.getArg(e,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],s=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",F.compareByOriginalPositions,ka.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)n.push({line:F.getArg(o,"generatedLine",null),column:F.getArg(o,"generatedColumn",null),lastColumn:F.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var l=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==l;)n.push({line:F.getArg(o,"generatedLine",null),column:F.getArg(o,"generatedColumn",null),lastColumn:F.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return n};Tn.SourceMapConsumer=Z;function ge(t,e){var r=t;typeof t=="string"&&(r=F.parseSourceMapInput(t));var i=F.getArg(r,"version"),n=F.getArg(r,"sources"),s=F.getArg(r,"names",[]),o=F.getArg(r,"sourceRoot",null),a=F.getArg(r,"sourcesContent",null),l=F.getArg(r,"mappings"),c=F.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=F.normalize(o)),n=n.map(String).map(F.normalize).map(function(f){return o&&F.isAbsolute(o)&&F.isAbsolute(f)?F.relative(o,f):f}),this._names=rr.fromArray(s.map(String),!0),this._sources=rr.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(f){return F.computeSourceURL(o,f,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=e,this.file=c}ge.prototype=Object.create(Z.prototype);ge.prototype.consumer=Z;ge.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=F.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};ge.fromSourceMap=function(e,r){var i=Object.create(ge.prototype),n=i._names=rr.fromArray(e._names.toArray(),!0),s=i._sources=rr.fromArray(e._sources.toArray(),!0);i.sourceRoot=e._sourceRoot,i.sourcesContent=e._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=e._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(m){return F.computeSourceURL(i.sourceRoot,m,r)});for(var o=e._mappings.toArray().slice(),a=i.__generatedMappings=[],l=i.__originalMappings=[],c=0,f=o.length;c<f;c++){var h=o[c],p=new wf;p.generatedLine=h.generatedLine,p.generatedColumn=h.generatedColumn,h.source&&(p.source=s.indexOf(h.source),p.originalLine=h.originalLine,p.originalColumn=h.originalColumn,h.name&&(p.name=n.indexOf(h.name)),l.push(p)),a.push(p)}return Ur(i.__originalMappings,F.compareByOriginalPositions),i};ge.prototype._version=3;Object.defineProperty(ge.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function wf(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}ge.prototype._parseMappings=function(e,r){for(var i=1,n=0,s=0,o=0,a=0,l=0,c=e.length,f=0,h={},p={},m=[],g=[],_,O,b,x,I;f<c;)if(e.charAt(f)===";")i++,f++,n=0;else if(e.charAt(f)===",")f++;else{for(_=new wf,_.generatedLine=i,x=f;x<c&&!this._charIsMappingSeparator(e,x);x++);if(O=e.slice(f,x),b=h[O],b)f+=O.length;else{for(b=[];f<x;)kb.decode(e,f,p),I=p.value,f=p.rest,b.push(I);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");h[O]=b}_.generatedColumn=n+b[0],n=_.generatedColumn,b.length>1&&(_.source=a+b[1],a+=b[1],_.originalLine=s+b[2],s=_.originalLine,_.originalLine+=1,_.originalColumn=o+b[3],o=_.originalColumn,b.length>4&&(_.name=l+b[4],l+=b[4])),g.push(_),typeof _.originalLine=="number"&&m.push(_)}Ur(g,F.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,Ur(m,F.compareByOriginalPositions),this.__originalMappings=m};ge.prototype._findMapping=function(e,r,i,n,s,o){if(e[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[i]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return ka.search(e,r,s,o)};ge.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var i=this._generatedMappings[e+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ge.prototype.originalPositionFor=function(e){var r={generatedLine:F.getArg(e,"line"),generatedColumn:F.getArg(e,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",F.compareByGeneratedPositionsDeflated,F.getArg(e,"bias",Z.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===r.generatedLine){var s=F.getArg(n,"source",null);s!==null&&(s=this._sources.at(s),s=F.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=F.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:F.getArg(n,"originalLine",null),column:F.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};ge.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ge.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(e);if(i>=0)return this.sourcesContent[i];var n=e;this.sourceRoot!=null&&(n=F.relative(this.sourceRoot,n));var s;if(this.sourceRoot!=null&&(s=F.urlParse(this.sourceRoot))){var o=n.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(r)return null;throw new Error('"'+n+'" is not in the SourceMap.')};ge.prototype.generatedPositionFor=function(e){var r=F.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:F.getArg(e,"line"),originalColumn:F.getArg(e,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",F.compareByOriginalPositions,F.getArg(e,"bias",Z.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===i.source)return{line:F.getArg(s,"generatedLine",null),column:F.getArg(s,"generatedColumn",null),lastColumn:F.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Tn.BasicSourceMapConsumer=ge;function Ke(t,e){var r=t;typeof t=="string"&&(r=F.parseSourceMapInput(t));var i=F.getArg(r,"version"),n=F.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new rr,this._names=new rr;var s={line:-1,column:0};this._sections=n.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=F.getArg(o,"offset"),l=F.getArg(a,"line"),c=F.getArg(a,"column");if(l<s.line||l===s.line&&c<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new Z(F.getArg(o,"map"),e)}})}Ke.prototype=Object.create(Z.prototype);Ke.prototype.constructor=Z;Ke.prototype._version=3;Object.defineProperty(Ke.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});Ke.prototype.originalPositionFor=function(e){var r={generatedLine:F.getArg(e,"line"),generatedColumn:F.getArg(e,"column")},i=ka.search(r,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:r.generatedLine-(n.generatedOffset.generatedLine-1),column:r.generatedColumn-(n.generatedOffset.generatedLine===r.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Ke.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Ke.prototype.sourceContentFor=function(e,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],s=n.consumer.sourceContentFor(e,!0);if(s)return s}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Ke.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer._findSourceIndex(F.getArg(e,"source"))!==-1){var n=i.consumer.generatedPositionFor(e);if(n){var s={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Ke.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],s=n.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=n.consumer._sources.at(a.source);l=F.computeSourceURL(n.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var c=null;a.name&&(c=n.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var f={source:l,generatedLine:a.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(n.generatedOffset.generatedLine===a.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(f),typeof f.originalLine=="number"&&this.__originalMappings.push(f)}Ur(this.__generatedMappings,F.compareByGeneratedPositionsDeflated),Ur(this.__originalMappings,F.compareByOriginalPositions)};Tn.IndexedSourceMapConsumer=Ke});var xf=H(Sf=>{var Eb=va().SourceMapGenerator,Dn=tr(),Ab=/(\r?\n)/,Ob=10,ir="$$$isSourceNode$$$";function Re(t,e,r,i,n){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=n??null,this[ir]=!0,i!=null&&this.add(i)}Re.fromStringWithSourceMap=function(e,r,i){var n=new Re,s=e.split(Ab),o=0,a=function(){var p=g(),m=g()||"";return p+m;function g(){return o<s.length?s[o++]:void 0}},l=1,c=0,f=null;return r.eachMapping(function(p){if(f!==null)if(l<p.generatedLine)h(f,a()),l++,c=0;else{var m=s[o]||"",g=m.substr(0,p.generatedColumn-c);s[o]=m.substr(p.generatedColumn-c),c=p.generatedColumn,h(f,g),f=p;return}for(;l<p.generatedLine;)n.add(a()),l++;if(c<p.generatedColumn){var m=s[o]||"";n.add(m.substr(0,p.generatedColumn)),s[o]=m.substr(p.generatedColumn),c=p.generatedColumn}f=p},this),o<s.length&&(f&&h(f,a()),n.add(s.splice(o).join(""))),r.sources.forEach(function(p){var m=r.sourceContentFor(p);m!=null&&(i!=null&&(p=Dn.join(i,p)),n.setSourceContent(p,m))}),n;function h(p,m){if(p===null||p.source===void 0)n.add(m);else{var g=i?Dn.join(i,p.source):p.source;n.add(new Re(p.originalLine,p.originalColumn,g,m,p.name))}}};Re.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[ir]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Re.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[ir]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Re.prototype.walk=function(e){for(var r,i=0,n=this.children.length;i<n;i++)r=this.children[i],r[ir]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Re.prototype.join=function(e){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(e);r.push(this.children[i]),this.children=r}return this};Re.prototype.replaceRight=function(e,r){var i=this.children[this.children.length-1];return i[ir]?i.replaceRight(e,r):typeof i=="string"?this.children[this.children.length-1]=i.replace(e,r):this.children.push("".replace(e,r)),this};Re.prototype.setSourceContent=function(e,r){this.sourceContents[Dn.toSetString(e)]=r};Re.prototype.walkSourceContents=function(e){for(var r=0,i=this.children.length;r<i;r++)this.children[r][ir]&&this.children[r].walkSourceContents(e);for(var n=Object.keys(this.sourceContents),r=0,i=n.length;r<i;r++)e(Dn.fromSetString(n[r]),this.sourceContents[n[r]])};Re.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Re.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},i=new Eb(e),n=!1,s=null,o=null,a=null,l=null;return this.walk(function(c,f){r.code+=c,f.source!==null&&f.line!==null&&f.column!==null?((s!==f.source||o!==f.line||a!==f.column||l!==f.name)&&i.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),s=f.source,o=f.line,a=f.column,l=f.name,n=!0):n&&(i.addMapping({generated:{line:r.line,column:r.column}}),s=null,n=!1);for(var h=0,p=c.length;h<p;h++)c.charCodeAt(h)===Ob?(r.line++,r.column=0,h+1===p?(s=null,n=!1):n&&i.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(c,f){i.setSourceContent(c,f)}),{code:r.code,map:i}};Sf.SourceNode=Re});var Cf=H(In=>{In.SourceMapGenerator=va().SourceMapGenerator;In.SourceMapConsumer=vf().SourceMapConsumer;In.SourceNode=xf().SourceNode});var Of=H(Rn=>{"use strict";Rn.__esModule=!0;Rn.safeJsonLiteral=Ef;var Aa=ve(),Pb=/[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/,Tb=/<(?=!--|\/?script)/gi;function Db(t){return t.replace(Tb,"\\u003C")}function Ib(t){return"\\u"+t.charCodeAt(0).toString(16)}function Ef(t){return Db(JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/[\ud800-\udfff]/g,Ib))}var qt=void 0;try{(typeof define!="function"||!define.amd)&&(kf=Cf(),qt=kf.SourceNode)}catch{}var kf;qt||(qt=function(t,e,r,i){this.src="",i&&this.add(i)},qt.prototype={add:function(e){Aa.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){Aa.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Ea(t,e,r){if(Aa.isArray(t)){for(var i=[],n=0,s=t.length;n<s;n++)i.push(e.wrap(t[n],r));return i}else if(typeof t=="boolean"||typeof t=="number")return t+"";return t}function Af(t){this.srcFile=t,this.source=[]}Af.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,r){this.source.unshift(this.wrap(e,r))},push:function(e,r){this.source.push(this.wrap(e,r))},merge:function(){var e=this.empty();return this.each(function(r){e.add([" ",r,`
|
|
38
|
-
`])}),e},each:function(e){for(var r=0,
|
|
39
|
-
`]),this.decorators.push("return fn;"),
|
|
37
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return typeof s<"u"?s:this.lex()},begin:function(s){this.conditionStack.push(s)},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(s){this.begin(s)}};return n.options={},n.performAction=function(s,o,a,l){function c(h,p){return o.yytext=o.yytext.substring(h,o.yyleng-p+h)}var f=l;switch(a){case 0:if(o.yytext.slice(-2)==="\\\\"?(c(0,1),this.begin("mu")):o.yytext.slice(-1)==="\\"?(c(0,1),this.begin("emu")):this.begin("mu"),o.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:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(c(5,9),"END_RAW_BLOCK");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(o.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 o.yytext=c(1,2).replace(/\\"/g,'"'),80;break;case 32:return o.yytext=c(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 o.yytext=o.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.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\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.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}},n})();t.lexer=e;function r(){this.yy={}}return r.prototype=t,t.Parser=r,new r})();vi.default=I_;$h.exports=vi.default});var ia=H(na=>{"use strict";na.__esModule=!0;var R_=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];na.NODE_TYPES=R_});var ki=H((Ci,Uh)=>{"use strict";Ci.__esModule=!0;function L_(t){return t&&t.__esModule?t:{default:t}}var N_=He(),sa=L_(N_),M_=ve(),F_=ia();function xi(){this.parents=[]}function Wh(t,e){return M_.indexOf(F_.NODE_TYPES,e)!==-1||!(e in xi.prototype)&&typeof t[e]=="function"}xi.prototype={constructor:xi,mutating:!1,acceptKey:function(e,r){var n=this.accept(e[r]);if(this.mutating){if(n&&!Wh(this,n.type))throw new sa.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+e.type);e[r]=n}},acceptRequired:function(e,r){if(this.acceptKey(e,r),!e[r])throw new sa.default(e.type+" requires "+r)},acceptArray:function(e){for(var r=0,n=e.length;r<n;r++)this.acceptKey(e,r),e[r]||(e.splice(r,1),r--,n--)},accept:function(e){if(e){if(!Wh(this,e.type)||!this[e.type])throw new sa.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var r=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return e}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:Si,Decorator:Si,BlockStatement:Vh,DecoratorBlock:Vh,PartialStatement:zh,PartialBlockStatement:function(e){zh.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:Si,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}};function Si(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function Vh(t){Si.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function zh(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}Ci.default=xi;Uh.exports=Ci.default});var Yh=H((Ei,Gh)=>{"use strict";Ei.__esModule=!0;function B_(t){return t&&t.__esModule?t:{default:t}}var q_=ki(),H_=B_(q_);function nt(){var t=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=t}nt.prototype=new H_.default;nt.prototype.Program=function(t){var e=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=t.body,i=0,s=n.length;i<s;i++){var o=n[i],a=this.accept(o);if(a){var l=oa(n,i,r),c=aa(n,i,r),f=a.openStandalone&&l,h=a.closeStandalone&&c,p=a.inlineStandalone&&l&&c;a.close&&Mt(n,i,!0),a.open&&kt(n,i,!0),e&&p&&(Mt(n,i),kt(n,i)&&o.type==="PartialStatement"&&(o.indent=/(?:^|[^ \t])([ \t]+)$/.exec(n[i-1].original)[1])),e&&f&&(Mt((o.program||o.inverse).body),kt(n,i)),e&&h&&(Mt(n,i),kt((o.inverse||o.program).body))}}return t};nt.prototype.BlockStatement=nt.prototype.DecoratorBlock=nt.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,r=t.program&&t.inverse,n=r,i=r;if(r&&r.chained)for(n=r.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var s={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:aa(e.body),closeStandalone:oa((n||e).body)};if(t.openStrip.close&&Mt(e.body,null,!0),r){var o=t.inverseStrip;o.open&&kt(e.body,null,!0),o.close&&Mt(n.body,null,!0),t.closeStrip.open&&kt(i.body,null,!0),!this.options.ignoreStandalone&&oa(e.body)&&aa(n.body)&&(kt(e.body),Mt(n.body))}else t.closeStrip.open&&kt(e.body,null,!0);return s};nt.prototype.Decorator=nt.prototype.MustacheStatement=function(t){return t.strip};nt.prototype.PartialStatement=nt.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}};function oa(t,e,r){e===void 0&&(e=t.length);var n=t[e-1],i=t[e-2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/(?:^|\S)[^\S\n]*\n\s*$/:/^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(n.original)}function aa(t,e,r){e===void 0&&(e=-1);var n=t[e+1],i=t[e+2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function Mt(t,e,r){var n=t[e==null?0:e+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var i=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==i}}function kt(t,e,r){var n=t[e==null?t.length-1:e-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var i=n.value;return n.value=n.value.replace(r?/(^|\S)\s+$/:/(^|[^ \t])[ \t]+$/,"$1"),n.leftStripped=n.value!==i,n.leftStripped}}Ei.default=nt;Gh.exports=Ei.default});var Kh=H($e=>{"use strict";$e.__esModule=!0;$e.SourceLocation=W_;$e.id=V_;$e.stripFlags=z_;$e.stripComment=U_;$e.preparePath=G_;$e.prepareMustache=Y_;$e.prepareRawBlock=K_;$e.prepareBlock=J_;$e.prepareProgram=Q_;$e.preparePartialBlock=Z_;function $_(t){return t&&t.__esModule?t:{default:t}}var j_=He(),la=$_(j_);function ca(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var r={loc:t.path.loc};throw new la.default(t.path.original+" doesn't match "+e,r)}}function W_(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function V_(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t}function z_(t,e){return{open:t.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function U_(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function G_(t,e,r){r=this.locInfo(r);for(var n=t?"@":"",i=[],s=0,o=0,a=e.length;o<a;o++){var l=e[o].part,c=e[o].original!==l;if(n+=(e[o].separator||"")+l,!c&&(l===".."||l==="."||l==="this")){if(i.length>0)throw new la.default("Invalid path: "+n,{loc:r});l===".."&&s++}else i.push(l)}return{type:"PathExpression",data:t,depth:s,parts:i,original:n,loc:r}}function Y_(t,e,r,n,i,s){var o=n.charAt(3)||n.charAt(2),a=o!=="{"&&o!=="&",l=/\*/.test(n);return{type:l?"Decorator":"MustacheStatement",path:t,params:e,hash:r,escaped:a,strip:i,loc:this.locInfo(s)}}function K_(t,e,r,n){ca(t,r),n=this.locInfo(n);var i={type:"Program",body:e,strip:{},loc:n};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function J_(t,e,r,n,i,s){n&&n.path&&ca(t,n);var o=/\*/.test(t.open);e.blockParams=t.blockParams;var a=void 0,l=void 0;if(r){if(o)throw new la.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),l=r.strip,a=r.program}return i&&(i=a,a=e,e=i),{type:o?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:a,openStrip:t.strip,inverseStrip:l,closeStrip:n&&n.strip,loc:this.locInfo(s)}}function Q_(t,e){if(!e&&t.length){var r=t[0].loc,n=t[t.length-1].loc;r&&n&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:t,strip:{},loc:e}}function Z_(t,e,r,n){return ca(t,r),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var Zh=H($r=>{"use strict";$r.__esModule=!0;$r.parseWithoutProcessing=Qh;$r.parse=ob;function X_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Jh(t){return t&&t.__esModule?t:{default:t}}var eb=jh(),ua=Jh(eb),tb=Yh(),rb=Jh(tb),nb=Kh(),ib=X_(nb),sb=ve();$r.parser=ua.default;var Ai={};sb.extend(Ai,ib);function Qh(t,e){if(t.type==="Program")return t;ua.default.yy=Ai,Ai.locInfo=function(n){return new Ai.SourceLocation(e&&e.srcName,n)};var r=ua.default.parse(t);return r}function ob(t,e){var r=Qh(t,e),n=new rb.default(e);return n.accept(r)}});var nf=H(Wr=>{"use strict";Wr.__esModule=!0;Wr.Compiler=da;Wr.precompile=hb;Wr.compile=fb;function ef(t){return t&&t.__esModule?t:{default:t}}var ab=He(),Zt=ef(ab),Et=ve(),lb=ra(),jr=ef(lb),cb=ia(),ub=[].slice;function da(){}da.prototype={compiler:da,equals:function(e){var r=this.opcodes.length;if(e.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var i=this.opcodes[n],s=e.opcodes[n];if(i.opcode!==s.opcode||!rf(i.args,s.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(e.children[n]))return!1;return!0},guid:0,compile:function(e,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Et.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(e)},compileProgram:function(e){var r=new this.compiler,n=r.compile(e,this.options),i=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[i]=n,this.useDepths=this.useDepths||n.useDepths,i},accept:function(e){if(Et.indexOf(cb.NODE_TYPES,e.type)===-1||!this[e.type])throw new Zt.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var r=this[e.type](e);return this.sourceNode.shift(),r},Program:function(e){db(e),this.options.blockParams.unshift(e.blockParams);for(var r=e.body,n=r.length,i=0;i<n;i++)this.accept(r[i]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){Xh(e);var r=e.program,n=e.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var i=this.classifySexpr(e);i==="helper"?this.helperSexpr(e,r,n):i==="simple"?(this.simpleSexpr(e),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var r=e.program&&this.compileProgram(e.program),n=this.setupFullMustacheParams(e,r,void 0),i=e.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,i.original)},PartialStatement:function(e){this.usePartial=!0;var r=e.program;r&&(r=this.compileProgram(e.program));var n=e.params;if(n.length>1)throw new Zt.default("Unsupported number of partial arguments: "+n.length,e);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=e.name.original,s=e.name.type==="SubExpression";s&&this.accept(e.name),this.setupFullMustacheParams(e,r,void 0,!0);var o=e.indent||"";this.options.preventIndent&&o&&(this.opcode("appendContent",o),o=""),this.opcode("invokePartial",s,i,o),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){if(e.value!=null&&typeof e.value!="string")throw ft(e,"value must be a string");e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){Xh(e);var r=this.classifySexpr(e);r==="simple"?this.simpleSexpr(e):r==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,r,n){var i=e.path,s=i.parts[0],o=r!=null||n!=null;this.opcode("getContext",ha(i)),this.opcode("pushProgram",r),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",s,o)},simpleSexpr:function(e){var r=e.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,r,n){var i=this.setupFullMustacheParams(e,r,n),s=e.path,o=s.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",i.length,o);else{if(this.options.knownHelpersOnly)throw new Zt.default("You specified knownHelpersOnly, but used the unknown helper "+o,e);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",i.length,s.original,jr.default.helpers.simpleId(s))}},PathExpression:function(e){var r=ha(e),n=fa(e);this.addDepth(r),this.opcode("getContext",r);var i=n[0],s=jr.default.helpers.scopedId(e),o=!r&&!s&&this.blockParamIndex(i);o?this.opcode("lookupBlockParam",o,n):i?e.data?(this.options.data=!0,this.opcode("lookupData",r,n,e.strict)):this.opcode("lookupOnContext",n,e.falsy,e.strict,s):this.opcode("pushContext")},StringLiteral:function(e){Oi(e),this.opcode("pushString",e.value)},NumberLiteral:function(e){Oi(e),this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){Oi(e),this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var r=e.pairs,n=0,i=void 0;if(!Et.isArray(r))throw ft(e,"pairs must be an array");i=r.length;for(var s=0;s<i;s++)if(!r[s]||typeof r[s].key!="string")throw ft(e,"pair keys must be strings");for(this.opcode("pushHash");n<i;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:ub.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){fa(e.path);var r=jr.default.helpers.simpleId(e.path),n=r&&!!this.blockParamIndex(e.path.parts[0]),i=!n&&jr.default.helpers.helperExpression(e),s=!n&&(i||r);if(s&&!i){var o=e.path.parts[0],a=this.options;a.knownHelpers[o]?i=!0:a.knownHelpersOnly&&(s=!1)}return i?"helper":s?"ambiguous":"simple"},pushParams:function(e){for(var r=0,n=e.length;r<n;r++)this.pushParam(e[r])},pushParam:function(e){Oi(e);var r=e.value!=null?e.value:e.original||"",n=ha(e);if(this.stringParams)typeof r!="number"&&typeof r!="boolean"&&(r=String(r)),r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),n&&this.addDepth(n),this.opcode("getContext",n),this.opcode("pushStringParam",r,e.type),e.type==="SubExpression"&&this.accept(e);else{if(this.trackIds){var i=void 0;if(e.parts&&!jr.default.helpers.scopedId(e)&&!n&&(i=this.blockParamIndex(fa(e)[0])),i){var s=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",i,s)}else r=e.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,r)}this.accept(e)}},setupFullMustacheParams:function(e,r,n,i){var s=e.params;return this.pushParams(s),this.opcode("pushProgram",r),this.opcode("pushProgram",n),e.hash?this.accept(e.hash):this.opcode("emptyHash",i),s},blockParamIndex:function(e){for(var r=0,n=this.options.blockParams.length;r<n;r++){var i=this.options.blockParams[r],s=i&&Et.indexOf(i,e);if(i&&s>=0)return[r,s]}}};function hb(t,e,r){if(t==null||typeof t!="string"&&t.type!=="Program")throw new Zt.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var n=r.parse(t,e),i=new r.Compiler().compile(n,e);return new r.JavaScriptCompiler().compile(i,e)}function fb(t,e,r){if(e===void 0&&(e={}),t==null||typeof t!="string"&&t.type!=="Program")throw new Zt.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);e=Et.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var n=void 0;function i(){var o=r.parse(t,e),a=new r.Compiler().compile(o,e),l=new r.JavaScriptCompiler().compile(a,e,void 0,!0);return r.template(l)}function s(o,a){return n||(n=i()),n.call(this,o,a)}return s._setup=function(o){return n||(n=i()),n._setup(o)},s._child=function(o,a,l,c){return n||(n=i()),n._child(o,a,l,c)},s}function ft(t,e){return new Zt.default("Invalid AST: "+t.type+" "+e,t)}function ha(t){var e=t.depth;if(e==null)return 0;if(typeof e!="number"||!isFinite(e)||Math.floor(e)!==e||e<0)throw ft(t,"depth must be a non-negative integer");return e}function Oi(t){var e=t.value;if(t.type==="StringLiteral"&&typeof e!="string")throw ft(t,"value must be a string");if(t.type==="NumberLiteral"&&typeof e!="number")throw ft(t,"value must be a number");if(t.type==="BooleanLiteral"&&typeof e!="boolean")throw ft(t,"value must be a boolean")}function tf(t,e,r){if(!Et.isArray(e))throw ft(t,r+" must be an array");for(var n=0;n<e.length;n++)if(typeof e[n]!="string")throw ft(t,r+" must only contain strings");return e}function fa(t){return tf(t,t.parts,"parts")}function db(t){t.blockParams!=null&&tf(t,t.blockParams,"blockParams")}function rf(t,e){if(t===e)return!0;if(Et.isArray(t)&&Et.isArray(e)&&t.length===e.length){for(var r=0;r<t.length;r++)if(!rf(t[r],e[r]))return!1;return!0}}function Xh(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}});var of=H(pa=>{var sf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");pa.encode=function(t){if(0<=t&&t<sf.length)return sf[t];throw new TypeError("Must be between 0 and 63: "+t)};pa.decode=function(t){var e=65,r=90,n=97,i=122,s=48,o=57,a=43,l=47,c=26,f=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:s<=t&&t<=o?t-s+f:t==a?62:t==l?63:-1}});var ya=H(ga=>{var af=of(),ma=5,lf=1<<ma,cf=lf-1,uf=lf;function pb(t){return t<0?(-t<<1)+1:(t<<1)+0}function mb(t){var e=(t&1)===1,r=t>>1;return e?-r:r}ga.encode=function(e){var r="",n,i=pb(e);do n=i&cf,i>>>=ma,i>0&&(n|=uf),r+=af.encode(n);while(i>0);return r};ga.decode=function(e,r,n){var i=e.length,s=0,o=0,a,l;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(l=af.decode(e.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(l&uf),l&=cf,s=s+(l<<o),o+=ma}while(a);n.value=mb(s),n.rest=r}});var tr=H(Se=>{function gb(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Se.getArg=gb;var hf=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,yb=/^data:.+\,.+$/;function Vr(t){var e=t.match(hf);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Se.urlParse=Vr;function Xt(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Se.urlGenerate=Xt;function _a(t){var e=t,r=Vr(t);if(r){if(!r.path)return t;e=r.path}for(var n=Se.isAbsolute(e),i=e.split(/\/+/),s,o=0,a=i.length-1;a>=0;a--)s=i[a],s==="."?i.splice(a,1):s===".."?o++:o>0&&(s===""?(i.splice(a+1,o),o=0):(i.splice(a,2),o--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Xt(r)):e}Se.normalize=_a;function ff(t,e){t===""&&(t="."),e===""&&(e=".");var r=Vr(e),n=Vr(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Xt(r);if(r||e.match(yb))return e;if(n&&!n.host&&!n.path)return n.host=e,Xt(n);var i=e.charAt(0)==="/"?e:_a(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Xt(n)):i}Se.join=ff;Se.isAbsolute=function(t){return t.charAt(0)==="/"||hf.test(t)};function _b(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Se.relative=_b;var df=(function(){var t=Object.create(null);return!("__proto__"in t)})();function pf(t){return t}function bb(t){return mf(t)?"$"+t:t}Se.toSetString=df?pf:bb;function wb(t){return mf(t)?t.slice(1):t}Se.fromSetString=df?pf:wb;function mf(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function vb(t,e,r){var n=er(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:er(t.name,e.name)}Se.compareByOriginalPositions=vb;function Sb(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=er(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:er(t.name,e.name)}Se.compareByGeneratedPositionsDeflated=Sb;function er(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function xb(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=er(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:er(t.name,e.name)}Se.compareByGeneratedPositionsInflated=xb;function Cb(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Se.parseSourceMapInput=Cb;function kb(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=Vr(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=ff(Xt(n),e)}return _a(e)}Se.computeSourceURL=kb});var va=H(gf=>{var ba=tr(),wa=Object.prototype.hasOwnProperty,Ft=typeof Map<"u";function dt(){this._array=[],this._set=Ft?new Map:Object.create(null)}dt.fromArray=function(e,r){for(var n=new dt,i=0,s=e.length;i<s;i++)n.add(e[i],r);return n};dt.prototype.size=function(){return Ft?this._set.size:Object.getOwnPropertyNames(this._set).length};dt.prototype.add=function(e,r){var n=Ft?e:ba.toSetString(e),i=Ft?this.has(e):wa.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(e),i||(Ft?this._set.set(e,s):this._set[n]=s)};dt.prototype.has=function(e){if(Ft)return this._set.has(e);var r=ba.toSetString(e);return wa.call(this._set,r)};dt.prototype.indexOf=function(e){if(Ft){var r=this._set.get(e);if(r>=0)return r}else{var n=ba.toSetString(e);if(wa.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};dt.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};dt.prototype.toArray=function(){return this._array.slice()};gf.ArraySet=dt});var bf=H(_f=>{var yf=tr();function Eb(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=i||yf.compareByGeneratedPositionsInflated(t,e)<=0}function Pi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Pi.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};Pi.prototype.add=function(e){Eb(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Pi.prototype.toArray=function(){return this._sorted||(this._array.sort(yf.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};_f.MappingList=Pi});var Sa=H(wf=>{var zr=ya(),ce=tr(),Ti=va().ArraySet,Ab=bf().MappingList;function je(t){t||(t={}),this._file=ce.getArg(t,"file",null),this._sourceRoot=ce.getArg(t,"sourceRoot",null),this._skipValidation=ce.getArg(t,"skipValidation",!1),this._sources=new Ti,this._names=new Ti,this._mappings=new Ab,this._sourcesContents=null}je.prototype._version=3;je.fromSourceMap=function(e){var r=e.sourceRoot,n=new je({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=ce.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),e.sources.forEach(function(i){var s=i;r!==null&&(s=ce.relative(r,i)),n._sources.has(s)||n._sources.add(s);var o=e.sourceContentFor(i);o!=null&&n.setSourceContent(i,o)}),n};je.prototype.addMapping=function(e){var r=ce.getArg(e,"generated"),n=ce.getArg(e,"original",null),i=ce.getArg(e,"source",null),s=ce.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})};je.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=ce.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ce.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[ce.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};je.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=ce.relative(s,i));var o=new Ti,a=new Ti;this._mappings.unsortedForEach(function(l){if(l.source===i&&l.originalLine!=null){var c=e.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,n!=null&&(l.source=ce.join(n,l.source)),s!=null&&(l.source=ce.relative(s,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var f=l.source;f!=null&&!o.has(f)&&o.add(f);var h=l.name;h!=null&&!a.has(h)&&a.add(h)},this),this._sources=o,this._names=a,e.sources.forEach(function(l){var c=e.sourceContentFor(l);c!=null&&(n!=null&&(l=ce.join(n,l)),s!=null&&(l=ce.relative(s,l)),this.setSourceContent(l,c))},this)};je.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new 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(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};je.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,o=0,a="",l,c,f,h,p=this._mappings.toArray(),m=0,g=p.length;m<g;m++){if(c=p[m],l="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)l+=";",r++;else if(m>0){if(!ce.compareByGeneratedPositionsInflated(c,p[m-1]))continue;l+=","}l+=zr.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=zr.encode(h-o),o=h,l+=zr.encode(c.originalLine-1-i),i=c.originalLine-1,l+=zr.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(f=this._names.indexOf(c.name),l+=zr.encode(f-s),s=f)),a+=l}return a};je.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=ce.relative(r,n));var i=ce.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};je.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};je.prototype.toString=function(){return JSON.stringify(this.toJSON())};wf.SourceMapGenerator=je});var vf=H(Bt=>{Bt.GREATEST_LOWER_BOUND=1;Bt.LEAST_UPPER_BOUND=2;function xa(t,e,r,n,i,s){var o=Math.floor((e-t)/2)+t,a=i(r,n[o],!0);return a===0?o:a>0?e-o>1?xa(o,e,r,n,i,s):s==Bt.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?xa(t,o,r,n,i,s):s==Bt.LEAST_UPPER_BOUND?o:t<0?-1:t}Bt.search=function(e,r,n,i){if(r.length===0)return-1;var s=xa(-1,r.length,e,r,n,i||Bt.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s}});var xf=H(Sf=>{function Ca(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Ob(t,e){return Math.round(t+Math.random()*(e-t))}function ka(t,e,r,n){if(r<n){var i=Ob(r,n),s=r-1;Ca(t,i,n);for(var o=t[n],a=r;a<n;a++)e(t[a],o)<=0&&(s+=1,Ca(t,s,a));Ca(t,s+1,a);var l=s+1;ka(t,e,r,l-1),ka(t,e,l+1,n)}}Sf.quickSort=function(t,e){ka(t,e,0,t.length-1)}});var kf=H(Di=>{var F=tr(),Ea=vf(),rr=va().ArraySet,Pb=ya(),Ur=xf().quickSort;function X(t,e){var r=t;return typeof t=="string"&&(r=F.parseSourceMapInput(t)),r.sections!=null?new Ke(r,e):new ge(r,e)}X.fromSourceMap=function(t,e){return ge.fromSourceMap(t,e)};X.prototype._version=3;X.prototype.__generatedMappings=null;Object.defineProperty(X.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});X.prototype.__originalMappings=null;Object.defineProperty(X.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});X.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};X.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};X.GENERATED_ORDER=1;X.ORIGINAL_ORDER=2;X.GREATEST_LOWER_BOUND=1;X.LEAST_UPPER_BOUND=2;X.prototype.eachMapping=function(e,r,n){var i=r||null,s=n||X.GENERATED_ORDER,o;switch(s){case X.GENERATED_ORDER:o=this._generatedMappings;break;case X.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(l){var c=l.source===null?null:this._sources.at(l.source);return c=F.computeSourceURL(a,c,this._sourceMapURL),{source:c,generatedLine:l.generatedLine,generatedColumn:l.generatedColumn,originalLine:l.originalLine,originalColumn:l.originalColumn,name:l.name===null?null:this._names.at(l.name)}},this).forEach(e,i)};X.prototype.allGeneratedPositionsFor=function(e){var r=F.getArg(e,"line"),n={source:F.getArg(e,"source"),originalLine:r,originalColumn:F.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",F.compareByOriginalPositions,Ea.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:F.getArg(o,"generatedLine",null),column:F.getArg(o,"generatedColumn",null),lastColumn:F.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var l=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==l;)i.push({line:F.getArg(o,"generatedLine",null),column:F.getArg(o,"generatedColumn",null),lastColumn:F.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};Di.SourceMapConsumer=X;function ge(t,e){var r=t;typeof t=="string"&&(r=F.parseSourceMapInput(t));var n=F.getArg(r,"version"),i=F.getArg(r,"sources"),s=F.getArg(r,"names",[]),o=F.getArg(r,"sourceRoot",null),a=F.getArg(r,"sourcesContent",null),l=F.getArg(r,"mappings"),c=F.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=F.normalize(o)),i=i.map(String).map(F.normalize).map(function(f){return o&&F.isAbsolute(o)&&F.isAbsolute(f)?F.relative(o,f):f}),this._names=rr.fromArray(s.map(String),!0),this._sources=rr.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(f){return F.computeSourceURL(o,f,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=e,this.file=c}ge.prototype=Object.create(X.prototype);ge.prototype.consumer=X;ge.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=F.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};ge.fromSourceMap=function(e,r){var n=Object.create(ge.prototype),i=n._names=rr.fromArray(e._names.toArray(),!0),s=n._sources=rr.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(m){return F.computeSourceURL(n.sourceRoot,m,r)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],l=n.__originalMappings=[],c=0,f=o.length;c<f;c++){var h=o[c],p=new Cf;p.generatedLine=h.generatedLine,p.generatedColumn=h.generatedColumn,h.source&&(p.source=s.indexOf(h.source),p.originalLine=h.originalLine,p.originalColumn=h.originalColumn,h.name&&(p.name=i.indexOf(h.name)),l.push(p)),a.push(p)}return Ur(n.__originalMappings,F.compareByOriginalPositions),n};ge.prototype._version=3;Object.defineProperty(ge.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Cf(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}ge.prototype._parseMappings=function(e,r){for(var n=1,i=0,s=0,o=0,a=0,l=0,c=e.length,f=0,h={},p={},m=[],g=[],_,O,b,x,I;f<c;)if(e.charAt(f)===";")n++,f++,i=0;else if(e.charAt(f)===",")f++;else{for(_=new Cf,_.generatedLine=n,x=f;x<c&&!this._charIsMappingSeparator(e,x);x++);if(O=e.slice(f,x),b=h[O],b)f+=O.length;else{for(b=[];f<x;)Pb.decode(e,f,p),I=p.value,f=p.rest,b.push(I);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");h[O]=b}_.generatedColumn=i+b[0],i=_.generatedColumn,b.length>1&&(_.source=a+b[1],a+=b[1],_.originalLine=s+b[2],s=_.originalLine,_.originalLine+=1,_.originalColumn=o+b[3],o=_.originalColumn,b.length>4&&(_.name=l+b[4],l+=b[4])),g.push(_),typeof _.originalLine=="number"&&m.push(_)}Ur(g,F.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,Ur(m,F.compareByOriginalPositions),this.__originalMappings=m};ge.prototype._findMapping=function(e,r,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return Ea.search(e,r,s,o)};ge.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ge.prototype.originalPositionFor=function(e){var r={generatedLine:F.getArg(e,"line"),generatedColumn:F.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",F.compareByGeneratedPositionsDeflated,F.getArg(e,"bias",X.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=F.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=F.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=F.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:F.getArg(i,"originalLine",null),column:F.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};ge.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ge.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=F.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=F.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};ge.prototype.generatedPositionFor=function(e){var r=F.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:F.getArg(e,"line"),originalColumn:F.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",F.compareByOriginalPositions,F.getArg(e,"bias",X.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:F.getArg(s,"generatedLine",null),column:F.getArg(s,"generatedColumn",null),lastColumn:F.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Di.BasicSourceMapConsumer=ge;function Ke(t,e){var r=t;typeof t=="string"&&(r=F.parseSourceMapInput(t));var n=F.getArg(r,"version"),i=F.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new rr,this._names=new rr;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=F.getArg(o,"offset"),l=F.getArg(a,"line"),c=F.getArg(a,"column");if(l<s.line||l===s.line&&c<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new X(F.getArg(o,"map"),e)}})}Ke.prototype=Object.create(X.prototype);Ke.prototype.constructor=X;Ke.prototype._version=3;Object.defineProperty(Ke.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});Ke.prototype.originalPositionFor=function(e){var r={generatedLine:F.getArg(e,"line"),generatedColumn:F.getArg(e,"column")},n=Ea.search(r,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Ke.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Ke.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(e,!0);if(s)return s}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Ke.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(F.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Ke.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=i.consumer._sources.at(a.source);l=F.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var c=null;a.name&&(c=i.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var f={source:l,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(f),typeof f.originalLine=="number"&&this.__originalMappings.push(f)}Ur(this.__generatedMappings,F.compareByGeneratedPositionsDeflated),Ur(this.__originalMappings,F.compareByOriginalPositions)};Di.IndexedSourceMapConsumer=Ke});var Af=H(Ef=>{var Tb=Sa().SourceMapGenerator,Ii=tr(),Db=/(\r?\n)/,Ib=10,nr="$$$isSourceNode$$$";function Re(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[nr]=!0,n!=null&&this.add(n)}Re.fromStringWithSourceMap=function(e,r,n){var i=new Re,s=e.split(Db),o=0,a=function(){var p=g(),m=g()||"";return p+m;function g(){return o<s.length?s[o++]:void 0}},l=1,c=0,f=null;return r.eachMapping(function(p){if(f!==null)if(l<p.generatedLine)h(f,a()),l++,c=0;else{var m=s[o]||"",g=m.substr(0,p.generatedColumn-c);s[o]=m.substr(p.generatedColumn-c),c=p.generatedColumn,h(f,g),f=p;return}for(;l<p.generatedLine;)i.add(a()),l++;if(c<p.generatedColumn){var m=s[o]||"";i.add(m.substr(0,p.generatedColumn)),s[o]=m.substr(p.generatedColumn),c=p.generatedColumn}f=p},this),o<s.length&&(f&&h(f,a()),i.add(s.splice(o).join(""))),r.sources.forEach(function(p){var m=r.sourceContentFor(p);m!=null&&(n!=null&&(p=Ii.join(n,p)),i.setSourceContent(p,m))}),i;function h(p,m){if(p===null||p.source===void 0)i.add(m);else{var g=n?Ii.join(n,p.source):p.source;i.add(new Re(p.originalLine,p.originalColumn,g,m,p.name))}}};Re.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[nr]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Re.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[nr]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Re.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[nr]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Re.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};Re.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[nr]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};Re.prototype.setSourceContent=function(e,r){this.sourceContents[Ii.toSetString(e)]=r};Re.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][nr]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(Ii.fromSetString(i[r]),this.sourceContents[i[r]])};Re.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Re.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Tb(e),i=!1,s=null,o=null,a=null,l=null;return this.walk(function(c,f){r.code+=c,f.source!==null&&f.line!==null&&f.column!==null?((s!==f.source||o!==f.line||a!==f.column||l!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),s=f.source,o=f.line,a=f.column,l=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var h=0,p=c.length;h<p;h++)c.charCodeAt(h)===Ib?(r.line++,r.column=0,h+1===p?(s=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(c,f){n.setSourceContent(c,f)}),{code:r.code,map:n}};Ef.SourceNode=Re});var Of=H(Ri=>{Ri.SourceMapGenerator=Sa().SourceMapGenerator;Ri.SourceMapConsumer=kf().SourceMapConsumer;Ri.SourceNode=Af().SourceNode});var If=H(Li=>{"use strict";Li.__esModule=!0;Li.safeJsonLiteral=Tf;var Oa=ve(),Rb=/[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/,Lb=/<(?=!--|\/?script)/gi;function Nb(t){return t.replace(Lb,"\\u003C")}function Mb(t){return"\\u"+t.charCodeAt(0).toString(16)}function Tf(t){return Nb(JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/[\ud800-\udfff]/g,Mb))}var qt=void 0;try{(typeof define!="function"||!define.amd)&&(Pf=Of(),qt=Pf.SourceNode)}catch{}var Pf;qt||(qt=function(t,e,r,n){this.src="",n&&this.add(n)},qt.prototype={add:function(e){Oa.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){Oa.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Aa(t,e,r){if(Oa.isArray(t)){for(var n=[],i=0,s=t.length;i<s;i++)n.push(e.wrap(t[i],r));return n}else if(typeof t=="boolean"||typeof t=="number")return t+"";return t}function Df(t){this.srcFile=t,this.source=[]}Df.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,r){this.source.unshift(this.wrap(e,r))},push:function(e,r){this.source.push(this.wrap(e,r))},merge:function(){var e=this.empty();return this.each(function(r){e.add([" ",r,`
|
|
38
|
+
`])}),e},each:function(e){for(var r=0,n=this.source.length;r<n;r++)e(this.source[r])},empty:function(){var e=this.currentLocation||{start:{}};return new qt(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return e instanceof qt?e:(e=Aa(e,this,r),new qt(r.start.line,r.start.column,this.srcFile,e))},functionCall:function(e,r,n){return n=this.generateList(n),this.wrap([e,r?"."+r+"(":"(",n,")"])},quotedString:function(e){return e=e+"",Rb.test(e)?Tf(e):'"'+e+'"'},objectLiteral:function(e){var r=this,n=[];Object.keys(e).forEach(function(s){var o=Aa(e[s],r);o!=="undefined"&&n.push([r.quotedString(s),":",o])});var i=this.generateList(n);return i.prepend("{"),i.add("}"),i},generateList:function(e){for(var r=this.empty(),n=0,i=e.length;n<i;n++)n&&r.add(","),r.add(Aa(e[n],this));return r},generateArray:function(e){var r=this.generateList(e);return r.prepend("["),r.add("]"),r}};Li.default=Df});var qf=H((Ni,Bf)=>{"use strict";Ni.__esModule=!0;function Nf(t){return t&&t.__esModule?t:{default:t}}var Rf=pi(),Fb=He(),Pa=Nf(Fb),Bb=ve(),Mf=If(),Lf=Nf(Mf);function ir(t){this.value=t}function sr(){}sr.prototype={nameLookup:function(e,r){return this.internalNameLookup(e,r)},depthedLookup:function(e){return[this.aliasable("container.lookup"),"(depths, ",this.quotedString(e),")"]},compilerInfo:function(){var e=Rf.COMPILER_REVISION,r=Rf.REVISION_CHANGES[e];return[e,r]},appendToBuffer:function(e,r,n){return Bb.isArray(e)||(e=[e]),e=this.source.wrap(e,r),this.environment.isSimple?["return ",e,";"]:n?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(e,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",this.quotedString(r),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(e,r,n,i){this.environment=e,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!n,this.context=n||{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(e,r),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var s=e.opcodes,o=void 0,a=void 0,l=void 0,c=void 0;for(l=0,c=s.length;l<c;l++)o=s[l],this.source.currentLocation=o.loc,a=a||o.loc,this[o.opcode].apply(this,o.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new Pa.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
39
|
+
`]),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
40
40
|
`),this.decorators.push(`}
|
|
41
|
-
`),this.decorators=this.decorators.merge()));var f=this.createFunctionContext(
|
|
42
|
-
`,a,"}"])},mergeSource:function(e){var r=this.environment.isSimple,
|
|
41
|
+
`),this.decorators=this.decorators.merge()));var f=this.createFunctionContext(i);if(this.isChild)return f;var h={compiler:this.compilerInfo(),main:f};this.decorators&&(h.main_d=this.decorators,h.useDecorators=!0);var p=this.context,m=p.programs,g=p.decorators;for(l=0,c=m.length;l<c;l++)h[l]=m[l],g[l]&&(h[l+"_d"]=g[l],h.useDecorators=!0);return this.environment.usePartial&&(h.usePartial=!0),this.options.data&&(h.useData=!0),this.useDepths&&(h.useDepths=!0),this.useBlockParams&&(h.useBlockParams=!0),this.options.compat&&(h.compat=!0),i?h.compilerOptions=this.options:(h.compiler=JSON.stringify(h.compiler),this.source.currentLocation={start:{line:1,column:0}},h=this.objectLiteral(h),r.srcName?(h=h.toStringWithSourceMap({file:r.destName}),h.map=h.map&&h.map.toString()):h=h.toString()),h},preamble:function(){this.lastContext=0,this.source=new Lf.default(this.options.srcName),this.decorators=new Lf.default(this.options.srcName)},createFunctionContext:function(e){var r=this,n="",i=this.stackVars.concat(this.registers.list);i.length>0&&(n+=", "+i.join(", "));var s=0;Object.keys(this.aliases).forEach(function(l){var c=r.aliases[l];c.children&&c.referenceCount>1&&(n+=", alias"+ ++s+"="+l,c.children[0]="alias"+s)}),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var o=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&o.push("blockParams"),this.useDepths&&o.push("depths");var a=this.mergeSource(n);return e?(o.push(a),Function.apply(this,o)):this.source.wrap(["function(",o.join(","),`) {
|
|
42
|
+
`,a,"}"])},mergeSource:function(e){var r=this.environment.isSimple,n=!this.forceBuffer,i=void 0,s=void 0,o=void 0,a=void 0;return this.source.each(function(l){l.appendToBuffer?(o?l.prepend(" + "):o=l,a=l):(o&&(s?o.prepend("buffer += "):i=!0,a.add(";"),o=a=void 0),s=!0,r||(n=!1))}),n?o?(o.prepend("return "),a.add(";")):s||this.source.push('return "";'):(e+=", buffer = "+(i?"":this.initializeBuffer()),o?(o.prepend("return buffer + "),a.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(i?"":`;
|
|
43
43
|
`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
|
|
44
44
|
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
45
45
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -47,44 +47,44 @@ Expecting `+q.join(", ")+", got '"+(this.terminals_[L]||L)+"'":Me="Parse error o
|
|
|
47
47
|
}
|
|
48
48
|
return undefined
|
|
49
49
|
}
|
|
50
|
-
`.trim()},blockValue:function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),i=[this.contextName(0)];this.setupHelperArgs(e,0,i);var n=this.popStack();i.splice(1,0,n),this.push(this.source.functionCall(r,"call",i))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var i=this.topStack();r.splice(1,0,i),this.pushSource(["if (!",this.lastHelper,") { ",i," = ",this.source.functionCall(e,"call",r),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,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(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,r,i,n){var s=0;!n&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[s++])):this.pushContext(),this.resolvePath("context",e,s,r,i)},lookupBlockParam:function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(e,r,i){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,i)},resolvePath:function(e,r,i,n,s){var o=this;if(this.options.strict||this.options.assumeObjects){this.push(Nb(this.options.strict&&s,this,r,i,e));return}for(var a=r.length,l=function(f){o.replaceStack(function(h){var p=o.nameLookup(h,r[f],e);return n?[" && ",p]:[" != null ? ",p," : ",h]})},c=i;c<a;c++)l(c)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,r){var i=this.nameLookup("decorators",r,"decorator"),n=this.setupHelperArgs(r,e);this.decorators.push(["var decorator = ",i,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+r+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",n])," || fn;"])},invokeHelper:function(e,r,i){var n=this.popStack(),s=this.setupHelper(e,r),o=[];i&&o.push(s.name),o.push(n),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(o,"||"),")"],l=this.source.functionCall(a,"call",s.callParams);this.push(l)},itemsSeparatedBy:function(e,r){var i=[];i.push(e[0]);for(var n=1;n<e.length;n++)i.push(r,e[n]);return i},invokeKnownHelper:function(e,r){var i=this.setupHelper(e,r);this.push(this.source.functionCall(i.name,"call",i.callParams))},invokeAmbiguous:function(e,r){this.useRegister("helper");var i=this.popStack();this.emptyHash();var n=this.setupHelper(0,e,r),s=this.lastHelper=this.nameLookup("helpers",e,"helper"),o=["(","(helper = ",s," || ",i,")"];this.options.strict||(o[0]="(helper = ",o.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",o,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",n.callParams)," : helper))"])},invokePartial:function(e,r,i){var n=[],s=this.setupParams(r,1,n);e&&(r=this.popStack(),delete s.name),i&&(s.indent=this.quotedString(i)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",e?n.unshift(r):n.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),n.push(s),this.push(this.source.functionCall("container.invokePartial","",n))},assignToHash:function(e){var r=this.popStack(),i=void 0,n=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(n=this.popStack(),i=this.popStack());var o=this.hash;i&&(o.contexts[e]=i),n&&(o.types[e]=n),s&&(o.ids[e]=s),o.values[e]=r},pushId:function(e,r,i){e==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(i?" + "+this.quotedString("."+i):"")):e==="PathExpression"?this.pushString(r):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:sr,compileChildren:function(e,r){for(var i=e.children,n=void 0,s=void 0,o=0,a=i.length;o<a;o++){n=i[o],s=new this.compiler;var l=this.matchExistingProgram(n);if(l==null){var c=this.context.programs.push("")-1;n.index=c,n.name="program"+c,this.context.programs[c]=s.compile(n,r,this.context,!this.precompile),this.context.decorators[c]=s.decorators,this.context.environments[c]=n,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,n.useDepths=this.useDepths,n.useBlockParams=this.useBlockParams}else n.index=l.index,n.name="program"+l.index,this.useDepths=this.useDepths||l.useDepths,this.useBlockParams=this.useBlockParams||l.useBlockParams}},matchExistingProgram:function(e){for(var r=0,i=this.context.environments.length;r<i;r++){var n=this.context.environments[r];if(n&&n.equals(e))return n}},programExpression:function(e){var r=this.environment.children[e],i=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&i.push("blockParams"),this.useDepths&&i.push("depths"),"container.program("+i.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof nr||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new nr(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var r=["("],i=void 0,n=void 0,s=void 0;if(!this.isInline())throw new Oa.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof nr)i=[o.value],r=["(",i],s=!0;else{n=!0;var a=this.incrStack();r=["((",this.push(a)," = ",o,")"],i=this.topStack()}var l=e.call(this,i);s||this.popStack(),n&&this.stackSlot--,this.push(r.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var r=0,i=e.length;r<i;r++){var n=e[r];if(n instanceof nr)this.compileStack.push(n);else{var s=this.incrStack();this.pushSource([s," = ",n,";"]),this.compileStack.push(s)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var r=this.isInline(),i=(r?this.inlineStack:this.compileStack).pop();if(!e&&i instanceof nr)return i.value;if(!r){if(!this.stackSlot)throw new Oa.default("Invalid stack pop");this.stackSlot--}return i},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,r=e[e.length-1];return r instanceof nr?r.value:r},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var r=this.aliases[e];return r?(r.referenceCount++,r):(r=this.aliases[e]=this.source.wrap(e),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(e,r,i){var n=[],s=this.setupHelperArgs(r,e,n,i),o=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:n,paramsInit:s,name:o,callParams:[a].concat(n)}},setupParams:function(e,r,i){var n={},s=[],o=[],a=[],l=!i,c=void 0;l&&(i=[]),n.name=this.quotedString(e),n.hash=this.popStack(),this.trackIds&&(n.hashIds=this.popStack()),this.stringParams&&(n.hashTypes=this.popStack(),n.hashContexts=this.popStack());var f=this.popStack(),h=this.popStack();(h||f)&&(n.fn=h||"container.noop",n.inverse=f||"container.noop");for(var p=r;p--;)c=this.popStack(),i[p]=c,this.trackIds&&(a[p]=this.popStack()),this.stringParams&&(o[p]=this.popStack(),s[p]=this.popStack());return l&&(n.args=this.source.generateArray(i)),this.trackIds&&(n.ids=this.source.generateArray(a)),this.stringParams&&(n.types=this.source.generateArray(o),n.contexts=this.source.generateArray(s)),this.options.data&&(n.data="data"),this.useBlockParams&&(n.blockParams="blockParams"),n},setupHelperArgs:function(e,r,i,n){var s=this.setupParams(e,r,i);return s.loc=Rf(this),s=this.objectLiteral(s),n?(this.useRegister("options"),i.push("options"),["options=",s]):i?(i.push(s),""):s}};(function(){for(var t="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(" "),e=sr.RESERVED_WORDS={},r=0,i=t.length;r<i;r++)e[t[r]]=!0})();sr.isValidJavaScriptVariableName=function(t){return!sr.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)};function Rf(t){var e=t.source.currentLocation;return e?If.safeJsonLiteral(e):"undefined"}function Nb(t,e,r,i,n){var s=e.popStack(),o=r.length;t&&o--;for(var a=i;a<o;a++)s=e.nameLookup(s,r[a],n);return t?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(r[o]),", ",Rf(e)," )"]:s}Ln.default=sr;Lf.exports=Ln.default});var Bf=H((Nn,Ff)=>{"use strict";Nn.__esModule=!0;function Gr(t){return t&&t.__esModule?t:{default:t}}var Mb=Lh(),Fb=Gr(Mb),Bb=ta(),qb=Gr(Bb),Pa=Yh(),Ta=Xh(),Hb=Nf(),$b=Gr(Hb),jb=Cn(),Wb=Gr(jb),Vb=Qo(),zb=Gr(Vb),Ub=Fb.default.create;function Mf(){var t=Ub();return t.compile=function(e,r){return Ta.compile(e,r,t)},t.precompile=function(e,r){return Ta.precompile(e,r,t)},t.AST=qb.default,t.Compiler=Ta.Compiler,t.JavaScriptCompiler=$b.default,t.Parser=Pa.parser,t.parse=Pa.parse,t.parseWithoutProcessing=Pa.parseWithoutProcessing,t}var or=Mf();or.create=Mf;zb.default(or);or.Visitor=Wb.default;or.default=or;Nn.default=or;Ff.exports=Nn.default});var qf=H(Mn=>{"use strict";Mn.__esModule=!0;Mn.print=Jb;Mn.PrintVisitor=ne;function Gb(t){return t&&t.__esModule?t:{default:t}}var Yb=Cn(),Kb=Gb(Yb);function Jb(t){return new ne().accept(t)}function ne(){this.padding=0}ne.prototype=new Kb.default;ne.prototype.pad=function(t){for(var e="",r=0,i=this.padding;r<i;r++)e+=" ";return e+=t+`
|
|
51
|
-
`,e};
|
|
50
|
+
`.trim()},blockValue:function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(e,"call",r),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,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(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,r,n,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[s++])):this.pushContext(),this.resolvePath("context",e,s,r,n)},lookupBlockParam:function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(e,r,n){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(e,r,n,i,s){var o=this;if(this.options.strict||this.options.assumeObjects){this.push(qb(this.options.strict&&s,this,r,n,e));return}for(var a=r.length,l=function(f){o.replaceStack(function(h){var p=o.nameLookup(h,r[f],e);return i?[" && ",p]:[" != null ? ",p," : ",h]})},c=n;c<a;c++)l(c)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,e);this.decorators.push(["var decorator = ",n,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+r+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",i])," || fn;"])},invokeHelper:function(e,r,n){var i=this.popStack(),s=this.setupHelper(e,r),o=[];n&&o.push(s.name),o.push(i),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(o,"||"),")"],l=this.source.functionCall(a,"call",s.callParams);this.push(l)},itemsSeparatedBy:function(e,r){var n=[];n.push(e[0]);for(var i=1;i<e.length;i++)n.push(r,e[i]);return n},invokeKnownHelper:function(e,r){var n=this.setupHelper(e,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(e,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,e,r),s=this.lastHelper=this.nameLookup("helpers",e,"helper"),o=["(","(helper = ",s," || ",n,")"];this.options.strict||(o[0]="(helper = ",o.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",o,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(e,r,n){var i=[],s=this.setupParams(r,1,i);e&&(r=this.popStack(),delete s.name),n&&(s.indent=this.quotedString(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",e?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function(e){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var o=this.hash;n&&(o.contexts[e]=n),i&&(o.types[e]=i),s&&(o.ids[e]=s),o.values[e]=r},pushId:function(e,r,n){e==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+this.quotedString("."+n):"")):e==="PathExpression"?this.pushString(r):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:sr,compileChildren:function(e,r){for(var n=e.children,i=void 0,s=void 0,o=0,a=n.length;o<a;o++){i=n[o],s=new this.compiler;var l=this.matchExistingProgram(i);if(l==null){var c=this.context.programs.push("")-1;i.index=c,i.name="program"+c,this.context.programs[c]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[c]=s.decorators,this.context.environments[c]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=l.index,i.name="program"+l.index,this.useDepths=this.useDepths||l.useDepths,this.useBlockParams=this.useBlockParams||l.useBlockParams}},matchExistingProgram:function(e){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(e))return i}},programExpression:function(e){var r=this.environment.children[e],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof ir||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new ir(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var r=["("],n=void 0,i=void 0,s=void 0;if(!this.isInline())throw new Pa.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof ir)n=[o.value],r=["(",n],s=!0;else{i=!0;var a=this.incrStack();r=["((",this.push(a)," = ",o,")"],n=this.topStack()}var l=e.call(this,n);s||this.popStack(),i&&this.stackSlot--,this.push(r.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var r=0,n=e.length;r<n;r++){var i=e[r];if(i instanceof ir)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!e&&n instanceof ir)return n.value;if(!r){if(!this.stackSlot)throw new Pa.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,r=e[e.length-1];return r instanceof ir?r.value:r},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var r=this.aliases[e];return r?(r.referenceCount++,r):(r=this.aliases[e]=this.source.wrap(e),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(e,r,n){var i=[],s=this.setupHelperArgs(r,e,i,n),o=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:o,callParams:[a].concat(i)}},setupParams:function(e,r,n){var i={},s=[],o=[],a=[],l=!n,c=void 0;l&&(n=[]),i.name=this.quotedString(e),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),h=this.popStack();(h||f)&&(i.fn=h||"container.noop",i.inverse=f||"container.noop");for(var p=r;p--;)c=this.popStack(),n[p]=c,this.trackIds&&(a[p]=this.popStack()),this.stringParams&&(o[p]=this.popStack(),s[p]=this.popStack());return l&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(a)),this.stringParams&&(i.types=this.source.generateArray(o),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function(e,r,n,i){var s=this.setupParams(e,r,n);return s.loc=Ff(this),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s}};(function(){for(var t="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(" "),e=sr.RESERVED_WORDS={},r=0,n=t.length;r<n;r++)e[t[r]]=!0})();sr.isValidJavaScriptVariableName=function(t){return!sr.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)};function Ff(t){var e=t.source.currentLocation;return e?Mf.safeJsonLiteral(e):"undefined"}function qb(t,e,r,n,i){var s=e.popStack(),o=r.length;t&&o--;for(var a=n;a<o;a++)s=e.nameLookup(s,r[a],i);return t?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(r[o]),", ",Ff(e)," )"]:s}Ni.default=sr;Bf.exports=Ni.default});var jf=H((Mi,$f)=>{"use strict";Mi.__esModule=!0;function Gr(t){return t&&t.__esModule?t:{default:t}}var Hb=Bh(),$b=Gr(Hb),jb=ra(),Wb=Gr(jb),Ta=Zh(),Da=nf(),Vb=qf(),zb=Gr(Vb),Ub=ki(),Gb=Gr(Ub),Yb=Zo(),Kb=Gr(Yb),Jb=$b.default.create;function Hf(){var t=Jb();return t.compile=function(e,r){return Da.compile(e,r,t)},t.precompile=function(e,r){return Da.precompile(e,r,t)},t.AST=Wb.default,t.Compiler=Da.Compiler,t.JavaScriptCompiler=zb.default,t.Parser=Ta.parser,t.parse=Ta.parse,t.parseWithoutProcessing=Ta.parseWithoutProcessing,t}var or=Hf();or.create=Hf;Kb.default(or);or.Visitor=Gb.default;or.default=or;Mi.default=or;$f.exports=Mi.default});var Wf=H(Fi=>{"use strict";Fi.__esModule=!0;Fi.print=ew;Fi.PrintVisitor=se;function Qb(t){return t&&t.__esModule?t:{default:t}}var Zb=ki(),Xb=Qb(Zb);function ew(t){return new se().accept(t)}function se(){this.padding=0}se.prototype=new Xb.default;se.prototype.pad=function(t){for(var e="",r=0,n=this.padding;r<n;r++)e+=" ";return e+=t+`
|
|
51
|
+
`,e};se.prototype.Program=function(t){var e="",r=t.body,n=void 0,i=void 0;if(t.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=t.blockParams.length;n<i;n++)s+=" "+t.blockParams[n];s+=" ]",e+=this.pad(s)}for(n=0,i=r.length;n<i;n++)e+=this.accept(r[n]);return this.padding--,e};se.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};se.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};se.prototype.BlockStatement=se.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};se.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};se.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};se.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};se.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};se.prototype.SubExpression=function(t){for(var e=t.params,r=[],n=void 0,i=0,s=e.length;i<s;i++)r.push(this.accept(e[i]));return e="["+r.join(", ")+"]",n=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+n};se.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};se.prototype.StringLiteral=function(t){return'"'+t.value+'"'};se.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};se.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};se.prototype.UndefinedLiteral=function(){return"UNDEFINED"};se.prototype.NullLiteral=function(){return"NULL"};se.prototype.Hash=function(t){for(var e=t.pairs,r=[],n=0,i=e.length;n<i;n++)r.push(this.accept(e[n]));return"HASH{"+r.join(", ")+"}"};se.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var Gf=H((X2,Uf)=>{var Bi=jf().default,zf=Wf();Bi.PrintVisitor=zf.PrintVisitor;Bi.print=zf.print;Uf.exports=Bi;function Vf(t,e){var r=Ve("fs"),n=r.readFileSync(e,"utf8");t.exports=Bi.compile(n)}typeof Ve<"u"&&Ve.extensions&&(Ve.extensions[".handlebars"]=Vf,Ve.extensions[".hbs"]=Vf)});import{readFile as id,writeFile as rd,access as kw,mkdir as Ew}from"node:fs/promises";import{resolve as Je,relative as Na}from"node:path";import{pathToFileURL as sd}from"node:url";function dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var be={},nn={},wt={},Ha;function mr(){if(Ha)return wt;Ha=1;function t(o){return typeof o>"u"||o===null}function e(o){return typeof o=="object"&&o!==null}function r(o){return Array.isArray(o)?o:t(o)?[]:[o]}function n(o,a){if(a){let l=Object.keys(a);for(let c=0,f=l.length;c<f;c+=1){let h=l[c];o[h]=a[h]}}return o}function i(o,a){let l="";for(let c=0;c<a;c+=1)l+=o;return l}function s(o){return o===0&&Number.NEGATIVE_INFINITY===1/o}return wt.isNothing=t,wt.isObject=e,wt.toArray=r,wt.repeat=i,wt.isNegativeZero=s,wt.extend=n,wt}var zi,$a;function gr(){if($a)return zi;$a=1;function t(r,n){let i="",s=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(i+='in "'+r.mark.name+'" '),i+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!n&&r.mark.snippet&&(i+=`
|
|
52
52
|
|
|
53
|
-
`+r.mark.snippet),s+" "+
|
|
54
|
-
`+h}let g=e(
|
|
53
|
+
`+r.mark.snippet),s+" "+i):s}function e(r,n){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(n){return this.name+": "+t(this,n)},zi=e,zi}var Ui,ja;function pd(){if(ja)return Ui;ja=1;let t=mr();function e(i,s,o,a,l){let c="",f="",h=Math.floor(l/2)-1;return a-s>h&&(c=" ... ",s=a-h+c.length),o-a>h&&(f=" ...",o=a+h-f.length),{str:c+i.slice(s,o).replace(/\t/g,"\u2192")+f,pos:a-s+c.length}}function r(i,s){return t.repeat(" ",s-i.length)+i}function n(i,s){if(s=Object.create(s||null),!i.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let o=/\r?\n|\r|\0/g,a=[0],l=[],c,f=-1;for(;c=o.exec(i.buffer);)l.push(c.index),a.push(c.index+c[0].length),i.position<=c.index&&f<0&&(f=a.length-2);f<0&&(f=a.length-1);let h="",p=Math.min(i.line+s.linesAfter,l.length).toString().length,m=s.maxLength-(s.indent+p+3);for(let _=1;_<=s.linesBefore&&!(f-_<0);_++){let O=e(i.buffer,a[f-_],l[f-_],i.position-(a[f]-a[f-_]),m);h=t.repeat(" ",s.indent)+r((i.line-_+1).toString(),p)+" | "+O.str+`
|
|
54
|
+
`+h}let g=e(i.buffer,a[f],l[f],i.position,m);h+=t.repeat(" ",s.indent)+r((i.line+1).toString(),p)+" | "+g.str+`
|
|
55
55
|
`,h+=t.repeat("-",s.indent+p+3+g.pos)+`^
|
|
56
|
-
`;for(let _=1;_<=s.linesAfter&&!(f+_>=l.length);_++){let O=e(
|
|
57
|
-
`}return h.replace(/\n$/,"")}return
|
|
58
|
-
\r`;function r(o){if(o===null)return!1;let a=0,l=o.length,c=e;for(let f=0;f<l;f++){let h=c.indexOf(o.charAt(f));if(!(h>64)){if(h<0)return!1;a+=6}}return a%8===0}function
|
|
59
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function
|
|
60
|
-
`,y-1))}function Kr(u,y,E){let A,S,d,w,v,P,T=u.kind,D=u.result,C=u.input.charCodeAt(u.position);if(L(C)||N(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96)return!1;if(C===63||C===45){let R=u.input.charCodeAt(u.position+1);if(L(R)||E&&N(R))return!1}for(u.kind="scalar",u.result="",A=S=u.position,d=!1;C!==0;){if(C===58){let R=u.input.charCodeAt(u.position+1);if(L(R)||E&&N(R))break}else if(C===35){let R=u.input.charCodeAt(u.position-1);if(L(R))break}else{if(u.position===u.lineStart&&Qe(u)||E&&N(C))break;if(x(C))if(w=u.line,v=u.lineStart,P=u.lineIndent,
|
|
56
|
+
`;for(let _=1;_<=s.linesAfter&&!(f+_>=l.length);_++){let O=e(i.buffer,a[f+_],l[f+_],i.position-(a[f]-a[f+_]),m);h+=t.repeat(" ",s.indent)+r((i.line+_+1).toString(),p)+" | "+O.str+`
|
|
57
|
+
`}return h.replace(/\n$/,"")}return Ui=n,Ui}var Gi,Wa;function ke(){if(Wa)return Gi;Wa=1;let t=gr(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(s){let o={};return s!==null&&Object.keys(s).forEach(function(a){s[a].forEach(function(l){o[String(l)]=a})}),o}function i(s,o){if(o=o||{},Object.keys(o).forEach(function(a){if(e.indexOf(a)===-1)throw new t('Unknown option "'+a+'" is met in definition of "'+s+'" YAML type.')}),this.options=o,this.tag=s,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(a){return a},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=n(o.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return Gi=i,Gi}var Yi,Va;function hl(){if(Va)return Yi;Va=1;let t=gr(),e=ke();function r(s,o){let a=[];return s[o].forEach(function(l){let c=a.length;a.forEach(function(f,h){f.tag===l.tag&&f.kind===l.kind&&f.multi===l.multi&&(c=h)}),a[c]=l}),a}function n(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(a){a.multi?(s.multi[a.kind].push(a),s.multi.fallback.push(a)):s[a.kind][a.tag]=s.fallback[a.tag]=a}for(let a=0,l=arguments.length;a<l;a+=1)arguments[a].forEach(o);return s}function i(s){return this.extend(s)}return i.prototype.extend=function(o){let a=[],l=[];if(o instanceof e)l.push(o);else if(Array.isArray(o))l=l.concat(o);else if(o&&(Array.isArray(o.implicit)||Array.isArray(o.explicit)))o.implicit&&(a=a.concat(o.implicit)),o.explicit&&(l=l.concat(o.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");a.forEach(function(f){if(!(f instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(f){if(!(f instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let c=Object.create(i.prototype);return c.implicit=(this.implicit||[]).concat(a),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=n(c.compiledImplicit,c.compiledExplicit),c},Yi=i,Yi}var Ki,za;function fl(){if(za)return Ki;za=1;let t=ke();return Ki=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ki}var Ji,Ua;function dl(){if(Ua)return Ji;Ua=1;let t=ke();return Ji=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ji}var Qi,Ga;function pl(){if(Ga)return Qi;Ga=1;let t=ke();return Qi=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Qi}var Zi,Ya;function ml(){if(Ya)return Zi;Ya=1;let t=hl();return Zi=new t({explicit:[fl(),dl(),pl()]}),Zi}var Xi,Ka;function gl(){if(Ka)return Xi;Ka=1;let t=ke();function e(i){if(i===null)return!0;let s=i.length;return s===1&&i==="~"||s===4&&(i==="null"||i==="Null"||i==="NULL")}function r(){return null}function n(i){return i===null}return Xi=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:r,predicate:n,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Xi}var es,Ja;function yl(){if(Ja)return es;Ja=1;let t=ke();function e(i){if(i===null)return!1;let s=i.length;return s===4&&(i==="true"||i==="True"||i==="TRUE")||s===5&&(i==="false"||i==="False"||i==="FALSE")}function r(i){return i==="true"||i==="True"||i==="TRUE"}function n(i){return Object.prototype.toString.call(i)==="[object Boolean]"}return es=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:r,predicate:n,represent:{lowercase:function(i){return i?"true":"false"},uppercase:function(i){return i?"TRUE":"FALSE"},camelcase:function(i){return i?"True":"False"}},defaultStyle:"lowercase"}),es}var ts,Qa;function _l(){if(Qa)return ts;Qa=1;let t=mr(),e=ke();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}function n(c){return c>=48&&c<=55}function i(c){return c>=48&&c<=57}function s(c){if(c===null)return!1;let f=c.length,h=0,p=!1;if(!f)return!1;let m=c[h];if((m==="-"||m==="+")&&(m=c[++h]),m==="0"){if(h+1===f)return!0;if(m=c[++h],m==="b"){for(h++;h<f;h++){if(m=c[h],m!=="0"&&m!=="1")return!1;p=!0}return p&&isFinite(o(c))}if(m==="x"){for(h++;h<f;h++){if(!r(c.charCodeAt(h)))return!1;p=!0}return p&&isFinite(o(c))}if(m==="o"){for(h++;h<f;h++){if(!n(c.charCodeAt(h)))return!1;p=!0}return p&&isFinite(o(c))}}for(;h<f;h++){if(!i(c.charCodeAt(h)))return!1;p=!0}return p?isFinite(o(c)):!1}function o(c){let f=c,h=1,p=f[0];if((p==="-"||p==="+")&&(p==="-"&&(h=-1),f=f.slice(1),p=f[0]),f==="0")return 0;if(p==="0"){if(f[1]==="b")return h*parseInt(f.slice(2),2);if(f[1]==="x")return h*parseInt(f.slice(2),16);if(f[1]==="o")return h*parseInt(f.slice(2),8)}return h*parseInt(f,10)}function a(c){return o(c)}function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!t.isNegativeZero(c)}return ts=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:a,predicate:l,represent:{binary:function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},octal:function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},decimal:function(c){return c.toString(10)},hexadecimal:function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ts}var rs,Za;function bl(){if(Za)return rs;Za=1;let t=mr(),e=ke(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(c){return c===null||!r.test(c)?!1:isFinite(parseFloat(c,10))?!0:n.test(c)}function s(c){let f=c.toLowerCase(),h=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:h*parseFloat(f,10)}let o=/^[-+]?[0-9]+e/;function a(c,f){if(isNaN(c))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(c))return"-0.0";let h=c.toString(10);return o.test(h)?h.replace("e",".e"):h}function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||t.isNegativeZero(c))}return rs=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:s,predicate:l,represent:a,defaultStyle:"lowercase"}),rs}var ns,Xa;function wl(){return Xa||(Xa=1,ns=ml().extend({implicit:[gl(),yl(),_l(),bl()]})),ns}var is,el;function vl(){return el||(el=1,is=wl()),is}var ss,tl;function Sl(){if(tl)return ss;tl=1;let t=ke(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(o){return o===null?!1:e.exec(o)!==null||r.exec(o)!==null}function i(o){let a=0,l=null,c=e.exec(o);if(c===null&&(c=r.exec(o)),c===null)throw new Error("Date resolve error");let f=+c[1],h=+c[2]-1,p=+c[3];if(!c[4])return new Date(Date.UTC(f,h,p));let m=+c[4],g=+c[5],_=+c[6];if(c[7]){for(a=c[7].slice(0,3);a.length<3;)a+="0";a=+a}if(c[9]){let b=+c[10],x=+(c[11]||0);l=(b*60+x)*6e4,c[9]==="-"&&(l=-l)}let O=new Date(Date.UTC(f,h,p,m,g,_,a));return l&&O.setTime(O.getTime()-l),O}function s(o){return o.toISOString()}return ss=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:s}),ss}var os,rl;function xl(){if(rl)return os;rl=1;let t=ke();function e(r){return r==="<<"||r===null}return os=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),os}var as,nl;function Cl(){if(nl)return as;nl=1;let t=ke(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
58
|
+
\r`;function r(o){if(o===null)return!1;let a=0,l=o.length,c=e;for(let f=0;f<l;f++){let h=c.indexOf(o.charAt(f));if(!(h>64)){if(h<0)return!1;a+=6}}return a%8===0}function n(o){let a=o.replace(/[\r\n=]/g,""),l=a.length,c=e,f=0,h=[];for(let m=0;m<l;m++)m%4===0&&m&&(h.push(f>>16&255),h.push(f>>8&255),h.push(f&255)),f=f<<6|c.indexOf(a.charAt(m));let p=l%4*6;return p===0?(h.push(f>>16&255),h.push(f>>8&255),h.push(f&255)):p===18?(h.push(f>>10&255),h.push(f>>2&255)):p===12&&h.push(f>>4&255),new Uint8Array(h)}function i(o){let a="",l=0,c=o.length,f=e;for(let p=0;p<c;p++)p%3===0&&p&&(a+=f[l>>18&63],a+=f[l>>12&63],a+=f[l>>6&63],a+=f[l&63]),l=(l<<8)+o[p];let h=c%3;return h===0?(a+=f[l>>18&63],a+=f[l>>12&63],a+=f[l>>6&63],a+=f[l&63]):h===2?(a+=f[l>>10&63],a+=f[l>>4&63],a+=f[l<<2&63],a+=f[64]):h===1&&(a+=f[l>>2&63],a+=f[l<<4&63],a+=f[64],a+=f[64]),a}function s(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return as=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:s,represent:i}),as}var ls,il;function kl(){if(il)return ls;il=1;let t=ke(),e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(s){if(s===null)return!0;let o={},a=s;for(let l=0,c=a.length;l<c;l+=1){let f=a[l],h=!1;if(r.call(f)!=="[object Object]")return!1;let p;for(p in f)if(e.call(f,p))if(!h)h=!0;else return!1;if(!h||e.call(o,p))return!1;Object.defineProperty(o,p,{value:!0})}return!0}function i(s){return s!==null?s:[]}return ls=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n,construct:i}),ls}var cs,sl;function El(){if(sl)return cs;sl=1;let t=ke(),e=Object.prototype.toString;function r(i){if(i===null)return!0;let s=i,o=new Array(s.length);for(let a=0,l=s.length;a<l;a+=1){let c=s[a];if(e.call(c)!=="[object Object]")return!1;let f=Object.keys(c);if(f.length!==1)return!1;o[a]=[f[0],c[f[0]]]}return!0}function n(i){if(i===null)return[];let s=i,o=new Array(s.length);for(let a=0,l=s.length;a<l;a+=1){let c=s[a],f=Object.keys(c);o[a]=[f[0],c[f[0]]]}return o}return cs=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:n}),cs}var us,ol;function Al(){if(ol)return us;ol=1;let t=ke(),e=Object.prototype.hasOwnProperty;function r(i){if(i===null)return!0;let s=i;for(let o in s)if(e.call(s,o)&&s[o]!==null)return!1;return!0}function n(i){return i!==null?i:{}}return us=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:n}),us}var hs,al;function ds(){return al||(al=1,hs=vl().extend({implicit:[Sl(),xl()],explicit:[Cl(),kl(),El(),Al()]})),hs}var ll;function md(){if(ll)return nn;ll=1;let t=mr(),e=gr(),r=pd(),n=ds(),i=Object.prototype.hasOwnProperty,s=1,o=2,a=3,l=4,c=1,f=2,h=3,p=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/[\x85\u2028\u2029]/,g=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,O=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(u){return Object.prototype.toString.call(u)}function x(u){return u===10||u===13}function I(u){return u===9||u===32}function L(u){return u===9||u===32||u===10||u===13}function N(u){return u===44||u===91||u===93||u===123||u===125}function V(u){if(u>=48&&u<=57)return u-48;let y=u|32;return y>=97&&y<=102?y-97+10:-1}function B(u){return u===120?2:u===117?4:u===85?8:0}function Q(u){return u>=48&&u<=57?u-48:-1}function ee(u){switch(u){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
59
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function oe(u){return u<=65535?String.fromCharCode(u):String.fromCharCode((u-65536>>10)+55296,(u-65536&1023)+56320)}function ae(u,y,E){y==="__proto__"?Object.defineProperty(u,y,{configurable:!0,enumerable:!0,writable:!0,value:E}):u[y]=E}let pe=new Array(256),xe=new Array(256);for(let u=0;u<256;u++)pe[u]=ee(u)?1:0,xe[u]=ee(u);function q(u,y){this.input=u,this.filename=y.filename||null,this.schema=y.schema||n,this.onWarning=y.onWarning||null,this.legacy=y.legacy||!1,this.json=y.json||!1,this.listener=y.listener||null,this.maxDepth=typeof y.maxDepth=="number"?y.maxDepth:100,this.maxTotalMergeKeys=typeof y.maxTotalMergeKeys=="number"?y.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=u.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Me(u,y){let E={name:u.filename,buffer:u.input.slice(0,-1),position:u.position,line:u.line,column:u.position-u.lineStart};return E.snippet=r(E),new e(y,E)}function k(u,y){throw Me(u,y)}function K(u,y){u.onWarning&&u.onWarning.call(null,Me(u,y))}function ue(u,y,E){let A=u.anchorMapTransactions;if(A.length!==0){let S=A[A.length-1];i.call(S,y)||(S[y]={existed:i.call(u.anchorMap,y),value:u.anchorMap[y]})}u.anchorMap[y]=E}function mt(u){u.anchorMapTransactions.push(Object.create(null))}function Z(u){let y=u.anchorMapTransactions.pop(),E=u.anchorMapTransactions;if(E.length===0)return;let A=E[E.length-1],S=Object.keys(y);for(let d=0,w=S.length;d<w;d+=1){let v=S[d];i.call(A,v)||(A[v]=y[v])}}function We(u){let y=u.anchorMapTransactions.pop(),E=Object.keys(y);for(let A=E.length-1;A>=0;A-=1){let S=y[E[A]];S.existed?u.anchorMap[E[A]]=S.value:delete u.anchorMap[E[A]]}}function Ce(u){return{position:u.position,line:u.line,lineStart:u.lineStart,lineIndent:u.lineIndent,firstTabInLine:u.firstTabInLine,tag:u.tag,anchor:u.anchor,kind:u.kind,result:u.result}}function Ae(u,y){u.position=y.position,u.line=y.line,u.lineStart=y.lineStart,u.lineIndent=y.lineIndent,u.firstTabInLine=y.firstTabInLine,u.tag=y.tag,u.anchor=y.anchor,u.kind=y.kind,u.result=y.result}let st={YAML:function(y,E,A){y.version!==null&&k(y,"duplication of %YAML directive"),A.length!==1&&k(y,"YAML directive accepts exactly one argument");let S=/^([0-9]+)\.([0-9]+)$/.exec(A[0]);S===null&&k(y,"ill-formed argument of the YAML directive");let d=parseInt(S[1],10),w=parseInt(S[2],10);d!==1&&k(y,"unacceptable YAML version of the document"),y.version=A[0],y.checkLineBreaks=w<2,w!==1&&w!==2&&K(y,"unsupported YAML version of the document")},TAG:function(y,E,A){let S;A.length!==2&&k(y,"TAG directive accepts exactly two arguments");let d=A[0];S=A[1],_.test(d)||k(y,"ill-formed tag handle (first argument) of the TAG directive"),i.call(y.tagMap,d)&&k(y,'there is a previously declared suffix for "'+d+'" tag handle'),O.test(S)||k(y,"ill-formed tag prefix (second argument) of the TAG directive");try{S=decodeURIComponent(S)}catch{k(y,"tag prefix is malformed: "+S)}y.tagMap[d]=S}};function _e(u,y,E,A){if(y<E){let S=u.input.slice(y,E);if(A)for(let d=0,w=S.length;d<w;d+=1){let v=S.charCodeAt(d);v===9||v>=32&&v<=1114111||k(u,"expected valid JSON character")}else p.test(S)&&k(u,"the stream contains non-printable characters");u.result+=S}}function gt(u){u.totalMergeKeys++,u.maxTotalMergeKeys!==-1&&u.totalMergeKeys>u.maxTotalMergeKeys&&k(u,"merge keys exceeded maxTotalMergeKeys ("+u.maxTotalMergeKeys+")")}function cr(u,y,E,A){t.isObject(E)||k(u,"cannot merge mappings; the provided source object is unacceptable"),gt(u);let S=Object.keys(E);for(let d=0,w=S.length;d<w;d+=1){let v=S[d];gt(u),i.call(y,v)||(ae(y,v,E[v]),A[v]=!0)}}function ot(u,y,E,A,S,d,w,v,P){if(Array.isArray(S)){S=Array.prototype.slice.call(S);for(let T=0,D=S.length;T<D;T+=1)Array.isArray(S[T])&&k(u,"nested arrays are not supported inside keys"),typeof S=="object"&&b(S[T])==="[object Object]"&&(S[T]="[object Object]")}if(typeof S=="object"&&b(S)==="[object Object]"&&(S="[object Object]"),S=String(S),y===null&&(y={}),A==="tag:yaml.org,2002:merge")if(Array.isArray(d)){d.length>100&&k(u,"abnormal merge sequence size");for(let T=0,D=d.length;T<D;T+=1)cr(u,y,d[T],E)}else cr(u,y,d,E);else!u.json&&!i.call(E,S)&&i.call(y,S)&&(u.line=w||u.line,u.lineStart=v||u.lineStart,u.position=P||u.position,k(u,"duplicated mapping key")),ae(y,S,d),delete E[S];return y}function ur(u){let y=u.input.charCodeAt(u.position);y===10?u.position++:y===13?(u.position++,u.input.charCodeAt(u.position)===10&&u.position++):k(u,"a line break is expected"),u.line+=1,u.lineStart=u.position,u.firstTabInLine=-1}function ne(u,y,E){let A=0,S=u.input.charCodeAt(u.position);for(;S!==0;){for(;I(S);)S===9&&u.firstTabInLine===-1&&(u.firstTabInLine=u.position),S=u.input.charCodeAt(++u.position);if(y&&S===35)do S=u.input.charCodeAt(++u.position);while(S!==10&&S!==13&&S!==0);if(x(S))for(ur(u),S=u.input.charCodeAt(u.position),A++,u.lineIndent=0;S===32;)u.lineIndent++,S=u.input.charCodeAt(++u.position);else break}return E!==-1&&A!==0&&u.lineIndent<E&&K(u,"deficient indentation"),A}function Qe(u){let y=u.position,E=u.input.charCodeAt(y);return!!((E===45||E===46)&&E===u.input.charCodeAt(y+1)&&E===u.input.charCodeAt(y+2)&&(y+=3,E=u.input.charCodeAt(y),E===0||L(E)))}function $t(u,y){y===1?u.result+=" ":y>1&&(u.result+=t.repeat(`
|
|
60
|
+
`,y-1))}function Kr(u,y,E){let A,S,d,w,v,P,T=u.kind,D=u.result,C=u.input.charCodeAt(u.position);if(L(C)||N(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96)return!1;if(C===63||C===45){let R=u.input.charCodeAt(u.position+1);if(L(R)||E&&N(R))return!1}for(u.kind="scalar",u.result="",A=S=u.position,d=!1;C!==0;){if(C===58){let R=u.input.charCodeAt(u.position+1);if(L(R)||E&&N(R))break}else if(C===35){let R=u.input.charCodeAt(u.position-1);if(L(R))break}else{if(u.position===u.lineStart&&Qe(u)||E&&N(C))break;if(x(C))if(w=u.line,v=u.lineStart,P=u.lineIndent,ne(u,!1,-1),u.lineIndent>=y){d=!0,C=u.input.charCodeAt(u.position);continue}else{u.position=S,u.line=w,u.lineStart=v,u.lineIndent=P;break}}d&&(_e(u,A,S,!1),$t(u,u.line-w),A=S=u.position,d=!1),I(C)||(S=u.position+1),C=u.input.charCodeAt(++u.position)}return _e(u,A,S,!1),u.result?!0:(u.kind=T,u.result=D,!1)}function hr(u,y){let E,A,S=u.input.charCodeAt(u.position);if(S!==39)return!1;for(u.kind="scalar",u.result="",u.position++,E=A=u.position;(S=u.input.charCodeAt(u.position))!==0;)if(S===39)if(_e(u,E,u.position,!0),S=u.input.charCodeAt(++u.position),S===39)E=u.position,u.position++,A=u.position;else return!0;else x(S)?(_e(u,E,A,!0),$t(u,ne(u,!1,y)),E=A=u.position):u.position===u.lineStart&&Qe(u)?k(u,"unexpected end of the document within a single quoted scalar"):(u.position++,I(S)||(A=u.position));k(u,"unexpected end of the stream within a single quoted scalar")}function Jr(u,y){let E,A,S,d=u.input.charCodeAt(u.position);if(d!==34)return!1;for(u.kind="scalar",u.result="",u.position++,E=A=u.position;(d=u.input.charCodeAt(u.position))!==0;){if(d===34)return _e(u,E,u.position,!0),u.position++,!0;if(d===92){if(_e(u,E,u.position,!0),d=u.input.charCodeAt(++u.position),x(d))ne(u,!1,y);else if(d<256&&pe[d])u.result+=xe[d],u.position++;else if((S=B(d))>0){let w=S,v=0;for(;w>0;w--)d=u.input.charCodeAt(++u.position),(S=V(d))>=0?v=(v<<4)+S:k(u,"expected hexadecimal character");u.result+=oe(v),u.position++}else k(u,"unknown escape sequence");E=A=u.position}else x(d)?(_e(u,E,A,!0),$t(u,ne(u,!1,y)),E=A=u.position):u.position===u.lineStart&&Qe(u)?k(u,"unexpected end of the document within a double quoted scalar"):(u.position++,I(d)||(A=u.position))}k(u,"unexpected end of the stream within a double quoted scalar")}function Qr(u,y){let E=!0,A,S,d,w=u.tag,v,P=u.anchor,T,D,C,R,M=Object.create(null),$,W,z,U=u.input.charCodeAt(u.position);if(U===91)T=93,R=!1,v=[];else if(U===123)T=125,R=!0,v={};else return!1;for(u.anchor!==null&&ue(u,u.anchor,v),U=u.input.charCodeAt(++u.position);U!==0;){if(ne(u,!0,y),U=u.input.charCodeAt(u.position),U===T)return u.position++,u.tag=w,u.anchor=P,u.kind=R?"mapping":"sequence",u.result=v,!0;if(E?U===44&&k(u,"expected the node content, but found ','"):k(u,"missed comma between flow collection entries"),W=$=z=null,D=C=!1,U===63){let bt=u.input.charCodeAt(u.position+1);L(bt)&&(D=C=!0,u.position++,ne(u,!0,y))}A=u.line,S=u.lineStart,d=u.position,_t(u,y,s,!1,!0),W=u.tag,$=u.result,ne(u,!0,y),U=u.input.charCodeAt(u.position),(C||u.line===A)&&U===58&&(D=!0,U=u.input.charCodeAt(++u.position),ne(u,!0,y),_t(u,y,s,!1,!0),z=u.result),R?ot(u,v,M,W,$,z,A,S,d):D?v.push(ot(u,null,M,W,$,z,A,S,d)):v.push($),ne(u,!0,y),U=u.input.charCodeAt(u.position),U===44?(E=!0,U=u.input.charCodeAt(++u.position)):E=!1}k(u,"unexpected end of the stream within a flow collection")}function yt(u,y){let E,A=c,S=!1,d=!1,w=y,v=0,P=!1,T,D=u.input.charCodeAt(u.position);if(D===124)E=!1;else if(D===62)E=!0;else return!1;for(u.kind="scalar",u.result="";D!==0;)if(D=u.input.charCodeAt(++u.position),D===43||D===45)c===A?A=D===43?h:f:k(u,"repeat of a chomping mode identifier");else if((T=Q(D))>=0)T===0?k(u,"bad explicit indentation width of a block scalar; it cannot be less than one"):d?k(u,"repeat of an indentation width identifier"):(w=y+T-1,d=!0);else break;if(I(D)){do D=u.input.charCodeAt(++u.position);while(I(D));if(D===35)do D=u.input.charCodeAt(++u.position);while(!x(D)&&D!==0)}for(;D!==0;){for(ur(u),u.lineIndent=0,D=u.input.charCodeAt(u.position);(!d||u.lineIndent<w)&&D===32;)u.lineIndent++,D=u.input.charCodeAt(++u.position);if(!d&&u.lineIndent>w&&(w=u.lineIndent),x(D)){v++;continue}if(!d&&w===0&&k(u,"missing indentation for block scalar"),u.lineIndent<w){A===h?u.result+=t.repeat(`
|
|
61
61
|
`,S?1+v:v):A===c&&S&&(u.result+=`
|
|
62
62
|
`);break}E?I(D)?(P=!0,u.result+=t.repeat(`
|
|
63
63
|
`,S?1+v:v)):P?(P=!1,u.result+=t.repeat(`
|
|
64
64
|
`,v+1)):v===0?S&&(u.result+=" "):u.result+=t.repeat(`
|
|
65
65
|
`,v):u.result+=t.repeat(`
|
|
66
|
-
`,S?1+v:v),S=!0,d=!0,v=0;let C=u.position;for(;!x(D)&&D!==0;)D=u.input.charCodeAt(++u.position);_e(u,C,u.position,!1)}return!0}function Zr(u,y){let E=u.tag,A=u.anchor,S=[],d=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&ue(u,u.anchor,S);let w=u.input.charCodeAt(u.position);for(;w!==0&&(u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,k(u,"tab characters must not be used in indentation")),w===45);){let v=u.input.charCodeAt(u.position+1);if(!L(v))break;if(d=!0,u.position++,
|
|
67
|
-
`),u.charCodeAt(0)===65279&&(u=u.slice(1)));let E=new q(u,y),A=u.indexOf("\0");for(A!==-1&&(E.position=A,k(E,"null byte is not allowed in input")),E.input+="\0";E.input.charCodeAt(E.position)===32;)E.lineIndent+=1,E.position+=1;for(;E.position<E.length-1;)
|
|
66
|
+
`,S?1+v:v),S=!0,d=!0,v=0;let C=u.position;for(;!x(D)&&D!==0;)D=u.input.charCodeAt(++u.position);_e(u,C,u.position,!1)}return!0}function Zr(u,y){let E=u.tag,A=u.anchor,S=[],d=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&ue(u,u.anchor,S);let w=u.input.charCodeAt(u.position);for(;w!==0&&(u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,k(u,"tab characters must not be used in indentation")),w===45);){let v=u.input.charCodeAt(u.position+1);if(!L(v))break;if(d=!0,u.position++,ne(u,!0,-1)&&u.lineIndent<=y){S.push(null),w=u.input.charCodeAt(u.position);continue}let P=u.line;if(_t(u,y,a,!1,!0),S.push(u.result),ne(u,!0,-1),w=u.input.charCodeAt(u.position),(u.line===P||u.lineIndent>y)&&w!==0)k(u,"bad indentation of a sequence entry");else if(u.lineIndent<y)break}return d?(u.tag=E,u.anchor=A,u.kind="sequence",u.result=S,!0):!1}function Xr(u,y,E){let A,S,d,w,v=u.tag,P=u.anchor,T={},D=Object.create(null),C=null,R=null,M=null,$=!1,W=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&ue(u,u.anchor,T);let z=u.input.charCodeAt(u.position);for(;z!==0;){!$&&u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,k(u,"tab characters must not be used in indentation"));let U=u.input.charCodeAt(u.position+1),bt=u.line;if((z===63||z===58)&&L(U))z===63?($&&(ot(u,T,D,C,R,null,S,d,w),C=R=M=null),W=!0,$=!0,A=!0):$?($=!1,A=!0):k(u,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),u.position+=1,z=U;else{if(S=u.line,d=u.lineStart,w=u.position,!_t(u,E,o,!1,!0))break;if(u.line===bt){for(z=u.input.charCodeAt(u.position);I(z);)z=u.input.charCodeAt(++u.position);if(z===58)z=u.input.charCodeAt(++u.position),L(z)||k(u,"a whitespace character is expected after the key-value separator within a block mapping"),$&&(ot(u,T,D,C,R,null,S,d,w),C=R=M=null),W=!0,$=!1,A=!1,C=u.tag,R=u.result;else if(W)k(u,"can not read an implicit mapping pair; a colon is missed");else return u.tag=v,u.anchor=P,!0}else if(W)k(u,"can not read a block mapping entry; a multiline key may not be an implicit key");else return u.tag=v,u.anchor=P,!0}if((u.line===bt||u.lineIndent>y)&&($&&(S=u.line,d=u.lineStart,w=u.position),_t(u,y,l,!0,A)&&($?R=u.result:M=u.result),$||(ot(u,T,D,C,R,M,S,d,w),C=R=M=null),ne(u,!0,-1),z=u.input.charCodeAt(u.position)),(u.line===bt||u.lineIndent>y)&&z!==0)k(u,"bad indentation of a mapping entry");else if(u.lineIndent<y)break}return $&&ot(u,T,D,C,R,null,S,d,w),W&&(u.tag=v,u.anchor=P,u.kind="mapping",u.result=T),W}function en(u){let y=!1,E=!1,A,S,d=u.input.charCodeAt(u.position);if(d!==33)return!1;u.tag!==null&&k(u,"duplication of a tag property"),d=u.input.charCodeAt(++u.position),d===60?(y=!0,d=u.input.charCodeAt(++u.position)):d===33?(E=!0,A="!!",d=u.input.charCodeAt(++u.position)):A="!";let w=u.position;if(y){do d=u.input.charCodeAt(++u.position);while(d!==0&&d!==62);u.position<u.length?(S=u.input.slice(w,u.position),d=u.input.charCodeAt(++u.position)):k(u,"unexpected end of the stream within a verbatim tag")}else{for(;d!==0&&!L(d);)d===33&&(E?k(u,"tag suffix cannot contain exclamation marks"):(A=u.input.slice(w-1,u.position+1),_.test(A)||k(u,"named tag handle cannot contain such characters"),E=!0,w=u.position+1)),d=u.input.charCodeAt(++u.position);S=u.input.slice(w,u.position),g.test(S)&&k(u,"tag suffix cannot contain flow indicator characters")}S&&!O.test(S)&&k(u,"tag name cannot contain such characters: "+S);try{S=decodeURIComponent(S)}catch{k(u,"tag name is malformed: "+S)}return y?u.tag=S:i.call(u.tagMap,A)?u.tag=u.tagMap[A]+S:A==="!"?u.tag="!"+S:A==="!!"?u.tag="tag:yaml.org,2002:"+S:k(u,'undeclared tag handle "'+A+'"'),!0}function tn(u){let y=u.input.charCodeAt(u.position);if(y!==38)return!1;u.anchor!==null&&k(u,"duplication of an anchor property"),y=u.input.charCodeAt(++u.position);let E=u.position;for(;y!==0&&!L(y)&&!N(y);)y=u.input.charCodeAt(++u.position);return u.position===E&&k(u,"name of an anchor node must contain at least one character"),u.anchor=u.input.slice(E,u.position),!0}function Hi(u){let y=u.input.charCodeAt(u.position);if(y!==42)return!1;y=u.input.charCodeAt(++u.position);let E=u.position;for(;y!==0&&!L(y)&&!N(y);)y=u.input.charCodeAt(++u.position);u.position===E&&k(u,"name of an alias node must contain at least one character");let A=u.input.slice(E,u.position);return i.call(u.anchorMap,A)||k(u,'unidentified alias "'+A+'"'),u.result=u.anchorMap[A],ne(u,!0,-1),!0}function rn(u,y,E,A){let S=Ce(u);return mt(u),Ae(u,y),u.tag=null,u.anchor=null,u.kind=null,u.result=null,Xr(u,E,A)&&u.kind==="mapping"?(Z(u),!0):(We(u),Ae(u,S),!1)}function _t(u,y,E,A,S){let d,w,v=1,P=!1,T=!1,D=null,C,R,M;u.depth>=u.maxDepth&&k(u,"nesting exceeded maxDepth ("+u.maxDepth+")"),u.depth+=1,u.listener!==null&&u.listener("open",u),u.tag=null,u.anchor=null,u.kind=null,u.result=null;let $=d=w=l===E||a===E;if(A&&ne(u,!0,-1)&&(P=!0,u.lineIndent>y?v=1:u.lineIndent===y?v=0:u.lineIndent<y&&(v=-1)),v===1)for(;;){let W=u.input.charCodeAt(u.position),z=Ce(u);if(P&&(W===33&&u.tag!==null||W===38&&u.anchor!==null)||!en(u)&&!tn(u))break;D===null&&(D=z),ne(u,!0,-1)?(P=!0,w=$,u.lineIndent>y?v=1:u.lineIndent===y?v=0:u.lineIndent<y&&(v=-1)):w=!1}if(w&&(w=P||S),v===1||l===E)if(s===E||o===E?R=y:R=y+1,M=u.position-u.lineStart,v===1)if(w&&(Zr(u,M)||Xr(u,M,R))||Qr(u,R))T=!0;else{let W=u.input.charCodeAt(u.position);D!==null&&$&&!w&&W!==124&&W!==62&&rn(u,D,D.position-D.lineStart,R)||d&&yt(u,R)||hr(u,R)||Jr(u,R)?T=!0:Hi(u)?(T=!0,(u.tag!==null||u.anchor!==null)&&k(u,"alias node should not have any properties")):Kr(u,R,s===E)&&(T=!0,u.tag===null&&(u.tag="?")),u.anchor!==null&&ue(u,u.anchor,u.result)}else v===0&&(T=w&&Zr(u,M));if(u.tag===null)u.anchor!==null&&ue(u,u.anchor,u.result);else if(u.tag==="?"){u.result!==null&&u.kind!=="scalar"&&k(u,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+u.kind+'"');for(let W=0,z=u.implicitTypes.length;W<z;W+=1)if(C=u.implicitTypes[W],C.resolve(u.result)){u.result=C.construct(u.result),u.tag=C.tag,u.anchor!==null&&ue(u,u.anchor,u.result);break}}else if(u.tag!=="!"){if(i.call(u.typeMap[u.kind||"fallback"],u.tag))C=u.typeMap[u.kind||"fallback"][u.tag];else{C=null;let W=u.typeMap.multi[u.kind||"fallback"];for(let z=0,U=W.length;z<U;z+=1)if(u.tag.slice(0,W[z].tag.length)===W[z].tag){C=W[z];break}}C||k(u,"unknown tag !<"+u.tag+">"),u.result!==null&&C.kind!==u.kind&&k(u,"unacceptable node kind for !<"+u.tag+'> tag; it should be "'+C.kind+'", not "'+u.kind+'"'),C.resolve(u.result,u.tag)?(u.result=C.construct(u.result,u.tag),u.anchor!==null&&ue(u,u.anchor,u.result)):k(u,"cannot resolve a node with !<"+u.tag+"> explicit tag")}return u.listener!==null&&u.listener("close",u),u.depth-=1,u.tag!==null||u.anchor!==null||T}function $i(u){let y=u.position,E=!1,A;for(u.version=null,u.checkLineBreaks=u.legacy,u.tagMap=Object.create(null),u.anchorMap=Object.create(null);(A=u.input.charCodeAt(u.position))!==0&&(ne(u,!0,-1),A=u.input.charCodeAt(u.position),!(u.lineIndent>0||A!==37));){E=!0,A=u.input.charCodeAt(++u.position);let S=u.position;for(;A!==0&&!L(A);)A=u.input.charCodeAt(++u.position);let d=u.input.slice(S,u.position),w=[];for(d.length<1&&k(u,"directive name must not be less than one character in length");A!==0;){for(;I(A);)A=u.input.charCodeAt(++u.position);if(A===35){do A=u.input.charCodeAt(++u.position);while(A!==0&&!x(A));break}if(x(A))break;for(S=u.position;A!==0&&!L(A);)A=u.input.charCodeAt(++u.position);w.push(u.input.slice(S,u.position))}A!==0&&ur(u),i.call(st,d)?st[d](u,d,w):K(u,'unknown document directive "'+d+'"')}if(ne(u,!0,-1),u.lineIndent===0&&u.input.charCodeAt(u.position)===45&&u.input.charCodeAt(u.position+1)===45&&u.input.charCodeAt(u.position+2)===45?(u.position+=3,ne(u,!0,-1)):E&&k(u,"directives end mark is expected"),_t(u,u.lineIndent-1,l,!1,!0),ne(u,!0,-1),u.checkLineBreaks&&m.test(u.input.slice(y,u.position))&&K(u,"non-ASCII line breaks are interpreted as content"),u.documents.push(u.result),u.position===u.lineStart&&Qe(u)){u.input.charCodeAt(u.position)===46&&(u.position+=3,ne(u,!0,-1));return}u.position<u.length-1&&k(u,"end of the stream or a document separator is expected")}function fr(u,y){u=String(u),y=y||{},u.length!==0&&(u.charCodeAt(u.length-1)!==10&&u.charCodeAt(u.length-1)!==13&&(u+=`
|
|
67
|
+
`),u.charCodeAt(0)===65279&&(u=u.slice(1)));let E=new q(u,y),A=u.indexOf("\0");for(A!==-1&&(E.position=A,k(E,"null byte is not allowed in input")),E.input+="\0";E.input.charCodeAt(E.position)===32;)E.lineIndent+=1,E.position+=1;for(;E.position<E.length-1;)$i(E);return E.documents}function ji(u,y,E){y!==null&&typeof y=="object"&&typeof E>"u"&&(E=y,y=null);let A=fr(u,E);if(typeof y!="function")return A;for(let S=0,d=A.length;S<d;S+=1)y(A[S])}function Wi(u,y){let E=fr(u,y);if(E.length!==0){if(E.length===1)return E[0];throw new e("expected a single document in the stream, but found more")}}return nn.loadAll=ji,nn.load=Wi,nn}var fs={},cl;function gd(){if(cl)return fs;cl=1;let t=mr(),e=gr(),r=ds(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,o=9,a=10,l=13,c=32,f=33,h=34,p=35,m=37,g=38,_=39,O=42,b=44,x=45,I=58,L=61,N=62,V=63,B=64,Q=91,ee=93,oe=96,ae=123,pe=124,xe=125,q={};q[0]="\\0",q[7]="\\a",q[8]="\\b",q[9]="\\t",q[10]="\\n",q[11]="\\v",q[12]="\\f",q[13]="\\r",q[27]="\\e",q[34]='\\"',q[92]="\\\\",q[133]="\\N",q[160]="\\_",q[8232]="\\L",q[8233]="\\P";let Me=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],k=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function K(d,w){if(w===null)return{};let v={},P=Object.keys(w);for(let T=0,D=P.length;T<D;T+=1){let C=P[T],R=String(w[C]);C.slice(0,2)==="!!"&&(C="tag:yaml.org,2002:"+C.slice(2));let M=d.compiledTypeMap.fallback[C];M&&i.call(M.styleAliases,R)&&(R=M.styleAliases[R]),v[C]=R}return v}function ue(d){let w,v,P=d.toString(16).toUpperCase();if(d<=255)w="x",v=2;else if(d<=65535)w="u",v=4;else if(d<=4294967295)w="U",v=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+w+t.repeat("0",v-P.length)+P}let mt=1,Z=2;function We(d){this.schema=d.schema||r,this.indent=Math.max(1,d.indent||2),this.noArrayIndent=d.noArrayIndent||!1,this.skipInvalid=d.skipInvalid||!1,this.flowLevel=t.isNothing(d.flowLevel)?-1:d.flowLevel,this.styleMap=K(this.schema,d.styles||null),this.sortKeys=d.sortKeys||!1,this.lineWidth=d.lineWidth||80,this.noRefs=d.noRefs||!1,this.noCompatMode=d.noCompatMode||!1,this.condenseFlow=d.condenseFlow||!1,this.quotingType=d.quotingType==='"'?Z:mt,this.forceQuotes=d.forceQuotes||!1,this.replacer=typeof d.replacer=="function"?d.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ce(d,w){let v=t.repeat(" ",w),P=0,T="",D=d.length;for(;P<D;){let C,R=d.indexOf(`
|
|
68
68
|
`,P);R===-1?(C=d.slice(P),P=D):(C=d.slice(P,R+1),P=R+1),C.length&&C!==`
|
|
69
|
-
`&&(T+=v),T+=C}return T}function
|
|
70
|
-
`+t.repeat(" ",d.indent*w)}function st(d,w){for(let v=0,P=d.implicitTypes.length;v<P;v+=1)if(d.implicitTypes[v].resolve(w))return!0;return!1}function _e(d){return d===c||d===o}function gt(d){return d>=32&&d<=126||d>=161&&d<=55295&&d!==8232&&d!==8233||d>=57344&&d<=65533&&d!==s||d>=65536&&d<=1114111}function cr(d){return gt(d)&&d!==s&&d!==l&&d!==a}function ot(d,w,v){let P=cr(d),T=P&&!_e(d);return(v?P:P&&d!==b&&d!==
|
|
69
|
+
`&&(T+=v),T+=C}return T}function Ae(d,w){return`
|
|
70
|
+
`+t.repeat(" ",d.indent*w)}function st(d,w){for(let v=0,P=d.implicitTypes.length;v<P;v+=1)if(d.implicitTypes[v].resolve(w))return!0;return!1}function _e(d){return d===c||d===o}function gt(d){return d>=32&&d<=126||d>=161&&d<=55295&&d!==8232&&d!==8233||d>=57344&&d<=65533&&d!==s||d>=65536&&d<=1114111}function cr(d){return gt(d)&&d!==s&&d!==l&&d!==a}function ot(d,w,v){let P=cr(d),T=P&&!_e(d);return(v?P:P&&d!==b&&d!==Q&&d!==ee&&d!==ae&&d!==xe)&&d!==p&&!(w===I&&!T)||cr(w)&&!_e(w)&&d===p||w===I&&T}function ur(d){return gt(d)&&d!==s&&!_e(d)&&d!==x&&d!==V&&d!==I&&d!==b&&d!==Q&&d!==ee&&d!==ae&&d!==xe&&d!==p&&d!==g&&d!==O&&d!==f&&d!==pe&&d!==L&&d!==N&&d!==_&&d!==h&&d!==m&&d!==B&&d!==oe}function ne(d){return!_e(d)&&d!==I}function Qe(d,w){let v=d.charCodeAt(w),P;return v>=55296&&v<=56319&&w+1<d.length&&(P=d.charCodeAt(w+1),P>=56320&&P<=57343)?(v-55296)*1024+P-56320+65536:v}function $t(d){return/^\n* /.test(d)}let Kr=1,hr=2,Jr=3,Qr=4,yt=5;function Zr(d,w,v,P,T,D,C,R){let M,$=0,W=null,z=!1,U=!1,bt=P!==-1,dr=-1,pr=ur(Qe(d,0))&&ne(Qe(d,d.length-1));if(w||C)for(M=0;M<d.length;$>=65536?M+=2:M++){if($=Qe(d,M),!gt($))return yt;pr=pr&&ot($,W,R),W=$}else{for(M=0;M<d.length;$>=65536?M+=2:M++){if($=Qe(d,M),$===a)z=!0,bt&&(U=U||M-dr-1>P&&d[dr+1]!==" ",dr=M);else if(!gt($))return yt;pr=pr&&ot($,W,R),W=$}U=U||bt&&M-dr-1>P&&d[dr+1]!==" "}return!z&&!U?pr&&!C&&!T(d)?Kr:D===Z?yt:hr:v>9&&$t(d)?yt:C?D===Z?yt:hr:U?Qr:Jr}function Xr(d,w,v,P,T){d.dump=(function(){if(w.length===0)return d.quotingType===Z?'""':"''";if(!d.noCompatMode&&(Me.indexOf(w)!==-1||k.test(w)))return d.quotingType===Z?'"'+w+'"':"'"+w+"'";let D=d.indent*Math.max(1,v),C=d.lineWidth===-1?-1:Math.max(Math.min(d.lineWidth,40),d.lineWidth-D),R=P||d.flowLevel>-1&&v>=d.flowLevel;function M($){return st(d,$)}switch(Zr(w,R,d.indent,C,M,d.quotingType,d.forceQuotes&&!P,T)){case Kr:return w;case hr:return"'"+w.replace(/'/g,"''")+"'";case Jr:return"|"+en(w,d.indent)+tn(Ce(w,D));case Qr:return">"+en(w,d.indent)+tn(Ce(Hi(w,C),D));case yt:return'"'+_t(w)+'"';default:throw new e("impossible error: invalid scalar style")}})()}function en(d,w){let v=$t(d)?String(w):"",P=d[d.length-1]===`
|
|
71
71
|
`,D=P&&(d[d.length-2]===`
|
|
72
72
|
`||d===`
|
|
73
73
|
`)?"+":P?"":"-";return v+D+`
|
|
74
|
-
`}function
|
|
75
|
-
`?d.slice(0,-1):d}function
|
|
76
|
-
`);return R=R!==-1?R:d.length,v.lastIndex=R,
|
|
74
|
+
`}function tn(d){return d[d.length-1]===`
|
|
75
|
+
`?d.slice(0,-1):d}function Hi(d,w){let v=/(\n+)([^\n]*)/g,P=(function(){let R=d.indexOf(`
|
|
76
|
+
`);return R=R!==-1?R:d.length,v.lastIndex=R,rn(d.slice(0,R),w)})(),T=d[0]===`
|
|
77
77
|
`||d[0]===" ",D,C;for(;C=v.exec(d);){let R=C[1],M=C[2];D=M[0]===" ",P+=R+(!T&&!D&&M!==""?`
|
|
78
|
-
`:"")+
|
|
78
|
+
`:"")+rn(M,w),T=D}return P}function rn(d,w){if(d===""||d[0]===" ")return d;let v=/ [^ ]/g,P,T=0,D,C=0,R=0,M="";for(;P=v.exec(d);)R=P.index,R-T>w&&(D=C>T?C:R,M+=`
|
|
79
79
|
`+d.slice(T,D),T=D+1),C=R;return M+=`
|
|
80
80
|
`,d.length-T>w&&C>T?M+=d.slice(T,C)+`
|
|
81
|
-
`+d.slice(C+1):M+=d.slice(T),M.slice(1)}function _t(d){let w="",v=0;for(let P=0;P<d.length;v>=65536?P+=2:P++){v=Qe(d,P);let T=q[v];!T&>(v)?(w+=d[P],v>=65536&&(w+=d[P+1])):w+=T||ue(v)}return w}function
|
|
82
|
-
`:""}return hs.dump=S,hs}var cl;function dd(){if(cl)return be;cl=1;let t=hd(),e=fd();function r(i,n){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return be.Type=Ce(),be.Schema=ul(),be.FAILSAFE_SCHEMA=pl(),be.JSON_SCHEMA=bl(),be.CORE_SCHEMA=wl(),be.DEFAULT_SCHEMA=fs(),be.load=t.load,be.loadAll=t.loadAll,be.dump=e.dump,be.YAMLException=gr(),be.types={binary:xl(),float:_l(),map:dl(),null:ml(),pairs:kl(),set:El(),timestamp:vl(),bool:gl(),int:yl(),merge:Sl(),omap:Cl(),seq:fl(),str:hl()},be.safeLoad=r("safeLoad","load"),be.safeLoadAll=r("safeLoadAll","loadAll"),be.safeDump=r("safeDump","dump"),be}var pd=dd(),Ze=cd(pd),{Type:Ew,Schema:Aw,FAILSAFE_SCHEMA:Ow,JSON_SCHEMA:Pw,CORE_SCHEMA:Tw,DEFAULT_SCHEMA:Dw,load:Iw,loadAll:Rw,dump:Lw,YAMLException:Nw,types:Mw,safeLoad:Fw,safeLoadAll:Bw,safeDump:qw}=Ze;var j=Wn(Pl(),1);import{stat as Gd}from"fs";import{stat as Yd,readdir as Kd}from"fs/promises";import{EventEmitter as Jd}from"events";import*as G from"path";import{stat as _d,lstat as Tl,readdir as bd,realpath as wd}from"node:fs/promises";import{Readable as vd}from"node:stream";import{resolve as Dl,relative as Sd,join as xd,sep as Cd}from"node:path";var Pe={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},ps={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:Pe.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(ps);var Nl="READDIRP_RECURSIVE_ERROR",kd=new Set(["ENOENT","EPERM","EACCES","ELOOP",Nl]),Il=[Pe.DIR_TYPE,Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE,Pe.FILE_TYPE],Ed=new Set([Pe.DIR_TYPE,Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE]),Ad=new Set([Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE,Pe.FILE_TYPE]),Od=t=>kd.has(t.code),Pd=process.platform==="win32",Rl=t=>!0,Ll=t=>{if(t===void 0)return Rl;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(i=>r.basename===i)}return Rl},ms=class extends vd{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let r={...ps,...e},{root:i,type:n}=r;this._fileFilter=Ll(r.fileFilter),this._directoryFilter=Ll(r.directoryFilter);let s=r.lstat?Tl:_d;Pd?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=r.depth??ps.depth,this._wantsDir=n?Ed.has(n):!1,this._wantsFile=n?Ad.has(n):!1,this._wantsEverything=n===Pe.EVERYTHING_TYPE,this._root=Dl(i),this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,i=r&&r.files;if(i&&i.length>0){let{path:n,depth:s}=r,o=i.splice(0,e).map(l=>this._formatEntry(l,n)),a=await Promise.all(o);for(let l of a){if(!l)continue;if(this.destroyed)return;let c=await this._getEntryType(l);c==="directory"&&this._directoryFilter(l)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,s+1)),this._wantsDir&&(this.push(l),e--)):(c==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let n=this.parents.pop();if(!n){this.push(null);break}if(this.parent=await n,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let i;try{i=await bd(e,this._rdOptions)}catch(n){this._onError(n)}return{files:i,depth:r,path:e}}async _formatEntry(e,r){let i,n=this._isDirent?e.name:e;try{let s=Dl(xd(r,n));i={path:Sd(this._root,s),fullPath:s,basename:n},i[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(s){this._onError(s);return}return i}_onError(e){Od(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let r=e[this._statsProp];if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let i=e.fullPath;try{let n=await wd(i),s=await Tl(n);if(s.isFile())return"file";if(s.isDirectory()){let o=n.length;if(i.startsWith(n)&&i.substr(o,1)===Cd){let a=new Error(`Circular symlink detected: "${i}" points to "${n}"`);return a.code=Nl,this._onError(a)}return"directory"}}catch(n){return this._onError(n),""}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function Ml(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=Pe.FILE_DIR_TYPE),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Il.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Il.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new ms(e)}import{watchFile as Td,unwatchFile as Fl,watch as Dd}from"fs";import{open as Id,stat as ql,lstat as Rd,realpath as gs}from"fs/promises";import*as ee from"path";import{type as Ld}from"os";var Nd="data",bs="end",Hl="close",ui=()=>{};var hi=process.platform,ws=hi==="win32",Md=hi==="darwin",Fd=hi==="linux",Bd=hi==="freebsd",$l=Ld()==="OS400",te={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},ze=te,qd="watch",Hd={lstat:Rd,stat:ql},At="listeners",oi="errHandlers",jt="rawEmitters",$d=[At,oi,jt],jd=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Wd=t=>jd.has(ee.extname(t).slice(1).toLowerCase()),_s=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},yr=(t,e,r)=>{let i=t[e];i instanceof Set||(t[e]=i=new Set([i])),i.add(r)},Vd=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},_r=(t,e,r)=>{let i=t[e];i instanceof Set?i.delete(r):i===r&&delete t[e]},jl=t=>t instanceof Set?t.size===0:!t,ai=new Map;function Bl(t,e,r,i,n){let s=(o,a)=>{r(t),n(o,a,{watchedPath:t}),a&&t!==a&&li(ee.resolve(t,a),At,ee.join(t,a))};try{return Dd(t,{persistent:e.persistent},s)}catch(o){i(o);return}}var li=(t,e,r,i,n)=>{let s=ai.get(t);s&&_s(s[e],o=>{o(r,i,n)})},zd=(t,e,r,i)=>{let{listener:n,errHandler:s,rawEmitter:o}=i,a=ai.get(e),l;if(!r.persistent)return l=Bl(t,r,n,s,o),l?l.close.bind(l):void 0;if(a)yr(a,At,n),yr(a,oi,s),yr(a,jt,o);else{if(l=Bl(t,r,li.bind(null,e,At),s,li.bind(null,e,jt)),!l)return;l.on(ze.ERROR,async c=>{let f=li.bind(null,e,oi);if(a&&(a.watcherUnusable=!0),ws&&c.code==="EPERM")try{await(await Id(t,"r")).close(),f(c)}catch{}else f(c)}),a={listeners:n,errHandlers:s,rawEmitters:o,watcher:l},ai.set(e,a)}return()=>{_r(a,At,n),_r(a,oi,s),_r(a,jt,o),jl(a.listeners)&&(a.watcher.close(),ai.delete(e),$d.forEach(Vd(a)),a.watcher=void 0,Object.freeze(a))}},ys=new Map,Ud=(t,e,r,i)=>{let{listener:n,rawEmitter:s}=i,o=ys.get(e),a=o&&o.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&(Fl(e),o=void 0),o?(yr(o,At,n),yr(o,jt,s)):(o={listeners:n,rawEmitters:s,options:r,watcher:Td(e,r,(l,c)=>{_s(o.rawEmitters,h=>{h(ze.CHANGE,e,{curr:l,prev:c})});let f=l.mtimeMs;(l.size!==c.size||f>c.mtimeMs||f===0)&&_s(o.listeners,h=>h(t,l))})},ys.set(e,o)),()=>{_r(o,At,n),_r(o,jt,s),jl(o.listeners)&&(ys.delete(e),Fl(e),o.options=o.watcher=void 0,Object.freeze(o))}},ci=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let i=this.fsw.options,n=ee.dirname(e),s=ee.basename(e);this.fsw._getWatchedDir(n).add(s);let a=ee.resolve(e),l={persistent:i.persistent};r||(r=ui);let c;if(i.usePolling){let f=i.interval!==i.binaryInterval;l.interval=f&&Wd(s)?i.binaryInterval:i.interval,c=Ud(e,a,l,{listener:r,rawEmitter:this.fsw._emitRaw})}else c=zd(e,a,l,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return c}_handleFile(e,r,i){if(this.fsw.closed)return;let n=ee.dirname(e),s=ee.basename(e),o=this.fsw._getWatchedDir(n),a=r;if(o.has(s))return;let l=async(f,h)=>{if(this.fsw._throttle(qd,e,5)){if(!h||h.mtimeMs===0)try{let p=await ql(e);if(this.fsw.closed)return;let m=p.atimeMs,g=p.mtimeMs;if((!m||m<=g||g!==a.mtimeMs)&&this.fsw._emit(ze.CHANGE,e,p),(Md||Fd||Bd)&&a.ino!==p.ino){this.fsw._closeFile(f),a=p;let _=this._watchWithNodeFs(e,l);_&&this.fsw._addPathCloser(f,_)}else a=p}catch{this.fsw._remove(n,s)}else if(o.has(s)){let p=h.atimeMs,m=h.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(ze.CHANGE,e,h),a=h}}},c=this._watchWithNodeFs(e,l);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ze.ADD,e,0))return;this.fsw._emit(ze.ADD,e,r)}return c}async _handleSymlink(e,r,i,n){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await gs(i)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(n)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ze.CHANGE,i,e.stats)):(o.add(n),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ze.ADD,i,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,i,n,s,o,a){if(e=ee.join(e,""),a=this.fsw._throttle("readdir",e,1e3),!a)return;let l=this.fsw._getWatchedDir(i.path),c=new Set,f=this.fsw._readdirp(e,{fileFilter:h=>i.filterPath(h),directoryFilter:h=>i.filterDir(h)});if(f)return f.on(Nd,async h=>{if(this.fsw.closed){f=void 0;return}let p=h.path,m=ee.join(e,p);if(c.add(p),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,m,p))){if(this.fsw.closed){f=void 0;return}(p===n||!n&&!l.has(p))&&(this.fsw._incrReadyCount(),m=ee.join(s,ee.relative(s,m)),this._addToNodeFs(m,r,i,o+1))}}).on(ze.ERROR,this._boundHandleError),new Promise((h,p)=>{if(!f)return p();f.once(bs,()=>{if(this.fsw.closed){f=void 0;return}let m=a?a.clear():!1;h(void 0),l.getChildren().filter(g=>g!==e&&!c.has(g)).forEach(g=>{this.fsw._remove(e,g)}),f=void 0,m&&this._handleRead(e,!1,i,n,s,o,a)})})}async _handleDir(e,r,i,n,s,o,a){let l=this.fsw._getWatchedDir(ee.dirname(e)),c=l.has(ee.basename(e));!(i&&this.fsw.options.ignoreInitial)&&!s&&!c&&this.fsw._emit(ze.ADD_DIR,e,r),l.add(ee.basename(e)),this.fsw._getWatchedDir(e);let f,h,p=this.fsw.options.depth;if((p==null||n<=p)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,i,o,s,e,n,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(m,g)=>{g&&g.mtimeMs===0||this._handleRead(m,!1,o,s,e,n,f)})}return h}async _addToNodeFs(e,r,i,n,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e);i&&(a.filterPath=l=>i.filterPath(l),a.filterDir=l=>i.filterDir(l));try{let l=await Hd[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,l))return o(),!1;let c=this.fsw.options.followSymlinks,f;if(l.isDirectory()){let h=ee.resolve(e),p=c?await gs(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,l,r,n,s,a,p),this.fsw.closed))return;h!==p&&p!==void 0&&this.fsw._symlinkPaths.set(h,p)}else if(l.isSymbolicLink()){let h=c?await gs(e):e;if(this.fsw.closed)return;let p=ee.dirname(a.watchPath);if(this.fsw._getWatchedDir(p).add(a.watchPath),this.fsw._emit(ze.ADD,a.watchPath,l),f=await this._handleDir(p,l,r,n,e,a,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(ee.resolve(e),h)}else f=this._handleFile(a.watchPath,l,r);return o(),f&&this.fsw._addPathCloser(e,f),!1}catch(l){if(this.fsw._handleError(l))return o(),e}}};var vs="/",Qd="//",Yl=".",Zd="..",Xd="string",ep=/\\/g,Wl=/\/\//,tp=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,rp=/^\.[/\\]/;function fi(t){return Array.isArray(t)?t:[t]}var Ss=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function ip(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=G.relative(t.path,e);return r?!r.startsWith("..")&&!G.isAbsolute(r):!1}return!1}:()=>!1}function np(t){if(typeof t!="string")throw new Error("string expected");t=G.normalize(t),t=t.replace(/\\/g,"/");let e=!1;t.startsWith("//")&&(e=!0);let r=/\/\//;for(;t.match(r);)t=t.replace(r,"/");return e&&(t="/"+t),t}function Vl(t,e,r){let i=np(e);for(let n=0;n<t.length;n++){let s=t[n];if(s(i,r))return!0}return!1}function sp(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let i=fi(t).map(n=>ip(n));return e==null?(n,s)=>Vl(i,n,s):Vl(i,e)}var zl=t=>{let e=fi(t).flat();if(!e.every(r=>typeof r===Xd))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Kl)},Ul=t=>{let e=t.replace(ep,vs),r=!1;for(e.startsWith(Qd)&&(r=!0);e.match(Wl);)e=e.replace(Wl,vs);return r&&(e=vs+e),e},Kl=t=>Ul(G.normalize(Ul(t))),Gl=(t="")=>e=>typeof e=="string"?Kl(G.isAbsolute(e)?e:G.join(t,e)):e,op=(t,e)=>G.isAbsolute(t)?t:G.join(e,t),ap=Object.freeze(new Set),xs=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==Yl&&e!==Zd&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let i=this.path;try{await Kd(i)}catch{this._removeWatcher&&this._removeWatcher(G.dirname(i),G.basename(i))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=ui,this.items=ap,Object.freeze(this)}},lp="stat",cp="lstat",Cs=class{constructor(e,r,i){this.fsw=i;let n=e;this.path=e=e.replace(rp,""),this.watchPath=n,this.fullWatchPath=G.resolve(n),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?lp:cp}entryPath(e){return G.join(this.watchPath,G.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return this.fsw._isntIgnored(i,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},di=class extends Jd{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},n={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?fi(e.ignored):fi([]),awaitWriteFinish:r===!0?i:typeof r=="object"?{...i,...r}:!1};$l&&(n.usePolling=!0),n.atomic===void 0&&(n.atomic=!n.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let l=s.toLowerCase();l==="false"||l==="0"?n.usePolling=!1:l==="true"||l==="1"?n.usePolling=!0:n.usePolling=!!l}let o=process.env.CHOKIDAR_INTERVAL;o&&(n.interval=Number.parseInt(o,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=ui,this._readyEmitted=!0,process.nextTick(()=>this.emit(te.READY)))},this._emitRaw=(...l)=>this.emit(te.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=n,this._nodeFsHandler=new ci(this),Object.freeze(n)}_addIgnoredPath(e){if(Ss(e)){for(let r of this._ignoredPaths)if(Ss(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)Ss(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,i){let{cwd:n}=this.options;this.closed=!1,this._closePromise=void 0;let s=zl(e);return n&&(s=s.map(o=>op(o,n))),s.forEach(o=>{this._removeIgnoredPath(o)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async o=>{let a=await this._nodeFsHandler._addToNodeFs(o,!i,void 0,0,r);return a&&this._emitReady(),a})).then(o=>{this.closed||o.forEach(a=>{a&&this.add(G.dirname(a),G.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=zl(e),{cwd:i}=this.options;return r.forEach(n=>{!G.isAbsolute(n)&&!this._closers.has(n)&&(i&&(n=G.join(i,n)),n=G.resolve(n)),this._closePath(n),this._addIgnoredPath(n),this._watched.has(n)&&this._addIgnoredPath({path:n,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(i=>{let n=i();n instanceof Promise&&e.push(n)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,i)=>{let s=(this.options.cwd?G.relative(this.options.cwd,i):i)||Yl;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==te.ERROR&&this.emit(te.ALL,e,...r)}async _emit(e,r,i){if(this.closed)return;let n=this.options;ws&&(r=G.normalize(r)),n.cwd&&(r=G.relative(n.cwd,r));let s=[r];i!=null&&s.push(i);let o=n.awaitWriteFinish,a;if(o&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(n.atomic){if(e===te.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((l,c)=>{this.emit(...l),this.emit(te.ALL,...l),this._pendingUnlinks.delete(c)})},typeof n.atomic=="number"?n.atomic:100),this;e===te.ADD&&this._pendingUnlinks.has(r)&&(e=te.CHANGE,this._pendingUnlinks.delete(r))}if(o&&(e===te.ADD||e===te.CHANGE)&&this._readyEmitted){let l=(c,f)=>{c?(e=te.ERROR,s[0]=c,this.emitWithAll(e,s)):f&&(s.length>1?s[1]=f:s.push(f),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,o.stabilityThreshold,e,l),this}if(e===te.CHANGE&&!this._throttle(te.CHANGE,r,50))return this;if(n.alwaysStat&&i===void 0&&(e===te.ADD||e===te.ADD_DIR||e===te.CHANGE)){let l=n.cwd?G.join(n.cwd,r):r,c;try{c=await Yd(l)}catch{}if(!c||this.closed)return;s.push(c)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(te.ERROR,e),e||this.closed}_throttle(e,r,i){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e);if(!n)throw new Error("invalid throttle");let s=n.get(r);if(s)return s.count++,!1;let o,a=()=>{let c=n.get(r),f=c?c.count:0;return n.delete(r),clearTimeout(o),c&&clearTimeout(c.timeoutObject),f};o=setTimeout(a,i);let l={timeoutObject:o,clear:a,count:0};return n.set(r,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,i,n){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let o=s.pollInterval,a,l=e;this.options.cwd&&!G.isAbsolute(e)&&(l=G.join(this.options.cwd,e));let c=new Date,f=this._pendingWrites;function h(p){Gd(l,(m,g)=>{if(m||!f.has(e)){m&&m.code!=="ENOENT"&&n(m);return}let _=Number(new Date);p&&g.size!==p.size&&(f.get(e).lastChange=_);let O=f.get(e);_-O.lastChange>=r?(f.delete(e),n(void 0,g)):a=setTimeout(h,o,g)})}f.has(e)||(f.set(e,{lastChange:c,cancelWait:()=>(f.delete(e),clearTimeout(a),i)}),a=setTimeout(h,o))}_isIgnored(e,r){if(this.options.atomic&&tp.test(e))return!0;if(!this._userIgnored){let{cwd:i}=this.options,s=(this.options.ignored||[]).map(Gl(i)),a=[...[...this._ignoredPaths].map(Gl(i)),...s];this._userIgnored=sp(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new Cs(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=G.resolve(e);return this._watched.has(r)||this._watched.set(r,new xs(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,i){let n=G.join(e,r),s=G.resolve(n);if(i=i??(this._watched.has(n)||this._watched.has(s)),!this._throttle("remove",n,100))return;!i&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(n).getChildren().forEach(p=>this._remove(n,p));let l=this._getWatchedDir(e),c=l.has(r);l.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let f=n;if(this.options.cwd&&(f=G.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===te.ADD)return;this._watched.delete(n),this._watched.delete(s);let h=i?te.UNLINK_DIR:te.UNLINK;c&&!this._isIgnored(n)&&this._emit(h,n),this._closePath(n)}_closePath(e){this._closeFile(e);let r=G.dirname(e);this._getWatchedDir(r).remove(G.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(i=>i()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(r)}_readdirp(e,r){if(this.closed)return;let i={type:te.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},n=Ml(e,i);return this._streams.add(n),n.once(Hl,()=>{n=void 0}),n.once(bs,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};function up(t,e={}){let r=new di(e);return r.add(t),r}var Jl={watch:up,FSWatcher:di};import{tsImport as rd}from"tsx/esm/api";var cc=Wn(lc(),1),{program:c1,createCommand:u1,createArgument:h1,createOption:f1,CommanderError:d1,InvalidArgumentError:p1,InvalidOptionArgumentError:m1,Command:uc,Argument:g1,Option:y1,Help:_1}=cc.default;var hc=`# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json
|
|
81
|
+
`+d.slice(C+1):M+=d.slice(T),M.slice(1)}function _t(d){let w="",v=0;for(let P=0;P<d.length;v>=65536?P+=2:P++){v=Qe(d,P);let T=q[v];!T&>(v)?(w+=d[P],v>=65536&&(w+=d[P+1])):w+=T||ue(v)}return w}function $i(d,w,v){let P="",T=d.tag;for(let D=0,C=v.length;D<C;D+=1){let R=v[D];d.replacer&&(R=d.replacer.call(v,String(D),R)),(y(d,w,R,!1,!1)||typeof R>"u"&&y(d,w,null,!1,!1))&&(P!==""&&(P+=","+(d.condenseFlow?"":" ")),P+=d.dump)}d.tag=T,d.dump="["+P+"]"}function fr(d,w,v,P){let T="",D=d.tag;for(let C=0,R=v.length;C<R;C+=1){let M=v[C];d.replacer&&(M=d.replacer.call(v,String(C),M)),(y(d,w+1,M,!0,!0,!1,!0)||typeof M>"u"&&y(d,w+1,null,!0,!0,!1,!0))&&((!P||T!=="")&&(T+=Ae(d,w)),d.dump&&a===d.dump.charCodeAt(0)?T+="-":T+="- ",T+=d.dump)}d.tag=D,d.dump=T||"[]"}function ji(d,w,v){let P="",T=d.tag,D=Object.keys(v);for(let C=0,R=D.length;C<R;C+=1){let M="";P!==""&&(M+=", "),d.condenseFlow&&(M+='"');let $=D[C],W=v[$];d.replacer&&(W=d.replacer.call(v,$,W)),y(d,w,$,!1,!1)&&(d.dump.length>1024&&(M+="? "),M+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),y(d,w,W,!1,!1)&&(M+=d.dump,P+=M))}d.tag=T,d.dump="{"+P+"}"}function Wi(d,w,v,P){let T="",D=d.tag,C=Object.keys(v);if(d.sortKeys===!0)C.sort();else if(typeof d.sortKeys=="function")C.sort(d.sortKeys);else if(d.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let R=0,M=C.length;R<M;R+=1){let $="";(!P||T!=="")&&($+=Ae(d,w));let W=C[R],z=v[W];if(d.replacer&&(z=d.replacer.call(v,W,z)),!y(d,w+1,W,!0,!0,!0))continue;let U=d.tag!==null&&d.tag!=="?"||d.dump&&d.dump.length>1024;U&&(d.dump&&a===d.dump.charCodeAt(0)?$+="?":$+="? "),$+=d.dump,U&&($+=Ae(d,w)),y(d,w+1,z,!0,U)&&(d.dump&&a===d.dump.charCodeAt(0)?$+=":":$+=": ",$+=d.dump,T+=$)}d.tag=D,d.dump=T||"{}"}function u(d,w,v){let P=v?d.explicitTypes:d.implicitTypes;for(let T=0,D=P.length;T<D;T+=1){let C=P[T];if((C.instanceOf||C.predicate)&&(!C.instanceOf||typeof w=="object"&&w instanceof C.instanceOf)&&(!C.predicate||C.predicate(w))){if(v?C.multi&&C.representName?d.tag=C.representName(w):d.tag=C.tag:d.tag="?",C.represent){let R=d.styleMap[C.tag]||C.defaultStyle,M;if(n.call(C.represent)==="[object Function]")M=C.represent(w,R);else if(i.call(C.represent,R))M=C.represent[R](w,R);else throw new e("!<"+C.tag+'> tag resolver accepts not "'+R+'" style');d.dump=M}return!0}}return!1}function y(d,w,v,P,T,D,C){d.tag=null,d.dump=v,u(d,v,!1)||u(d,v,!0);let R=n.call(d.dump),M=P;P&&(P=d.flowLevel<0||d.flowLevel>w);let $=R==="[object Object]"||R==="[object Array]",W,z;if($&&(W=d.duplicates.indexOf(v),z=W!==-1),(d.tag!==null&&d.tag!=="?"||z||d.indent!==2&&w>0)&&(T=!1),z&&d.usedDuplicates[W])d.dump="*ref_"+W;else{if($&&z&&!d.usedDuplicates[W]&&(d.usedDuplicates[W]=!0),R==="[object Object]")P&&Object.keys(d.dump).length!==0?(Wi(d,w,d.dump,T),z&&(d.dump="&ref_"+W+d.dump)):(ji(d,w,d.dump),z&&(d.dump="&ref_"+W+" "+d.dump));else if(R==="[object Array]")P&&d.dump.length!==0?(d.noArrayIndent&&!C&&w>0?fr(d,w-1,d.dump,T):fr(d,w,d.dump,T),z&&(d.dump="&ref_"+W+d.dump)):($i(d,w,d.dump),z&&(d.dump="&ref_"+W+" "+d.dump));else if(R==="[object String]")d.tag!=="?"&&Xr(d,d.dump,w,D,M);else{if(R==="[object Undefined]")return!1;if(d.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+R)}if(d.tag!==null&&d.tag!=="?"){let U=encodeURI(d.tag[0]==="!"?d.tag.slice(1):d.tag).replace(/!/g,"%21");d.tag[0]==="!"?U="!"+U:U.slice(0,18)==="tag:yaml.org,2002:"?U="!!"+U.slice(18):U="!<"+U+">",d.dump=U+" "+d.dump}}return!0}function E(d,w){let v=[],P=[];A(d,v,P);let T=P.length;for(let D=0;D<T;D+=1)w.duplicates.push(v[P[D]]);w.usedDuplicates=new Array(T)}function A(d,w,v){if(d!==null&&typeof d=="object"){let P=w.indexOf(d);if(P!==-1)v.indexOf(P)===-1&&v.push(P);else if(w.push(d),Array.isArray(d))for(let T=0,D=d.length;T<D;T+=1)A(d[T],w,v);else{let T=Object.keys(d);for(let D=0,C=T.length;D<C;D+=1)A(d[T[D]],w,v)}}}function S(d,w){w=w||{};let v=new We(w);v.noRefs||E(d,v);let P=d;return v.replacer&&(P=v.replacer.call({"":P},"",P)),y(v,0,P,!0,!0)?v.dump+`
|
|
82
|
+
`:""}return fs.dump=S,fs}var ul;function yd(){if(ul)return be;ul=1;let t=md(),e=gd();function r(n,i){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return be.Type=ke(),be.Schema=hl(),be.FAILSAFE_SCHEMA=ml(),be.JSON_SCHEMA=wl(),be.CORE_SCHEMA=vl(),be.DEFAULT_SCHEMA=ds(),be.load=t.load,be.loadAll=t.loadAll,be.dump=e.dump,be.YAMLException=gr(),be.types={binary:Cl(),float:bl(),map:pl(),null:gl(),pairs:El(),set:Al(),timestamp:Sl(),bool:yl(),int:_l(),merge:xl(),omap:kl(),seq:dl(),str:fl()},be.safeLoad=r("safeLoad","load"),be.safeLoadAll=r("safeLoadAll","loadAll"),be.safeDump=r("safeDump","dump"),be}var _d=yd(),Ze=dd(_d),{Type:Tw,Schema:Dw,FAILSAFE_SCHEMA:Iw,JSON_SCHEMA:Rw,CORE_SCHEMA:Lw,DEFAULT_SCHEMA:Nw,load:Mw,loadAll:Fw,dump:Bw,YAMLException:qw,types:Hw,safeLoad:$w,safeLoadAll:jw,safeDump:Ww}=Ze;var j=Vi(Tl(),1);import{stat as Qd}from"fs";import{stat as Zd,readdir as Xd}from"fs/promises";import{EventEmitter as ep}from"events";import*as G from"path";import{stat as Sd,lstat as Dl,readdir as xd,realpath as Cd}from"node:fs/promises";import{Readable as kd}from"node:stream";import{resolve as Il,relative as Ed,join as Ad,sep as Od}from"node:path";var Pe={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},ms={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:Pe.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(ms);var Ml="READDIRP_RECURSIVE_ERROR",Pd=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ml]),Rl=[Pe.DIR_TYPE,Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE,Pe.FILE_TYPE],Td=new Set([Pe.DIR_TYPE,Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE]),Dd=new Set([Pe.EVERYTHING_TYPE,Pe.FILE_DIR_TYPE,Pe.FILE_TYPE]),Id=t=>Pd.has(t.code),Rd=process.platform==="win32",Ll=t=>!0,Nl=t=>{if(t===void 0)return Ll;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(n=>r.basename===n)}return Ll},gs=class extends kd{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let r={...ms,...e},{root:n,type:i}=r;this._fileFilter=Nl(r.fileFilter),this._directoryFilter=Nl(r.directoryFilter);let s=r.lstat?Dl:Sd;Rd?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=r.depth??ms.depth,this._wantsDir=i?Td.has(i):!1,this._wantsFile=i?Dd.has(i):!1,this._wantsEverything=i===Pe.EVERYTHING_TYPE,this._root=Il(n),this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,n=r&&r.files;if(n&&n.length>0){let{path:i,depth:s}=r,o=n.splice(0,e).map(l=>this._formatEntry(l,i)),a=await Promise.all(o);for(let l of a){if(!l)continue;if(this.destroyed)return;let c=await this._getEntryType(l);c==="directory"&&this._directoryFilter(l)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,s+1)),this._wantsDir&&(this.push(l),e--)):(c==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await xd(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:r,path:e}}async _formatEntry(e,r){let n,i=this._isDirent?e.name:e;try{let s=Il(Ad(r,i));n={path:Ed(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(s){this._onError(s);return}return n}_onError(e){Id(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let r=e[this._statsProp];if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let i=await Cd(n),s=await Dl(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===Od){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=Ml,this._onError(a)}return"directory"}}catch(i){return this._onError(i),""}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function Fl(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=Pe.FILE_DIR_TYPE),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Rl.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Rl.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new gs(e)}import{watchFile as Ld,unwatchFile as Bl,watch as Nd}from"fs";import{open as Md,stat as Hl,lstat as Fd,realpath as ys}from"fs/promises";import*as te from"path";import{type as Bd}from"os";var qd="data",ws="end",$l="close",hn=()=>{};var fn=process.platform,vs=fn==="win32",Hd=fn==="darwin",$d=fn==="linux",jd=fn==="freebsd",jl=Bd()==="OS400",re={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},ze=re,Wd="watch",Vd={lstat:Fd,stat:Hl},At="listeners",an="errHandlers",jt="rawEmitters",zd=[At,an,jt],Ud=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Gd=t=>Ud.has(te.extname(t).slice(1).toLowerCase()),bs=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},yr=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},Yd=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},_r=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Wl=t=>t instanceof Set?t.size===0:!t,ln=new Map;function ql(t,e,r,n,i){let s=(o,a)=>{r(t),i(o,a,{watchedPath:t}),a&&t!==a&&cn(te.resolve(t,a),At,te.join(t,a))};try{return Nd(t,{persistent:e.persistent},s)}catch(o){n(o);return}}var cn=(t,e,r,n,i)=>{let s=ln.get(t);s&&bs(s[e],o=>{o(r,n,i)})},Kd=(t,e,r,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=ln.get(e),l;if(!r.persistent)return l=ql(t,r,i,s,o),l?l.close.bind(l):void 0;if(a)yr(a,At,i),yr(a,an,s),yr(a,jt,o);else{if(l=ql(t,r,cn.bind(null,e,At),s,cn.bind(null,e,jt)),!l)return;l.on(ze.ERROR,async c=>{let f=cn.bind(null,e,an);if(a&&(a.watcherUnusable=!0),vs&&c.code==="EPERM")try{await(await Md(t,"r")).close(),f(c)}catch{}else f(c)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:l},ln.set(e,a)}return()=>{_r(a,At,i),_r(a,an,s),_r(a,jt,o),Wl(a.listeners)&&(a.watcher.close(),ln.delete(e),zd.forEach(Yd(a)),a.watcher=void 0,Object.freeze(a))}},_s=new Map,Jd=(t,e,r,n)=>{let{listener:i,rawEmitter:s}=n,o=_s.get(e),a=o&&o.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&(Bl(e),o=void 0),o?(yr(o,At,i),yr(o,jt,s)):(o={listeners:i,rawEmitters:s,options:r,watcher:Ld(e,r,(l,c)=>{bs(o.rawEmitters,h=>{h(ze.CHANGE,e,{curr:l,prev:c})});let f=l.mtimeMs;(l.size!==c.size||f>c.mtimeMs||f===0)&&bs(o.listeners,h=>h(t,l))})},_s.set(e,o)),()=>{_r(o,At,i),_r(o,jt,s),Wl(o.listeners)&&(_s.delete(e),Bl(e),o.options=o.watcher=void 0,Object.freeze(o))}},un=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,i=te.dirname(e),s=te.basename(e);this.fsw._getWatchedDir(i).add(s);let a=te.resolve(e),l={persistent:n.persistent};r||(r=hn);let c;if(n.usePolling){let f=n.interval!==n.binaryInterval;l.interval=f&&Gd(s)?n.binaryInterval:n.interval,c=Jd(e,a,l,{listener:r,rawEmitter:this.fsw._emitRaw})}else c=Kd(e,a,l,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return c}_handleFile(e,r,n){if(this.fsw.closed)return;let i=te.dirname(e),s=te.basename(e),o=this.fsw._getWatchedDir(i),a=r;if(o.has(s))return;let l=async(f,h)=>{if(this.fsw._throttle(Wd,e,5)){if(!h||h.mtimeMs===0)try{let p=await Hl(e);if(this.fsw.closed)return;let m=p.atimeMs,g=p.mtimeMs;if((!m||m<=g||g!==a.mtimeMs)&&this.fsw._emit(ze.CHANGE,e,p),(Hd||$d||jd)&&a.ino!==p.ino){this.fsw._closeFile(f),a=p;let _=this._watchWithNodeFs(e,l);_&&this.fsw._addPathCloser(f,_)}else a=p}catch{this.fsw._remove(i,s)}else if(o.has(s)){let p=h.atimeMs,m=h.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(ze.CHANGE,e,h),a=h}}},c=this._watchWithNodeFs(e,l);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ze.ADD,e,0))return;this.fsw._emit(ze.ADD,e,r)}return c}async _handleSymlink(e,r,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await ys(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ze.CHANGE,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ze.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,n,i,s,o,a){if(e=te.join(e,""),a=this.fsw._throttle("readdir",e,1e3),!a)return;let l=this.fsw._getWatchedDir(n.path),c=new Set,f=this.fsw._readdirp(e,{fileFilter:h=>n.filterPath(h),directoryFilter:h=>n.filterDir(h)});if(f)return f.on(qd,async h=>{if(this.fsw.closed){f=void 0;return}let p=h.path,m=te.join(e,p);if(c.add(p),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,m,p))){if(this.fsw.closed){f=void 0;return}(p===i||!i&&!l.has(p))&&(this.fsw._incrReadyCount(),m=te.join(s,te.relative(s,m)),this._addToNodeFs(m,r,n,o+1))}}).on(ze.ERROR,this._boundHandleError),new Promise((h,p)=>{if(!f)return p();f.once(ws,()=>{if(this.fsw.closed){f=void 0;return}let m=a?a.clear():!1;h(void 0),l.getChildren().filter(g=>g!==e&&!c.has(g)).forEach(g=>{this.fsw._remove(e,g)}),f=void 0,m&&this._handleRead(e,!1,n,i,s,o,a)})})}async _handleDir(e,r,n,i,s,o,a){let l=this.fsw._getWatchedDir(te.dirname(e)),c=l.has(te.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!c&&this.fsw._emit(ze.ADD_DIR,e,r),l.add(te.basename(e)),this.fsw._getWatchedDir(e);let f,h,p=this.fsw.options.depth;if((p==null||i<=p)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(m,g)=>{g&&g.mtimeMs===0||this._handleRead(m,!1,o,s,e,i,f)})}return h}async _addToNodeFs(e,r,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e);n&&(a.filterPath=l=>n.filterPath(l),a.filterDir=l=>n.filterDir(l));try{let l=await Vd[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,l))return o(),!1;let c=this.fsw.options.followSymlinks,f;if(l.isDirectory()){let h=te.resolve(e),p=c?await ys(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,l,r,i,s,a,p),this.fsw.closed))return;h!==p&&p!==void 0&&this.fsw._symlinkPaths.set(h,p)}else if(l.isSymbolicLink()){let h=c?await ys(e):e;if(this.fsw.closed)return;let p=te.dirname(a.watchPath);if(this.fsw._getWatchedDir(p).add(a.watchPath),this.fsw._emit(ze.ADD,a.watchPath,l),f=await this._handleDir(p,l,r,i,e,a,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(te.resolve(e),h)}else f=this._handleFile(a.watchPath,l,r);return o(),f&&this.fsw._addPathCloser(e,f),!1}catch(l){if(this.fsw._handleError(l))return o(),e}}};var Ss="/",tp="//",Kl=".",rp="..",np="string",ip=/\\/g,Vl=/\/\//,sp=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,op=/^\.[/\\]/;function dn(t){return Array.isArray(t)?t:[t]}var xs=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function ap(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=G.relative(t.path,e);return r?!r.startsWith("..")&&!G.isAbsolute(r):!1}return!1}:()=>!1}function lp(t){if(typeof t!="string")throw new Error("string expected");t=G.normalize(t),t=t.replace(/\\/g,"/");let e=!1;t.startsWith("//")&&(e=!0);let r=/\/\//;for(;t.match(r);)t=t.replace(r,"/");return e&&(t="/"+t),t}function zl(t,e,r){let n=lp(e);for(let i=0;i<t.length;i++){let s=t[i];if(s(n,r))return!0}return!1}function cp(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=dn(t).map(i=>ap(i));return e==null?(i,s)=>zl(n,i,s):zl(n,e)}var Ul=t=>{let e=dn(t).flat();if(!e.every(r=>typeof r===np))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Jl)},Gl=t=>{let e=t.replace(ip,Ss),r=!1;for(e.startsWith(tp)&&(r=!0);e.match(Vl);)e=e.replace(Vl,Ss);return r&&(e=Ss+e),e},Jl=t=>Gl(G.normalize(Gl(t))),Yl=(t="")=>e=>typeof e=="string"?Jl(G.isAbsolute(e)?e:G.join(t,e)):e,up=(t,e)=>G.isAbsolute(t)?t:G.join(e,t),hp=Object.freeze(new Set),Cs=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==Kl&&e!==rp&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await Xd(n)}catch{this._removeWatcher&&this._removeWatcher(G.dirname(n),G.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=hn,this.items=hp,Object.freeze(this)}},fp="stat",dp="lstat",ks=class{constructor(e,r,n){this.fsw=n;let i=e;this.path=e=e.replace(op,""),this.watchPath=i,this.fullWatchPath=G.resolve(i),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?fp:dp}entryPath(e){return G.join(this.watchPath,G.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},pn=class extends ep{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?dn(e.ignored):dn([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};jl&&(i.usePolling=!0),i.atomic===void 0&&(i.atomic=!i.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let l=s.toLowerCase();l==="false"||l==="0"?i.usePolling=!1:l==="true"||l==="1"?i.usePolling=!0:i.usePolling=!!l}let o=process.env.CHOKIDAR_INTERVAL;o&&(i.interval=Number.parseInt(o,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=hn,this._readyEmitted=!0,process.nextTick(()=>this.emit(re.READY)))},this._emitRaw=(...l)=>this.emit(re.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new un(this),Object.freeze(i)}_addIgnoredPath(e){if(xs(e)){for(let r of this._ignoredPaths)if(xs(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)xs(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,n){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let s=Ul(e);return i&&(s=s.map(o=>up(o,i))),s.forEach(o=>{this._removeIgnoredPath(o)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async o=>{let a=await this._nodeFsHandler._addToNodeFs(o,!n,void 0,0,r);return a&&this._emitReady(),a})).then(o=>{this.closed||o.forEach(a=>{a&&this.add(G.dirname(a),G.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=Ul(e),{cwd:n}=this.options;return r.forEach(i=>{!G.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=G.join(n,i)),i=G.resolve(i)),this._closePath(i),this._addIgnoredPath(i),this._watched.has(i)&&this._addIgnoredPath({path:i,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=(this.options.cwd?G.relative(this.options.cwd,n):n)||Kl;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==re.ERROR&&this.emit(re.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let i=this.options;vs&&(r=G.normalize(r)),i.cwd&&(r=G.relative(i.cwd,r));let s=[r];n!=null&&s.push(n);let o=i.awaitWriteFinish,a;if(o&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(i.atomic){if(e===re.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((l,c)=>{this.emit(...l),this.emit(re.ALL,...l),this._pendingUnlinks.delete(c)})},typeof i.atomic=="number"?i.atomic:100),this;e===re.ADD&&this._pendingUnlinks.has(r)&&(e=re.CHANGE,this._pendingUnlinks.delete(r))}if(o&&(e===re.ADD||e===re.CHANGE)&&this._readyEmitted){let l=(c,f)=>{c?(e=re.ERROR,s[0]=c,this.emitWithAll(e,s)):f&&(s.length>1?s[1]=f:s.push(f),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,o.stabilityThreshold,e,l),this}if(e===re.CHANGE&&!this._throttle(re.CHANGE,r,50))return this;if(i.alwaysStat&&n===void 0&&(e===re.ADD||e===re.ADD_DIR||e===re.CHANGE)){let l=i.cwd?G.join(i.cwd,r):r,c;try{c=await Zd(l)}catch{}if(!c||this.closed)return;s.push(c)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(re.ERROR,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e);if(!i)throw new Error("invalid throttle");let s=i.get(r);if(s)return s.count++,!1;let o,a=()=>{let c=i.get(r),f=c?c.count:0;return i.delete(r),clearTimeout(o),c&&clearTimeout(c.timeoutObject),f};o=setTimeout(a,n);let l={timeoutObject:o,clear:a,count:0};return i.set(r,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,i){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let o=s.pollInterval,a,l=e;this.options.cwd&&!G.isAbsolute(e)&&(l=G.join(this.options.cwd,e));let c=new Date,f=this._pendingWrites;function h(p){Qd(l,(m,g)=>{if(m||!f.has(e)){m&&m.code!=="ENOENT"&&i(m);return}let _=Number(new Date);p&&g.size!==p.size&&(f.get(e).lastChange=_);let O=f.get(e);_-O.lastChange>=r?(f.delete(e),i(void 0,g)):a=setTimeout(h,o,g)})}f.has(e)||(f.set(e,{lastChange:c,cancelWait:()=>(f.delete(e),clearTimeout(a),n)}),a=setTimeout(h,o))}_isIgnored(e,r){if(this.options.atomic&&sp.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Yl(n)),a=[...[...this._ignoredPaths].map(Yl(n)),...s];this._userIgnored=cp(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new ks(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=G.resolve(e);return this._watched.has(r)||this._watched.set(r,new Cs(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let i=G.join(e,r),s=G.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(i).getChildren().forEach(p=>this._remove(i,p));let l=this._getWatchedDir(e),c=l.has(r);l.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let f=i;if(this.options.cwd&&(f=G.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===re.ADD)return;this._watched.delete(i),this._watched.delete(s);let h=n?re.UNLINK_DIR:re.UNLINK;c&&!this._isIgnored(i)&&this._emit(h,i),this._closePath(i)}_closePath(e){this._closeFile(e);let r=G.dirname(e);this._getWatchedDir(r).remove(G.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:re.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},i=Fl(e,n);return this._streams.add(i),i.once($l,()=>{i=void 0}),i.once(ws,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};function pp(t,e={}){let r=new pn(e);return r.add(t),r}var Ql={watch:pp,FSWatcher:pn};import{tsImport as od}from"tsx/esm/api";var uc=Vi(cc(),1),{program:d1,createCommand:p1,createArgument:m1,createOption:g1,CommanderError:y1,InvalidArgumentError:_1,InvalidOptionArgumentError:b1,Command:hc,Argument:w1,Option:v1,Help:S1}=uc.default;var fc=`# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json
|
|
83
83
|
cli_contracts: 0.1.0
|
|
84
84
|
|
|
85
85
|
info:
|
|
86
86
|
title: embedoc CLI
|
|
87
|
-
version: 0.14.
|
|
87
|
+
version: 0.14.11
|
|
88
88
|
description: >-
|
|
89
89
|
In-place document generator that auto-updates marker blocks in documents
|
|
90
90
|
and source code while preserving manually edited sections. Supports
|
|
@@ -423,11 +423,11 @@ command_sets:
|
|
|
423
423
|
recommended_before_use:
|
|
424
424
|
- Ensure embedoc.config.yaml exists (run init if needed).
|
|
425
425
|
- Verify datasource files are accessible.
|
|
426
|
-
`,
|
|
426
|
+
`,dc=`{
|
|
427
427
|
"cli_contracts": "0.1.0",
|
|
428
428
|
"info": {
|
|
429
429
|
"title": "embedoc CLI",
|
|
430
|
-
"version": "0.14.
|
|
430
|
+
"version": "0.14.11",
|
|
431
431
|
"description": "In-place document generator that auto-updates marker blocks in documents and source code while preserving manually edited sections. Supports multiple datasources (SQLite, CSV, JSON, YAML, glob, TypeScript API), programmable TypeScript renderers, Handlebars file generation, and incremental builds with dependency tracking.",
|
|
432
432
|
"license": {
|
|
433
433
|
"name": "MIT"
|
|
@@ -850,56 +850,57 @@ command_sets:
|
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
|
-
}`;function
|
|
854
|
-
`),process.exitCode=2;return}let s=
|
|
855
|
-
`)}else{let l=[];if(l.push("# embedoc extract"),l.push("# source: embedded"),l.push("# type: cli-contracts/command-extract"),
|
|
853
|
+
}`;function pc(t,e){let r=new hc;return r.name("embedoc").version(e,"-V, --version").description("In-place document generator with marker-based embedding."),r.command("init").description("Initialize embedoc in the current project.").option("-f, --force","Overwrite existing files.",!1).action(async(n,i)=>{await t.init(n,i.optsWithGlobals())}),r.command("build").description("Build documents by replacing markers with rendered content.").argument("[files...]","Specific file paths to process. If omitted, processes all targets from config.").option("-c, --config <path>","Path to config file (YAML or JSON).","embedoc.config.yaml").option("-d, --dry-run","Preview changes without writing files.",!1).option("-v, --verbose","Enable verbose output.",!1).action(async(n,i,s)=>{await t.build(n,i,s.optsWithGlobals())}),r.command("generate").description("Generate new files from datasource records using Handlebars templates.").option("-c, --config <path>","Path to config file (YAML or JSON).","embedoc.config.yaml").option("-s, --datasource <name>","Specific datasource to process.").option("-g, --generator <name>","Specific generator template to use.").option("-a, --all","Process all datasources that have generators configured.",!1).option("-d, --dry-run","Preview generation without writing files.",!1).option("-v, --verbose","Enable verbose output.",!1).action(async(n,i)=>{await t.generate(n,i.optsWithGlobals())}),r.command("watch").description("Watch files and rebuild on changes with dependency tracking.").option("-c, --config <path>","Path to config file (YAML or JSON).","embedoc.config.yaml").option("-v, --verbose","Enable verbose rebuild output.",!1).option("--debug-deps","Print dependency graph at startup for debugging.",!1).action(async(n,i)=>{await t.watch(n,i.optsWithGlobals())}),r.command("extract").description("Extract contract specification for this CLI tool.").argument("[commands...]","Command IDs to extract. Use dot notation.").option("-a, --all","Extract all commands.",!1).option("--include-meta","Include extraction metadata.",!0).option("--no-include-meta").option("-F, --format <format>","Output format (yaml or json).","yaml").action(async(n,i)=>{if(n.length===0&&!i.all){process.stderr.write(JSON.stringify({code:"INVALID_ARGS",message:"Specify command IDs or use --all"})+`
|
|
854
|
+
`),process.exitCode=2;return}let s=i.format||"yaml",o=JSON.parse(dc),a=i.all?[]:n;if(a.length===0)if(s==="json"){let l={};i.includeMeta&&(l._meta={source:"embedded",type:"cli-contracts/extract",extractedAt:new Date().toISOString(),specVersion:o.cli_contracts??"0.1.0",commands:["embedoc.init","embedoc.build","embedoc.generate","embedoc.watch"]}),Object.assign(l,o),process.stdout.write(JSON.stringify(l,null,2)+`
|
|
855
|
+
`)}else{let l=[];if(l.push("# embedoc extract"),l.push("# source: embedded"),l.push("# type: cli-contracts/command-extract"),i.includeMeta){l.push("---"),l.push("source: embedded"),l.push("type: cli-contracts/command-extract"),l.push("extractedAt: "+new Date().toISOString()),l.push("spec_version: "+(o.cli_contracts??"0.1.0")),l.push("commands:");for(let c of["embedoc.init","embedoc.build","embedoc.generate","embedoc.watch"])l.push(" - "+c)}l.push("---"),l.push(fc),process.stdout.write(l.join(`
|
|
856
856
|
`)+`
|
|
857
857
|
`)}else{let l={cli_contracts:o.cli_contracts,info:o.info,command_sets:{}},c=l.command_sets;for(let[f,h]of Object.entries(o.command_sets??{})){let p=h.commands;if(!p)continue;let m={};for(let[g,_]of Object.entries(p)){let O=f+"."+g;a.some(b=>b===g||b===O||g.startsWith(b+"."))&&(m[g]=_)}if(Object.keys(m).length>0){let g={...h};g.commands=m,c[f]=g}}o.components&&(l.components=o.components),process.stdout.write(JSON.stringify(l,null,2)+`
|
|
858
|
-
`)}process.exitCode=0}),r}import Ep from"better-sqlite3";var yi=class{type="sqlite";db;queryString;constructor(e){if(!e.path)throw new Error('SQLite datasource requires "path" configuration');this.db=new Ep(e.path,{readonly:!0}),this.queryString=e.query}async query(e,r=[]){try{return this.db.prepare(e).all(...r)}catch(i){let n=i instanceof Error?i.message:String(i);throw new Error(`SQLite query failed: ${n}`,{cause:i})}}async getAll(){if(!this.queryString)throw new Error("No query defined for this datasource. Use query() method instead.");return this.query(this.queryString)}async close(){this.db.close()}};function js(t){return new yi(t)}import{readFile as Tp}from"node:fs/promises";var Y=class t extends Error{constructor(e,r,i,...n){Array.isArray(r)&&(r=r.join(" ").trim()),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,t),this.code=e;for(let s of n)for(let o in s){let a=s[o];this[o]=Buffer.isBuffer(a)?a.toString(i.encoding):a==null?a:JSON.parse(JSON.stringify(a))}}};var wr=function(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)};var _i=function(t){let e=[];for(let r=0,i=t.length;r<i;r++){let n=t[r];if(n==null||n===!1)e[r]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[r]={name:`${n}`};else if(wr(n)){if(typeof n.name!="string")throw new Y("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);e[r]=n}else throw new Y("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${r}`])}return e};var Ws=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let r=this.length+e.length;if(r>=this.size&&(this.resize(),r>=this.size))throw Error("INVALID_BUFFER_STATE");let i=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{let r=this.length++;r===this.size&&this.resize();let i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,r)}}append(e){let r=this.length++;r===this.size&&this.resize(),this.buf[r]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let r=Buffer.allocUnsafe(this.size);this.buf.copy(r,0,0,e),this.buf=r}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},Vs=Ws;var pc=function(t){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((i,n)=>{let s=Buffer.from(String.fromCharCode(n),t.encoding);return n!==63&&s.length===1&&s[0]===63||i.push(s),i},[]),r=new Uint8Array(256);for(let i of e)r[i[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:t.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:t.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(t.escape)&&Buffer.isBuffer(t.quote)&&Buffer.compare(t.escape,t.quote)===0,expectedRecordLength:Array.isArray(t.columns)?t.columns.length:void 0,field:new Vs(20),firstLineToHeaders:t.cast_first_line_to_header,needMoreDataSize:Math.max(t.comment!==null?t.comment.length:0,...t.delimiter?t.delimiter.map(i=>i.length):[],t.delimiter_auto?1:0,t.quote!==null?t.quote.length:0,...e.map(i=>i.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new Vs(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:t.record_delimiter.length===0?0:Math.max(...t.record_delimiter.map(i=>i.length)),trimChars:[Buffer.from(" ",t.encoding)[0],Buffer.from(" ",t.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:r}};var mc=function(t){return t.replace(/([A-Z])/g,function(e,r){return"_"+r.toLowerCase()})};var Wt=function(t){let e={};for(let i in t)e[mc(i)]=t[i];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new Y("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new Y("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new Y("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(i){let n=Date.parse(i);return isNaN(n)?i:new Date(n)};else if(typeof e.cast_date!="function")throw new Y("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=_i(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new Y("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new Y("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new Y("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new Y("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new Y("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!wr(e.delimiter_auto))throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!wr(e.delimiter_auto.preferred))throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(i,n)=>(i.total-i.std)*(n.preferred[i.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let r=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(i){if(typeof i=="string"&&(i=Buffer.from(i,e.encoding)),!Buffer.isBuffer(i)||i.length===0)throw new Y("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${r}`],e);return i}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new Y("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new Y("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new Y("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(i,n){if(typeof i!="string"&&!Buffer.isBuffer(i))throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(i)}`],e);if(i.length===0)throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(i)}`],e);return typeof i=="string"&&(i=Buffer.from(i,e.encoding)),i}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&t.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&t.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`);return e};var gc=function(t,e){e||({delimiter_auto:e}=Wt({delimiter_auto:!0})),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)&&(t=(n=>{let s=[],o=bi({delimiter:[]}),a=f=>s.push(f),l=()=>{},c=o.parse(n,!0,a,l);if(c!==void 0)throw c;return s})(t));let r=Array(127).fill().map(()=>({lines:[]}));t.map(([n],s)=>{for(let o=0,a=n.length;o<a;o++){let l=n.charCodeAt(o);r[l].lines[s]===void 0&&(r[l].lines[s]=0),r[l].lines[s]++}}),r.map((n,s)=>{n.char_code=s,n.std=Ap(n.lines),n.total=n.lines.reduce((o,a)=>o+a,0),n.preferred=!!e.preferred[s],n.score=e.score(n,e)});let i=r.reduce((n,s)=>n.score>s.score?n:s,{});return String.fromCharCode(i.char_code)},Ap=function(t){let e=t.length;if(e===0)return 0;let r=t.reduce((i,n)=>i+n)/e;return Math.sqrt(t.map(i=>Math.pow(i-r,2)).reduce((i,n)=>i+n)/e)};var yc=function(t){return t.every(e=>e==null||e.toString&&e.toString().trim()==="")},Op=13,Pp=10,Vt={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},bi=function(t={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},r=Wt(t);return{info:e,original_options:t,options:r,state:pc(r),__needMoreData:function(i,n,s){if(s)return!1;let{encoding:o,escape:a,quote:l}=this.options,{quoting:c,needMoreDataSize:f,recordDelimiterMaxLength:h}=this.state,p=n-i-1,m=Math.max(f,h===0?Buffer.from(`\r
|
|
859
|
-
`,o).length:h,c?(a===null?0:a.length)+l.length:0,c?l.length+h:0);return p<m},parse:function(i,n,s,o){let{bom:a,comment_no_infix:l,delimiter_auto:c,encoding:f,from_line:h,ltrim:p,max_record_size:m,raw:g,relax_quotes:_,rtrim:O,skip_empty_lines:b,to:x,to_line:I}=this.options,{comment:L,escape:N,quote:B,record_delimiter:z}=this.options,{bomSkipped:se,delimiterDiscovered:ae,delimiterBufPrevious:X,rawBuffer:pe,escapeIsQuote:ce}=this.state;if(!ae&&c){let K;if(X===void 0?K=i:X!==void 0&&i===void 0?K=X:K=Buffer.concat([X,i]),i=void 0,n||K.length>c.size)this.options.delimiter=[Buffer.from(gc(K,this.options.delimiter_auto))],this.state.previousBuf=K,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=K;return}}let{previousBuf:Oe}=this.state,q;if(Oe===void 0)if(i===void 0){o();return}else q=i;else Oe!==void 0&&i===void 0?q=Oe:q=Buffer.concat([Oe,i]);if(se===!1)if(a===!1)this.state.bomSkipped=!0;else if(q.length<3){if(n===!1){this.state.previousBuf=q;return}}else{for(let K in Vt)if(Vt[K].compare(q,0,Vt[K].length)===0){let ue=Vt[K].length;this.state.bufBytesStart+=ue,q=q.slice(ue);let mt=Wt({...this.original_options,encoding:K});for(let Q in mt)this.options[Q]=mt[Q];({comment:L,escape:N,quote:B}=this.options);break}this.state.bomSkipped=!0}let Me=q.length,k;for(k=0;k<Me&&!this.__needMoreData(k,Me,n);k++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),I!==-1&&this.info.lines>I){this.state.stop=!0,o();return}this.state.quoting===!1&&z.length===0&&this.__autoDiscoverRecordDelimiter(q,k)&&(z=this.options.record_delimiter);let K=q[k];if(g===!0&&pe.append(K),(K===Op||K===Pp)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(N!==null&&this.state.quoting===!0&&this.__isEscape(q,k,K)&&k+N.length<Me)if(ce){if(this.__isQuote(q,k+N.length)){this.state.escaping=!0,k+=N.length-1;continue}}else{this.state.escaping=!0,k+=N.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(q,k))if(this.state.quoting===!0){let Q=q[k+B.length],We=O&&this.__isCharTrimable(q,k+B.length),xe=L!==null&&this.__compareBytes(L,q,k+B.length,Q),Ee=this.__isDelimiter(q,k+B.length,Q),st=z.length===0?this.__autoDiscoverRecordDelimiter(q,k+B.length):this.__isRecordDelimiter(Q,q,k+B.length);if(N!==null&&this.__isEscape(q,k,K)&&this.__isQuote(q,k+N.length))k+=N.length-1;else if(!Q||Ee||st||xe||We){this.state.quoting=!1,this.state.wasQuoting=!0,k+=B.length-1;continue}else if(_===!1){let _e=this.__error(new Y("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(Q)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(_e!==void 0)return _e}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(B),k+=B.length-1}else if(this.state.field.length!==0){if(_===!1){let Q=this.__infoField(),We=Object.keys(Vt).map(Ee=>Vt[Ee].equals(this.state.field.toString())?Ee:!1).filter(Boolean)[0],xe=this.__error(new Y("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(Q.column)} at line ${Q.lines}, value is ${JSON.stringify(this.state.field.toString(f))}`,We?`(${We} bom)`:void 0],this.options,Q,{field:this.state.field}));if(xe!==void 0)return xe}}else{this.state.quoting=!0,k+=B.length-1;continue}if(this.state.quoting===!1){let Q=this.__isRecordDelimiter(K,q,k);if(Q!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=h){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),k+=Q-1;continue}if(b===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,k+=Q-1;continue}this.info.bytes=this.state.bufBytesStart+k;let Ee=this.__onField();if(Ee!==void 0)return Ee;this.info.bytes=this.state.bufBytesStart+k+Q;let st=this.__onRecord(s);if(st!==void 0)return st;if(x!==-1&&this.info.records>=x){this.state.stop=!0,o();return}}this.state.commenting=!1,k+=Q-1;continue}if(this.state.commenting)continue;if(L!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(L,q,k,K)!==0){this.state.commenting=!0;continue}let We=this.__isDelimiter(q,k,K);if(We!==0){this.info.bytes=this.state.bufBytesStart+k;let xe=this.__onField();if(xe!==void 0)return xe;k+=We-1;continue}}}if(this.state.commenting===!1&&m!==0&&this.state.record_length+this.state.field.length>m)return this.__error(new Y("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${m}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let ue=p===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(q,k),mt=O===!1||this.state.wasQuoting===!1;if(ue===!0&&mt===!0)this.state.field.append(K);else{if(O===!0&&!this.__isCharTrimable(q,k))return this.__error(new Y("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));ue===!1&&(k+=this.__isCharTrimable(q,k)-1);continue}}if(n===!0)if(this.state.quoting===!0){let K=this.__error(new Y("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(K!==void 0)return K}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+k;let K=this.__onField();if(K!==void 0)return K;let ue=this.__onRecord(s);if(ue!==void 0)return ue}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=k,this.state.previousBuf=q.slice(k);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(i){let{columns:n,group_columns_by_name:s,encoding:o,info:a,from:l,relax_column_count:c,relax_column_count_less:f,relax_column_count_more:h,raw:p,skip_records_with_empty_values:m}=this.options,{enabled:g,record:_}=this.state;if(g===!1)return this.__resetRecord();let O=_.length;if(n===!0){if(m===!0&&yc(_)){this.__resetRecord();return}return this.__firstLineToColumns(_)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=O),O!==this.state.expectedRecordLength){let b=n===!1?new Y("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${O} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_}):new Y("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${O} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_});if(c===!0||f===!0&&O<this.state.expectedRecordLength||h===!0&&O>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=b;else{let x=this.__error(b);if(x)return x}}if(m===!0&&yc(_)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,l===1||this.info.records>=l){let{objname:b}=this.options;if(n!==!1){let x={};for(let I=0,L=_.length;I<L;I++)n[I]===void 0||n[I].disabled||(s===!0&&Object.hasOwn(x,n[I].name)?Array.isArray(x[n[I].name])?x[n[I].name]=x[n[I].name].concat(_[I]):x[n[I].name]=[x[n[I].name],_[I]]:Object.defineProperty(x,n[I].name,{value:_[I],enumerable:!0,writable:!0,configurable:!0}));if(p===!0||a===!0){let I=Object.assign({record:x},p===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),L=this.__push(b===void 0?I:[x[b],I],i);if(L)return L}else{let I=this.__push(b===void 0?x:[x[b],x],i);if(I)return I}}else if(p===!0||a===!0){let x=Object.assign({record:_},p===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),I=this.__push(b===void 0?x:[_[b],x],i);if(I)return I}else{let x=this.__push(b===void 0?_:[_[b],_],i);if(x)return x}}this.__resetRecord()},__firstLineToColumns:function(i){let{firstLineToHeaders:n}=this.state;try{let s=n===void 0?i:n.call(null,i);if(!Array.isArray(s))return this.__error(new Y("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(s)}`],this.options,this.__infoField(),{headers:s}));let o=_i(s);this.state.expectedRecordLength=o.length,this.options.columns=o,this.__resetRecord();return}catch(s){return s}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:i,encoding:n,rtrim:s,max_record_size:o}=this.options,{enabled:a,wasQuoting:l}=this.state;if(a===!1)return this.__resetField();let c=this.state.field.toString(n);if(s===!0&&l===!1&&(c=c.trimRight()),i===!0){let[f,h]=this.__cast(c);if(f!==void 0)return f;c=h}this.state.record.push(c),o!==0&&typeof c=="string"&&(this.state.record_length+=c.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(i,n){let{on_record:s}=this.options;if(s!==void 0){let o=this.__infoRecord();try{i=s.call(null,i,o)}catch(a){return a}if(i==null)return}this.info.bytes_records+=this.info.bytes,n(i)},__cast:function(i){let{columns:n,relax_column_count:s}=this.options;if(Array.isArray(n)===!0&&s&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let a=this.__infoField();return[void 0,this.state.castField.call(null,i,a)]}catch(a){return[a]}if(this.__isFloat(i))return[void 0,parseFloat(i)];if(this.options.cast_date!==!1){let a=this.__infoField();return[void 0,this.options.cast_date.call(null,i,a)]}return[void 0,i]},__compareBytes:function(i,n,s,o){if(i[0]!==o)return 0;let a=i.length;for(let l=1;l<a;l++)if(i[l]!==n[s+l])return 0;return a},__isCharTrimable:function(i,n){let{timchars:s,timcharFirstBytes:o}=this.state,a=i[n];if(a===void 0||o[a]===0)return 0;e:for(let l=0;l<s.length;l++){let c=s[l];for(let f=0;f<c.length;f++)if(c[f]!==i[n+f])continue e;return c.length}return 0},__isDelimiter:function(i,n,s){let{delimiter:o,ignore_last_delimiters:a}=this.options;if(a===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(a!==!1&&typeof a=="number"&&this.state.record.length===a-1)return 0;e:for(let l=0;l<o.length;l++){let c=o[l];if(c[0]===s){for(let f=1;f<c.length;f++)if(c[f]!==i[n+f])continue e;return c.length}}return 0},__isEscape:function(i,n,s){let{escape:o}=this.options;if(o===null)return!1;let a=o.length;if(o[0]===s){for(let l=0;l<a;l++)if(o[l]!==i[n+l])return!1;return!0}return!1},__isFloat:function(i){return i-parseFloat(i)+1>=0},__isQuote:function(i,n){let{quote:s}=this.options;if(s===null)return!1;let o=s.length;for(let a=0;a<o;a++)if(s[a]!==i[n+a])return!1;return!0},__isRecordDelimiter:function(i,n,s){let{record_delimiter:o}=this.options,a=o.length;e:for(let l=0;l<a;l++){let c=o[l],f=c.length;if(c[0]===i){for(let h=1;h<f;h++)if(c[h]!==n[s+h])continue e;return c.length}}return 0},__autoDiscoverRecordDelimiter:function(i,n){let{encoding:s}=this.options,o=[Buffer.from(`\r
|
|
858
|
+
`)}process.exitCode=0}),r}import Tp from"better-sqlite3";var _n=class{type="sqlite";db;queryString;constructor(e){if(!e.path)throw new Error('SQLite datasource requires "path" configuration');this.db=new Tp(e.path,{readonly:!0}),this.queryString=e.query}async query(e,r=[]){try{return this.db.prepare(e).all(...r)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(`SQLite query failed: ${i}`,{cause:n})}}async getAll(){if(!this.queryString)throw new Error("No query defined for this datasource. Use query() method instead.");return this.query(this.queryString)}async close(){this.db.close()}};function Ws(t){return new _n(t)}import{readFile as Lp}from"node:fs/promises";var Y=class t extends Error{constructor(e,r,n,...i){Array.isArray(r)&&(r=r.join(" ").trim()),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,t),this.code=e;for(let s of i)for(let o in s){let a=s[o];this[o]=Buffer.isBuffer(a)?a.toString(n.encoding):a==null?a:JSON.parse(JSON.stringify(a))}}};var wr=function(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)};var bn=function(t){let e=[];for(let r=0,n=t.length;r<n;r++){let i=t[r];if(i==null||i===!1)e[r]={disabled:!0};else if(typeof i=="string"||typeof i=="number")e[r]={name:`${i}`};else if(wr(i)){if(typeof i.name!="string")throw new Y("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);e[r]=i}else throw new Y("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(i)} at position ${r}`])}return e};var Vs=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let r=this.length+e.length;if(r>=this.size&&(this.resize(),r>=this.size))throw Error("INVALID_BUFFER_STATE");let n=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),n.copy(this.buf,e.length),this.length+=e.length}else{let r=this.length++;r===this.size&&this.resize();let n=this.clone();this.buf[0]=e,n.copy(this.buf,1,0,r)}}append(e){let r=this.length++;r===this.size&&this.resize(),this.buf[r]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let r=Buffer.allocUnsafe(this.size);this.buf.copy(r,0,0,e),this.buf=r}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},zs=Vs;var mc=function(t){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((n,i)=>{let s=Buffer.from(String.fromCharCode(i),t.encoding);return i!==63&&s.length===1&&s[0]===63||n.push(s),n},[]),r=new Uint8Array(256);for(let n of e)r[n[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:t.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:t.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(t.escape)&&Buffer.isBuffer(t.quote)&&Buffer.compare(t.escape,t.quote)===0,expectedRecordLength:Array.isArray(t.columns)?t.columns.length:void 0,field:new zs(20),firstLineToHeaders:t.cast_first_line_to_header,needMoreDataSize:Math.max(t.comment!==null?t.comment.length:0,...t.delimiter?t.delimiter.map(n=>n.length):[],t.delimiter_auto?1:0,t.quote!==null?t.quote.length:0,...e.map(n=>n.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new zs(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:t.record_delimiter.length===0?0:Math.max(...t.record_delimiter.map(n=>n.length)),trimChars:[Buffer.from(" ",t.encoding)[0],Buffer.from(" ",t.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:r}};var gc=function(t){return t.replace(/([A-Z])/g,function(e,r){return"_"+r.toLowerCase()})};var Wt=function(t){let e={};for(let n in t)e[gc(n)]=t[n];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new Y("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new Y("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new Y("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(n){let i=Date.parse(n);return isNaN(i)?n:new Date(i)};else if(typeof e.cast_date!="function")throw new Y("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=bn(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new Y("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new Y("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new Y("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new Y("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new Y("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!wr(e.delimiter_auto))throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!wr(e.delimiter_auto.preferred))throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(n,i)=>(n.total-n.std)*(i.preferred[n.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new Y("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let r=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(n){if(typeof n=="string"&&(n=Buffer.from(n,e.encoding)),!Buffer.isBuffer(n)||n.length===0)throw new Y("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${r}`],e);return n}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new Y("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new Y("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new Y("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(n,i){if(typeof n!="string"&&!Buffer.isBuffer(n))throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${i},`,`got ${JSON.stringify(n)}`],e);if(n.length===0)throw new Y("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${i},`,`got ${JSON.stringify(n)}`],e);return typeof n=="string"&&(n=Buffer.from(n,e.encoding)),n}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&t.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&t.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`);return e};var yc=function(t,e){e||({delimiter_auto:e}=Wt({delimiter_auto:!0})),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)&&(t=(i=>{let s=[],o=wn({delimiter:[]}),a=f=>s.push(f),l=()=>{},c=o.parse(i,!0,a,l);if(c!==void 0)throw c;return s})(t));let r=Array(127).fill().map(()=>({lines:[]}));t.map(([i],s)=>{for(let o=0,a=i.length;o<a;o++){let l=i.charCodeAt(o);r[l].lines[s]===void 0&&(r[l].lines[s]=0),r[l].lines[s]++}}),r.map((i,s)=>{i.char_code=s,i.std=Dp(i.lines),i.total=i.lines.reduce((o,a)=>o+a,0),i.preferred=!!e.preferred[s],i.score=e.score(i,e)});let n=r.reduce((i,s)=>i.score>s.score?i:s,{});return String.fromCharCode(n.char_code)},Dp=function(t){let e=t.length;if(e===0)return 0;let r=t.reduce((n,i)=>n+i)/e;return Math.sqrt(t.map(n=>Math.pow(n-r,2)).reduce((n,i)=>n+i)/e)};var _c=function(t){return t.every(e=>e==null||e.toString&&e.toString().trim()==="")},Ip=13,Rp=10,Vt={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},wn=function(t={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},r=Wt(t);return{info:e,original_options:t,options:r,state:mc(r),__needMoreData:function(n,i,s){if(s)return!1;let{encoding:o,escape:a,quote:l}=this.options,{quoting:c,needMoreDataSize:f,recordDelimiterMaxLength:h}=this.state,p=i-n-1,m=Math.max(f,h===0?Buffer.from(`\r
|
|
859
|
+
`,o).length:h,c?(a===null?0:a.length)+l.length:0,c?l.length+h:0);return p<m},parse:function(n,i,s,o){let{bom:a,comment_no_infix:l,delimiter_auto:c,encoding:f,from_line:h,ltrim:p,max_record_size:m,raw:g,relax_quotes:_,rtrim:O,skip_empty_lines:b,to:x,to_line:I}=this.options,{comment:L,escape:N,quote:V,record_delimiter:B}=this.options,{bomSkipped:Q,delimiterDiscovered:ee,delimiterBufPrevious:oe,rawBuffer:ae,escapeIsQuote:pe}=this.state;if(!ee&&c){let K;if(oe===void 0?K=n:oe!==void 0&&n===void 0?K=oe:K=Buffer.concat([oe,n]),n=void 0,i||K.length>c.size)this.options.delimiter=[Buffer.from(yc(K,this.options.delimiter_auto))],this.state.previousBuf=K,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=K;return}}let{previousBuf:xe}=this.state,q;if(xe===void 0)if(n===void 0){o();return}else q=n;else xe!==void 0&&n===void 0?q=xe:q=Buffer.concat([xe,n]);if(Q===!1)if(a===!1)this.state.bomSkipped=!0;else if(q.length<3){if(i===!1){this.state.previousBuf=q;return}}else{for(let K in Vt)if(Vt[K].compare(q,0,Vt[K].length)===0){let ue=Vt[K].length;this.state.bufBytesStart+=ue,q=q.slice(ue);let mt=Wt({...this.original_options,encoding:K});for(let Z in mt)this.options[Z]=mt[Z];({comment:L,escape:N,quote:V}=this.options);break}this.state.bomSkipped=!0}let Me=q.length,k;for(k=0;k<Me&&!this.__needMoreData(k,Me,i);k++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),I!==-1&&this.info.lines>I){this.state.stop=!0,o();return}this.state.quoting===!1&&B.length===0&&this.__autoDiscoverRecordDelimiter(q,k)&&(B=this.options.record_delimiter);let K=q[k];if(g===!0&&ae.append(K),(K===Ip||K===Rp)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(N!==null&&this.state.quoting===!0&&this.__isEscape(q,k,K)&&k+N.length<Me)if(pe){if(this.__isQuote(q,k+N.length)){this.state.escaping=!0,k+=N.length-1;continue}}else{this.state.escaping=!0,k+=N.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(q,k))if(this.state.quoting===!0){let Z=q[k+V.length],We=O&&this.__isCharTrimable(q,k+V.length),Ce=L!==null&&this.__compareBytes(L,q,k+V.length,Z),Ae=this.__isDelimiter(q,k+V.length,Z),st=B.length===0?this.__autoDiscoverRecordDelimiter(q,k+V.length):this.__isRecordDelimiter(Z,q,k+V.length);if(N!==null&&this.__isEscape(q,k,K)&&this.__isQuote(q,k+N.length))k+=N.length-1;else if(!Z||Ae||st||Ce||We){this.state.quoting=!1,this.state.wasQuoting=!0,k+=V.length-1;continue}else if(_===!1){let _e=this.__error(new Y("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(Z)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(_e!==void 0)return _e}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(V),k+=V.length-1}else if(this.state.field.length!==0){if(_===!1){let Z=this.__infoField(),We=Object.keys(Vt).map(Ae=>Vt[Ae].equals(this.state.field.toString())?Ae:!1).filter(Boolean)[0],Ce=this.__error(new Y("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(Z.column)} at line ${Z.lines}, value is ${JSON.stringify(this.state.field.toString(f))}`,We?`(${We} bom)`:void 0],this.options,Z,{field:this.state.field}));if(Ce!==void 0)return Ce}}else{this.state.quoting=!0,k+=V.length-1;continue}if(this.state.quoting===!1){let Z=this.__isRecordDelimiter(K,q,k);if(Z!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=h){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),k+=Z-1;continue}if(b===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,k+=Z-1;continue}this.info.bytes=this.state.bufBytesStart+k;let Ae=this.__onField();if(Ae!==void 0)return Ae;this.info.bytes=this.state.bufBytesStart+k+Z;let st=this.__onRecord(s);if(st!==void 0)return st;if(x!==-1&&this.info.records>=x){this.state.stop=!0,o();return}}this.state.commenting=!1,k+=Z-1;continue}if(this.state.commenting)continue;if(L!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(L,q,k,K)!==0){this.state.commenting=!0;continue}let We=this.__isDelimiter(q,k,K);if(We!==0){this.info.bytes=this.state.bufBytesStart+k;let Ce=this.__onField();if(Ce!==void 0)return Ce;k+=We-1;continue}}}if(this.state.commenting===!1&&m!==0&&this.state.record_length+this.state.field.length>m)return this.__error(new Y("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${m}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let ue=p===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(q,k),mt=O===!1||this.state.wasQuoting===!1;if(ue===!0&&mt===!0)this.state.field.append(K);else{if(O===!0&&!this.__isCharTrimable(q,k))return this.__error(new Y("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));ue===!1&&(k+=this.__isCharTrimable(q,k)-1);continue}}if(i===!0)if(this.state.quoting===!0){let K=this.__error(new Y("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(K!==void 0)return K}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+k;let K=this.__onField();if(K!==void 0)return K;let ue=this.__onRecord(s);if(ue!==void 0)return ue}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=k,this.state.previousBuf=q.slice(k);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(n){let{columns:i,group_columns_by_name:s,encoding:o,info:a,from:l,relax_column_count:c,relax_column_count_less:f,relax_column_count_more:h,raw:p,skip_records_with_empty_values:m}=this.options,{enabled:g,record:_}=this.state;if(g===!1)return this.__resetRecord();let O=_.length;if(i===!0){if(m===!0&&_c(_)){this.__resetRecord();return}return this.__firstLineToColumns(_)}if(i===!1&&this.info.records===0&&(this.state.expectedRecordLength=O),O!==this.state.expectedRecordLength){let b=i===!1?new Y("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${O} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_}):new Y("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${i.length},`,`got ${O} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_});if(c===!0||f===!0&&O<this.state.expectedRecordLength||h===!0&&O>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=b;else{let x=this.__error(b);if(x)return x}}if(m===!0&&_c(_)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,l===1||this.info.records>=l){let{objname:b}=this.options;if(i!==!1){let x={};for(let I=0,L=_.length;I<L;I++)i[I]===void 0||i[I].disabled||(s===!0&&Object.hasOwn(x,i[I].name)?Array.isArray(x[i[I].name])?x[i[I].name]=x[i[I].name].concat(_[I]):x[i[I].name]=[x[i[I].name],_[I]]:Object.defineProperty(x,i[I].name,{value:_[I],enumerable:!0,writable:!0,configurable:!0}));if(p===!0||a===!0){let I=Object.assign({record:x},p===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),L=this.__push(b===void 0?I:[x[b],I],n);if(L)return L}else{let I=this.__push(b===void 0?x:[x[b],x],n);if(I)return I}}else if(p===!0||a===!0){let x=Object.assign({record:_},p===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),I=this.__push(b===void 0?x:[_[b],x],n);if(I)return I}else{let x=this.__push(b===void 0?_:[_[b],_],n);if(x)return x}}this.__resetRecord()},__firstLineToColumns:function(n){let{firstLineToHeaders:i}=this.state;try{let s=i===void 0?n:i.call(null,n);if(!Array.isArray(s))return this.__error(new Y("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(s)}`],this.options,this.__infoField(),{headers:s}));let o=bn(s);this.state.expectedRecordLength=o.length,this.options.columns=o,this.__resetRecord();return}catch(s){return s}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:n,encoding:i,rtrim:s,max_record_size:o}=this.options,{enabled:a,wasQuoting:l}=this.state;if(a===!1)return this.__resetField();let c=this.state.field.toString(i);if(s===!0&&l===!1&&(c=c.trimRight()),n===!0){let[f,h]=this.__cast(c);if(f!==void 0)return f;c=h}this.state.record.push(c),o!==0&&typeof c=="string"&&(this.state.record_length+=c.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(n,i){let{on_record:s}=this.options;if(s!==void 0){let o=this.__infoRecord();try{n=s.call(null,n,o)}catch(a){return a}if(n==null)return}this.info.bytes_records+=this.info.bytes,i(n)},__cast:function(n){let{columns:i,relax_column_count:s}=this.options;if(Array.isArray(i)===!0&&s&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let a=this.__infoField();return[void 0,this.state.castField.call(null,n,a)]}catch(a){return[a]}if(this.__isFloat(n))return[void 0,parseFloat(n)];if(this.options.cast_date!==!1){let a=this.__infoField();return[void 0,this.options.cast_date.call(null,n,a)]}return[void 0,n]},__compareBytes:function(n,i,s,o){if(n[0]!==o)return 0;let a=n.length;for(let l=1;l<a;l++)if(n[l]!==i[s+l])return 0;return a},__isCharTrimable:function(n,i){let{timchars:s,timcharFirstBytes:o}=this.state,a=n[i];if(a===void 0||o[a]===0)return 0;e:for(let l=0;l<s.length;l++){let c=s[l];for(let f=0;f<c.length;f++)if(c[f]!==n[i+f])continue e;return c.length}return 0},__isDelimiter:function(n,i,s){let{delimiter:o,ignore_last_delimiters:a}=this.options;if(a===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(a!==!1&&typeof a=="number"&&this.state.record.length===a-1)return 0;e:for(let l=0;l<o.length;l++){let c=o[l];if(c[0]===s){for(let f=1;f<c.length;f++)if(c[f]!==n[i+f])continue e;return c.length}}return 0},__isEscape:function(n,i,s){let{escape:o}=this.options;if(o===null)return!1;let a=o.length;if(o[0]===s){for(let l=0;l<a;l++)if(o[l]!==n[i+l])return!1;return!0}return!1},__isFloat:function(n){return n-parseFloat(n)+1>=0},__isQuote:function(n,i){let{quote:s}=this.options;if(s===null)return!1;let o=s.length;for(let a=0;a<o;a++)if(s[a]!==n[i+a])return!1;return!0},__isRecordDelimiter:function(n,i,s){let{record_delimiter:o}=this.options,a=o.length;e:for(let l=0;l<a;l++){let c=o[l],f=c.length;if(c[0]===n){for(let h=1;h<f;h++)if(c[h]!==i[s+h])continue e;return c.length}}return 0},__autoDiscoverRecordDelimiter:function(n,i){let{encoding:s}=this.options,o=[Buffer.from(`\r
|
|
860
860
|
`,s),Buffer.from(`
|
|
861
|
-
`,s),Buffer.from("\r",s)];e:for(let a=0;a<o.length;a++){let l=o[a].length;for(let c=0;c<l;c++)if(o[a][c]!==i[n+c])continue e;return this.options.record_delimiter.push(o[a]),this.state.recordDelimiterMaxLength=o[a].length,o[a].length}return 0},__error:function(i){let{encoding:n,raw:s,skip_records_with_error:o}=this.options,a=typeof i=="string"?new Error(i):i;if(o){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(a,s?this.state.rawBuffer.toString(n):void 0)}catch(l){return l}return}else return a},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:i,raw:n,encoding:s}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:i===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(s):void 0}},__infoField:function(){let{columns:i}=this.options,n=Array.isArray(i),s=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:s,column:n===!0?i.length>this.state.record.length?i[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var _c=function(t,e={}){typeof t=="string"&&(t=Buffer.from(t));let r=e&&e.objname?Object.create(null):[],i=bi(e),n=a=>{i.options.objname===void 0?r.push(a):r[a[0]]=a[1]},s=()=>{},o=i.parse(t,!0,n,s);if(o!==void 0)throw o;return r};function Xe(t,e,r){let i=e.match(/WHERE\s+(\w+)\s*=\s*\?/i);if(i&&r.length>0){let n=i[1]??"",s=String(r[0]);return t.filter(o=>String(o[n])===s)}return t}var wi=class{type="csv";data=null;filePath;encoding;constructor(e){if(!e.path)throw new Error('CSV datasource requires "path" configuration');this.filePath=e.path,this.encoding=e.encoding??"utf-8"}async loadData(){if(this.data!==null)return this.data;let e=await Tp(this.filePath,{encoding:this.encoding}),r=_c(e,{columns:!0,skip_empty_lines:!0,trim:!0});return this.data=r,this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function zs(t){return new wi(t)}import{readFile as Dp}from"node:fs/promises";var vi=class{type="json";data=null;filePath;constructor(e){if(!e.path)throw new Error('JSON datasource requires "path" configuration');this.filePath=e.path}async loadData(){if(this.data!==null)return this.data;let e=await Dp(this.filePath,{encoding:"utf-8"}),r=JSON.parse(e);if(Array.isArray(r))this.data=r;else if(typeof r=="object"&&r!==null)this.data=[r];else throw new Error("JSON file must contain an array or object");return this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Us(t){return new vi(t)}import{readFile as Ip}from"node:fs/promises";var Si=class{type="yaml";data=null;filePath;constructor(e){if(!e.path)throw new Error('YAML datasource requires "path" configuration');this.filePath=e.path}async loadData(){if(this.data!==null)return this.data;let e=await Ip(this.filePath,{encoding:"utf-8"}),r=Ze.load(e);if(Array.isArray(r))this.data=r;else if(typeof r=="object"&&r!==null)this.data=[r];else throw new Error("YAML file must contain an array or object");return this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Gs(t){return new Si(t)}import{stat as Dg}from"node:fs/promises";import{basename as Lu,dirname as Ig,extname as Rg}from"node:path";import{fileURLToPath as Tm}from"node:url";import{tracingChannel as Dm,channel as Im}from"node:diagnostics_channel";import{posix as Fm,win32 as _o}from"node:path";import{fileURLToPath as Bm}from"node:url";import{lstatSync as qm,readdir as Hm,readdirSync as $m,readlinkSync as jm,realpathSync as Wm}from"fs";import*as Vm from"node:fs";import{lstat as zm,readdir as Um,readlink as Gm,realpath as Ym}from"node:fs/promises";import{EventEmitter as xo}from"node:events";import uu from"node:stream";import{StringDecoder as Km}from"node:string_decoder";var Uc=(t,e,r)=>{let i=t instanceof RegExp?bc(t,r):t,n=e instanceof RegExp?bc(e,r):e,s=i!==null&&n!=null&&Rp(i,n,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+i.length,s[1]),post:r.slice(s[1]+n.length)}},bc=(t,e)=>{let r=e.match(t);return r?r[0]:null},Rp=(t,e,r)=>{let i,n,s,o,a,l=r.indexOf(t),c=r.indexOf(e,l+1),f=l;if(l>=0&&c>0){if(t===e)return[l,c];for(i=[],s=r.length;f>=0&&!a;){if(f===l)i.push(f),l=r.indexOf(t,f+1);else if(i.length===1){let h=i.pop();h!==void 0&&(a=[h,c])}else n=i.pop(),n!==void 0&&n<s&&(s=n,o=c),c=r.indexOf(e,f+1);f=l<c&&l>=0?l:c}i.length&&o!==void 0&&(a=[s,o])}return a},Gc="\0SLASH"+Math.random()+"\0",Yc="\0OPEN"+Math.random()+"\0",wo="\0CLOSE"+Math.random()+"\0",Kc="\0COMMA"+Math.random()+"\0",Jc="\0PERIOD"+Math.random()+"\0",Lp=new RegExp(Gc,"g"),Np=new RegExp(Yc,"g"),Mp=new RegExp(wo,"g"),Fp=new RegExp(Kc,"g"),Bp=new RegExp(Jc,"g"),qp=/\\\\/g,Hp=/\\{/g,$p=/\\}/g,jp=/\\,/g,Wp=/\\\./g,Vp=1e5,zp=4e6,Up=1e3,Gp=1e3;function Ys(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Yp(t){return t.replace(qp,Gc).replace(Hp,Yc).replace($p,wo).replace(jp,Kc).replace(Wp,Jc)}function Kp(t){return t.replace(Lp,"\\").replace(Np,"{").replace(Mp,"}").replace(Fp,",").replace(Bp,".")}function Ks(t,e){for(let r=0;r<e.length;r++)t.push(e[r])}function Jp(t){let e=[],r="";for(;;){let i=Uc("{","}",t);if(!i){let l=t.split(",");return l[0]=r+l[0],Ks(e,l),e}let{pre:n,body:s,post:o}=i,a=n.split(",");if(a[0]=r+a[0],a[a.length-1]+="{"+s+"}",!o.length)return Ks(e,a),e;r=a.pop(),Ks(e,a),t=o}}function Qp(t,e={}){if(!t)return[];let{max:r=Vp,maxLength:i=zp,maxDepth:n=Up,maxRewrites:s=Gp}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),uo(Yp(t),r,i,n,0,s,!0).map(Kp)}function Zp(t){return"{"+t+"}"}function Xp(t){return/^-?0\d/.test(t)}function em(t,e){return t<=e}function tm(t,e){return t>=e}function vr(t,e,r,i,n,s){let o=[],a=0;for(let l=0;l<t.length;l++)for(let c=0;c<r.length;c++){if(o.length>=i)return o;let f=t[l]+e+r[c];if(!(s&&!f)){if(a+f.length>n)return o;o.push(f),a+=f.length}}return o}function rm(t,e,r,i){let n=t.split(/\.\./),s=[];if(n[0]===void 0||n[1]===void 0)return s;let o=Ys(n[0]),a=Ys(n[1]),l=Math.max(n[0].length,n[1].length),c=n.length===3&&n[2]!==void 0?Math.max(Math.abs(Ys(n[2])),1):1,f=em;a<o&&(c*=-1,f=tm);let h=n.some(Xp),p=0;for(let m=o;f(m,a)&&s.length<r;m+=c){let g;if(e)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),h){let _=l-g.length;if(_>0){let O=new Array(_+1).join("0");m<0?g="-"+O+g.slice(1):g=O+g}}if(p+g.length>i)break;s.push(g),p+=g.length}return s}function uo(t,e,r,i,n,s,o){if(n>i)return[t];let a=[""],l=0,c=!1,f=!0;for(;;){let h=Uc("{","}",t);if(!h)return vr(a,t,[""],e,r,c);let p=h.pre;if(/\$$/.test(p)){if(a=vr(a,p+"{"+h.body+"}",[""],e,r,c&&!h.post.length),f=!1,!h.post.length)break;t=h.post;continue}let m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),_=m||g,O=h.body.indexOf(",")>=0;if(!_&&!O){if(l<s&&h.post.match(/,(?!,).*\}/)){l++,t=h.pre+"{"+h.body+wo+h.post,o=!0;continue}return vr(a,p+"{"+h.body+"}"+h.post,[""],e,r,c)}f&&(c=o&&!_,f=!1);let b;if(_)b=rm(h.body,g,e,r);else{let x=Jp(h.body);if(x.length===1&&x[0]!==void 0&&(x=uo(x[0],e,r,i,n+1,s,!1).map(Zp),x.length===1)){if(a=vr(a,p+x[0],[""],e,r,c&&!h.post.length),!h.post.length)break;t=h.post;continue}let I=c&&!h.post.length&&!p;for(let N=0;I&&N<a.length;N++)a[N]&&(I=!1);b=[];let L=0;e:for(let N=0;N<x.length;N++){let B=uo(x[N],e,r,i,n+1,s,!1);for(let z=0;z<B.length;z++){let se=B[z];if(!(I&&!se)){if(b.length>=e||L+se.length>r)break e;b.push(se),L+=se.length}}}}if(a=vr(a,p,b,e,r,c&&!h.post.length),!h.post.length)break;t=h.post}return a}var ho=(t,e)=>t===e?{t:"lit",ch:String(t)}:{t:"class",re:new RegExp(`^[${t}-${e}]$`)},Js=(t,e)=>e.map(r=>[ho(t,t),...r]),Lr=(t,e)=>{if(!t)return[[]];let r=+t[0],i=+e[0],n=t.slice(1),s=e.slice(1);if(r===i)return Js(r,Lr(n,s));let o="0".repeat(n.length),a="9".repeat(n.length),l=[];n!==o&&l.push(...Js(r++,Lr(n,a)));let c=s===a?[]:Js(i--,Lr(o,s));return r<=i&&l.push([ho(r,i),...Array.from(n,()=>ho(0,9))]),l.push(...c),l},wc=(t,e,r)=>{if(r)return Lr(String(t).padStart(r,"0"),String(e).padStart(r,"0"));let i=[];for(let n=String(t).length;n<=String(e).length;n++){let s=Math.max(t,n===1?0:10**(n-1)),o=Math.min(e,10**n-1);i.push(...Lr(String(s),String(o)))}return i},im=(t,e)=>{let r=Number(t),i=Number(e);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(i))return;r>i&&([r,i]=[i,r]);let n=/^-?0\d/.test(t)||/^-?0\d/.test(e)?Math.max(t.length,e.length):0,s=[];if(r<0){let o=wc(Math.max(-i,1),-r,n&&n-1);s.push(...o.map(a=>[{t:"lit",ch:"-"},...a]))}return i>=0&&s.push(...wc(Math.max(r,0),i,n)),s},nm={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},Sr=t=>t.replace(/[[\]\\-]/g,"\\$&"),Qs=/$./,sm=(t,e,r=!1,i)=>{let n=b=>{let x=i?b.normalize(i):b;return[...x].length===1?x:b},s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let o=[],a=[],l=s+1,c=!1,f=!1,h=!1,p=s,m="";e:for(;l<t.length;){let b=String.fromCodePoint(t.codePointAt(l));if((b==="!"||b==="^")&&l===s+1){h=!0,l++;continue}if(b==="]"&&c&&!f){p=l+1;break}if(c=!0,b==="\\"&&!f){f=!0,l++;continue}if(b==="["&&!f){for(let[I,[L,N]]of Object.entries(nm))if(t.startsWith(I,l)){if(m)return[Qs,t.length-s];l+=I.length,N?a.push(L):o.push(L);continue e}}f=!1;let x=n(b);if(m){x.codePointAt(0)>m.codePointAt(0)?o.push(Sr(m)+"-"+Sr(x)):x===m&&o.push(Sr(x)),m="",l+=b.length;continue}if(t.startsWith("-]",l+b.length)){o.push(Sr(x+"-")),l+=b.length+1;continue}if(t.startsWith("-",l+b.length)){m=x,l+=b.length+1;continue}o.push(Sr(x)),l+=b.length}if(p<l)return[Qs,0];if(!o.length&&!a.length)return[Qs,t.length-s];let g="["+(h?"^":"")+o.join("")+"]",_="["+(h?"":"^")+a.join("")+"]",O="^"+(o.length&&a.length?"("+g+"|"+_+")":o.length?g:_);return[new RegExp(O,r?"iu":"u"),p-s]},fo={t:"match",id:0},om="!?+*@",Tt=t=>({t:"lit",ch:t}),am=t=>t.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),Qc=t=>new RegExp(`^${am(t)}$`,"iu"),xi=new Map,Zc=t=>{let e=xi.get(t);return e||(e=Qc(t),xi.size>=1e3&&xi.clear(),xi.set(t,e)),e},vo=(t,e)=>{if(e===t.ch)return!0;if(!t.re)return!1;let r=e.charCodeAt(0);if(r>=128)return t.re.test(e);let i=t.ascii??=new Uint8Array(128);return i[r]||=t.re.test(e)?1:2,i[r]===1},lm=(t,e,r,i,n)=>{let s=[];for(let o=0;o<t.length;){let a=String.fromCodePoint(t.codePointAt(o));if(n){let l=a==="\\"&&t.startsWith(n,o+1)?1:0;if(l||a===n){let c=o+l+n.length,f=t.indexOf(n,c),h=/^(-?\d+)\.\.(-?\d+)$/.exec(t.slice(c,f)),p=f!==-1&&h&&im(h[1],h[2]);if(p){s.push({t:"ext",type:"@",alts:p}),o=f+n.length;continue}}}if(a==="\\"){let l=t.codePointAt(o+1),c=l===void 0?a:String.fromCodePoint(l);s.push(Tt(c)),o+=1+c.length;continue}if(a==="["){let[l,c]=sm(t,o,e,i);if(c){s.push({t:"class",re:l}),o+=c;continue}}if(!r&&om.includes(a)&&t[o+1]==="("){s.push({t:"open",type:a}),o+=2;continue}s.push(!r&&a==="|"?{t:"bar"}:!r&&a===")"?{t:"close"}:a==="*"?{t:"star"}:a==="?"?{t:"any"}:Tt(a)),o+=a.length}return s},cm=t=>{let e=new Map,r=[];return t.forEach((i,n)=>{i.t==="open"?r.push(n):i.t==="close"&&r.length&&e.set(r.pop(),n)}),e},Xc=(t,e,r,i,n)=>{let s=[],o=[s];for(let a=r;a<i;a++){let l=t[a],c=e.get(a);if(l.t==="open"&&c!==void 0){let f=Xc(t,e,a+1,c,!1);s.push({t:"ext",type:l.type,alts:f}),a=c}else l.t==="bar"&&!n?o.push(s=[]):l.t==="open"?s.push(Tt(l.type),Tt("(")):l.t==="bar"?s.push(Tt("|")):l.t==="close"?s.push(Tt(")")):s.push(l)}return o},eu=(t,e)=>{let r=[],i="",n=()=>{for(let s of i.normalize(e))r.push(Tt(s));i=""};for(let s of t){if(s.t==="lit"){i+=s.ch;continue}n(),r.push(s.t==="ext"?{...s,alts:s.alts.map(o=>eu(o,e))}:s)}return n(),r},um=(t,e)=>{let r=1,i=o=>({t:"split",id:r++,out:o}),n=(o,a)=>o.reduceRight((l,c)=>s(c,l),a),s=(o,a)=>{switch(o.t){case"lit":let h=e?Zc(o.ch):void 0;return{t:"lit",id:r++,ch:o.ch,re:h,next:a};case"any":case"star":return{t:o.t,id:r++,next:a};case"class":return{t:"class",id:r++,re:o.re,next:a}}let l=h=>o.alts.map(p=>n(p,h));switch(o.type){case"@":return i(l(a));case"?":return i([a,...l(a)]);case"!":return{t:"neg",id:r++,sub:i(l(fo)),next:a}}let c=i([]),f=i(l(c));return c.out.push(a,f),o.type==="*"?c:f};return[n(t,fo),r]},hm=t=>{let e=[],r=new Set,i=s=>s.t==="match"?"match":String(s.id),n=(s,o)=>{if(s.t==="match"||r.has(s))return;r.add(s);let a=l=>e.push(`${o}${s.id}: ${l}`);switch(s.t){case"split":a(`split -> ${s.out.map(i).join(", ")}`);for(let l of s.out)n(l,o);return;case"neg":return a(`!(${i(s.sub)}) -> ${i(s.next)}`),n(s.sub,o+" "),n(s.next,o);case"lit":a(`${JSON.stringify(s.ch)} -> ${i(s.next)}`);break;case"class":a(`${s.re} -> ${i(s.next)}`);break;default:a(`${s.t==="any"?"?":"*"} -> ${i(s.next)}`)}n(s.next,o)};return n(t,""),[`start -> ${i(t)}`,...e].join(`
|
|
862
|
-
`)},fm=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},tu=(t,e)=>t.ids.length!==e.ids.length||t.runs.length!==e.runs.length||t.ids.some((r,i)=>r!==e.ids[i])?!1:t.runs.every(r=>e.runs.some(i=>i.neg===r.neg&&tu(i.state,r.state))),vc=t=>({has:new Float64Array(t),seen:new Float64Array(t),gen:0}),po=class{dots;dotStart;#e;constructor(t,e,r){this.dots=t,this.dotStart=e,this.#e=r}state(){return new fm(++this.#e.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,r)=>e-r),t.match&&t.ids.unshift(fo.id),t}#n(t,e){let{seen:r}=this.#e;return r[e.id]===t.gen?!1:(r[e.id]=t.gen,!0)}#i(t,e){let{has:r}=this.#e;return r[e.id]===t.gen?!1:(r[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,r,i){switch(e.t){case"split":if(!this.#n(t,e))return;for(let s of e.out)this.add(t,s,r,i);return;case"neg":if(!this.#n(t,e))return;let n=this.state();return this.add(n,e.sub,r,!1),this.done(n),this.addRun(t,{t:"run",neg:e,state:n},r,i);case"star":if(this.restricted(r,i))return;this.#i(t,e)&&this.add(t,e.next,r,i);return;case"match":t.match=!0;return;default:this.#i(t,e)}}addRun(t,e,r,i){for(let n of t.runs)if(n.neg===e.neg&&tu(n.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,r,i)}step(t,e,r,i){let n=this.state();for(let s of t.threads)switch(s.t){case"lit":vo(s,e)&&this.add(n,s.next,r+1,i);break;case"any":this.restricted(r,i)||this.add(n,s.next,r+1,i);break;case"class":!this.restricted(r,i)&&s.re.test(e)&&this.add(n,s.next,r+1,i);break;case"star":this.restricted(r,i)||this.add(n,s,r+1,i)}if(!this.restricted(r,i))for(let s of t.runs){if(s.state.dead){this.addRun(n,s,r+1,i);continue}let o=this.step(s.state,e,r,!1);this.addRun(n,{t:"run",neg:s.neg,state:o},r+1,i)}return this.done(n)}},ru=t=>{let e=t.ids.join();if(!t.runs.length)return e;let r=t.runs.map(i=>`${i.neg.id}(${ru(i.state)})`);return`${e}|${r.sort().join("|")}`},dm=1<<18,pm=class{#e;#n=new Map;#i=0;#o;#s;#d;#f;constructor(t,e){this.#e=t,this.#d=new po(!1,!1,e),this.#f=new po(!1,!0,e)}#h(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#a(t){let e=ru(t),r=this.#n.get(e);if(r)return r;this.#i>dm&&this.#m();let i=this.#h(t);return this.#n.set(e,i),this.#i+=e.length+1,i}#m(){this.#n.clear(),this.#i=0,this.#o=void 0,this.#s=void 0}start(t){if(t){if(this.#s)return this.#s;let r=this.#f.state();return this.#f.add(r,this.#e,0,!0),this.#s=this.#h(this.#f.done(r))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#e,0,!0),this.#o=this.#a(this.#d.done(e))}next(t,e){let r=e.charCodeAt(0),i=r<128?void 0:t.next.get(e);if(i)return i;let n=t===this.#s?this.#a(this.#f.step(t.state,e,0,!0)):this.#a(this.#d.step(t.state,e,1,!0));return r<128?(t.ascii||(t.ascii=new Array(128),this.#i+=128),t.ascii[r]=n):t.next.set(e,n),this.#i++,n}},mm=t=>{let e=[];for(let r=t;r.t!=="match";r=r.next){if(r.t==="split"||r.t==="neg")return;e.push(r)}return e},gm=(t,e,r,i)=>{let n=0,s=r,o=-1,a=0;for(;s<i;){let l=t[n];if(l?.t==="star"){o=n++,a=s;continue}let c=e[s];if(l&&(l.t==="any"||l.t==="lit"&&vo(l,c)||l.t==="class"&&l.re.test(c))){n++,s++;continue}if(o===-1)return!1;n=o+1,s=++a}for(;t[n]?.t==="star";)n++;return n===t.length},iu=t=>{let e=0,r=0;for(let i of t){let[n,s]=ym(i);e+=n,r+=s}return[e,r]},ym=t=>{if(t.t==="star")return[0,1/0];if(t.t!=="ext")return[1,1];if(t.type==="!")return[0,1/0];let e=t.alts.map(iu),r=Math.min(...e.map(s=>s[0])),i=Math.max(...e.map(s=>s[1])),n=i===0?0:1/0;return t.type==="@"?[r,i]:t.type==="?"?[0,i]:t.type==="*"?[0,n]:[r,n]},Sc=(t,e,r)=>{for(let i=0;i<t.length;i++)if(!vo(t[i],e[r+i]))return!1;return!0},_m=/[/\ud800-\udfff]/,bm=/[\ud800-\udfff]/,Ci=t=>bm.test(t)?[...t]:t,xc=t=>{if(t.includes("/"))throw new Error("can only match a single path portion, got: "+t)},Cc=class{pattern;options;#e;#n;#i;#o;#s;#d=!1;#f;#h;#a=!1;#m=0;#c=1/0;#l=[];#r=[];#_;#x;#b=!1;#g;#y;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:r=!1,noext:i=!1,normalize:n}=e;this.#y=n===!0?"NFC":n||void 0;let s=/^[?*+@]\(\)$/.test(t),o=lm(t,r,i||s,this.#y,e.rangeMark),[a]=Xc(o,cm(o),0,o.length,!0);this.#y&&(a=eu(a,this.#y));let[l,c]=um(a,r);if(this.#e=l,this.#n=c,a.every(f=>f.t==="lit"))this.#s=a.map(f=>f.ch).join(""),this.#d=r;else{let f=m=>m.t!=="lit"?void 0:r?{ch:m.ch,re:Zc(m.ch)}:{ch:m.ch};for(let m of a){let g=f(m);if(!g)break;this.#l.push(g)}for(let m=a.length-1;m>=0;m--){let g=f(a[m]);if(!g)break;this.#r.unshift(g)}this.#b=!!(this.#l.length||this.#r.length),r||(this.#_=this.#l.map(m=>m.ch).join(""),this.#x=this.#r.map(m=>m.ch).join("")),this.#h=mm(this.#e)?.slice(this.#l.length,-this.#r.length||void 0),this.#a=!!this.#h?.every(m=>m.t==="star"||m.t==="any");let[h,p]=iu(a);this.#m=h,this.#c=p}}test(t){return this.#y?(xc(t),this.#p(t.normalize(this.#y))):_m.test(t)?(xc(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#y?t.normalize(this.#y):t)}#p(t,e){if(this.#s!==void 0)return this.#d?(this.#f??=Qc(this.#s)).test(t):t===this.#s;let r=this.#m,i=this.#c;if(e===void 0){let c=t.length,f=c+1>>1;if(c<r||f>i)return!1;(f<r||c>i)&&(e=Ci(t))}if(e!==void 0&&(e.length<r||e.length>i))return!1;let n=this.#l.length;if(this.#b)if(this.#_!==void 0&&this.#x!==void 0){if(!t.startsWith(this.#_)||!t.endsWith(this.#x))return!1}else{e??=Ci(t);let c=e.length-this.#r.length;if(!Sc(this.#l,e,0)||!Sc(this.#r,e,c))return!1}let s=!this.options.dot&&t.startsWith(".");if(this.#h){if(t==="."||t===".."||s&&!n)return!1;if(this.#a)return!0;e??=Ci(t);let c=e.length-this.#r.length;return gm(this.#h,e,n,c)}if(e??=Ci(t),t==="."||t===".."){this.#i??=vc(this.#n);let c=this.#o??=new po(!0,!1,this.#i),f=c.state();c.add(f,this.#e,0,!0);let h=c.done(f);for(let p=0;p<e.length;p++)h=c.step(h,e[p],p,!0);return h.match}this.#i??=vc(this.#n);let o=this.#g??=new pm(this.#e,this.#i),a=o.start(s),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let f=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[f]??o.next(a,e[c])}return a.match}toString(){return hm(this.#e)}},Bi=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},So=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!1}={})=>r?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),nu=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!0}={})=>r?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),De=(t,e,r={})=>(Bi(e),!r.nocomment&&e.charAt(0)==="#"?!1:vm(e,r).match(t)),zt=new Map,wm=256,vm=(t,e)=>{let r=t+"\0"+JSON.stringify(e),i=zt.get(r);return i?zt.delete(r):(i=new Dt(t,{...e}),zt.size>=wm&&zt.delete(zt.keys().next().value)),zt.set(r,i),i},su=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",kc={win32:{sep:"\\"},posix:{sep:"/"}},Sm=su==="win32"?kc.win32.sep:kc.posix.sep;De.sep=Sm;var ie=Symbol("globstar **");De.GLOBSTAR=ie;var xm=(t,e={})=>r=>De(r,t,e);De.filter=xm;var lt=(t,e={})=>Object.assign({},t,e),Cm=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return De;let e=De;return Object.assign((r,i,n={})=>e(r,i,lt(t,n)),{Minimatch:class extends e.Minimatch{constructor(r,i={}){super(r,lt(t,i))}static defaults(r){return e.defaults(lt(t,r)).Minimatch}},unescape:(r,i={})=>e.unescape(r,lt(t,i)),escape:(r,i={})=>e.escape(r,lt(t,i)),filter:(r,i={})=>e.filter(r,lt(t,i)),defaults:r=>e.defaults(lt(t,r)),braceExpand:(r,i={})=>e.braceExpand(r,lt(t,i)),match:(r,i,n={})=>e.match(r,i,lt(t,n)),sep:e.sep,GLOBSTAR:ie})};De.defaults=Cm;var mo=(t,e={})=>(Bi(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Qp(t,{max:e.braceExpandMax}));De.braceExpand=mo;var km=100,Em=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,Am=(t,e,r={})=>{let i=new Dt(e,r);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};De.match=Am;var Ec=/[?*]|[+@!]\(.*?\)|\[|\]/,ou=(t,e)=>{let r=e+1;(t.charAt(r)==="!"||t.charAt(r)==="^")&&r++;let i=!1;for(;r<t.length;r++){let n=t.charAt(r);if(n==="]"&&i)return r;i=!0,n==="\\"&&r++}return-1},Om=(t,e)=>{if(!e&&(t==="+()"||t==="@()"))return t;let r="";for(let i=0;i<t.length;i++){let n=t.charAt(i);if(n==="\\")r+=t.charAt(++i)||n;else{if(n==="*"||n==="?")return;if(n==="["){let s=ou(t,i);if(s===-1){r+=n;continue}let o=t.slice(i+1,s);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(t.charAt(i+1)))return;r+=o,i=s}else{if(!e&&"+@!".includes(n)&&t.charAt(i+1)==="("&&t.includes(")",i+2))return;r+=n}}}return r},Pm=t=>{if(/^[?*+@]\(\)$/.test(t)||t.includes("[:"))return!1;let e=0;for(let r=0;r<t.length;r++){let i=t.charAt(r);if(i==="\\"){if(++r===t.length)return!1}else if(i==="["){let n=ou(t,r);n!==-1&&(r=n)}else if("+@!?*".includes(i)&&t.charAt(r+1)==="(")e++,r++;else if(i===")"){if(!e--)return!1}else if(i==="|"&&!e)return!1}return!e},Zs,Ac,xt=(t,e)=>typeof t=="string"?e===t:e!==""&&t.testUnchecked(e),Oc=(t,e,r,i,n)=>xt(t,e)?r:i!==void 0&&xt(t,i)?n:-1,go=t=>t==="."||t==="..",Xs=t=>typeof t=="string"&&/^[a-z]:$/i.test(t),Ni=t=>typeof t=="string"&&/^unc$/i.test(t),eo=t=>{if(t[0]!==""||t[1]!=="")return-1;let e=t[2]!=="?"?2:Ni(t[3])?4:-1,r=t[e],i=t[e+1];return e!==-1&&r!==void 0&&r!==""&&r!==ie&&i!==void 0&&i!==""&&i!==ie?e:-1},ki=(t,e)=>!go(t)&&(e||!t.startsWith(".")),xr=(t,e,r,i,n)=>{for(let s=e;s<r;){if(t.charCodeAt(s)===46){if(!i)return!0;let a=t.charCodeAt(s+1)===46?s+2:s+1;if(a>=r||qi(t.charCodeAt(a),n))return!0}let o=yo(t,s,n);if(o===-1)return!1;for(s=o+1;s<r&&qi(t.charCodeAt(s),n);)s++}return!1},qi=(t,e)=>e==="/"?t===47:e==="\\"?t===92:t===47||t===92,yo=(t,e,r)=>{if(r!=="both")return t.indexOf(r,e);let i=t.indexOf("/",e),n=t.indexOf("\\",e);return i===-1?n:n===-1?i:Math.min(i,n)},Pc=(t,e,r)=>r!=="both"?t.lastIndexOf(r,e):Math.max(t.lastIndexOf("/",e),t.lastIndexOf("\\",e)),to={},Dt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#n;#i;#o;#s=[];#d=[];#f=[];#h=new Map;#a=!1;#m;#c=new WeakMap;constructor(t,e={}){Bi(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||su,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#e=!this.preserveMultipleSlashes,this.#i=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(s=>this.#r(s));this.#f=this.set.map((s,o)=>this.#e&&s.length-1>n[o]),this.#s=this.set.map((s,o)=>{let a=this.#f[o]?s.length-1:s.length,l=s.slice(n[o]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#n=this.#s.some(s=>s.length),this.#d=this.set.map((s,o)=>{let[a,l,c]=s;if(this.#f[o]&&s.length===2&&a===ie&&l!==ie)return"tail";if(this.#f[o]&&e.matchBase&&s.length===1&&a!==ie&&a!=="")return"base";if(!(!this.#e||n[o]!==-1)){if(s.length===3&&a===ie&&c===ie&&l!==ie&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(s.length===2&&l===ie&&a!==ie&&a!=="")return"head"}})}#l(t){return this.#o?t.normalize(this.#o):t}#r(t){if(!this.isWindows)return-1;if(Xs(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&Xs(t[3]))return 3;let e=eo(t);return e===-1?-1:e+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#A())];let r=this.globSet.map(n=>this.#t(n));this.globParts=this.preprocess(r),this.#a=!0;let i=this.globParts.map((n,s,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&Ni(n[3])?6:4,l=n[0]===""&&n[1]===""&&(n[2]==="?"||!Ec.test(n[2]))&&n.slice(3,a).every(f=>!Ec.test(f)),c=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,a).map(f=>this.#l(f)),...n.slice(a).map(f=>this.parse(f))];if(c)return[this.#l(n[0]),...n.slice(1).map(f=>this.parse(f))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let s=this.set[n];s[0]===""&&s[1]===""&&this.globParts[n][2]==="?"&&(Xs(s[3])||Ni(this.globParts[n][3]))&&(Ni(this.globParts[n][3])&&(s[3]="UNC"),s[2]="?")}e.noext||this.mergeRows(),this.#a=!1,this.set.forEach((n,s)=>{for(let o=0;o<n.length;o++)n[o]===to&&(n[o]=this.parse(this.globParts[s][o]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(r=>r.length));for(let r=0;r<e;r++){let i=new Map;this.set.forEach((s,o)=>{if(!(s[r]instanceof Cc||s[r]===to)||!Pm(this.globParts[o][r]))return;let a=[...this.globParts[o]];a[r]="";let l=`${s.length}/${a.join("/")}`,c=i.get(l);c?c.push(o):i.set(l,[o])});let n=new Set;for(let s of i.values()){if(s.length<2)continue;let[o,...a]=s,l=`@(${s.map(c=>this.globParts[c][r]).join("|")})`;this.globParts[o][r]=l,this.set[o][r]=this.parse(l);for(let c of a)n.add(c)}n.size&&(t=!0,this.set=this.set.filter((s,o)=>!n.has(o)),this.globParts=this.globParts.filter((s,o)=>!n.has(o)))}}}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let r=-1;for(;(r=e.indexOf("**",r+1))!==-1;){let i=r;for(;e[i+1]==="**";)i++;i!==r&&e.splice(r,i-r)}return e})}levelOneOptimize(t){return t.map(e=>{let r=this.#r(e)+1;return e=e.reduce((i,n)=>{let s=i[i.length-1];return n==="**"&&s==="**"?i:n===".."&&i.length>r&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#_(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",r=this.#e?0:-1,i="",n=0,s,o=0,a=!!this.options.dot;e:for(let l=0;l<this.set.length;l++){let c=this.set[l],f=c[c.length-1],h=r!==-1&&this.#f[l]&&f!==ie;if(h&&r===0){let g=Pc(t,t.length,e);if(n=g+1,i=t.slice(n),i===""&&g>=0){let O=g;for(;O>0&&qi(t.charCodeAt(O-1),e);)O--;o=O===0?0:Pc(t,O-1,e)+1,s=t.slice(o,O)}let _=this.#i&&(go(i)||i===""&&s!==void 0&&go(s));r=_?-1:1,h=!_}let p=-1;if(h&&typeof f=="string"&&(p=Oc(f,i,n,s,o),p===-1))continue;if(this.#n){for(let g of this.#s[l])if(!t.includes(g))continue e}if(h&&typeof f=="object"&&(p=Oc(f,i,n,s,o),p===-1))continue;let m=this.#d[l];if(m==="base"&&h)return"yes";if(m==="tail"&&h){if(this.#i&&xr(t,0,p,!0,e))return"maybe";if(!xr(t,0,p,a,e))return"yes";continue}if(m==="mid"||m==="head"){let g=this.#b(t,c,m==="head",a,e);if(g!=="no")return g;continue}return"maybe"}return"no"}#x(t,e,r){let i=!!this.options.dot,n=t.length;if(r==="head"){if(n<2||!xt(e[0],t[0]))return!1;for(let o=1;o<n;o++)if(!ki(t[o],i))return!1;return!0}let s=e[1];if(r==="tail"){let o=n-1;if(!xt(s,t[o])&&(t[o]!==""||n===1||!xt(s,t[--o])))return!1;for(let a=0;a<o;a++)if(!ki(t[a],i))return!1;return!0}for(let o=0;o<n;o++){if(xt(s,t[o])&&o+1<n){let a=o+1;for(;a<n&&ki(t[a],i);)a++;if(a===n)return!0}if(!ki(t[o],i))return!1}return!1}#b(t,e,r,i,n){if(this.#i&&xr(t,0,t.length,!0,n))return"maybe";let s=e[r?0:1],o=0;for(let a=yo(t,o,n);a!==-1;a=yo(t,o,n)){let l=a+1;for(;l<t.length&&qi(t.charCodeAt(l),n);)l++;if((typeof s=="string"?a-o===s.length&&t.startsWith(s,o):a>o&&s.testUnchecked(t.slice(o,a)))&&!xr(t,l,t.length,i,n))return"yes";if(r||xr(t,o,l,i,n))return"no";o=l}return"no"}#g(t){let e=Zs;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#y(t){let{isWindows:e,preserveMultipleSlashes:r}=this,i=this.#t(e?t.split("\\").join("/"):t),n=this.#o;return n&&(i=i.map(s=>s.normalize(n))),Zs={f:t,isWindows:e,preserveMultipleSlashes:r,normalize:n,parts:i},Zs}#p(t){let e=[...t],r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let o=e[s];s===1&&o===""&&e[0]===""||(o==="."||o==="")&&(r=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=this.#r(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,r=0,i=1e6,n=!1;do{n=!1;for(let s of t){let o=-1;for(;(o=s.indexOf("**",o+1))!==-1;){let c=o;for(;s[c+1]==="**";)c++;c>o&&s.splice(o+1,c-o);let f=s[o+1],h=s[o+2],p=s[o+3];if(f!==".."||!h||h==="."||h===".."||!p||p==="."||p==="..")continue;let m=s.length-1;if(t.length>=e||r+m>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");n=!0,s.splice(o,1);let g=s.slice(0);g[o]="**",r+=m,t.push(g),o--}if(!this.preserveMultipleSlashes){for(let c=1;c<s.length-1;c++){let f=s[c];c===1&&f===""&&s[0]===""||(f==="."||f==="")&&(n=!0,s.splice(c,1),c--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(n=!0,s.pop())}let a=this.#r(s)+1,l=a;for(;(l=s.indexOf("..",l+1))!==-1;){let c=s[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;let f=l===1&&s[l+1]==="**"?["."]:[];s.splice(l-1,2,...f),s.length===0&&s.push(""),l=Math.max(l-2,a)}}}}while(n);return t}secondPhasePreProcess(t){let e=new Set,r=t.filter(s=>{let o=s.join("/");return e.has(o)?!1:(e.add(o),!0)}),i=new Map;for(let s of r){let o=[];for(let a=0;a<s.length;a++)s[a]==="*"&&o.push(a);o.length&&i.set(o.join(","),o)}if(!i.size||r.length*i.size>1e5)return r;let{dot:n}=this.options;return r.filter(s=>{for(let o of i.values()){if(o[o.length-1]>=s.length)continue;let a=[...s],l=!0,c=!1;for(let f of o){let h=s[f];if(h!=="*"){if(!h||h==="**"||!n&&h.startsWith(".")){l=!1;break}a[f]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,r++;r&&(this.pattern=t.slice(r)),this.negate=e}#C(t,e,r,i){let n=0,s=0,o=this.isWindows?eo(e):-1,a=o===-1?-1:eo(r);if(a!==-1){let l=r[a],c=r[a+1];typeof l!="string"||typeof c!="string"?(n=o,s=a):e[o].toLowerCase()===l.toLowerCase()&&e[o+1].toLowerCase()===c.toLowerCase()&&(n=o+2,s=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),h=!f&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),p=c?3:l?0:void 0,m=h?3:f?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[g,_]=[t[p],r[m]];g.toLowerCase()===_.toLowerCase()&&(s=m+1,n=p+1)}}return t=e,r.includes(ie)?this.#k(t,r,i,n,s):this.#w(t,r,i,n,s)}#k(t,e,r,i,n){let{head:s,body:o,tail:a,segments:l}=this.#v(e,r,n);if(s.length){let f=i+s.length;if(!this.#w(t,s,r,i,0,f))return!1;i+=s.length,n+=s.length}let c=0;if(a.length){if(a.length+i>t.length)return!1;let f=t.length-a.length;if(this.#w(t,a,r,f,0))c=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(f--,!this.#w(t,a,r,f,0)))return!1;c=a.length+1}}if(!o.length){let f=!!c;for(let h=i;h<t.length-c;h++){let p=String(t[h]);if(f=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return r||f}return!!this.#S(t,l,t.length-c,i,0,r,0,!!c,new Set)}#v(t,e,r){let i=this.#c.get(t);i||(i=[],this.#c.set(t,i));let n=r*2+(e?1:0),s=i[n];if(s)return s;let o=t.indexOf(ie,r),a=t.lastIndexOf(ie),l=t.slice(r,o),c=t.slice(o+1,e?void 0:a),f=e?[]:t.slice(a+1),h=[[[],0]],p=h[0],m=0,g=[0];for(let O of c)O===ie?(g.push(m),p=[[],0],h.push(p)):(p[0].push(O),m++);h.forEach((O,b)=>{O[1]=m-g[b]});let _={head:l,body:c,tail:f,segments:h};return i[n]=_,_}#S(t,e,r,i,n,s,o,a,l){let c=e[n];if(!c){if(s)return i>=r||i===r-1&&t[i]==="";for(let m=i;m<r;m++){a=!0;let g=t[m];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return a}let[f,h]=c,p=s?r:r-h;for(;i<=p;){let m=n*(t.length+1)+i;if(l.has(m))return!1;if(l.add(m),this.#w(t,f,s,i,0,i+f.length)&&o<this.maxGlobstarRecursion){let _=this.#S(t,e,r,i+f.length,n+1,s,o+1,a,l);if(_!==!1)return _}if(i===p)break;let g=t[i];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;i++}return s||null}#w(t,e,r,i,n,s=t.length){let o,a,l,c;for(o=i,a=n,c=Math.min(s,t.length),l=e.length;o<c&&a<l;o++,a++){let f=e[a],h=t[o];if(f===!1||f===ie||!xt(f,h))return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return mo(this.pattern,this.options)}#A(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let r=String.fromCharCode(e),i=!1,n=t.replace(Em,(o,a,l)=>{let c=Number(a),f=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(f)||Math.abs(c-f)+1<km?o:(i=!0,`${r}${a}..${l}${r}`)});if(!i)return this.braceExpand();let s=mo(n,this.options);for(let o of s)for(let a of o.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(r))return this.braceExpand()}return this.#m=r,s}parse(t){Bi(t);let e=this.options;if(t==="**")return ie;if(t==="")return"";let{nocase:r,nocaseMagicOnly:i,noext:n=!1,dot:s,normalize:o}=e,a=this.#m,l=a&&t.includes(a)?void 0:Om(t,n);if(l!==void 0&&!(r&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#l(l);if(this.#a)return to;let c=this.#h.get(t);return c||(c=new Cc(t,{nocase:r,noext:n,dot:s,normalize:o,...a&&{rangeMark:a}}),this.#h.set(t,c)),c}#t(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let r=this.options,i=this.#g(t);if(!i){if(!e&&!this.#o&&(this.#e||this.#n)&&Ac!==t){Ac=t;let l=this.#_(t);if(l==="no")return r.flipNegate?!1:this.negate;if(l==="yes")return r.flipNegate?!0:!this.negate}i=this.#y(t)}let n=i.parts,s=this.#i?i.resolved??=this.#p(n):n,o=this.set,a=n[n.length-1];if(!a)for(let l=n.length-2;!a&&l>=0;l--)a=n[l];for(let l=0;l<o.length;l++){let c=o[l],f=e?void 0:this.#d[l];if(f==="base"?xt(c[0],a):f?this.#x(s,c,f):r.matchBase&&c.length===1?this.#C([a],[a],c,e):this.#C(n,s,c,e))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return De.defaults(t).Minimatch}};De.Minimatch=Dt;De.escape=So;De.unescape=nu;var me=Im("lru-cache:metrics"),Pr=Dm("lru-cache"),Rm=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ro=()=>me.hasSubscribers||Pr.hasSubscribers,au=new Set,Tc=typeof process=="object"&&process?process:{},Lm=(t,e,r,i)=>{typeof Tc.emitWarning=="function"?Tc.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Nm=t=>!au.has(t),St=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),lu=t=>St(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Mi:null:null,Mi=class extends Array{constructor(t){super(t),this.fill(0)}},Mm=class Tr{heap;length;static#e=!1;static create(e){let r=lu(e);if(!r)return[];Tr.#e=!0;let i=new Tr(e,r);return Tr.#e=!1,i}constructor(e,r){if(!Tr.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},$i=class cu{#e;#n;#i;#o;#s;#d;#f;#h;get perf(){return this.#h}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#m;#c;#l;#r;#_;#x;#b;#g;#y;#p;#C;#k;#v;#S;#w;#A;#t;#D;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#v,autopurgeTimers:e.#S,sizes:e.#C,keyMap:e.#c,keyList:e.#l,valList:e.#r,next:e.#_,prev:e.#x,get head(){return e.#b},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,i,n,s)=>e.#F(r,i,n,s),moveToTail:r=>e.#Y(r),indexes:r=>e.#P(r),rindexes:r=>e.#T(r),isStale:r=>e.#E(r)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#m}get size(){return this.#a}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#i}get onInsert(){return this.#o}get disposeAfter(){return this.#s}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:c,onInsert:f,disposeAfter:h,noDisposeOnSet:p,noUpdateTTL:m,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:O,fetchMethod:b,memoMethod:x,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:B,ignoreFetchAbort:z,backgroundFetchSize:se=1,perf:ae}=e;if(this.backgroundFetchSize=se,ae!==void 0&&typeof ae?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#h=ae??Rm,r!==0&&!St(r))throw new TypeError("max option must be a nonnegative integer");let X=r?lu(r):Array;if(!X)throw new Error("invalid max value: "+r);if(this.#e=r,this.#n=g,this.maxEntrySize=_||this.#n,this.sizeCalculation=O,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=x,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=b,this.#A=!!b,this.#c=new Map,this.#l=Array.from({length:r}).fill(void 0),this.#r=Array.from({length:r}).fill(void 0),this.#_=new X(r),this.#x=new X(r),this.#b=0,this.#g=0,this.#y=Mm.create(r),this.#a=0,this.#m=0,typeof c=="function"&&(this.#i=c),typeof f=="function"&&(this.#o=f),typeof h=="function"?(this.#s=h,this.#p=[]):(this.#s=void 0,this.#p=void 0),this.#w=!!this.#i,this.#D=!!this.#o,this.#t=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#n!==0&&!St(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!St(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=St(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!St(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let pe="LRU_CACHE_UNBOUNDED";Nm(pe)&&(au.add(pe),Lm("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",pe,cu))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#I(){let e=new Mi(this.#e),r=new Mi(this.#e);this.#v=e,this.#k=r;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=i,this.#q=(l,c,f=this.#h.now())=>{r[l]=c!==0?f:0,e[l]=c,n(l,c)},this.#O=l=>{r[l]=e[l]!==0?this.#h.now():0,n(l,e[l])};let n=this.ttlAutopurge?(l,c)=>{if(i?.[l]&&(clearTimeout(i[l]),i[l]=void 0),c&&c!==0&&i){let f=setTimeout(()=>{this.#E(l)?(this.#B(this.#l[l],"expire"),i[l]=void 0):n(l,a(l))},c+1);f.unref&&f.unref(),i[l]=f}}:()=>{};this.#R=(l,c)=>{if(e[c]){let f=e[c],h=r[c];if(!f||!h)return;l.ttl=f,l.start=h,l.now=s||o();let p=l.now-h;l.remainingTTL=f-p}};let s=0,o=()=>{let l=this.#h.now();if(this.ttlResolution>0){s=l;let c=setTimeout(()=>s=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{let c=this.#c.get(l);return c===void 0?0:a(c)};let a=l=>{let c=e[l],f=r[l];if(!c||!f)return 1/0;let h=(s||o())-f;return c-h};this.#E=l=>{let c=r[l],f=e[l];return!!f&&!!c&&(s||o())-c>f}}#O=()=>{};#R=()=>{};#q=()=>{};#E=()=>!1;#V(){let e=new Mi(this.#e);this.#m=0,this.#C=e,this.#N=r=>{this.#m-=e[r],e[r]=0},this.#H=(r,i,n,s)=>{if(!St(n)){if(this.#u(i))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,r),!St(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return n},this.#L=(r,i,n)=>{if(e[r]=i,this.#n){let s=this.#n-e[r];for(;this.#m>s;)this.#W(!0)}this.#m+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#m)}}#N=e=>{};#L=(e,r,i)=>{};#H=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;this.#$(r)&&((e||!this.#E(r))&&(yield r),r!==this.#b);)r=this.#x[r]}*#T({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#b;this.#$(r)&&((e||!this.#E(r))&&(yield r),r!==this.#g);)r=this.#_[r]}#$(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#l[e],this.#r[e]])}*rentries(){for(let e of this.#T())this.#r[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#l[e],this.#r[e]])}*keys(){for(let e of this.#P()){let r=this.#l[e];r!==void 0&&!this.#u(this.#r[e])&&(yield r)}}*rkeys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#u(this.#r[e])&&(yield r)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#T())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#P()){let n=this.#r[i],s=this.#u(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#l[i],this))return this.#G(this.#l[i],r)}}forEach(e,r=this){for(let i of this.#P()){let n=this.#r[i],s=this.#u(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}rforEach(e,r=this){for(let i of this.#T()){let n=this.#r[i],s=this.#u(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}purgeStale(){let e=!1;for(let r of this.#T({allowStale:!0}))this.#E(r)&&(this.#B(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let i=this.#r[r],n=this.#u(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#v&&this.#k){let o=this.#v[r],a=this.#k[r];if(o&&a){let l=o-(this.#h.now()-a);s.ttl=l,s.start=Date.now()}}return this.#C&&(s.size=this.#C[r]),s}dump(){let e=[];for(let r of this.#P({allowStale:!0})){let i=this.#l[r],n=this.#r[r],s=this.#u(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#v&&this.#k){o.ttl=this.#v[r];let a=this.#h.now()-this.#k[r];o.start=Math.floor(Date.now()-a)}this.#C&&(o.size=this.#C[r]),e.unshift([i,o])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=this.#h.now()-n}this.#M(r,i.value,i)}}set(e,r,i={}){let{status:n=me.hasSubscribers?{}:void 0}=i;i.status=n,n&&(n.op="set",n.key=e,r!==void 0&&(n.value=r),n.cache=this);let s=this.#M(e,r,i);return n&&me.hasSubscribers&&me.publish(n),s}#M(e,r,i,n){let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=i,f=this.#u(r);if(r===void 0)return c&&(c.set="deleted"),this.delete(e),this;let{noUpdateTTL:h=this.noUpdateTTL}=i;c&&!f&&(c.value=r);let p=this.#H(e,r,i.size||0,l,c);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#B(e,"set"),c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this;let m=this.#a===0?void 0:this.#c.get(e);if(m===void 0)m=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#e?this.#W(!1):this.#a,this.#l[m]=e,this.#r[m]=r,this.#c.set(e,m),this.#_[this.#g]=m,this.#x[m]=this.#g,this.#g=m,this.#a++,this.#L(m,p,c),c&&(c.set="add"),h=!1,this.#D&&!f&&this.#o?.(r,e,"add");else{this.#Y(m);let g=this.#r[m];if(r!==g){if(!a)if(this.#u(g)){g!==n&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=g;_!==void 0&&_!==r&&(this.#w&&this.#i?.(_,e,"set"),this.#t&&this.#p?.push([_,e,"set"]))}else this.#w&&this.#i?.(g,e,"set"),this.#t&&this.#p?.push([g,e,"set"]);if(this.#N(m),this.#L(m,p,c),this.#r[m]=r,!f){let _=g&&this.#u(g)?g.__staleWhileFetching:g,O=_===void 0?"add":r!==_?"replace":"update";c&&(c.set=O,_!==void 0&&(c.oldValue=_)),this.#D&&this.onInsert?.(r,e,O)}}else f||(c&&(c.set="update"),this.#D&&this.onInsert?.(r,e,"update"))}if(s!==0&&!this.#v&&this.#I(),this.#v&&(h||this.#q(m,s,o),c&&this.#R(c,m)),!a&&this.#t&&this.#p){let g=this.#p,_;for(;_=g?.shift();)this.#s?.(..._)}return this}pop(){try{for(;this.#a;){let e=this.#r[this.#b];if(this.#W(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#p){let e=this.#p,r;for(;r=e?.shift();)this.#s?.(...r)}}}#W(e){let r=this.#b,i=this.#l[r],n=this.#r[r],s=this.#u(n);s&&n.__abortController.abort(new Error("evicted"));let o=s?n.__staleWhileFetching:n;return(this.#w||this.#t)&&o!==void 0&&(this.#w&&this.#i?.(o,i,"evict"),this.#t&&this.#p?.push([o,i,"evict"])),this.#N(r),this.#S?.[r]&&(clearTimeout(this.#S[r]),this.#S[r]=void 0),e&&(this.#l[r]=void 0,this.#r[r]=void 0,this.#y.push(r)),this.#a===1?(this.#b=this.#g=0,this.#y.length=0):this.#b=this.#_[r],this.#c.delete(i),this.#a--,r}has(e,r={}){let{status:i=me.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="has",i.key=e,i.cache=this);let n=this.#K(e,r);return me.hasSubscribers&&me.publish(i),n}#K(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,s=this.#c.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#E(s))n&&(n.has="stale",this.#R(n,s));else return i&&this.#O(s),n&&(n.has="hit",this.#R(n,s)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{status:i=ro()?{}:void 0}=r;i&&(i.op="peek",i.key=e,i.cache=this),r.status=i;let n=this.#z(e,r);return me.hasSubscribers&&me.publish(i),n}#z(e,r){let{status:i,allowStale:n=this.allowStale}=r,s=this.#c.get(e);if(s===void 0||!n&&this.#E(s)){i&&(i.peek=s===void 0?"miss":"stale");return}let o=this.#r[s],a=this.#u(o)?o.__staleWhileFetching:o;return i&&(a!==void 0?(i.peek="hit",i.value=a):i.peek="miss"),a}#F(e,r,i,n){let s=r===void 0?void 0:this.#r[r];if(this.#u(s))return s;let o=new AbortController,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:i,context:n},c=(_,O=!1)=>{let{aborted:b}=o.signal,x=i.ignoreFetchAbort&&_!==void 0,I=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&_!==void 0);if(i.status&&(b&&!O?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,x&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),b&&!x&&!O)return h(o.signal.reason,I);let L=m,N=this.#r[r];return(N===m||N===void 0&&x&&O)&&(_===void 0?L.__staleWhileFetching!==void 0?this.#r[r]=L.__staleWhileFetching:this.#B(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#M(e,_,l.options,L))),_},f=_=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=_),h(_,!1)),h=(_,O)=>{let{aborted:b}=o.signal,x=b&&i.allowStaleOnFetchAbort,I=x||i.allowStaleOnFetchRejection,L=I||i.noDeleteOnFetchRejection,N=m;if(this.#r[r]===m&&(!L||!O&&N.__staleWhileFetching===void 0?this.#B(e,"fetch"):x||(this.#r[r]=N.__staleWhileFetching)),I)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw _},p=(_,O)=>{let b=this.#d?.(e,s,l);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=x=>c(x,!0)))}),b&&b instanceof Promise?b.then(x=>_(x===void 0?void 0:x),O):b!==void 0&&_(b)};i.status&&(i.status.fetchDispatched=!0);let m=new Promise(p).then(c,f),g=Object.assign(m,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#M(e,g,{...l.options,status:void 0}),r=this.#c.get(e)):this.#r[r]=g,g}#u(e){if(!this.#A)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(e,r={}){let i=Pr.hasSubscribers,{status:n=ro()?{}:void 0}=r;r.status=n,n&&r.context&&(n.context=r.context);let s=this.#U(e,r);return n&&i&&(n.trace=!0,Pr.tracePromise(()=>s,n).catch(()=>{})),s}async#U(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:_,forceRefresh:O=!1,status:b,signal:x}=r;if(b&&(b.op="fetch",b.key=e,O&&(b.forceRefresh=!0),b.cache=this),!this.#A)return b&&(b.fetch="get"),this.#G(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:b});let I={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:b,signal:x},L=this.#c.get(e);if(L===void 0){b&&(b.fetch="miss");let N=this.#F(e,L,I,_);return N.__returned=N}else{let N=this.#r[L];if(this.#u(N)){let ae=i&&N.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",ae&&(b.returnedStale=!0)),ae?N.__staleWhileFetching:N.__returned=N}let B=this.#E(L);if(!O&&!B)return b&&(b.fetch="hit"),this.#Y(L),n&&this.#O(L),b&&this.#R(b,L),N;let z=this.#F(e,L,I,_),se=z.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=B?"stale":"refresh",se&&B&&(b.returnedStale=!0)),se?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,r={}){let i=Pr.hasSubscribers,{status:n=ro()?{}:void 0}=r;r.status=n,n&&r.context&&(n.context=r.context);let s=this.#j(e,r);return n&&i&&(n.trace=!0,Pr.tracePromise(()=>s,n).catch(()=>{})),s}async#j(e,r={}){let i=await this.#U(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let{status:i=me.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="memo",i.key=e,r.context&&(i.context=r.context),i.cache=this);let n=this.#Z(e,r);return i&&(i.value=n),me.hasSubscribers&&me.publish(i),n}#Z(e,r={}){let i=this.#f;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,status:s,forceRefresh:o,...a}=r;s&&o&&(s.forceRefresh=!0);let l=this.#G(e,a),c=o||l===void 0;if(s&&(s.memo=c?"miss":"hit",c||(s.value=l)),!c)return l;let f=i(e,l,{options:a,context:n});return s&&(s.value=f),this.#M(e,f,a),f}get(e,r={}){let{status:i=me.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="get",i.key=e,i.cache=this);let n=this.#G(e,r);return i&&(n!==void 0&&(i.value=n),me.hasSubscribers&&me.publish(i)),n}#G(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#c.get(e);if(a===void 0){o&&(o.get="miss");return}let l=this.#r[a],c=this.#u(l);return o&&this.#R(o,a),this.#E(a)?c?(o&&(o.get="stale-fetching"),i&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#B(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=c?"fetching":"hit"),this.#Y(a),n&&this.#O(a),c?l.__staleWhileFetching:l)}#J(e,r){this.#x[r]=e,this.#_[e]=r}#Y(e){e!==this.#g&&(e===this.#b?this.#b=this.#_[e]:this.#J(this.#x[e],this.#_[e]),this.#J(this.#g,e),this.#g=e)}delete(e){return this.#B(e,"delete")}#B(e,r){me.hasSubscribers&&me.publish({op:"delete",delete:r,key:e,cache:this});let i=!1;if(this.#a!==0){let n=this.#c.get(e);if(n!==void 0)if(this.#S?.[n]&&(clearTimeout(this.#S[n]),this.#S[n]=void 0),i=!0,this.#a===1)this.#Q(r);else{this.#N(n);let s=this.#r[n];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#t)&&(this.#w&&this.#i?.(s,e,r),this.#t&&this.#p?.push([s,e,r])),this.#c.delete(e),this.#l[n]=void 0,this.#r[n]=void 0,n===this.#g)this.#g=this.#x[n];else if(n===this.#b)this.#b=this.#_[n];else{let o=this.#x[n];this.#_[o]=this.#_[n];let a=this.#_[n];this.#x[a]=this.#x[n]}this.#a--,this.#y.push(n)}}if(this.#t&&this.#p?.length){let n=this.#p,s;for(;s=n?.shift();)this.#s?.(...s)}return i}clear(){return this.#Q("delete")}#Q(e){for(let r of this.#T({allowStale:!0})){let i=this.#r[r];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#l[r];this.#w&&this.#i?.(i,n,e),this.#t&&this.#p?.push([i,n,e])}}if(this.#c.clear(),this.#r.fill(void 0),this.#l.fill(void 0),this.#v&&this.#k){this.#v.fill(0),this.#k.fill(0);for(let r of this.#S??[])r!==void 0&&clearTimeout(r);this.#S?.fill(void 0)}if(this.#C&&this.#C.fill(0),this.#b=0,this.#g=0,this.#y.length=0,this.#m=0,this.#a=0,this.#t&&this.#p){let r=this.#p,i;for(;i=r?.shift();)this.#s?.(...i)}}},Dc=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jm=t=>!!t&&typeof t=="object"&&(t instanceof Hi||t instanceof uu||Qm(t)||Zm(t)),Qm=t=>!!t&&typeof t=="object"&&t instanceof xo&&typeof t.pipe=="function"&&t.pipe!==uu.Writable.prototype.pipe,Zm=t=>!!t&&typeof t=="object"&&t instanceof xo&&typeof t.write=="function"&&typeof t.end=="function",ct=Symbol("EOF"),ut=Symbol("maybeEmitEnd"),vt=Symbol("emittedEnd"),Ei=Symbol("emittingEnd"),Cr=Symbol("emittedError"),Ai=Symbol("closed"),Ic=Symbol("read"),Oi=Symbol("flush"),Rc=Symbol("flushChunk"),Ue=Symbol("encoding"),Ut=Symbol("decoder"),he=Symbol("flowing"),kr=Symbol("paused"),Gt=Symbol("resume"),fe=Symbol("buffer"),ke=Symbol("pipes"),de=Symbol("bufferLength"),io=Symbol("bufferPush"),Pi=Symbol("bufferShift"),we=Symbol("objectMode"),oe=Symbol("destroyed"),no=Symbol("error"),so=Symbol("emitData"),Lc=Symbol("emitEnd"),oo=Symbol("emitEnd2"),et=Symbol("async"),ao=Symbol("abort"),Ti=Symbol("aborted"),Er=Symbol("signal"),Ot=Symbol("dataListeners"),Te=Symbol("discarded"),Ar=t=>Promise.resolve().then(t),Xm=t=>t(),eg=t=>t==="end"||t==="finish"||t==="prefinish",tg=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,rg=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),hu=class{src;dest;opts;ondrain;constructor(t,e,r){this.src=t,this.dest=e,this.opts=r,this.ondrain=()=>t[Gt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ig=class extends hu{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,r){super(t,e,r),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},ng=t=>!!t.objectMode,sg=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Hi=class extends xo{[he]=!1;[kr]=!1;[ke]=[];[fe]=[];[we];[Ue];[et];[Ut];[ct]=!1;[vt]=!1;[Ei]=!1;[Ai]=!1;[Cr]=null;[de]=0;[oe]=!1;[Er];[Ti]=!1;[Ot]=0;[Te]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ng(e)?(this[we]=!0,this[Ue]=null):sg(e)?(this[Ue]=e.encoding,this[we]=!1):(this[we]=!1,this[Ue]=null),this[et]=!!e.async,this[Ut]=this[Ue]?new Km(this[Ue]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[fe]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ke]});let{signal:r}=e;r&&(this[Er]=r,r.aborted?this[ao]():r.addEventListener("abort",()=>this[ao]()))}get bufferLength(){return this[de]}get encoding(){return this[Ue]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[we]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[et]}set async(t){this[et]=this[et]||!!t}[ao](){this[Ti]=!0,this.emit("abort",this[Er]?.reason),this.destroy(this[Er]?.reason)}get aborted(){return this[Ti]}set aborted(t){}write(t,e,r){if(this[Ti])return!1;if(this[ct])throw new Error("write after end");if(this[oe])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(r=e,e="utf8"),e||(e="utf8");let i=this[et]?Ar:Xm;if(!this[we]&&!Buffer.isBuffer(t)){if(rg(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(tg(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[he]&&this[de]!==0&&this[Oi](!0),this[he]?this.emit("data",t):this[io](t),this[de]!==0&&this.emit("readable"),r&&i(r),this[he]):t.length?(typeof t=="string"&&!(e===this[Ue]&&!this[Ut]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[Ue]&&(t=this[Ut].write(t)),this[he]&&this[de]!==0&&this[Oi](!0),this[he]?this.emit("data",t):this[io](t),this[de]!==0&&this.emit("readable"),r&&i(r),this[he]):(this[de]!==0&&this.emit("readable"),r&&i(r),this[he])}read(t){if(this[oe])return null;if(this[Te]=!1,this[de]===0||t===0||t&&t>this[de])return this[ut](),null;this[we]&&(t=null),this[fe].length>1&&!this[we]&&(this[fe]=[this[Ue]?this[fe].join(""):Buffer.concat(this[fe],this[de])]);let e=this[Ic](t||null,this[fe][0]);return this[ut](),e}[Ic](t,e){if(this[we])this[Pi]();else{let r=e;t===r.length||t===null?this[Pi]():typeof r=="string"?(this[fe][0]=r.slice(t),e=r.slice(0,t),this[de]-=t):(this[fe][0]=r.subarray(t),e=r.subarray(0,t),this[de]-=t)}return this.emit("data",e),!this[fe].length&&!this[ct]&&this.emit("drain"),e}end(t,e,r){return typeof t=="function"&&(r=t,t=void 0),typeof e=="function"&&(r=e,e="utf8"),t!==void 0&&this.write(t,e),r&&this.once("end",r),this[ct]=!0,this.writable=!1,(this[he]||!this[kr])&&this[ut](),this}[Gt](){this[oe]||(!this[Ot]&&!this[ke].length&&(this[Te]=!0),this[kr]=!1,this[he]=!0,this.emit("resume"),this[fe].length?this[Oi]():this[ct]?this[ut]():this.emit("drain"))}resume(){return this[Gt]()}pause(){this[he]=!1,this[kr]=!0,this[Te]=!1}get destroyed(){return this[oe]}get flowing(){return this[he]}get paused(){return this[kr]}[io](t){this[we]?this[de]+=1:this[de]+=t.length,this[fe].push(t)}[Pi](){return this[we]?this[de]-=1:this[de]-=this[fe][0].length,this[fe].shift()}[Oi](t=!1){do;while(this[Rc](this[Pi]())&&this[fe].length);!t&&!this[fe].length&&!this[ct]&&this.emit("drain")}[Rc](t){return this.emit("data",t),this[he]}pipe(t,e){if(this[oe])return t;this[Te]=!1;let r=this[vt];return e=e||{},t===Dc.stdout||t===Dc.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,r?e.end&&t.end():(this[ke].push(e.proxyErrors?new ig(this,t,e):new hu(this,t,e)),this[et]?Ar(()=>this[Gt]()):this[Gt]()),t}unpipe(t){let e=this[ke].find(r=>r.dest===t);e&&(this[ke].length===1?(this[he]&&this[Ot]===0&&(this[he]=!1),this[ke]=[]):this[ke].splice(this[ke].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let r=super.on(t,e);if(t==="data")this[Te]=!1,this[Ot]++,!this[ke].length&&!this[he]&&this[Gt]();else if(t==="readable"&&this[de]!==0)super.emit("readable");else if(eg(t)&&this[vt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Cr]){let i=e;this[et]?Ar(()=>i.call(this,this[Cr])):i.call(this,this[Cr])}return r}removeListener(t,e){return this.off(t,e)}off(t,e){let r=super.off(t,e);return t==="data"&&(this[Ot]=this.listeners("data").length,this[Ot]===0&&!this[Te]&&!this[ke].length&&(this[he]=!1)),r}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Ot]=0,!this[Te]&&!this[ke].length&&(this[he]=!1)),e}get emittedEnd(){return this[vt]}[ut](){!this[Ei]&&!this[vt]&&!this[oe]&&this[fe].length===0&&this[ct]&&(this[Ei]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ai]&&this.emit("close"),this[Ei]=!1)}emit(t,...e){let r=e[0];if(t!=="error"&&t!=="close"&&t!==oe&&this[oe])return!1;if(t==="data")return!this[we]&&!r?!1:this[et]?(Ar(()=>this[so](r)),!0):this[so](r);if(t==="end")return this[Lc]();if(t==="close"){if(this[Ai]=!0,!this[vt]&&!this[oe])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Cr]=r,super.emit(no,r);let n=!this[Er]||this.listeners("error").length?super.emit("error",r):!1;return this[ut](),n}else if(t==="resume"){let n=super.emit("resume");return this[ut](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[ut](),i}[so](t){for(let r of this[ke])r.dest.write(t)===!1&&this.pause();let e=this[Te]?!1:super.emit("data",t);return this[ut](),e}[Lc](){return this[vt]?!1:(this[vt]=!0,this.readable=!1,this[et]?(Ar(()=>this[oo]()),!0):this[oo]())}[oo](){if(this[Ut]){let e=this[Ut].end();if(e){for(let r of this[ke])r.dest.write(e);this[Te]||super.emit("data",e)}}for(let e of this[ke])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[we]||(t.dataLength=0);let e=this.promise();return this.on("data",r=>{t.push(r),this[we]||(t.dataLength+=r.length)}),await e,t}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Ue]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(oe,()=>e(new Error("stream destroyed"))),this.on("error",r=>e(r)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[Te]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[ct])return e();let i,n,s=c=>{this.off("data",o),this.off("end",a),this.off(oe,l),e(),n(c)},o=c=>{this.off("error",s),this.off("end",a),this.off(oe,l),this.pause(),i({value:c,done:!!this[ct]})},a=()=>{this.off("error",s),this.off("data",o),this.off(oe,l),e(),i({done:!0,value:void 0})},l=()=>s(new Error("stream destroyed"));return new Promise((c,f)=>{n=f,i=c,this.once(oe,l),this.once("error",s),this.once("end",a),this.once("data",o)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Te]=!1;let t=!1,e=()=>(this.pause(),this.off(no,e),this.off(oe,e),this.off("end",e),t=!0,{done:!0,value:void 0}),r=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(no,e),this.once(oe,e),{next:r,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[oe])return t?this.emit("error",t):this.emit(oe),this;this[oe]=!0,this[Te]=!0,this[fe].length=0,this[de]=0;let e=this;return typeof e.close=="function"&&!this[Ai]&&e.close(),t?this.emit("error",t):this.emit(oe),this}static get isStream(){return Jm}},og=Wm.native,Dr={lstatSync:qm,readdir:Hm,readdirSync:$m,readlinkSync:jm,realpathSync:og,promises:{lstat:zm,readdir:Um,readlink:Gm,realpath:Ym}},fu=t=>!t||t===Dr||t===Vm?Dr:{...Dr,...t,promises:{...Dr.promises,...t.promises}},ag=/^\\\\\?\\([a-z]:)\\?$/i,lg=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,cg=/^\\\\[^\\?]+\\[^\\]+$/,Nc=t=>t.replace(/\//g,"\\").replace(ag,"$1\\").replace(lg,"\\\\$1\\").replace(cg,"$&\\"),ug=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,hg=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,fg=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,dg=/[\\/]/,qe=0,du=1,pu=2,tt=4,mu=6,gu=8,Pt=10,yu=12,Be=15,Or=~Be,lo=16,Mc=32,Ir=64,Ge=128,Di=256,Fi=512,Fc=Ir|Ge|Fi,pg=1023,co=t=>t.isFile()?gu:t.isDirectory()?tt:t.isSymbolicLink()?Pt:t.isCharacterDevice()?pu:t.isBlockDevice()?mu:t.isSocket()?yu:t.isFIFO()?du:qe,Bc=new $i({max:2**12}),Rr=t=>{let e=Bc.get(t);if(e)return e;let r=t.normalize("NFKD");return Bc.set(t,r),r},qc=new $i({max:2**12}),Ii=t=>{let e=qc.get(t);if(e)return e;let r=Rr(t.toLowerCase());return qc.set(t,r),r},Hc=class extends $i{constructor(){super({max:256})}},mg=class extends $i{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},_u=Symbol("PathScurry setAsCwd"),Ae=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#i;get mode(){return this.#i}#o;get nlink(){return this.#o}#s;get uid(){return this.#s}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#m;get size(){return this.#m}#c;get blocks(){return this.#c}#l;get atimeMs(){return this.#l}#r;get mtimeMs(){return this.#r}#_;get ctimeMs(){return this.#_}#x;get birthtimeMs(){return this.#x}#b;get atime(){return this.#b}#g;get mtime(){return this.#g}#y;get ctime(){return this.#y}#p;get birthtime(){return this.#p}#C;#k;#v;#S;#w;#A;#t;#D;#I;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=qe,r,i,n,s,o){this.name=t,this.#C=n?Ii(t):Rr(t),this.#t=e&pg,this.nocase=n,this.roots=i,this.root=r||this,this.#D=s,this.#v=o.fullpath,this.#w=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=fu(o.fs)}get fs(){return this.#e}depth(){return this.#k!==void 0?this.#k:this.parent?this.#k=this.parent.depth()+1:this.#k=0}childrenCache(){return this.#D}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#R(r):this.#R(r)}#R(t){let e=this;for(let r of t)e=e.child(r);return e}children(){let t=this.#D.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#D.set(this,e),this.#t&=~lo,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let r=this.children(),i=this.nocase?Ii(t):Rr(t);for(let a of r)if(a.#C===i)return a;let n=this.parent?this.sep:"",s=this.#v?this.#v+n+t:void 0,o=this.newChild(t,qe,{...e,parent:this,fullpath:s});return this.canReaddir()||(o.#t|=Ge),r.push(o),o}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let t=this.name,e=this.parent;if(!e)return this.#w=this.name;let r=e.relative();return r+(!r||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,e=this.parent;if(!e)return this.#A=this.fullpathPosix();let r=e.relativePosix();return r+(!r||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=r}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep==="/")return this.#S=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#S=`//?/${i}`:this.#S=i}let t=this.parent,e=t.fullpathPosix(),r=e+(!e||!t.parent?"":"/")+this.name;return this.#S=r}isUnknown(){return(this.#t&Be)===qe}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&Be)===gu}isDirectory(){return(this.#t&Be)===tt}isCharacterDevice(){return(this.#t&Be)===pu}isBlockDevice(){return(this.#t&Be)===mu}isFIFO(){return(this.#t&Be)===du}isSocket(){return(this.#t&Be)===yu}isSymbolicLink(){return(this.#t&Pt)===Pt}lstatCached(){return this.#t&Mc?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let t=this.#t&Be;return!(t!==qe&&t!==Pt||this.#t&Di||this.#t&Ge)}calledReaddir(){return!!(this.#t&lo)}isENOENT(){return!!(this.#t&Ge)}isNamed(t){return this.nocase?this.#C===Ii(t):this.#C===Rr(t)}async readlink(){let t=this.#I;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(e);if(r)return this.#I=r}catch(e){this.#T(e.code);return}}readlinkSync(){let t=this.#I;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(e);if(r)return this.#I=r}catch(e){this.#T(e.code);return}}#q(t){this.#t|=lo;for(let e=t.provisional;e<t.length;e++){let r=t[e];r&&r.#E()}}#E(){this.#t&Ge||(this.#t=(this.#t|Ge)&Or,this.#V())}#V(){let t=this.children();t.provisional=0;for(let e of t)e.#E()}#N(){this.#t|=Fi,this.#L()}#L(){if(this.#t&Ir)return;let t=this.#t;(t&Be)===tt&&(t&=Or),this.#t=t|Ir,this.#V()}#H(t=""){t==="ENOTDIR"||t==="EPERM"?this.#L():t==="ENOENT"?this.#E():this.children().provisional=0}#P(t=""){t==="ENOTDIR"?this.parent.#L():t==="ENOENT"&&this.#E()}#T(t=""){let e=this.#t;e|=Di,t==="ENOENT"&&(e|=Ge),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Or),this.#t=e,t==="ENOTDIR"&&this.parent&&this.parent.#L()}#$(t,e){return this.#W(t,e)||this.#M(t,e)}#M(t,e){let r=co(t),i=this.newChild(t.name,r,{parent:this}),n=i.#t&Be;return n!==tt&&n!==Pt&&n!==qe&&(i.#t|=Ir),e.unshift(i),e.provisional++,i}#W(t,e){for(let r=e.provisional;r<e.length;r++){let i=e[r];if((this.nocase?Ii(t.name):Rr(t.name))===i.#C)return this.#K(t,i,r,e)}}#K(t,e,r,i){let n=e.name;return e.#t=e.#t&Or|co(t),n!==t.name&&(e.name=t.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#t&Ge)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(t){this.#P(t.code)}}lstatSync(){if((this.#t&Ge)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(t){this.#P(t.code)}}#z(t){let{atime:e,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:s,blocks:o,ctime:a,ctimeMs:l,dev:c,gid:f,ino:h,mode:p,mtime:m,mtimeMs:g,nlink:_,rdev:O,size:b,uid:x}=t;this.#b=e,this.#l=r,this.#p=i,this.#x=n,this.#h=s,this.#c=o,this.#y=a,this.#_=l,this.#n=c,this.#d=f,this.#a=h,this.#i=p,this.#g=m,this.#r=g,this.#o=_,this.#f=O,this.#m=b,this.#s=x;let I=co(t);this.#t=this.#t&Or|I|Mc,I!==qe&&I!==tt&&I!==Pt&&(this.#t|=Ir)}#F=[];#u=!1;#U(t){this.#u=!1;let e=this.#F.slice();this.#F.length=0,e.forEach(r=>r(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#F.push(t),this.#u)return;this.#u=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,s)=>{if(n)this.#H(n.code),r.provisional=0;else{for(let o of s)this.#$(o,r);this.#q(r)}this.#U(r.slice(0,r.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#j)await this.#j;else{let r=()=>{};this.#j=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(e,{withFileTypes:!0}))this.#$(i,t);this.#q(t)}catch(i){this.#H(i.code),t.provisional=0}this.#j=void 0,r()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let r of this.#e.readdirSync(e,{withFileTypes:!0}))this.#$(r,t);this.#q(t)}catch(r){this.#H(r.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#t&Fc)return!1;let t=Be&this.#t;return t===qe||t===tt||t===Pt}shouldWalk(t,e){return(this.#t&tt)===tt&&!(this.#t&Fc)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#O)return this.#O;if(!((Fi|Di|Ge)&this.#t))try{let t=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!((Fi|Di|Ge)&this.#t))try{let t=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N()}}[_u](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),r=[],i=this;for(;i&&i.parent;)e.add(i),i.#w=r.join(this.sep),i.#A=r.join("/"),i=i.parent,r.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#w=void 0,i.#A=void 0,i=i.parent}},bu=class wu extends Ae{sep="\\";splitSep=dg;constructor(e,r=qe,i,n,s,o,a){super(e,r,i,n,s,o,a)}newChild(e,r=qe,i={}){return new wu(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return ug.exec(e)?.[0]??_o.parse(e).root}getRoot(e){if(e=Nc(e.toUpperCase()),e===this.root.name||/^[\\/]$/.test(e))return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new Co(e,{nocase:this.nocase,fs:this.fs}).root}sameRoot(e,r=this.root.name){return Nc(e.toUpperCase())===r}},vu=class Su extends Ae{splitSep="/";sep="/";constructor(e,r=qe,i,n,s,o,a){super(e,r,i,n,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=qe,i={}){return new Su(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},xu=class{root;rootPath;roots;cwd;#e;#n;#i;nocase;#o;constructor(t=process.cwd(),e,r,{nocase:i,childrenCacheSize:n=16*1024,fs:s=Dr}={}){this.#o=fu(s),(t instanceof URL||t.startsWith("file://"))&&(t=Bm(t));let o=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new Hc,this.#n=new Hc,this.#i=new mg(n);let a=o.substring(this.rootPath.length).split(r);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,f=e.sep,h=this.rootPath,p=!1;for(let m of a){let g=c--;l=l.child(m,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:h+=(p?"":f)+m}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let s=t[n];if(!(!s||s===".")&&(e=e?`${s}/${e}`:s,this.isAbsolute(s)))break}let r=this.#e.get(e);if(r!==void 0)return r;let i=this.cwd.resolve(e).fullpath();return this.#e.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let s=t[n];if(!(!s||s===".")&&(e=e?`${s}/${e}`:s,this.isAbsolute(s)))break}let r=this.#n.get(e);if(r!==void 0)return r;let i=this.cwd.resolve(e).fullpathPosix();return this.#n.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r}=e;if(t.canReaddir()){let i=await t.readdir();return r?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0}=e;return t.canReaddir()?r?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t.withFileTypes,t=this.cwd);let r=await t.readlink();return e?r:r?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t.withFileTypes,t=this.cwd);let r=t.readlinkSync();return e?r:r?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t.withFileTypes,t=this.cwd);let r=await t.realpath();return e?r:r?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t.withFileTypes,t=this.cwd);let r=t.realpathSync();return e?r:r?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:s}=e,o=[];(!n||n(t))&&o.push(r?t:t.fullpath());let a=new Set,l=(f,h)=>{a.add(f),f.readdirCB((p,m)=>{if(p)return h(p);let g=m.length;if(!g)return h();let _=()=>{--g===0&&h()};for(let O of m)(!n||n(O))&&o.push(r?O:O.fullpath()),i&&O.isSymbolicLink()?O.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(a,s)?l(b,_):_()):O.shouldWalk(a,s)?l(O,_):_()},!0)},c=t;return new Promise((f,h)=>{l(c,p=>{if(p)return h(p);f(o)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:s}=e,o=[];(!n||n(t))&&o.push(r?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let f of c){(!n||n(f))&&o.push(r?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,s)&&a.add(h)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:s}=e;(!n||n(t))&&(yield r?t:t.fullpath());let o=new Set([t]);for(let a of o){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield r?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(o,s)&&o.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:s}=e,o=new Hi({objectMode:!0});(!n||n(t))&&o.write(r?t:t.fullpath());let a=new Set,l=[t],c=0,f=()=>{let h=!1;for(;!h;){let p=l.shift();if(!p){c===0&&o.end();return}c++,a.add(p);let m=(_,O,b=!1)=>{if(_)return o.emit("error",_);if(i&&!b){let x=[];for(let I of O)I.isSymbolicLink()&&x.push(I.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(x.length){Promise.all(x).then(()=>m(null,O,!0));return}}for(let x of O)x&&(!n||n(x))&&(o.write(r?x:x.fullpath())||(h=!0));c--;for(let x of O){let I=x.realpathCached()||x;I.shouldWalk(a,s)&&l.push(I)}h&&!o.flowing?o.once("drain",f):g||f()},g=!0;p.readdirCB(m,!0),g=!1}};return f(),o}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Ae||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:s}=e,o=new Hi({objectMode:!0}),a=new Set;(!n||n(t))&&o.write(r?t:t.fullpath());let l=[t],c=0,f=()=>{let h=!1;for(;!h;){let p=l.shift();if(!p){c===0&&o.end();return}c++,a.add(p);let m=p.readdirSync();for(let g of m)(!n||n(g))&&(o.write(r?g:g.fullpath())||(h=!0));c--;for(let g of m){let _=g;if(g.isSymbolicLink()){if(!(i&&(_=g.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(a,s)&&l.push(_)}}h&&!o.flowing&&o.once("drain",f)};return f(),o}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[_u](e)}},Co=class extends xu{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:r=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(hg,"").replace(fg,"\\")),super(t,_o,"\\",{...e,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return _o.parse(t).root.toUpperCase()}newRoot(t){return new bu(this.rootPath,tt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},ko=class extends xu{sep="/";constructor(t=process.cwd(),e={}){let{nocase:r=!1}=e;super(t,Fm,"/",{...e,nocase:r}),this.nocase=r}parseRootPath(t){return"/"}newRoot(t){return new vu(this.rootPath,tt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Cu=class extends ko{constructor(t=process.cwd(),e={}){let{nocase:r=!0}=e;super(t,{...e,nocase:r})}},b0=process.platform==="win32"?bu:vu,gg=process.platform==="win32"?Co:process.platform==="darwin"?Cu:ko,yg=t=>t.length>=1,_g=t=>t.length>=1,bg=Symbol.for("nodejs.util.inspect.custom"),ku=class Eu{#e;#n;#i;length;#o;#s;#d;#f;#h;#a;#m=!0;constructor(e,r,i,n){if(!yg(e))throw new TypeError("empty pattern list");if(!_g(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=r,this.#i=i,this.#o=n,this.#i===0){if(this.isUNC()){let s=this.#c()?6:4,o=this.#e.slice(0,s),a=this.#n.slice(0,s),l=this.#e.slice(s),c=this.#n.slice(s);l[0]===""&&(l.shift(),c.shift());let f=[...o,""].join("/"),h=[...a,""].join("/");this.#e=[f,...l],this.#n=[h,...c],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let c=`${s}/`,f=`${a}/`;this.#e=[c,...o],this.#n=[f,...l],this.length=this.#e.length}}}[bg](){return`Pattern <${this.#n.slice(this.#i).join("/")}>`}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===ie}isMatcher(){return typeof this.#e[this.#i]=="object"}globString(){return this.#d=this.#d||(this.#i===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new Eu(this.#e,this.#n,this.#i+1,this.#o),this.#s.#a=this.#a,this.#s.#h=this.#h,this.#s.#f=this.#f,this.#s):this.#s=null}#c(){let e=this.#e;return e[2]==="?"&&typeof e[3]=="string"&&/^unc$/i.test(e[3])}isUNC(){let e=this.#e,r=this.#c()?4:2;return this.#h!==void 0?this.#h:this.#h=this.#o==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[r]=="string"&&!!e[r]&&typeof e[r+1]=="string"&&!!e[r+1]}isDrive(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}},wg=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$c=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:r,noext:i,noglobstar:n,normalize:s,platform:o=wg,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c,braceExpandMax:f=1e4},h){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,l=!!l||c===!1,this.mmopts={braceExpandMax:f,dot:!0,nobrace:e,nocase:r,noext:i,noglobstar:n,normalize:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let p=h?.resolve(a??"/").fullpath()??"/";this.slashRoot=So(p.replace(/\\/g,"/").replace(/\/$/,""),{magicalBraces:!0,windowsPathsNoEscape:l});for(let m of t)this.add(m)}add(t){let e=new Dt(t,this.mmopts);for(let r=0;r<e.set.length;r++){let i=e.set[r],n=e.globParts[r];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let s=new ku(i,n,0,this.platform),o=s.root()==="/"?`${this.slashRoot}/${s.rest()?.globString()??""}`:s.globString(),a=new Dt(o,this.mmopts),l=n[n.length-1]==="**",c=s.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),r=`${e}/`,i=t.relative()||".",n=`${i}/`;for(let s of this.relative)if(s.match(i)||s.match(n))return!0;for(let s of this.absolute)if(s.match(e)||s.match(r))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,r=`${t.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}},vg=class Au{parent;store;constructor(e){this.parent=e}copy(){return new Au(this)}#e(e){let r=this.store?.get(e);return r||!this.parent?r:this.parent.#e(e)}hasWalked(e,r){return!!this.#e(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),n=this.#e(i);n?n.add(r.globString()):(this.store??=new Map).set(i,new Set([r.globString()]))}},Ou=class bo{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(e,r,i){let n=(r?bo.ABSOLUTE:0)|(i?bo.IF_DIR:0),s=this.store.get(e);this.store.set(e,s===void 0?n:n&s)}},Sg=class{store=new Map;add(t,e){if(!t.canReaddir())return;let r=this.store.get(t);r?r.find(i=>i.globString()===e.globString())||r.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},jc=class Pu{hasWalkedCache;matches=new Ou;subwalks=new Sg;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new vg}processPatterns(e,r){this.patterns=r;let i=r.map(n=>[e,n]);for(let[n,s]of i){this.hasWalkedCache.storeWalked(n,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let l,c,f=!1;for(;typeof(l=s.pattern())=="string"&&(c=s.rest());)n=n.resolve(l),s=c,f=!0;if(l=s.pattern(),c=s.rest(),f){if(this.hasWalkedCache.hasWalked(n,s))continue;this.hasWalkedCache.storeWalked(n,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(n.resolve(l),a,h);continue}else if(l===ie){(!n.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(n,s);let h=c?.pattern(),p=c?.rest();if(!c||(h===""||h===".")&&!p)this.matches.add(n,a,h===""||h===".");else if(h===".."){let m=n.parent||n;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,a,!0)}}else typeof l=="object"&&this.subwalks.add(n,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Pu(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),n=this.child();for(let s of r)for(let o of i){let a=o.isAbsolute(),l=o.pattern(),c=o.rest();l===ie?n.testGlobstar(s,o,c,a):typeof l=="object"?n.testMatcher(s,l,c,a):n.testString(s,l,c,a)}return n}testGlobstar(e,r,i,n){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),n);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else typeof s=="object"&&this.testMatcher(e,s,i.rest(),n)}}testMatcher(e,r,i,n){r.testUnchecked(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,r,i,n){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}},{ABSOLUTE:Ri,IF_DIR:Li}=Ou,xg=(t,e,r)=>typeof t=="string"?new $c([t],e,r):Array.isArray(t)?new $c(t,e,r):t,Tu=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#i;signal;maxDepth;includeChildMatches;constructor(t,e,r){if(this.patterns=t,this.path=e,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=xg(r.ignore??[],r,e),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#o(t){return this.seen.has(t)||!!this.#n?.ignored?.(t)}#s(t){return!!this.#n?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#e.shift());)t()}onResume(t){this.paused?this.#e.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let r,i;if(this.opts.realpath){if(r=t.realpathCached()||await t.realpath(),!r)return;i=r}else i=t;let n=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let s=await n.realpath();s&&(s.isUnknown()||this.opts.stat)&&await s.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let r,i;if(this.opts.realpath){if(r=t.realpathCached()||t.realpathSync(),!r)return;i=r}else i=t;let n=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let s=n.realpathSync();s&&(s?.isUnknown()||this.opts.stat)&&s.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#n?.add){let n=`${t.relativePosix()}/**`;this.#n.add(n)}let r=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(r){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!n.startsWith(`..${this.#i}`)?`.${this.#i}`:"";this.matchEmit(n?s+n+i:`.${i}`)}}async match(t,e,r){let i=await this.matchCheck(t,r);i&&this.matchFinish(i,e)}matchSync(t,e,r){let i=this.matchCheckSync(t,r);i&&this.#d(i,e)}walkCB(t,e,r){if(this.signal?.aborted)return r();this.walkCB2(t,e,new jc(this.opts),r)}walkCB2(t,e,r,i){if(this.#s(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(t,e,r,i));return}r.processPatterns(t,e);let n=1,s=()=>{--n===0&&i()};for(let[o,a]of r.matches.store)this.#o(o)||(n++,this.match(o,!!(a&Ri),!!(a&Li)).then(()=>s()));for(let o of r.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,r,s):o.readdirCB((l,c)=>this.walkCB3(o,c,r,s),!0)}s()}walkCB3(t,e,r,i){let n=r.filterEntries(t,e),s=1,o=()=>{--s===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||(s++,this.match(a,!!(l&Ri),!!(l&Li)).then(()=>o()));for(let[a,l]of n.subwalks.entries())s++,this.walkCB2(a,l,n.child(),o);o()}walkCBSync(t,e,r){if(this.signal?.aborted)return r();this.walkCB2Sync(t,e,new jc(this.opts),r)}walkCB2Sync(t,e,r,i){if(this.#s(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,r,i));return}r.processPatterns(t,e);let n=1,s=()=>{--n===0&&i()};for(let[o,a]of r.matches.store)this.#o(o)||this.matchSync(o,!!(a&Ri),!!(a&Li));for(let o of r.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirSync();this.walkCB3Sync(o,a,r,s)}s()}walkCB3Sync(t,e,r,i){let n=r.filterEntries(t,e),s=1,o=()=>{--s===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||this.matchSync(a,!!(l&Ri),!!(l&Li));for(let[a,l]of n.subwalks.entries())s++,this.walkCB2Sync(a,l,n.child(),o);o()}},Wc=class extends Tu{matches=[];constructor(t,e,r){super(t,e,r)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Vc=class extends Tu{results;constructor(t,e,r){super(t,e,r),this.results=new Hi({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},Cg=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",It=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=Tm(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let r=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(r=r.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");r=r.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=r,this.platform=e.platform||Cg,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?Co:e.platform==="darwin"?Cu:e.platform?ko:gg;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},s=this.pattern.map(l=>new Dt(l,n)),[o,a]=s.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=o.map((l,c)=>{let f=a[c];if(!f)throw new Error("invalid pattern object");return new ku(l,f,0,this.platform)})}async walk(){return await new Wc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new Wc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new Vc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Vc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},kg=(t,e={})=>{for(let r of Array.isArray(t)?t:[t])if(new Dt(r,e).hasMagic())return!0;return!1};function ji(t,e={}){return new It(t,e).streamSync()}function Du(t,e={}){return new It(t,e).stream()}function Iu(t,e={}){return new It(t,e).walkSync()}async function zc(t,e={}){return new It(t,e).walk()}function Wi(t,e={}){return new It(t,e).iterateSync()}function Ru(t,e={}){return new It(t,e).iterate()}var Eg=ji,Ag=Object.assign(Du,{sync:ji}),Og=Wi,Pg=Object.assign(Ru,{sync:Wi}),Tg=Object.assign(Iu,{stream:ji,iterate:Wi}),Yt=Object.assign(zc,{glob:zc,globSync:Iu,sync:Tg,globStream:Du,stream:Ag,globStreamSync:ji,streamSync:Eg,globIterate:Ru,iterate:Pg,globIterateSync:Wi,iterateSync:Og,Glob:It,hasMagic:kg,escape:So,unescape:nu});Yt.glob=Yt;var Vi=class{type="glob";data=null;pattern;constructor(e){if(!e.pattern)throw new Error('Glob datasource requires "pattern" configuration');this.pattern=e.pattern}async loadData(){if(this.data!==null)return this.data;let e=await Yt(this.pattern,{nodir:!0}),r=[];for(let i of e)try{let n=await Dg(i),s=Rg(i);r.push({path:i,name:Lu(i),basename:Lu(i,s),ext:s.slice(1),dir:Ig(i),size:n.size,mtime:n.mtime.toISOString()})}catch{continue}return this.data=r,this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Eo(t){return new Vi(t)}import{dirname as Oo,relative as zi,resolve as Nu,sep as Gi}from"node:path";var Mu=">=5.0.0 <7.0.0",Ui={namespace:{label:"Namespace",dir:"namespaces"},enum:{label:"Enumeration",dir:"enumerations"},class:{label:"Class",dir:"classes"},interface:{label:"Interface",dir:"interfaces"},type:{label:"Type Alias",dir:"type-aliases"},variable:{label:"Variable",dir:"variables"},function:{label:"Function",dir:"functions"},reference:{label:"Reference",dir:"references"}},Lg=new Set(["hidden","ignore"]),Ng={summary:"",tags:[],parameters:new Map,typeParameters:new Map,returns:""};function Fu(t){for(;t.length>0&&t[0].trim()==="";)t.shift();for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return t.join(`
|
|
863
|
-
`)}function Mg(t){let e=[],r=0;for(let i=0;i<t.length;i++){if(t[i]==="`"){let n=1;for(;t[i+n]==="`";)n++;r===0?r=n:n===r&&(r=0),i+=n-1;continue}r===0&&t[i]==="@"&&(i===0||/\s/.test(t[i-1]))&&/[A-Za-z]/.test(t[i+1]??"")&&e.push(i)}return e}function Fg(t){let r=t.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(/\r?\n/).map((o,a)=>a===0?o.trim():o.replace(/^\s*\*(?: |(?=\S)|$)/,"").replace(/\s+$/,"")),i=[{tag:null,lines:[]}],n=null;for(let o of r){let a=/^\s*(```+|~~~+)/.exec(o);if(a){let f=a[1];n===null?n=f[0].repeat(f.length):f.startsWith(n)&&(n=null)}let l=n===null&&!a?Mg(o):[];if(l.length===0){i[i.length-1].lines.push(o);continue}let c=o.slice(0,l[0]).replace(/\s+$/,"");c!==""&&i[i.length-1].lines.push(c),l.forEach((f,h)=>{let p=o.slice(f,l[h+1]??o.length).replace(/\s+$/,""),m=/^@([A-Za-z][\w-]*)\s*([\s\S]*)$/.exec(p);i.push({tag:m[1],lines:[m[2]]})})}let s={summary:Fu(i[0].lines),tags:[],parameters:new Map,typeParameters:new Map,returns:""};for(let o of i.slice(1)){let a=o.tag,l=Fu(o.lines);if(a==="param"||a==="template"||a==="typeParam"){let c=/^(?:\{[^}]*\}\s*)?\[?([\w$.]+)(?:=[^\]]*)?\]?\s*(?:-\s*)?([\s\S]*)$/.exec(l);if(c){let f=a==="param"?s.parameters:s.typeParameters;!c[1].includes(".")&&!f.has(c[1])&&f.set(c[1],c[2].trim())}}else a==="returns"||a==="return"?s.returns=l.replace(/^\{[^}]*\}\s*/,""):s.tags.push({tag:a,text:l})}return s}async function Bg(){let t;try{t=await import("typescript")}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`The "typescript" datasource needs the "typescript" package (${Mu}). Install it in your project (npm install -D typescript). Cause: ${i}`,{cause:r})}let e=t.default??t;if(typeof e.createProgram!="function")throw new Error(`The "typescript" datasource needs the TypeScript compiler API (${Mu}); the installed "typescript" package does not provide it.`);return e}function Nr(t){return t.split(Gi).join("/")}function qg(t){let e=t.map(n=>Oo(n).split(Gi)),r=e[0]??[],i=r.length;for(let n of e){let s=0;for(;s<i&&s<n.length&&n[s]===r[s];)s++;i=s}return r.slice(0,i).join(Gi)||Gi}var To=/\{@link(?:code|plain)?\s+([^}|\s]+)(?:\s*\|\s*|\s+)?([^}]*)\}/g;function Hg(t){let e=new Map(t.map(r=>[r.name,r]));for(let r of t){let i=[],n=(l,c)=>{i.push(l,...c.map(f=>f.text))},s=l=>{n(l.summary,l.tags),i.push(...l.parameters.map(c=>c.description)),l.returns&&i.push(l.returns.description)};n(r.summary,r.tags),r.signatures.forEach(s);for(let l of r.members)n(l.summary,l.tags),l.signatures.forEach(s);let o=new Map,a=r.referenceOf?[r.referenceOf]:[];for(let l of i)for(let c of l.matchAll(To))a.push(c[1]);for(let l of a){if(o.has(l))continue;let[c,...f]=l.split(/[.#]/),h=e.get(c??"");h&&o.set(l,{target:l,name:h.name,kind:h.kind,kindDir:h.kindDir,member:f.length>0?f.join("."):null})}r.links=[...o.values()]}}function $g(t,e){return t<e?-1:t>e?1:0}function Ao(t,e){let r=t.toLowerCase(),i=e.toLowerCase();return r!==i?r<i?-1:1:t<e?-1:t>e?1:0}var Po=class{constructor(e,r,i,n){this.ts=e;this.program=r;this.checker=i;this.options=n;this.typeFlags=e.TypeFormatFlags.NoTruncation|e.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope}ts;program;checker;options;typeFlags;extract(e){let{ts:r,checker:i}=this,n=new Map;for(let a of e){let l=this.program.getSourceFile(a);if(!l)throw new Error(`TypeScript entry point not found in the program: ${a}`);let c=i.getSymbolAtLocation(l);if(c)for(let f of i.getExportsOfModule(c)){let h=f.flags&r.SymbolFlags.Alias?i.getAliasedSymbol(f):f,p=n.get(h)??[];p.some(m=>m.name===f.name)||p.push(f),n.set(h,p)}}let s=[];for(let[a,l]of n){let c=l.find(h=>h.name===a.name)??l[0],f=this.buildSymbol(c.name,a);if(f){s.push(f);for(let h of l){if(h===c)continue;let p=this.buildReference(h,f.symbol);p&&s.push(p)}}}s.sort((a,l)=>{if(this.options.sort==="source-order"){let c=$g(a.position[0],l.position[0]);if(c!==0)return c;if(a.position[1]!==l.position[1])return a.position[1]-l.position[1]}return Ao(a.symbol.name,l.symbol.name)});let o=s.map(a=>a.symbol);return Hg(o),o}buildReference(e,r){let i=e.declarations?.[0];if(!i)return null;let n=this.docOf(i);if(this.isHidden(n.tags))return null;let s=i.getSourceFile();return{symbol:{name:e.name,kind:"reference",kindLabel:Ui.reference.label,kindDir:Ui.reference.dir,category:null,summary:n.summary,tags:n.tags,code:null,typeParameters:[],extends:[],implements:[],signatures:[],members:[],source:this.sourceOf(i),referenceOf:r.name,links:[]},position:[Nr(zi(this.options.baseDir,s.fileName)),this.nameNode(i).getStart()]}}buildSymbol(e,r){let{ts:i}=this,n=(r.declarations??[]).filter(h=>!this.isExcludedFile(h)),s=this.primaryDeclaration(n);if(!s)return null;let o=this.kindOf(s);if(!o)return null;let a=this.docOf(s);if(this.isHidden(a.tags))return null;let l=a.tags.find(h=>h.tag==="category"),c={name:e,kind:o,kindLabel:Ui[o].label,kindDir:Ui[o].dir,category:l&&l.text.trim()||null,summary:a.summary,tags:a.tags,code:null,typeParameters:[],extends:[],implements:[],signatures:[],members:[],source:this.sourceOf(s),referenceOf:null,links:[]};if(i.isClassDeclaration(s))c.typeParameters=this.typeParameters(s.typeParameters,a),this.heritage(s,c),c.members=this.members(s.members,e);else if(i.isInterfaceDeclaration(s)){c.typeParameters=this.typeParameters(s.typeParameters,a);let h=n.filter(i.isInterfaceDeclaration);for(let p of h)this.heritage(p,c);c.members=h.flatMap(p=>this.members(p.members,e))}else if(i.isEnumDeclaration(s))c.members=n.filter(i.isEnumDeclaration).flatMap(h=>h.members.map(p=>this.enumMember(p))).filter(h=>h!==null);else if(i.isTypeAliasDeclaration(s)){c.typeParameters=this.typeParameters(s.typeParameters,a);let h=this.typeParameterList(s.typeParameters);c.code=`type ${e}${h} = ${s.type.getText()};`,i.isTypeLiteralNode(s.type)&&(c.members=this.members(s.type.members,e))}else if(o==="function")c.signatures=this.functionSignatures(e,r,s);else if(i.isVariableDeclaration(s)){let h=(i.getCombinedNodeFlags(s)&i.NodeFlags.Const)!==0,p=s.type?s.type.getText():this.checker.typeToString(this.checker.getTypeAtLocation(s.name),void 0,this.typeFlags);c.code=`${h?"const":"let"} ${e}: ${p};`,c.members=this.variableMembers(s)}let f=s.getSourceFile();return{symbol:c,position:[Nr(zi(this.options.baseDir,f.fileName)),this.nameNode(s).getStart()]}}isExcludedFile(e){if(!this.options.excludeExternals)return!1;let r=e.getSourceFile();return this.program.isSourceFileFromExternalLibrary(r)||this.program.isSourceFileDefaultLibrary(r)||Nr(r.fileName).includes("/node_modules/")}primaryDeclaration(e){let{ts:r}=this,i=[r.isClassDeclaration,r.isInterfaceDeclaration,r.isEnumDeclaration,r.isTypeAliasDeclaration,r.isFunctionDeclaration,r.isVariableDeclaration,r.isModuleDeclaration];for(let n of i){let s=e.find(n);if(s)return s}}kindOf(e){let{ts:r}=this;if(r.isClassDeclaration(e))return"class";if(r.isInterfaceDeclaration(e))return"interface";if(r.isEnumDeclaration(e))return"enum";if(r.isTypeAliasDeclaration(e))return"type";if(r.isFunctionDeclaration(e))return"function";if(r.isModuleDeclaration(e))return"namespace";if(r.isVariableDeclaration(e)){let i=e.initializer;return i!==void 0&&(r.isArrowFunction(i)||r.isFunctionExpression(i))&&!e.type?"function":"variable"}return null}nameNode(e){return e.name??e}sourceOf(e){let r=e.getSourceFile(),i=r.getLineAndCharacterOfPosition(this.nameNode(e).getStart()).line+1,n=Nr(zi(this.options.baseDir,r.fileName)),s=Nr(zi(this.options.displayDir,r.fileName)),o=null,a=this.options.sourceLinkTemplate;return a&&(o=a.replace(/\{gitRevision\}/g,this.options.gitRevision??"").replace(/\{path\}/g,n).replace(/\{line\}/g,String(i))),{file:s,path:n,line:i,url:o}}docOf(e){let{ts:r}=this,i=r.getJSDocCommentsAndTags(e).filter(r.isJSDoc),n=i[i.length-1];return n?Fg(n.getSourceFile().text.slice(n.pos,n.end)):Ng}isHidden(e){return e.some(r=>Lg.has(r.tag)||this.options.excludeInternal&&r.tag==="internal")}typeText(e,r){return e?e.getText():this.checker.typeToString(r(),void 0,this.typeFlags)}typeParameterList(e){return!e||e.length===0?"":`<${e.map(r=>r.getText()).join(", ")}>`}typeParameters(e,r){return e?e.map(i=>({name:i.name.text,constraint:i.constraint?i.constraint.getText():null,default:i.default?i.default.getText():null,description:r.typeParameters.get(i.name.text)??""})):[]}heritage(e,r){let{ts:i}=this;for(let n of e.heritageClauses??[]){let s=n.types.map(o=>o.getText());n.token===i.SyntaxKind.ExtendsKeyword?r.extends.push(...s):r.implements.push(...s)}}parameters(e,r){let{ts:i}=this;return e.filter(n=>!(i.isIdentifier(n.name)&&n.name.text==="this")).map(n=>({name:n.name.getText(),type:this.typeText(n.type,()=>this.checker.getTypeAtLocation(n)),optional:n.questionToken!==void 0||n.initializer!==void 0,rest:n.dotDotDotToken!==void 0,defaultValue:n.initializer?n.initializer.getText():null,description:i.isIdentifier(n.name)?r.parameters.get(n.name.text)??"":""}))}parameterCode(e){return e.map(r=>`${r.rest?"...":""}${r.name}${r.optional&&!r.rest?"?":""}: ${r.type}`).join(", ")}returnsOf(e,r,i){return{type:e.type?e.type.getText():r?this.checker.typeToString(this.checker.getReturnTypeOfSignature(r),void 0,this.typeFlags):"void",description:i.returns}}signature(e,r,i,n="",s=e){let o=this.docOf(s),a=this.parameters(e.parameters,o),l=this.typeParameters(e.typeParameters,o),c=this.checker.getSignatureFromDeclaration(e),f=null,h="";i==="construct"?h=`: ${n}`:i!=="set"&&(f=this.returnsOf(e,c,o),h=`: ${f.type}`);let p=this.typeParameterList(e.typeParameters);return{code:`${r}${p}(${this.parameterCode(a)})${h};`,summary:o.summary,tags:o.tags,typeParameters:l,parameters:a,returns:f,source:this.sourceOf(s)}}publicOverloads(e){let r=e.filter(i=>!("body"in i)||i.body===void 0);return r.length>0?r:e}functionSignatures(e,r,i){let{ts:n}=this;if(n.isVariableDeclaration(i)){let o=i.initializer;return o&&(n.isArrowFunction(o)||n.isFunctionExpression(o))?[this.signature(o,`function ${e}`,"call","",i)]:[]}let s=(r.declarations??[]).filter(n.isFunctionDeclaration);return this.publicOverloads(s).map(o=>this.signature(o,`function ${e}`,"call"))}modifiers(e){let{ts:r}=this,i=r.canHaveModifiers(e)?r.getModifiers(e)??[]:[];return new Set(i.map(n=>n.kind))}isPrivate(e,r){let i=e.name;return r.has(this.ts.SyntaxKind.PrivateKeyword)||i!==void 0&&this.ts.isPrivateIdentifier(i)}members(e,r){let{ts:i}=this,n=new Map,s=[];for(let a of e){if(i.isClassStaticBlockDeclaration(a)||i.isSemicolonClassElement(a))continue;let l=this.modifiers(a);if(this.options.excludePrivate&&this.isPrivate(a,l))continue;let c;if(i.isConstructorDeclaration(a)||i.isConstructSignatureDeclaration(a))c="constructor";else if(i.isCallSignatureDeclaration(a))c="()";else if(i.isIndexSignatureDeclaration(a))c=`[${a.parameters.map(f=>f.getText()).join(", ")}]`;else{let f=a.name?a.name.getText():"";c=`${l.has(i.SyntaxKind.StaticKeyword)?"static ":""}${f}`}n.has(c)||(n.set(c,[]),s.push(c)),n.get(c).push(a)}let o=[];for(let a of s){let l=this.member(n.get(a),r);l&&o.push(l),a==="constructor"&&o.push(...this.parameterProperties(n.get(a)))}return this.options.sort==="alphabetical"&&o.sort((a,l)=>Ao(a.name,l.name)),o}member(e,r){let{ts:i}=this,n=e[0],s=this.docOf(n);if(this.isHidden(s.tags))return null;let o=this.modifiers(n),a=o.has(i.SyntaxKind.StaticKeyword),l=o.has(i.SyntaxKind.AbstractKeyword),c=`${a?"static ":""}${l?"abstract ":""}`,f={static:a,readonly:o.has(i.SyntaxKind.ReadonlyKeyword),optional:n.questionToken!==void 0,protected:o.has(i.SyntaxKind.ProtectedKeyword),abstract:l,summary:s.summary,tags:s.tags,source:this.sourceOf(n)};if(i.isConstructorDeclaration(n)||i.isConstructSignatureDeclaration(n)){let p=this.publicOverloads(e),m=`${r}${this.ownerTypeArguments(n)}`;return{...f,name:"constructor",kind:"constructor",type:null,signatures:p.map(g=>this.signature(g,`new ${r}`,"construct",m))}}if(i.isCallSignatureDeclaration(n))return{...f,name:"()",kind:"call-signature",type:null,signatures:e.map(p=>this.signature(p,"","call"))};if(i.isIndexSignatureDeclaration(n)){let p=n.parameters.map(m=>m.getText()).join(", ");return{...f,name:`[${p}]`,kind:"index-signature",type:this.typeText(n.type,()=>this.checker.getTypeAtLocation(n)),signatures:[]}}let h=n.name?n.name.getText():"";if(i.isMethodDeclaration(n)||i.isMethodSignature(n)){let p=this.publicOverloads(e);return{...f,name:h,kind:"method",type:null,signatures:p.map(m=>this.signature(m,`${c}${h}`,"call"))}}if(i.isGetAccessorDeclaration(n)||i.isSetAccessorDeclaration(n)){let p=e.filter(i.isGetAccessorDeclaration),m=e.filter(i.isSetAccessorDeclaration);return{...f,name:h,kind:"accessor",type:null,signatures:[...p.map(g=>this.signature(g,`${c}get ${h}`,"get")),...m.map(g=>this.signature(g,`${c}set ${h}`,"set"))]}}return i.isPropertyDeclaration(n)||i.isPropertySignature(n)?{...f,name:h,kind:"property",type:this.typeText(n.type,()=>this.checker.getTypeAtLocation(n.name)),signatures:[]}:null}variableMembers(e){let{ts:r,checker:i}=this,n=i.getTypeAtLocation(e.name),s=n.isIntersection()?n.types:[n],o=[];for(let a of s){let l=a.getSymbol();if(!(!l||!(l.flags&(r.SymbolFlags.ObjectLiteral|r.SymbolFlags.TypeLiteral))))for(let c of i.getPropertiesOfType(a)){let f=c.valueDeclaration??c.declarations?.[0];if(!f)continue;let h=this.docOf(f);this.isHidden(h.tags)||o.push({name:c.name,kind:"property",static:!1,readonly:!1,optional:(c.flags&r.SymbolFlags.Optional)!==0,protected:!1,abstract:!1,type:i.typeToString(i.getTypeOfSymbolAtLocation(c,e),void 0,this.typeFlags),summary:h.summary,tags:h.tags,signatures:[],source:this.sourceOf(f)})}}return this.options.sort==="alphabetical"&&o.sort((a,l)=>Ao(a.name,l.name)),o}parameterProperties(e){let{ts:r}=this,i=[];for(let n of e){if(!r.isConstructorDeclaration(n))continue;let s=this.docOf(n);for(let o of n.parameters){if(!r.isParameterPropertyDeclaration(o,n)||!r.isIdentifier(o.name))continue;let a=this.modifiers(o);this.options.excludePrivate&&a.has(r.SyntaxKind.PrivateKeyword)||i.push({name:o.name.text,kind:"property",static:!1,readonly:a.has(r.SyntaxKind.ReadonlyKeyword),optional:o.questionToken!==void 0||o.initializer!==void 0,protected:a.has(r.SyntaxKind.ProtectedKeyword),abstract:!1,type:this.typeText(o.type,()=>this.checker.getTypeAtLocation(o)),summary:s.parameters.get(o.name.text)??"",tags:[],signatures:[],source:this.sourceOf(o)})}}return i}ownerTypeArguments(e){let r=e.parent;return this.ts.isClassDeclaration(r)&&r.typeParameters&&r.typeParameters.length>0?`<${r.typeParameters.map(i=>i.name.text).join(", ")}>`:""}enumMember(e){let r=this.docOf(e);if(this.isHidden(r.tags))return null;let i=this.checker.getConstantValue(e);return{name:e.name.getText(),kind:"enum-member",static:!1,readonly:!0,optional:!1,protected:!1,abstract:!1,type:i===void 0?e.initializer?.getText()??null:JSON.stringify(i),summary:r.summary,tags:r.tags,signatures:[],source:this.sourceOf(e)}}},Yi=class{type="typescript";data=null;config;constructor(e){let r=e.entry_points;if(!Array.isArray(r)||r.length===0||!r.every(s=>typeof s=="string"))throw new Error('TypeScript datasource requires "entry_points" (a list of file paths)');let i=e.source_link_template;if(i!==void 0&&typeof i!="string")throw new Error('TypeScript datasource "source_link_template" must be a string');if(typeof i=="string"&&i.includes("{gitRevision}")&&typeof e.git_revision!="string")throw new Error('TypeScript datasource "source_link_template" uses {gitRevision}; set "git_revision" (e.g. main)');let n=e.sort;if(n!==void 0&&n!=="source-order"&&n!=="alphabetical")throw new Error('TypeScript datasource "sort" must be "source-order" or "alphabetical"');for(let s of["exclude_internal","exclude_private","exclude_externals"])if(e[s]!==void 0&&typeof e[s]!="boolean")throw new Error(`TypeScript datasource "${s}" must be true or false`);this.config=e}async loadData(){if(this.data!==null)return this.data;let e=await Bg(),r=process.cwd(),i=this.config.entry_points.map(l=>Nu(r,l)),n=this.config.tsconfig?Nu(r,this.config.tsconfig):e.findConfigFile(Oo(i[0]),e.sys.fileExists),s={};if(n){let l=e.readConfigFile(n,e.sys.readFile);if(l.error)throw new Error(`Cannot read ${n}: ${e.flattenDiagnosticMessageText(l.error.messageText,`
|
|
864
|
-
`)}`);s=e.parseJsonConfigFileContent(l.config,e.sys,
|
|
861
|
+
`,s),Buffer.from("\r",s)];e:for(let a=0;a<o.length;a++){let l=o[a].length;for(let c=0;c<l;c++)if(o[a][c]!==n[i+c])continue e;return this.options.record_delimiter.push(o[a]),this.state.recordDelimiterMaxLength=o[a].length,o[a].length}return 0},__error:function(n){let{encoding:i,raw:s,skip_records_with_error:o}=this.options,a=typeof n=="string"?new Error(n):n;if(o){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(a,s?this.state.rawBuffer.toString(i):void 0)}catch(l){return l}return}else return a},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:n,raw:i,encoding:s}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:n===!0,index:this.state.record.length,raw:i?this.state.rawBuffer.toString(s):void 0}},__infoField:function(){let{columns:n}=this.options,i=Array.isArray(n),s=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:s,column:i===!0?n.length>this.state.record.length?n[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var bc=function(t,e={}){typeof t=="string"&&(t=Buffer.from(t));let r=e&&e.objname?Object.create(null):[],n=wn(e),i=a=>{n.options.objname===void 0?r.push(a):r[a[0]]=a[1]},s=()=>{},o=n.parse(t,!0,i,s);if(o!==void 0)throw o;return r};function Xe(t,e,r){let n=e.match(/WHERE\s+(\w+)\s*=\s*\?/i);if(n&&r.length>0){let i=n[1]??"",s=String(r[0]);return t.filter(o=>String(o[i])===s)}return t}var vn=class{type="csv";data=null;filePath;encoding;constructor(e){if(!e.path)throw new Error('CSV datasource requires "path" configuration');this.filePath=e.path,this.encoding=e.encoding??"utf-8"}async loadData(){if(this.data!==null)return this.data;let e=await Lp(this.filePath,{encoding:this.encoding}),r=bc(e,{columns:!0,skip_empty_lines:!0,trim:!0});return this.data=r,this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Us(t){return new vn(t)}import{readFile as Np}from"node:fs/promises";var Sn=class{type="json";data=null;filePath;constructor(e){if(!e.path)throw new Error('JSON datasource requires "path" configuration');this.filePath=e.path}async loadData(){if(this.data!==null)return this.data;let e=await Np(this.filePath,{encoding:"utf-8"}),r=JSON.parse(e);if(Array.isArray(r))this.data=r;else if(typeof r=="object"&&r!==null)this.data=[r];else throw new Error("JSON file must contain an array or object");return this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Gs(t){return new Sn(t)}import{readFile as Mp}from"node:fs/promises";var xn=class{type="yaml";data=null;filePath;constructor(e){if(!e.path)throw new Error('YAML datasource requires "path" configuration');this.filePath=e.path}async loadData(){if(this.data!==null)return this.data;let e=await Mp(this.filePath,{encoding:"utf-8"}),r=Ze.load(e);if(Array.isArray(r))this.data=r;else if(typeof r=="object"&&r!==null)this.data=[r];else throw new Error("YAML file must contain an array or object");return this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Ys(t){return new xn(t)}import{stat as Ng}from"node:fs/promises";import{basename as Nu,dirname as Mg,extname as Fg}from"node:path";import{fileURLToPath as Lm}from"node:url";import{tracingChannel as Nm,channel as Mm}from"node:diagnostics_channel";import{posix as $m,win32 as bo}from"node:path";import{fileURLToPath as jm}from"node:url";import{lstatSync as Wm,readdir as Vm,readdirSync as zm,readlinkSync as Um,realpathSync as Gm}from"fs";import*as Ym from"node:fs";import{lstat as Km,readdir as Jm,readlink as Qm,realpath as Zm}from"node:fs/promises";import{EventEmitter as Co}from"node:events";import hu from"node:stream";import{StringDecoder as Xm}from"node:string_decoder";var Gc=(t,e,r)=>{let n=t instanceof RegExp?wc(t,r):t,i=e instanceof RegExp?wc(e,r):e,s=n!==null&&i!=null&&Fp(n,i,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+i.length)}},wc=(t,e)=>{let r=e.match(t);return r?r[0]:null},Fp=(t,e,r)=>{let n,i,s,o,a,l=r.indexOf(t),c=r.indexOf(e,l+1),f=l;if(l>=0&&c>0){if(t===e)return[l,c];for(n=[],s=r.length;f>=0&&!a;){if(f===l)n.push(f),l=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(a=[h,c])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=c),c=r.indexOf(e,f+1);f=l<c&&l>=0?l:c}n.length&&o!==void 0&&(a=[s,o])}return a},Yc="\0SLASH"+Math.random()+"\0",Kc="\0OPEN"+Math.random()+"\0",vo="\0CLOSE"+Math.random()+"\0",Jc="\0COMMA"+Math.random()+"\0",Qc="\0PERIOD"+Math.random()+"\0",Bp=new RegExp(Yc,"g"),qp=new RegExp(Kc,"g"),Hp=new RegExp(vo,"g"),$p=new RegExp(Jc,"g"),jp=new RegExp(Qc,"g"),Wp=/\\\\/g,Vp=/\\{/g,zp=/\\}/g,Up=/\\,/g,Gp=/\\\./g,Yp=1e5,Kp=4e6,Jp=1e3,Qp=1e3;function Ks(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Zp(t){return t.replace(Wp,Yc).replace(Vp,Kc).replace(zp,vo).replace(Up,Jc).replace(Gp,Qc)}function Xp(t){return t.replace(Bp,"\\").replace(qp,"{").replace(Hp,"}").replace($p,",").replace(jp,".")}function Js(t,e){for(let r=0;r<e.length;r++)t.push(e[r])}function em(t){let e=[],r="";for(;;){let n=Gc("{","}",t);if(!n){let l=t.split(",");return l[0]=r+l[0],Js(e,l),e}let{pre:i,body:s,post:o}=n,a=i.split(",");if(a[0]=r+a[0],a[a.length-1]+="{"+s+"}",!o.length)return Js(e,a),e;r=a.pop(),Js(e,a),t=o}}function tm(t,e={}){if(!t)return[];let{max:r=Yp,maxLength:n=Kp,maxDepth:i=Jp,maxRewrites:s=Qp}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),ho(Zp(t),r,n,i,0,s,!0).map(Xp)}function rm(t){return"{"+t+"}"}function nm(t){return/^-?0\d/.test(t)}function im(t,e){return t<=e}function sm(t,e){return t>=e}function vr(t,e,r,n,i,s){let o=[],a=0;for(let l=0;l<t.length;l++)for(let c=0;c<r.length;c++){if(o.length>=n)return o;let f=t[l]+e+r[c];if(!(s&&!f)){if(a+f.length>i)return o;o.push(f),a+=f.length}}return o}function om(t,e,r,n){let i=t.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=Ks(i[0]),a=Ks(i[1]),l=Math.max(i[0].length,i[1].length),c=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Ks(i[2])),1):1,f=im;a<o&&(c*=-1,f=sm);let h=i.some(nm),p=0;for(let m=o;f(m,a)&&s.length<r;m+=c){let g;if(e)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),h){let _=l-g.length;if(_>0){let O=new Array(_+1).join("0");m<0?g="-"+O+g.slice(1):g=O+g}}if(p+g.length>n)break;s.push(g),p+=g.length}return s}function ho(t,e,r,n,i,s,o){if(i>n)return[t];let a=[""],l=0,c=!1,f=!0;for(;;){let h=Gc("{","}",t);if(!h)return vr(a,t,[""],e,r,c);let p=h.pre;if(/\$$/.test(p)){if(a=vr(a,p+"{"+h.body+"}",[""],e,r,c&&!h.post.length),f=!1,!h.post.length)break;t=h.post;continue}let m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),_=m||g,O=h.body.indexOf(",")>=0;if(!_&&!O){if(l<s&&h.post.match(/,(?!,).*\}/)){l++,t=h.pre+"{"+h.body+vo+h.post,o=!0;continue}return vr(a,p+"{"+h.body+"}"+h.post,[""],e,r,c)}f&&(c=o&&!_,f=!1);let b;if(_)b=om(h.body,g,e,r);else{let x=em(h.body);if(x.length===1&&x[0]!==void 0&&(x=ho(x[0],e,r,n,i+1,s,!1).map(rm),x.length===1)){if(a=vr(a,p+x[0],[""],e,r,c&&!h.post.length),!h.post.length)break;t=h.post;continue}let I=c&&!h.post.length&&!p;for(let N=0;I&&N<a.length;N++)a[N]&&(I=!1);b=[];let L=0;e:for(let N=0;N<x.length;N++){let V=ho(x[N],e,r,n,i+1,s,!1);for(let B=0;B<V.length;B++){let Q=V[B];if(!(I&&!Q)){if(b.length>=e||L+Q.length>r)break e;b.push(Q),L+=Q.length}}}}if(a=vr(a,p,b,e,r,c&&!h.post.length),!h.post.length)break;t=h.post}return a}var fo=(t,e)=>t===e?{t:"lit",ch:String(t)}:{t:"class",re:new RegExp(`^[${t}-${e}]$`)},Qs=(t,e)=>e.map(r=>[fo(t,t),...r]),Lr=(t,e)=>{if(!t)return[[]];let r=+t[0],n=+e[0],i=t.slice(1),s=e.slice(1);if(r===n)return Qs(r,Lr(i,s));let o="0".repeat(i.length),a="9".repeat(i.length),l=[];i!==o&&l.push(...Qs(r++,Lr(i,a)));let c=s===a?[]:Qs(n--,Lr(o,s));return r<=n&&l.push([fo(r,n),...Array.from(i,()=>fo(0,9))]),l.push(...c),l},vc=(t,e,r)=>{if(r)return Lr(String(t).padStart(r,"0"),String(e).padStart(r,"0"));let n=[];for(let i=String(t).length;i<=String(e).length;i++){let s=Math.max(t,i===1?0:10**(i-1)),o=Math.min(e,10**i-1);n.push(...Lr(String(s),String(o)))}return n},am=(t,e)=>{let r=Number(t),n=Number(e);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(n))return;r>n&&([r,n]=[n,r]);let i=/^-?0\d/.test(t)||/^-?0\d/.test(e)?Math.max(t.length,e.length):0,s=[];if(r<0){let o=vc(Math.max(-n,1),-r,i&&i-1);s.push(...o.map(a=>[{t:"lit",ch:"-"},...a]))}return n>=0&&s.push(...vc(Math.max(r,0),n,i)),s},lm={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},Sr=t=>t.replace(/[[\]\\-]/g,"\\$&"),Zs=/$./,cm=(t,e,r=!1,n)=>{let i=b=>{let x=n?b.normalize(n):b;return[...x].length===1?x:b},s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let o=[],a=[],l=s+1,c=!1,f=!1,h=!1,p=s,m="";e:for(;l<t.length;){let b=String.fromCodePoint(t.codePointAt(l));if((b==="!"||b==="^")&&l===s+1){h=!0,l++;continue}if(b==="]"&&c&&!f){p=l+1;break}if(c=!0,b==="\\"&&!f){f=!0,l++;continue}if(b==="["&&!f){for(let[I,[L,N]]of Object.entries(lm))if(t.startsWith(I,l)){if(m)return[Zs,t.length-s];l+=I.length,N?a.push(L):o.push(L);continue e}}f=!1;let x=i(b);if(m){x.codePointAt(0)>m.codePointAt(0)?o.push(Sr(m)+"-"+Sr(x)):x===m&&o.push(Sr(x)),m="",l+=b.length;continue}if(t.startsWith("-]",l+b.length)){o.push(Sr(x+"-")),l+=b.length+1;continue}if(t.startsWith("-",l+b.length)){m=x,l+=b.length+1;continue}o.push(Sr(x)),l+=b.length}if(p<l)return[Zs,0];if(!o.length&&!a.length)return[Zs,t.length-s];let g="["+(h?"^":"")+o.join("")+"]",_="["+(h?"":"^")+a.join("")+"]",O="^"+(o.length&&a.length?"("+g+"|"+_+")":o.length?g:_);return[new RegExp(O,r?"iu":"u"),p-s]},po={t:"match",id:0},um="!?+*@",Tt=t=>({t:"lit",ch:t}),hm=t=>t.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),Zc=t=>new RegExp(`^${hm(t)}$`,"iu"),Cn=new Map,Xc=t=>{let e=Cn.get(t);return e||(e=Zc(t),Cn.size>=1e3&&Cn.clear(),Cn.set(t,e)),e},So=(t,e)=>{if(e===t.ch)return!0;if(!t.re)return!1;let r=e.charCodeAt(0);if(r>=128)return t.re.test(e);let n=t.ascii??=new Uint8Array(128);return n[r]||=t.re.test(e)?1:2,n[r]===1},fm=(t,e,r,n,i)=>{let s=[];for(let o=0;o<t.length;){let a=String.fromCodePoint(t.codePointAt(o));if(i){let l=a==="\\"&&t.startsWith(i,o+1)?1:0;if(l||a===i){let c=o+l+i.length,f=t.indexOf(i,c),h=/^(-?\d+)\.\.(-?\d+)$/.exec(t.slice(c,f)),p=f!==-1&&h&&am(h[1],h[2]);if(p){s.push({t:"ext",type:"@",alts:p}),o=f+i.length;continue}}}if(a==="\\"){let l=t.codePointAt(o+1),c=l===void 0?a:String.fromCodePoint(l);s.push(Tt(c)),o+=1+c.length;continue}if(a==="["){let[l,c]=cm(t,o,e,n);if(c){s.push({t:"class",re:l}),o+=c;continue}}if(!r&&um.includes(a)&&t[o+1]==="("){s.push({t:"open",type:a}),o+=2;continue}s.push(!r&&a==="|"?{t:"bar"}:!r&&a===")"?{t:"close"}:a==="*"?{t:"star"}:a==="?"?{t:"any"}:Tt(a)),o+=a.length}return s},dm=t=>{let e=new Map,r=[];return t.forEach((n,i)=>{n.t==="open"?r.push(i):n.t==="close"&&r.length&&e.set(r.pop(),i)}),e},eu=(t,e,r,n,i)=>{let s=[],o=[s];for(let a=r;a<n;a++){let l=t[a],c=e.get(a);if(l.t==="open"&&c!==void 0){let f=eu(t,e,a+1,c,!1);s.push({t:"ext",type:l.type,alts:f}),a=c}else l.t==="bar"&&!i?o.push(s=[]):l.t==="open"?s.push(Tt(l.type),Tt("(")):l.t==="bar"?s.push(Tt("|")):l.t==="close"?s.push(Tt(")")):s.push(l)}return o},tu=(t,e)=>{let r=[],n="",i=()=>{for(let s of n.normalize(e))r.push(Tt(s));n=""};for(let s of t){if(s.t==="lit"){n+=s.ch;continue}i(),r.push(s.t==="ext"?{...s,alts:s.alts.map(o=>tu(o,e))}:s)}return i(),r},pm=(t,e)=>{let r=1,n=o=>({t:"split",id:r++,out:o}),i=(o,a)=>o.reduceRight((l,c)=>s(c,l),a),s=(o,a)=>{switch(o.t){case"lit":let h=e?Xc(o.ch):void 0;return{t:"lit",id:r++,ch:o.ch,re:h,next:a};case"any":case"star":return{t:o.t,id:r++,next:a};case"class":return{t:"class",id:r++,re:o.re,next:a}}let l=h=>o.alts.map(p=>i(p,h));switch(o.type){case"@":return n(l(a));case"?":return n([a,...l(a)]);case"!":return{t:"neg",id:r++,sub:n(l(po)),next:a}}let c=n([]),f=n(l(c));return c.out.push(a,f),o.type==="*"?c:f};return[i(t,po),r]},mm=t=>{let e=[],r=new Set,n=s=>s.t==="match"?"match":String(s.id),i=(s,o)=>{if(s.t==="match"||r.has(s))return;r.add(s);let a=l=>e.push(`${o}${s.id}: ${l}`);switch(s.t){case"split":a(`split -> ${s.out.map(n).join(", ")}`);for(let l of s.out)i(l,o);return;case"neg":return a(`!(${n(s.sub)}) -> ${n(s.next)}`),i(s.sub,o+" "),i(s.next,o);case"lit":a(`${JSON.stringify(s.ch)} -> ${n(s.next)}`);break;case"class":a(`${s.re} -> ${n(s.next)}`);break;default:a(`${s.t==="any"?"?":"*"} -> ${n(s.next)}`)}i(s.next,o)};return i(t,""),[`start -> ${n(t)}`,...e].join(`
|
|
862
|
+
`)},gm=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},ru=(t,e)=>t.ids.length!==e.ids.length||t.runs.length!==e.runs.length||t.ids.some((r,n)=>r!==e.ids[n])?!1:t.runs.every(r=>e.runs.some(n=>n.neg===r.neg&&ru(n.state,r.state))),Sc=t=>({has:new Float64Array(t),seen:new Float64Array(t),gen:0}),mo=class{dots;dotStart;#e;constructor(t,e,r){this.dots=t,this.dotStart=e,this.#e=r}state(){return new gm(++this.#e.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,r)=>e-r),t.match&&t.ids.unshift(po.id),t}#i(t,e){let{seen:r}=this.#e;return r[e.id]===t.gen?!1:(r[e.id]=t.gen,!0)}#n(t,e){let{has:r}=this.#e;return r[e.id]===t.gen?!1:(r[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,r,n){switch(e.t){case"split":if(!this.#i(t,e))return;for(let s of e.out)this.add(t,s,r,n);return;case"neg":if(!this.#i(t,e))return;let i=this.state();return this.add(i,e.sub,r,!1),this.done(i),this.addRun(t,{t:"run",neg:e,state:i},r,n);case"star":if(this.restricted(r,n))return;this.#n(t,e)&&this.add(t,e.next,r,n);return;case"match":t.match=!0;return;default:this.#n(t,e)}}addRun(t,e,r,n){for(let i of t.runs)if(i.neg===e.neg&&ru(i.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,r,n)}step(t,e,r,n){let i=this.state();for(let s of t.threads)switch(s.t){case"lit":So(s,e)&&this.add(i,s.next,r+1,n);break;case"any":this.restricted(r,n)||this.add(i,s.next,r+1,n);break;case"class":!this.restricted(r,n)&&s.re.test(e)&&this.add(i,s.next,r+1,n);break;case"star":this.restricted(r,n)||this.add(i,s,r+1,n)}if(!this.restricted(r,n))for(let s of t.runs){if(s.state.dead){this.addRun(i,s,r+1,n);continue}let o=this.step(s.state,e,r,!1);this.addRun(i,{t:"run",neg:s.neg,state:o},r+1,n)}return this.done(i)}},nu=t=>{let e=t.ids.join();if(!t.runs.length)return e;let r=t.runs.map(n=>`${n.neg.id}(${nu(n.state)})`);return`${e}|${r.sort().join("|")}`},ym=1<<18,_m=class{#e;#i=new Map;#n=0;#o;#s;#d;#f;constructor(t,e){this.#e=t,this.#d=new mo(!1,!1,e),this.#f=new mo(!1,!0,e)}#h(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#a(t){let e=nu(t),r=this.#i.get(e);if(r)return r;this.#n>ym&&this.#m();let n=this.#h(t);return this.#i.set(e,n),this.#n+=e.length+1,n}#m(){this.#i.clear(),this.#n=0,this.#o=void 0,this.#s=void 0}start(t){if(t){if(this.#s)return this.#s;let r=this.#f.state();return this.#f.add(r,this.#e,0,!0),this.#s=this.#h(this.#f.done(r))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#e,0,!0),this.#o=this.#a(this.#d.done(e))}next(t,e){let r=e.charCodeAt(0),n=r<128?void 0:t.next.get(e);if(n)return n;let i=t===this.#s?this.#a(this.#f.step(t.state,e,0,!0)):this.#a(this.#d.step(t.state,e,1,!0));return r<128?(t.ascii||(t.ascii=new Array(128),this.#n+=128),t.ascii[r]=i):t.next.set(e,i),this.#n++,i}},bm=t=>{let e=[];for(let r=t;r.t!=="match";r=r.next){if(r.t==="split"||r.t==="neg")return;e.push(r)}return e},wm=(t,e,r,n)=>{let i=0,s=r,o=-1,a=0;for(;s<n;){let l=t[i];if(l?.t==="star"){o=i++,a=s;continue}let c=e[s];if(l&&(l.t==="any"||l.t==="lit"&&So(l,c)||l.t==="class"&&l.re.test(c))){i++,s++;continue}if(o===-1)return!1;i=o+1,s=++a}for(;t[i]?.t==="star";)i++;return i===t.length},iu=t=>{let e=0,r=0;for(let n of t){let[i,s]=vm(n);e+=i,r+=s}return[e,r]},vm=t=>{if(t.t==="star")return[0,1/0];if(t.t!=="ext")return[1,1];if(t.type==="!")return[0,1/0];let e=t.alts.map(iu),r=Math.min(...e.map(s=>s[0])),n=Math.max(...e.map(s=>s[1])),i=n===0?0:1/0;return t.type==="@"?[r,n]:t.type==="?"?[0,n]:t.type==="*"?[0,i]:[r,i]},xc=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!So(t[n],e[r+n]))return!1;return!0},Sm=/[/\ud800-\udfff]/,xm=/[\ud800-\udfff]/,kn=t=>xm.test(t)?[...t]:t,Cc=t=>{if(t.includes("/"))throw new Error("can only match a single path portion, got: "+t)},kc=class{pattern;options;#e;#i;#n;#o;#s;#d=!1;#f;#h;#a=!1;#m=0;#c=1/0;#l=[];#r=[];#_;#x;#b=!1;#g;#y;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:r=!1,noext:n=!1,normalize:i}=e;this.#y=i===!0?"NFC":i||void 0;let s=/^[?*+@]\(\)$/.test(t),o=fm(t,r,n||s,this.#y,e.rangeMark),[a]=eu(o,dm(o),0,o.length,!0);this.#y&&(a=tu(a,this.#y));let[l,c]=pm(a,r);if(this.#e=l,this.#i=c,a.every(f=>f.t==="lit"))this.#s=a.map(f=>f.ch).join(""),this.#d=r;else{let f=m=>m.t!=="lit"?void 0:r?{ch:m.ch,re:Xc(m.ch)}:{ch:m.ch};for(let m of a){let g=f(m);if(!g)break;this.#l.push(g)}for(let m=a.length-1;m>=0;m--){let g=f(a[m]);if(!g)break;this.#r.unshift(g)}this.#b=!!(this.#l.length||this.#r.length),r||(this.#_=this.#l.map(m=>m.ch).join(""),this.#x=this.#r.map(m=>m.ch).join("")),this.#h=bm(this.#e)?.slice(this.#l.length,-this.#r.length||void 0),this.#a=!!this.#h?.every(m=>m.t==="star"||m.t==="any");let[h,p]=iu(a);this.#m=h,this.#c=p}}test(t){return this.#y?(Cc(t),this.#p(t.normalize(this.#y))):Sm.test(t)?(Cc(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#y?t.normalize(this.#y):t)}#p(t,e){if(this.#s!==void 0)return this.#d?(this.#f??=Zc(this.#s)).test(t):t===this.#s;let r=this.#m,n=this.#c;if(e===void 0){let c=t.length,f=c+1>>1;if(c<r||f>n)return!1;(f<r||c>n)&&(e=kn(t))}if(e!==void 0&&(e.length<r||e.length>n))return!1;let i=this.#l.length;if(this.#b)if(this.#_!==void 0&&this.#x!==void 0){if(!t.startsWith(this.#_)||!t.endsWith(this.#x))return!1}else{e??=kn(t);let c=e.length-this.#r.length;if(!xc(this.#l,e,0)||!xc(this.#r,e,c))return!1}let s=!this.options.dot&&t.startsWith(".");if(this.#h){if(t==="."||t===".."||s&&!i)return!1;if(this.#a)return!0;e??=kn(t);let c=e.length-this.#r.length;return wm(this.#h,e,i,c)}if(e??=kn(t),t==="."||t===".."){this.#n??=Sc(this.#i);let c=this.#o??=new mo(!0,!1,this.#n),f=c.state();c.add(f,this.#e,0,!0);let h=c.done(f);for(let p=0;p<e.length;p++)h=c.step(h,e[p],p,!0);return h.match}this.#n??=Sc(this.#i);let o=this.#g??=new _m(this.#e,this.#n),a=o.start(s),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let f=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[f]??o.next(a,e[c])}return a.match}toString(){return mm(this.#e)}},qn=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},xo=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!1}={})=>r?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),su=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!0}={})=>r?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),De=(t,e,r={})=>(qn(e),!r.nocomment&&e.charAt(0)==="#"?!1:km(e,r).match(t)),zt=new Map,Cm=256,km=(t,e)=>{let r=t+"\0"+JSON.stringify(e),n=zt.get(r);return n?zt.delete(r):(n=new Dt(t,{...e}),zt.size>=Cm&&zt.delete(zt.keys().next().value)),zt.set(r,n),n},ou=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ec={win32:{sep:"\\"},posix:{sep:"/"}},Em=ou==="win32"?Ec.win32.sep:Ec.posix.sep;De.sep=Em;var ie=Symbol("globstar **");De.GLOBSTAR=ie;var Am=(t,e={})=>r=>De(r,t,e);De.filter=Am;var lt=(t,e={})=>Object.assign({},t,e),Om=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return De;let e=De;return Object.assign((r,n,i={})=>e(r,n,lt(t,i)),{Minimatch:class extends e.Minimatch{constructor(r,n={}){super(r,lt(t,n))}static defaults(r){return e.defaults(lt(t,r)).Minimatch}},unescape:(r,n={})=>e.unescape(r,lt(t,n)),escape:(r,n={})=>e.escape(r,lt(t,n)),filter:(r,n={})=>e.filter(r,lt(t,n)),defaults:r=>e.defaults(lt(t,r)),braceExpand:(r,n={})=>e.braceExpand(r,lt(t,n)),match:(r,n,i={})=>e.match(r,n,lt(t,i)),sep:e.sep,GLOBSTAR:ie})};De.defaults=Om;var go=(t,e={})=>(qn(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:tm(t,{max:e.braceExpandMax}));De.braceExpand=go;var Pm=100,Tm=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,Dm=(t,e,r={})=>{let n=new Dt(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};De.match=Dm;var Ac=/[?*]|[+@!]\(.*?\)|\[|\]/,au=(t,e)=>{let r=e+1;(t.charAt(r)==="!"||t.charAt(r)==="^")&&r++;let n=!1;for(;r<t.length;r++){let i=t.charAt(r);if(i==="]"&&n)return r;n=!0,i==="\\"&&r++}return-1},Im=(t,e)=>{if(!e&&(t==="+()"||t==="@()"))return t;let r="";for(let n=0;n<t.length;n++){let i=t.charAt(n);if(i==="\\")r+=t.charAt(++n)||i;else{if(i==="*"||i==="?")return;if(i==="["){let s=au(t,n);if(s===-1){r+=i;continue}let o=t.slice(n+1,s);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(t.charAt(n+1)))return;r+=o,n=s}else{if(!e&&"+@!".includes(i)&&t.charAt(n+1)==="("&&t.includes(")",n+2))return;r+=i}}}return r},Rm=t=>{if(/^[?*+@]\(\)$/.test(t)||t.includes("[:"))return!1;let e=0;for(let r=0;r<t.length;r++){let n=t.charAt(r);if(n==="\\"){if(++r===t.length)return!1}else if(n==="["){let i=au(t,r);i!==-1&&(r=i)}else if("+@!?*".includes(n)&&t.charAt(r+1)==="(")e++,r++;else if(n===")"){if(!e--)return!1}else if(n==="|"&&!e)return!1}return!e},Xs,Oc,xt=(t,e)=>typeof t=="string"?e===t:e!==""&&t.testUnchecked(e),Pc=(t,e,r,n,i)=>xt(t,e)?r:n!==void 0&&xt(t,n)?i:-1,yo=t=>t==="."||t==="..",eo=t=>typeof t=="string"&&/^[a-z]:$/i.test(t),Mn=t=>typeof t=="string"&&/^unc$/i.test(t),to=t=>{if(t[0]!==""||t[1]!=="")return-1;let e=t[2]!=="?"?2:Mn(t[3])?4:-1,r=t[e],n=t[e+1];return e!==-1&&r!==void 0&&r!==""&&r!==ie&&n!==void 0&&n!==""&&n!==ie?e:-1},En=(t,e)=>!yo(t)&&(e||!t.startsWith(".")),xr=(t,e,r,n,i)=>{for(let s=e;s<r;){if(t.charCodeAt(s)===46){if(!n)return!0;let a=t.charCodeAt(s+1)===46?s+2:s+1;if(a>=r||Hn(t.charCodeAt(a),i))return!0}let o=_o(t,s,i);if(o===-1)return!1;for(s=o+1;s<r&&Hn(t.charCodeAt(s),i);)s++}return!1},Hn=(t,e)=>e==="/"?t===47:e==="\\"?t===92:t===47||t===92,_o=(t,e,r)=>{if(r!=="both")return t.indexOf(r,e);let n=t.indexOf("/",e),i=t.indexOf("\\",e);return n===-1?i:i===-1?n:Math.min(n,i)},Tc=(t,e,r)=>r!=="both"?t.lastIndexOf(r,e):Math.max(t.lastIndexOf("/",e),t.lastIndexOf("\\",e)),ro={},Dt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#i;#n;#o;#s=[];#d=[];#f=[];#h=new Map;#a=!1;#m;#c=new WeakMap;constructor(t,e={}){qn(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||ou,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#e=!this.preserveMultipleSlashes,this.#n=(e.optimizationLevel??1)>=2;let n=e.normalize;this.#o=n===!0?"NFC":n||void 0,this.make();let i=this.set.map(s=>this.#r(s));this.#f=this.set.map((s,o)=>this.#e&&s.length-1>i[o]),this.#s=this.set.map((s,o)=>{let a=this.#f[o]?s.length-1:s.length,l=s.slice(i[o]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#i=this.#s.some(s=>s.length),this.#d=this.set.map((s,o)=>{let[a,l,c]=s;if(this.#f[o]&&s.length===2&&a===ie&&l!==ie)return"tail";if(this.#f[o]&&e.matchBase&&s.length===1&&a!==ie&&a!=="")return"base";if(!(!this.#e||i[o]!==-1)){if(s.length===3&&a===ie&&c===ie&&l!==ie&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(s.length===2&&l===ie&&a!==ie&&a!=="")return"head"}})}#l(t){return this.#o?t.normalize(this.#o):t}#r(t){if(!this.isWindows)return-1;if(eo(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&eo(t[3]))return 3;let e=to(t);return e===-1?-1:e+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#A())];let r=this.globSet.map(i=>this.#t(i));this.globParts=this.preprocess(r),this.#a=!0;let n=this.globParts.map((i,s,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=i[2]==="?"&&Mn(i[3])?6:4,l=i[0]===""&&i[1]===""&&(i[2]==="?"||!Ac.test(i[2]))&&i.slice(3,a).every(f=>!Ac.test(f)),c=/^[a-z]:/i.test(i[0]);if(l)return[...i.slice(0,a).map(f=>this.#l(f)),...i.slice(a).map(f=>this.parse(f))];if(c)return[this.#l(i[0]),...i.slice(1).map(f=>this.parse(f))]}return i.map(a=>this.parse(a))});if(this.set=n.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][2]==="?"&&(eo(s[3])||Mn(this.globParts[i][3]))&&(Mn(this.globParts[i][3])&&(s[3]="UNC"),s[2]="?")}e.noext||this.mergeRows(),this.#a=!1,this.set.forEach((i,s)=>{for(let o=0;o<i.length;o++)i[o]===ro&&(i[o]=this.parse(this.globParts[s][o]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(r=>r.length));for(let r=0;r<e;r++){let n=new Map;this.set.forEach((s,o)=>{if(!(s[r]instanceof kc||s[r]===ro)||!Rm(this.globParts[o][r]))return;let a=[...this.globParts[o]];a[r]="";let l=`${s.length}/${a.join("/")}`,c=n.get(l);c?c.push(o):n.set(l,[o])});let i=new Set;for(let s of n.values()){if(s.length<2)continue;let[o,...a]=s,l=`@(${s.map(c=>this.globParts[c][r]).join("|")})`;this.globParts[o][r]=l,this.set[o][r]=this.parse(l);for(let c of a)i.add(c)}i.size&&(t=!0,this.set=this.set.filter((s,o)=>!i.has(o)),this.globParts=this.globParts.filter((s,o)=>!i.has(o)))}}}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let n=0;n<r.length;n++)r[n]==="**"&&(r[n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let r=-1;for(;(r=e.indexOf("**",r+1))!==-1;){let n=r;for(;e[n+1]==="**";)n++;n!==r&&e.splice(r,n-r)}return e})}levelOneOptimize(t){return t.map(e=>{let r=this.#r(e)+1;return e=e.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&n.length>r&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),e.length===0?[""]:e})}#_(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",r=this.#e?0:-1,n="",i=0,s,o=0,a=!!this.options.dot;e:for(let l=0;l<this.set.length;l++){let c=this.set[l],f=c[c.length-1],h=r!==-1&&this.#f[l]&&f!==ie;if(h&&r===0){let g=Tc(t,t.length,e);if(i=g+1,n=t.slice(i),n===""&&g>=0){let O=g;for(;O>0&&Hn(t.charCodeAt(O-1),e);)O--;o=O===0?0:Tc(t,O-1,e)+1,s=t.slice(o,O)}let _=this.#n&&(yo(n)||n===""&&s!==void 0&&yo(s));r=_?-1:1,h=!_}let p=-1;if(h&&typeof f=="string"&&(p=Pc(f,n,i,s,o),p===-1))continue;if(this.#i){for(let g of this.#s[l])if(!t.includes(g))continue e}if(h&&typeof f=="object"&&(p=Pc(f,n,i,s,o),p===-1))continue;let m=this.#d[l];if(m==="base"&&h)return"yes";if(m==="tail"&&h){if(this.#n&&xr(t,0,p,!0,e))return"maybe";if(!xr(t,0,p,a,e))return"yes";continue}if(m==="mid"||m==="head"){let g=this.#b(t,c,m==="head",a,e);if(g!=="no")return g;continue}return"maybe"}return"no"}#x(t,e,r){let n=!!this.options.dot,i=t.length;if(r==="head"){if(i<2||!xt(e[0],t[0]))return!1;for(let o=1;o<i;o++)if(!En(t[o],n))return!1;return!0}let s=e[1];if(r==="tail"){let o=i-1;if(!xt(s,t[o])&&(t[o]!==""||i===1||!xt(s,t[--o])))return!1;for(let a=0;a<o;a++)if(!En(t[a],n))return!1;return!0}for(let o=0;o<i;o++){if(xt(s,t[o])&&o+1<i){let a=o+1;for(;a<i&&En(t[a],n);)a++;if(a===i)return!0}if(!En(t[o],n))return!1}return!1}#b(t,e,r,n,i){if(this.#n&&xr(t,0,t.length,!0,i))return"maybe";let s=e[r?0:1],o=0;for(let a=_o(t,o,i);a!==-1;a=_o(t,o,i)){let l=a+1;for(;l<t.length&&Hn(t.charCodeAt(l),i);)l++;if((typeof s=="string"?a-o===s.length&&t.startsWith(s,o):a>o&&s.testUnchecked(t.slice(o,a)))&&!xr(t,l,t.length,n,i))return"yes";if(r||xr(t,o,l,n,i))return"no";o=l}return"no"}#g(t){let e=Xs;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#y(t){let{isWindows:e,preserveMultipleSlashes:r}=this,n=this.#t(e?t.split("\\").join("/"):t),i=this.#o;return i&&(n=n.map(s=>s.normalize(i))),Xs={f:t,isWindows:e,preserveMultipleSlashes:r,normalize:i,parts:n},Xs}#p(t){let e=[...t],r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let o=e[s];s===1&&o===""&&e[0]===""||(o==="."||o==="")&&(r=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=this.#r(e)+1,i=n;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,e.splice(i-1,2),i=Math.max(i-2,n))}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,r=0,n=1e6,i=!1;do{i=!1;for(let s of t){let o=-1;for(;(o=s.indexOf("**",o+1))!==-1;){let c=o;for(;s[c+1]==="**";)c++;c>o&&s.splice(o+1,c-o);let f=s[o+1],h=s[o+2],p=s[o+3];if(f!==".."||!h||h==="."||h===".."||!p||p==="."||p==="..")continue;let m=s.length-1;if(t.length>=e||r+m>n)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");i=!0,s.splice(o,1);let g=s.slice(0);g[o]="**",r+=m,t.push(g),o--}if(!this.preserveMultipleSlashes){for(let c=1;c<s.length-1;c++){let f=s[c];c===1&&f===""&&s[0]===""||(f==="."||f==="")&&(i=!0,s.splice(c,1),c--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(i=!0,s.pop())}let a=this.#r(s)+1,l=a;for(;(l=s.indexOf("..",l+1))!==-1;){let c=s[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){i=!0;let f=l===1&&s[l+1]==="**"?["."]:[];s.splice(l-1,2,...f),s.length===0&&s.push(""),l=Math.max(l-2,a)}}}}while(i);return t}secondPhasePreProcess(t){let e=new Set,r=t.filter(s=>{let o=s.join("/");return e.has(o)?!1:(e.add(o),!0)}),n=new Map;for(let s of r){let o=[];for(let a=0;a<s.length;a++)s[a]==="*"&&o.push(a);o.length&&n.set(o.join(","),o)}if(!n.size||r.length*n.size>1e5)return r;let{dot:i}=this.options;return r.filter(s=>{for(let o of n.values()){if(o[o.length-1]>=s.length)continue;let a=[...s],l=!0,c=!1;for(let f of o){let h=s[f];if(h!=="*"){if(!h||h==="**"||!i&&h.startsWith(".")){l=!1;break}a[f]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,r=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,r++;r&&(this.pattern=t.slice(r)),this.negate=e}#C(t,e,r,n){let i=0,s=0,o=this.isWindows?to(e):-1,a=o===-1?-1:to(r);if(a!==-1){let l=r[a],c=r[a+1];typeof l!="string"||typeof c!="string"?(i=o,s=a):e[o].toLowerCase()===l.toLowerCase()&&e[o+1].toLowerCase()===c.toLowerCase()&&(i=o+2,s=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),h=!f&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),p=c?3:l?0:void 0,m=h?3:f?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[g,_]=[t[p],r[m]];g.toLowerCase()===_.toLowerCase()&&(s=m+1,i=p+1)}}return t=e,r.includes(ie)?this.#k(t,r,n,i,s):this.#w(t,r,n,i,s)}#k(t,e,r,n,i){let{head:s,body:o,tail:a,segments:l}=this.#v(e,r,i);if(s.length){let f=n+s.length;if(!this.#w(t,s,r,n,0,f))return!1;n+=s.length,i+=s.length}let c=0;if(a.length){if(a.length+n>t.length)return!1;let f=t.length-a.length;if(this.#w(t,a,r,f,0))c=a.length;else{if(t[t.length-1]!==""||n+a.length===t.length||(f--,!this.#w(t,a,r,f,0)))return!1;c=a.length+1}}if(!o.length){let f=!!c;for(let h=n;h<t.length-c;h++){let p=String(t[h]);if(f=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return r||f}return!!this.#S(t,l,t.length-c,n,0,r,0,!!c,new Set)}#v(t,e,r){let n=this.#c.get(t);n||(n=[],this.#c.set(t,n));let i=r*2+(e?1:0),s=n[i];if(s)return s;let o=t.indexOf(ie,r),a=t.lastIndexOf(ie),l=t.slice(r,o),c=t.slice(o+1,e?void 0:a),f=e?[]:t.slice(a+1),h=[[[],0]],p=h[0],m=0,g=[0];for(let O of c)O===ie?(g.push(m),p=[[],0],h.push(p)):(p[0].push(O),m++);h.forEach((O,b)=>{O[1]=m-g[b]});let _={head:l,body:c,tail:f,segments:h};return n[i]=_,_}#S(t,e,r,n,i,s,o,a,l){let c=e[i];if(!c){if(s)return n>=r||n===r-1&&t[n]==="";for(let m=n;m<r;m++){a=!0;let g=t[m];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return a}let[f,h]=c,p=s?r:r-h;for(;n<=p;){let m=i*(t.length+1)+n;if(l.has(m))return!1;if(l.add(m),this.#w(t,f,s,n,0,n+f.length)&&o<this.maxGlobstarRecursion){let _=this.#S(t,e,r,n+f.length,i+1,s,o+1,a,l);if(_!==!1)return _}if(n===p)break;let g=t[n];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;n++}return s||null}#w(t,e,r,n,i,s=t.length){let o,a,l,c;for(o=n,a=i,c=Math.min(s,t.length),l=e.length;o<c&&a<l;o++,a++){let f=e[a],h=t[o];if(f===!1||f===ie||!xt(f,h))return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return go(this.pattern,this.options)}#A(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let r=String.fromCharCode(e),n=!1,i=t.replace(Tm,(o,a,l)=>{let c=Number(a),f=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(f)||Math.abs(c-f)+1<Pm?o:(n=!0,`${r}${a}..${l}${r}`)});if(!n)return this.braceExpand();let s=go(i,this.options);for(let o of s)for(let a of o.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(r))return this.braceExpand()}return this.#m=r,s}parse(t){qn(t);let e=this.options;if(t==="**")return ie;if(t==="")return"";let{nocase:r,nocaseMagicOnly:n,noext:i=!1,dot:s,normalize:o}=e,a=this.#m,l=a&&t.includes(a)?void 0:Im(t,i);if(l!==void 0&&!(r&&!n&&t.toUpperCase()!==t.toLowerCase()))return this.#l(l);if(this.#a)return ro;let c=this.#h.get(t);return c||(c=new kc(t,{nocase:r,noext:i,dot:s,normalize:o,...a&&{rangeMark:a}}),this.#h.set(t,c)),c}#t(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let r=this.options,n=this.#g(t);if(!n){if(!e&&!this.#o&&(this.#e||this.#i)&&Oc!==t){Oc=t;let l=this.#_(t);if(l==="no")return r.flipNegate?!1:this.negate;if(l==="yes")return r.flipNegate?!0:!this.negate}n=this.#y(t)}let i=n.parts,s=this.#n?n.resolved??=this.#p(i):i,o=this.set,a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l=0;l<o.length;l++){let c=o[l],f=e?void 0:this.#d[l];if(f==="base"?xt(c[0],a):f?this.#x(s,c,f):r.matchBase&&c.length===1?this.#C([a],[a],c,e):this.#C(i,s,c,e))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return De.defaults(t).Minimatch}};De.Minimatch=Dt;De.escape=xo;De.unescape=su;var me=Mm("lru-cache:metrics"),Pr=Nm("lru-cache"),Fm=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,no=()=>me.hasSubscribers||Pr.hasSubscribers,lu=new Set,Dc=typeof process=="object"&&process?process:{},Bm=(t,e,r,n)=>{typeof Dc.emitWarning=="function"?Dc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},qm=t=>!lu.has(t),St=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),cu=t=>St(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Fn:null:null,Fn=class extends Array{constructor(t){super(t),this.fill(0)}},Hm=class Tr{heap;length;static#e=!1;static create(e){let r=cu(e);if(!r)return[];Tr.#e=!0;let n=new Tr(e,r);return Tr.#e=!1,n}constructor(e,r){if(!Tr.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},jn=class uu{#e;#i;#n;#o;#s;#d;#f;#h;get perf(){return this.#h}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#m;#c;#l;#r;#_;#x;#b;#g;#y;#p;#C;#k;#v;#S;#w;#A;#t;#D;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#v,autopurgeTimers:e.#S,sizes:e.#C,keyMap:e.#c,keyList:e.#l,valList:e.#r,next:e.#_,prev:e.#x,get head(){return e.#b},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,n,i,s)=>e.#F(r,n,i,s),moveToTail:r=>e.#Y(r),indexes:r=>e.#P(r),rindexes:r=>e.#T(r),isStale:r=>e.#E(r)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#m}get size(){return this.#a}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#n}get onInsert(){return this.#o}get disposeAfter(){return this.#s}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:c,onInsert:f,disposeAfter:h,noDisposeOnSet:p,noUpdateTTL:m,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:O,fetchMethod:b,memoMethod:x,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:V,ignoreFetchAbort:B,backgroundFetchSize:Q=1,perf:ee}=e;if(this.backgroundFetchSize=Q,ee!==void 0&&typeof ee?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#h=ee??Fm,r!==0&&!St(r))throw new TypeError("max option must be a nonnegative integer");let oe=r?cu(r):Array;if(!oe)throw new Error("invalid max value: "+r);if(this.#e=r,this.#i=g,this.maxEntrySize=_||this.#i,this.sizeCalculation=O,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=x,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=b,this.#A=!!b,this.#c=new Map,this.#l=Array.from({length:r}).fill(void 0),this.#r=Array.from({length:r}).fill(void 0),this.#_=new oe(r),this.#x=new oe(r),this.#b=0,this.#g=0,this.#y=Hm.create(r),this.#a=0,this.#m=0,typeof c=="function"&&(this.#n=c),typeof f=="function"&&(this.#o=f),typeof h=="function"?(this.#s=h,this.#p=[]):(this.#s=void 0,this.#p=void 0),this.#w=!!this.#n,this.#D=!!this.#o,this.#t=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#i!==0&&!St(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!St(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=St(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!St(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#i===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){let ae="LRU_CACHE_UNBOUNDED";qm(ae)&&(lu.add(ae),Bm("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ae,uu))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#I(){let e=new Fn(this.#e),r=new Fn(this.#e);this.#v=e,this.#k=r;let n=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=n,this.#q=(l,c,f=this.#h.now())=>{r[l]=c!==0?f:0,e[l]=c,i(l,c)},this.#O=l=>{r[l]=e[l]!==0?this.#h.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,c)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),c&&c!==0&&n){let f=setTimeout(()=>{this.#E(l)?(this.#B(this.#l[l],"expire"),n[l]=void 0):i(l,a(l))},c+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#R=(l,c)=>{if(e[c]){let f=e[c],h=r[c];if(!f||!h)return;l.ttl=f,l.start=h,l.now=s||o();let p=l.now-h;l.remainingTTL=f-p}};let s=0,o=()=>{let l=this.#h.now();if(this.ttlResolution>0){s=l;let c=setTimeout(()=>s=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{let c=this.#c.get(l);return c===void 0?0:a(c)};let a=l=>{let c=e[l],f=r[l];if(!c||!f)return 1/0;let h=(s||o())-f;return c-h};this.#E=l=>{let c=r[l],f=e[l];return!!f&&!!c&&(s||o())-c>f}}#O=()=>{};#R=()=>{};#q=()=>{};#E=()=>!1;#V(){let e=new Fn(this.#e);this.#m=0,this.#C=e,this.#N=r=>{this.#m-=e[r],e[r]=0},this.#H=(r,n,i,s)=>{if(!St(i)){if(this.#u(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!St(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#L=(r,n,i)=>{if(e[r]=n,this.#i){let s=this.#i-e[r];for(;this.#m>s;)this.#W(!0)}this.#m+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#m)}}#N=e=>{};#L=(e,r,n)=>{};#H=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;this.#$(r)&&((e||!this.#E(r))&&(yield r),r!==this.#b);)r=this.#x[r]}*#T({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#b;this.#$(r)&&((e||!this.#E(r))&&(yield r),r!==this.#g);)r=this.#_[r]}#$(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#l[e],this.#r[e]])}*rentries(){for(let e of this.#T())this.#r[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#l[e],this.#r[e]])}*keys(){for(let e of this.#P()){let r=this.#l[e];r!==void 0&&!this.#u(this.#r[e])&&(yield r)}}*rkeys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#u(this.#r[e])&&(yield r)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#T())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#P()){let i=this.#r[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.#G(this.#l[n],r)}}forEach(e,r=this){for(let n of this.#P()){let i=this.#r[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}rforEach(e,r=this){for(let n of this.#T()){let i=this.#r[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let r of this.#T({allowStale:!0}))this.#E(r)&&(this.#B(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#r[r],i=this.#u(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#v&&this.#k){let o=this.#v[r],a=this.#k[r];if(o&&a){let l=o-(this.#h.now()-a);s.ttl=l,s.start=Date.now()}}return this.#C&&(s.size=this.#C[r]),s}dump(){let e=[];for(let r of this.#P({allowStale:!0})){let n=this.#l[r],i=this.#r[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#v&&this.#k){o.ttl=this.#v[r];let a=this.#h.now()-this.#k[r];o.start=Math.floor(Date.now()-a)}this.#C&&(o.size=this.#C[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#h.now()-i}this.#M(r,n.value,n)}}set(e,r,n={}){let{status:i=me.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,r!==void 0&&(i.value=r),i.cache=this);let s=this.#M(e,r,n);return i&&me.hasSubscribers&&me.publish(i),s}#M(e,r,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=n,f=this.#u(r);if(r===void 0)return c&&(c.set="deleted"),this.delete(e),this;let{noUpdateTTL:h=this.noUpdateTTL}=n;c&&!f&&(c.value=r);let p=this.#H(e,r,n.size||0,l,c);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#B(e,"set"),c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this;let m=this.#a===0?void 0:this.#c.get(e);if(m===void 0)m=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#e?this.#W(!1):this.#a,this.#l[m]=e,this.#r[m]=r,this.#c.set(e,m),this.#_[this.#g]=m,this.#x[m]=this.#g,this.#g=m,this.#a++,this.#L(m,p,c),c&&(c.set="add"),h=!1,this.#D&&!f&&this.#o?.(r,e,"add");else{this.#Y(m);let g=this.#r[m];if(r!==g){if(!a)if(this.#u(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=g;_!==void 0&&_!==r&&(this.#w&&this.#n?.(_,e,"set"),this.#t&&this.#p?.push([_,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#t&&this.#p?.push([g,e,"set"]);if(this.#N(m),this.#L(m,p,c),this.#r[m]=r,!f){let _=g&&this.#u(g)?g.__staleWhileFetching:g,O=_===void 0?"add":r!==_?"replace":"update";c&&(c.set=O,_!==void 0&&(c.oldValue=_)),this.#D&&this.onInsert?.(r,e,O)}}else f||(c&&(c.set="update"),this.#D&&this.onInsert?.(r,e,"update"))}if(s!==0&&!this.#v&&this.#I(),this.#v&&(h||this.#q(m,s,o),c&&this.#R(c,m)),!a&&this.#t&&this.#p){let g=this.#p,_;for(;_=g?.shift();)this.#s?.(..._)}return this}pop(){try{for(;this.#a;){let e=this.#r[this.#b];if(this.#W(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#p){let e=this.#p,r;for(;r=e?.shift();)this.#s?.(...r)}}}#W(e){let r=this.#b,n=this.#l[r],i=this.#r[r],s=this.#u(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#t)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#t&&this.#p?.push([o,n,"evict"])),this.#N(r),this.#S?.[r]&&(clearTimeout(this.#S[r]),this.#S[r]=void 0),e&&(this.#l[r]=void 0,this.#r[r]=void 0,this.#y.push(r)),this.#a===1?(this.#b=this.#g=0,this.#y.length=0):this.#b=this.#_[r],this.#c.delete(n),this.#a--,r}has(e,r={}){let{status:n=me.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#K(e,r);return me.hasSubscribers&&me.publish(n),i}#K(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#c.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#E(s))i&&(i.has="stale",this.#R(i,s));else return n&&this.#O(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{status:n=no()?{}:void 0}=r;n&&(n.op="peek",n.key=e,n.cache=this),r.status=n;let i=this.#z(e,r);return me.hasSubscribers&&me.publish(n),i}#z(e,r){let{status:n,allowStale:i=this.allowStale}=r,s=this.#c.get(e);if(s===void 0||!i&&this.#E(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#r[s],a=this.#u(o)?o.__staleWhileFetching:o;return n&&(a!==void 0?(n.peek="hit",n.value=a):n.peek="miss"),a}#F(e,r,n,i){let s=r===void 0?void 0:this.#r[r];if(this.#u(s))return s;let o=new AbortController,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},c=(_,O=!1)=>{let{aborted:b}=o.signal,x=n.ignoreFetchAbort&&_!==void 0,I=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&_!==void 0);if(n.status&&(b&&!O?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),b&&!x&&!O)return h(o.signal.reason,I);let L=m,N=this.#r[r];return(N===m||N===void 0&&x&&O)&&(_===void 0?L.__staleWhileFetching!==void 0?this.#r[r]=L.__staleWhileFetching:this.#B(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#M(e,_,l.options,L))),_},f=_=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=_),h(_,!1)),h=(_,O)=>{let{aborted:b}=o.signal,x=b&&n.allowStaleOnFetchAbort,I=x||n.allowStaleOnFetchRejection,L=I||n.noDeleteOnFetchRejection,N=m;if(this.#r[r]===m&&(!L||!O&&N.__staleWhileFetching===void 0?this.#B(e,"fetch"):x||(this.#r[r]=N.__staleWhileFetching)),I)return n.status&&N.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw _},p=(_,O)=>{let b=this.#d?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(_(void 0),n.allowStaleOnFetchAbort&&(_=x=>c(x,!0)))}),b&&b instanceof Promise?b.then(x=>_(x===void 0?void 0:x),O):b!==void 0&&_(b)};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(p).then(c,f),g=Object.assign(m,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#M(e,g,{...l.options,status:void 0}),r=this.#c.get(e)):this.#r[r]=g,g}#u(e){if(!this.#A)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(e,r={}){let n=Pr.hasSubscribers,{status:i=no()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#U(e,r);return i&&n&&(i.trace=!0,Pr.tracePromise(()=>s,i).catch(()=>{})),s}async#U(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:_,forceRefresh:O=!1,status:b,signal:x}=r;if(b&&(b.op="fetch",b.key=e,O&&(b.forceRefresh=!0),b.cache=this),!this.#A)return b&&(b.fetch="get"),this.#G(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:b});let I={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:b,signal:x},L=this.#c.get(e);if(L===void 0){b&&(b.fetch="miss");let N=this.#F(e,L,I,_);return N.__returned=N}else{let N=this.#r[L];if(this.#u(N)){let ee=n&&N.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",ee&&(b.returnedStale=!0)),ee?N.__staleWhileFetching:N.__returned=N}let V=this.#E(L);if(!O&&!V)return b&&(b.fetch="hit"),this.#Y(L),i&&this.#O(L),b&&this.#R(b,L),N;let B=this.#F(e,L,I,_),Q=B.__staleWhileFetching!==void 0&&n;return b&&(b.fetch=V?"stale":"refresh",Q&&V&&(b.returnedStale=!0)),Q?B.__staleWhileFetching:B.__returned=B}}forceFetch(e,r={}){let n=Pr.hasSubscribers,{status:i=no()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#j(e,r);return i&&n&&(i.trace=!0,Pr.tracePromise(()=>s,i).catch(()=>{})),s}async#j(e,r={}){let n=await this.#U(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let{status:n=me.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="memo",n.key=e,r.context&&(n.context=r.context),n.cache=this);let i=this.#Z(e,r);return n&&(n.value=i),me.hasSubscribers&&me.publish(n),i}#Z(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...a}=r;s&&o&&(s.forceRefresh=!0);let l=this.#G(e,a),c=o||l===void 0;if(s&&(s.memo=c?"miss":"hit",c||(s.value=l)),!c)return l;let f=n(e,l,{options:a,context:i});return s&&(s.value=f),this.#M(e,f,a),f}get(e,r={}){let{status:n=me.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#G(e,r);return n&&(i!==void 0&&(n.value=i),me.hasSubscribers&&me.publish(n)),i}#G(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#c.get(e);if(a===void 0){o&&(o.get="miss");return}let l=this.#r[a],c=this.#u(l);return o&&this.#R(o,a),this.#E(a)?c?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#B(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=c?"fetching":"hit"),this.#Y(a),i&&this.#O(a),c?l.__staleWhileFetching:l)}#J(e,r){this.#x[r]=e,this.#_[e]=r}#Y(e){e!==this.#g&&(e===this.#b?this.#b=this.#_[e]:this.#J(this.#x[e],this.#_[e]),this.#J(this.#g,e),this.#g=e)}delete(e){return this.#B(e,"delete")}#B(e,r){me.hasSubscribers&&me.publish({op:"delete",delete:r,key:e,cache:this});let n=!1;if(this.#a!==0){let i=this.#c.get(e);if(i!==void 0)if(this.#S?.[i]&&(clearTimeout(this.#S[i]),this.#S[i]=void 0),n=!0,this.#a===1)this.#Q(r);else{this.#N(i);let s=this.#r[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#t)&&(this.#w&&this.#n?.(s,e,r),this.#t&&this.#p?.push([s,e,r])),this.#c.delete(e),this.#l[i]=void 0,this.#r[i]=void 0,i===this.#g)this.#g=this.#x[i];else if(i===this.#b)this.#b=this.#_[i];else{let o=this.#x[i];this.#_[o]=this.#_[i];let a=this.#_[i];this.#x[a]=this.#x[i]}this.#a--,this.#y.push(i)}}if(this.#t&&this.#p?.length){let i=this.#p,s;for(;s=i?.shift();)this.#s?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let r of this.#T({allowStale:!0})){let n=this.#r[r];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[r];this.#w&&this.#n?.(n,i,e),this.#t&&this.#p?.push([n,i,e])}}if(this.#c.clear(),this.#r.fill(void 0),this.#l.fill(void 0),this.#v&&this.#k){this.#v.fill(0),this.#k.fill(0);for(let r of this.#S??[])r!==void 0&&clearTimeout(r);this.#S?.fill(void 0)}if(this.#C&&this.#C.fill(0),this.#b=0,this.#g=0,this.#y.length=0,this.#m=0,this.#a=0,this.#t&&this.#p){let r=this.#p,n;for(;n=r?.shift();)this.#s?.(...n)}}},Ic=typeof process=="object"&&process?process:{stdout:null,stderr:null},eg=t=>!!t&&typeof t=="object"&&(t instanceof $n||t instanceof hu||tg(t)||rg(t)),tg=t=>!!t&&typeof t=="object"&&t instanceof Co&&typeof t.pipe=="function"&&t.pipe!==hu.Writable.prototype.pipe,rg=t=>!!t&&typeof t=="object"&&t instanceof Co&&typeof t.write=="function"&&typeof t.end=="function",ct=Symbol("EOF"),ut=Symbol("maybeEmitEnd"),vt=Symbol("emittedEnd"),An=Symbol("emittingEnd"),Cr=Symbol("emittedError"),On=Symbol("closed"),Rc=Symbol("read"),Pn=Symbol("flush"),Lc=Symbol("flushChunk"),Ue=Symbol("encoding"),Ut=Symbol("decoder"),he=Symbol("flowing"),kr=Symbol("paused"),Gt=Symbol("resume"),fe=Symbol("buffer"),Ee=Symbol("pipes"),de=Symbol("bufferLength"),io=Symbol("bufferPush"),Tn=Symbol("bufferShift"),we=Symbol("objectMode"),le=Symbol("destroyed"),so=Symbol("error"),oo=Symbol("emitData"),Nc=Symbol("emitEnd"),ao=Symbol("emitEnd2"),et=Symbol("async"),lo=Symbol("abort"),Dn=Symbol("aborted"),Er=Symbol("signal"),Ot=Symbol("dataListeners"),Te=Symbol("discarded"),Ar=t=>Promise.resolve().then(t),ng=t=>t(),ig=t=>t==="end"||t==="finish"||t==="prefinish",sg=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,og=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),fu=class{src;dest;opts;ondrain;constructor(t,e,r){this.src=t,this.dest=e,this.opts=r,this.ondrain=()=>t[Gt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ag=class extends fu{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,r){super(t,e,r),this.proxyErrors=n=>this.dest.emit("error",n),t.on("error",this.proxyErrors)}},lg=t=>!!t.objectMode,cg=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",$n=class extends Co{[he]=!1;[kr]=!1;[Ee]=[];[fe]=[];[we];[Ue];[et];[Ut];[ct]=!1;[vt]=!1;[An]=!1;[On]=!1;[Cr]=null;[de]=0;[le]=!1;[Er];[Dn]=!1;[Ot]=0;[Te]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");lg(e)?(this[we]=!0,this[Ue]=null):cg(e)?(this[Ue]=e.encoding,this[we]=!1):(this[we]=!1,this[Ue]=null),this[et]=!!e.async,this[Ut]=this[Ue]?new Xm(this[Ue]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[fe]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Ee]});let{signal:r}=e;r&&(this[Er]=r,r.aborted?this[lo]():r.addEventListener("abort",()=>this[lo]()))}get bufferLength(){return this[de]}get encoding(){return this[Ue]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[we]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[et]}set async(t){this[et]=this[et]||!!t}[lo](){this[Dn]=!0,this.emit("abort",this[Er]?.reason),this.destroy(this[Er]?.reason)}get aborted(){return this[Dn]}set aborted(t){}write(t,e,r){if(this[Dn])return!1;if(this[ct])throw new Error("write after end");if(this[le])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(r=e,e="utf8"),e||(e="utf8");let n=this[et]?Ar:ng;if(!this[we]&&!Buffer.isBuffer(t)){if(og(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(sg(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[he]&&this[de]!==0&&this[Pn](!0),this[he]?this.emit("data",t):this[io](t),this[de]!==0&&this.emit("readable"),r&&n(r),this[he]):t.length?(typeof t=="string"&&!(e===this[Ue]&&!this[Ut]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[Ue]&&(t=this[Ut].write(t)),this[he]&&this[de]!==0&&this[Pn](!0),this[he]?this.emit("data",t):this[io](t),this[de]!==0&&this.emit("readable"),r&&n(r),this[he]):(this[de]!==0&&this.emit("readable"),r&&n(r),this[he])}read(t){if(this[le])return null;if(this[Te]=!1,this[de]===0||t===0||t&&t>this[de])return this[ut](),null;this[we]&&(t=null),this[fe].length>1&&!this[we]&&(this[fe]=[this[Ue]?this[fe].join(""):Buffer.concat(this[fe],this[de])]);let e=this[Rc](t||null,this[fe][0]);return this[ut](),e}[Rc](t,e){if(this[we])this[Tn]();else{let r=e;t===r.length||t===null?this[Tn]():typeof r=="string"?(this[fe][0]=r.slice(t),e=r.slice(0,t),this[de]-=t):(this[fe][0]=r.subarray(t),e=r.subarray(0,t),this[de]-=t)}return this.emit("data",e),!this[fe].length&&!this[ct]&&this.emit("drain"),e}end(t,e,r){return typeof t=="function"&&(r=t,t=void 0),typeof e=="function"&&(r=e,e="utf8"),t!==void 0&&this.write(t,e),r&&this.once("end",r),this[ct]=!0,this.writable=!1,(this[he]||!this[kr])&&this[ut](),this}[Gt](){this[le]||(!this[Ot]&&!this[Ee].length&&(this[Te]=!0),this[kr]=!1,this[he]=!0,this.emit("resume"),this[fe].length?this[Pn]():this[ct]?this[ut]():this.emit("drain"))}resume(){return this[Gt]()}pause(){this[he]=!1,this[kr]=!0,this[Te]=!1}get destroyed(){return this[le]}get flowing(){return this[he]}get paused(){return this[kr]}[io](t){this[we]?this[de]+=1:this[de]+=t.length,this[fe].push(t)}[Tn](){return this[we]?this[de]-=1:this[de]-=this[fe][0].length,this[fe].shift()}[Pn](t=!1){do;while(this[Lc](this[Tn]())&&this[fe].length);!t&&!this[fe].length&&!this[ct]&&this.emit("drain")}[Lc](t){return this.emit("data",t),this[he]}pipe(t,e){if(this[le])return t;this[Te]=!1;let r=this[vt];return e=e||{},t===Ic.stdout||t===Ic.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,r?e.end&&t.end():(this[Ee].push(e.proxyErrors?new ag(this,t,e):new fu(this,t,e)),this[et]?Ar(()=>this[Gt]()):this[Gt]()),t}unpipe(t){let e=this[Ee].find(r=>r.dest===t);e&&(this[Ee].length===1?(this[he]&&this[Ot]===0&&(this[he]=!1),this[Ee]=[]):this[Ee].splice(this[Ee].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let r=super.on(t,e);if(t==="data")this[Te]=!1,this[Ot]++,!this[Ee].length&&!this[he]&&this[Gt]();else if(t==="readable"&&this[de]!==0)super.emit("readable");else if(ig(t)&&this[vt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Cr]){let n=e;this[et]?Ar(()=>n.call(this,this[Cr])):n.call(this,this[Cr])}return r}removeListener(t,e){return this.off(t,e)}off(t,e){let r=super.off(t,e);return t==="data"&&(this[Ot]=this.listeners("data").length,this[Ot]===0&&!this[Te]&&!this[Ee].length&&(this[he]=!1)),r}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Ot]=0,!this[Te]&&!this[Ee].length&&(this[he]=!1)),e}get emittedEnd(){return this[vt]}[ut](){!this[An]&&!this[vt]&&!this[le]&&this[fe].length===0&&this[ct]&&(this[An]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[On]&&this.emit("close"),this[An]=!1)}emit(t,...e){let r=e[0];if(t!=="error"&&t!=="close"&&t!==le&&this[le])return!1;if(t==="data")return!this[we]&&!r?!1:this[et]?(Ar(()=>this[oo](r)),!0):this[oo](r);if(t==="end")return this[Nc]();if(t==="close"){if(this[On]=!0,!this[vt]&&!this[le])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(t==="error"){this[Cr]=r,super.emit(so,r);let i=!this[Er]||this.listeners("error").length?super.emit("error",r):!1;return this[ut](),i}else if(t==="resume"){let i=super.emit("resume");return this[ut](),i}else if(t==="finish"||t==="prefinish"){let i=super.emit(t);return this.removeAllListeners(t),i}let n=super.emit(t,...e);return this[ut](),n}[oo](t){for(let r of this[Ee])r.dest.write(t)===!1&&this.pause();let e=this[Te]?!1:super.emit("data",t);return this[ut](),e}[Nc](){return this[vt]?!1:(this[vt]=!0,this.readable=!1,this[et]?(Ar(()=>this[ao]()),!0):this[ao]())}[ao](){if(this[Ut]){let e=this[Ut].end();if(e){for(let r of this[Ee])r.dest.write(e);this[Te]||super.emit("data",e)}}for(let e of this[Ee])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[we]||(t.dataLength=0);let e=this.promise();return this.on("data",r=>{t.push(r),this[we]||(t.dataLength+=r.length)}),await e,t}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Ue]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(le,()=>e(new Error("stream destroyed"))),this.on("error",r=>e(r)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[Te]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[ct])return e();let n,i,s=c=>{this.off("data",o),this.off("end",a),this.off(le,l),e(),i(c)},o=c=>{this.off("error",s),this.off("end",a),this.off(le,l),this.pause(),n({value:c,done:!!this[ct]})},a=()=>{this.off("error",s),this.off("data",o),this.off(le,l),e(),n({done:!0,value:void 0})},l=()=>s(new Error("stream destroyed"));return new Promise((c,f)=>{i=f,n=c,this.once(le,l),this.once("error",s),this.once("end",a),this.once("data",o)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Te]=!1;let t=!1,e=()=>(this.pause(),this.off(so,e),this.off(le,e),this.off("end",e),t=!0,{done:!0,value:void 0}),r=()=>{if(t)return e();let n=this.read();return n===null?e():{done:!1,value:n}};return this.once("end",e),this.once(so,e),this.once(le,e),{next:r,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[le])return t?this.emit("error",t):this.emit(le),this;this[le]=!0,this[Te]=!0,this[fe].length=0,this[de]=0;let e=this;return typeof e.close=="function"&&!this[On]&&e.close(),t?this.emit("error",t):this.emit(le),this}static get isStream(){return eg}},ug=Gm.native,Dr={lstatSync:Wm,readdir:Vm,readdirSync:zm,readlinkSync:Um,realpathSync:ug,promises:{lstat:Km,readdir:Jm,readlink:Qm,realpath:Zm}},du=t=>!t||t===Dr||t===Ym?Dr:{...Dr,...t,promises:{...Dr.promises,...t.promises}},hg=/^\\\\\?\\([a-z]:)\\?$/i,fg=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,dg=/^\\\\[^\\?]+\\[^\\]+$/,Mc=t=>t.replace(/\//g,"\\").replace(hg,"$1\\").replace(fg,"\\\\$1\\").replace(dg,"$&\\"),pg=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,mg=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,gg=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,yg=/[\\/]/,qe=0,pu=1,mu=2,tt=4,gu=6,yu=8,Pt=10,_u=12,Be=15,Or=~Be,co=16,Fc=32,Ir=64,Ge=128,In=256,Bn=512,Bc=Ir|Ge|Bn,_g=1023,uo=t=>t.isFile()?yu:t.isDirectory()?tt:t.isSymbolicLink()?Pt:t.isCharacterDevice()?mu:t.isBlockDevice()?gu:t.isSocket()?_u:t.isFIFO()?pu:qe,qc=new jn({max:2**12}),Rr=t=>{let e=qc.get(t);if(e)return e;let r=t.normalize("NFKD");return qc.set(t,r),r},Hc=new jn({max:2**12}),Rn=t=>{let e=Hc.get(t);if(e)return e;let r=Rr(t.toLowerCase());return Hc.set(t,r),r},$c=class extends jn{constructor(){super({max:256})}},bg=class extends jn{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},bu=Symbol("PathScurry setAsCwd"),Oe=class{name;root;roots;parent;nocase;isCWD=!1;#e;#i;get dev(){return this.#i}#n;get mode(){return this.#n}#o;get nlink(){return this.#o}#s;get uid(){return this.#s}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#m;get size(){return this.#m}#c;get blocks(){return this.#c}#l;get atimeMs(){return this.#l}#r;get mtimeMs(){return this.#r}#_;get ctimeMs(){return this.#_}#x;get birthtimeMs(){return this.#x}#b;get atime(){return this.#b}#g;get mtime(){return this.#g}#y;get ctime(){return this.#y}#p;get birthtime(){return this.#p}#C;#k;#v;#S;#w;#A;#t;#D;#I;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=qe,r,n,i,s,o){this.name=t,this.#C=i?Rn(t):Rr(t),this.#t=e&_g,this.nocase=i,this.roots=n,this.root=r||this,this.#D=s,this.#v=o.fullpath,this.#w=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=du(o.fs)}get fs(){return this.#e}depth(){return this.#k!==void 0?this.#k:this.parent?this.#k=this.parent.depth()+1:this.#k=0}childrenCache(){return this.#D}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#R(r):this.#R(r)}#R(t){let e=this;for(let r of t)e=e.child(r);return e}children(){let t=this.#D.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#D.set(this,e),this.#t&=~co,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let r=this.children(),n=this.nocase?Rn(t):Rr(t);for(let a of r)if(a.#C===n)return a;let i=this.parent?this.sep:"",s=this.#v?this.#v+i+t:void 0,o=this.newChild(t,qe,{...e,parent:this,fullpath:s});return this.canReaddir()||(o.#t|=Ge),r.push(o),o}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let t=this.name,e=this.parent;if(!e)return this.#w=this.name;let r=e.relative();return r+(!r||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,e=this.parent;if(!e)return this.#A=this.fullpathPosix();let r=e.relativePosix();return r+(!r||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=r}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep==="/")return this.#S=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#S=`//?/${n}`:this.#S=n}let t=this.parent,e=t.fullpathPosix(),r=e+(!e||!t.parent?"":"/")+this.name;return this.#S=r}isUnknown(){return(this.#t&Be)===qe}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&Be)===yu}isDirectory(){return(this.#t&Be)===tt}isCharacterDevice(){return(this.#t&Be)===mu}isBlockDevice(){return(this.#t&Be)===gu}isFIFO(){return(this.#t&Be)===pu}isSocket(){return(this.#t&Be)===_u}isSymbolicLink(){return(this.#t&Pt)===Pt}lstatCached(){return this.#t&Fc?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let t=this.#t&Be;return!(t!==qe&&t!==Pt||this.#t&In||this.#t&Ge)}calledReaddir(){return!!(this.#t&co)}isENOENT(){return!!(this.#t&Ge)}isNamed(t){return this.nocase?this.#C===Rn(t):this.#C===Rr(t)}async readlink(){let t=this.#I;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(e);if(r)return this.#I=r}catch(e){this.#T(e.code);return}}readlinkSync(){let t=this.#I;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(e);if(r)return this.#I=r}catch(e){this.#T(e.code);return}}#q(t){this.#t|=co;for(let e=t.provisional;e<t.length;e++){let r=t[e];r&&r.#E()}}#E(){this.#t&Ge||(this.#t=(this.#t|Ge)&Or,this.#V())}#V(){let t=this.children();t.provisional=0;for(let e of t)e.#E()}#N(){this.#t|=Bn,this.#L()}#L(){if(this.#t&Ir)return;let t=this.#t;(t&Be)===tt&&(t&=Or),this.#t=t|Ir,this.#V()}#H(t=""){t==="ENOTDIR"||t==="EPERM"?this.#L():t==="ENOENT"?this.#E():this.children().provisional=0}#P(t=""){t==="ENOTDIR"?this.parent.#L():t==="ENOENT"&&this.#E()}#T(t=""){let e=this.#t;e|=In,t==="ENOENT"&&(e|=Ge),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Or),this.#t=e,t==="ENOTDIR"&&this.parent&&this.parent.#L()}#$(t,e){return this.#W(t,e)||this.#M(t,e)}#M(t,e){let r=uo(t),n=this.newChild(t.name,r,{parent:this}),i=n.#t&Be;return i!==tt&&i!==Pt&&i!==qe&&(n.#t|=Ir),e.unshift(n),e.provisional++,n}#W(t,e){for(let r=e.provisional;r<e.length;r++){let n=e[r];if((this.nocase?Rn(t.name):Rr(t.name))===n.#C)return this.#K(t,n,r,e)}}#K(t,e,r,n){let i=e.name;return e.#t=e.#t&Or|uo(t),i!==t.name&&(e.name=t.name),r!==n.provisional&&(r===n.length-1?n.pop():n.splice(r,1),n.unshift(e)),n.provisional++,e}async lstat(){if((this.#t&Ge)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(t){this.#P(t.code)}}lstatSync(){if((this.#t&Ge)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(t){this.#P(t.code)}}#z(t){let{atime:e,atimeMs:r,birthtime:n,birthtimeMs:i,blksize:s,blocks:o,ctime:a,ctimeMs:l,dev:c,gid:f,ino:h,mode:p,mtime:m,mtimeMs:g,nlink:_,rdev:O,size:b,uid:x}=t;this.#b=e,this.#l=r,this.#p=n,this.#x=i,this.#h=s,this.#c=o,this.#y=a,this.#_=l,this.#i=c,this.#d=f,this.#a=h,this.#n=p,this.#g=m,this.#r=g,this.#o=_,this.#f=O,this.#m=b,this.#s=x;let I=uo(t);this.#t=this.#t&Or|I|Fc,I!==qe&&I!==tt&&I!==Pt&&(this.#t|=Ir)}#F=[];#u=!1;#U(t){this.#u=!1;let e=this.#F.slice();this.#F.length=0,e.forEach(r=>r(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);e?t(null,i):queueMicrotask(()=>t(null,i));return}if(this.#F.push(t),this.#u)return;this.#u=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(i,s)=>{if(i)this.#H(i.code),r.provisional=0;else{for(let o of s)this.#$(o,r);this.#q(r)}this.#U(r.slice(0,r.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#j)await this.#j;else{let r=()=>{};this.#j=new Promise(n=>r=n);try{for(let n of await this.#e.promises.readdir(e,{withFileTypes:!0}))this.#$(n,t);this.#q(t)}catch(n){this.#H(n.code),t.provisional=0}this.#j=void 0,r()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let r of this.#e.readdirSync(e,{withFileTypes:!0}))this.#$(r,t);this.#q(t)}catch(r){this.#H(r.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#t&Bc)return!1;let t=Be&this.#t;return t===qe||t===tt||t===Pt}shouldWalk(t,e){return(this.#t&tt)===tt&&!(this.#t&Bc)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#O)return this.#O;if(!((Bn|In|Ge)&this.#t))try{let t=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!((Bn|In|Ge)&this.#t))try{let t=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N()}}[bu](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),r=[],n=this;for(;n&&n.parent;)e.add(n),n.#w=r.join(this.sep),n.#A=r.join("/"),n=n.parent,r.push("..");for(n=t;n&&n.parent&&!e.has(n);)n.#w=void 0,n.#A=void 0,n=n.parent}},wu=class vu extends Oe{sep="\\";splitSep=yg;constructor(e,r=qe,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=qe,n={}){return new vu(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return pg.exec(e)?.[0]??bo.parse(e).root}getRoot(e){if(e=Mc(e.toUpperCase()),e===this.root.name||/^[\\/]$/.test(e))return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new ko(e,{nocase:this.nocase,fs:this.fs}).root}sameRoot(e,r=this.root.name){return Mc(e.toUpperCase())===r}},Su=class xu extends Oe{splitSep="/";sep="/";constructor(e,r=qe,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=qe,n={}){return new xu(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Cu=class{root;rootPath;roots;cwd;#e;#i;#n;nocase;#o;constructor(t=process.cwd(),e,r,{nocase:n,childrenCacheSize:i=16*1024,fs:s=Dr}={}){this.#o=du(s),(t instanceof URL||t.startsWith("file://"))&&(t=jm(t));let o=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new $c,this.#i=new $c,this.#n=new bg(i);let a=o.substring(this.rootPath.length).split(r);if(a.length===1&&!a[0]&&a.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,f=e.sep,h=this.rootPath,p=!1;for(let m of a){let g=c--;l=l.child(m,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:h+=(p?"":f)+m}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let i=t.length-1;i>=0;i--){let s=t[i];if(!(!s||s===".")&&(e=e?`${s}/${e}`:s,this.isAbsolute(s)))break}let r=this.#e.get(e);if(r!==void 0)return r;let n=this.cwd.resolve(e).fullpath();return this.#e.set(e,n),n}resolvePosix(...t){let e="";for(let i=t.length-1;i>=0;i--){let s=t[i];if(!(!s||s===".")&&(e=e?`${s}/${e}`:s,this.isAbsolute(s)))break}let r=this.#i.get(e);if(r!==void 0)return r;let n=this.cwd.resolve(e).fullpathPosix();return this.#i.set(e,n),n}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r}=e;if(t.canReaddir()){let n=await t.readdir();return r?n:n.map(i=>i.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0}=e;return t.canReaddir()?r?t.readdirSync():t.readdirSync().map(n=>n.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t.withFileTypes,t=this.cwd);let r=await t.readlink();return e?r:r?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t.withFileTypes,t=this.cwd);let r=t.readlinkSync();return e?r:r?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t.withFileTypes,t=this.cwd);let r=await t.realpath();return e?r:r?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t.withFileTypes,t=this.cwd);let r=t.realpathSync();return e?r:r?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:n=!1,filter:i,walkFilter:s}=e,o=[];(!i||i(t))&&o.push(r?t:t.fullpath());let a=new Set,l=(f,h)=>{a.add(f),f.readdirCB((p,m)=>{if(p)return h(p);let g=m.length;if(!g)return h();let _=()=>{--g===0&&h()};for(let O of m)(!i||i(O))&&o.push(r?O:O.fullpath()),n&&O.isSymbolicLink()?O.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(a,s)?l(b,_):_()):O.shouldWalk(a,s)?l(O,_):_()},!0)},c=t;return new Promise((f,h)=>{l(c,p=>{if(p)return h(p);f(o)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:n=!1,filter:i,walkFilter:s}=e,o=[];(!i||i(t))&&o.push(r?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let f of c){(!i||i(f))&&o.push(r?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(n&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,s)&&a.add(h)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:n=!1,filter:i,walkFilter:s}=e;(!i||i(t))&&(yield r?t:t.fullpath());let o=new Set([t]);for(let a of o){let l=a.readdirSync();for(let c of l){(!i||i(c))&&(yield r?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(n&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(o,s)&&o.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:n=!1,filter:i,walkFilter:s}=e,o=new $n({objectMode:!0});(!i||i(t))&&o.write(r?t:t.fullpath());let a=new Set,l=[t],c=0,f=()=>{let h=!1;for(;!h;){let p=l.shift();if(!p){c===0&&o.end();return}c++,a.add(p);let m=(_,O,b=!1)=>{if(_)return o.emit("error",_);if(n&&!b){let x=[];for(let I of O)I.isSymbolicLink()&&x.push(I.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(x.length){Promise.all(x).then(()=>m(null,O,!0));return}}for(let x of O)x&&(!i||i(x))&&(o.write(r?x:x.fullpath())||(h=!0));c--;for(let x of O){let I=x.realpathCached()||x;I.shouldWalk(a,s)&&l.push(I)}h&&!o.flowing?o.once("drain",f):g||f()},g=!0;p.readdirCB(m,!0),g=!1}};return f(),o}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Oe||(e=t,t=this.cwd);let{withFileTypes:r=!0,follow:n=!1,filter:i,walkFilter:s}=e,o=new $n({objectMode:!0}),a=new Set;(!i||i(t))&&o.write(r?t:t.fullpath());let l=[t],c=0,f=()=>{let h=!1;for(;!h;){let p=l.shift();if(!p){c===0&&o.end();return}c++,a.add(p);let m=p.readdirSync();for(let g of m)(!i||i(g))&&(o.write(r?g:g.fullpath())||(h=!0));c--;for(let g of m){let _=g;if(g.isSymbolicLink()){if(!(n&&(_=g.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(a,s)&&l.push(_)}}h&&!o.flowing&&o.once("drain",f)};return f(),o}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[bu](e)}},ko=class extends Cu{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:r=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(mg,"").replace(gg,"\\")),super(t,bo,"\\",{...e,nocase:r}),this.nocase=r;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(t){return bo.parse(t).root.toUpperCase()}newRoot(t){return new wu(this.rootPath,tt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Eo=class extends Cu{sep="/";constructor(t=process.cwd(),e={}){let{nocase:r=!1}=e;super(t,$m,"/",{...e,nocase:r}),this.nocase=r}parseRootPath(t){return"/"}newRoot(t){return new Su(this.rootPath,tt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},ku=class extends Eo{constructor(t=process.cwd(),e={}){let{nocase:r=!0}=e;super(t,{...e,nocase:r})}},x0=process.platform==="win32"?wu:Su,wg=process.platform==="win32"?ko:process.platform==="darwin"?ku:Eo,vg=t=>t.length>=1,Sg=t=>t.length>=1,xg=Symbol.for("nodejs.util.inspect.custom"),Eu=class Au{#e;#i;#n;length;#o;#s;#d;#f;#h;#a;#m=!0;constructor(e,r,n,i){if(!vg(e))throw new TypeError("empty pattern list");if(!Sg(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#i=r,this.#n=n,this.#o=i,this.#n===0){if(this.isUNC()){let s=this.#c()?6:4,o=this.#e.slice(0,s),a=this.#i.slice(0,s),l=this.#e.slice(s),c=this.#i.slice(s);l[0]===""&&(l.shift(),c.shift());let f=[...o,""].join("/"),h=[...a,""].join("/");this.#e=[f,...l],this.#i=[h,...c],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...l]=this.#i;o[0]===""&&(o.shift(),l.shift());let c=`${s}/`,f=`${a}/`;this.#e=[c,...o],this.#i=[f,...l],this.length=this.#e.length}}}[xg](){return`Pattern <${this.#i.slice(this.#n).join("/")}>`}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]=="string"}isGlobstar(){return this.#e[this.#n]===ie}isMatcher(){return typeof this.#e[this.#n]=="object"}globString(){return this.#d=this.#d||(this.#n===0?this.isAbsolute()?this.#i[0]+this.#i.slice(1).join("/"):this.#i.join("/"):this.#i.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new Au(this.#e,this.#i,this.#n+1,this.#o),this.#s.#a=this.#a,this.#s.#h=this.#h,this.#s.#f=this.#f,this.#s):this.#s=null}#c(){let e=this.#e;return e[2]==="?"&&typeof e[3]=="string"&&/^unc$/i.test(e[3])}isUNC(){let e=this.#e,r=this.#c()?4:2;return this.#h!==void 0?this.#h:this.#h=this.#o==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[r]=="string"&&!!e[r]&&typeof e[r+1]=="string"&&!!e[r+1]}isDrive(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}},Cg=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",jc=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:r,noext:n,noglobstar:i,normalize:s,platform:o=Cg,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c,braceExpandMax:f=1e4},h){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,l=!!l||c===!1,this.mmopts={braceExpandMax:f,dot:!0,nobrace:e,nocase:r,noext:n,noglobstar:i,normalize:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let p=h?.resolve(a??"/").fullpath()??"/";this.slashRoot=xo(p.replace(/\\/g,"/").replace(/\/$/,""),{magicalBraces:!0,windowsPathsNoEscape:l});for(let m of t)this.add(m)}add(t){let e=new Dt(t,this.mmopts);for(let r=0;r<e.set.length;r++){let n=e.set[r],i=e.globParts[r];if(!n||!i)throw new Error("invalid pattern object");for(;n[0]==="."&&i[0]===".";)n.shift(),i.shift();let s=new Eu(n,i,0,this.platform),o=s.root()==="/"?`${this.slashRoot}/${s.rest()?.globString()??""}`:s.globString(),a=new Dt(o,this.mmopts),l=i[i.length-1]==="**",c=s.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),r=`${e}/`,n=t.relative()||".",i=`${n}/`;for(let s of this.relative)if(s.match(n)||s.match(i))return!0;for(let s of this.absolute)if(s.match(e)||s.match(r))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,r=`${t.relative()||"."}/`;for(let n of this.relativeChildren)if(n.match(r))return!0;for(let n of this.absoluteChildren)if(n.match(e))return!0;return!1}},kg=class Ou{parent;store;constructor(e){this.parent=e}copy(){return new Ou(this)}#e(e){let r=this.store?.get(e);return r||!this.parent?r:this.parent.#e(e)}hasWalked(e,r){return!!this.#e(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.#e(n);i?i.add(r.globString()):(this.store??=new Map).set(n,new Set([r.globString()]))}},Pu=class wo{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(e,r,n){let i=(r?wo.ABSOLUTE:0)|(n?wo.IF_DIR:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}},Eg=class{store=new Map;add(t,e){if(!t.canReaddir())return;let r=this.store.get(t);r?r.find(n=>n.globString()===e.globString())||r.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Wc=class Tu{hasWalkedCache;matches=new Pu;subwalks=new Eg;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new kg}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,c,f=!1;for(;typeof(l=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(l),s=c,f=!0;if(l=s.pattern(),c=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(i.resolve(l),a,h);continue}else if(l===ie){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=c?.pattern(),p=c?.rest();if(!c||(h===""||h===".")&&!p)this.matches.add(i,a,h===""||h===".");else if(h===".."){let m=i.parent||i;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,a,!0)}}else typeof l=="object"&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Tu(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),l=o.pattern(),c=o.rest();l===ie?i.testGlobstar(s,o,c,a):typeof l=="object"?i.testMatcher(s,l,c,a):i.testString(s,l,c,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else typeof s=="object"&&this.testMatcher(e,s,n.rest(),i)}}testMatcher(e,r,n,i){r.testUnchecked(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}},{ABSOLUTE:Ln,IF_DIR:Nn}=Pu,Ag=(t,e,r)=>typeof t=="string"?new jc([t],e,r):Array.isArray(t)?new jc(t,e,r):t,Du=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#i;#n;signal;maxDepth;includeChildMatches;constructor(t,e,r){if(this.patterns=t,this.path=e,this.opts=r,this.#n=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#i=Ag(r.ignore??[],r,e),!this.includeChildMatches&&typeof this.#i.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#o(t){return this.seen.has(t)||!!this.#i?.ignored?.(t)}#s(t){return!!this.#i?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#e.shift());)t()}onResume(t){this.paused?this.#e.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let r,n;if(this.opts.realpath){if(r=t.realpathCached()||await t.realpath(),!r)return;n=r}else n=t;let i=n.isUnknown()||this.opts.stat?await n.lstat():n;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let s=await i.realpath();s&&(s.isUnknown()||this.opts.stat)&&await s.lstat()}return this.matchCheckTest(i,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let r,n;if(this.opts.realpath){if(r=t.realpathCached()||t.realpathSync(),!r)return;n=r}else n=t;let i=n.isUnknown()||this.opts.stat?n.lstatSync():n;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let s=i.realpathSync();s&&(s?.isUnknown()||this.opts.stat)&&s.lstatSync()}return this.matchCheckTest(i,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#i?.add){let i=`${t.relativePosix()}/**`;this.#i.add(i)}let r=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let n=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(r){let i=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(i+n)}else{let i=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!i.startsWith(`..${this.#n}`)?`.${this.#n}`:"";this.matchEmit(i?s+i+n:`.${n}`)}}async match(t,e,r){let n=await this.matchCheck(t,r);n&&this.matchFinish(n,e)}matchSync(t,e,r){let n=this.matchCheckSync(t,r);n&&this.#d(n,e)}walkCB(t,e,r){if(this.signal?.aborted)return r();this.walkCB2(t,e,new Wc(this.opts),r)}walkCB2(t,e,r,n){if(this.#s(t)||this.signal?.aborted)return n();if(this.paused){this.onResume(()=>this.walkCB2(t,e,r,n));return}r.processPatterns(t,e);let i=1,s=()=>{--i===0&&n()};for(let[o,a]of r.matches.store)this.#o(o)||(i++,this.match(o,!!(a&Ln),!!(a&Nn)).then(()=>s()));for(let o of r.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;i++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,r,s):o.readdirCB((l,c)=>this.walkCB3(o,c,r,s),!0)}s()}walkCB3(t,e,r,n){let i=r.filterEntries(t,e),s=1,o=()=>{--s===0&&n()};for(let[a,l]of i.matches.store)this.#o(a)||(s++,this.match(a,!!(l&Ln),!!(l&Nn)).then(()=>o()));for(let[a,l]of i.subwalks.entries())s++,this.walkCB2(a,l,i.child(),o);o()}walkCBSync(t,e,r){if(this.signal?.aborted)return r();this.walkCB2Sync(t,e,new Wc(this.opts),r)}walkCB2Sync(t,e,r,n){if(this.#s(t)||this.signal?.aborted)return n();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,r,n));return}r.processPatterns(t,e);let i=1,s=()=>{--i===0&&n()};for(let[o,a]of r.matches.store)this.#o(o)||this.matchSync(o,!!(a&Ln),!!(a&Nn));for(let o of r.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;i++;let a=o.readdirSync();this.walkCB3Sync(o,a,r,s)}s()}walkCB3Sync(t,e,r,n){let i=r.filterEntries(t,e),s=1,o=()=>{--s===0&&n()};for(let[a,l]of i.matches.store)this.#o(a)||this.matchSync(a,!!(l&Ln),!!(l&Nn));for(let[a,l]of i.subwalks.entries())s++,this.walkCB2Sync(a,l,i.child(),o);o()}},Vc=class extends Du{matches=[];constructor(t,e,r){super(t,e,r)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},zc=class extends Du{results;constructor(t,e,r){super(t,e,r),this.results=new $n({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},Og=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",It=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=Lm(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let r=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(r=r.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");r=r.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=r,this.platform=e.platform||Og,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ko:e.platform==="darwin"?ku:e.platform?Eo:wg;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},s=this.pattern.map(l=>new Dt(l,i)),[o,a]=s.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=o.map((l,c)=>{let f=a[c];if(!f)throw new Error("invalid pattern object");return new Eu(l,f,0,this.platform)})}async walk(){return await new Vc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new Vc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new zc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new zc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},Pg=(t,e={})=>{for(let r of Array.isArray(t)?t:[t])if(new Dt(r,e).hasMagic())return!0;return!1};function Wn(t,e={}){return new It(t,e).streamSync()}function Iu(t,e={}){return new It(t,e).stream()}function Ru(t,e={}){return new It(t,e).walkSync()}async function Uc(t,e={}){return new It(t,e).walk()}function Vn(t,e={}){return new It(t,e).iterateSync()}function Lu(t,e={}){return new It(t,e).iterate()}var Tg=Wn,Dg=Object.assign(Iu,{sync:Wn}),Ig=Vn,Rg=Object.assign(Lu,{sync:Vn}),Lg=Object.assign(Ru,{stream:Wn,iterate:Vn}),Yt=Object.assign(Uc,{glob:Uc,globSync:Ru,sync:Lg,globStream:Iu,stream:Dg,globStreamSync:Wn,streamSync:Tg,globIterate:Lu,iterate:Rg,globIterateSync:Vn,iterateSync:Ig,Glob:It,hasMagic:Pg,escape:xo,unescape:su});Yt.glob=Yt;var zn=class{type="glob";data=null;pattern;constructor(e){if(!e.pattern)throw new Error('Glob datasource requires "pattern" configuration');this.pattern=e.pattern}async loadData(){if(this.data!==null)return this.data;let e=await Yt(this.pattern,{nodir:!0}),r=[];for(let n of e)try{let i=await Ng(n),s=Fg(n);r.push({path:n,name:Nu(n),basename:Nu(n,s),ext:s.slice(1),dir:Mg(n),size:i.size,mtime:i.mtime.toISOString()})}catch{continue}return this.data=r,this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Ao(t){return new zn(t)}import{dirname as Po,relative as Un,resolve as Mu,sep as Yn}from"node:path";var Fu=">=5.0.0 <7.0.0",Gn={namespace:{label:"Namespace",dir:"namespaces"},enum:{label:"Enumeration",dir:"enumerations"},class:{label:"Class",dir:"classes"},interface:{label:"Interface",dir:"interfaces"},type:{label:"Type Alias",dir:"type-aliases"},variable:{label:"Variable",dir:"variables"},function:{label:"Function",dir:"functions"},reference:{label:"Reference",dir:"references"}},Bg=new Set(["hidden","ignore"]),qg={summary:"",tags:[],parameters:new Map,typeParameters:new Map,returns:""};function Bu(t){for(;t.length>0&&t[0].trim()==="";)t.shift();for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return t.join(`
|
|
863
|
+
`)}function Hg(t){let e=[],r=0;for(let n=0;n<t.length;n++){if(t[n]==="`"){let i=1;for(;t[n+i]==="`";)i++;r===0?r=i:i===r&&(r=0),n+=i-1;continue}r===0&&t[n]==="@"&&(n===0||/\s/.test(t[n-1]))&&/[A-Za-z]/.test(t[n+1]??"")&&e.push(n)}return e}function $g(t){let r=t.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(/\r?\n/).map((o,a)=>a===0?o.trim():o.replace(/^\s*\*(?: |(?=\S)|$)/,"").replace(/\s+$/,"")),n=[{tag:null,lines:[]}],i=null;for(let o of r){let a=/^\s*(```+|~~~+)/.exec(o);if(a){let f=a[1];i===null?i=f[0].repeat(f.length):f.startsWith(i)&&(i=null)}let l=i===null&&!a?Hg(o):[];if(l.length===0){n[n.length-1].lines.push(o);continue}let c=o.slice(0,l[0]).replace(/\s+$/,"");c!==""&&n[n.length-1].lines.push(c),l.forEach((f,h)=>{let p=o.slice(f,l[h+1]??o.length).replace(/\s+$/,""),m=/^@([A-Za-z][\w-]*)\s*([\s\S]*)$/.exec(p);n.push({tag:m[1],lines:[m[2]]})})}let s={summary:Bu(n[0].lines),tags:[],parameters:new Map,typeParameters:new Map,returns:""};for(let o of n.slice(1)){let a=o.tag,l=Bu(o.lines);if(a==="param"||a==="template"||a==="typeParam"){let c=/^(?:\{[^}]*\}\s*)?\[?([\w$.]+)(?:=[^\]]*)?\]?\s*(?:-\s*)?([\s\S]*)$/.exec(l);if(c){let f=a==="param"?s.parameters:s.typeParameters;!c[1].includes(".")&&!f.has(c[1])&&f.set(c[1],c[2].trim())}}else a==="returns"||a==="return"?s.returns=l.replace(/^\{[^}]*\}\s*/,""):s.tags.push({tag:a,text:l})}return s}async function jg(){let t;try{t=await import("typescript")}catch(r){let n=r instanceof Error?r.message:String(r);throw new Error(`The "typescript" datasource needs the "typescript" package (${Fu}). Install it in your project (npm install -D typescript). Cause: ${n}`,{cause:r})}let e=t.default??t;if(typeof e.createProgram!="function")throw new Error(`The "typescript" datasource needs the TypeScript compiler API (${Fu}); the installed "typescript" package does not provide it.`);return e}function Nr(t){return t.split(Yn).join("/")}function Wg(t){let e=t.map(i=>Po(i).split(Yn)),r=e[0]??[],n=r.length;for(let i of e){let s=0;for(;s<n&&s<i.length&&i[s]===r[s];)s++;n=s}return r.slice(0,n).join(Yn)||Yn}var Do=/\{@link(?:code|plain)?\s+([^}|\s]+)(?:\s*\|\s*|\s+)?([^}]*)\}/g;function Vg(t){let e=new Map(t.map(r=>[r.name,r]));for(let r of t){let n=[],i=(l,c)=>{n.push(l,...c.map(f=>f.text))},s=l=>{i(l.summary,l.tags),n.push(...l.parameters.map(c=>c.description)),l.returns&&n.push(l.returns.description)};i(r.summary,r.tags),r.signatures.forEach(s);for(let l of r.members)i(l.summary,l.tags),l.signatures.forEach(s);let o=new Map,a=r.referenceOf?[r.referenceOf]:[];for(let l of n)for(let c of l.matchAll(Do))a.push(c[1]);for(let l of a){if(o.has(l))continue;let[c,...f]=l.split(/[.#]/),h=e.get(c??"");h&&o.set(l,{target:l,name:h.name,kind:h.kind,kindDir:h.kindDir,member:f.length>0?f.join("."):null})}r.links=[...o.values()]}}function zg(t,e){return t<e?-1:t>e?1:0}function Oo(t,e){let r=t.toLowerCase(),n=e.toLowerCase();return r!==n?r<n?-1:1:t<e?-1:t>e?1:0}var To=class{constructor(e,r,n,i){this.ts=e;this.program=r;this.checker=n;this.options=i;this.typeFlags=e.TypeFormatFlags.NoTruncation|e.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope}ts;program;checker;options;typeFlags;extract(e){let{ts:r,checker:n}=this,i=new Map;for(let a of e){let l=this.program.getSourceFile(a);if(!l)throw new Error(`TypeScript entry point not found in the program: ${a}`);let c=n.getSymbolAtLocation(l);if(c)for(let f of n.getExportsOfModule(c)){let h=f.flags&r.SymbolFlags.Alias?n.getAliasedSymbol(f):f,p=i.get(h)??[];p.some(m=>m.name===f.name)||p.push(f),i.set(h,p)}}let s=[];for(let[a,l]of i){let c=l.find(h=>h.name===a.name)??l[0],f=this.buildSymbol(c.name,a);if(f){s.push(f);for(let h of l){if(h===c)continue;let p=this.buildReference(h,f.symbol);p&&s.push(p)}}}s.sort((a,l)=>{if(this.options.sort==="source-order"){let c=zg(a.position[0],l.position[0]);if(c!==0)return c;if(a.position[1]!==l.position[1])return a.position[1]-l.position[1]}return Oo(a.symbol.name,l.symbol.name)});let o=s.map(a=>a.symbol);return Vg(o),o}buildReference(e,r){let n=e.declarations?.[0];if(!n)return null;let i=this.docOf(n);if(this.isHidden(i.tags))return null;let s=n.getSourceFile();return{symbol:{name:e.name,kind:"reference",kindLabel:Gn.reference.label,kindDir:Gn.reference.dir,category:null,summary:i.summary,tags:i.tags,code:null,typeParameters:[],extends:[],implements:[],signatures:[],members:[],source:this.sourceOf(n),referenceOf:r.name,links:[]},position:[Nr(Un(this.options.baseDir,s.fileName)),this.nameNode(n).getStart()]}}buildSymbol(e,r){let{ts:n}=this,i=(r.declarations??[]).filter(h=>!this.isExcludedFile(h)),s=this.primaryDeclaration(i);if(!s)return null;let o=this.kindOf(s);if(!o)return null;let a=this.docOf(s);if(this.isHidden(a.tags))return null;let l=a.tags.find(h=>h.tag==="category"),c={name:e,kind:o,kindLabel:Gn[o].label,kindDir:Gn[o].dir,category:l&&l.text.trim()||null,summary:a.summary,tags:a.tags,code:null,typeParameters:[],extends:[],implements:[],signatures:[],members:[],source:this.sourceOf(s),referenceOf:null,links:[]};if(n.isClassDeclaration(s))c.typeParameters=this.typeParameters(s.typeParameters,a),this.heritage(s,c),c.members=this.members(s.members,e);else if(n.isInterfaceDeclaration(s)){c.typeParameters=this.typeParameters(s.typeParameters,a);let h=i.filter(n.isInterfaceDeclaration);for(let p of h)this.heritage(p,c);c.members=h.flatMap(p=>this.members(p.members,e))}else if(n.isEnumDeclaration(s))c.members=i.filter(n.isEnumDeclaration).flatMap(h=>h.members.map(p=>this.enumMember(p))).filter(h=>h!==null);else if(n.isTypeAliasDeclaration(s)){c.typeParameters=this.typeParameters(s.typeParameters,a);let h=this.typeParameterList(s.typeParameters);c.code=`type ${e}${h} = ${s.type.getText()};`,n.isTypeLiteralNode(s.type)&&(c.members=this.members(s.type.members,e))}else if(o==="function")c.signatures=this.functionSignatures(e,r,s);else if(n.isVariableDeclaration(s)){let h=(n.getCombinedNodeFlags(s)&n.NodeFlags.Const)!==0,p=s.type?s.type.getText():this.checker.typeToString(this.checker.getTypeAtLocation(s.name),void 0,this.typeFlags);c.code=`${h?"const":"let"} ${e}: ${p};`,c.members=this.variableMembers(s)}let f=s.getSourceFile();return{symbol:c,position:[Nr(Un(this.options.baseDir,f.fileName)),this.nameNode(s).getStart()]}}isExcludedFile(e){if(!this.options.excludeExternals)return!1;let r=e.getSourceFile();return this.program.isSourceFileFromExternalLibrary(r)||this.program.isSourceFileDefaultLibrary(r)||Nr(r.fileName).includes("/node_modules/")}primaryDeclaration(e){let{ts:r}=this,n=[r.isClassDeclaration,r.isInterfaceDeclaration,r.isEnumDeclaration,r.isTypeAliasDeclaration,r.isFunctionDeclaration,r.isVariableDeclaration,r.isModuleDeclaration];for(let i of n){let s=e.find(i);if(s)return s}}kindOf(e){let{ts:r}=this;if(r.isClassDeclaration(e))return"class";if(r.isInterfaceDeclaration(e))return"interface";if(r.isEnumDeclaration(e))return"enum";if(r.isTypeAliasDeclaration(e))return"type";if(r.isFunctionDeclaration(e))return"function";if(r.isModuleDeclaration(e))return"namespace";if(r.isVariableDeclaration(e)){let n=e.initializer;return n!==void 0&&(r.isArrowFunction(n)||r.isFunctionExpression(n))&&!e.type?"function":"variable"}return null}nameNode(e){return e.name??e}sourceOf(e){let r=e.getSourceFile(),n=r.getLineAndCharacterOfPosition(this.nameNode(e).getStart()).line+1,i=Nr(Un(this.options.baseDir,r.fileName)),s=Nr(Un(this.options.displayDir,r.fileName)),o=null,a=this.options.sourceLinkTemplate;return a&&(o=a.replace(/\{gitRevision\}/g,this.options.gitRevision??"").replace(/\{path\}/g,i).replace(/\{line\}/g,String(n))),{file:s,path:i,line:n,url:o}}docOf(e){let{ts:r}=this,n=r.getJSDocCommentsAndTags(e).filter(r.isJSDoc),i=n[n.length-1];return i?$g(i.getSourceFile().text.slice(i.pos,i.end)):qg}isHidden(e){return e.some(r=>Bg.has(r.tag)||this.options.excludeInternal&&r.tag==="internal")}typeText(e,r){return e?e.getText():this.checker.typeToString(r(),void 0,this.typeFlags)}typeParameterList(e){return!e||e.length===0?"":`<${e.map(r=>r.getText()).join(", ")}>`}typeParameters(e,r){return e?e.map(n=>({name:n.name.text,constraint:n.constraint?n.constraint.getText():null,default:n.default?n.default.getText():null,description:r.typeParameters.get(n.name.text)??""})):[]}heritage(e,r){let{ts:n}=this;for(let i of e.heritageClauses??[]){let s=i.types.map(o=>o.getText());i.token===n.SyntaxKind.ExtendsKeyword?r.extends.push(...s):r.implements.push(...s)}}parameters(e,r){let{ts:n}=this;return e.filter(i=>!(n.isIdentifier(i.name)&&i.name.text==="this")).map(i=>({name:i.name.getText(),type:this.typeText(i.type,()=>this.checker.getTypeAtLocation(i)),optional:i.questionToken!==void 0||i.initializer!==void 0,rest:i.dotDotDotToken!==void 0,defaultValue:i.initializer?i.initializer.getText():null,description:n.isIdentifier(i.name)?r.parameters.get(i.name.text)??"":""}))}parameterCode(e){return e.map(r=>`${r.rest?"...":""}${r.name}${r.optional&&!r.rest?"?":""}: ${r.type}`).join(", ")}returnsOf(e,r,n){return{type:e.type?e.type.getText():r?this.checker.typeToString(this.checker.getReturnTypeOfSignature(r),void 0,this.typeFlags):"void",description:n.returns}}signature(e,r,n,i="",s=e){let o=this.docOf(s),a=this.parameters(e.parameters,o),l=this.typeParameters(e.typeParameters,o),c=this.checker.getSignatureFromDeclaration(e),f=null,h="";n==="construct"?h=`: ${i}`:n!=="set"&&(f=this.returnsOf(e,c,o),h=`: ${f.type}`);let p=this.typeParameterList(e.typeParameters);return{code:`${r}${p}(${this.parameterCode(a)})${h};`,summary:o.summary,tags:o.tags,typeParameters:l,parameters:a,returns:f,source:this.sourceOf(s)}}publicOverloads(e){let r=e.filter(n=>!("body"in n)||n.body===void 0);return r.length>0?r:e}functionSignatures(e,r,n){let{ts:i}=this;if(i.isVariableDeclaration(n)){let o=n.initializer;return o&&(i.isArrowFunction(o)||i.isFunctionExpression(o))?[this.signature(o,`function ${e}`,"call","",n)]:[]}let s=(r.declarations??[]).filter(i.isFunctionDeclaration);return this.publicOverloads(s).map(o=>this.signature(o,`function ${e}`,"call"))}modifiers(e){let{ts:r}=this,n=r.canHaveModifiers(e)?r.getModifiers(e)??[]:[];return new Set(n.map(i=>i.kind))}isPrivate(e,r){let n=e.name;return r.has(this.ts.SyntaxKind.PrivateKeyword)||n!==void 0&&this.ts.isPrivateIdentifier(n)}members(e,r){let{ts:n}=this,i=new Map,s=[];for(let a of e){if(n.isClassStaticBlockDeclaration(a)||n.isSemicolonClassElement(a))continue;let l=this.modifiers(a);if(this.options.excludePrivate&&this.isPrivate(a,l))continue;let c;if(n.isConstructorDeclaration(a)||n.isConstructSignatureDeclaration(a))c="constructor";else if(n.isCallSignatureDeclaration(a))c="()";else if(n.isIndexSignatureDeclaration(a))c=`[${a.parameters.map(f=>f.getText()).join(", ")}]`;else{let f=a.name?a.name.getText():"";c=`${l.has(n.SyntaxKind.StaticKeyword)?"static ":""}${f}`}i.has(c)||(i.set(c,[]),s.push(c)),i.get(c).push(a)}let o=[];for(let a of s){let l=this.member(i.get(a),r);l&&o.push(l),a==="constructor"&&o.push(...this.parameterProperties(i.get(a)))}return this.options.sort==="alphabetical"&&o.sort((a,l)=>Oo(a.name,l.name)),o}member(e,r){let{ts:n}=this,i=e[0],s=this.docOf(i);if(this.isHidden(s.tags))return null;let o=this.modifiers(i),a=o.has(n.SyntaxKind.StaticKeyword),l=o.has(n.SyntaxKind.AbstractKeyword),c=`${a?"static ":""}${l?"abstract ":""}`,f={static:a,readonly:o.has(n.SyntaxKind.ReadonlyKeyword),optional:i.questionToken!==void 0,protected:o.has(n.SyntaxKind.ProtectedKeyword),abstract:l,summary:s.summary,tags:s.tags,source:this.sourceOf(i)};if(n.isConstructorDeclaration(i)||n.isConstructSignatureDeclaration(i)){let p=this.publicOverloads(e),m=`${r}${this.ownerTypeArguments(i)}`;return{...f,name:"constructor",kind:"constructor",type:null,signatures:p.map(g=>this.signature(g,`new ${r}`,"construct",m))}}if(n.isCallSignatureDeclaration(i))return{...f,name:"()",kind:"call-signature",type:null,signatures:e.map(p=>this.signature(p,"","call"))};if(n.isIndexSignatureDeclaration(i)){let p=i.parameters.map(m=>m.getText()).join(", ");return{...f,name:`[${p}]`,kind:"index-signature",type:this.typeText(i.type,()=>this.checker.getTypeAtLocation(i)),signatures:[]}}let h=i.name?i.name.getText():"";if(n.isMethodDeclaration(i)||n.isMethodSignature(i)){let p=this.publicOverloads(e);return{...f,name:h,kind:"method",type:null,signatures:p.map(m=>this.signature(m,`${c}${h}`,"call"))}}if(n.isGetAccessorDeclaration(i)||n.isSetAccessorDeclaration(i)){let p=e.filter(n.isGetAccessorDeclaration),m=e.filter(n.isSetAccessorDeclaration);return{...f,name:h,kind:"accessor",type:null,signatures:[...p.map(g=>this.signature(g,`${c}get ${h}`,"get")),...m.map(g=>this.signature(g,`${c}set ${h}`,"set"))]}}return n.isPropertyDeclaration(i)||n.isPropertySignature(i)?{...f,name:h,kind:"property",type:this.typeText(i.type,()=>this.checker.getTypeAtLocation(i.name)),signatures:[]}:null}variableMembers(e){let{ts:r,checker:n}=this,i=n.getTypeAtLocation(e.name),s=i.isIntersection()?i.types:[i],o=[];for(let a of s){let l=a.getSymbol();if(!(!l||!(l.flags&(r.SymbolFlags.ObjectLiteral|r.SymbolFlags.TypeLiteral))))for(let c of n.getPropertiesOfType(a)){let f=c.valueDeclaration??c.declarations?.[0];if(!f)continue;let h=this.docOf(f);this.isHidden(h.tags)||o.push({name:c.name,kind:"property",static:!1,readonly:!1,optional:(c.flags&r.SymbolFlags.Optional)!==0,protected:!1,abstract:!1,type:n.typeToString(n.getTypeOfSymbolAtLocation(c,e),void 0,this.typeFlags),summary:h.summary,tags:h.tags,signatures:[],source:this.sourceOf(f)})}}return this.options.sort==="alphabetical"&&o.sort((a,l)=>Oo(a.name,l.name)),o}parameterProperties(e){let{ts:r}=this,n=[];for(let i of e){if(!r.isConstructorDeclaration(i))continue;let s=this.docOf(i);for(let o of i.parameters){if(!r.isParameterPropertyDeclaration(o,i)||!r.isIdentifier(o.name))continue;let a=this.modifiers(o);this.options.excludePrivate&&a.has(r.SyntaxKind.PrivateKeyword)||n.push({name:o.name.text,kind:"property",static:!1,readonly:a.has(r.SyntaxKind.ReadonlyKeyword),optional:o.questionToken!==void 0||o.initializer!==void 0,protected:a.has(r.SyntaxKind.ProtectedKeyword),abstract:!1,type:this.typeText(o.type,()=>this.checker.getTypeAtLocation(o)),summary:s.parameters.get(o.name.text)??"",tags:[],signatures:[],source:this.sourceOf(o)})}}return n}ownerTypeArguments(e){let r=e.parent;return this.ts.isClassDeclaration(r)&&r.typeParameters&&r.typeParameters.length>0?`<${r.typeParameters.map(n=>n.name.text).join(", ")}>`:""}enumMember(e){let r=this.docOf(e);if(this.isHidden(r.tags))return null;let n=this.checker.getConstantValue(e);return{name:e.name.getText(),kind:"enum-member",static:!1,readonly:!0,optional:!1,protected:!1,abstract:!1,type:n===void 0?e.initializer?.getText()??null:JSON.stringify(n),summary:r.summary,tags:r.tags,signatures:[],source:this.sourceOf(e)}}},Kn=class{type="typescript";data=null;config;constructor(e){let r=e.entry_points;if(!Array.isArray(r)||r.length===0||!r.every(s=>typeof s=="string"))throw new Error('TypeScript datasource requires "entry_points" (a list of file paths)');let n=e.source_link_template;if(n!==void 0&&typeof n!="string")throw new Error('TypeScript datasource "source_link_template" must be a string');if(typeof n=="string"&&n.includes("{gitRevision}")&&typeof e.git_revision!="string")throw new Error('TypeScript datasource "source_link_template" uses {gitRevision}; set "git_revision" (e.g. main)');let i=e.sort;if(i!==void 0&&i!=="source-order"&&i!=="alphabetical")throw new Error('TypeScript datasource "sort" must be "source-order" or "alphabetical"');for(let s of["exclude_internal","exclude_private","exclude_externals"])if(e[s]!==void 0&&typeof e[s]!="boolean")throw new Error(`TypeScript datasource "${s}" must be true or false`);this.config=e}async loadData(){if(this.data!==null)return this.data;let e=await jg(),r=process.cwd(),n=this.config.entry_points.map(l=>Mu(r,l)),i=this.config.tsconfig?Mu(r,this.config.tsconfig):e.findConfigFile(Po(n[0]),e.sys.fileExists),s={};if(i){let l=e.readConfigFile(i,e.sys.readFile);if(l.error)throw new Error(`Cannot read ${i}: ${e.flattenDiagnosticMessageText(l.error.messageText,`
|
|
864
|
+
`)}`);s=e.parseJsonConfigFileContent(l.config,e.sys,Po(i)).options}s={...s,noEmit:!0};let o=e.createProgram({rootNames:n,options:s}),a=new To(e,o,o.getTypeChecker(),{excludeInternal:this.config.exclude_internal??!0,excludePrivate:this.config.exclude_private??!0,excludeExternals:this.config.exclude_externals??!0,sourceLinkTemplate:this.config.source_link_template??null,gitRevision:this.config.git_revision??null,sort:this.config.sort??"source-order",baseDir:r,displayDir:Wg(n)});return this.data=a.extract(n),this.data}async query(e,r=[]){return Xe(await this.loadData(),e,r)}async getAll(){return this.loadData()}async close(){this.data=null}};function Io(t){return new Kn(t)}async function Ug(t,e){if(e&&t.type in e)return e[t.type].create(t);switch(t.type){case"sqlite":return Ws(t);case"csv":return Us(t);case"json":return Gs(t);case"yaml":return Ys(t);case"glob":return Ao(t);case"typescript":return Io(t);default:throw new Error(`Unknown datasource type: "${t.type}". Register custom types in datasources_dir.`)}}async function Mr(t,e){let r={};if(t.datasources)for(let[n,i]of Object.entries(t.datasources))r[n]=await Ug(i,e);return r}async function Fr(t){for(let e of Object.values(t))await e.close()}import{readFile as Xg,writeFile as ey}from"node:fs/promises";import{resolve as Zu}from"node:path";var Gg={html:{start:"<!--",end:"-->"},block:{start:"/*",end:"*/"},line:{start:"//",end:""},hash:{start:"#",end:""},sql:{start:"--",end:""}};function Hu(t){let e={},r=/(\w+)=["']([^"']*)["']/g,n;for(;(n=r.exec(t))!==null;){let i=n[1],s=n[2];i&&s!==void 0&&(e[i]=s)}return e}function Qn(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!e)return{data:{},content:t,raw:""};let r=e[1]??"",n=Ze.load(r),i=n&&typeof n=="object"&&!Array.isArray(n)?n:{},s=t.slice(e[0].length).replace(/^\n+/,""),o=`---
|
|
865
865
|
${r.trim()}
|
|
866
866
|
---
|
|
867
|
-
`;return{data:
|
|
868
|
-
`).length}function
|
|
869
|
-
`)},
|
|
867
|
+
`;return{data:i,content:s,raw:o}}function Zn(t){let e=t.split(".").pop()?.toLowerCase()??"";return e==="md"||e==="markdown"||e==="mdx"}function $u(t){let e=[],r=null,n=0;for(let i of t.split(`
|
|
868
|
+
`)){let s=n+i.length+1,o=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(i.replace(/\r$/,""));if(o){let a=o[1];r===null?a[0]==="`"&&o[2].includes("`")||(r={char:a[0],length:a.length,start:n}):a[0]===r.char&&a.length>=r.length&&o[2].trim()===""&&(e.push([r.start,Math.min(s,t.length)]),r=null)}n=s}return r!==null&&e.push([r.start,t.length]),e}function ju(t){return e=>t.some(([r,n])=>e>=r&&e<n)}function Wu(t,e,r,n){let i=new RegExp(t.source,t.flags.includes("g")?t.flags:t.flags+"g");i.lastIndex=r;let s;for(;(s=i.exec(e))!==null;){if(!n(s.index))return s;s[0].length===0&&i.lastIndex++}return null}function Xn(t,e,r={}){let n=[],{start:i,end:s}=e,o=ju(r.markdown?$u(t):[]),a=Jn(i),l=s?Jn(s):"",c;s?c=new RegExp(`${a}\\s*@embedoc:(?!end\\b)(\\w+)\\s*([^]*?)\\s*${l}`,"g"):c=new RegExp(`${a}\\s*@embedoc:(?!end\\b)(\\w+)\\s*(.*)$`,"gm");let f;s?f=new RegExp(`${a}\\s*@embedoc:end\\s*${l}`):f=new RegExp(`${a}\\s*@embedoc:end\\s*$`,"m");let h;for(;(h=c.exec(t))!==null;){let p=h.index;if(o(p))continue;let m=h[0],g=h[1],_=h[2]?.trim()??"",O=p+m.length,b=t.slice(O),x=Wu(f,t,O,o),I=x&&{index:x.index-O,0:x[0]};if(I){let N=/(?:^|\n)([ \t]+)$/.exec(b.slice(0,I.index))?.[1]??"",V=I.index-N.length,B=N+I[0],Q=O+V+B.length,ee=b.slice(0,V);g&&n.push({startIndex:p,endIndex:Q,templateName:g,params:Hu(_),existingContent:ee,startMarkerLine:m,endMarkerLine:B})}}return n}function ei(t,e){let n={...Gg,...e}[t];if(!n)throw new Error(`Unknown comment style: ${t}`);return n}function qu(t,e){return t.slice(0,e).split(`
|
|
869
|
+
`).length}function Vu(t,e,r={}){let n=[],{start:i,end:s}=e,o=ju(r.markdown?$u(t):[]),a=Jn(i),l=s?Jn(s):"",c,f;s?(c=new RegExp(`${a}\\s*@embedoc-data:(?!end\\s*${l})([\\w.]+)(?:\\s+([^\\n]*?))?\\s*${l}`,"g"),f=new RegExp(`${a}\\s*@embedoc-data:end\\s*${l}`)):(c=new RegExp(`${a}\\s*@embedoc-data:(?!end\\s*$)([\\w.]+)(?:\\s+(.*))?$`,"gm"),f=new RegExp(`${a}\\s*@embedoc-data:end\\s*$`,"m"));let h;for(;(h=c.exec(t))!==null;){let p=h.index;if(o(p))continue;let m=h[0],g=h[1],_=h[2]?.trim()??"";if(!g||g==="end")continue;let b=Hu(_).format??"yaml",x=p+m.length,I=t.slice(x),L=Wu(f,t,x,o),N=L&&{index:L.index-x,0:L[0]};if(N){let V=I.slice(0,N.index),B=qu(t,p),Q=qu(t,x+N.index+N[0].length);n.push({name:g,format:b,content:V,startLine:B,endLine:Q,byteSize:Buffer.byteLength(V,"utf-8")})}}return n}function Jn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zu(t){return t==null?"":String(t).replace(/\|/g,"\\|").replace(/\n/g,"<br>")}function Uu(){return{table(t,e){if(t.length===0)return"";let r=[],n="| "+t.map(zu).join(" | ")+" |";r.push(n);let i="| "+t.map(()=>"---").join(" | ")+" |";r.push(i);for(let s of e){let a="| "+t.map((l,c)=>zu(s[c])).join(" | ")+" |";r.push(a)}return r.join(`
|
|
870
|
+
`)},list(t,e=!1){return t.map((r,n)=>`${e?`${n+1}.`:"-"} ${r}`).join(`
|
|
870
871
|
`)},codeBlock(t,e=""){return"```"+e+`
|
|
871
|
-
`+t+"\n```"},link(t,e){return`[${t}](${e})`},heading(t,e=1){return`${"#".repeat(Math.min(Math.max(e,1),6))} ${t}`},bold(t){return`**${t}**`},italic(t){return`*${t}*`},checkbox(t){return t?"\u2714":""}}}import
|
|
872
|
-
`).filter(s=>s.trim().length>0);if(e.length===0)return[];let r=e[0];if(!r)return[];let
|
|
873
|
-
`).map(s=>s.trim()).filter(s=>s.length>0&&!s.match(/^\|[-:| ]+\|$/));if(e.length===0)return[];let r=e[0];if(!r)return[];let
|
|
874
|
-
`).length-1:0,g=
|
|
875
|
-
`+
|
|
876
|
-
`+B.endMarkerLine;
|
|
877
|
-
`):
|
|
878
|
-
`)}function Ht(t,e){return t.filter(r=>r.tag===e)}function
|
|
879
|
-
`);l.trim()!==""&&!l.trimStart().startsWith("```")&&c.some(f=>f.trimStart().startsWith("```"))?
|
|
880
|
-
`).trim()):
|
|
881
|
-
`)),
|
|
882
|
-
|
|
883
|
-
`)))}function
|
|
872
|
+
`+t+"\n```"},link(t,e){return`[${t}](${e})`},heading(t,e=1){return`${"#".repeat(Math.min(Math.max(e,1),6))} ${t}`},bold(t){return`**${t}**`},italic(t){return`*${t}*`},checkbox(t){return t?"\u2714":""}}}import Gu from"node:path";var Lo=["^```\\w*\\s*\\n?","\\n?```\\s*$"],Yg={enabled:!0,maxBytes:10240,allowedFormats:["yaml","json","js","csv","table","text"],conflictPolicy:"warn",allowAnonymous:!1,stripCodeFences:!0,stripPatterns:Lo};function Ku(t){return t.replace(/\[(\d+)\]/g,".$1").split(".").filter(e=>e.length>0).map(e=>/^\d+$/.test(e)?parseInt(e,10):e)}function No(t,e){let r=Ku(e),n=t;for(let i of r){if(n==null)return;n=n[i]}return n}function Ju(t,e,r){let n=Ku(e);if(n.length===0)return;let i=t;for(let o=0;o<n.length-1;o++){let a=n[o],l=n[o+1];if(typeof a=="number")throw new Error(`Array index in middle of path not supported: ${e}`);a in i||(i[a]=typeof l=="number"?[]:{}),i=i[a]}let s=n[n.length-1];i[s]=r}function Kg(t){let e=t.indexOf(".");return e===-1?t:t.slice(0,e)}function Jg(t,e){let r=t.trim();for(let n of e){let i=new RegExp(n);r=r.replace(i,"")}return r.trim()}function Yu(t,e,r={},n){let{stripCodeFences:i=!0,stripPatterns:s}=r,o=t;i&&(o=Jg(o,s??Lo));let a=o.trim();switch(e){case"yaml":return Ze.load(a,{schema:Ze.JSON_SCHEMA})??{};case"json":return a?JSON.parse(a):{};case"js":case"javascript":return a?new Function("return ("+a+")")():{};case"csv":return Qg(a);case"table":return Zg(a);case"text":return a;default:{let l=n?.[e];return l?l(a):a}}}function Qg(t){let e=t.split(`
|
|
873
|
+
`).filter(s=>s.trim().length>0);if(e.length===0)return[];let r=e[0];if(!r)return[];let n=r.split(",").map(s=>s.trim()),i=[];for(let s=1;s<e.length;s++){let o=e[s];if(!o)continue;let a=o.split(",").map(c=>c.trim()),l={};n.forEach((c,f)=>{l[c]=a[f]??""}),i.push(l)}return i}function Zg(t){let e=t.split(`
|
|
874
|
+
`).map(s=>s.trim()).filter(s=>s.length>0&&!s.match(/^\|[-:| ]+\|$/));if(e.length===0)return[];let r=e[0];if(!r)return[];let n=r.split("|").map(s=>s.trim()).filter(s=>s.length>0),i=[];for(let s=1;s<e.length;s++){let o=e[s];if(!o)continue;let a=o.split("|").map(f=>f.trim()),l=o.startsWith("|")?a.slice(1,-1):a,c={};n.forEach((f,h)=>{c[f]=l[h]??""}),i.push(c)}return i}var Ro=class{type="inline";format;documentPath;startLine;endLine;byteSize;data;_isObject;_locations;constructor(e,r,n,i,s,o,a=[]){this.data=e,this.format=r,this.documentPath=n,this.startLine=i,this.endLine=s,this.byteSize=o,this._isObject=!Array.isArray(e)&&typeof e=="object"&&e!==null,this._locations=[...a].sort((l,c)=>l.propertyPath===""?-1:c.propertyPath===""?1:l.propertyPath.localeCompare(c.propertyPath))}async query(e,r){return Array.isArray(this.data)?this.data:[this.data]}async getAll(){return Array.isArray(this.data)?this.data:[this.data]}getRawData(){return this.data}async get(e){return No(this.data,e)}isObjectType(){return this._isObject}async close(){}merge(e,r){if(!this._isObject)throw new Error("Cannot merge into array datasource");Ju(this.data,e,r)}getMeta(e="",r){let n=this._locations.find(i=>i.propertyPath===e);return n?this._buildLocation(n,r):null}getAllMeta(e){return this._locations.map(r=>this._buildLocation(r,e))}get locations(){return this._locations}_buildLocation(e,r){let n=this.documentPath;if(r){let i=Gu.dirname(r);n=Gu.relative(i,this.documentPath),n=n.replace(/\\/g,"/"),!n.startsWith(".")&&!n.startsWith("/")&&(n="./"+n)}return{propertyPath:e.propertyPath,absolutePath:this.documentPath,relativePath:n,startLine:e.startLine,endLine:e.endLine,contentStartLine:e.startLine+1,contentEndLine:e.endLine-1,format:e.format}}};function Qu(t,e,r={},n){let i={...Yg,...r},s=new Map,o={stripCodeFences:i.stripCodeFences,stripPatterns:r.stripPatterns??Lo},a=new Map;for(let l of t){if(l.byteSize>i.maxBytes)throw new Error(`Inline datasource "${l.name}" exceeds max size (${l.byteSize} > ${i.maxBytes} bytes)`);if(!(n!=null&&l.format in n)&&!i.allowedFormats.includes(l.format))throw new Error(`Inline datasource "${l.name}" uses disallowed format "${l.format}"`);let f=Kg(l.name);a.has(f)||a.set(f,[]),a.get(f).push(l)}for(let[l,c]of a){let f=c.find(b=>b.name===l),h,p="yaml",m=0,g=0,_=0,O=[];f?(h=Yu(f.content,f.format,o,n),p=f.format,m=f.startLine,g=f.endLine,_=f.byteSize,O.push({propertyPath:"",startLine:f.startLine,endLine:f.endLine,format:f.format})):h={};for(let b of c)if(b.name!==l&&b.name.startsWith(l+".")){let x=b.name.slice(l.length+1),I=Yu(b.content,b.format,o,n);(typeof h!="object"||h===null)&&(h={}),Ju(h,x,I),O.push({propertyPath:x,startLine:b.startLine,endLine:b.endLine,format:b.format}),(m===0||b.startLine<m)&&(m=b.startLine),b.endLine>g&&(g=b.endLine),_+=b.byteSize}s.set(l,new Ro(h,p,e,m,g,_,O))}return s}function ty(t,e,r){let n={};for(let[i,s]of Object.entries(t))n[i]=s.replace(/\$\{(\w+(?:\.\w+|\[\d+\])*)\}/g,(o,a)=>{let l=a.split("."),c=l[0];if(!c)return"";let f=r.get(c);if(f){let p=l.slice(1).join(".");if(p){let g=No(f.data,p);return g!=null?String(g):""}let m=f.data;return m!=null?String(m):""}let h=e;for(let p of l){if(h==null)return"";if(typeof h=="object")h=h[p];else return""}return h!=null?String(h):""});return n}async function ry(t,e,r,n,i,s,o=!1,a){let l={filePath:t,success:!0,markersUpdated:0,changed:!1};try{let c=ei(r.comment_style,s.comment_styles),{data:f,content:h,raw:p}=Qn(e),m=p?p.split(`
|
|
875
|
+
`).length-1:0,g={markdown:Zn(t)},_=Vu(h,c,g);for(let B of _)B.startLine+=m,B.endLine+=m;let O=Qu(_,t,s.inline_datasource,a),b={...i};for(let[B,Q]of O){if(B in b){let ee=s.inline_datasource?.conflictPolicy??"warn";if(ee==="error")throw new Error(`Inline datasource "${B}" conflicts with external datasource (conflict_policy: error)`);if(ee==="prefer_external")continue;console.warn(`Warning: Inline datasource "${B}" overrides external datasource in ${t}`)}b[B]=Q}let x=Xn(h,c,g);if(x.length===0&&_.length===0)return l;let I=Uu(),L=h,N=[...x].sort((B,Q)=>Q.startIndex-B.startIndex);for(let B of N){let Q=n[B.templateName];if(!Q){console.warn(`Warning: Unknown embed "${B.templateName}" in ${t}`);continue}let oe={params:ty(B.params,f,O),frontmatter:f,datasources:b,markdown:I,filePath:t,existingContent:B.existingContent},ae=await Q.render(oe);if(ae.content===null||ae.content===void 0)continue;let xe=B.params.inline==="true"?B.startMarkerLine+ae.content+B.endMarkerLine:B.startMarkerLine+`
|
|
876
|
+
`+ae.content+`
|
|
877
|
+
`+B.endMarkerLine;L=L.slice(0,B.startIndex)+xe+L.slice(B.endIndex),l.markersUpdated++}let V=p+L;if(V!==e&&(l.changed=!0,!o)){let Q=(s.output?.line_ending??"lf")==="crlf"?V.replace(/\n/g,`\r
|
|
878
|
+
`):V;await ey(t,Q,{encoding:s.output?.encoding??"utf-8"})}for(let B of O.values())await B.close()}catch(c){l.success=!1,l.error=c instanceof Error?c:new Error(String(c))}return l}async function Br(t){return await Yt(t.pattern,{ignore:t.exclude??[],nodir:!0})}async function Mo(t,e,r,n={}){let i=Date.now(),s=[],o=n.specificFiles&&n.specificFiles.length>0?new Set(n.specificFiles.map(l=>Zu(l))):null;for(let l of t.targets){let c=await Br(l);o&&(c=c.filter(f=>o.has(Zu(f))));for(let f of c){n.verbose&&console.log(`Processing: ${f}`);try{let h=await Xg(f,{encoding:"utf-8"}),p=await ry(f,h,l,e,r,t,n.dryRun,n.customInlineFormats);s.push(p),n.verbose&&p.markersUpdated>0&&console.log(` Updated ${p.markersUpdated} marker(s)${p.changed?" (changed)":" (no changes)"}`)}catch(h){s.push({filePath:f,success:!1,markersUpdated:0,changed:!1,error:h instanceof Error?h:new Error(String(h))}),n.verbose&&console.error(` Error: ${h}`)}}}let a=Date.now()-i;return{totalFiles:s.length,successFiles:s.filter(l=>l.success).length,failedFiles:s.filter(l=>!l.success).length,totalMarkersUpdated:s.reduce((l,c)=>l+c.markersUpdated,0),results:s,duration:a}}var ye=Vi(Gf(),1);import{readFile as hw,writeFile as fw,mkdir as dw,access as pw}from"node:fs/promises";import{dirname as mw,join as gw}from"node:path";var Yf=[{kind:"namespace",title:"Namespaces"},{kind:"enum",title:"Enumerations"},{kind:"class",title:"Classes"},{kind:"interface",title:"Interfaces"},{kind:"type",title:"Type Aliases"},{kind:"variable",title:"Variables"},{kind:"function",title:"Functions"},{kind:"reference",title:"References"}],tw=[{kind:"constructor",title:"Constructors"},{kind:"call-signature",title:"Call Signature"},{kind:"index-signature",title:"Indexable"},{kind:"property",title:"Properties"},{kind:"accessor",title:"Accessors"},{kind:"method",title:"Methods"},{kind:"enum-member",title:"Enumeration Members"}];var rw=new Set(["example","deprecated","see","remarks","default","defaultValue","internal","category"]);function nw(t){if(typeof t.name!="string"||typeof t.kind!="string"||typeof t.kindDir!="string"||!Array.isArray(t.members))throw new Error('Expected a record of the "typescript" datasource (ApiSymbol)');return t}function Ia(t){return t.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu,"").replace(/\s/g,"-")}function Le(t,e){return`${"#".repeat(Math.min(Math.max(t,1),6))} ${e}`}function Yr(t){return t.replace(/([\\`*_<>[\]|])/g,"\\$1")}function Ne(t){let e=t.replace(/\s+/g," ").trim(),r=e.includes("`")?"``":"`",n=r==="``"?" ":"";return`${r}${n}${e}${n}${r}`}function Ra(t){return t.replace(/\r?\n\s*\r?\n/g,"<br><br>").replace(/\s*\r?\n\s*/g," ").replace(/\|/g,"\\|").trim()}function Kf(t,e,r,n,i){if(t.ownFileKinds.has(r)){let o=`${n}/${e}.md`,a=t.onOwnPage?`../${o}`:o;return i?`${a}#${Ia(i)}`:a}let s=`#${Ia(e)}`;return t.onOwnPage?`../${t.indexFile}${s}`:s}function pt(t,e){return e.replace(Do,(r,n,i)=>{let s=i.trim()||n,o=t.symbol.links.find(a=>a.target===n);return o?`[${Ne(s)}](${Kf(t,o.name,o.kind,o.kindDir,o.member)})`:Ne(s)})}function Jf(t){let e=`${t.file}:${t.line}`;return t.url?`Defined in: [${e}](${t.url})`:`Defined in: ${e}`}function Qf(t){return["```ts",t,"```"].join(`
|
|
879
|
+
`)}function Ht(t,e){return t.filter(r=>r.tag===e)}function qi(t,e,r,n){let i=[];for(let a of Ht(r,"deprecated"))i.push(`> **Deprecated**${a.text?` ${pt(t,a.text)}`:""}`);e&&i.push(pt(t,e));for(let a of Ht(r,"remarks"))i.push(Le(n,"Remarks"),pt(t,a.text));for(let a of r){if(rw.has(a.tag))continue;let l=a.tag.charAt(0).toUpperCase()+a.tag.slice(1);i.push(Le(n,l)),a.text&&i.push(pt(t,a.text))}let s=Ht(r,"example");if(s.length>0){i.push(Le(n,s.length>1?"Examples":"Example"));for(let a of s){let[l="",...c]=a.text.split(`
|
|
880
|
+
`);l.trim()!==""&&!l.trimStart().startsWith("```")&&c.some(f=>f.trimStart().startsWith("```"))?i.push(Le(n+1,Yr(l.trim())),c.join(`
|
|
881
|
+
`).trim()):i.push(a.text)}}let o=Ht(r,"see");return o.length>0&&i.push(Le(n,"See"),o.map(a=>`- ${pt(t,a.text)}`).join(`
|
|
882
|
+
`)),i}function iw(t,e,r){let n=[];for(let i of Ht(r,"deprecated"))n.push(`**Deprecated**${i.text?` ${i.text}`:""}`);e&&n.push(e);for(let i of[...Ht(r,"default"),...Ht(r,"defaultValue")])n.push(`**Default** ${Ne(i.text)}`);return Ra(pt(t,n.join(`
|
|
883
|
+
|
|
884
|
+
`)))}function Zf(t,e,r){if(e.length===0)return[];let n=e.some(o=>o.description),i=e.map(o=>{let a=o.name;o.constraint&&(a+=` extends ${o.constraint}`),o.default&&(a+=` = ${o.default}`);let l=[Ne(a)];return n&&l.push(Ra(pt(t,o.description))),`| ${l.join(" | ")} |`}),s=n?`| Type Parameter | Description |
|
|
884
885
|
| ------ | ------ |`:`| Type Parameter |
|
|
885
|
-
| ------ |`;return[Le(r,"Type Parameters"),[s,...
|
|
886
|
-
`)]}function
|
|
886
|
+
| ------ |`;return[Le(r,"Type Parameters"),[s,...i].join(`
|
|
887
|
+
`)]}function Xf(t,e,r){let n=[Qf(e.code),Jf(e.source)];if(n.push(...qi(t,e.summary,e.tags,r)),n.push(...Zf(t,e.typeParameters,r)),e.parameters.length>0){let i=e.parameters.some(a=>a.description),s=i?`| Parameter | Type | Description |
|
|
887
888
|
| ------ | ------ | ------ |`:`| Parameter | Type |
|
|
888
|
-
| ------ | ------ |`,o=e.parameters.map(a=>{let l=`${a.rest?"...":""}${a.name}${a.optional&&!a.rest?"?":""}`,c=[Ne(l),Ne(a.type)];if(
|
|
889
|
-
`))}return e.returns&&(
|
|
890
|
-
| ------ | ------ | ------ | ------ |`:`| ${
|
|
891
|
-
| ------ | ------ | ------ | ------ |`,l=s.map(c=>{let f=[c.static?"static":"",c.readonly&&!o?"readonly":"",c.protected?"protected":""].filter(Boolean).join(" "),h=`<a id="${
|
|
892
|
-
`));continue}s.forEach((o,a)=>{a>0&&
|
|
893
|
-
`)),r.implements.length>0&&
|
|
894
|
-
`)),r.kind!=="function"&&
|
|
889
|
+
| ------ | ------ |`,o=e.parameters.map(a=>{let l=`${a.rest?"...":""}${a.name}${a.optional&&!a.rest?"?":""}`,c=[Ne(l),Ne(a.type)];if(i){let f=pt(t,a.description);a.defaultValue!==null&&(f+=`${f?" ":""}**Default** ${Ne(a.defaultValue)}`),c.push(Ra(f))}return`| ${c.join(" | ")} |`});n.push(Le(r,"Parameters"),[s,...o].join(`
|
|
890
|
+
`))}return e.returns&&(n.push(Le(r,"Returns"),Ne(e.returns.type)),e.returns.description&&n.push(pt(t,e.returns.description))),n}function sw(t){let e=t.kind==="method"?`${t.name}()`:t.name;return Yr(e)}function ow(t,e,r){let n=[];for(let i of tw){let s=e.filter(o=>o.kind===i.kind);if(s.length!==0){if(n.push(Le(r,i.title)),i.kind==="property"||i.kind==="enum-member"||i.kind==="index-signature"){let o=i.kind==="enum-member",a=o?`| Member | Value | Description | Defined in |
|
|
891
|
+
| ------ | ------ | ------ | ------ |`:`| ${i.kind==="index-signature"?"Index":"Property"} | Type | Description | Defined in |
|
|
892
|
+
| ------ | ------ | ------ | ------ |`,l=s.map(c=>{let f=[c.static?"static":"",c.readonly&&!o?"readonly":"",c.protected?"protected":""].filter(Boolean).join(" "),h=`<a id="${Ia(c.name)}"></a> ${Ne(`${c.name}${c.optional?"?":""}`)}${f?` (${f})`:""}`,p=c.source.url?`[${c.source.file}:${c.source.line}](${c.source.url})`:`${c.source.file}:${c.source.line}`;return`| ${h} | ${c.type===null?"":Ne(c.type)} | ${iw(t,c.summary,c.tags)} | ${p} |`});n.push([a,...l].join(`
|
|
893
|
+
`));continue}s.forEach((o,a)=>{a>0&&n.push("***"),i.kind!=="call-signature"&&n.push(Le(r+1,sw(o)));let l=i.kind==="call-signature"?r+1:r+2,c=o.signatures.length===0?qi(t,o.summary,o.tags,l):[];n.push(...c),o.signatures.forEach((f,h)=>{h>0&&n.push("***");let p=f.summary||f.tags.length>0?f:{...f,summary:o.summary,tags:o.tags};n.push(...Xf(t,p,l))})})}}return n}function aw(t,e){let r=t.symbol,n=[];if(r.referenceOf!==null){let i=r.links.find(o=>o.target===r.referenceOf),s=i?`[${Yr(r.referenceOf)}](${Kf(t,i.name,i.kind,i.kindDir,null)})`:Ne(r.referenceOf);return n.push(`Renames and re-exports ${s}`),n.push(...qi(t,r.summary,r.tags,e)),n}return r.code&&n.push(Qf(r.code)),r.kind!=="function"&&(n.push(Jf(r.source)),n.push(...qi(t,r.summary,r.tags,e))),r.extends.length>0&&n.push(Le(e,"Extends"),r.extends.map(i=>`- ${Ne(i)}`).join(`
|
|
894
|
+
`)),r.implements.length>0&&n.push(Le(e,"Implements"),r.implements.map(i=>`- ${Ne(i)}`).join(`
|
|
895
|
+
`)),r.kind!=="function"&&n.push(...Zf(t,r.typeParameters,e)),r.kind==="function"&&r.signatures.forEach((i,s)=>{s>0&&n.push("***"),n.push(...Xf(t,i,e))}),n.push(...ow(t,r.members,e)),n}function lw(t,e){let r=e&&t.typeParameters.length>0?`<${t.typeParameters.map(i=>i.name).join(", ")}>`:"",n=t.kind==="function"?"()":"";return Yr(`${t.name}${n}${r}`)}function cw(t){let e=t.ownFileKinds??[];for(let r of e)if(!Yf.some(n=>n.kind===r))throw new Error(`Unknown symbol kind "${String(r)}" in ownFileKinds (expected: ${Yf.map(n=>n.kind).join(", ")})`);return new Set(e)}function uw(t,e,r){return{ownFileKinds:cw(e),categoryOrder:e.categoryOrder??[],indexFile:e.indexFile??"README.md",onOwnPage:r,symbol:t}}function ed(t,e={}){let r=nw(t),n=uw(r,e,!0),i=`[API](../${n.indexFile}) / ${Yr(r.name)}`,s=Le(1,`${r.kindLabel}: ${lw(r,!0)}`);return[i,s,...aw(n,2)].join(`
|
|
895
896
|
|
|
896
897
|
`)+`
|
|
897
|
-
`}function
|
|
898
|
-
`):c;await
|
|
899
|
-
Processing datasource: ${
|
|
898
|
+
`}function yw(){ye.default.registerHelper("today",()=>new Date().toISOString().split("T")[0]),ye.default.registerHelper("datetime",()=>new Date().toISOString()),ye.default.registerHelper("eq",(t,e)=>t===e),ye.default.registerHelper("ne",(t,e)=>t!==e),ye.default.registerHelper("gt",(t,e)=>t>e),ye.default.registerHelper("lt",(t,e)=>t<e),ye.default.registerHelper("and",(...t)=>(t.pop(),t.every(Boolean))),ye.default.registerHelper("or",(...t)=>(t.pop(),t.some(Boolean))),ye.default.registerHelper("json",t=>JSON.stringify(t,null,2)),ye.default.registerHelper("uppercase",t=>String(t??"").toUpperCase()),ye.default.registerHelper("lowercase",t=>String(t??"").toLowerCase()),ye.default.registerHelper("capitalize",t=>{let e=String(t??"");return e.charAt(0).toUpperCase()+e.slice(1)}),ye.default.registerHelper("replace",(t,e,r)=>String(t??"").replace(new RegExp(e,"g"),r)),ye.default.registerHelper("api_page",(t,e)=>{let r=e.hash,n=r.own_file_kinds,i=r.index_file;return new ye.default.SafeString(ed(t,{ownFileKinds:typeof n=="string"?n.split(",").map(s=>s.trim()).filter(Boolean):void 0,indexFile:typeof i=="string"?i:void 0}))})}yw();async function _w(t,e){let r=await hw(t,{encoding:"utf-8"});return ye.default.compile(r)(e)}function bw(t,e){return t.replace(/\{([^}]+)\}/g,(r,n)=>{let i=e[n];return i!=null?String(i):""})}async function ww(t){try{return await pw(t),!0}catch{return!1}}async function vw(t,e,r,n,i=!1){let s=bw(e.output_path,t),o={filePath:s,success:!0,skipped:!1};try{if(await ww(s)&&!e.overwrite)return o.skipped=!0,o;let l=gw(r,e.template),c=await _w(l,t);if(!i){await dw(mw(s),{recursive:!0});let h=(n.output?.line_ending??"lf")==="crlf"?c.replace(/\n/g,`\r
|
|
899
|
+
`):c;await fw(s,h,{encoding:n.output?.encoding??"utf-8"})}}catch(a){o.success=!1,o.error=a instanceof Error?a:new Error(String(a))}return o}function Sw(t,e){if(e===void 0)return t;let r=Object.entries(e).map(([n,i])=>{let s=Array.isArray(i)?i:[i];if(!s.every(o=>typeof o=="string"))throw new Error(`Generator "where.${n}" must be a string or a list of strings`);return{field:n,values:new Set(s)}});return t.filter(n=>r.every(({field:i,values:s})=>s.has(String(n[i]))))}async function xw(t,e,r,n,i={}){let s=[];if(!e.generators||e.generators.length===0)return i.verbose&&console.log(`No generators defined for datasource: ${t}`),s;let o=n.templates_dir??".embedoc/templates",a=await r.getAll();i.verbose&&console.log(`Found ${a.length} records in datasource: ${t}`);for(let l of e.generators)if(!(i.generatorName&&l.template!==i.generatorName)){i.verbose&&console.log(` Generator: ${l.template}`);for(let c of Sw(a,l.where)){let f=await vw(c,l,o,n,i.dryRun);s.push(f),i.verbose&&(f.skipped?console.log(` Skipped (exists): ${f.filePath}`):f.success?console.log(` Generated: ${f.filePath}`):console.log(` Failed: ${f.filePath} - ${f.error?.message}`))}}return s}async function td(t,e,r={}){let n=[];if(!t.datasources)return n;for(let[i,s]of Object.entries(t.datasources)){if(r.datasourceName&&i!==r.datasourceName||!s.generators||s.generators.length===0)continue;let o=e[i];if(!o){r.verbose&&console.warn(`Datasource not initialized: ${i}`);continue}r.verbose&&console.log(`
|
|
900
|
+
Processing datasource: ${i}`);let a=await xw(i,s,o,t,r);n.push(...a)}return n}import{readFile as Cw}from"node:fs/promises";import{resolve as it,relative as La}from"node:path";var ar=class{nodes=new Map;config;renderersDir;embeds;constructor(e,r){this.config=e,this.embeds=r,this.renderersDir=it(e.renderers_dir??e.embeds_dir??".embedoc/renderers")}getOrCreateNode(e,r){let n=it(r),i=this.nodes.get(n);return i||(i={type:e,path:n,dependsOn:new Set,dependedBy:new Set},this.nodes.set(n,i)),i}addDependency(e,r){let n=this.nodes.get(it(e)),i=this.nodes.get(it(r));n&&i&&(n.dependsOn.add(i.path),i.dependedBy.add(n.path))}async analyzeDocument(e,r){let n=it(e),i=this.getOrCreateNode("document",n);try{let s=await Cw(n,{encoding:"utf-8"}),o=ei(r.comment_style,this.config.comment_styles),{content:a}=Qn(s),l=Xn(a,o,{markdown:Zn(e)}),c=new Set(l.map(f=>f.templateName));for(let f of c){let h=this.embeds[f];if(h){let p=`embed:${f}`,m=this.getOrCreateNode("embed",p);if(i.dependsOn.add(m.path),m.dependedBy.add(i.path),h.dependsOn)for(let g of h.dependsOn){let _=this.config.datasources?.[g];if(_?.path){let O=it(_.path),b=this.getOrCreateNode("datasource",O);m.dependsOn.add(b.path),b.dependedBy.add(m.path)}}}}}catch{}}async build(){this.nodes.clear();for(let e of this.config.targets){let r=await Br(e);for(let n of r)await this.analyzeDocument(n,e)}}getAffectedDocuments(e){let r=it(e),n=new Set,i=this.nodes.get(r);if(!i){for(let a of this.nodes.values())if(a.type==="datasource"&&a.path===r){i=a;break}}if(!i&&e.endsWith(".ts")){let a=e.split("/").pop()?.replace(".ts","");if(a&&a!=="index"){let l=`embed:${a}`;if(i=this.nodes.get(it(l)),!i){let c=a.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"");i=this.nodes.get(it(`embed:${c}`))}}}if(!i)return this.nodes.get(r)?.type==="document"?[r]:[];let s=new Set,o=[i];for(;o.length>0;){let a=o.shift();if(!s.has(a.path)){s.add(a.path),a.type==="document"&&n.add(a.path);for(let l of a.dependedBy){let c=this.nodes.get(l);c&&!s.has(l)&&o.push(c)}}}return Array.from(n)}getWatchPaths(){let e=[];if(this.config.datasources)for(let r of Object.values(this.config.datasources))r.path&&e.push(it(r.path));return e.push(this.renderersDir),e}dump(){console.log(`
|
|
900
901
|
=== Dependency Graph ===`);for(let[e,r]of this.nodes){if(console.log(`
|
|
901
|
-
[${r.type}] ${
|
|
902
|
-
`));let e=[],r=[],
|
|
902
|
+
[${r.type}] ${La(process.cwd(),e)}`),r.dependsOn.size>0){console.log(" depends on:");for(let n of r.dependsOn)console.log(` - ${La(process.cwd(),n)}`)}if(r.dependedBy.size>0){console.log(" depended by:");for(let n of r.dependedBy)console.log(` - ${La(process.cwd(),n)}`)}}}};var Aw={version:"0.14.11"};async function Ma(t){let e=Je(t),r=await id(e,{encoding:"utf-8"});return t.endsWith(".json")?JSON.parse(r):Ze.load(r)}async function lr(t){try{return await kw(t),!0}catch{return!1}}function nd(t){return t.renderers_dir?t.renderers_dir:t.embeds_dir?(console.warn(j.default.yellow('Warning: "embeds_dir" is deprecated. Use "renderers_dir" instead.')),t.embeds_dir):".embedoc/renderers"}async function Fa(t){let e=Je(t,"index.ts"),r=Je(t,"index.js");try{if(await lr(e)){let n=await od(e,import.meta.url);return n.embeds??n.default?.embeds??{}}return await lr(r)?(await import(sd(r).href)).embeds??{}:{}}catch(n){let i=n instanceof Error?n.message:String(n);return console.warn(j.default.yellow(`Warning: Could not load renderers from ${t}: ${i}`)),{}}}async function Ba(t){let e=Je(t,"index.ts"),r=Je(t,"index.js"),n={datasourceTypes:{},inlineFormats:{}};try{let i;return await lr(e)?i=await od(e,import.meta.url):await lr(r)&&(i=await import(sd(r).href)),i?{datasourceTypes:i.datasourceTypes??i.default?.datasourceTypes??{},inlineFormats:i.inlineFormats??i.default?.inlineFormats??{}}:n}catch(i){let s=i instanceof Error?i.message:String(i);return console.warn(j.default.yellow(`Warning: Could not load custom datasources from ${t}: ${s}`)),n}}var Ow={init:async t=>{try{console.log(j.default.cyan(`\u{1F4C1} Initializing embedoc...
|
|
903
|
+
`));let e=[],r=[],n=async(l,c)=>{let f=Je(l);if(!t.force&&await lr(f)){r.push(l);return}let h=f.substring(0,f.lastIndexOf("/"));await Ew(h,{recursive:!0}),await rd(f,c,{encoding:"utf-8"}),e.push(l)};await n("embedoc.config.yaml",`version: "1.0"
|
|
903
904
|
|
|
904
905
|
targets:
|
|
905
906
|
- pattern: "./docs/**/*.md"
|
|
@@ -915,7 +916,7 @@ datasources: {}
|
|
|
915
916
|
# example_csv:
|
|
916
917
|
# type: csv
|
|
917
918
|
# path: "./data/example.csv"
|
|
918
|
-
`),await
|
|
919
|
+
`),await n(".embedoc/renderers/index.ts",`/**
|
|
919
920
|
* embedoc renderers
|
|
920
921
|
*
|
|
921
922
|
* Export your custom renderers here.
|
|
@@ -927,7 +928,7 @@ datasources: {}
|
|
|
927
928
|
export const embeds = {
|
|
928
929
|
// my_renderer: myRenderer,
|
|
929
930
|
};
|
|
930
|
-
`),await
|
|
931
|
+
`),await n(".embedoc/datasources/index.ts",`/**
|
|
931
932
|
* embedoc custom datasources and inline format parsers
|
|
932
933
|
*
|
|
933
934
|
* datasourceTypes: register custom datasource types usable in embedoc.config.yaml
|
|
@@ -944,17 +945,17 @@ export const datasourceTypes = {
|
|
|
944
945
|
export const inlineFormats = {
|
|
945
946
|
// toml: (content: string) => parseToml(content),
|
|
946
947
|
};
|
|
947
|
-
`),await
|
|
948
|
-
`,{encoding:"utf-8"}),console.log(j.default.green(" Updated package.json scripts:"));for(let[m,g]of p)l.includes(`"${m}"`)||console.log(j.default.gray(` "${m}": "${g}"`));console.log("")}}if(e.length>0){console.log(j.default.green(" Created:"));for(let l of e)console.log(j.default.gray(` ${l}`))}if(r.length>0){console.log(j.default.yellow(" Skipped (already exists):"));for(let l of r)console.log(j.default.gray(` ${l}`))}console.log(""),console.log(j.default.green("\u2705 embedoc initialized!")),console.log(""),console.log(" Next steps:"),console.log(j.default.cyan(" 1. Edit embedoc.config.yaml to configure targets and datasources")),console.log(j.default.cyan(" 2. Add renderers in .embedoc/renderers/")),console.log(j.default.cyan(" 3. Run: npx embedoc build"))}catch(e){console.error(j.default.red("\u274C Init failed:")),console.error(e instanceof Error?e.message:String(e)),process.exit(1)}},build:async(t,e)=>{let r=Date.now();try{console.log(j.default.cyan("\u{1F527} Loading configuration..."));let
|
|
948
|
+
`),await n(".embedoc/templates/.gitkeep","");let a=Je("package.json");if(await lr(a)){let l=await id(a,{encoding:"utf-8"}),c=JSON.parse(l),f=c.scripts??{},h=!1,p=[["embedoc:build","embedoc build"],["embedoc:watch","embedoc watch"],["embedoc:generate","embedoc generate --all"]];for(let[m,g]of p)m in f||(f[m]=g,h=!0);if(h){c.scripts=f,await rd(a,JSON.stringify(c,null,2)+`
|
|
949
|
+
`,{encoding:"utf-8"}),console.log(j.default.green(" Updated package.json scripts:"));for(let[m,g]of p)l.includes(`"${m}"`)||console.log(j.default.gray(` "${m}": "${g}"`));console.log("")}}if(e.length>0){console.log(j.default.green(" Created:"));for(let l of e)console.log(j.default.gray(` ${l}`))}if(r.length>0){console.log(j.default.yellow(" Skipped (already exists):"));for(let l of r)console.log(j.default.gray(` ${l}`))}console.log(""),console.log(j.default.green("\u2705 embedoc initialized!")),console.log(""),console.log(" Next steps:"),console.log(j.default.cyan(" 1. Edit embedoc.config.yaml to configure targets and datasources")),console.log(j.default.cyan(" 2. Add renderers in .embedoc/renderers/")),console.log(j.default.cyan(" 3. Run: npx embedoc build"))}catch(e){console.error(j.default.red("\u274C Init failed:")),console.error(e instanceof Error?e.message:String(e)),process.exit(1)}},build:async(t,e)=>{let r=Date.now();try{console.log(j.default.cyan("\u{1F527} Loading configuration..."));let n=await Ma(e.config??"embedoc.config.yaml"),i=n.datasources_dir??".embedoc/datasources",s=await Ba(i);console.log(j.default.cyan("\u{1F4E6} Initializing datasources..."));let o=await Mr(n,s.datasourceTypes);console.log(j.default.cyan("\u{1F4DD} Loading renderers..."));let a=nd(n),l=await Fa(a);console.log(j.default.cyan("\u{1F504} Processing files..."));let c=await Mo(n,l,o,{dryRun:e.dryRun,verbose:e.verbose,specificFiles:t.length>0?t:void 0,customInlineFormats:s.inlineFormats});await Fr(o);let f=Date.now()-r;console.log(""),console.log(j.default.green("\u2705 Build completed!")),console.log(` Files processed: ${c.totalFiles}`),console.log(` Markers updated: ${c.totalMarkersUpdated}`),console.log(` Success: ${c.successFiles}`),c.failedFiles>0&&console.log(j.default.red(` Failed: ${c.failedFiles}`)),console.log(` Duration: ${f}ms`),e.dryRun&&console.log(j.default.yellow(`
|
|
949
950
|
(Dry run - no files were modified)`));for(let h of c.results)!h.success&&h.error&&(console.error(j.default.red(`
|
|
950
|
-
Error in ${h.filePath}:`)),console.error(` ${h.error.message}`));process.exit(c.failedFiles>0?1:0)}catch(
|
|
951
|
+
Error in ${h.filePath}:`)),console.error(` ${h.error.message}`));process.exit(c.failedFiles>0?1:0)}catch(n){console.error(j.default.red("\u274C Build failed:")),console.error(n instanceof Error?n.message:String(n)),process.exit(1)}},generate:async t=>{let e=Date.now();try{!t.datasource&&!t.all&&(console.error(j.default.red("Error: Either --datasource or --all must be specified")),process.exit(1)),console.log(j.default.cyan("\u{1F527} Loading configuration..."));let r=await Ma(t.config??"embedoc.config.yaml"),n=r.datasources_dir??".embedoc/datasources",i=await Ba(n);console.log(j.default.cyan("\u{1F4E6} Initializing datasources..."));let s=await Mr(r,i.datasourceTypes);console.log(j.default.cyan("\u{1F4C4} Generating files..."));let o=await td(r,s,{dryRun:t.dryRun,verbose:t.verbose,datasourceName:t.datasource,generatorName:t.generator});await Fr(s);let a=Date.now()-e,l=o.filter(h=>h.success&&!h.skipped).length,c=o.filter(h=>h.skipped).length,f=o.filter(h=>!h.success).length;console.log(""),console.log(j.default.green("\u2705 Generation completed!")),console.log(` Generated: ${l}`),console.log(` Skipped (existing): ${c}`),f>0&&console.log(j.default.red(` Failed: ${f}`)),console.log(` Duration: ${a}ms`),t.dryRun&&console.log(j.default.yellow(`
|
|
951
952
|
(Dry run - no files were created)`));for(let h of o)!h.success&&h.error&&(console.error(j.default.red(`
|
|
952
|
-
Error for ${h.filePath}:`)),console.error(` ${h.error.message}`));process.exit(f>0?1:0)}catch(r){console.error(j.default.red("\u274C Generation failed:")),console.error(r instanceof Error?r.message:String(r)),process.exit(1)}},watch:async t=>{try{console.log(j.default.cyan("\u{1F527} Loading configuration..."));let e=await
|
|
953
|
-
\u{1F504} Renderer changed: ${
|
|
953
|
+
Error for ${h.filePath}:`)),console.error(` ${h.error.message}`));process.exit(f>0?1:0)}catch(r){console.error(j.default.red("\u274C Generation failed:")),console.error(r instanceof Error?r.message:String(r)),process.exit(1)}},watch:async t=>{try{console.log(j.default.cyan("\u{1F527} Loading configuration..."));let e=await Ma(t.config??"embedoc.config.yaml"),r=e.datasources_dir??".embedoc/datasources",n=await Ba(r);console.log(j.default.cyan("\u{1F4E6} Initializing datasources..."));let i=await Mr(e,n.datasourceTypes);console.log(j.default.cyan("\u{1F4DD} Loading renderers..."));let s=Je(nd(e)),o=await Fa(s);console.log(j.default.cyan("\u{1F517} Building dependency graph..."));let a=new ar(e,o);await a.build(),t.debugDeps&&a.dump();let l=e.targets.map(_=>_.pattern),c=a.getWatchPaths();console.log(j.default.cyan("\u{1F440} Watching for changes...")),console.log(` Document patterns: ${l.join(", ")}`),c.length>0&&console.log(` Additional paths: ${c.map(_=>Na(process.cwd(),_)).join(", ")}`);let f=Ql.watch([...l,...c],{ignored:["**/node_modules/**","**/.git/**"],persistent:!0,ignoreInitial:!0}),h=null,p=new Map,m=async()=>{let _=new Map(p);p.clear();let O=!1;for(let[x]of _)if(x.startsWith(s)&&x.endsWith(".ts")){console.log(j.default.yellow(`
|
|
954
|
+
\u{1F504} Renderer changed: ${Na(process.cwd(),x)}`)),console.log(j.default.cyan(" Reloading renderers..."));try{o=await Fa(s),O=!0}catch(I){console.error(j.default.red(" Failed to reload renderers:"),I);return}}O&&(console.log(j.default.cyan(" Rebuilding dependency graph...")),a=new ar(e,o),await a.build());let b=new Set;for(let[x]of _){let I=a.getAffectedDocuments(x);for(let L of I)b.add(L)}if(b.size===0)for(let[x]of _){let I=Je(x);for(let L of e.targets)if((await Br(L)).some(V=>Je(V)===I)){b.add(I);break}}if(b.size===0){console.log(j.default.gray(`
|
|
954
955
|
No affected documents found`));return}console.log(j.default.yellow(`
|
|
955
|
-
\u{1F4DD} Rebuilding ${b.size} document(s)...`));for(let x of b)console.log(j.default.gray(` - ${
|
|
956
|
+
\u{1F4DD} Rebuilding ${b.size} document(s)...`));for(let x of b)console.log(j.default.gray(` - ${Na(process.cwd(),x)}`));try{await Fr(i),i=await Mr(e,n.datasourceTypes);let x=await Mo(e,o,i,{verbose:t.verbose,specificFiles:Array.from(b),customInlineFormats:n.inlineFormats});x.totalMarkersUpdated>0?console.log(j.default.green(` \u2705 Updated ${x.totalMarkersUpdated} marker(s)`)):console.log(j.default.gray(" No markers updated")),a=new ar(e,o),await a.build()}catch(x){console.error(j.default.red(" \u274C Error:"),x)}},g=_=>O=>{p.set(Je(O),_),h&&clearTimeout(h),h=setTimeout(m,200)};f.on("change",g("change")),f.on("add",g("add")),process.on("SIGINT",async()=>{console.log(j.default.cyan(`
|
|
956
957
|
|
|
957
|
-
\u{1F44B} Stopping watch...`)),await f.close(),await Fr(
|
|
958
|
+
\u{1F44B} Stopping watch...`)),await f.close(),await Fr(i),process.exit(0)})}catch(e){console.error(j.default.red("\u274C Watch failed:")),console.error(e instanceof Error?e.message:String(e)),process.exit(1)}}};pc(Ow,Aw.version).parse();
|
|
958
959
|
/*! Bundled license information:
|
|
959
960
|
|
|
960
961
|
chokidar/esm/index.js:
|