@karmaniverous/stan-cli 0.10.3 → 0.11.0

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/dist/cli/stan.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import require$$0 from 'node:events';
3
- import require$$1, { spawn } from 'node:child_process';
4
- import path, { dirname, resolve, join, delimiter } from 'node:path';
2
+ import { createRequire } from 'node:module';
5
3
  import c, { readFileSync, existsSync, rmSync, createWriteStream } from 'node:fs';
6
- import process$2 from 'node:process';
7
4
  import { copyFile, readdir, readFile, writeFile, stat, mkdir, rm, open, realpath, appendFile } from 'node:fs/promises';
5
+ import path, { dirname, resolve, join, delimiter } from 'node:path';
8
6
  import { pathExists, ensureDir, move, remove } from 'fs-extra';
7
+ import process$2 from 'node:process';
9
8
  import { fileURLToPath } from 'node:url';
10
9
  import S from 'process';
11
- import require$$0$1 from 'buffer';
10
+ import require$$0 from 'buffer';
12
11
  import { createHash } from 'node:crypto';
12
+ import { spawn } from 'node:child_process';
13
13
  import x from 'os';
14
14
  import $ from 'path';
15
15
  import O from 'util';
@@ -20,8 +20,7 @@ import os$1 from 'node:os';
20
20
  import tty from 'node:tty';
21
21
  import readline__default, { emitKeypressEvents } from 'node:readline';
22
22
  import clipboardy from 'clipboardy';
23
- import require$$0$2 from 'child_process';
24
- import { createRequire } from 'node:module';
23
+ import require$$0$1 from 'child_process';
25
24
 
26
25
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
27
26
 
@@ -243,6 +242,21 @@ function requireArgument () {
243
242
 
244
243
  var command = {};
245
244
 
245
+ const require$4 = createRequire(import.meta.url);
246
+ function __require$4() { return require$4("node:events"); }
247
+
248
+ const require$3 = createRequire(import.meta.url);
249
+ function __require$3() { return require$3("node:child_process"); }
250
+
251
+ const require$2 = createRequire(import.meta.url);
252
+ function __require$2() { return require$2("node:path"); }
253
+
254
+ const require$1 = createRequire(import.meta.url);
255
+ function __require$1() { return require$1("node:fs"); }
256
+
257
+ const require = createRequire(import.meta.url);
258
+ function __require() { return require("node:process"); }
259
+
246
260
  var help = {};
247
261
 
248
262
  var hasRequiredHelp;
@@ -1506,11 +1520,11 @@ var hasRequiredCommand;
1506
1520
  function requireCommand () {
1507
1521
  if (hasRequiredCommand) return command;
1508
1522
  hasRequiredCommand = 1;
1509
- const EventEmitter = require$$0.EventEmitter;
1510
- const childProcess = require$$1;
1511
- const path$1 = path;
1512
- const fs = c;
1513
- const process = process$2;
1523
+ const EventEmitter = __require$4().EventEmitter;
1524
+ const childProcess = __require$3();
1525
+ const path = __require$2();
1526
+ const fs = __require$1();
1527
+ const process = __require();
1514
1528
 
1515
1529
  const { Argument, humanReadableArgName } = requireArgument();
1516
1530
  const { CommanderError } = requireError();
@@ -2712,11 +2726,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2712
2726
 
2713
2727
  function findFile(baseDir, baseName) {
2714
2728
  // Look for specified file
2715
- const localBin = path$1.resolve(baseDir, baseName);
2729
+ const localBin = path.resolve(baseDir, baseName);
2716
2730
  if (fs.existsSync(localBin)) return localBin;
2717
2731
 
2718
2732
  // Stop looking if candidate already has an expected extension.
2719
- if (sourceExt.includes(path$1.extname(baseName))) return undefined;
2733
+ if (sourceExt.includes(path.extname(baseName))) return undefined;
2720
2734
 
2721
2735
  // Try all the extensions.
2722
2736
  const foundExt = sourceExt.find((ext) =>
@@ -2742,8 +2756,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
2742
2756
  } catch {
2743
2757
  resolvedScriptPath = this._scriptPath;
2744
2758
  }
2745
- executableDir = path$1.resolve(
2746
- path$1.dirname(resolvedScriptPath),
2759
+ executableDir = path.resolve(
2760
+ path.dirname(resolvedScriptPath),
2747
2761
  executableDir,
2748
2762
  );
2749
2763
  }
@@ -2754,9 +2768,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2754
2768
 
2755
2769
  // Legacy search using prefix of script name instead of command name
2756
2770
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2757
- const legacyName = path$1.basename(
2771
+ const legacyName = path.basename(
2758
2772
  this._scriptPath,
2759
- path$1.extname(this._scriptPath),
2773
+ path.extname(this._scriptPath),
2760
2774
  );
2761
2775
  if (legacyName !== this._name) {
2762
2776
  localFile = findFile(
@@ -2768,7 +2782,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2768
2782
  executableFile = localFile || executableFile;
2769
2783
  }
2770
2784
 
2771
- launchWithNode = sourceExt.includes(path$1.extname(executableFile));
2785
+ launchWithNode = sourceExt.includes(path.extname(executableFile));
2772
2786
 
2773
2787
  let proc;
2774
2788
  if (process.platform !== 'win32') {
@@ -3923,7 +3937,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3923
3937
  */
3924
3938
 
3925
3939
  nameFromFilename(filename) {
3926
- this._name = path$1.basename(filename, path$1.extname(filename));
3940
+ this._name = path.basename(filename, path.extname(filename));
3927
3941
 
3928
3942
  return this;
3929
3943
  }
@@ -4334,11 +4348,11 @@ const {
4334
4348
  Help,
4335
4349
  } = commander;
4336
4350
 
4337
- const P="archive.tar",L="archive.prev.tar",N=e=>e.replace(/\\/g,"/"),I=(e,t)=>{const n=N(e).replace(/\/+$/,""),r=N(t);return r===n||r.startsWith(`${n}/`)},M=(e,t)=>{const n=N(e);return I(`${n}/diff`,t)||I(`${n}/patch`,t)},D=I,j=e=>{const t=e.replace(/\\/g,"/");return e=>!(M(t,e)||((e,t)=>{const n=N(e);return N(t)===`${n}/output/${P}`||N(t)===`${n}/output/archive.diff.tar`||N(t)===`${n}/output/archive.warnings.txt`})(t,e))},H=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},F=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);},B=1048576,z=async(e,t)=>{const n=[],r=[],a=[];await Promise.all(t.map(async t=>{const c=t.replace(/\\/g,"/");const u=resolve(e,t);let l=null;try{l=await stat(u);}catch{return}const f=l?.size??0;let p,d=false;try{d=await(async e=>{try{const t=await open(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:n}=await t.read(e,0,e.length,0);for(let t=0;t<n;t+=1)if(0===e[t])return !0;return !1}finally{await t.close().catch(()=>{});}}catch{return !1}})(u);}catch{d=false;}if(d)return void r.push({path:c,size:f});n.push(c);try{if(f<=B||f<5*B){p=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await readFile(u,"utf8"));}}catch{}(f>B||"number"==typeof p&&p>3e3)&&a.push({path:c,size:f,loc:p});}));const c=[];if(r.length>0){c.push(`Binary files excluded from archive (${r.length.toString()}):`);for(const e of r)c.push(` - ${e.path} (${e.size.toString()} bytes)`);c.push("");}if(a.length>0){c.push(`Large text files (included; consider excludes if unwanted) (${a.length.toString()}):`);for(const e of a){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),c.push(t.join(" "));}c.push(""),c.push(`Thresholds: size > ${B.toString()} bytes or LOC > ${3e3.toString()}`);}0===c.length&&c.push("No archive warnings.");const u=c.join("\n")+(c.length?"\n":"");return {textFiles:n,excludedBinaries:r,largeText:a,warningsBody:u}};var K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,Z={exports:{}};var W,G,V,Y,Q,J,X,ee,te,ne,re,se=(q||(q=1,function(e){function t(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,r=/(?:[^\\]|^)\\$/,s=/^\\!/,i=/^\\#/,o=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,c=/\/$/,u="/";let l="node-ignore";"undefined"!=typeof Symbol&&(l=Symbol.for("node-ignore"));const f=l,p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),h=/([0-z])-([0-z])/g,d=()=>false,g=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return /\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",_={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},b=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i);}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(m,_[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=false,o=e;0===o.indexOf("!")&&(r=true,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[];}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=true);if(b(e)&&(e={pattern:e}),(e=>e&&b(e)&&!n.test(e)&&!r.test(e)&&0!==e.indexOf("#"))(e.pattern)){const t=S(e,this._ignoreCase);this._added=true,this._rules.push(t);}}add(e){return this._added=false,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=false,i=false;this._rules.forEach(o=>{const{negative:a}=o;i===a&&s!==i||a&&!s&&!i&&!t||o[n].test(e)&&(s=!a,i=a,r=a?void 0:o);});const o={ignored:s,unignored:i};return r&&(o.rule=r),o}}const k=(e,t)=>{throw new t(e)},E=(e,t,n)=>b(e)?e?!E.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),x=e=>a.test(e);E.isNotRelative=x,E.convert=e=>e;class ${constructor({ignorecase:e=true,ignoreCase:t=e,allowRelativePaths:n=false}={}){p(this,f,true),this._rules=new A(t),this._strictPathCheck=!n,this._initCache();}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null);}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){const s=e&&E.convert(e);return E(s,e,this._strictPathCheck?k:d),this._t(s,t,n,r)}checkIgnore(e){if(!c.test(e))return this.test(e);const t=e.split(u).filter(Boolean);if(t.pop(),t.length){const e=this._t(t.join(u)+u,this._testCache,true,t);if(e.ignored)return e}return this._rules.test(e,false,v)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split(u).filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);const s=this._t(r.join(u)+u,t,n,r);return t[e]=s.ignored?s:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,false).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,true)}}const O=e=>new $(e),R=()=>{E.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");const e=/^[a-z]:\//i;E.isNotRelative=t=>e.test(t)||x(t);};"undefined"!=typeof process&&"win32"===process.platform&&R(),e.exports=O,O.default=O,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(Z)),Z.exports),ie=U(se),oe={};function ae(){if(G)return W;G=1;const e="\\\\/",t=`[^${e}]`,n="\\.",r="\\/",s="[^/]",i=`(?:${r}|$)`,o=`(?:^|${r})`,a=`${n}{1,2}${i}`,c={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:r,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${o}${a})`,NO_DOT_SLASH:`(?!${n}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${r}]`,STAR:`${s}*?`,START_ANCHOR:o,SEP:"/"},u={...c,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"};return W={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>true===e?u:c}}function ce(){return V||(V=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=ae();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(s,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return "win32"===e||"windows"===e}return !("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(n,e=>"\\"===e?"":e),e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return -1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return true===t.negated&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return ""===r?n[n.length-2]:r};}(oe)),oe}function ue(){if(Q)return Y;Q=1;const e=ce(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=ae(),m=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Y=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(true===D||$===c){for(z++;true!==U()&&($=Z());)if($!==r)if($!==c){if(true!==D&&$===i&&($=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&$===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if($===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if($!==a){if(true!==b.noext){if(true===($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,$===o&&R===C&&(F=true),true===S){for(;true!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,$=Z();continue}break}}if($===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if($===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if($===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||$!==o||R!==C){if(true!==b.noparen&&$===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&($=Z());)if($!==u){if($===d){B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,$=Z(),$===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&true===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):true===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(true===b.tokens&&(Y.maxDepth=0,m($)||k.push(K),Y.tokens=k),true===b.parts||true===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=true,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r;}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth);}Y.slashes=A,Y.parts=E;}return Y},Y}function le(){if(X)return J;X=1;const e=ae(),t=ce(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r);}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=e.globChars(p.windows),_=e.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:$,QMARK:O,QMARK_NO_DOT:R,STAR:C,START_ANCHOR:T}=v,P=e=>`(${y}(?:(?!${T}${e.dot?k:b}).)*?)`,L=p.dot?"":E,N=p.dot?O:R;let I=true===p.bash?P(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:m};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],H=[];let F,B=g;const z=()=>M.index===d-1,K=M.peek=(e=1)=>l[M.index+e],U=M.advance=()=>l[++M.index]||"",q=()=>l.slice(M.index+1),Z=(e="",t=0)=>{M.consumed+=e,M.index+=t;},W=e=>{M.output+=null!=e.output?e.output:e.value,Z(e.value);},G=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),M.start++,e++;return e%2!=0&&(M.negated=true,M.start++,true)},V=e=>{M[e]++,H.push(e);},Y=e=>{M[e]--,H.pop();},Q=e=>{if("globstar"===B.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=true===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,M.output+=B.output);}if(D.length&&"paren"!==e.type&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&W(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,m.push(e),B=e;},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=B,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:M.output?"":A}),Q({type:"paren",extglob:true,value:U(),output:r}),D.push(n);},X=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=I;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=P(p)),(r!==I||z()||/^\)+$/.test(q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(M.negatedExtglob=true);}Q({type:"paren",extglob:true,value:F,output:n}),Y("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?O.repeat(i.length):""):0===o?N+(i?O.repeat(i.length):""):O.repeat(r.length):"."===s?b.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!z();){if(F=U(),"\0"===F)continue;if("\\"===F){const e=K();if("/"===e&&true!==p.bash)continue;if("."===e||";"===e)continue;if(!e){F+="\\",Q({type:"text",value:F});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(F+="\\")),true===p.unescape?F=U():F+=U(),0===M.brackets){Q({type:"text",value:F});continue}}if(M.brackets>0&&("]"!==F||"["===B.value||"[^"===B.value)){if(false!==p.posix&&":"===F){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=true,e.includes(":"))){const e=B.value.lastIndexOf("["),t=B.value.slice(0,e),n=B.value.slice(e+2),s=r[n];if(s){B.value=t+s,M.backtrack=true,U(),g.output||1!==m.indexOf(B)||(g.output=A);continue}}}("["===F&&":"!==K()||"-"===F&&"]"===K())&&(F=`\\${F}`),"]"!==F||"["!==B.value&&"[^"!==B.value||(F=`\\${F}`),true===p.posix&&"!"===F&&"["===B.value&&(F="^"),B.value+=F,W({value:F});continue}if(1===M.quotes&&'"'!==F){F=t.escapeRegex(F),B.value+=F,W({value:F});continue}if('"'===F){M.quotes=1===M.quotes?0:1,true===p.keepQuotes&&Q({type:"text",value:F});continue}if("("===F){V("parens"),Q({type:"paren",value:F});continue}if(")"===F){if(0===M.parens&&true===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=D[D.length-1];if(e&&M.parens===e.parens+1){X(D.pop());continue}Q({type:"paren",value:F,output:M.parens?")":"\\)"}),Y("parens");continue}if("["===F){if(true!==p.nobracket&&q().includes("]"))V("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));F=`\\${F}`;}Q({type:"bracket",value:F});continue}if("]"===F){if(true===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:F,output:`\\${F}`});continue}if(0===M.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:F,output:`\\${F}`});continue}Y("brackets");const e=B.value.slice(1);if(true===B.posix||"^"!==e[0]||e.includes("/")||(F=`/${F}`),B.value+=F,W({value:F}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),true===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===F&&true!==p.nobrace){V("braces");const e={type:"brace",value:F,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};j.push(e),Q(e);continue}if("}"===F){const e=j[j.length-1];if(true===p.nobrace||!e){Q({type:"text",value:F,output:F});continue}let t=")";if(true===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=true;}if(true!==e.comma&&true!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",F=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value;}Q({type:"brace",value:F,output:t}),Y("braces"),j.pop();continue}if("|"===F){D.length>0&&D[D.length-1].conditions++,Q({type:"text",value:F});continue}if(","===F){let e=F;const t=j[j.length-1];t&&"braces"===H[H.length-1]&&(t.comma=true,e="|"),Q({type:"comma",value:F,output:e});continue}if("/"===F){if("dot"===B.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",m.pop(),B=g;continue}Q({type:"slash",value:F,output:S});continue}if("."===F){if(M.braces>0&&"dot"===B.type){"."===B.value&&(B.output=b);const e=j[j.length-1];B.type="dots",B.output+=F,B.value+=F,e.dots=true;continue}if(M.braces+M.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:F,output:b});continue}Q({type:"dot",value:F,output:b});continue}if("?"===F){if(!(B&&"("===B.value)&&true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",F);continue}if(B&&"paren"===B.type){const e=K();let t=F;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${F}`),Q({type:"text",value:F,output:t});continue}if(true!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:F,output:R});continue}Q({type:"qmark",value:F,output:O});continue}if("!"===F){if(true!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",F);continue}if(true!==p.nonegate&&0===M.index){G();continue}}if("+"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",F);continue}if(B&&"("===B.value||false===p.regex){Q({type:"plus",value:F,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||M.parens>0){Q({type:"plus",value:F});continue}Q({type:"plus",value:w});continue}if("@"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:true,value:F,output:""});continue}Q({type:"text",value:F});continue}if("*"!==F){"$"!==F&&"^"!==F||(F=`\\${F}`);const e=s.exec(q());e&&(F+=e[0],M.index+=e[0].length),Q({type:"text",value:F});continue}if(B&&("globstar"===B.type||true===B.star)){B.type="star",B.star=true,B.value+=F,B.output=I,M.backtrack=true,M.globstar=true,Z(F);continue}let e=q();if(true!==p.noextglob&&/^\([^?]/.test(e)){J("star",F);continue}if("star"===B.type){if(true===p.noglobstar){Z(F);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(true===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:F,output:""});continue}const i=M.braces>0&&("comma"===t.type||"brace"===t.type),o=D.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:F,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[M.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3);}if("bos"===t.type&&z()){B.type="globstar",B.value+=F,B.output=P(p),M.output=B.output,M.globstar=true,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=P(p)+(p.strictSlashes?")":"|$)"),B.value+=F,M.globstar=true,M.output+=t.output+B.output,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${P(p)}${S}|${S}${n})`,B.value+=F,M.output+=t.output+B.output,M.globstar=true,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=F,B.output=`(?:^|${S}|${P(p)}${S})`,M.output=B.output,M.globstar=true,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-B.output.length),B.type="globstar",B.output=P(p),B.value+=F,M.output+=B.output,M.globstar=true,Z(F);continue}const n={type:"star",value:F,output:I};true!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||true!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):true===p.dot?(M.output+=$,B.output+=$):(M.output+=L,B.output+=L),"*"!==K()&&(M.output+=A,B.output+=A)),Q(n)):(n.output=F,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=L+n.output),Q(n));}for(;M.brackets>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets");}for(;M.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens");}for(;M.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces");}if(true===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),true===M.backtrack){M.output="";for(const e of M.tokens)M.output+=null!=e.output?e.output:e.value,e.suffix&&(M.output+=e.suffix);}return M};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?g:h,b=i.capture?"":"?:";let w=true===i.bash?".*?":m;i.capture&&(w=`(${w})`);const S=e=>true===e.noglobstar?w:`(${b}(?:(?!${y}${e.dot?p:u}).)*?)`,A=e=>{switch(e){case "*":return `${v}${f}${w}`;case ".*":return `${u}${f}${w}`;case "*.*":return `${v}${w}${u}${f}${w}`;case "*/*":return `${v}${w}${l}${f}${_}${w}`;case "**":return v+S(i);case "**/*":return `(?:${v}${S(i)}${l})?${_}${f}${w}`;case "**/*.*":return `(?:${v}${S(i)}${l})?${_}${w}${u}${f}${w}`;case "**/.*":return `(?:${v}${S(i)}${l})?${u}${f}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=A(t[1]);if(!n)return;return n+u+t[2]}}},k=t.removePrefix(r,{negated:false,prefix:""});let E=A(k);return E&&true!==i.strictSlashes&&(E+=`${l}?`),E},J=u}function fe(){if(te)return ee;te=1;const e=ue(),t=le(),n=ce(),r=ae(),s=(e,t,n=false)=>{if(Array.isArray(e)){const r=e.map(e=>s(e,t,n)),i=e=>{for(const t of r){const n=t(e);if(n)return n}return false};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const o=t||{},a=o.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,false,true),u=c.state;delete c.state;let l=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n);}const f=(n,r=false)=>{const{isMatch:i,match:f,output:p}=s.test(n,c,t,{glob:e,posix:a}),h={glob:e,state:u,regex:c,posix:a,input:n,output:p,match:f,isMatch:i};return "function"==typeof o.onResult&&o.onResult(h),false===i?(h.isMatch=false,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=false,!!r&&h):("function"==typeof o.onMatch&&o.onMatch(h),!r||h)};return n&&(f.state=u),f};return s.test=(e,t,r,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return {isMatch:false,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===i),false!==u&&true!==a.capture||(u=true===a.matchBase||true===a.basename?s.matchBase(e,t,r,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},s.matchBase=(e,t,r)=>(t instanceof RegExp?t:s.makeRe(t,r)).test(n.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,n)=>Array.isArray(e)?e.map(e=>s.parse(e,n)):t(e,{...n,fastpaths:false}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return true===r&&(u.state=e),u},s.makeRe=(e,n={},r=false,i=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===n.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=t.fastpaths(e,n)),o.output||(o=t(e,n)),s.compileRe(o,n,r,i)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&true===t.debug)throw e;return /$^/}},s.constants=r,ee=s}function pe(){if(re)return ne;re=1;const e=fe(),t=ce();function n(n,r,s=false){return !r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),ne=n}var he=U(pe());const de=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const r=`${n}/system`,s=`${n}/output`,i=`${n}/diff`,o=`${n}/dist`,a=`${n}/patch`,c=`${n}/imports`;return {rootRel:n,systemRel:r,outputRel:s,diffRel:i,distRel:o,patchRel:a,importsRel:c,rootAbs:resolve(e,n),systemAbs:resolve(e,r),outputAbs:resolve(e,s),diffAbs:resolve(e,i),distAbs:resolve(e,o),patchAbs:resolve(e,a),importsAbs:resolve(e,c)}},ge=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),s=resolve(e,r),i=await readdir(s,{withFileTypes:true});for(const e of i){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t},me=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},ye=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>me(e,t):()=>false;var n;const r=he(t,{dot:true});return e=>r(e)},ve=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[]})=>{const c=r.replace(/\\/g,"/"),u=((e,t)=>{const n=new Set;for(const r of e){if("package.json"===r)continue;if(!r.endsWith("/package.json"))continue;const e=r.slice(0,-13);e.startsWith("node_modules/")||e.startsWith(".git/")||e===t||e.startsWith(`${t}/`)||e.length>0&&n.add(e);}return Array.from(n)})(e,c),l=await(async e=>{const n=resolve(e,".gitignore");if(!existsSync(n))return null;try{const e=await readFile(n,"utf8"),t=ie();return t.add(e),t}catch{return null}})(n),f=[e=>me(e,"node_modules"),e=>me(e,".git"),...l?[e=>l.ignores(e)]:[],...a.map(ye),...u.map(e=>t=>me(t,e)),e=>M(c,e)];s||f.push(e=>D(`${c}/output`,e));const p=e.filter(e=>!f.some(t=>t(e)));if(o.length>0){const t=o.map(ye),n=[e=>M(c,e),...s?[]:[e=>D(`${c}/output`,e)]],r=new Set(p);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(ye);return e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e)))}return p},_e=async(e,t)=>{const n=de(e,t);return await ensureDir(n.rootAbs),await ensureDir(n.outputAbs),await ensureDir(n.diffAbs),await ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},be=async(e,t)=>{const n=await _e(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}},we=async(e,n,r={})=>{const{includeOutputDir:s=false,fileName:i,includes:o=[],excludes:a=[]}=r;let u=i??"archive.tar";u.endsWith(".tar")||(u+=".tar");const{outDir:l,diffDir:f}=await be(e,n),p=await ge(e),d=await ve(p,{cwd:e,stanPath:n,includeOutputDir:s,includes:o,excludes:a}),g=resolve(l,u),m=resolve(f,L);if(existsSync(g))try{await copyFile(g,m);}catch{}const{textFiles:y,warningsBody:v}=await z(e,d),_=y;F(v,r.onArchiveWarnings);const b=await import('./index-ucZa1KMb-CSQ-GldX.js');if(s?await b.create({file:g,cwd:e,filter:j(n)},H(_,n)):await b.create({file:g,cwd:e,filter:j(n)},_),!existsSync(m))try{await copyFile(g,m);}catch{}return g},Se=".stan",Ae="code -g {file}",ke=e=>e instanceof URL?fileURLToPath(e):e;function Ee({cwd:t}={}){const n=function(t,{cwd:n=process$2.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(ke(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,ke(s)??o);const a=path.isAbsolute(t);for(;i;){const n=a?t:path.join(i,t);try{const t=c.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=path.dirname(i);}}("package.json",{cwd:t});return n&&path.dirname(n)}const xe=["stan.config.yml","stan.config.yaml","stan.config.json"],$e=e=>{for(const n of xe){const r=resolve(e,n);if(existsSync(r))return r}return null},Oe=e=>{const t=$e(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=Ee({cwd:r});if(!e||n.has(e))break;n.add(e);const t=$e(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Re,Ce={},Te={},Pe={},Le={};function Ne(){if(Re)return Le;Re=1;const e=Symbol.for("yaml.alias"),t=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),s=Symbol.for("yaml.scalar"),i=Symbol.for("yaml.seq"),o=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[o]===s;function c(e){if(e&&"object"==typeof e)switch(e[o]){case n:case i:return true}return false}return Le.ALIAS=e,Le.DOC=t,Le.MAP=n,Le.NODE_TYPE=o,Le.PAIR=r,Le.SCALAR=s,Le.SEQ=i,Le.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Le.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Le.isCollection=c,Le.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Le.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Le.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Le.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Le.isScalar=a,Le.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Le}var Ie,Me,De={};function je(){if(Ie)return De;Ie=1;var e=Ne();const t=Symbol("break visit"),n=Symbol("skip children"),r=Symbol("remove node");function s(t,n){const s=c(n);if(e.isDocument(t)){i(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null);}else i(null,t,s,Object.freeze([]));}function i(n,s,o,a){const c=u(n,s,o,a);if(e.isNode(c)||e.isPair(c))return l(n,a,c),i(n,c,o,a);if("symbol"!=typeof c)if(e.isCollection(s)){a=Object.freeze(a.concat(s));for(let e=0;e<s.items.length;++e){const n=i(e,s.items[e],o,a);if("number"==typeof n)e=n-1;else {if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1);}}}else if(e.isPair(s)){a=Object.freeze(a.concat(s));const e=i("key",s.key,o,a);if(e===t)return t;e===r&&(s.key=null);const n=i("value",s.value,o,a);if(n===t)return t;n===r&&(s.value=null);}return c}async function o(t,n){const s=c(n);if(e.isDocument(t)){await a(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null);}else await a(null,t,s,Object.freeze([]));}async function a(n,s,i,o){const c=await u(n,s,i,o);if(e.isNode(c)||e.isPair(c))return l(n,o,c),a(n,c,i,o);if("symbol"!=typeof c)if(e.isCollection(s)){o=Object.freeze(o.concat(s));for(let e=0;e<s.items.length;++e){const n=await a(e,s.items[e],i,o);if("number"==typeof n)e=n-1;else {if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1);}}}else if(e.isPair(s)){o=Object.freeze(o.concat(s));const e=await a("key",s.key,i,o);if(e===t)return t;e===r&&(s.key=null);const n=await a("value",s.value,i,o);if(n===t)return t;n===r&&(s.value=null);}return c}function c(e){return "object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(t,n,r,s){return "function"==typeof r?r(t,n,s):e.isMap(n)?r.Map?.(t,n,s):e.isSeq(n)?r.Seq?.(t,n,s):e.isPair(n)?r.Pair?.(t,n,s):e.isScalar(n)?r.Scalar?.(t,n,s):e.isAlias(n)?r.Alias?.(t,n,s):void 0}function l(t,n,r){const s=n[n.length-1];if(e.isCollection(s))s.items[t]=r;else if(e.isPair(s))"key"===t?s.key=r:s.value=r;else {if(!e.isDocument(s)){const t=e.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${t} parent`)}s.contents=r;}}return s.BREAK=t,s.SKIP=n,s.REMOVE=r,o.BREAK=t,o.SKIP=n,o.REMOVE=r,De.visit=s,De.visitAsync=o,De}function He(){if(Me)return Pe;Me=1;var e=Ne(),t=je();const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class s{constructor(e,t){this.docStart=null,this.docEnd=false,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t);}clone(){const e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new s(this.yaml,this.tags);switch(this.yaml.version){case "1.1":this.atNextDocument=true;break;case "1.2":this.atNextDocument=false,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=false);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case "%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return false;const[e,r]=n;return this.tags[e]=r,true}case "%YAML":{if(this.yaml.explicit=true,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),false;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,true;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),false}default:return t(0,`Unknown directive ${r}`,true),false}}tagName(e,t){if("!"===e)return "!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return "!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return "!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+r(e.substring(n.length));return "!"===e[0]?e:`!<${e}>`}toString(n){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(n&&s.length>0&&e.isNode(n.contents)){const r={};t.visit(n.contents,(t,n)=>{e.isNode(n)&&n.tag&&(r[n.tag]=true);}),i=Object.keys(r);}else i=[];for(const[e,t]of s)"!!"===e&&"tag:yaml.org,2002:"===t||n&&!i.some(e=>e.startsWith(t))||r.push(`%TAG ${e} ${t}`);return r.join("\n")}}return s.defaultYaml={explicit:false,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},Pe.Directives=s,Pe}var Fe,Be={},ze={},Ke={};function Ue(){if(Fe)return Ke;Fe=1;var e=Ne(),t=je();function n(e){const n=new Set;return t.visit(e,{Value(e,t){t.anchor&&n.add(t.anchor);}}),n}function r(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}return Ke.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return true},Ke.anchorNames=n,Ke.createNodeAnchors=function(t,s){const i=[],o=new Map;let a=null;return {onAnchor:e=>{i.push(e),a??(a=n(t));const o=r(s,a);return a.add(o),o},setAnchors:()=>{for(const t of i){const n=o.get(t);if("object"!=typeof n||!n.anchor||!e.isScalar(n.node)&&!e.isCollection(n.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}n.node.anchor=n.anchor;}},sourceObjects:o}},Ke.findNewAnchor=r,Ke}var qe,Ze={},We={};function Ge(){if(qe)return We;return qe=1,We.applyReviver=function e(t,n,r,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let n=0,r=s.length;n<r;++n){const r=s[n],i=e(t,s,String(n),r);void 0===i?delete s[n]:i!==r&&(s[n]=i);}else if(s instanceof Map)for(const n of Array.from(s.keys())){const r=s.get(n),i=e(t,s,n,r);void 0===i?s.delete(n):i!==r&&s.set(n,i);}else if(s instanceof Set)for(const n of Array.from(s)){const r=e(t,s,n,n);void 0===r?s.delete(n):r!==n&&(s.delete(n),s.add(r));}else for(const[n,r]of Object.entries(s)){const i=e(t,s,n,r);void 0===i?delete s[n]:i!==r&&(s[n]=i);}return t.call(n,r,s)},We}var Ve,Ye,Qe,Je={};function Xe(){if(Ve)return Je;Ve=1;var e=Ne();return Je.toJS=function t(n,r,s){if(Array.isArray(n))return n.map((e,n)=>t(e,String(n),s));if(n&&"function"==typeof n.toJSON){if(!s||!e.hasAnchor(n))return n.toJSON(r,s);const t={aliasCount:0,count:1,res:void 0};s.anchors.set(n,t),s.onCreate=e=>{t.res=e,delete s.onCreate;};const i=n.toJSON(r,s);return s.onCreate&&s.onCreate(i),i}return "bigint"!=typeof n||s?.keep?n:Number(n)},Je}function et(){if(Ye)return Ze;Ye=1;var e=Ge(),t=Ne(),n=Xe();return Ze.NodeBase=class{constructor(e){Object.defineProperty(this,t.NODE_TYPE,{value:e});}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(r,{mapAsMap:s,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!t.isDocument(r))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:r,keep:true,mapAsMap:true===s,mapKeyWarned:false,maxAliasCount:"number"==typeof i?i:100},u=n.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return "function"==typeof a?e.applyReviver(a,{"":u},"",u):u}},Ze}function tt(){if(Qe)return ze;Qe=1;var e=Ue(),t=je(),n=Ne(),r=et(),s=Xe();let i=class extends r.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}});}resolve(e,r){let s,i;r?.aliasResolveCache?s=r.aliasResolveCache:(s=[],t.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t);}}),r&&(r.aliasResolveCache=s));for(const e of s){if(e===this)break;e.anchor===this.source&&(i=e);}return i}toJSON(e,t){if(!t)return {source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let c=n.get(a);if(c||(s.toJS(a,null,t),c=n.get(a)),!c||void 0===c.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(i>=0&&(c.count+=1,0===c.aliasCount&&(c.aliasCount=o(r,a,n)),c.count*c.aliasCount>i)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(e.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(t.implicitKey)return `${s} `}return s}};function o(e,t,r){if(n.isAlias(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}if(n.isCollection(t)){let n=0;for(const s of t.items){const t=o(e,s,r);t>n&&(n=t);}return n}if(n.isPair(t)){const n=o(e,t.key,r),s=o(e,t.value,r);return Math.max(n,s)}return 1}return ze.Alias=i,ze}var nt,rt,st,it={},ot={},at={};function ct(){if(nt)return at;nt=1;var e=Ne(),t=et(),n=Xe();let r=class extends t.NodeBase{constructor(t){super(e.SCALAR),this.value=t;}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}};return r.BLOCK_FOLDED="BLOCK_FOLDED",r.BLOCK_LITERAL="BLOCK_LITERAL",r.PLAIN="PLAIN",r.QUOTE_DOUBLE="QUOTE_DOUBLE",r.QUOTE_SINGLE="QUOTE_SINGLE",at.Scalar=r,at.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,at}function ut(){if(rt)return ot;rt=1;var e=tt(),t=Ne(),n=ct();return ot.createNode=function(r,s,i){if(t.isDocument(r)&&(r=r.contents),t.isNode(r))return r;if(t.isPair(r)){const e=i.schema[t.MAP].createNode?.(i.schema,null,i);return e.items.push(r),e}(r instanceof String||r instanceof Number||r instanceof Boolean||"undefined"!=typeof BigInt&&r instanceof BigInt)&&(r=r.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:u,sourceObjects:l}=i;let f;if(o&&r&&"object"==typeof r){if(f=l.get(r),f)return f.anchor??(f.anchor=a(r)),new e.Alias(f.anchor);f={anchor:null,node:null},l.set(r,f);}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let p=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(r,s,u.tags);if(!p){if(r&&"function"==typeof r.toJSON&&(r=r.toJSON()),!r||"object"!=typeof r){const e=new n.Scalar(r);return f&&(f.node=e),e}p=r instanceof Map?u[t.MAP]:Symbol.iterator in Object(r)?u[t.SEQ]:u[t.MAP];}c&&(c(p),delete i.onTagObj);const h=p?.createNode?p.createNode(i.schema,r,i):"function"==typeof p?.nodeClass?.from?p.nodeClass.from(i.schema,r,i):new n.Scalar(r);return s?h.tag=s:p.default||(h.tag=p.tag),f&&(f.node=h),h},ot}function lt(){if(st)return it;st=1;var e=ut(),t=Ne(),n=et();function r(t,n,r){let s=r;for(let e=n.length-1;e>=0;--e){const t=n[e];if("number"==typeof t&&Number.isInteger(t)&&t>=0){const e=[];e[t]=s,s=e;}else s=new Map([[t,s]]);}return e.createNode(s,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const s=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;let i=class extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true});}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(n=>t.isNode(n)||t.isPair(n)?n.clone(e):n),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(s(e))this.add(n);else {const[s,...i]=e,o=this.get(s,true);if(t.isCollection(o))o.addIn(i,n);else {if(void 0!==o||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n));}}}deleteIn(e){const[n,...r]=e;if(0===r.length)return this.delete(n);const s=this.get(n,true);if(t.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,true);return 0===s.length?!n&&t.isScalar(i)?i.value:i:t.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!t.isPair(n))return false;const r=n.value;return null==r||e&&t.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(0===r.length)return this.has(n);const s=this.get(n,true);return !!t.isCollection(s)&&s.hasIn(r)}setIn(e,n){const[s,...i]=e;if(0===i.length)this.set(s,n);else {const e=this.get(s,true);if(t.isCollection(e))e.setIn(i,n);else {if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n));}}}};return it.Collection=i,it.collectionFromPath=r,it.isEmptyPath=s,it}var ft,pt={},ht={},dt={},gt={};function mt(){if(ft)return gt;ft=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return gt.indentComment=e,gt.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,gt.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),gt}var yt,vt,_t,bt,wt={},St={};function At(){if(yt)return St;yt=1;const e="block",t="quoted";function n(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else {do{i=e[++t];}while(i&&"\n"!==i);r=t,s=t+1,i=e[s];}return r}return St.FOLD_BLOCK=e,St.FOLD_FLOW="flow",St.FOLD_QUOTED=t,St.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,g,m=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):m=a-o);let y=false,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(m=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(_=v,r[v+1]){case "x":v+=3;break;case "u":v+=5;break;case "U":v+=9;break;default:v+=1;}b=v;}if("\n"===o)i===e&&(v=n(r,v,s.length)),m=v+s.length+f,d=void 0;else {if(" "===o&&g&&" "!==g&&"\n"!==g&&"\t"!==g){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v);}if(v>=m)if(d)p.push(d),m=d+f,d=void 0;else if(i===t){for(;" "===g||"\t"===g;)g=o,o=r[v+=1],y=true;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=true,m=e+f,d=void 0;}else y=true;}g=o;}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`);}return w},St}function kt(){if(vt)return wt;vt=1;var e=ct(),t=At();const n=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),r=e=>/^(%|---|\.\.\.)/m.test(e);function s(e,s){const i=JSON.stringify(e);if(s.options.doubleQuotedAsJSON)return i;const{implicitKey:o}=s,a=s.options.doubleQuotedMinMultiLineLength,c=s.indent||(r(e)?" ":"");let u="",l=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(u+=i.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(i[e+1]){case "u":{u+=i.slice(l,e);const t=i.substr(e+2,4);switch(t){case "0000":u+="\\0";break;case "0007":u+="\\a";break;case "000b":u+="\\v";break;case "001b":u+="\\e";break;case "0085":u+="\\N";break;case "00a0":u+="\\_";break;case "2028":u+="\\L";break;case "2029":u+="\\P";break;default:"00"===t.substr(0,2)?u+="\\x"+t.substr(2):u+=i.substr(e,6);}e+=5,l=e+1;}break;case "n":if(o||'"'===i[e+2]||i.length<a)e+=1;else {for(u+=i.slice(l,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)u+="\n",e+=2;u+=c," "===i[e+2]&&(u+="\\"),e+=1,l=e+1;}break;default:e+=1;}return u=l?u+i.slice(l):i,o?u:t.foldFlowLines(u,c,t.FOLD_QUOTED,n(s,false))}function i(e,i){if(false===i.options.singleQuote||i.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return s(e,i);const o=i.indent||(r(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${o}`)+"'";return i.implicitKey?a:t.foldFlowLines(a,o,t.FOLD_FLOW,n(i,false))}function o(e,t){const{singleQuote:n}=t.options;let r;if(false===n)r=s;else {const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s;}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g");}catch{a=/\n+(?!\n|$)/g;}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const g=u.indent||(u.forceBlockIndent||r(c)?" ":""),m="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return false;const r=t-n,s=e.length;if(s<=r)return false;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return true;if(n=t+1,s-n<=r)return false}return true}(c,d,g.length));if(!c)return m?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let _=c.substring(v);const b=_.indexOf("\n");-1===b?y="-":c===_||b!==_.length-1?(y="+",f&&f()):y="",_&&(c=c.slice(0,-_.length),"\n"===_[_.length-1]&&(_=_.slice(0,-1)),_=_.replace(a,`$&${g}`));let w,S=false,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=true;else {if("\n"!==e)break;A=w;}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${g}`));let E=(S?g?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!m){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let s=false;const o=n(u,true);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=true;});const a=t.foldFlowLines(`${k}${r}${_}`,g,t.FOLD_BLOCK,o);if(!s)return `>${E}\n${g}${a}`}return `|${E}\n${g}${k}${c=c.replace(/\n+/g,`$&${g}`)}${_}`}return wt.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:g}=a;g!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(g=e.Scalar.QUOTE_DOUBLE);const m=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:g,inFlow:m}=i;if(h&&f.includes("\n")||m&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||m||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!m&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=true,c(s,i,a,u);if(h&&d===g)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,false))}(d,u,l,f);default:return null}};let y=m(g);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=m(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},wt}function Et(){if(_t)return dt;_t=1;var e=Ue(),t=Ne(),n=mt(),r=kt();return dt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:true,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case "block":s=false;break;case "flow":s=true;break;default:s=null;}return {anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:s,options:r}},dt.stringify=function(n,s,i,o){if(t.isPair(n))return n.toString(s,i,o);if(t.isAlias(n)){if(s.doc.directives)return n.toString(s);if(s.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(n):s.resolvedAliases=new Set([n]),n=n.resolve(s.doc);}let a;const c=t.isNode(n)?n:s.doc.createNode(n,{onTagObj:e=>a=e});a??(a=function(e,n){if(n.tag){const t=e.filter(e=>e.tag===n.tag);if(t.length>0)return t.find(e=>e.format===n.format)??t[0]}let r,s;if(t.isScalar(n)){s=n.value;let t=e.filter(e=>e.identify?.(s));if(t.length>1){const e=t.filter(e=>e.test);e.length>0&&(t=e);}r=t.find(e=>e.format===n.format)??t.find(e=>!e.format);}else s=n,r=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!r)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return r}(s.doc.schema.tags,c));const u=function(n,r,{anchors:s,doc:i}){if(!i.directives)return "";const o=[],a=(t.isScalar(n)||t.isCollection(n))&&n.anchor;a&&e.anchorIsValid(a)&&(s.add(a),o.push(`&${a}`));const c=n.tag??(r.default?null:r.tag);return c&&o.push(i.directives.tagString(c)),o.join(" ")}(c,a,s);u.length>0&&(s.indentAtStart=(s.indentAtStart??0)+u.length+1);const l="function"==typeof a.stringify?a.stringify(c,s,i,o):t.isScalar(c)?r.stringifyString(c,s,i,o):c.toString(s,i,o);return u?t.isScalar(c)||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${s.indent}${l}`:l},dt}function xt(){if(bt)return ht;bt=1;var e=Ne(),t=ct(),n=Et(),r=mt();return ht.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:g}}=o;let m=e.isNode(s)&&s.comment||null;if(g){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!g&&(!s||m&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:false,implicitKey:!y&&(g||!u),indent:f+p});let v,_,b,w=false,S=false,A=n.stringify(s,o,()=>w=true,()=>S=true);if(!y&&!o.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=true;}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!g||null==i&&y)return A=`? ${A}`,m&&!w?A+=r.lineComment(A,o.indent,h(m)):S&&c&&c(),A;w&&(m=null),y?(m&&(A+=r.lineComment(A,o.indent,h(m))),A=`? ${A}\n${f}:`):(A=`${A}:`,m&&(A+=r.lineComment(A,o.indent,h(m)))),e.isNode(i)?(v=!!i.spaceBefore,_=i.commentBefore,b=i.comment):(v=false,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=false,y||m||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=false,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=false;const E=n.stringify(i,o,()=>k=true,()=>S=true);let x=" ";if(m||v||_){if(x=v?"\n":"",_){const e=h(_);x+=`\n${r.indentComment(e,o.indent)}`;}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n");}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=false;if(n&&("&"===e||"!"===e)){let n=E.indexOf(" ");"&"===e&&-1!==n&&n<t&&"!"===E[n+1]&&(n=E.indexOf(" ",n+1)),(-1===n||t<n)&&(r=true);}r||(x=`\n${o.indent}`);}}else ""!==E&&"\n"!==E[0]||(x="");return A+=x+E,o.inFlow?k&&a&&a():b&&!k?A+=r.lineComment(A,o.indent,h(b)):S&&c&&c(),A},ht}var $t,Ot={},Rt={};function Ct(){if($t)return Rt;$t=1;var e=S;return Rt.debug=function(e,...t){"debug"===e&&console.log(...t);},Rt.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Rt}var Tt,Pt,Lt,Nt={};function It(){if(Tt)return Nt;Tt=1;var e=Ne(),t=ct();const n="<<",r={identify:e=>e===n||"symbol"==typeof e&&e.description===n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t.Scalar(Symbol(n)),{addToJSMap:s}),stringify:()=>n};function s(t,n,r){if(r=t&&e.isAlias(r)?r.resolve(t.doc):r,e.isSeq(r))for(const e of r.items)i(t,n,e);else if(Array.isArray(r))for(const e of r)i(t,n,e);else i(t,n,r);}function i(t,n,r){const s=t&&e.isAlias(r)?r.resolve(t.doc):r;if(!e.isMap(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[e,t]of i)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:true,enumerable:true,configurable:true});return n}return Nt.addMergeToJSMap=s,Nt.isMergeKey=(n,s)=>(r.identify(s)||e.isScalar(s)&&(!s.type||s.type===t.Scalar.PLAIN)&&r.identify(s.value))&&n?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default),Nt.merge=r,Nt}function Mt(){if(Pt)return Ot;Pt=1;var e=Ct(),t=It(),n=Et(),r=Ne(),s=Xe();return Ot.addPairToJSMap=function(i,o,{key:a,value:c}){if(r.isNode(a)&&a.addToJSMap)a.addToJSMap(i,o,c);else if(t.isMergeKey(i,a))t.addMergeToJSMap(i,o,c);else {const t=s.toJS(a,"",i);if(o instanceof Map)o.set(t,s.toJS(c,t,i));else if(o instanceof Set)o.add(t);else {const u=function(t,s,i){if(null===s)return "";if("object"!=typeof s)return String(s);if(r.isNode(t)&&i?.doc){const r=n.createStringifyContext(i.doc,{});r.anchors=new Set;for(const e of i.anchors.keys())r.anchors.add(e.anchor);r.inFlow=true,r.inStringifyKey=true;const s=t.toString(r);if(!i.mapKeyWarned){let t=JSON.stringify(s);t.length>40&&(t=t.substring(0,36)+'..."'),e.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=true;}return s}return JSON.stringify(s)}(a,t,i),l=s.toJS(c,u,i);u in o?Object.defineProperty(o,u,{value:l,writable:true,enumerable:true,configurable:true}):o[u]=l;}}return o},Ot}function Dt(){if(Lt)return pt;Lt=1;var e=ut(),t=xt(),n=Mt(),r=Ne();let s=class e{constructor(e,t=null){Object.defineProperty(this,r.NODE_TYPE,{value:r.PAIR}),this.key=e,this.value=t;}clone(t){let{key:n,value:s}=this;return r.isNode(n)&&(n=n.clone(t)),r.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return n.addPairToJSMap(t,r,this)}toString(e,n,r){return e?.doc?t.stringifyPair(this,e,n,r):JSON.stringify(this)}};return pt.Pair=s,pt.createPair=function(t,n,r){const i=e.createNode(t,void 0,r),o=e.createNode(n,void 0,r);return new s(i,o)},pt}var jt,Ht,Ft,Bt={},zt={},Kt={},Ut={};function qt(){if(jt)return Ut;jt=1;var e=Ne(),t=Et(),n=mt();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let g=false;const m=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!g&&c.spaceBefore&&m.push(""),i(o,m,c.commentBefore,g),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!g&&t.spaceBefore&&m.push(""),i(o,m,t.commentBefore,g));}g=false;let f=t.stringify(c,d,()=>l=null,()=>g=true);l&&(f+=n.lineComment(f,u,h(l))),g&&l&&(g=false),m.push(a+f);}let y;if(0===m.length)y=c.start+c.end;else {y=m[0];for(let e=1;e<m.length;++e){const t=m[e];y+=t?`\n${p}${t}`:"\n";}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):g&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:true,type:null});let h=false,d=0;const g=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&g.push(""),i(s,g,c.commentBefore,false),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&g.push(""),i(s,g,t.commentBefore,false),t.comment&&(h=true));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=true)):null==c.value&&t?.comment&&(u=t.comment);}u&&(h=true);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(g.length>d||l.includes("\n"))&&(h=true),g.push(l),d=g.length;}const{start:m,end:y}=o;if(0===g.length)return m+y;if(!h){const e=g.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth;}if(h){let e=m;for(const t of g)e+=t?`\n${u}${c}${t}`:"\n";return `${e}\n${c}${y}`}return `${m}${l}${g.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart());}}return Ut.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ut}function Zt(){if(Ht)return Kt;Ht=1;var e=qt(),t=Mt(),n=lt(),r=Ne(),s=Dt(),i=ct();function o(e,t){const n=r.isScalar(t)?t.value:t;for(const s of e)if(r.isPair(s)){if(s.key===t||s.key===n)return s;if(r.isScalar(s.key)&&s.key.value===n)return s}}let a=class extends n.Collection{static get tagName(){return "tag:yaml.org,2002:map"}constructor(e){super(r.MAP,e),this.items=[];}static from(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new this(e),a=(e,a)=>{if("function"==typeof i)a=i.call(t,e,a);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==a||r)&&o.items.push(s.createPair(e,a,n));};if(t instanceof Map)for(const[e,n]of t)a(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))a(e,t[e]);return "function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=r.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new s.Pair(e.key,e.value):new s.Pair(e,e?.value);const a=o(this.items,n.key),c=this.schema?.sortMapEntries;if(a){if(!t)throw new Error(`Key ${n.key} already set`);r.isScalar(a.value)&&i.isScalarValue(n.value)?a.value.value=n.value:a.value=n.value;}else if(c){const e=this.items.findIndex(e=>c(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n);}else this.items.push(n);}delete(e){const t=o(this.items,e);if(!t)return false;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=o(this.items,e),s=n?.value;return (!t&&r.isScalar(s)?s.value:s)??void 0}has(e){return !!o(this.items,e)}set(e,t){this.add(new s.Pair(e,t),true);}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const e of this.items)t.addPairToJSMap(n,s,e);return s}toString(t,n,s){if(!t)return JSON.stringify(this);for(const e of this.items)if(!r.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return !t.allNullValues&&this.hasAllNullValues(false)&&(t=Object.assign({},t,{allNullValues:true})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Kt.YAMLMap=a,Kt.findPair=o,Kt}function Wt(){if(Ft)return zt;Ft=1;var e=Ne(),t=Zt();const n={collection:"map",default:true,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(t,n)=>(e.isMap(t)||n("Expected a mapping for this tag"),t),createNode:(e,n,r)=>t.YAMLMap.from(e,n,r)};return zt.map=n,zt}var Gt,Vt,Yt={},Qt={};function Jt(){if(Gt)return Qt;Gt=1;var e=ut(),t=qt(),n=lt(),r=Ne(),s=ct(),i=Xe();let o=class extends n.Collection{static get tagName(){return "tag:yaml.org,2002:seq"}constructor(e){super(r.SEQ,e),this.items=[];}add(e){this.items.push(e);}delete(e){const t=a(e);if("number"!=typeof t)return false;return this.items.splice(t,1).length>0}get(e,t){const n=a(e);if("number"!=typeof n)return;const s=this.items[n];return !t&&r.isScalar(s)?s.value:s}has(e){const t=a(e);return "number"==typeof t&&t<this.items.length}set(e,t){const n=a(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];r.isScalar(i)&&s.isScalarValue(t)?i.value=t:this.items[n]=t;}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(i.toJS(e,String(r++),t));return n}toString(e,n,r){return e?t.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let t=0;for(let o of n){if("function"==typeof s){const e=n instanceof Set?o:String(t++);o=s.call(n,e,o);}i.items.push(e.createNode(o,void 0,r));}}return i}};function a(e){let t=r.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}return Qt.YAMLSeq=o,Qt}function Xt(){if(Vt)return Yt;Vt=1;var e=Ne(),t=Jt();const n={collection:"seq",default:true,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(t,n)=>(e.isSeq(t)||n("Expected a sequence for this tag"),t),createNode:(e,n,r)=>t.YAMLSeq.from(e,n,r)};return Yt.seq=n,Yt}var en,tn={};function nn(){if(en)return tn;en=1;var e=kt();const t={identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:true},n),e.stringifyString(t,n,r,s))};return tn.string=t,tn}var rn,sn={},on$1={};function an(){if(rn)return on$1;rn=1;var e=ct();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e.Scalar(null),stringify:({source:e},n)=>"string"==typeof e&&t.test.test(e)?e:n.options.nullStr};return on$1.nullTag=t,on$1}var cn,un={};function ln(){if(cn)return un;cn=1;var e=ct();const t={identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new e.Scalar("t"===t[0]||"T"===t[0]),stringify({source:e,value:n},r){if(e&&t.test.test(e)){if(n===("t"===e[0]||"T"===e[0]))return e}return n?r.options.trueStr:r.options.falseStr}};return un.boolTag=t,un}var fn,pn,hn={},dn={};function gn(){if(fn)return dn;return fn=1,dn.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0";}return i},dn}function mn(){if(pn)return hn;pn=1;var e=ct(),t=gn();const n={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new e.Scalar(parseFloat(t)),r=t.indexOf(".");return -1!==r&&"0"===t[t.length-1]&&(n.minFractionDigits=t.length-r-1),n},stringify:t.stringifyNumber};return hn.float=s,hn.floatExp=r,hn.floatNaN=n,hn}var yn,vn={};function _n(){if(yn)return vn;yn=1;var e=gn();const t=e=>"bigint"==typeof e||Number.isInteger(e),n=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function r(n,r,s){const{value:i}=n;return t(i)&&i>=0?s+i.toString(r):e.stringifyNumber(n)}const s={identify:e=>t(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>n(e,2,8,r),stringify:e=>r(e,8,"0o")},i={identify:t,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},o={identify:e=>t(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return vn.int=i,vn.intHex=o,vn.intOct=s,vn}var bn,wn={};function Sn(){if(bn)return wn;bn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=ln(),i=mn(),o=_n();const a=[e.map,n.seq,r.string,t.nullTag,s.boolTag,o.intOct,o.int,o.intHex,i.floatNaN,i.floatExp,i.float];return wn.schema=a,wn}var An,kn={};function En(){if(An)return kn;An=1;var e=ct(),t=Wt(),n=Xt();function r(e){return "bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>r(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:s}],o={default:true,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return kn.schema=a,kn}var xn,$n={};function On(){if(xn)return $n;xn=1;var e=require$$0$1,t=ct(),n=kt();const r={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(t,n){if("function"==typeof e.Buffer)return e.Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t);return n}return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:r,type:s,value:i},o,a,c){if(!i)return "";const u=i;let l;if("function"==typeof e.Buffer)l=u instanceof e.Buffer?u.toString("base64"):e.Buffer.from(u.buffer).toString("base64");else {if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<u.length;++t)e+=String.fromCharCode(u[t]);l=btoa(e);}}if(s??(s=t.Scalar.BLOCK_LITERAL),s!==t.Scalar.QUOTE_DOUBLE){const e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),n=Math.ceil(l.length/e),r=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)r[t]=l.substr(s,e);l=r.join(s===t.Scalar.BLOCK_LITERAL?"\n":" ");}return n.stringifyString({comment:r,type:s,value:l},o,a,c)}};return $n.binary=r,$n}var Rn,Cn,Tn={},Pn={};function Ln(){if(Rn)return Pn;Rn=1;var e=Ne(),t=Dt(),n=ct(),r=Jt();function s(r,s){if(e.isSeq(r))for(let i=0;i<r.items.length;++i){let o=r.items[i];if(!e.isPair(o)){if(e.isMap(o)){o.items.length>1&&s("Each pair must have its own sequence indicator");const e=o.items[0]||new t.Pair(new n.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment;}o=e;}r.items[i]=e.isPair(o)?o:new t.Pair(o);}}else s("Expected a sequence for this tag");return r}function i(e,n,s){const{replacer:i}=s,o=new r.YAMLSeq(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let e of n){let r,c;if("function"==typeof i&&(e=i.call(n,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);r=e[0],c=e[1];}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);r=t[0],c=e[r];}else r=e;o.items.push(t.createPair(r,c,s));}return o}const o={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return Pn.createPairs=i,Pn.pairs=o,Pn.resolvePairs=s,Pn}function Nn(){if(Cn)return Tn;Cn=1;var e=Ne(),t=Xe(),n=Zt(),r=Jt(),s=Ln();class i extends r.YAMLSeq{constructor(){super(),this.add=n.YAMLMap.prototype.add.bind(this),this.delete=n.YAMLMap.prototype.delete.bind(this),this.get=n.YAMLMap.prototype.get.bind(this),this.has=n.YAMLMap.prototype.has.bind(this),this.set=n.YAMLMap.prototype.set.bind(this),this.tag=i.tag;}toJSON(n,r){if(!r)return super.toJSON(n);const s=new Map;r?.onCreate&&r.onCreate(s);for(const n of this.items){let i,o;if(e.isPair(n)?(i=t.toJS(n.key,"",r),o=t.toJS(n.value,i,r)):i=t.toJS(n,"",r),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o);}return s}static from(e,t,n){const r=s.createPairs(e,t,n),i=new this;return i.items=r.items,i}}i.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:i,default:false,tag:"tag:yaml.org,2002:omap",resolve(t,n){const r=s.resolvePairs(t,n),o=[];for(const{key:t}of r.items)e.isScalar(t)&&(o.includes(t.value)?n(`Ordered maps must not include duplicate keys: ${t.value}`):o.push(t.value));return Object.assign(new i,r)},createNode:(e,t,n)=>i.from(e,t,n)};return Tn.YAMLOMap=i,Tn.omap=o,Tn}var In,Mn={},Dn={};function jn(){if(In)return Dn;In=1;var e=ct();function t({value:e,source:t},s){return t&&(e?n:r).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const n={identify:e=>true===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(true),stringify:t},r={identify:e=>false===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(false),stringify:t};return Dn.falseTag=r,Dn.trueTag=n,Dn}var Hn,Fn={};function Bn(){if(Hn)return Fn;Hn=1;var e=ct(),t=gn();const n={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new e.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(-1!==r){const e=t.substring(r+1).replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length);}return n},stringify:t.stringifyNumber};return Fn.float=s,Fn.floatExp=r,Fn.floatNaN=n,Fn}var zn,Kn={};function Un(){if(zn)return Kn;zn=1;var e=gn();const t=e=>"bigint"==typeof e||Number.isInteger(e);function n(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;}const t=BigInt(e);return "-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return "-"===s?-1*i:i}function r(n,r,s){const{value:i}=n;if(t(i)){const e=i.toString(r);return i<0?"-"+s+e.substr(1):s+e}return e.stringifyNumber(n)}const s={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>n(e,2,2,r),stringify:e=>r(e,2,"0b")},i={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>n(e,1,8,r),stringify:e=>r(e,8,"0")},o={identify:t,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},a={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return Kn.int=o,Kn.intBin=s,Kn.intHex=a,Kn.intOct=i,Kn}var qn,Zn={};function Wn(){if(qn)return Zn;qn=1;var e=Ne(),t=Dt(),n=Zt();class r extends n.YAMLMap{constructor(e){super(e),this.tag=r.tag;}add(r){let s;s=e.isPair(r)?r:r&&"object"==typeof r&&"key"in r&&"value"in r&&null===r.value?new t.Pair(r.key,null):new t.Pair(r,null);n.findPair(this.items,s.key)||this.items.push(s);}get(t,r){const s=n.findPair(this.items,t);return !r&&e.isPair(s)?e.isScalar(s.key)?s.key.value:s.key:s}set(e,r){if("boolean"!=typeof r)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof r);const s=n.findPair(this.items,e);s&&!r?this.items.splice(this.items.indexOf(s),1):!s&&r&&this.items.push(new t.Pair(e));}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,n);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let e of n)"function"==typeof s&&(e=s.call(n,e,e)),i.items.push(t.createPair(e,null,r));return i}}r.tag="tag:yaml.org,2002:set";const s={collection:"map",identify:e=>e instanceof Set,nodeClass:r,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>r.from(e,t,n),resolve(t,n){if(e.isMap(t)){if(t.hasAllNullValues(true))return Object.assign(new r,t);n("Set items must all have null values");}else n("Expected a mapping for this tag");return t}};return Zn.YAMLSet=r,Zn.set=s,Zn}var Gn,Vn,Yn,Qn,Jn={};function Xn(){if(Gn)return Jn;Gn=1;var e=gn();function t(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return "-"===n?s(-1)*i:i}function n(t){let{value:n}=t,r=e=>e;if("bigint"==typeof n)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return e.stringifyNumber(t);let s="";n<0&&(s="-",n*=r(-1));const i=r(60),o=[n%i];return n<60?o.unshift(0):(n=(n-o[0])/i,o.unshift(n%i),n>=60&&(n=(n-o[0])/i,o.unshift(n))),s+o.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const r={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:r})=>t(e,r),stringify:n},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,false),stringify:n},i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(i.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,s,o,a,c,u]=n.map(Number),l=n[7]?Number((n[7]+"00").substr(1,3)):0;let f=Date.UTC(r,s-1,o,a||0,c||0,u||0,l);const p=n[8];if(p&&"Z"!==p){let e=t(p,false);Math.abs(e)<30&&(e*=60),f-=6e4*e;}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Jn.floatTime=s,Jn.intTime=r,Jn.timestamp=i,Jn}function er(){if(Vn)return Mn;Vn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=On(),i=jn(),o=Bn(),a=Un(),c=It(),u=Nn(),l=Ln(),f=Wn(),p=Xn();const h=[e.map,n.seq,r.string,t.nullTag,i.trueTag,i.falseTag,a.intBin,a.intOct,a.int,a.intHex,o.floatNaN,o.floatExp,o.float,s.binary,c.merge,u.omap,l.pairs,f.set,p.intTime,p.floatTime,p.timestamp];return Mn.schema=h,Mn}function tr(){if(Yn)return sn;Yn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=ln(),i=mn(),o=_n(),a=Sn(),c=En(),u=On(),l=It(),f=Nn(),p=Ln(),h=er(),d=Wn(),g=Xn();const m=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:g.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:g.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:g.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":g.timestamp};return sn.coreKnownTags=v,sn.getTags=function(e,t,n){const r=m.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(m.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[];}if(Array.isArray(e))for(const t of e)s=s.concat(t);else "function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},sn}function nr(){if(Qn)return Bt;Qn=1;var e=Ne(),t=Wt(),n=Xt(),r=nn(),s=tr();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Bt.Schema=class o{constructor({compat:o,customTags:a,merge:c,resolveKnownTags:u,schema:l,sortMapEntries:f,toStringDefaults:p}){this.compat=Array.isArray(o)?s.getTags(o,"compat"):o?s.getTags(null,o):null,this.name="string"==typeof l&&l||"core",this.knownTags=u?s.coreKnownTags:{},this.tags=s.getTags(a,this.name,c),this.toStringOptions=p??null,Object.defineProperty(this,e.MAP,{value:t.map}),Object.defineProperty(this,e.SCALAR,{value:r.string}),Object.defineProperty(this,e.SEQ,{value:n.seq}),this.sortMapEntries="function"==typeof f?f:true===f?i:null;}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Bt}var rr,sr,ir={};function or(){if(rr)return ir;rr=1;var e=Ne(),t=Et(),n=mt();return ir.stringifyDocument=function(r,s){const i=[];let o=true===s.directives;if(false!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=true):r.directives.docStart&&(o=true);}o&&i.push("---");const a=t.createStringifyContext(r,s),{commentString:c}=a.options;if(r.commentBefore){1!==i.length&&i.unshift("");const e=c(r.commentBefore);i.unshift(n.indentComment(e,""));}let u=false,l=null;if(r.contents){if(e.isNode(r.contents)){if(r.contents.spaceBefore&&o&&i.push(""),r.contents.commentBefore){const e=c(r.contents.commentBefore);i.push(n.indentComment(e,""));}a.forceBlockIndent=!!r.comment,l=r.contents.comment;}const s=l?void 0:()=>u=true;let f=t.stringify(r.contents,a,()=>l=null,s);l&&(f+=n.lineComment(f,"",c(l))),"|"!==f[0]&&">"!==f[0]||"---"!==i[i.length-1]?i.push(f):i[i.length-1]=`--- ${f}`;}else i.push(t.stringify(r.contents,a));if(r.directives?.docEnd)if(r.comment){const e=c(r.comment);e.includes("\n")?(i.push("..."),i.push(n.indentComment(e,""))):i.push(`... ${e}`);}else i.push("...");else {let e=r.comment;e&&u&&(e=e.replace(/^\n+/,"")),e&&(u&&!l||""===i[i.length-1]||i.push(""),i.push(n.indentComment(c(e),"")));}return i.join("\n")+"\n"},ir}function ar(){if(sr)return Be;sr=1;var e=tt(),t=lt(),n=Ne(),r=Dt(),s=Xe(),i=nr(),o=or(),a=Ue(),c=Ge(),u=ut(),l=He();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return Be.Document=class p{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r);}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e);}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t);}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n;}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t;}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:g}=a.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:i??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:g},y=u.createNode(e,p,m);return c&&n.isCollection(y)&&(y.flow=true),d(),y}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new r.Pair(s,i)}delete(e){return !!f(this.contents)&&this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,true):!!f(this.contents)&&this.contents.deleteIn(e)}get(e,t){return n.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,r){return t.isEmptyPath(e)?!r&&n.isScalar(this.contents)?this.contents.value:this.contents:n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return !!n.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:!!n.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,n){null==this.contents?this.contents=t.collectionFromPath(this.schema,[e],n):f(this.contents)&&this.contents.set(e,n);}setIn(e,n){t.isEmptyPath(e)?this.contents=n:null==this.contents?this.contents=t.collectionFromPath(this.schema,Array.from(e),n):f(this.contents)&&this.contents.setIn(e,n);}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case "1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new l.Directives({version:"1.1"}),n={resolveKnownTags:false,schema:"yaml-1.1"};break;case "1.2":case "next":this.directives?this.directives.yaml.version=e:this.directives=new l.Directives({version:e}),n={resolveKnownTags:true,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else {if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new i.Schema(Object.assign(n,t));}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:true===n,mapKeyWarned:false,maxAliasCount:"number"==typeof r?r:100},u=s.toJS(this.contents,t??"",a);if("function"==typeof i)for(const{count:e,res:t}of a.anchors.values())i(t,e);return "function"==typeof o?c.applyReviver(o,{"":u},"",u):u}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return o.stringifyDocument(this,e)}},Be}var cr,ur={};function lr(){if(cr)return ur;cr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ur.YAMLError=e,ur.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ur.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ur.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1;}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o;}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`;}},ur}var fr,pr={},hr={},dr={},gr={},mr={};function yr(){if(fr)return mr;return fr=1,mr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=false,u=a,l=a,f="",p="",h=false,d=false,g=null,m=null,y=null,v=null,_=null,b=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=false),g&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),s.type){case "space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(g=s),l=true;break;case "comment":{l||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=s.source.substring(1)||" ";f?f+=p+e:f=e,p="",u=false;break}case "newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=true):p+=s.source,u=true,h=true,(m||y)&&(v=s),l=true;break;case "anchor":m&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true),m=s,w??(w=s.offset),u=false,l=false,d=true;break;case "tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=false,l=false,d=true;break;case n:(m||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),b&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),b=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=false;break;case "comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=false,l=false;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=false,l=false;}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:A,start:w??A}},mr}var vr,_r={};function br(){if(vr)return _r;return vr=1,_r.containsNewline=function e(t){if(!t)return null;switch(t.type){case "alias":case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":if(t.source.includes("\n"))return true;if(t.end)for(const e of t.end)if("newline"===e.type)return true;return false;case "flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return true;if(n.sep)for(const e of n.sep)if("newline"===e.type)return true;if(e(n.key)||e(n.value))return true}return false;default:return true}},_r}var wr,Sr={};function Ar(){if(wr)return Sr;wr=1;var e=br();return Sr.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const s=n.end[0];if(s.indent===t&&("]"===s.source||"}"===s.source)&&e.containsNewline(n)){r(s,"BAD_INDENT","Flow end indicator should be more indented than parent",true);}}},Sr}var kr,Er,xr={};function $r(){if(kr)return xr;kr=1;var e=Ne();return xr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(false===s)return false;const i="function"==typeof s?s:(t,n)=>t===n||e.isScalar(t)&&e.isScalar(n)&&t.value===n.value;return n.some(e=>i(e.key,r))},xr}function Or(){if(Er)return gr;Er=1;var e=Dt(),t=Zt(),n=yr(),r=br(),s=Ar(),i=$r();const o="All mapping items must start at the same column";return gr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=false);let d=l.offset,g=null;for(const t of l.items){const{start:p,key:m,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:m??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:true}),b=!_.found;if(b){if(m&&("block-seq"===m.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){g=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(m))&&f(m??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line");}else _.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=true;const w=_.end,S=m?a(u,m,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,m,f),u.atKey=false,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!m||"block-scalar"===m.type});if(d=A.end,A.found){b&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&_.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r);}else {b&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n);}}return g&&g<d&&f(g,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,g??d],h},gr}var Rr,Cr={};function Tr(){if(Rr)return Cr;Rr=1;var e=Jt(),t=yr(),n=Ar();return Cr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=false),i.atKey&&(i.atKey=false);let l=o.offset,f=null;for(const{start:e,value:c}of o.items){const p=t.resolveProps(e,{indicator:"seq-item-ind",next:c,offset:l,onError:a,parentIndent:o.indent,startOnNewline:true});if(!p.found){if(!(p.anchor||p.tag||c)){f=p.end,p.comment&&(u.comment=p.comment);continue}c&&"block-seq"===c.type?a(p.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator");}const h=c?r(i,c,p,a):s(i,p.end,e,null,p,a);i.schema.compat&&n.flowIndentCheck(o.indent,c,a),l=h.range[2],u.items.push(h);}return u.range=[o.offset,l,f??l],u},Cr}var Pr,Lr,Nr,Ir={},Mr={};function Dr(){if(Pr)return Mr;return Pr=1,Mr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=false,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case "space":i=true;break;case "comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";s?s+=o+t:s=t,o="";break}case "newline":s&&(o+=e),i=true;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`);}t+=e.length;}}return {comment:s,offset:t}},Mr}function jr(){if(Lr)return Ir;Lr=1;var e=Ne(),t=Dt(),n=Zt(),r=Jt(),s=Dr(),i=yr(),o=br(),a=$r();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Ir.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,g){const m="{"===h.start.source,y=m?"flow map":"flow sequence",v=new(g?.nodeClass??(m?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=true;const _=p.atRoot;_&&(p.atRoot=false),p.atKey&&(p.atKey=false);let b=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:g,key:_,sep:w,value:S}=s,A=i.resolveProps(g,{flow:y,indicator:"explicit-key-ind",next:_??w?.[0],offset:b,onError:d,parentIndent:h.indent,startOnNewline:false});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),b=A.end;continue}!m&&p.options.strict&&o.containsNewline(_)&&d(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of g)switch(e.type){case "comma":case "space":break;case "comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1);}}if(m||w||A.found){p.atKey=true;const e=A.end,r=_?l(p,_,A,d):f(p,e,g,null,A,d);u(_)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=false;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:false});if(o.found){if(!m&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),m){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E);}else {const e=new n.YAMLMap(p.schema);e.flow=true,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e);}b=k?k.range[2]:o.end;}else {const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),b=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c);}}const w=m?"}":"]",[S,...A]=h.end;let k=b;if(S&&S.source===w)k=S.offset+S.source.length;else {const e=y[0].toUpperCase()+y.substring(1);d(b,_?"MISSING_CHAR":"BAD_INDENT",_?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S);}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset];}else v.range=[h.offset,k,k];return v},Ir}function Hr(){if(Nr)return dr;Nr=1;var e=Ne(),t=ct(),n=Zt(),r=Jt(),s=Or(),i=Tr(),o=jr();function a(e,t,n,r,a,c){const u="block-map"===n.type?s.resolveBlockMap(e,t,n,r,c):"block-seq"===n.type?i.resolveBlockSeq(e,t,n,r,c):o.resolveFlowCollection(e,t,n,r,c),l=u.constructor;return "!"===a||a===l.tagName?(u.tag=l.tagName,u):(a&&(u.tag=a),u)}return dr.composeCollection=function(s,i,o,c,u){const l=c.tag,f=l?i.directives.tagName(l.source,e=>u(l,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===o.type){const{anchor:e,newlineAfterProp:t}=c,n=e&&l?e.offset>l.offset?e:l:e??l;if(n&&(!t||t.offset<n.offset)){u(n,"MISSING_CHAR","Missing newline after block sequence props");}}const p="block-map"===o.type?"map":"block-seq"===o.type?"seq":"{"===o.start.source?"map":"seq";if(!l||!f||"!"===f||f===n.YAMLMap.tagName&&"map"===p||f===r.YAMLSeq.tagName&&"seq"===p)return a(s,i,o,u,f);let h=i.schema.tags.find(e=>e.tag===f&&e.collection===p);if(!h){const e=i.schema.knownTags[f];if(!e||e.collection!==p)return e?u(l,"BAD_COLLECTION_TYPE",`${e.tag} used for ${p} collection, but expects ${e.collection??"scalar"}`,true):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,true),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:false})),h=e;}const d=a(s,i,o,u,f,h),g=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,m=e.isNode(g)?g:new t.Scalar(g);return m.range=d.range,m.tag=f,h?.format&&(m.format=h.format),m},dr}var Fr,Br={},zr={};function Kr(){if(Fr)return zr;Fr=1;var e=ct();return zr.resolveBlockScalar=function(t,n,r){const s=n.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let t=1;t<s.length;++t){const n=s[t];if(a||"-"!==n&&"+"!==n){const r=Number(n);!o&&r?o=r:-1===c&&(c=e+t);}else a=n;} -1!==c&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=false,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case "space":u=true;case "newline":f+=s.source.length;break;case "comment":if(n&&!u){r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");}f+=s.source.length,l=s.source.substring(1);break;case "error":r(s,"UNEXPECTED_TOKEN",s.message),f+=s.source.length;break;default:{r(s,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${s.type}`);const e=s.source;e&&"string"==typeof e&&(f+=e.length);}}}return {mode:i,indent:o,chomp:a,comment:l,length:f}}(n,t.options.strict,r);if(!i)return {value:"",type:null,comment:"",range:[s,s,s]};const o=">"===i.mode?e.Scalar.BLOCK_FOLDED:e.Scalar.BLOCK_LITERAL,a=n.source?function(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(n.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e;}if(0===c){const e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let t=s+i.length;return n.source&&(t+=n.source.length),{value:e,type:o,comment:i.comment,range:[s,t,t]}}let u=n.indent+i.indent,l=n.offset+i.length,f=0;for(let e=0;e<c;++e){const[n,s]=a[e];if(""!==s&&"\r"!==s){if(n.length<u){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(l+n.length,"MISSING_CHAR",e);}if(0===i.indent&&(u=n.length),f=e,0===u&&!t.atRoot){r(l,"BAD_INDENT","Block scalar values in collections must be indented");}break}0===i.indent&&n.length>u&&(u=n.length),l+=n.length+s.length+1;}for(let e=a.length-1;e>=c;--e)a[e][0].length>u&&(c=e+1);let p="",h="",d=false;for(let e=0;e<f;++e)p+=a[e][0].slice(u)+"\n";for(let t=f;t<c;++t){let[n,s]=a[t];l+=n.length+s.length+1;const c="\r"===s[s.length-1];if(c&&(s=s.slice(0,-1)),s&&n.length<u){const e=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-s.length-(c?2:1),"BAD_INDENT",e),n="";}o===e.Scalar.BLOCK_LITERAL?(p+=h+n.slice(u)+s,h="\n"):n.length>u||"\t"===s[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),p+=h+n.slice(u)+s,h="\n",d=true):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=false);}switch(i.chomp){case "-":break;case "+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n";}const g=s+i.length+n.source.length;return {value:p,type:o,comment:i.comment,range:[s,g,g]}},zr}var Ur,qr,Zr={};function Wr(){if(Ur)return Zr;Ur=1;var e=ct(),t=Dr();function n(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy");}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy;}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)""===r[1]?"\n"===i?s+=i:i="\n":(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+(r?.[1]??"")}function r(e,t){let n="",r=e[t+1];for(;!(" "!==r&&"\t"!==r&&"\n"!==r&&"\r"!==r||"\r"===r&&"\n"!==e[t+2]);)"\n"===r&&(n+="\n"),r=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const s={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function i(e,t,n,r){const s=e.substr(t,n),i=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(i)){const s=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}return String.fromCodePoint(i)}return Zr.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const g=(e,t,n)=>c(u+e,t,n);switch(l){case "scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case "\t":r="a tab character";break;case ",":r="flow indicator character ,";break;case "%":r="directive indicator character %";break;case "|":case ">":r=`block scalar indicator ${e[0]}`;break;case "@":case "`":r=`reserved character ${e[0]}`;}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,g);break;case "single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,g);break;case "double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s;}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s;}else {const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r;}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a);}else n+=a;}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,g);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const m=u+f.length,y=t.resolveEnd(p,m,a,c);return {value:d,type:h,comment:y.comment,range:[u,m,y.offset]}},Zr}function Gr(){if(qr)return Br;qr=1;var e=Ne(),t=ct(),n=Kr(),r=Wr();return Br.composeScalar=function(s,i,o,a){const{value:c,type:u,comment:l,range:f}="block-scalar"===i.type?n.resolveBlockScalar(s,i,a):r.resolveFlowScalar(i,s.options.strict,a),p=o?s.directives.tagName(o.source,e=>a(o,"TAG_RESOLVE_FAILED",e)):null;let h,d;h=s.options.stringKeys&&s.atKey?s.schema[e.SCALAR]:p?function(t,n,r,s,i){if("!"===r)return t[e.SCALAR];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===r){if(!e.default||!e.test)return e;o.push(e);}for(const e of o)if(e.test?.test(n))return e;const a=t.knownTags[r];if(a&&!a.collection)return t.tags.push(Object.assign({},a,{default:false,test:void 0})),a;return i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),t[e.SCALAR]}(s.schema,c,p,o,a):"scalar"===i.type?function({atKey:t,directives:n,schema:r},s,i,o){const a=r.tags.find(e=>(true===e.default||t&&"key"===e.default)&&e.test?.test(s))||r[e.SCALAR];if(r.compat){const t=r.compat.find(e=>e.default&&e.test?.test(s))??r[e.SCALAR];if(a.tag!==t.tag){o(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n.tagString(a.tag)} or ${n.tagString(t.tag)}`,true);}}return a}(s,c,i,a):s.schema[e.SCALAR];try{const n=h.resolve(c,e=>a(o??i,"TAG_RESOLVE_FAILED",e),s.options);d=e.isScalar(n)?n:new t.Scalar(n);}catch(e){const n=e instanceof Error?e.message:String(e);a(o??i,"TAG_RESOLVE_FAILED",n),d=new t.Scalar(c);}return d.range=f,d.source=c,u&&(d.type=u),p&&(d.tag=p),h.format&&(d.format=h.format),l&&(d.comment=l),d},Br}var Vr,Yr,Qr,Jr,Xr={};function es(){if(Vr)return Xr;return Vr=1,Xr.emptyScalarPosition=function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case "space":case "comment":case "newline":e-=n.source.length;continue}for(n=t[++r];"space"===n?.type;)e+=n.source.length,n=t[++r];break}}return e},Xr}function ts(){if(Yr)return hr;Yr=1;var e=tt(),t=Ne(),n=Hr(),r=Gr(),s=Dr(),i=es();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:g}=u;let m,y=true;switch(a.type){case "alias":m=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||g)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "block-scalar":m=r.composeScalar(i,a,g,l),d&&(m.anchor=d.source.substring(1));break;case "block-map":case "block-seq":case "flow-collection":m=n.composeCollection(o,i,a,u,l),d&&(m.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),m=c(i,a.offset,void 0,null,u,l),y=false;}if(d&&""===m.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(m)||"string"!=typeof m.value||m.tag&&"tag:yaml.org,2002:str"!==m.tag)){l(g??a,"NON_STRING_KEY","With stringKeys, all keys must be strings");}return p&&(m.spaceBefore=true),h&&("scalar"===a.type&&""===a.source?m.comment=h:m.commentBefore=h),i.options.keepSourceTokens&&y&&(m.srcToken=a),m}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=true),a&&(h.comment=a,h.range[2]=l),h}return hr.composeEmptyNode=c,hr.composeNode=a,hr}function ns(){if(Qr)return pr;Qr=1;var e=ar(),t=ts(),n=Dr(),r=yr();return pr.composeDoc=function(s,i,{offset:o,start:a,value:c,end:u},l){const f=Object.assign({_directives:i},s),p=new e.Document(void 0,f),h={atKey:false,atRoot:true,directives:p.directives,options:p.options,schema:p.schema},d=r.resolveProps(a,{indicator:"doc-start",next:c??u?.[0],offset:o,onError:l,parentIndent:0,startOnNewline:true});d.found&&(p.directives.docStart=true,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const g=p.contents.range[2],m=n.resolveEnd(u,g,false,l);return m.comment&&(p.comment=m.comment),p.range=[o,g,m.offset],p},pr}function rs(){if(Jr)return Te;Jr=1;var e=S,t=He(),n=ar(),r=lr(),s=Ne(),i=ns(),o=Dr();function a(e){if("number"==typeof e)return [e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return [t,t+("string"==typeof n?n.length:1)]}function c(e){let t="",n=false,r=false;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case "#":t+=(""===t?"":r?"\n\n":"\n")+(i.substring(1)||" "),n=true,r=false;break;case "%":"#"!==e[s+1]?.[0]&&(s+=1),n=false;break;default:n||(r=true),n=false;}}return {comment:t,afterEmptyLine:r}}return Te.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=false,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=a(e);s?this.warnings.push(new r.YAMLWarning(i,t,n)):this.errors.push(new r.YAMLParseError(i,t,n));},this.directives=new t.Directives({version:e.version||"1.2"}),this.options=e;}decorate(e,t){const{comment:n,afterEmptyLine:r}=c(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(s.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];s.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n;}else {const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n;}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[];}streamInfo(){return {comment:c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=false,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n);}*next(t){switch(e.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case "directive":this.directives.add(t.source,(e,n,r)=>{const s=a(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r);}),this.prelude.push(t.source),this.atDirectives=true;break;case "document":{const e=i.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,false),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=false;break}case "byte-order-mark":case "space":break;case "comment":case "newline":this.prelude.push(t.source);break;case "error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case "doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=true;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,true),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment;}this.doc.range[2]=e.offset;break}default:this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`));}}*end(e=false,t=-1){if(this.doc)this.decorate(this.doc,true),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,false),yield r;}}},Te}var ss,is={},os={};function as(){if(ss)return os;ss=1;var e=Kr(),t=Wr(),n=lr(),r=kt();function s(e,t){if(t)for(const n of t)switch(n.type){case "space":case "comment":e.push(n);break;case "newline":return e.push(n),true}return false}function i(e,t,n){switch(e.type){case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":e.type=n,e.source=t;break;case "block-scalar":{const r=e.props.slice(1);let s=t.length;"block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length);for(const e of r)e.offset+=s;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case "block-map":case "block-seq":{const r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{const r="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:s});}}}return os.createScalarToken=function(e,t){const{implicitKey:n=false,indent:i,inFlow:o=false,offset:a=-1,type:c="PLAIN"}=t,u=r.stringifyString({type:c,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:o,options:{blockQuote:true,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:"\n"}];switch(u[0]){case "|":case ">":{const e=u.indexOf("\n"),t=u.substring(0,e),n=u.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:a,indent:i,source:t}];return s(r,l)||r.push({type:"newline",offset:-1,indent:i,source:"\n"}),{type:"block-scalar",offset:a,indent:i,props:r,source:n}}case '"':return {type:"double-quoted-scalar",offset:a,indent:i,source:u,end:l};case "'":return {type:"single-quoted-scalar",offset:a,indent:i,source:u,end:l};default:return {type:"scalar",offset:a,indent:i,source:u,end:l}}},os.resolveAsScalar=function(r,s=true,i){if(r){const o=(e,t,r)=>{const s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!i)throw new n.YAMLParseError([s,s+1],t,r);i(s,t,r);};switch(r.type){case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return t.resolveFlowScalar(r,s,o);case "block-scalar":return e.resolveBlockScalar({options:{strict:s}},r,o)}}return null},os.setScalarValue=function(e,t,n={}){let{afterKey:o=false,implicitKey:a=false,inFlow:c=false,type:u}=n,l="indent"in e?e.indent:null;if(o&&"number"==typeof l&&(l+=2),!u)switch(e.type){case "single-quoted-scalar":u="QUOTE_SINGLE";break;case "double-quoted-scalar":u="QUOTE_DOUBLE";break;case "block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");u=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN";}const f=r.stringifyString({type:u,value:t},{implicitKey:a||null===l,indent:null!==l&&l>0?" ".repeat(l):"",inFlow:c,options:{blockQuote:true,lineWidth:-1}});switch(f[0]){case "|":case ">":!function(e,t){const n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=r,e.source=i;}else {const{offset:t}=e,n="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:n,source:r}];s(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:o,source:i});}}(e,f);break;case '"':i(e,f,"double-quoted-scalar");break;case "'":i(e,f,"single-quoted-scalar");break;default:i(e,f,"scalar");}},os}var cs,us={};function ls(){if(cs)return us;cs=1;function e(n){switch(n.type){case "block-scalar":{let t="";for(const r of n.props)t+=e(r);return t+n.source}case "block-map":case "block-seq":{let e="";for(const r of n.items)e+=t(r);return e}case "flow-collection":{let e=n.start.source;for(const r of n.items)e+=t(r);for(const t of n.end)e+=t.source;return e}case "document":{let e=t(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function t({start:t,key:n,sep:r,value:s}){let i="";for(const e of t)i+=e.source;if(n&&(i+=e(n)),r)for(const e of r)i+=e.source;return s&&(i+=e(s)),i}return us.stringify=n=>"type"in n?e(n):t(n),us}var fs,ps,hs={};function ds(){if(fs)return hs;fs=1;const e=Symbol("break visit"),t=Symbol("skip children"),n=Symbol("remove item");function r(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),s(Object.freeze([]),e,t);}function s(t,r,i){let o=i(r,t);if("symbol"==typeof o)return o;for(const a of ["key","value"]){const c=r[a];if(c&&"items"in c){for(let r=0;r<c.items.length;++r){const o=s(Object.freeze(t.concat([[a,r]])),c.items[r],i);if("number"==typeof o)r=o-1;else {if(o===e)return e;o===n&&(c.items.splice(r,1),r-=1);}}"function"==typeof o&&"key"===a&&(o=o(r,t));}}return "function"==typeof o?o(r,t):o}return r.BREAK=e,r.SKIP=t,r.REMOVE=n,r.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r];}return n},r.parentCollection=(e,t)=>{const n=r.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},hs.visit=r,hs}function gs(){if(ps)return is;ps=1;var e=as(),t=ls(),n=ds();return is.createScalarToken=e.createScalarToken,is.resolveAsScalar=e.resolveAsScalar,is.setScalarValue=e.setScalarValue,is.stringify=t.stringify,is.visit=n.visit,is.BOM="\ufeff",is.DOCUMENT="",is.FLOW_END="",is.SCALAR="",is.isCollection=e=>!!e&&"items"in e,is.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),is.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},is.tokenType=function(e){switch(e){case "\ufeff":return "byte-order-mark";case "":return "doc-mode";case "":return "flow-error-end";case "":return "scalar";case "---":return "doc-start";case "...":return "doc-end";case "":case "\n":case "\r\n":return "newline";case "-":return "seq-item-ind";case "?":return "explicit-key-ind";case ":":return "map-value-ind";case "{":return "flow-map-start";case "}":return "flow-map-end";case "[":return "flow-seq-start";case "]":return "flow-seq-end";case ",":return "comma"}switch(e[0]){case " ":case "\t":return "space";case "#":return "comment";case "%":return "directive-line";case "*":return "alias";case "&":return "anchor";case "!":return "tag";case "'":return "single-quoted-scalar";case '"':return "double-quoted-scalar";case "|":case ">":return "block-scalar-header"}return null},is}var ms,ys={};function vs(){if(ms)return ys;ms=1;var e=gs();function t(e){switch(e){case void 0:case " ":case "\n":case "\r":case "\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s=new Set(",[]{}"),i=new Set(" ,[]{}\n\r\t"),o=e=>!e||i.has(e);return ys.Lexer=class{constructor(){this.atEnd=false,this.blockScalarIndent=-1,this.blockScalarKeep=false,this.buffer="",this.flowKey=false,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0;}*lex(e,t=false){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null;}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n);}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return !t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){const n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return "\n"===n||t>=this.indentNext||!n&&!this.atEnd?e+t:-1}if("-"===n||"."===n){const n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return ("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case "stream":return yield*this.parseStream();case "line-start":return yield*this.parseLineStart();case "block-start":return yield*this.parseBlockStart();case "doc":return yield*this.parseDocument();case "flow":return yield*this.parseFlowCollection();case "quoted-scalar":return yield*this.parseQuotedScalar();case "block-scalar":return yield*this.parseBlockScalar();case "plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){const r=t[n-1];if(" "===r||"\t"===r){e=n-1;break}n=t.indexOf("#",n+1);}for(;;){const n=t[e-1];if(" "!==n&&"\t"!==n)break;e-=1;}const r=(yield*this.pushCount(e))+(yield*this.pushSpaces(true));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(true);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(false),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return "doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case "#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel=1,"flow";case "}":case "]":return yield*this.pushCount(1),"doc";case "*":return yield*this.pushUntil(o),"doc";case '"':case "'":return yield*this.parseQuotedScalar();case "|":case ">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(true)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,s=-1;do{n=yield*this.pushNewline(),n>0?(r=yield*this.pushSpaces(false),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(true));}while(n+r>0);const i=this.getLine();if(null===i)return this.setNext("flow");if(-1!==s&&s<this.indentNext&&"#"!==i[0]||0===s&&(i.startsWith("---")||i.startsWith("..."))&&t(i[3])){if(!(s===this.indentNext-1&&1===this.flowLevel&&("]"===i[0]||"}"===i[0])))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart()}let a=0;for(;","===i[a];)a+=(yield*this.pushCount(1)),a+=(yield*this.pushSpaces(true)),this.flowKey=false;switch(a+=(yield*this.pushIndicators()),i[a]){case void 0:return "flow";case "#":return yield*this.pushCount(i.length-a),"flow";case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel+=1,"flow";case "}":case "]":return yield*this.pushCount(1),this.flowKey=true,this.flowLevel-=1,this.flowLevel?"flow":"doc";case "*":return yield*this.pushUntil(o),"flow";case '"':case "'":return this.flowKey=true,yield*this.parseQuotedScalar();case ":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=false,yield*this.pushCount(1),yield*this.pushSpaces(true),"flow"}default:return this.flowKey=false,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1);}const n=this.buffer.substring(0,t);let r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){const e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e);} -1!==r&&(t=r-("\r"===n[r-1]?2:1));}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length;}return yield*this.pushToIndex(t+1,false),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=false;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=true;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case " ":r+=1;break;case "\n":n=e,r=0;break;case "\r":{const t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){ -1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e);}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length;}}let s=n+1;for(t=this.buffer[s];" "===t;)t=this.buffer[++s];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++s];n=s-1;}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);const s=e;for(;" "===t;)t=this.buffer[--e];if(!("\n"===t&&e>=this.pos&&e+1+r>s))break;n=e;}return yield e.SCALAR,yield*this.pushToIndex(n+1,true),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let r,i=this.pos-1,o=this.pos-1;for(;r=this.buffer[++o];)if(":"===r){const e=this.buffer[o+1];if(t(e)||n&&s.has(e))break;i=o;}else if(t(r)){let e=this.buffer[o+1];if("\r"===r&&("\n"===e?(o+=1,r="\n",e=this.buffer[o+1]):i=o),"#"===e||n&&s.has(e))break;if("\n"===r){const e=this.continueScalar(o+1);if(-1===e)break;o=Math.max(o,e-2);}}else {if(n&&s.has(r))break;i=o;}return r||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(i+1,true),n?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield ""),0)}*pushIndicators(){switch(this.charAt(0)){case "!":return (yield*this.pushTag())+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "&":return (yield*this.pushUntil(o))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "-":case "?":case ":":{const e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&s.has(n))return e?this.flowKey&&(this.flowKey=false):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,false)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else {if("%"!==t||!n.has(this.buffer[e+1])||!n.has(this.buffer[e+2]))break;t=this.buffer[e+=3];}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];return "\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n];}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,false)}},ys}var _s,bs={};function ws(){if(_s)return bs;_s=1;return bs.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r;}if(this.lineStarts[t]===e)return {line:t+1,col:1};if(0===t)return {line:0,col:e};return {line:t,col:e-this.lineStarts[t-1]+1}};}},bs}var Ss,As={};function ks(){if(Ss)return As;Ss=1;var e=S,t=gs(),n=vs();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return true;return false}function s(e){for(let t=0;t<e.length;++t)switch(e[t].type){case "space":case "comment":case "newline":break;default:return t}return -1}function i(e){switch(e?.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "flow-collection":return true;default:return false}}function o(e){switch(e.type){case "document":return e.start;case "block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case "block-seq":return e.items[e.items.length-1].start;default:return []}}function a(e){if(0===e.length)return [];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case "doc-start":case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":case "newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function c(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||r(t.start,"explicit-key-ind")||r(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep);}return As.Parser=class{constructor(e){this.atNewLine=true,this.atScalar=false,this.indent=0,this.offset=0,this.onKeyLine=false,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e;}*parse(e,t=false){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end());}*next(n){if(this.source=n,e.env.LOG_TOKENS&&console.log("|",t.prettyToken(n)),this.atScalar)return this.atScalar=false,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=false,this.atScalar=true,this.type="scalar";else {switch(this.type=r,yield*this.step(),r){case "newline":this.atNewLine=true,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case "space":this.atNewLine&&" "===n[0]&&(this.indent+=n.length);break;case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case "doc-mode":case "flow-error-end":return;default:this.atNewLine=false;}this.offset+=n.length;}else {const e=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:n}),this.offset+=n.length;}}*end(){for(;this.stack.length>0;)yield*this.pop();}get sourceToken(){return {type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case "document":return yield*this.document(e);case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return yield*this.scalar(e);case "block-scalar":return yield*this.blockScalar(e);case "block-map":return yield*this.blockMap(e);case "block-seq":return yield*this.blockSequence(e);case "flow-collection":return yield*this.flowCollection(e);case "doc-end":return yield*this.documentEnd(e)}yield*this.pop();}else {for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else {const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&c(t),e.type){case "document":e.value=t;break;case "block-scalar":e.props.push(t);break;case "block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=true);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case "block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case "flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t);}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===s(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1));}}else {const e="Tried to pop an empty stack";yield {type:"error",offset:this.offset,source:"",message:e};}}*stream(){switch(this.type){case "directive-line":return void(yield {type:"directive",offset:this.offset,source:this.source});case "byte-order-mark":case "space":case "comment":case "newline":return void(yield this.sourceToken);case "doc-mode":case "doc-start":{const e={type:"document",offset:this.offset,start:[]};return "doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source};}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case "doc-start":return void(-1!==s(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case "anchor":case "tag":case "space":case "comment":case "newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source};}*scalar(e){if("map-value-ind"===this.type){const t=a(o(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=true,this.stack[this.stack.length-1]=r;}else yield*this.lineEnd(e);}*blockScalar(e){switch(this.type){case "space":case "comment":case "newline":return void e.props.push(this.sourceToken);case "scalar":if(e.source=this.source,this.atNewLine=true,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1;}yield*this.pop();break;default:yield*this.pop(),yield*this.step();}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case "newline":if(this.onKeyLine=false,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case "space":case "comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else {if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken);}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let o=[];if(s&&t.sep&&!t.value){const n=[];for(let r=0;r<t.sep.length;++r){const s=t.sep[r];switch(s.type){case "newline":n.push(r);break;case "space":break;case "comment":s.indent>e.indent&&(n.length=0);break;default:n.length=0;}}n.length>=2&&(o=t.sep.splice(n[1]));}switch(this.type){case "anchor":case "tag":return void(s||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=true):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case "explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:true})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]}):(t.start.push(this.sourceToken),t.explicitKey=true),void(this.onKeyLine=true);case "map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(i(t.key)&&!r(t.sep,"newline")){const e=a(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]});}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else {const e=a(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]});}else t.sep?t.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=true);case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:o,key:n,sep:[]}),this.onKeyLine=true):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=true))}default:{const s=this.startBlockValue(e);if(s){if("block-seq"===s.type){if(!t.explicitKey&&t.sep&&!r(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:o});return void this.stack.push(s)}}}}yield*this.pop(),yield*this.step();}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case "newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else t.start.push(this.sourceToken);return;case "space":case "comment":if(t.value)e.items.push({start:[this.sourceToken]});else {if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken);}return;case "anchor":case "tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case "seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||r(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step();}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1);}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case "comma":case "explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case "map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case "space":case "comment":case "newline":case "anchor":case "tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case "flow-map-end":case "flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step());}else {const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=a(o(t));c(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=true,this.stack[this.stack.length-1]=s;}else yield*this.lineEnd(e);}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1;}return {type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return this.flowScalar(this.type);case "block-scalar-header":return {type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case "flow-map-start":case "flow-seq-start":return {type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case "seq-item-ind":return {type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case "explicit-key-ind":{this.onKeyLine=true;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:true}]}}case "map-value-ind":{this.onKeyLine=true;const t=a(o(e));return {type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return "comment"===this.type&&(!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()));}*lineEnd(e){switch(this.type){case "comma":case "doc-start":case "doc-end":case "flow-seq-end":case "flow-map-end":case "map-value-ind":yield*this.pop(),yield*this.step();break;case "newline":this.onKeyLine=false;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop());}}},As}var Es,xs,$s={};function Os(){if(Es)return $s;Es=1;var e=rs(),t=ar(),n=lr(),r=Ct(),s=Ne(),i=ws(),o=ks();function a(e){const t=false!==e.prettyErrors;return {lineCounter:e.lineCounter||t&&new i.LineCounter||null,prettyErrors:t}}function c(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r);let l=null;for(const e of u.compose(c.parse(t),true,t.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=e;return i&&s&&(l.errors.forEach(n.prettifyError(t,s)),l.warnings.forEach(n.prettifyError(t,s))),l}return $s.parse=function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=c(e,n);if(!i)return null;if(i.warnings.forEach(e=>r.warn(i.options.logLevel,e)),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[];}return i.toJS(Object.assign({reviver:s},n))},$s.parseAllDocuments=function(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r),l=Array.from(u.compose(c.parse(t)));if(i&&s)for(const e of l)e.errors.forEach(n.prettifyError(t,s)),e.warnings.forEach(n.prettifyError(t,s));return l.length>0?l:Object.assign([],{empty:true},u.streamInfo())},$s.parseDocument=c,$s.stringify=function(e,n,r){let i=null;if("function"==typeof n||Array.isArray(n)?i=n:void 0===r&&n&&(r=n),"string"==typeof r&&(r=r.length),"number"==typeof r){const e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e};}if(void 0===e){const{keepUndefined:e}=r??n??{};if(!e)return}return s.isDocument(e)&&!i?e.toString(r):new t.Document(e,i,r).toString(r)},$s}var Rs=function(){if(xs)return Ce;xs=1;var e=rs(),t=ar(),n=nr(),r=lr(),s=tt(),i=Ne(),o=Dt(),a=ct(),c=Zt(),u=Jt(),l=gs(),f=vs(),p=ws(),h=ks(),d=Os(),g=je();return Ce.Composer=e.Composer,Ce.Document=t.Document,Ce.Schema=n.Schema,Ce.YAMLError=r.YAMLError,Ce.YAMLParseError=r.YAMLParseError,Ce.YAMLWarning=r.YAMLWarning,Ce.Alias=s.Alias,Ce.isAlias=i.isAlias,Ce.isCollection=i.isCollection,Ce.isDocument=i.isDocument,Ce.isMap=i.isMap,Ce.isNode=i.isNode,Ce.isPair=i.isPair,Ce.isScalar=i.isScalar,Ce.isSeq=i.isSeq,Ce.Pair=o.Pair,Ce.Scalar=a.Scalar,Ce.YAMLMap=c.YAMLMap,Ce.YAMLSeq=u.YAMLSeq,Ce.CST=l,Ce.Lexer=f.Lexer,Ce.LineCounter=p.LineCounter,Ce.Parser=h.Parser,Ce.parse=d.parse,Ce.parseAllDocuments=d.parseAllDocuments,Ce.parseDocument=d.parseDocument,Ce.stringify=d.stringify,Ce.visit=g.visit,Ce.visitAsync=g.visitAsync,Ce}(),Cs=U(Rs);function Ts(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:false}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r;}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Ps extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Ls extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Ns={};function Is(e){return Ns}function Ms(e,t){return "bigint"==typeof t?t.toString():t}function Ds(e){return {get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function js(e){return null==e}function Hs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Fs=Symbol("evaluating");function Bs(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Fs)return void 0===r&&(r=Fs,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function zs(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Ks(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Us(e){return JSON.stringify(e)}const qs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ws=Ds(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Gs(e){if(false===Zs(e))return false;const t=e.constructor;if(void 0===t)return true;const n=t.prototype;return false!==Zs(n)&&false!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Vs(e){return Gs(e)?{...e}:Array.isArray(e)?[...e]:e}const Ys=new Set(["string","number","symbol"]);function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Js(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Xs(e){const t=e;if(!t)return {};if("string"==typeof t)return {error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function ei(e,t=0){if(true===e.aborted)return true;for(let n=t;n<e.issues.length;n++)if(true!==e.issues[n]?.continue)return true;return false}function ti(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function ni(e){return "string"==typeof e?e:e?.message}function ri(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=ni(e.inst?._zod.def?.error?.(e))??ni(t?.error?.(e))??ni(n.customError?.(e))??ni(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function si(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ii(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const oi=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:false}),Object.defineProperty(e,"issues",{value:t,enumerable:false}),e.message=JSON.stringify(t,Ms,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ai=Ts("$ZodError",oi),ci=Ts("$ZodError",oi,{Parent:Error});const ui=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:false}):{async:false},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Ps;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ri(e,i,Is())));throw qs(t,s?.callee),t}return o.value},li=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:true}):{async:true};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ri(e,i,Is())));throw qs(t,s?.callee),t}return o.value},fi=e=>(t,n,r)=>{const s=r?{...r,async:false}:{async:false},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ps;return i.issues.length?{success:false,error:new(e??ai)(i.issues.map(e=>ri(e,s,Is())))}:{success:true,data:i.value}},pi=fi(ci),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:true}):{async:true};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:false,error:new e(i.issues.map(e=>ri(e,s,Is())))}:{success:true,data:i.value}},di=hi(ci),gi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},mi=e=>(t,n,r)=>ui(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return li(e)(t,n,s)},vi=e=>async(t,n,r)=>li(e)(t,n,r),_i=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fi(e)(t,n,s)},bi=e=>(t,n,r)=>fi(e)(t,n,r),wi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hi(e)(t,n,s)},Si=e=>async(t,n,r)=>hi(e)(t,n,r),Ai=/^[cC][^\s-]{8,}$/,ki=/^[0-9a-z]+$/,Ei=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xi=/^[0-9a-vA-V]{20}$/,$i=/^[A-Za-z0-9]{27}$/,Oi=/^[a-zA-Z0-9_-]{21}$/,Ri=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ci=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ti=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Pi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Li=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ni=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ii=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Di=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ji=/^[A-Za-z0-9_-]*$/,Hi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Fi=/^\+(?:[0-9]){6,14}[0-9]$/,Bi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zi=new RegExp(`^${Bi}$`);function Ki(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return "number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Ui=/^[^A-Z]*$/,qi=/^[^a-z]*$/,Zi=Ts("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Wi=Ts("$ZodCheckMaxLength",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum);}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=si(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Gi=Ts("$ZodCheckMinLength",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum);}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=si(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Vi=Ts("$ZodCheckLengthEquals",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length;}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=si(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Yi=Ts("$ZodCheckStringFormat",(e,t)=>{var n,r;Zi.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern));}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(r=e._zod).check??(r.check=()=>{});}),Qi=Ts("$ZodCheckRegex",(e,t)=>{Yi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),Ji=Ts("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ui),Yi.init(e,t);}),Xi=Ts("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qi),Yi.init(e,t);}),eo=Ts("$ZodCheckIncludes",(e,t)=>{Zi.init(e,t);const n=Qs(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r);}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort});};}),to=Ts("$ZodCheckStartsWith",(e,t)=>{Zi.init(e,t);const n=new RegExp(`^${Qs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n);}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),no=Ts("$ZodCheckEndsWith",(e,t)=>{Zi.init(e,t);const n=new RegExp(`.*${Qs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n);}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};}),ro=Ts("$ZodCheckOverwrite",(e,t)=>{Zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class so{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e);}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const io={major:4,minor:1,patch:11},oo=Ts("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=io;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {const t=(e,t,n)=>{let r,s=ei(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&false===n?.async)throw new Ps;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=ei(e,t)));});else {if(e.issues.length===t)continue;s||(s=ei(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(ei(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new Ps;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:true});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(false===i.async)throw new Ps;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=pi(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return di(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ao=Ts("$ZodString",(e,t)=>{var n;oo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value);}catch(r){}return "string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n};}),co=Ts("$ZodStringFormat",(e,t)=>{Yi.init(e,t),ao.init(e,t);}),uo=Ts("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ci),co.init(e,t);}),lo=Ts("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ti(e));}else t.pattern??(t.pattern=Ti());co.init(e,t);}),fo=Ts("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Pi),co.init(e,t);}),po=Ts("$ZodURL",(e,t)=>{co.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Hi.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});}};}),ho=Ts("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),co.init(e,t);}),go$1=Ts("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Oi),co.init(e,t);}),mo=Ts("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ai),co.init(e,t);}),yo=Ts("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ki),co.init(e,t);}),vo=Ts("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ei),co.init(e,t);}),_o=Ts("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xi),co.init(e,t);}),bo=Ts("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$i),co.init(e,t);}),wo=Ts("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Ki({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Bi}T(?:${r})$`)}(t)),co.init(e,t);}),So=Ts("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zi),co.init(e,t);}),Ao=Ts("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Ki(t)}$`)),co.init(e,t);}),ko=Ts("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ri),co.init(e,t);}),Eo=Ts("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Li),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),xo=Ts("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ni),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6";}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`);}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort});}};}),$o=Ts("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ii),co.init(e,t);}),Oo=Ts("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mi),co.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`);}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort});}};});function Ro(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const Co=Ts("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Di),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Ro(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const To=Ts("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ji),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!ji.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Ro(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort});};}),Po=Ts("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Fi),co.init(e,t);});const Lo=Ts("$ZodJWT",(e,t)=>{co.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return !1;const[r]=n;if(!r)return !1;const s=JSON.parse(atob(r));return !("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return false}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort});};}),No=Ts("$ZodUnknown",(e,t)=>{oo.init(e,t),e._zod.parse=e=>e;}),Io=Ts("$ZodNever",(e,t)=>{oo.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Mo(e,t,n){e.issues.length&&t.issues.push(...ti(n,e.issues)),t.value[n]=e.value;}const Do=Ts("$ZodArray",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Mo(t,n,e))):Mo(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function jo(e,t,n,r){e.issues.length&&t.issues.push(...ti(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Ho(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return {...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fo(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type;for(const s of Object.keys(t)){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>jo(e,n,s,t))):jo(i,n,s,t);}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Bo=Ts("$ZodObject",(e,t)=>{oo.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}});}const r=Ds(()=>Ho(t));Bs(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e);}}return n});const s=Zs,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>jo(n,t,e,a))):jo(r,t,e,a);}return i?Fo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),zo=Ts("$ZodObjectJIT",(e,t)=>{Bo.init(e,t);const n=e._zod.parse,r=Ds(()=>Ho(t));let s;const i=Zs,o=!Ns.jitless,a=o&&Ws.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&false===f?.async&&true!==f.jitless?(s||(s=(e=>{const t=new so(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Us(e);return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=Us(e);t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `);}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return (t,n)=>a(e,t,n)})(t.shape)),l=s(l,f),c?Fo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ko(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!ei(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ri(e,r,Is())))}),t)}const Uo=Ts("$ZodUnion",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Bs(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Bs(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Bs(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Hs(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=false;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=true;else {if(0===t.issues.length)return t;a.push(t);}}return o?Promise.all(a).then(t=>Ko(t,s,e,i)):Ko(a,s,e,i)};}),qo=Ts("$ZodIntersection",(e,t)=>{oo.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>Wo(e,t,n)):Wo(e,s,i)};});function Zo(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return {valid:true,data:e};if(Gs(e)&&Gs(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=Zo(e[n],t[n]);if(!r.valid)return {valid:false,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data;}return {valid:true,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=Zo(e[r],t[r]);if(!s.valid)return {valid:false,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data);}return {valid:true,data:n}}return {valid:false,mergeErrorPath:[]}}function Wo(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ei(e))return e;const r=Zo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Go=Ts("$ZodRecord",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Gs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...ti(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...ti(e,o.issues)),n.value[e]=o.value);}let a;for(const e in s)o.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a});}else {n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ri(e,r,Is())),input:o,path:[o],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...ti(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...ti(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),Vo=Ts("$ZodEnum",(e,t)=>{oo.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Ys.has(typeof e)).map(e=>"string"==typeof e?Qs(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t};}),Yo=Ts("$ZodTransform",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ls(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return (s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n))}if(s instanceof Promise)throw new Ps;return n.value=s,n};});function Qo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Jo=Ts("$ZodOptional",(e,t)=>{oo.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Bs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Bs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Hs(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Qo(t,e.value)):Qo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Xo=Ts("$ZodNullable",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),Bs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Hs(e.source)}|null)$`):void 0}),Bs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n);}),ea=Ts("$ZodDefault",(e,t)=>{oo.init(e,t),e._zod.optin="optional",Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ta(e,t)):ta(r,t)};});function ta(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const na=Ts("$ZodPrefault",(e,t)=>{oo.init(e,t),e._zod.optin="optional",Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n));}),ra=Ts("$ZodNonOptional",(e,t)=>{oo.init(e,t),Bs(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>sa(t,e)):sa(s,e)};});function sa(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ia=Ts("$ZodCatch",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ri(e,n,Is()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ri(e,n,Is()))},input:e.value}),e.issues=[]),e)};}),oa=Ts("$ZodPipe",(e,t)=>{oo.init(e,t),Bs(e._zod,"values",()=>t.in._zod.values),Bs(e._zod,"optin",()=>t.in._zod.optin),Bs(e._zod,"optout",()=>t.out._zod.optout),Bs(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>aa(e,t.in,n)):aa(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aa(e,t.out,n)):aa(r,t.out,n)};});function aa(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const ca=Ts("$ZodReadonly",(e,t)=>{oo.init(e,t),Bs(e._zod,"propValues",()=>t.innerType._zod.propValues),Bs(e._zod,"values",()=>t.innerType._zod.values),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ua):ua(r)};});function ua(e){return e.value=Object.freeze(e.value),e}const la=Ts("$ZodCustom",(e,t)=>{Zi.init(e,t),oo.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>fa(t,n,r,e));fa(s,n,r,e);};});function fa(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ii(e));}}class pa{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e);}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ha(){return new pa}const da=ha();function ga(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Xs(t)})}function ma(e,t){return new Wi({check:"max_length",...Xs(t),maximum:e})}function ya(e,t){return new Gi({check:"min_length",...Xs(t),minimum:e})}function va(e,t){return new Vi({check:"length_equals",...Xs(t),length:e})}function _a(e){return new ro({check:"overwrite",tx:e})}function ba(e){const t=function(e,t){const n=new Zi({check:"custom",...Xs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ii(e,n.value,t._zod.def));else {const r=e;r.fatal&&(r.continue=false),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ii(r));}},e(n.value,n)));return t}const wa=Ts("ZodISODateTime",(e,t)=>{wo.init(e,t),Ga.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Xs(t)})}(wa,e)}const Aa=Ts("ZodISODate",(e,t)=>{So.init(e,t),Ga.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Xs(t)})}(Aa,e)}const Ea=Ts("ZodISOTime",(e,t)=>{Ao.init(e,t),Ga.init(e,t);});function xa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Xs(t)})}(Ea,e)}const $a=Ts("ZodISODuration",(e,t)=>{ko.init(e,t),Ga.init(e,t);});function Oa(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Xs(t)})}($a,e)}const Ra=(e,t)=>{ai.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},s=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else {let e=r,s=0;for(;s<t.path.length;){const r=t.path[s];s===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],s++;}}};return s(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return {formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ms,2);}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ms,2);}},isEmpty:{get:()=>0===e.issues.length}});},Ca=Ts("ZodError",Ra),Ta=Ts("ZodError",Ra,{Parent:Error}),Pa=ui(Ta),La=li(Ta),Na=fi(Ta),Ia=hi(Ta),Ma=gi(Ta),Da=mi(Ta),ja=yi(Ta),Ha=vi(Ta),Fa=_i(Ta),Ba=bi(Ta),za=wi(Ta),Ka=Si(Ta),Ua=Ts("ZodType",(e,t)=>(oo.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ks(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Js(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Pa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Na(e,t,n),e.parseAsync=async(t,n)=>La(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ia(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ma(e,t,n),e.decode=(t,n)=>Da(e,t,n),e.encodeAsync=async(t,n)=>ja(e,t,n),e.decodeAsync=async(t,n)=>Ha(e,t,n),e.safeEncode=(t,n)=>Fa(e,t,n),e.safeDecode=(t,n)=>Ba(e,t,n),e.safeEncodeAsync=async(t,n)=>za(e,t,n),e.safeDecodeAsync=async(t,n)=>Ka(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Xs(n)})}(jc,e,t)}(t,n)),e.superRefine=t=>e.check(ba(t)),e.overwrite=t=>e.check(_a(t)),e.optional=()=>Oc(e),e.nullable=()=>Cc(e),e.nullish=()=>Oc(Cc(e)),e.nonoptional=t=>function(e,t){return new Lc({type:"nonoptional",innerType:e,...Xs(t)})}(e,t),e.array=()=>_c(e),e.or=t=>Sc([e,t]),e.and=t=>new Ac({type:"intersection",left:e,right:t}),e.transform=t=>Mc(e,new xc({type:"transform",transform:t})),e.default=t=>{return n=t,new Tc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():Vs(n)}});var n;},e.prefault=t=>{return n=t,new Pc({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():Vs(n)}});var n;},e.catch=t=>{return new Nc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Mc(e,t),e.readonly=()=>new Dc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return da.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>da.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return da.get(e);const n=e.clone();return da.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),qa=Ts("_ZodString",(e,t)=>{ao.init(e,t),Ua.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"regex",...Xs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new eo({check:"string_format",format:"includes",...Xs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new to({check:"string_format",format:"starts_with",...Xs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new no({check:"string_format",format:"ends_with",...Xs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ya(...t)),e.max=(...t)=>e.check(ma(...t)),e.length=(...t)=>e.check(va(...t)),e.nonempty=(...t)=>e.check(ya(1,...t)),e.lowercase=t=>e.check(function(e){return new Ji({check:"string_format",format:"lowercase",...Xs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Xi({check:"string_format",format:"uppercase",...Xs(e)})}(t)),e.trim=()=>e.check(_a(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return _a(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(_a(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(_a(e=>e.toUpperCase()));}),Za=Ts("ZodString",(e,t)=>{ao.init(e,t),qa.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Xs(t)})}(Va,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Xs(t)})}(Ja,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Xs(t)})}(hc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Xs(t)})}(Xa,t)),e.guid=t=>e.check(ga(Ya,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Xs(t)})}(Qa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Xs(t)})}(Qa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Xs(t)})}(Qa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Xs(t)})}(Qa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Xs(t)})}(ec,t)),e.guid=t=>e.check(ga(Ya,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Xs(t)})}(tc,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Xs(t)})}(nc,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Xs(t)})}(rc,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Xs(t)})}(lc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Xs(t)})}(fc,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Xs(t)})}(sc,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Xs(t)})}(ic,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Xs(t)})}(oc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Xs(t)})}(ac,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Xs(t)})}(cc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Xs(t)})}(uc,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Xs(t)})}(pc,t)),e.datetime=t=>e.check(Sa(t)),e.date=t=>e.check(ka(t)),e.time=t=>e.check(xa(t)),e.duration=t=>e.check(Oa(t));});function Wa(e){return function(e,t){return new e({type:"string",...Xs(t)})}(Za,e)}const Ga=Ts("ZodStringFormat",(e,t)=>{co.init(e,t),qa.init(e,t);}),Va=Ts("ZodEmail",(e,t)=>{fo.init(e,t),Ga.init(e,t);}),Ya=Ts("ZodGUID",(e,t)=>{uo.init(e,t),Ga.init(e,t);}),Qa=Ts("ZodUUID",(e,t)=>{lo.init(e,t),Ga.init(e,t);}),Ja=Ts("ZodURL",(e,t)=>{po.init(e,t),Ga.init(e,t);}),Xa=Ts("ZodEmoji",(e,t)=>{ho.init(e,t),Ga.init(e,t);}),ec=Ts("ZodNanoID",(e,t)=>{go$1.init(e,t),Ga.init(e,t);}),tc=Ts("ZodCUID",(e,t)=>{mo.init(e,t),Ga.init(e,t);}),nc=Ts("ZodCUID2",(e,t)=>{yo.init(e,t),Ga.init(e,t);}),rc=Ts("ZodULID",(e,t)=>{vo.init(e,t),Ga.init(e,t);}),sc=Ts("ZodXID",(e,t)=>{_o.init(e,t),Ga.init(e,t);}),ic=Ts("ZodKSUID",(e,t)=>{bo.init(e,t),Ga.init(e,t);}),oc=Ts("ZodIPv4",(e,t)=>{Eo.init(e,t),Ga.init(e,t);}),ac=Ts("ZodIPv6",(e,t)=>{xo.init(e,t),Ga.init(e,t);}),cc=Ts("ZodCIDRv4",(e,t)=>{$o.init(e,t),Ga.init(e,t);}),uc=Ts("ZodCIDRv6",(e,t)=>{Oo.init(e,t),Ga.init(e,t);}),lc=Ts("ZodBase64",(e,t)=>{Co.init(e,t),Ga.init(e,t);}),fc=Ts("ZodBase64URL",(e,t)=>{To.init(e,t),Ga.init(e,t);}),pc=Ts("ZodE164",(e,t)=>{Po.init(e,t),Ga.init(e,t);}),hc=Ts("ZodJWT",(e,t)=>{Lo.init(e,t),Ga.init(e,t);}),dc=Ts("ZodUnknown",(e,t)=>{No.init(e,t),Ua.init(e,t);});function gc(){return new dc({type:"unknown"})}const mc=Ts("ZodNever",(e,t)=>{Io.init(e,t),Ua.init(e,t);});function yc(e){return function(e,t){return new e({type:"never",...Xs(t)})}(mc,e)}const vc=Ts("ZodArray",(e,t)=>{Do.init(e,t),Ua.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ya(t,n)),e.nonempty=t=>e.check(ya(1,t)),e.max=(t,n)=>e.check(ma(t,n)),e.length=(t,n)=>e.check(va(t,n)),e.unwrap=()=>e.element;});function _c(e,t){return function(e,t,n){return new e({type:"array",element:t,...Xs(n)})}(vc,e,t)}const bc=Ts("ZodObject",(e,t)=>{zo.init(e,t),Ua.init(e,t),Bs(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ec({type:"enum",entries:n,...Xs(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:gc()}),e.loose=()=>e.clone({...e._zod.def,catchall:gc()}),e.strict=()=>e.clone({...e._zod.def,catchall:yc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Gs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ks(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return zs(this,"shape",n),n},checks:[]});return Js(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Gs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return zs(this,"shape",n),n},checks:e._zod.def.checks};return Js(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ks(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return zs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Js(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Js(e,Ks(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r]);}return zs(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Ks(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e];}return zs(this,"shape",r),r},checks:[]});return Js(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ks(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t]);}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return zs(this,"shape",s),s},checks:[]});return Js(t,r)}($c,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ks(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}));}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return zs(this,"shape",s),s},checks:[]});return Js(t,r)}(Lc,e,t[0]);});const wc=Ts("ZodUnion",(e,t)=>{Uo.init(e,t),Ua.init(e,t),e.options=t.options;});function Sc(e,t){return new wc({type:"union",options:e,...Xs(t)})}const Ac=Ts("ZodIntersection",(e,t)=>{qo.init(e,t),Ua.init(e,t);});const kc=Ts("ZodRecord",(e,t)=>{Go.init(e,t),Ua.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const Ec=Ts("ZodEnum",(e,t)=>{Vo.init(e,t),Ua.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r];}return new Ec({...t,checks:[],...Xs(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t];}return new Ec({...t,checks:[],...Xs(r),entries:s})};});const xc=Ts("ZodTransform",(e,t)=>{Yo.init(e,t),Ua.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ls(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ii(r,n.value,t));else {const t=r;t.fatal&&(t.continue=false),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ii(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const $c=Ts("ZodOptional",(e,t)=>{Jo.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function Oc(e){return new $c({type:"optional",innerType:e})}const Rc=Ts("ZodNullable",(e,t)=>{Xo.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function Cc(e){return new Rc({type:"nullable",innerType:e})}const Tc=Ts("ZodDefault",(e,t)=>{ea.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const Pc=Ts("ZodPrefault",(e,t)=>{na.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Lc=Ts("ZodNonOptional",(e,t)=>{ra.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Ts("ZodCatch",(e,t)=>{ia.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Ic=Ts("ZodPipe",(e,t)=>{oa.init(e,t),Ua.init(e,t),e.in=t.in,e.out=t.out;});function Mc(e,t){return new Ic({type:"pipe",in:e,out:t})}const Dc=Ts("ZodReadonly",(e,t)=>{ca.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const jc=Ts("ZodCustom",(e,t)=>{la.init(e,t),Ua.init(e,t);});const Hc=e=>{if(!e||"object"!=typeof e)return;const t=e,n={};for(const e of Object.keys(t)){const r=t[e];if("string"==typeof r){const t=r.trim();t&&(n[e]=[t]);}else if(Array.isArray(r)){const t=r.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0);t.length&&(n[e]=t);}}return Object.keys(n).length?n:void 0},Fc=(e,t)=>{const n=t?JSON.parse(e):Cs.parse(e);return n&&"object"==typeof n?n:{}},Bc=_c(Wa()).default([]).optional(),zc=Sc([Wa(),_c(Wa())]),Kc=(Uc=Wa(),qc=zc,new kc({type:"record",keyType:Uc,valueType:qc,...Xs(Zc)})).optional();var Uc,qc,Zc;const Wc=function(e,t){const n={type:"object",shape:e??{},...Xs(t)};return new bc(n)}({stanPath:Wa().min(1,{message:"stanPath must be a non-empty string"}),includes:Bc,excludes:Bc,imports:Kc}).strict(),Gc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Wc.parse(e)}catch(e){throw new Error((e=>e instanceof Ca?e.issues.map(e=>{const t=e.path.join(".")||"(root)";let n=e.message;return "stanPath"===t&&/Expected string/i.test(n)&&(n="stanPath must be a non-empty string"),`${t}: ${n}`}).join("\n"):String(e))(e))}},Vc=e=>{const t=Oe(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Fc(r,t.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core")){throw new Error(`stan-core: missing "stan-core" section in ${t}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`)}const i=Gc(s["stan-core"]),o=Hc(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Yc=async e=>{const t=Oe(e);if(!t)throw new Error("stan config not found");const n=t.replace(/\\/g,"/");return (async(e,t)=>{const n=await readFile(e,"utf8"),r=Fc(n,e.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(r,"stan-core"))throw new Error(`stan-core: missing "stan-core" section in ${t??e}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`);const s=Gc(r["stan-core"]),o=Hc(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Qc=e=>{try{return Vc(e).stanPath}catch{return Se}},Xc=async(e,n,s=false)=>{const i=de(e,n);if(await _e(e,n),!s){const e=resolve(i.outputAbs,P);if(existsSync(e))try{await copyFile(e,resolve(i.diffAbs,L));}catch{}const n=await readdir(i.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(i.outputAbs,e.name),{recursive:true,force:true});}return i.rootAbs},eu=async(e,t)=>{const n={};for(const r of t){const t=resolve(e,r),s=await readFile(t),o=createHash("sha256").update(s).digest("hex");n[r]=o;}return n},tu=e=>join(e,".archive.snapshot.json"),nu=async({cwd:e,stanPath:t,includes:n,excludes:r})=>{const{diffDir:s}=await be(e,t),i=await ge(e),o=await ve(i,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[]}),a=await eu(e,o),c=tu(s);return await writeFile(c,JSON.stringify(a,null,2),"utf8"),c},ru=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:a="createIfMissing",includeOutputDirInDiff:c=false,onArchiveWarnings:l})=>{const{outDir:f,diffDir:p}=await be(e,n),h=await ge(e),g=await ve(h,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[]}),m=await eu(e,g),y=tu(p),v=existsSync(y),_=v?JSON.parse(await readFile(y,"utf8")):{},b=v?g.filter(e=>!_[e]||_[e]!==m[e]):[...g],{textFiles:w,warningsBody:S}=await z(e,b),A=w;F(S,l);const k=join(f,`${r}.diff.tar`),E=await import('./index-ucZa1KMb-CSQ-GldX.js');if(c)await E.create({file:k,cwd:e,filter:j(n)},H(A,n));else if(0===A.length){const t=(e=>join(e,".stan_no_changes"))(p);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await E.create({file:k,cwd:e},r);}else {const t=Array.from(new Set([...A]));await E.create({file:k,cwd:e},t);}return "replace"===a?await writeFile(y,JSON.stringify(m,null,2),"utf8"):"createIfMissing"!==a||v||await writeFile(y,JSON.stringify(m,null,2),"utf8"),{diffPath:k}},su=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),iu=e=>{if(!e||!String(e).trim())return null;const t=su(String(e).trim());if(/^[/\\]/.test(t))return null;const n=t.split("/").filter(Boolean);if(n.some(e=>".."===e))return null;const r=n.join("/");return r.length?r:null},ou=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e);}const o=i.join("\n").trimEnd();return o.length?o:null},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),yu=e=>e.endsWith("\n")?e:e+"\n",vu=/[\u200B-\u200D\uFEFF]/g,_u=e=>!!/^diff --git /m.test(e)||(!(!/^---\s+(?:a\/|\S)/m.test(e)||!/^\+\+\+\s+(?:b\/|\S)/m.test(e))||!!/^@@\s+-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@/m.test(e)),bu=e=>{const t=mu(e).replace(vu,"");return yu(t)},wu=e=>{const t=(e=>{const t=e.split(/\r?\n/);let n=0;for(;n<t.length&&""===t[n].trim();)n+=1;let r=t.length-1;for(;r>=0&&""===t[r].trim();)r-=1;if(n>r)return e;const s=t[n].trim(),i=t[r].trim(),o=e=>/^```/.test(e),a=e=>{const s=t.slice(n+1,r);return [...t.slice(0,n),...s,...t.slice(r+1)].join("\n")};return o(s)&&o(i)||/^BEGIN[_ -]?PATCH/i.test(s)&&(c=i,/^END[_ -]?PATCH/i.test(c))||(e=>/^\*{3,}\s*BEGIN\s+PATCH/i.test(e)||/^\*{3,}\s*Begin\s+Patch/i.test(e))(s)&&(e=>/^\*{3,}\s*END\s+PATCH/i.test(e)||/^\*{3,}\s*End\s+Patch/i.test(e))(i)?a():e;var c;})(bu(e.trim())),n=bu(t),r=(e=>{const t=e.split("\n");for(let e=0;e<t.length;e+=1){const n=t[e];if(!n.match(/^`{3,}.*$/))continue;const r=(n.match(/^`+/)??[""])[0].length;for(let n=e+1;n<t.length;n+=1)if(new RegExp(`^\\\`{${r}{'}'}\\s*$`).test(t[n])){const r=t.slice(e+1,n).join("\n");if(_u(r))return r;e=n;break}}let n=e.search(/^diff --git /m);return n<0&&(n=e.search(/^---\s+(?:a\/|\S)/m)),n<0?null:e.slice(n).replace(/\n`{3,}\s*$/m,"\n")})(n);return yu(r?bu(r).trimEnd():n)},Su=e=>{const t=[],n=[],r=ou(e),s=r?{body:r}:null;if(!s)return {ops:t,errors:n};const i=s.body.split(/\r?\n/);let o=0;for(const e of i){o+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),i=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${o.toString()}: ${e}`);},u=e=>{e||c(`expected 1 path, got ${a.length.toString()}`);},l=e=>{e||c(`expected 2 paths, got ${a.length.toString()}`);},f=e=>iu(e);switch(i){case "mv":if(l(2===a.length),2===a.length){const e=f(a[0]),n=f(a[1]);e&&n?t.push({verb:"mv",src:e,dest:n}):c("mv: invalid repo-relative path");}break;case "rm":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rm",src:e}):c("rm: invalid repo-relative path");}break;case "rmdir":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rmdir",src:e}):c("rmdir: invalid repo-relative path");}break;case "mkdirp":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"mkdirp",src:e}):c("mkdirp: invalid repo-relative path");}break;default:c(`unknown verb "${i}"`);}}return {ops:t,errors:n}},Au=async(e,t,n=false)=>{const r=[],i=t=>((e,t)=>{const n=path.resolve(e,t),r=path.resolve(e)+path.sep,s=n===path.resolve(e)||n.startsWith(r);return {abs:n,ok:s}})(e,t);for(const e of t){const t={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:r}=i(e.src),{abs:s,ok:o}=i(e.dest);if(!r||!o)throw new Error("path escapes repo root");const a=await pathExists(t),c=await pathExists(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await ensureDir(path.dirname(s)),await move(t,s,{overwrite:!1}));}else if("rm"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");if(!await pathExists(t))throw new Error("path does not exist");n||await remove(t);}else if("rmdir"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");let o=null;try{o=await stat(t);}catch{o=null;}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await readdir(t)).length>0)throw new Error("directory not empty");n||await remove(t);}else if("mkdirp"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await ensureDir(t);}t.status="ok";}catch(e){t.status="failed";const n=e instanceof Error?e.message:String(e);t.message=n;}if(r.push(t),"failed"===t.status&&!n)break}return {ok:r.every(e=>"ok"===e.status),results:r}};function ku(e){return Array.isArray(e)?e.map(e=>ku(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function Eu(e){return Array.isArray(e)?e.map(e=>Eu(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function xu(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++;}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else {if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++;}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++;}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,a=0;for(;r<t.length&&(a<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?a++:" "===e&&(o++,a++);}if(o||1!==i.newLines||(i.newLines=0),a||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(a!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function $u(e,t,n){let r=true,s=false,i=false,o=1;return function a(){if(r&&!i){if(s?o++:r=false,e+o<=n)return e+o;i=true;}if(!s)return i||(r=true),t<=e-o?e-o++:(s=true,a())}}function Ou(e,t,n={}){let r;if(r="string"==typeof t?xu(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&(function(e){return e.includes("\r\n")&&!e.startsWith("\n")&&!e.match(/[^\r]\n/)}(e)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=ku(t):function(e){return !e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=Eu(t)));const r=e.split("\n"),s=t.hunks,i=n.compareLine||((e,t,n,r)=>t===r),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return e;let c="",u=false,l=false;for(let e=0;e<s[s.length-1].lines.length;e++){const t=s[s.length-1].lines[e];"\\"==t[0]&&("+"==c[0]?u=true:"-"==c[0]&&(l=true)),c=t;}if(u){if(l){if(!o&&""==r[r.length-1])return false}else if(""==r[r.length-1])r.pop();else if(!o)return false}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return false;function f(e,t,n,s=0,o=true,a=[],c=0){let u=0,l=false;for(;s<e.length;s++){const p=e[s],h=p.length>0?p[0]:" ",d=p.length>0?p.substr(1):p;if("-"===h){if(!i(t+1,r[t],h,d))return n&&null!=r[t]?(a[c]=r[t],f(e,t+1,n-1,s,false,a,c+1)):null;t++,u=0;}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=true;}if(" "===h){if(u++,a[c]=r[t],!i(t+1,r[t],h,d))return l||!n?null:r[t]&&(f(e,t+1,n-1,s+1,false,a,c+1)||f(e,t+1,n-1,s,false,a,c+1))||f(e,t,n-1,s+1,false,a,c);c++,o=true,l=false,t++;}}return c-=u,t-=u,a.length=c,{patchedLines:a,oldLineLastI:t-1}}const p=[];let h=0;for(let e=0;e<s.length;e++){const t=s[e];let n;const i=r.length-t.oldLines+o;let c;for(let e=0;e<=o;e++){c=t.oldStart+h-1;const r=$u(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return false;for(let e=a;e<c;e++)p.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){const t=n.patchedLines[e];p.push(t);}a=n.oldLineLastI+1,h=c+1-t.oldStart;}for(let e=a;e<r.length;e++)p.push(r[e]);return p.join("\n")}(e,r[0],n)}const Ru=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Cu=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Tu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Pu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Lu=e=>e.replace(/\n/g,"\r\n"),Nu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=xu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const a=o.some(e=>{const t=Cu(e.oldFileName),n=Cu(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!a)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const c=[],l=[];for(const e of o){const n=Cu(e.newFileName)??Cu(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^[./]+/,""),a=path.resolve(t,o),f=/\.md$/i.test(o);let h="",d=false,g=true;try{const e=await readFile(a,"utf8");h=e,d=/\r\n/.test(e);}catch{g=false;}const m=Tu(e.oldFileName);if(!g&&!m){l.push({path:o,reason:"target file not found"});continue}let y;!g&&m&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Pu(t)===Pu(r),fuzzFactor:f?1:0});}catch{l.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(false===y||"string"!=typeof y){l.push({path:o,reason:"unable to place hunk(s)"});continue}const v=d?Lu(y.replace(/\r/g,"")):y.replace(/\r/g,"");try{if(r){const e=s??path.join(t,".stan","patch",".sandbox"),n=path.resolve(e,o);await Ru(n),await writeFile(n,v,"utf8");}else {try{await Ru(a);}catch{}await writeFile(a,v,"utf8");}c.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:c,failed:l,sandboxRoot:s}},Iu=async e=>{const{cwd:t,patchAbs:n,cleaned:r,check:s,stripOrder:i=[1,0]}=e,o=i.flatMap(e=>((e,t)=>{const n=e?["--check"]:[];return [{args:[...n,"--3way","--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+nowarn-p${t.toString()}`},{args:[...n,"--3way","--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+ignore-p${t.toString()}`},{args:[...n,"--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+nowarn-p${t.toString()}`},{args:[...n,"--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+ignore-p${t.toString()}`}]})(s,e)),a=await(async(e,t,n,r="1"===process.env.STAN_DEBUG)=>{const s=[],i=[];for(const o of n){s.push(o.label);const n=await new Promise(n=>{const s=spawn("git",["apply",...o.args,t],{cwd:e,shell:false,windowsHide:true});let a="",c="";const u=s;u.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t);}),u.stdout?.on("data",e=>{const t=e.toString("utf8");a+=t,r&&process.stdout.write(t);}),s.on("close",e=>{i.push({label:o.label,code:e??0,stdout:a,stderr:c}),n(e??0);});});if(0===n)return {ok:true,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${n})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(a.ok)return {ok:true,result:a,js:null};const c=await Nu({cwd:t,cleaned:r,check:s});if(c.okFiles.length>0&&0===c.failed.length)return {ok:true,result:a,js:c};try{const e=await(async(e,t,n)=>{const r=t.replace(/\r\n/g,"\n").split("\n");let s=-1,i=null;for(let e=0;e<r.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(r[e])){const t=r[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){s=e+1,i=String(t[1]).trim().replace(/^[./]+/,"");break}}if(!i||!i.length)return null;const o=r.slice(s+1).join("\n");if(/^---\s+\/dev\/null/m.test(o))return null;const a=[];let c=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))c=!0;else if(c&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||a.push(t.slice(1));}}let f=a.join("\n");f.endsWith("\n")||(f+="\n");const h=n?path.join(e,".stan","patch",".sandbox","F"):e,d=path.resolve(h,i);return await mkdir(path.dirname(d),{recursive:!0}),await writeFile(d,f,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:a,js:e}}catch{}return {ok:false,result:a,js:c}};var Mu,Du={},ju={},Hu={};function Fu(){if(Mu)return Hu;return Mu=1,Object.defineProperty(Hu,"__esModule",{value:true}),Hu.splitWhen=Hu.flatten=void 0,Hu.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},Hu.splitWhen=function(e,t){const n=[[]];let r=0;for(const s of e)t(s)?(r++,n[r]=[]):n[r].push(s);return n},Hu}var Bu,zu={};function Ku(){if(Bu)return zu;return Bu=1,Object.defineProperty(zu,"__esModule",{value:true}),zu.isEnoentCodeError=void 0,zu.isEnoentCodeError=function(e){return "ENOENT"===e.code},zu}var Uu,qu={};var Zu,Wu={};function Gu(){if(Zu)return Wu;Zu=1,Object.defineProperty(Wu,"__esModule",{value:true}),Wu.convertPosixPathToPattern=Wu.convertWindowsPathToPattern=Wu.convertPathToPattern=Wu.escapePosixPath=Wu.escapeWindowsPath=Wu.escape=Wu.removeLeadingDotSegment=Wu.makeAbsolute=Wu.unixify=void 0;const e=$,t="win32"===x.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,i=/\\(?![!()+@[\]{}])/g;function o(e){return e.replace(r,"\\$2")}function a(e){return e.replace(n,"\\$2")}function c(e){return o(e).replace(s,"//$1").replace(i,"/")}function u(e){return a(e)}return Wu.unixify=function(e){return e.replace(/\\/g,"/")},Wu.makeAbsolute=function(t,n){return e.resolve(t,n)},Wu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Wu.escape=t?o:a,Wu.escapeWindowsPath=o,Wu.escapePosixPath=a,Wu.convertPathToPattern=t?c:u,Wu.convertWindowsPathToPattern=c,Wu.convertPosixPathToPattern=u,Wu}var Vu,Yu,Qu,Ju,Xu,el,tl={};function nl(){return Yu?Vu:(Yu=1,Vu=function(e){if("string"!=typeof e||""===e)return false;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return true;e=e.slice(t.index+t[0].length);}return false})}function rl(){if(Ju)return Qu;Ju=1;var e=nl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return true;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return true;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return true;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return true;if(-1===(a=e.indexOf("\\",n))||a>s)return true}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return true;if(-1!==o&&"("===e[n]&&"?"===e[n+1]&&/[:!=]/.test(e[n+2])&&")"!==e[n+3]&&(o=e.indexOf(")",n))>n&&(-1===(a=e.indexOf("\\",n))||a>o))return true;if(-1!==r&&"("===e[n]&&"|"!==e[n+1]&&(r<n&&(r=e.indexOf("|",n)),-1!==r&&")"!==e[r+1]&&(o=e.indexOf(")",r))>r&&(-1===(a=e.indexOf("\\",r))||a>o)))return true;if("\\"===e[n]){var c=e[n+1];n+=2;var u=t[c];if(u){var l=e.indexOf(u,n);-1!==l&&(n=l+1);}if("!"===e[n])return true}else n++;}return false},r=function(e){if("!"===e[0])return true;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return true;if("\\"===e[n]){var r=e[n+1];n+=2;var s=t[r];if(s){var i=e.indexOf(s,n);-1!==i&&(n=i+1);}if("!"===e[n])return true}else n++;}return false};return Qu=function(t,s){if("string"!=typeof t||""===t)return false;if(e(t))return true;var i=n;return s&&false===s.strict&&(i=r),i(t)}}var sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,gl,ml,yl,vl,_l,bl,wl,Sl,Al={};function kl(){return sl||(sl=1,(e=Al).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,s)=>false!==s&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=s,e.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&true!==r.escaped&&(r.value="\\"+r.value,r.escaped=true);},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=true,0)),e.isInvalidBrace=e=>!("brace"!==e.type||true!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&true===e.open&&true===e.close||(e.invalid=true,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||true===e.open||true===e.close,e.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const s=e[r];Array.isArray(s)?n(s):void 0!==s&&t.push(s);}return t};return n(e),t}),Al;var e;}function El(){if(ol)return il;ol=1;const e=kl();return il=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=true===t.invalid&&true===n.escapeInvalid;let a="";if(t.value)return (i||o)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)a+=r(e);return a};return r(t)}}function xl(){return cl?al:(cl=1,al=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function $l(){if(ll)return ul;ll=1;const e=xl(),t=(n,i,o)=>{if(false===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(false===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:true,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=false===a.strictZeros);let c=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(c))return t.cache[c].result;let u=Math.min(n,i),l=Math.max(n,i);if(1===Math.abs(u-l)){let e=n+"|"+i;return a.capture?`(${e})`:false===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],g=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){g=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0;}return l>=0&&(d=r(u,l,h,a)),h.negatives=g,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",false)||[],r=s(t,e,"",false)||[],i=s(e,t,"-?",true)||[];return n.concat(i).concat(r).join("|")}(g,d),true===a.capture?h.result=`(${h.result})`:false!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return {pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++;}return o&&(i+=true===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function r(e,t,r,s){let o,l=function(e,t){let n=1,r=1,s=a(e,n),o=new Set([t]);for(;e<=s&&s<=t;)o.add(s),n+=1,s=a(e,n);for(s=c(t+1,r)-1;e<s&&s<=t;)o.add(s),r+=1,s=c(t+1,r)-1;return o=[...o],o.sort(i),o}(e,t),f=[],h=e;for(let e=0;e<l.length;e++){let t=l[e],i=n(String(h),String(t),s),a="";r.isPadded||!o||o.pattern!==i.pattern?(r.isPadded&&(a=p(t,r,s)),i.string=a+i.pattern+u(i.count),f.push(i),h=t+1,o=i):(o.count.length>1&&o.count.pop(),o.count.push(i.count[0]),o.string=o.pattern+u(o.count),h=t+1);}return f}function s(e,t,n,r,s){let i=[];for(let s of e){let{string:e}=s;r||o(t,"string",e)||i.push(n+e),r&&o(t,"string",e)&&i.push(n+e);}return i}function i(e,t){return e>t?1:t>e?-1:0}function o(e,t,n){return e.some(e=>e[t]===n)}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function u(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function l(e,t,n){return `[${e}${t-e===1?"":"-"}${t}]`}function f(e){return /^-?(0+)\d/.test(e)}function p(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),s=false!==n.relaxZeros;switch(r){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},ul=t}function Ol(){if(pl)return fl;pl=1;const e=O,t=$l(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,s=e=>Number.isInteger(+e),i=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return false;for(;"0"===t[++n];);return n>0},o=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0");}return false===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},c=(e,n,r,s)=>{if(r)return t(e,n,{wrap:false,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=true===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),f=(e,t,n)=>{if(true===n.strictRanges)throw l([e,t]);return []},p=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(true===r.strictRanges)throw l([e,t]);return []}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),g=String(n);n=Math.max(Math.abs(n),1);let m=i(h)||i(d)||i(g),y=m?Math.max(h.length,d.length,g.length):0,v=false===m&&false===((e,t,n)=>"string"==typeof e||"string"==typeof t||true===n.stringify)(e,t,r),_=r.transform||(e=>t=>true===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),true,r);let b={negatives:[],positives:[]},w=e=>b[e<0?"negatives":"positives"].push(Math.abs(e)),S=[],A=0;for(;p?s>=f:s<=f;) true===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return true===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,s=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.map(e=>a(String(e),n)).join("|")),e.negatives.length&&(o=`-(${s}${e.negatives.map(e=>a(String(e),n)).join("|")})`),r=i&&o?`${i}|${o}`:i||o,t.wrap?`(${s}${r})`:r})(b,r,y):u(S,null,{wrap:false,...r}):S},h=(e,t,i,o={})=>{if(null==t&&r(e))return [e];if(!r(e)||!r(t))return f(e,t,o);if("function"==typeof i)return h(e,t,1,{transform:i});if(n(i))return h(e,t,0,i);let a={...o};return true===a.capture&&(a.wrap=true),i=i||a.step||1,s(i)?s(e)&&s(t)?p(e,t,i,a):((e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return f(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),o=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=o>a,p=Math.min(o,a),h=Math.max(o,a);if(r.toRegex&&1===n)return c(p,h,false,r);let d=[],g=0;for(;l?o>=a:o<=a;)d.push(i(o,g)),o=l?o-n:o+n,g++;return true===r.toRegex?u(d,null,{wrap:false,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(true===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return []})(i,a)};return fl=h}function Rl(){if(bl)return _l;bl=1;const e=El(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=vl?yl:(vl=1,yl={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return _l=(m,y={})=>{if("string"!=typeof m)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(m.length>_)throw new SyntaxError(`Input length (${m.length}), exceeds max characters (${_})`);const b={type:"root",input:m,nodes:[]},w=[b];let S=b,A=b,k=0;const E=m.length;let x,$=0,O=0;const R=()=>m[$++],C=e=>{if("text"===e.type&&"dot"===A.type&&(A.type="text"),!A||"text"!==A.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=A,A=e,e;A.value+=e.value;};for(C({type:"bos"});$<E;)if(S=w[w.length-1],x=R(),x!==g&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;$<E&&(e=R());)if(x+=e,e!==l)if(e!==n){if(e===f&&(k--,0===k))break}else x+=R();else k++;C({type:"text",value:x});continue}if(x!==o)if(x!==a){if(x===p||x===h||x===r){const e=x;let t;for(true!==y.keepQuotes&&(x="");$<E&&(t=R());)if(t!==n){if(t===e){ true===y.keepQuotes&&(x+=t);break}x+=t;}else x+=t+R();C({type:"text",value:x});continue}if(x===c){O++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:O,commas:0,ranges:0,nodes:[]}),w.push(S),C({type:"open",value:x});continue}if(x===u){if("brace"!==S.type){C({type:"text",value:x});continue}const e="close";S=w.pop(),S.close=true,C({type:e,value:x}),O--,S=w[w.length-1];continue}if(x===s&&O>0){if(S.ranges>0){S.ranges=0;const t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}];}C({type:"comma",value:x}),S.commas++;}else {if(x===i&&O>0&&0===S.commas){const e=S.nodes;if(0===O||0===e.length){C({type:"text",value:x});continue}if("dot"===A.type){if(S.range=[],A.value+=x,A.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=true,S.ranges=0,A.type="text";continue}S.ranges++,S.args=[];continue}if("range"===A.type){e.pop();const t=e[e.length-1];t.value+=A.value+x,A=t,S.ranges--;continue}C({type:"dot",value:x});continue}C({type:"text",value:x});}}else {if("paren"!==S.type){C({type:"text",value:x});continue}S=w.pop(),C({type:"text",value:x}),S=w[w.length-1];}else S=C({type:"paren",nodes:[]}),w.push(S),C({type:"text",value:x});}else C({type:"text",value:"\\"+x});else C({type:"text",value:(y.keepEscaping?x:"")+R()});do{if(S=w.pop(),"root"!==S.type){S.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=true),"close"===e.type&&(e.isClose=true),e.nodes||(e.type="text"),e.invalid=true);});const e=w[w.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes);}}while(w.length>0);return C({type:"eos"}),b},_l}function Cl(){if(Sl)return wl;Sl=1;const e=El(),t=function(){if(dl)return hl;dl=1;const e=Ol(),t=kl();return hl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=true===n.invalid&&true===r.escapeInvalid,c=true===o||true===a,u=true===r.escapeInvalid?"\\":"";let l="";if(true===n.isOpen)return u+n.value;if(true===n.isClose)return console.log("node.isClose",u,n.value),u+n.value;if("open"===n.type)return c?u+n.value:"(";if("close"===n.type)return c?u+n.value:")";if("comma"===n.type)return "comma"===n.prev.type?"":c?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const s=t.reduce(n.nodes),i=e(...s,{...r,wrap:false,toRegex:true,strictZeros:true});if(0!==i.length)return s.length>1&&i.length>1?`(${i})`:i}if(n.nodes)for(const e of n.nodes)l+=s(e,n);return l};return s(n)}}(),n=function(){if(ml)return gl;ml=1;const e=Ol(),t=El(),n=kl(),r=(e="",t="",s=false)=>{const i=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return s?n.flatten(t).map(e=>`{${e}}`):t;for(const n of e)if(Array.isArray(n))for(const e of n)i.push(r(e,t,s));else for(let e of t) true===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return gl=(s,i={})=>{const o=void 0===i.rangeLimit?1e3:i.rangeLimit,a=(s,c={})=>{s.queue=[];let u=c,l=c.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,l=u.queue;if(s.invalid||s.dollar)return void l.push(r(l.pop(),t(s,i)));if("brace"===s.type&&true!==s.invalid&&2===s.nodes.length)return void l.push(r(l.pop(),["{}"]));if(s.nodes&&s.ranges>0){const a=n.reduce(s.nodes);if(n.exceedsLimit(...a,i.step,o))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=e(...a,i);return 0===c.length&&(c=t(s,i)),l.push(r(l.pop(),c)),void(s.nodes=[])}const f=n.encloseBrace(s);let p=s.queue,h=s;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,p=h.queue;for(let e=0;e<s.nodes.length;e++){const t=s.nodes[e];"comma"!==t.type||"brace"!==s.type?"close"!==t.type?t.value&&"open"!==t.type?p.push(r(p.pop(),t.value)):t.nodes&&a(t,s):l.push(r(l.pop(),p,f)):(1===e&&p.push(""),p.push(""));}return p};return n.flatten(a(s))},gl}(),r=Rl(),s=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=s.create(r,t);Array.isArray(e)?n.push(...e):n.push(e);}else n=[].concat(s.create(e,t));return t&&true===t.expand&&true===t.nodupes&&(n=[...new Set(n)]),n};return s.parse=(e,t={})=>r(e,t),s.stringify=(t,n={})=>e("string"==typeof t?s.parse(t,n):t,n),s.compile=(e,n={})=>("string"==typeof e&&(e=s.parse(e,n)),t(e,n)),s.expand=(e,t={})=>{"string"==typeof e&&(e=s.parse(e,t));let r=n(e,t);return true===t.noempty&&(r=r.filter(Boolean)),true===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:true!==t.expand?s.compile(e,t):s.expand(e,t),wl=s}var Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul,ql={};function Zl(){if(Pl)return Tl;Pl=1;const e=$,t="\\\\/",n=`[^${t}]`,r="\\.",s="\\/",i="[^/]",o=`(?:${s}|$)`,a=`(?:^|${s})`,c=`${r}{1,2}${o}`,u={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:a},l={...u,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return Tl={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>true===e?l:u}}function Wl(){return Ll||(Ll=1,function(e){const t=$,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=Zl();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:true===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return -1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return true===t.negated&&(r=`(?:^(?!${r}).*$)`),r};}(ql)),ql}function Gl(){if(Hl)return jl;Hl=1;const e=$,t=function(){if(Il)return Nl;Il=1;const e=Wl(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=Zl(),m=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Nl=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(true===D||$===c){for(z++;true!==U()&&($=Z());)if($!==r)if($!==c){if(true!==D&&$===i&&($=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&$===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if($===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if($!==a){if(true!==b.noext&&true==($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,$===o&&R===C&&(F=true),true===S){for(;true!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if($===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if($===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||$!==o||R!==C){if(true!==b.noparen&&$===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&($=Z());)if($!==u){if($===d){B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,$=Z(),$===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&true===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):true===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(true===b.tokens&&(Y.maxDepth=0,m($)||k.push(K),Y.tokens=k),true===b.parts||true===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=true,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r;}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth);}Y.slashes=A,Y.parts=E;}return Y},Nl}(),n=function(){if(Dl)return Ml;Dl=1;const e=Zl(),t=Wl(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r);}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=t.isWindows(f),_=e.globChars(v),b=e.extglobChars(_),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:O,QMARK:R,QMARK_NO_DOT:C,STAR:T,START_ANCHOR:P}=_,L=e=>`(${y}(?:(?!${P}${e.dot?E:w}).)*?)`,N=p.dot?"":x,I=p.dot?R:C;let M=true===p.bash?L(p):T;p.capture&&(M=`(${M})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:m};l=t.removePrefix(l,D),d=l.length;const j=[],H=[],F=[];let B,z=g;const K=()=>D.index===d-1,U=D.peek=(e=1)=>l[D.index+e],q=D.advance=()=>l[++D.index]||"",Z=()=>l.slice(D.index+1),W=(e="",t=0)=>{D.consumed+=e,D.index+=t;},G=e=>{D.output+=null!=e.output?e.output:e.value,W(e.value);},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),D.start++,e++;return e%2!=0&&(D.negated=true,D.start++,true)},Y=e=>{D[e]++,F.push(e);},Q=e=>{D[e]--,F.pop();},J=e=>{if("globstar"===z.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=true===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=M,D.output+=z.output);}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&G(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,m.push(e),z=e;},X=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=z,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:D.output?"":k}),J({type:"paren",extglob:true,value:q(),output:r}),j.push(n);},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(p)),(r!==M||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(D.negatedExtglob=true);}J({type:"paren",extglob:true,value:B,output:n}),Q("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?R.repeat(i.length):""):0===o?I+(i?R.repeat(i.length):""):R.repeat(r.length):"."===s?w.repeat(r.length):"*"===s?n?n+s+(i?M:""):M:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&true!==p.bash)continue;if("."===e||";"===e)continue;if(!e){B+="\\",J({type:"text",value:B});continue}const t=/^\\+/.exec(Z());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(B+="\\")),true===p.unescape?B=q():B+=q(),0===D.brackets){J({type:"text",value:B});continue}}if(D.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(false!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=true,e.includes(":"))){const e=z.value.lastIndexOf("["),t=z.value.slice(0,e),n=z.value.slice(e+2),s=r[n];if(s){z.value=t+s,D.backtrack=true,q(),g.output||1!==m.indexOf(z)||(g.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),true===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,G({value:B});continue}if(1===D.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,G({value:B});continue}if('"'===B){D.quotes=1===D.quotes?0:1,true===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&true===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&D.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(true!==p.nobracket&&Z().includes("]"))Y("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`;}J({type:"bracket",value:B});continue}if("]"===B){if(true===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(true===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),true===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&true!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};H.push(e),J(e);continue}if("}"===B){const e=H[H.length-1];if(true===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(true===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=true;}if(true!==e.comma&&true!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value;}J({type:"brace",value:B,output:t}),Q("braces"),H.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,J({type:"text",value:B});continue}if(","===B){let e=B;const t=H[H.length-1];t&&"braces"===F[F.length-1]&&(t.comma=true,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),z=g;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(D.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=H[H.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=true;continue}if(D.braces+D.parens===0&&"bos"!==z.type&&"slash"!==z.type){J({type:"text",value:B,output:w});continue}J({type:"dot",value:B,output:w});continue}if("?"===B){if((!z||"("!==z.value)&&true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",B);continue}if(z&&"paren"===z.type){const e=U();let n=B;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===z.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Z()))&&(n=`\\${B}`),J({type:"text",value:B,output:n});continue}if(true!==p.dot&&("slash"===z.type||"bos"===z.type)){J({type:"qmark",value:B,output:C});continue}J({type:"qmark",value:B,output:R});continue}if("!"===B){if(true!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(true!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||false===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||D.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:true,value:B,output:""});continue}J({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const e=s.exec(Z());e&&(B+=e[0],D.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||true===z.star)){z.type="star",z.star=true,z.value+=B,z.output=M,D.backtrack=true,D.globstar=true,W(B);continue}let e=Z();if(true!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(true===p.noglobstar){W(B);continue}const t=z.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(true===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){J({type:"star",value:B,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3);}if("bos"===t.type&&K()){z.type="globstar",z.value+=B,z.output=L(p),D.output=z.output,D.globstar=true,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=L(p)+(p.strictSlashes?")":"|$)"),z.value+=B,D.globstar=true,D.output+=t.output+z.output,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${L(p)}${A}|${A}${n})`,z.value+=B,D.output+=t.output+z.output,D.globstar=true,W(B+q()),J({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){z.type="globstar",z.value+=B,z.output=`(?:^|${A}|${L(p)}${A})`,D.output=z.output,D.globstar=true,W(B+q()),J({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-z.output.length),z.type="globstar",z.output=L(p),z.value+=B,D.output+=z.output,D.globstar=true,W(B);continue}const n={type:"star",value:B,output:M};true!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||true!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=$,z.output+=$):true===p.dot?(D.output+=O,z.output+=O):(D.output+=N,z.output+=N),"*"!==U()&&(D.output+=k,z.output+=k)),J(n)):(n.output=B,J(n)):(n.output=".*?","bos"!==z.type&&"slash"!==z.type||(n.output=N+n.output),J(n));}for(;D.brackets>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets");}for(;D.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens");}for(;D.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces");}if(true===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),true===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix);}return D};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?g:d,b=i.dot?m:d,w=i.capture?"":"?:";let S=true===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>true===e.noglobstar?S:`(${w}(?:(?!${v}${e.dot?h:l}).)*?)`,k=e=>{switch(e){case "*":return `${_}${p}${S}`;case ".*":return `${l}${p}${S}`;case "*.*":return `${_}${S}${l}${p}${S}`;case "*/*":return `${_}${S}${f}${p}${b}${S}`;case "**":return _+A(i);case "**/*":return `(?:${_}${A(i)}${f})?${b}${p}${S}`;case "**/*.*":return `(?:${_}${A(i)}${f})?${b}${S}${l}${p}${S}`;case "**/.*":return `(?:${_}${A(i)}${f})?${l}${p}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=k(t[1]);if(!n)return;return n+l+t[2]}}},E=t.removePrefix(r,{negated:false,prefix:""});let x=k(E);return x&&true!==i.strictSlashes&&(x+=`${f}?`),x},Ml=u}(),r=Wl(),s=Zl(),i=(e,t,n=false)=>{if(Array.isArray(e)){const r=e.map(e=>i(e,t,n)),s=e=>{for(const t of r){const n=t(e);if(n)return n}return false};return s}const s=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},c=r.isWindows(t),u=s?i.compileRe(e,t):i.makeRe(e,t,false,true),l=u.state;delete u.state;let f=()=>false;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n);}const p=(n,r=false)=>{const{isMatch:s,match:o,output:p}=i.test(n,u,t,{glob:e,posix:c}),h={glob:e,state:l,regex:u,posix:c,input:n,output:p,match:o,isMatch:s};return "function"==typeof a.onResult&&a.onResult(h),false===s?(h.isMatch=false,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=false,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(p.state=l),p};return i.test=(e,t,n,{glob:s,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return {isMatch:false,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===s),false!==u&&true!==a.capture||(u=true===a.matchBase||true===a.basename?i.matchBase(e,t,n,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},i.matchBase=(t,n,s,o=r.isWindows(s))=>(n instanceof RegExp?n:i.makeRe(n,s)).test(e.basename(t)),i.isMatch=(e,t,n)=>i(t,n)(e),i.parse=(e,t)=>Array.isArray(e)?e.map(e=>i.parse(e,t)):n(e,{...t,fastpaths:false}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return true===r&&(u.state=e),u},i.makeRe=(e,t={},r=false,s=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=n.fastpaths(e,t)),o.output||(o=n(e,t)),i.compileRe(o,t,r,s)},i.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&true===t.debug)throw e;return /$^/}},i.constants=s,jl=i}function Vl(){return Bl?Fl:(Bl=1,Fl=Gl())}function Yl(){if(Ul)return tl;Ul=1,Object.defineProperty(tl,"__esModule",{value:true}),tl.isAbsolute=tl.partitionAbsoluteAndRelative=tl.removeDuplicateSlashes=tl.matchAny=tl.convertPatternsToRe=tl.makeRe=tl.getPatternParts=tl.expandBraceExpansion=tl.expandPatternsWithBraceExpansion=tl.isAffectDepthOfReadingPattern=tl.endsWithSlashGlobStar=tl.hasGlobStar=tl.getBaseDirectory=tl.isPatternRelatedToParentDirectory=tl.getPatternsOutsideCurrentDirectory=tl.getPatternsInsideCurrentDirectory=tl.getPositivePatterns=tl.getNegativePatterns=tl.isPositivePattern=tl.isNegativePattern=tl.convertToNegativePattern=tl.convertToPositivePattern=tl.isDynamicPattern=tl.isStaticPattern=void 0;const e=$,t=function(){if(el)return Xu;el=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Xu=function(a,c){Object.assign({flipBackslashes:true},c).flipBackslashes&&n&&a.indexOf("/")<0&&(a=a.replace(r,"/")),s.test(a)&&(a+="/"),a+="a";do{a=t(a);}while(e(a)||i.test(a));return a.replace(o,"$1")}}(),n=function(){if(Kl)return zl;Kl=1;const e=O,t=Cl(),n=Vl(),r=Wl(),s=e=>""===e||"./"===e,i=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},o=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,i=new Set,o=new Set,a=0,c=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e);};for(let o=0;o<t.length;o++){let u=n(String(t[o]),{...r,onResult:c},true),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,true);(l?!e.isMatch:e.isMatch)&&(l?s.add(e.output):(s.delete(e.output),i.add(e.output)));}}let u=(a===t.length?[...o]:[...i]).filter(e=>!s.has(e));if(r&&0===u.length){if(true===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(true===r.nonull||true===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};return o.match=o,o.matcher=(e,t)=>n(e,t),o.any=o.isMatch=(e,t,r)=>n(t,r)(e),o.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,s=[],i=new Set(o(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),s.push(e.output);}}));for(let e of s)i.has(e)||r.add(e);return [...r]},o.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some(e=>o.contains(t,e,r));if("string"==typeof n){if(s(t)||s(n))return false;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return true}return o.isMatch(t,n,{...r,contains:true})},o.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=o(Object.keys(e),t,n),i={};for(let t of s)i[t]=e[t];return i},o.some=(e,t,r)=>{let s=[].concat(e);for(let e of [].concat(t)){let t=n(String(e),r);if(s.some(e=>t(e)))return true}return false},o.every=(e,t,r)=>{let s=[].concat(e);for(let e of [].concat(t)){let t=n(String(e),r);if(!s.every(e=>t(e)))return false}return true},o.all=(t,r,s)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return [].concat(r).every(e=>n(e,s)(t))},o.capture=(e,t,s)=>{let i=r.isWindows(s),o=n.makeRe(String(e),{...s,capture:true}).exec(i?r.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>void 0===e?"":e)},o.makeRe=(...e)=>n.makeRe(...e),o.scan=(...e)=>n.scan(...e),o.parse=(e,r)=>{let s=[];for(let i of [].concat(e||[]))for(let e of t(String(i),r))s.push(n.parse(e,r));return s},o.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&true===n.nobrace||!i(e)?[e]:t(e,n)},o.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return o.braces(e,{...t,expand:true})},o.hasBraces=i,zl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return !l(e,t)}function l(e,t={}){return ""!==e&&(!(false!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(false===t.extglob||!o.test(e))||!(false===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return false;const n=e.indexOf("}",t+1);if(-1===n)return false;const r=e.slice(t,n);return a.test(r)}(e)))))}function f(e){return e.startsWith("!")&&"("!==e[1]}function p(e){return !f(e)}function h(e){return e.startsWith("..")||e.startsWith("./..")}function d(e){return e.endsWith("/**")}function g(e){const t=n.braces(e,{expand:true,nodupes:true,keepEscaping:true});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function m(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return tl.isStaticPattern=u,tl.isDynamicPattern=l,tl.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},tl.convertToNegativePattern=function(e){return "!"+e},tl.isNegativePattern=f,tl.isPositivePattern=p,tl.getNegativePatterns=function(e){return e.filter(f)},tl.getPositivePatterns=function(e){return e.filter(p)},tl.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},tl.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},tl.isPatternRelatedToParentDirectory=h,tl.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},tl.hasGlobStar=function(e){return e.includes("**")},tl.endsWithSlashGlobStar=d,tl.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},tl.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(g(t)),[])},tl.expandBraceExpansion=g,tl.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:true}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},tl.makeRe=m,tl.convertPatternsToRe=function(e,t){return e.map(e=>m(e,t))},tl.matchAny=function(e,t){return t.some(t=>t.test(e))},tl.removeDuplicateSlashes=function(e){return e.replace(c,"/")},tl.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},tl.isAbsolute=y,tl}var Ql,Jl,Xl,ef={};function tf(){if(Jl)return Ql;Jl=1;const e=R.PassThrough,t=Array.prototype.slice;function n(t,r){if(Array.isArray(t))for(let e=0,s=t.length;e<s;e++)t[e]=n(t[e],r);else {if(!t._readableState&&t.pipe&&(t=t.pipe(e(r))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause();}return t}return Ql=function(){const r=[],s=t.call(arguments);let i=false,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=false!==o.end,c=true===o.pipeError;null==o.objectMode&&(o.objectMode=true);null==o.highWaterMark&&(o.highWaterMark=65536);const u=e(o);function l(){for(let e=0,t=arguments.length;e<t;e++)r.push(n(arguments[e],o));return f(),this}function f(){if(i)return;i=true;let e=r.shift();if(!e)return void process.nextTick(p);Array.isArray(e)||(e=[e]);let t=e.length+1;function n(){--t>0||(i=false,f());}function s(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),c&&e.removeListener("error",r),n();}function r(e){u.emit("error",e);}if(e._readableState.endEmitted)return n();e.on("merge2UnpipeEnd",t),e.on("end",t),c&&e.on("error",r),e.pipe(u,{end:false}),e.resume();}for(let t=0;t<e.length;t++)s(e[t]);n();}function p(){i=false,u.emit("queueDrain"),a&&u.end();}u.setMaxListeners(0),u.add=l,u.on("unpipe",function(e){e.emit("merge2UnpipeEnd");}),s.length&&l.apply(null,s);return u},Ql}var nf,rf,sf,of={};function af(){if(nf)return of;return nf=1,Object.defineProperty(of,"__esModule",{value:true}),of.isEmpty=of.isString=void 0,of.isString=function(e){return "string"==typeof e},of.isEmpty=function(e){return ""===e},of}function cf(){if(rf)return ju;rf=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.string=ju.stream=ju.pattern=ju.path=ju.fs=ju.errno=ju.array=void 0;const e=Fu();ju.array=e;const t=Ku();ju.errno=t;const n=function(){if(Uu)return qu;Uu=1,Object.defineProperty(qu,"__esModule",{value:true}),qu.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t);}}return qu.createDirentFromStats=function(t,n){return new e(t,n)},qu}();ju.fs=n;const r=Gu();ju.path=r;const s=Yl();ju.pattern=s;const i=function(){if(Xl)return ef;Xl=1,Object.defineProperty(ef,"__esModule",{value:true}),ef.merge=void 0;const e=tf();function t(e){e.forEach(e=>e.emit("close"));}return ef.merge=function(n){const r=e(n);return n.forEach(e=>{e.once("error",e=>r.emit("error",e));}),r.once("close",()=>t(n)),r.once("end",()=>t(n)),r},ef}();ju.stream=i;const o=af();return ju.string=o,ju}var uf,lf={},ff={},pf={},hf={},df={},gf={},mf={},yf={},vf={};function _f(){if(uf)return vf;function e(e,t){e(t);}function t(e,t){e(null,t);}return uf=1,Object.defineProperty(vf,"__esModule",{value:true}),vf.read=void 0,vf.read=function(n,r,s){r.fs.lstat(n,(i,o)=>{null===i?o.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,i)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void e(s,n):void t(s,o);r.markSymbolicLink&&(i.isSymbolicLink=()=>true),t(s,i);}):t(s,o):e(s,i);});},vf}var bf,wf={};var Sf,Af,kf,Ef,xf,$f,Of,Rf={},Cf={};function Tf(){if(Af)return Rf;Af=1,Object.defineProperty(Rf,"__esModule",{value:true});const e=(Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)};}(Cf)),Cf);return Rf.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);}_getValue(e,t){return null!=e?e:t}},Rf}function Pf(){if(kf)return yf;kf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.statSync=yf.stat=yf.Settings=void 0;const e=_f(),t=(bf||(bf=1,Object.defineProperty(wf,"__esModule",{value:true}),wf.read=void 0,wf.read=function(e,t){const n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}),wf),n=Tf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return yf.Settings=n.default,yf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},yf.statSync=function(e,n){const s=r(n);return t.read(e,s)},yf}function Lf(){if(xf)return Ef;let e;return xf=1,Ef="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:K):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Nf,If={};function Mf(){if(Nf)return If;Nf=1,Object.defineProperty(If,"__esModule",{value:true}),If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const e=process.versions.node.split(".");if(void 0===e[0]||void 0===e[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const t=Number.parseInt(e[0],10),n=Number.parseInt(e[1],10),r=t>10,s=10===t&&n>=10;return If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,If}var Df,jf,Hf={},Ff={};function Bf(){if(jf)return Hf;jf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.fs=void 0;const e=function(){if(Df)return Ff;Df=1,Object.defineProperty(Ff,"__esModule",{value:true}),Ff.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t);}}return Ff.createDirentFromStats=function(t,n){return new e(t,n)},Ff}();return Hf.fs=e,Hf}var zf,Kf,Uf={};function qf(){if(zf)return Uf;return zf=1,Object.defineProperty(Uf,"__esModule",{value:true}),Uf.joinPathSegments=void 0,Uf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Uf}function Zf(){if(Kf)return mf;Kf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Pf(),t=function(){if(Of)return $f;Of=1,$f=function(t,n){let r,s,i,o=true;function a(t){function s(){n&&n(t,r),n=null;}o?e(s):s();}function c(e,t,n){r[e]=n,(0===--s||t)&&a(t);}Array.isArray(t)?(r=[],s=t.length):(i=Object.keys(t),r={},s=i.length),s?i?i.forEach(function(e){t[e](function(t,n){c(e,t,n);});}):t.forEach(function(e,t){e(function(e,n){c(t,e,n);});}):a(null),o=false;};const e=Lf();return $f}(),n=Mf(),r=Bf(),s=qf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:true},(o,u)=>{if(null!==o)return void a(i,o);const l=u.map(t=>({dirent:t,name:t.name,path:s.joinPathSegments(e,t.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void c(i,l);const f=l.map(e=>function(e,t){return n=>{e.dirent.isSymbolicLink()?t.fs.stat(e.path,(s,i)=>{if(null!==s)return t.throwErrorOnBrokenSymbolicLink?void n(s):void n(null,e);e.dirent=r.fs.createDirentFromStats(e.name,i),n(null,e);}):n(null,e);}}(e,n));t(f,(e,t)=>{null===e?c(i,t):a(i,e);});});}function o(n,i,o){i.fs.readdir(n,(u,l)=>{if(null!==u)return void a(o,u);const f=l.map(t=>{const o=s.joinPathSegments(n,t,i.pathSegmentSeparator);return n=>{e.stat(o,i.fsStatSettings,(e,s)=>{if(null!==e)return void n(e);const a={name:t,path:o,dirent:r.fs.createDirentFromStats(t,s)};i.stats&&(a.stats=s),n(null,a);});}});t(f,(e,t)=>{null===e?c(o,t):a(o,e);});});}function a(e,t){e(t);}function c(e,t){e(null,t);}return mf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r);},mf.readdirWithFileTypes=i,mf.readdir=o,mf}var Wf,Gf={};var Vf,Yf,Qf,Jf={},Xf={};function ep(){return Vf||(Vf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)};}(Xf)),Xf}function tp(){if(Qf)return gf;Qf=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.Settings=gf.scandirSync=gf.scandir=void 0;const e=Zf(),t=function(){if(Wf)return Gf;Wf=1,Object.defineProperty(Gf,"__esModule",{value:true}),Gf.readdir=Gf.readdirWithFileTypes=Gf.read=void 0;const e=Pf(),t=Mf(),n=Bf(),r=qf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:true}).map(s=>{const i={dirent:s,name:s.name,path:r.joinPathSegments(e,s.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(i.path);i.dirent=n.fs.createDirentFromStats(i.name,e);}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return i})}function i(t,s){return s.fs.readdirSync(t).map(i=>{const o=r.joinPathSegments(t,i,s.pathSegmentSeparator),a=e.statSync(o,s.fsStatSettings),c={name:i,path:o,dirent:n.fs.createDirentFromStats(i,a)};return s.stats&&(c.stats=a),c})}return Gf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Gf.readdirWithFileTypes=s,Gf.readdir=i,Gf}(),n=function(){if(Yf)return Jf;Yf=1,Object.defineProperty(Jf,"__esModule",{value:true});const e=$,t=Pf(),n=ep();return Jf.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Jf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},gf}var np,rp,sp,ip={exports:{}};function op(){if(sp)return ip.exports;sp=1;var e=rp?np:(rp=1,np=function(e){var t=new e,n=t;return {get:function(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r},release:function(e){n.next=e,n=e;}}});function t(t,s,i){if("function"==typeof t&&(i=s,s=t,t=null),!(i>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var o=e(r),a=null,c=null,u=0,l=null,f={push:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?c?(c.next=h,c=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked));},drain:n,saturated:n,pause:function(){f.paused=true;},paused:false,get concurrency(){return i},set concurrency(e){if(!(e>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(i=e,!f.paused)for(;a&&u<i;)u++,p();},running:function(){return u},resume:function(){if(!f.paused)return;if(f.paused=false,null===a)return u++,void p();for(;a&&u<i;)u++,p();},idle:function(){return 0===u&&0===f.length()},length:function(){var e=a,t=0;for(;e;)e=e.next,t++;return t},getQueue:function(){var e=a,t=[];for(;e;)t.push(e.value),e=e.next;return t},unshift:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?a?(h.next=a,a=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked));},empty:n,kill:function(){a=null,c=null,f.drain=n;},killAndDrain:function(){a=null,c=null,f.drain(),f.drain=n;},error:function(e){l=e;}};return f;function p(e){e&&o.release(e);var n=a;n&&u<=i?f.paused?u--:(c===a&&(c=null),a=n.next,n.next=null,s.call(t,n.value,n.worked),null===c&&f.empty()):0===--u&&f.drain();}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,r){var s=e.callback,i=e.errorHandler,o=e.value;e.value=null,e.callback=n,e.errorHandler&&i(t,o),s.call(e.context,t,r),e.release(e);};}return ip.exports=t,ip.exports.promise=function(e,r,s){"function"==typeof e&&(s=r,r=e,e=null);var i=t(e,function(e,t){r.call(this,e).then(function(e){t(null,e);},t);},s),o=i.push,a=i.unshift;return i.push=function(e){var t=new Promise(function(t,n){o(e,function(e,r){e?n(e):t(r);});});return t.catch(n),t},i.unshift=function(e){var t=new Promise(function(t,n){a(e,function(e,r){e?n(e):t(r);});});return t.catch(n),t},i.drained=function(){var e=new Promise(function(e){process.nextTick(function(){if(i.idle())e();else {var t=i.drain;i.drain=function(){"function"==typeof t&&t(),e(),i.drain=t;};}});});return e},i},ip.exports}var ap,cp={};function up(){if(ap)return cp;return ap=1,Object.defineProperty(cp,"__esModule",{value:true}),cp.joinPathSegments=cp.replacePathSegmentSeparator=cp.isAppliedFilter=cp.isFatalError=void 0,cp.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},cp.isAppliedFilter=function(e,t){return null===e||e(t)},cp.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},cp.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},cp}var lp,fp,pp,hp={};function dp(){if(lp)return hp;lp=1,Object.defineProperty(hp,"__esModule",{value:true});const e=up();return hp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},hp}function gp(){if(fp)return df;fp=1,Object.defineProperty(df,"__esModule",{value:true});const e=C,t=tp(),n=op(),r=up(),s=dp();class i extends s.default{constructor(r,s){super(r,s),this._settings=s,this._scandir=t.scandir,this._emitter=new e.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=false,this._isDestroyed=false,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end");};}read(){return this._isFatalError=false,this._isDestroyed=false,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath);}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=true,this._queue.killAndDrain();}onEntry(e){this._emitter.on("entry",e);}onError(e){this._emitter.once("error",e);}onEnd(e){this._emitter.once("end",e);}_pushToQueue(e,t){const n={directory:e,base:t};this._queue.push(n,e=>{null!==e&&this._handleError(e);});}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const t of r)this._handleEntry(t,e.base);t(null,void 0);}else t(n,void 0);});}_handleError(e){!this._isDestroyed&&r.isFatalError(this._settings,e)&&(this._isFatalError=true,this._isDestroyed=true,this._emitter.emit("error",e));}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const n=e.path;void 0!==t&&(e.path=r.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,void 0===t?void 0:e.path);}_emitEntry(e){this._emitter.emit("entry",e);}}return df.default=i,df}var mp,yp={};var vp,_p,bp={},wp={};function Sp(){if(_p)return bp;_p=1,Object.defineProperty(bp,"__esModule",{value:true});const e=function(){if(vp)return wp;vp=1,Object.defineProperty(wp,"__esModule",{value:true});const e=tp(),t=up(),n=dp();class r extends n.default{constructor(){super(...arguments),this._scandir=e.scandirSync,this._storage=[],this._queue=new Set;}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t});}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.directory,e.base);}_handleDirectory(e,t){try{const n=this._scandir(e,this._settings.fsScandirSettings);for(const e of n)this._handleEntry(e,t);}catch(e){this._handleError(e);}}_handleError(e){if(t.isFatalError(this._settings,e))throw e}_handleEntry(e,n){const r=e.path;void 0!==n&&(e.path=t.joinPathSegments(n,e.name,this._settings.pathSegmentSeparator)),t.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&t.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,void 0===n?void 0:e.path);}_pushToStorage(e){this._storage.push(e);}}return wp.default=r,wp}();return bp.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings);}read(){return this._reader.read()}},bp}var Ap,kp,Ep={};function xp(){if(kp)return pf;kp=1,Object.defineProperty(pf,"__esModule",{value:true}),pf.Settings=pf.walkStream=pf.walkSync=pf.walk=void 0;const e=function(){if(pp)return hf;pp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=gp();return hf.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings),this._storage=[];}read(e){this._reader.onError(t=>{!function(e,t){e(t);}(e,t);}),this._reader.onEntry(e=>{this._storage.push(e);}),this._reader.onEnd(()=>{!function(e,t){e(null,t);}(e,this._storage);}),this._reader.read();}},hf}(),t=function(){if(mp)return yp;mp=1,Object.defineProperty(yp,"__esModule",{value:true});const e=R,t=gp();return yp.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new t.default(this._root,this._settings),this._stream=new e.Readable({objectMode:true,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy();}});}read(){return this._reader.onError(e=>{this._stream.emit("error",e);}),this._reader.onEntry(e=>{this._stream.push(e);}),this._reader.onEnd(()=>{this._stream.push(null);}),this._reader.read(),this._stream}},yp}(),n=Sp(),r=function(){if(Ap)return Ep;Ap=1,Object.defineProperty(Ep,"__esModule",{value:true});const e=$,t=tp();return Ep.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.fsScandirSettings=new t.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Ep}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return pf.Settings=r.default,pf.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},pf.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},pf.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},pf}var $p,Op={};function Rp(){if($p)return Op;$p=1,Object.defineProperty(Op,"__esModule",{value:true});const e=$,t=Pf(),n=cf();return Op.default=class{constructor(e){this._settings=e,this._fsStatSettings=new t.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks});}_getFullEntryPath(t){return e.resolve(this._settings.cwd,t)}_makeEntry(e,t){const r={name:t,path:t,dirent:n.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return !n.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}},Op}var Cp,Tp,Pp={};function Lp(){if(Cp)return Pp;Cp=1,Object.defineProperty(Pp,"__esModule",{value:true});const e=R,t=Pf(),n=xp(),r=Rp();class s extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=t.stat;}dynamic(e,t){return this._walkStream(e,t)}static(t,n){const r=t.map(this._getFullEntryPath,this),s=new e.PassThrough({objectMode:true});s._write=(e,i,o)=>this._getEntry(r[e],t[e],n).then(t=>{null!==t&&n.entryFilter(t)&&s.push(t),e===r.length-1&&s.end(),o();}).catch(o);for(let e=0;e<r.length;e++)s.write(e);return s}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>null===e?t(r):n(e));})}}return Pp.default=s,Pp}var Np,Ip,Mp,Dp={},jp={},Hp={},Fp={};function Bp(){if(Ip)return Hp;Ip=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=function(){if(Np)return Fp;Np=1,Object.defineProperty(Fp,"__esModule",{value:true});const e=cf();return Fp.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage();}_fillStorage(){for(const e of this._patterns){const t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n});}}_getPatternSegments(t){return e.pattern.getPatternParts(t,this._micromatchOptions).map(t=>e.pattern.isDynamicPattern(t,this._settings)?{dynamic:true,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:false,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Fp}();class t extends e.default{match(e){const t=e.split("/"),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(const e of r){const r=e.sections[0];if(!e.complete&&n>r.length)return true;if(t.every((t,n)=>{const r=e.segments[n];return !(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return true}return false}}return Hp.default=t,Hp}var zp,Kp={};var Up,qp={};var Zp,Wp,Gp,Vp={};function Yp(){if(Wp)return Dp;Wp=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=$,t=function(){if(Mp)return jp;Mp=1,Object.defineProperty(jp,"__esModule",{value:true});const e=cf(),t=Bp();return jp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t;}getFilter(e,t,n){const r=this._getMatcher(t),s=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,s)}_getMatcher(e){return new t.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const n=t.filter(e.pattern.isAffectDepthOfReadingPattern);return e.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(t,n,r,s){if(this._isSkippedByDeep(t,n.path))return false;if(this._isSkippedSymbolicLink(n))return false;const i=e.path.removeLeadingDotSegment(n.path);return !this._isSkippedByPositivePatterns(i,r)&&this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,t){return this._settings.deep!==1/0&&this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){const n=t.split("/").length;return ""===e?n:n-e.split("/").length}_isSkippedSymbolicLink(e){return !this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return !this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(t,n){return !e.pattern.matchAny(t,n)}},jp}(),n=function(){if(zp)return Kp;zp=1,Object.defineProperty(Kp,"__esModule",{value:true});const e=cf();return Kp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map;}getFilter(t,n){const[r,s]=e.pattern.partitionAbsoluteAndRelative(n),i={positive:{all:e.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:true})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:true}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return false;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return false;const s=this._isMatchToPatternsSet(r,n,t.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(r),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0);}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return !!this._isMatchToPatterns(e,t.positive.all,n)&&(!this._isMatchToPatterns(e,t.negative.relative,n)&&!this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(t,n,r){if(0===n.length)return false;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return false;const s=e.pattern.matchAny(t,n);return !s&&r?e.pattern.matchAny(t+"/",n):s}},Kp}(),r=function(){if(Up)return qp;Up=1,Object.defineProperty(qp,"__esModule",{value:true});const e=cf();return qp.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},qp}(),s=function(){if(Zp)return Vp;Zp=1,Object.defineProperty(Vp,"__esModule",{value:true});const e=cf();return Vp.default=class{constructor(e){this._settings=e;}getTransformer(){return e=>this._transform(e)}_transform(t){let n=t.path;return this._settings.absolute&&(n=e.path.makeAbsolute(this._settings.cwd,n),n=e.path.unixify(n)),this._settings.markDirectories&&t.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:n}):n}},Vp}();return Dp.default=class{constructor(e){this._settings=e,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new t.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings);}_getRootDirectory(t){return e.resolve(this._settings.cwd,t.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return {basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return {dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:true,strictSlashes:false}}},Dp}function Qp(){if(Gp)return lf;Gp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=function(){if(Tp)return ff;Tp=1,Object.defineProperty(ff,"__esModule",{value:true});const e=xp(),t=Rp(),n=Lp();class r extends t.default{constructor(){super(...arguments),this._walkAsync=e.walk,this._readerStream=new n.default(this._settings);}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{null===e?n(t):r(e);});})}async static(e,t){const n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once("error",t),r.on("data",e=>n.push(e)),r.once("end",()=>e(n));})}}return ff.default=r,ff}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings);}async read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return (await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return lf.default=n,lf}var Jp,Xp={};var eh,th,nh={},rh={};function sh(){if(th)return nh;th=1,Object.defineProperty(nh,"__esModule",{value:true});const e=function(){if(eh)return rh;eh=1,Object.defineProperty(rh,"__esModule",{value:true});const e=Pf(),t=xp(),n=Rp();class r extends n.default{constructor(){super(...arguments),this._walkSync=t.walkSync,this._statSync=e.statSync;}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const n=[];for(const r of e){const e=this._getFullEntryPath(r),s=this._getEntry(e,r,t);null!==s&&t.entryFilter(s)&&n.push(s);}return n}_getEntry(e,t,n){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}return rh.default=r,rh}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings);}read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return nh.default=n,nh}var ih,oh,ah,ch={};var uh,lh,fh=function(){if(ah)return oh;ah=1;const e=function(){if(sf)return Du;sf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.convertPatternGroupToTask=Du.convertPatternGroupsToTasks=Du.groupPatternsByBaseDirectory=Du.getNegativePatternsAsPositive=Du.getPositivePatterns=Du.convertPatternsToTasks=Du.generate=void 0;const e=cf();function t(t,n){let r=t;return n.braceExpansion&&(r=e.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes("/")?e:`**/${e}`)),r.map(t=>e.pattern.removeDuplicateSlashes(t))}function n(t,n,r){const s=[],c=e.pattern.getPatternsOutsideCurrentDirectory(t),u=e.pattern.getPatternsInsideCurrentDirectory(t),l=i(c),f=i(u);return s.push(...o(l,n,r)),"."in f?s.push(a(".",u,n,r)):s.push(...o(f,n,r)),s}function r(t){return e.pattern.getPositivePatterns(t)}function s(t,n){return e.pattern.getNegativePatterns(t).concat(n).map(e.pattern.convertToPositivePattern)}function i(t){return t.reduce((t,n)=>{const r=e.pattern.getBaseDirectory(n);return r in t?t[r].push(n):t[r]=[n],t},{})}function o(e,t,n){return Object.keys(e).map(r=>a(r,e[r],t,n))}function a(t,n,r,s){return {dynamic:s,positive:n,negative:r,base:t,patterns:[].concat(n,r.map(e.pattern.convertToNegativePattern))}}return Du.generate=function(i,o){const a=t(i,o),c=t(o.ignore,o),u=r(a),l=s(a,c),f=u.filter(t=>e.pattern.isStaticPattern(t,o)),p=u.filter(t=>e.pattern.isDynamicPattern(t,o)),h=n(f,l,false),d=n(p,l,true);return h.concat(d)},Du.convertPatternsToTasks=n,Du.getPositivePatterns=r,Du.getNegativePatternsAsPositive=s,Du.groupPatternsByBaseDirectory=i,Du.convertPatternGroupsToTasks=o,Du.convertPatternGroupToTask=a,Du}(),t=Qp(),n=function(){if(Jp)return Xp;Jp=1,Object.defineProperty(Xp,"__esModule",{value:true});const e=R,t=Lp(),n=Yp();class r extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings);}read(t){const n=this._getRootDirectory(t),r=this._getReaderOptions(t),s=this.api(n,t,r),i=new e.Readable({objectMode:true,read:()=>{}});return s.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Xp.default=r,Xp}(),r=sh(),s=(ih||(ih=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=x,r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,false),this.baseNameMatch=this._getValue(this._options.baseNameMatch,false),this.braceExpansion=this._getValue(this._options.braceExpansion,true),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,false),this.extglob=this._getValue(this._options.extglob,true),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,true),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,false),this.objectMode=this._getValue(this._options.objectMode,false),this.onlyDirectories=this._getValue(this._options.onlyDirectories,false),this.onlyFiles=this._getValue(this._options.onlyFiles,true),this.stats=this._getValue(this._options.stats,false),this.suppressErrors=this._getValue(this._options.suppressErrors,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false),this.unique=this._getValue(this._options.unique,true),this.onlyDirectories&&(this.onlyFiles=false),this.stats&&(this.objectMode=true),this.ignore=[].concat(this.ignore);}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};}(ch)),ch),i$1=cf();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i$1.array.flatten(s)}function a(t,n,r){const i=[].concat(t),o=new s.default(r),a=e.generate(i,o),c=new n(o);return a.map(c.read,c)}function c(e){if(![].concat(e).every(e=>i$1.string.isString(e)&&!i$1.string.isEmpty(e)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}return function(t){function o(e,t){c(e);const n=a(e,r.default,t);return i$1.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i$1.stream.merge(r)}var l,f;t.glob=t,t.globSync=o,t.globStream=u,t.async=t,t.sync=o,t.stream=u,t.generateTasks=function(t,n){c(t);const r=[].concat(t),i=new s.default(n);return e.generate(r,i)},t.isDynamicPattern=function(e,t){c(e);const n=new s.default(t);return i$1.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i$1.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i$1.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i$1.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i$1.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i$1.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i$1.path.convertWindowsPathToPattern(e)};}(o||(o={})),oh=o}(),ph=U(fh);var hh=function(){if(lh)return uh;lh=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return uh=function(e,a){Object.assign({flipBackslashes:true},a).flipBackslashes&&n&&e.indexOf(r)<0&&(e=e.replace(s,r)),function(e){var t;switch(e.slice(-1)){case "}":t="{";break;case "]":t="[";break;default:return false}var n=e.indexOf(t);if(n<0)return false;return e.slice(n+1,-1).includes(r)}(e)&&(e+=r),e+="a";do{e=t(e);}while(o(e));return e.replace(i,"$1")}}(),dh=U(hh);const gh=e=>""!==e&&".."!==e,mh=e=>{if("string"!=typeof e||!e.trim())return null;const t=e.trim().replace(/[^A-Za-z0-9@/_-]/g,"_").replace(/\/{2,}/g,"/").trim().split("/").filter(e=>e.length>0);if(0===t.length)return null;for(const e of t)if(!gh(e))return null;return t.join("/")},yh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},vh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=de(t,n),o=path.join(i.rootAbs,"imports");await ensureDir(o);const a=Object.keys(r).sort();for(const e of a){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const a=path.join(o,i);await rm(a,{recursive:true,force:true}).catch(()=>{}),await ensureDir(a).catch(()=>{});const u=[];for(const e of n){const n=String(e??"").trim();if(!n)continue;const r=dh(n.replace(/\\/g,"/"));try{const e=await ph(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await yh(n))continue;const e=path.relative(path.isAbsolute(r)?r:path.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=path.join(a,e);await ensureDir(path.dirname(s)).catch(()=>{});try{await copyFile(n,s),u.push(s);}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>path.relative(t,e).replace(/\\/g,"/")));}}catch{}}},_h=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return Ee({cwd:path.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=path.join(e,"dist","stan.system.md");return existsSync(n)?n:null};const wh="0.3.0-0";
4351
+ const P="archive.tar",L="archive.prev.tar",N=e=>e.replace(/\\/g,"/"),I=(e,t)=>{const n=N(e).replace(/\/+$/,""),r=N(t);return r===n||r.startsWith(`${n}/`)},M=(e,t)=>{const n=N(e);return I(`${n}/diff`,t)||I(`${n}/patch`,t)},D=I,j=e=>{const t=e.replace(/\\/g,"/");return e=>!(M(t,e)||((e,t)=>{const n=N(e);return N(t)===`${n}/output/${P}`||N(t)===`${n}/output/archive.diff.tar`||N(t)===`${n}/output/archive.warnings.txt`})(t,e))},H=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},F=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);},B=1048576,z=async(e,t)=>{const n=[],r=[],a=[];await Promise.all(t.map(async t=>{const c=t.replace(/\\/g,"/");const u=resolve(e,t);let l=null;try{l=await stat(u);}catch{return}const f=l?.size??0;let p,d=false;try{d=await(async e=>{try{const t=await open(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:n}=await t.read(e,0,e.length,0);for(let t=0;t<n;t+=1)if(0===e[t])return !0;return !1}finally{await t.close().catch(()=>{});}}catch{return !1}})(u);}catch{d=false;}if(d)return void r.push({path:c,size:f});n.push(c);try{if(f<=B||f<5*B){p=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await readFile(u,"utf8"));}}catch{}(f>B||"number"==typeof p&&p>3e3)&&a.push({path:c,size:f,loc:p});}));const c=[];if(r.length>0){c.push(`Binary files excluded from archive (${r.length.toString()}):`);for(const e of r)c.push(` - ${e.path} (${e.size.toString()} bytes)`);c.push("");}if(a.length>0){c.push(`Large text files (included; consider excludes if unwanted) (${a.length.toString()}):`);for(const e of a){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),c.push(t.join(" "));}c.push(""),c.push(`Thresholds: size > ${B.toString()} bytes or LOC > ${3e3.toString()}`);}0===c.length&&c.push("No archive warnings.");const u=c.join("\n")+(c.length?"\n":"");return {textFiles:n,excludedBinaries:r,largeText:a,warningsBody:u}};var K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,Z={exports:{}};var W,G,V,Y,Q,J,X,ee,te,ne,re,se=(q||(q=1,function(e){function t(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,r=/(?:[^\\]|^)\\$/,s=/^\\!/,i=/^\\#/,o=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,c=/\/$/,u="/";let l="node-ignore";"undefined"!=typeof Symbol&&(l=Symbol.for("node-ignore"));const f=l,p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),h=/([0-z])-([0-z])/g,d=()=>false,g=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return /\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",_={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},b=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i);}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(m,_[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=false,o=e;0===o.indexOf("!")&&(r=true,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[];}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=true);if(b(e)&&(e={pattern:e}),(e=>e&&b(e)&&!n.test(e)&&!r.test(e)&&0!==e.indexOf("#"))(e.pattern)){const t=S(e,this._ignoreCase);this._added=true,this._rules.push(t);}}add(e){return this._added=false,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=false,i=false;this._rules.forEach(o=>{const{negative:a}=o;i===a&&s!==i||a&&!s&&!i&&!t||o[n].test(e)&&(s=!a,i=a,r=a?void 0:o);});const o={ignored:s,unignored:i};return r&&(o.rule=r),o}}const k=(e,t)=>{throw new t(e)},E=(e,t,n)=>b(e)?e?!E.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),x=e=>a.test(e);E.isNotRelative=x,E.convert=e=>e;class ${constructor({ignorecase:e=true,ignoreCase:t=e,allowRelativePaths:n=false}={}){p(this,f,true),this._rules=new A(t),this._strictPathCheck=!n,this._initCache();}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null);}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){const s=e&&E.convert(e);return E(s,e,this._strictPathCheck?k:d),this._t(s,t,n,r)}checkIgnore(e){if(!c.test(e))return this.test(e);const t=e.split(u).filter(Boolean);if(t.pop(),t.length){const e=this._t(t.join(u)+u,this._testCache,true,t);if(e.ignored)return e}return this._rules.test(e,false,v)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split(u).filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);const s=this._t(r.join(u)+u,t,n,r);return t[e]=s.ignored?s:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,false).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,true)}}const O=e=>new $(e),R=()=>{E.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");const e=/^[a-z]:\//i;E.isNotRelative=t=>e.test(t)||x(t);};"undefined"!=typeof process&&"win32"===process.platform&&R(),e.exports=O,O.default=O,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(Z)),Z.exports),ie=U(se),oe={};function ae(){if(G)return W;G=1;const e="\\\\/",t=`[^${e}]`,n="\\.",r="\\/",s="[^/]",i=`(?:${r}|$)`,o=`(?:^|${r})`,a=`${n}{1,2}${i}`,c={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:r,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${o}${a})`,NO_DOT_SLASH:`(?!${n}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${r}]`,STAR:`${s}*?`,START_ANCHOR:o,SEP:"/"},u={...c,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"};return W={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>true===e?u:c}}function ce(){return V||(V=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=ae();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(s,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return "win32"===e||"windows"===e}return !("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(n,e=>"\\"===e?"":e),e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return -1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return true===t.negated&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return ""===r?n[n.length-2]:r};}(oe)),oe}function ue(){if(Q)return Y;Q=1;const e=ce(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=ae(),m=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Y=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(true===D||$===c){for(z++;true!==U()&&($=Z());)if($!==r)if($!==c){if(true!==D&&$===i&&($=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&$===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if($===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if($!==a){if(true!==b.noext){if(true===($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,$===o&&R===C&&(F=true),true===S){for(;true!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,$=Z();continue}break}}if($===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if($===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if($===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||$!==o||R!==C){if(true!==b.noparen&&$===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&($=Z());)if($!==u){if($===d){B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,$=Z(),$===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&true===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):true===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(true===b.tokens&&(Y.maxDepth=0,m($)||k.push(K),Y.tokens=k),true===b.parts||true===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=true,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r;}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth);}Y.slashes=A,Y.parts=E;}return Y},Y}function le(){if(X)return J;X=1;const e=ae(),t=ce(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r);}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=e.globChars(p.windows),_=e.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:$,QMARK:O,QMARK_NO_DOT:R,STAR:C,START_ANCHOR:T}=v,P=e=>`(${y}(?:(?!${T}${e.dot?k:b}).)*?)`,L=p.dot?"":E,N=p.dot?O:R;let I=true===p.bash?P(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:m};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],H=[];let F,B=g;const z=()=>M.index===d-1,K=M.peek=(e=1)=>l[M.index+e],U=M.advance=()=>l[++M.index]||"",q=()=>l.slice(M.index+1),Z=(e="",t=0)=>{M.consumed+=e,M.index+=t;},W=e=>{M.output+=null!=e.output?e.output:e.value,Z(e.value);},G=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),M.start++,e++;return e%2!=0&&(M.negated=true,M.start++,true)},V=e=>{M[e]++,H.push(e);},Y=e=>{M[e]--,H.pop();},Q=e=>{if("globstar"===B.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=true===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,M.output+=B.output);}if(D.length&&"paren"!==e.type&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&W(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,m.push(e),B=e;},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=B,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:M.output?"":A}),Q({type:"paren",extglob:true,value:U(),output:r}),D.push(n);},X=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=I;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=P(p)),(r!==I||z()||/^\)+$/.test(q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(M.negatedExtglob=true);}Q({type:"paren",extglob:true,value:F,output:n}),Y("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?O.repeat(i.length):""):0===o?N+(i?O.repeat(i.length):""):O.repeat(r.length):"."===s?b.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!z();){if(F=U(),"\0"===F)continue;if("\\"===F){const e=K();if("/"===e&&true!==p.bash)continue;if("."===e||";"===e)continue;if(!e){F+="\\",Q({type:"text",value:F});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(F+="\\")),true===p.unescape?F=U():F+=U(),0===M.brackets){Q({type:"text",value:F});continue}}if(M.brackets>0&&("]"!==F||"["===B.value||"[^"===B.value)){if(false!==p.posix&&":"===F){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=true,e.includes(":"))){const e=B.value.lastIndexOf("["),t=B.value.slice(0,e),n=B.value.slice(e+2),s=r[n];if(s){B.value=t+s,M.backtrack=true,U(),g.output||1!==m.indexOf(B)||(g.output=A);continue}}}("["===F&&":"!==K()||"-"===F&&"]"===K())&&(F=`\\${F}`),"]"!==F||"["!==B.value&&"[^"!==B.value||(F=`\\${F}`),true===p.posix&&"!"===F&&"["===B.value&&(F="^"),B.value+=F,W({value:F});continue}if(1===M.quotes&&'"'!==F){F=t.escapeRegex(F),B.value+=F,W({value:F});continue}if('"'===F){M.quotes=1===M.quotes?0:1,true===p.keepQuotes&&Q({type:"text",value:F});continue}if("("===F){V("parens"),Q({type:"paren",value:F});continue}if(")"===F){if(0===M.parens&&true===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=D[D.length-1];if(e&&M.parens===e.parens+1){X(D.pop());continue}Q({type:"paren",value:F,output:M.parens?")":"\\)"}),Y("parens");continue}if("["===F){if(true!==p.nobracket&&q().includes("]"))V("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));F=`\\${F}`;}Q({type:"bracket",value:F});continue}if("]"===F){if(true===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:F,output:`\\${F}`});continue}if(0===M.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:F,output:`\\${F}`});continue}Y("brackets");const e=B.value.slice(1);if(true===B.posix||"^"!==e[0]||e.includes("/")||(F=`/${F}`),B.value+=F,W({value:F}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),true===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===F&&true!==p.nobrace){V("braces");const e={type:"brace",value:F,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};j.push(e),Q(e);continue}if("}"===F){const e=j[j.length-1];if(true===p.nobrace||!e){Q({type:"text",value:F,output:F});continue}let t=")";if(true===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=true;}if(true!==e.comma&&true!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",F=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value;}Q({type:"brace",value:F,output:t}),Y("braces"),j.pop();continue}if("|"===F){D.length>0&&D[D.length-1].conditions++,Q({type:"text",value:F});continue}if(","===F){let e=F;const t=j[j.length-1];t&&"braces"===H[H.length-1]&&(t.comma=true,e="|"),Q({type:"comma",value:F,output:e});continue}if("/"===F){if("dot"===B.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",m.pop(),B=g;continue}Q({type:"slash",value:F,output:S});continue}if("."===F){if(M.braces>0&&"dot"===B.type){"."===B.value&&(B.output=b);const e=j[j.length-1];B.type="dots",B.output+=F,B.value+=F,e.dots=true;continue}if(M.braces+M.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:F,output:b});continue}Q({type:"dot",value:F,output:b});continue}if("?"===F){if(!(B&&"("===B.value)&&true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",F);continue}if(B&&"paren"===B.type){const e=K();let t=F;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${F}`),Q({type:"text",value:F,output:t});continue}if(true!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:F,output:R});continue}Q({type:"qmark",value:F,output:O});continue}if("!"===F){if(true!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",F);continue}if(true!==p.nonegate&&0===M.index){G();continue}}if("+"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",F);continue}if(B&&"("===B.value||false===p.regex){Q({type:"plus",value:F,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||M.parens>0){Q({type:"plus",value:F});continue}Q({type:"plus",value:w});continue}if("@"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:true,value:F,output:""});continue}Q({type:"text",value:F});continue}if("*"!==F){"$"!==F&&"^"!==F||(F=`\\${F}`);const e=s.exec(q());e&&(F+=e[0],M.index+=e[0].length),Q({type:"text",value:F});continue}if(B&&("globstar"===B.type||true===B.star)){B.type="star",B.star=true,B.value+=F,B.output=I,M.backtrack=true,M.globstar=true,Z(F);continue}let e=q();if(true!==p.noextglob&&/^\([^?]/.test(e)){J("star",F);continue}if("star"===B.type){if(true===p.noglobstar){Z(F);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(true===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:F,output:""});continue}const i=M.braces>0&&("comma"===t.type||"brace"===t.type),o=D.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:F,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[M.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3);}if("bos"===t.type&&z()){B.type="globstar",B.value+=F,B.output=P(p),M.output=B.output,M.globstar=true,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=P(p)+(p.strictSlashes?")":"|$)"),B.value+=F,M.globstar=true,M.output+=t.output+B.output,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${P(p)}${S}|${S}${n})`,B.value+=F,M.output+=t.output+B.output,M.globstar=true,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=F,B.output=`(?:^|${S}|${P(p)}${S})`,M.output=B.output,M.globstar=true,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-B.output.length),B.type="globstar",B.output=P(p),B.value+=F,M.output+=B.output,M.globstar=true,Z(F);continue}const n={type:"star",value:F,output:I};true!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||true!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):true===p.dot?(M.output+=$,B.output+=$):(M.output+=L,B.output+=L),"*"!==K()&&(M.output+=A,B.output+=A)),Q(n)):(n.output=F,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=L+n.output),Q(n));}for(;M.brackets>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets");}for(;M.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens");}for(;M.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces");}if(true===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),true===M.backtrack){M.output="";for(const e of M.tokens)M.output+=null!=e.output?e.output:e.value,e.suffix&&(M.output+=e.suffix);}return M};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?g:h,b=i.capture?"":"?:";let w=true===i.bash?".*?":m;i.capture&&(w=`(${w})`);const S=e=>true===e.noglobstar?w:`(${b}(?:(?!${y}${e.dot?p:u}).)*?)`,A=e=>{switch(e){case "*":return `${v}${f}${w}`;case ".*":return `${u}${f}${w}`;case "*.*":return `${v}${w}${u}${f}${w}`;case "*/*":return `${v}${w}${l}${f}${_}${w}`;case "**":return v+S(i);case "**/*":return `(?:${v}${S(i)}${l})?${_}${f}${w}`;case "**/*.*":return `(?:${v}${S(i)}${l})?${_}${w}${u}${f}${w}`;case "**/.*":return `(?:${v}${S(i)}${l})?${u}${f}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=A(t[1]);if(!n)return;return n+u+t[2]}}},k=t.removePrefix(r,{negated:false,prefix:""});let E=A(k);return E&&true!==i.strictSlashes&&(E+=`${l}?`),E},J=u}function fe(){if(te)return ee;te=1;const e=ue(),t=le(),n=ce(),r=ae(),s=(e,t,n=false)=>{if(Array.isArray(e)){const r=e.map(e=>s(e,t,n)),i=e=>{for(const t of r){const n=t(e);if(n)return n}return false};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const o=t||{},a=o.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,false,true),u=c.state;delete c.state;let l=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n);}const f=(n,r=false)=>{const{isMatch:i,match:f,output:p}=s.test(n,c,t,{glob:e,posix:a}),h={glob:e,state:u,regex:c,posix:a,input:n,output:p,match:f,isMatch:i};return "function"==typeof o.onResult&&o.onResult(h),false===i?(h.isMatch=false,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=false,!!r&&h):("function"==typeof o.onMatch&&o.onMatch(h),!r||h)};return n&&(f.state=u),f};return s.test=(e,t,r,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return {isMatch:false,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===i),false!==u&&true!==a.capture||(u=true===a.matchBase||true===a.basename?s.matchBase(e,t,r,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},s.matchBase=(e,t,r)=>(t instanceof RegExp?t:s.makeRe(t,r)).test(n.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,n)=>Array.isArray(e)?e.map(e=>s.parse(e,n)):t(e,{...n,fastpaths:false}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return true===r&&(u.state=e),u},s.makeRe=(e,n={},r=false,i=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===n.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=t.fastpaths(e,n)),o.output||(o=t(e,n)),s.compileRe(o,n,r,i)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&true===t.debug)throw e;return /$^/}},s.constants=r,ee=s}function pe(){if(re)return ne;re=1;const e=fe(),t=ce();function n(n,r,s=false){return !r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),ne=n}var he=U(pe());const de=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const r=`${n}/system`,s=`${n}/output`,i=`${n}/diff`,o=`${n}/dist`,a=`${n}/patch`,c=`${n}/imports`;return {rootRel:n,systemRel:r,outputRel:s,diffRel:i,distRel:o,patchRel:a,importsRel:c,rootAbs:resolve(e,n),systemAbs:resolve(e,r),outputAbs:resolve(e,s),diffAbs:resolve(e,i),distAbs:resolve(e,o),patchAbs:resolve(e,a),importsAbs:resolve(e,c)}},ge=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),s=resolve(e,r),i=await readdir(s,{withFileTypes:true});for(const e of i){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t},me=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},ye=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>me(e,t):()=>false;var n;const r=he(t,{dot:true});return e=>r(e)},ve=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[],anchors:c=[]})=>{const u=r.replace(/\\/g,"/"),l=((e,t)=>{const n=new Set;for(const r of e){if("package.json"===r)continue;if(!r.endsWith("/package.json"))continue;const e=r.slice(0,-13);e.startsWith("node_modules/")||e.startsWith(".git/")||e===t||e.startsWith(`${t}/`)||e.length>0&&n.add(e);}return Array.from(n)})(e,u),f=await(async e=>{const n=resolve(e,".gitignore");if(!existsSync(n))return null;try{const e=await readFile(n,"utf8"),t=ie();return t.add(e),t}catch{return null}})(n),p=[e=>me(e,"node_modules"),e=>me(e,".git"),...f?[e=>f.ignores(e)]:[],...a.map(ye),...l.map(e=>t=>me(t,e)),e=>M(u,e)];s||p.push(e=>D(`${u}/output`,e));const d=e.filter(e=>!p.some(t=>t(e)));if(o.length>0){const t=o.map(ye),n=[e=>M(u,e),...s?[]:[e=>D(`${u}/output`,e)]],r=new Set(d);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(ye),l=new Set(e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e))));if(c.length>0){const t=c.map(ye);for(const n of e){!(M(u,n)||!s&&D(`${u}/output`,n))&&t.some(e=>e(n))&&l.add(n);}}return e.filter(e=>l.has(e))}if(c.length>0){const t=c.map(ye),n=new Set(d);for(const r of e){!(M(u,r)||!s&&D(`${u}/output`,r))&&t.some(e=>e(r))&&n.add(r);}return e.filter(e=>n.has(e))}return d},_e=async(e,t)=>{const n=de(e,t);return await ensureDir(n.rootAbs),await ensureDir(n.outputAbs),await ensureDir(n.diffAbs),await ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},be=async(e,t)=>{const n=await _e(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}},we=async(e,n,r={})=>{const{includeOutputDir:s=false,fileName:i,includes:o=[],excludes:a=[],anchors:u=[]}=r;let l=i??"archive.tar";l.endsWith(".tar")||(l+=".tar");const{outDir:f,diffDir:p}=await be(e,n),d=await ge(e),g=await ve(d,{cwd:e,stanPath:n,includeOutputDir:s,includes:o,excludes:a,anchors:u}),m=resolve(f,l),y=resolve(p,L);if(existsSync(m))try{await copyFile(m,y);}catch{}const{textFiles:v,warningsBody:_}=await z(e,g),b=v;F(_,r.onArchiveWarnings);const w=await import('./index-ucZa1KMb-CSQ-GldX.js');if(s?await w.create({file:m,cwd:e,filter:j(n)},H(b,n)):await w.create({file:m,cwd:e,filter:j(n)},b),!existsSync(y))try{await copyFile(m,y);}catch{}return m},Se=".stan",Ae="code -g {file}",ke=e=>e instanceof URL?fileURLToPath(e):e;function Ee({cwd:t}={}){const n=function(t,{cwd:n=process$2.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(ke(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,ke(s)??o);const a=path.isAbsolute(t);for(;i;){const n=a?t:path.join(i,t);try{const t=c.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=path.dirname(i);}}("package.json",{cwd:t});return n&&path.dirname(n)}const xe=["stan.config.yml","stan.config.yaml","stan.config.json"],$e=e=>{for(const n of xe){const r=resolve(e,n);if(existsSync(r))return r}return null},Oe=e=>{const t=$e(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=Ee({cwd:r});if(!e||n.has(e))break;n.add(e);const t=$e(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Re,Ce={},Te={},Pe={},Le={};function Ne(){if(Re)return Le;Re=1;const e=Symbol.for("yaml.alias"),t=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),s=Symbol.for("yaml.scalar"),i=Symbol.for("yaml.seq"),o=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[o]===s;function c(e){if(e&&"object"==typeof e)switch(e[o]){case n:case i:return true}return false}return Le.ALIAS=e,Le.DOC=t,Le.MAP=n,Le.NODE_TYPE=o,Le.PAIR=r,Le.SCALAR=s,Le.SEQ=i,Le.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Le.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Le.isCollection=c,Le.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Le.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Le.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Le.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Le.isScalar=a,Le.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Le}var Ie,Me,De={};function je(){if(Ie)return De;Ie=1;var e=Ne();const t=Symbol("break visit"),n=Symbol("skip children"),r=Symbol("remove node");function s(t,n){const s=c(n);if(e.isDocument(t)){i(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null);}else i(null,t,s,Object.freeze([]));}function i(n,s,o,a){const c=u(n,s,o,a);if(e.isNode(c)||e.isPair(c))return l(n,a,c),i(n,c,o,a);if("symbol"!=typeof c)if(e.isCollection(s)){a=Object.freeze(a.concat(s));for(let e=0;e<s.items.length;++e){const n=i(e,s.items[e],o,a);if("number"==typeof n)e=n-1;else {if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1);}}}else if(e.isPair(s)){a=Object.freeze(a.concat(s));const e=i("key",s.key,o,a);if(e===t)return t;e===r&&(s.key=null);const n=i("value",s.value,o,a);if(n===t)return t;n===r&&(s.value=null);}return c}async function o(t,n){const s=c(n);if(e.isDocument(t)){await a(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null);}else await a(null,t,s,Object.freeze([]));}async function a(n,s,i,o){const c=await u(n,s,i,o);if(e.isNode(c)||e.isPair(c))return l(n,o,c),a(n,c,i,o);if("symbol"!=typeof c)if(e.isCollection(s)){o=Object.freeze(o.concat(s));for(let e=0;e<s.items.length;++e){const n=await a(e,s.items[e],i,o);if("number"==typeof n)e=n-1;else {if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1);}}}else if(e.isPair(s)){o=Object.freeze(o.concat(s));const e=await a("key",s.key,i,o);if(e===t)return t;e===r&&(s.key=null);const n=await a("value",s.value,i,o);if(n===t)return t;n===r&&(s.value=null);}return c}function c(e){return "object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(t,n,r,s){return "function"==typeof r?r(t,n,s):e.isMap(n)?r.Map?.(t,n,s):e.isSeq(n)?r.Seq?.(t,n,s):e.isPair(n)?r.Pair?.(t,n,s):e.isScalar(n)?r.Scalar?.(t,n,s):e.isAlias(n)?r.Alias?.(t,n,s):void 0}function l(t,n,r){const s=n[n.length-1];if(e.isCollection(s))s.items[t]=r;else if(e.isPair(s))"key"===t?s.key=r:s.value=r;else {if(!e.isDocument(s)){const t=e.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${t} parent`)}s.contents=r;}}return s.BREAK=t,s.SKIP=n,s.REMOVE=r,o.BREAK=t,o.SKIP=n,o.REMOVE=r,De.visit=s,De.visitAsync=o,De}function He(){if(Me)return Pe;Me=1;var e=Ne(),t=je();const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class s{constructor(e,t){this.docStart=null,this.docEnd=false,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t);}clone(){const e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new s(this.yaml,this.tags);switch(this.yaml.version){case "1.1":this.atNextDocument=true;break;case "1.2":this.atNextDocument=false,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=false);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case "%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return false;const[e,r]=n;return this.tags[e]=r,true}case "%YAML":{if(this.yaml.explicit=true,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),false;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,true;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),false}default:return t(0,`Unknown directive ${r}`,true),false}}tagName(e,t){if("!"===e)return "!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return "!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return "!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+r(e.substring(n.length));return "!"===e[0]?e:`!<${e}>`}toString(n){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(n&&s.length>0&&e.isNode(n.contents)){const r={};t.visit(n.contents,(t,n)=>{e.isNode(n)&&n.tag&&(r[n.tag]=true);}),i=Object.keys(r);}else i=[];for(const[e,t]of s)"!!"===e&&"tag:yaml.org,2002:"===t||n&&!i.some(e=>e.startsWith(t))||r.push(`%TAG ${e} ${t}`);return r.join("\n")}}return s.defaultYaml={explicit:false,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},Pe.Directives=s,Pe}var Fe,Be={},ze={},Ke={};function Ue(){if(Fe)return Ke;Fe=1;var e=Ne(),t=je();function n(e){const n=new Set;return t.visit(e,{Value(e,t){t.anchor&&n.add(t.anchor);}}),n}function r(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}return Ke.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return true},Ke.anchorNames=n,Ke.createNodeAnchors=function(t,s){const i=[],o=new Map;let a=null;return {onAnchor:e=>{i.push(e),a??(a=n(t));const o=r(s,a);return a.add(o),o},setAnchors:()=>{for(const t of i){const n=o.get(t);if("object"!=typeof n||!n.anchor||!e.isScalar(n.node)&&!e.isCollection(n.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}n.node.anchor=n.anchor;}},sourceObjects:o}},Ke.findNewAnchor=r,Ke}var qe,Ze={},We={};function Ge(){if(qe)return We;return qe=1,We.applyReviver=function e(t,n,r,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let n=0,r=s.length;n<r;++n){const r=s[n],i=e(t,s,String(n),r);void 0===i?delete s[n]:i!==r&&(s[n]=i);}else if(s instanceof Map)for(const n of Array.from(s.keys())){const r=s.get(n),i=e(t,s,n,r);void 0===i?s.delete(n):i!==r&&s.set(n,i);}else if(s instanceof Set)for(const n of Array.from(s)){const r=e(t,s,n,n);void 0===r?s.delete(n):r!==n&&(s.delete(n),s.add(r));}else for(const[n,r]of Object.entries(s)){const i=e(t,s,n,r);void 0===i?delete s[n]:i!==r&&(s[n]=i);}return t.call(n,r,s)},We}var Ve,Ye,Qe,Je={};function Xe(){if(Ve)return Je;Ve=1;var e=Ne();return Je.toJS=function t(n,r,s){if(Array.isArray(n))return n.map((e,n)=>t(e,String(n),s));if(n&&"function"==typeof n.toJSON){if(!s||!e.hasAnchor(n))return n.toJSON(r,s);const t={aliasCount:0,count:1,res:void 0};s.anchors.set(n,t),s.onCreate=e=>{t.res=e,delete s.onCreate;};const i=n.toJSON(r,s);return s.onCreate&&s.onCreate(i),i}return "bigint"!=typeof n||s?.keep?n:Number(n)},Je}function et(){if(Ye)return Ze;Ye=1;var e=Ge(),t=Ne(),n=Xe();return Ze.NodeBase=class{constructor(e){Object.defineProperty(this,t.NODE_TYPE,{value:e});}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(r,{mapAsMap:s,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!t.isDocument(r))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:r,keep:true,mapAsMap:true===s,mapKeyWarned:false,maxAliasCount:"number"==typeof i?i:100},u=n.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return "function"==typeof a?e.applyReviver(a,{"":u},"",u):u}},Ze}function tt(){if(Qe)return ze;Qe=1;var e=Ue(),t=je(),n=Ne(),r=et(),s=Xe();let i=class extends r.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}});}resolve(e,r){let s,i;r?.aliasResolveCache?s=r.aliasResolveCache:(s=[],t.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t);}}),r&&(r.aliasResolveCache=s));for(const e of s){if(e===this)break;e.anchor===this.source&&(i=e);}return i}toJSON(e,t){if(!t)return {source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let c=n.get(a);if(c||(s.toJS(a,null,t),c=n.get(a)),!c||void 0===c.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(i>=0&&(c.count+=1,0===c.aliasCount&&(c.aliasCount=o(r,a,n)),c.count*c.aliasCount>i)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(e.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(t.implicitKey)return `${s} `}return s}};function o(e,t,r){if(n.isAlias(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}if(n.isCollection(t)){let n=0;for(const s of t.items){const t=o(e,s,r);t>n&&(n=t);}return n}if(n.isPair(t)){const n=o(e,t.key,r),s=o(e,t.value,r);return Math.max(n,s)}return 1}return ze.Alias=i,ze}var nt,rt,st,it={},ot={},at={};function ct(){if(nt)return at;nt=1;var e=Ne(),t=et(),n=Xe();let r=class extends t.NodeBase{constructor(t){super(e.SCALAR),this.value=t;}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}};return r.BLOCK_FOLDED="BLOCK_FOLDED",r.BLOCK_LITERAL="BLOCK_LITERAL",r.PLAIN="PLAIN",r.QUOTE_DOUBLE="QUOTE_DOUBLE",r.QUOTE_SINGLE="QUOTE_SINGLE",at.Scalar=r,at.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,at}function ut(){if(rt)return ot;rt=1;var e=tt(),t=Ne(),n=ct();return ot.createNode=function(r,s,i){if(t.isDocument(r)&&(r=r.contents),t.isNode(r))return r;if(t.isPair(r)){const e=i.schema[t.MAP].createNode?.(i.schema,null,i);return e.items.push(r),e}(r instanceof String||r instanceof Number||r instanceof Boolean||"undefined"!=typeof BigInt&&r instanceof BigInt)&&(r=r.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:u,sourceObjects:l}=i;let f;if(o&&r&&"object"==typeof r){if(f=l.get(r),f)return f.anchor??(f.anchor=a(r)),new e.Alias(f.anchor);f={anchor:null,node:null},l.set(r,f);}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let p=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(r,s,u.tags);if(!p){if(r&&"function"==typeof r.toJSON&&(r=r.toJSON()),!r||"object"!=typeof r){const e=new n.Scalar(r);return f&&(f.node=e),e}p=r instanceof Map?u[t.MAP]:Symbol.iterator in Object(r)?u[t.SEQ]:u[t.MAP];}c&&(c(p),delete i.onTagObj);const h=p?.createNode?p.createNode(i.schema,r,i):"function"==typeof p?.nodeClass?.from?p.nodeClass.from(i.schema,r,i):new n.Scalar(r);return s?h.tag=s:p.default||(h.tag=p.tag),f&&(f.node=h),h},ot}function lt(){if(st)return it;st=1;var e=ut(),t=Ne(),n=et();function r(t,n,r){let s=r;for(let e=n.length-1;e>=0;--e){const t=n[e];if("number"==typeof t&&Number.isInteger(t)&&t>=0){const e=[];e[t]=s,s=e;}else s=new Map([[t,s]]);}return e.createNode(s,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const s=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;let i=class extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true});}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(n=>t.isNode(n)||t.isPair(n)?n.clone(e):n),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(s(e))this.add(n);else {const[s,...i]=e,o=this.get(s,true);if(t.isCollection(o))o.addIn(i,n);else {if(void 0!==o||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n));}}}deleteIn(e){const[n,...r]=e;if(0===r.length)return this.delete(n);const s=this.get(n,true);if(t.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,true);return 0===s.length?!n&&t.isScalar(i)?i.value:i:t.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!t.isPair(n))return false;const r=n.value;return null==r||e&&t.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(0===r.length)return this.has(n);const s=this.get(n,true);return !!t.isCollection(s)&&s.hasIn(r)}setIn(e,n){const[s,...i]=e;if(0===i.length)this.set(s,n);else {const e=this.get(s,true);if(t.isCollection(e))e.setIn(i,n);else {if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n));}}}};return it.Collection=i,it.collectionFromPath=r,it.isEmptyPath=s,it}var ft,pt={},ht={},dt={},gt={};function mt(){if(ft)return gt;ft=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return gt.indentComment=e,gt.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,gt.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),gt}var yt,vt,_t,bt,wt={},St={};function At(){if(yt)return St;yt=1;const e="block",t="quoted";function n(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else {do{i=e[++t];}while(i&&"\n"!==i);r=t,s=t+1,i=e[s];}return r}return St.FOLD_BLOCK=e,St.FOLD_FLOW="flow",St.FOLD_QUOTED=t,St.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,g,m=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):m=a-o);let y=false,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(m=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(_=v,r[v+1]){case "x":v+=3;break;case "u":v+=5;break;case "U":v+=9;break;default:v+=1;}b=v;}if("\n"===o)i===e&&(v=n(r,v,s.length)),m=v+s.length+f,d=void 0;else {if(" "===o&&g&&" "!==g&&"\n"!==g&&"\t"!==g){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v);}if(v>=m)if(d)p.push(d),m=d+f,d=void 0;else if(i===t){for(;" "===g||"\t"===g;)g=o,o=r[v+=1],y=true;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=true,m=e+f,d=void 0;}else y=true;}g=o;}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`);}return w},St}function kt(){if(vt)return wt;vt=1;var e=ct(),t=At();const n=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),r=e=>/^(%|---|\.\.\.)/m.test(e);function s(e,s){const i=JSON.stringify(e);if(s.options.doubleQuotedAsJSON)return i;const{implicitKey:o}=s,a=s.options.doubleQuotedMinMultiLineLength,c=s.indent||(r(e)?" ":"");let u="",l=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(u+=i.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(i[e+1]){case "u":{u+=i.slice(l,e);const t=i.substr(e+2,4);switch(t){case "0000":u+="\\0";break;case "0007":u+="\\a";break;case "000b":u+="\\v";break;case "001b":u+="\\e";break;case "0085":u+="\\N";break;case "00a0":u+="\\_";break;case "2028":u+="\\L";break;case "2029":u+="\\P";break;default:"00"===t.substr(0,2)?u+="\\x"+t.substr(2):u+=i.substr(e,6);}e+=5,l=e+1;}break;case "n":if(o||'"'===i[e+2]||i.length<a)e+=1;else {for(u+=i.slice(l,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)u+="\n",e+=2;u+=c," "===i[e+2]&&(u+="\\"),e+=1,l=e+1;}break;default:e+=1;}return u=l?u+i.slice(l):i,o?u:t.foldFlowLines(u,c,t.FOLD_QUOTED,n(s,false))}function i(e,i){if(false===i.options.singleQuote||i.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return s(e,i);const o=i.indent||(r(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${o}`)+"'";return i.implicitKey?a:t.foldFlowLines(a,o,t.FOLD_FLOW,n(i,false))}function o(e,t){const{singleQuote:n}=t.options;let r;if(false===n)r=s;else {const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s;}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g");}catch{a=/\n+(?!\n|$)/g;}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const g=u.indent||(u.forceBlockIndent||r(c)?" ":""),m="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return false;const r=t-n,s=e.length;if(s<=r)return false;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return true;if(n=t+1,s-n<=r)return false}return true}(c,d,g.length));if(!c)return m?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let _=c.substring(v);const b=_.indexOf("\n");-1===b?y="-":c===_||b!==_.length-1?(y="+",f&&f()):y="",_&&(c=c.slice(0,-_.length),"\n"===_[_.length-1]&&(_=_.slice(0,-1)),_=_.replace(a,`$&${g}`));let w,S=false,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=true;else {if("\n"!==e)break;A=w;}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${g}`));let E=(S?g?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!m){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let s=false;const o=n(u,true);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=true;});const a=t.foldFlowLines(`${k}${r}${_}`,g,t.FOLD_BLOCK,o);if(!s)return `>${E}\n${g}${a}`}return `|${E}\n${g}${k}${c=c.replace(/\n+/g,`$&${g}`)}${_}`}return wt.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:g}=a;g!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(g=e.Scalar.QUOTE_DOUBLE);const m=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:g,inFlow:m}=i;if(h&&f.includes("\n")||m&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||m||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!m&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=true,c(s,i,a,u);if(h&&d===g)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,false))}(d,u,l,f);default:return null}};let y=m(g);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=m(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},wt}function Et(){if(_t)return dt;_t=1;var e=Ue(),t=Ne(),n=mt(),r=kt();return dt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:true,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case "block":s=false;break;case "flow":s=true;break;default:s=null;}return {anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:s,options:r}},dt.stringify=function(n,s,i,o){if(t.isPair(n))return n.toString(s,i,o);if(t.isAlias(n)){if(s.doc.directives)return n.toString(s);if(s.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(n):s.resolvedAliases=new Set([n]),n=n.resolve(s.doc);}let a;const c=t.isNode(n)?n:s.doc.createNode(n,{onTagObj:e=>a=e});a??(a=function(e,n){if(n.tag){const t=e.filter(e=>e.tag===n.tag);if(t.length>0)return t.find(e=>e.format===n.format)??t[0]}let r,s;if(t.isScalar(n)){s=n.value;let t=e.filter(e=>e.identify?.(s));if(t.length>1){const e=t.filter(e=>e.test);e.length>0&&(t=e);}r=t.find(e=>e.format===n.format)??t.find(e=>!e.format);}else s=n,r=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!r)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return r}(s.doc.schema.tags,c));const u=function(n,r,{anchors:s,doc:i}){if(!i.directives)return "";const o=[],a=(t.isScalar(n)||t.isCollection(n))&&n.anchor;a&&e.anchorIsValid(a)&&(s.add(a),o.push(`&${a}`));const c=n.tag??(r.default?null:r.tag);return c&&o.push(i.directives.tagString(c)),o.join(" ")}(c,a,s);u.length>0&&(s.indentAtStart=(s.indentAtStart??0)+u.length+1);const l="function"==typeof a.stringify?a.stringify(c,s,i,o):t.isScalar(c)?r.stringifyString(c,s,i,o):c.toString(s,i,o);return u?t.isScalar(c)||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${s.indent}${l}`:l},dt}function xt(){if(bt)return ht;bt=1;var e=Ne(),t=ct(),n=Et(),r=mt();return ht.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:g}}=o;let m=e.isNode(s)&&s.comment||null;if(g){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!g&&(!s||m&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:false,implicitKey:!y&&(g||!u),indent:f+p});let v,_,b,w=false,S=false,A=n.stringify(s,o,()=>w=true,()=>S=true);if(!y&&!o.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=true;}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!g||null==i&&y)return A=`? ${A}`,m&&!w?A+=r.lineComment(A,o.indent,h(m)):S&&c&&c(),A;w&&(m=null),y?(m&&(A+=r.lineComment(A,o.indent,h(m))),A=`? ${A}\n${f}:`):(A=`${A}:`,m&&(A+=r.lineComment(A,o.indent,h(m)))),e.isNode(i)?(v=!!i.spaceBefore,_=i.commentBefore,b=i.comment):(v=false,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=false,y||m||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=false,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=false;const E=n.stringify(i,o,()=>k=true,()=>S=true);let x=" ";if(m||v||_){if(x=v?"\n":"",_){const e=h(_);x+=`\n${r.indentComment(e,o.indent)}`;}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n");}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=false;if(n&&("&"===e||"!"===e)){let n=E.indexOf(" ");"&"===e&&-1!==n&&n<t&&"!"===E[n+1]&&(n=E.indexOf(" ",n+1)),(-1===n||t<n)&&(r=true);}r||(x=`\n${o.indent}`);}}else ""!==E&&"\n"!==E[0]||(x="");return A+=x+E,o.inFlow?k&&a&&a():b&&!k?A+=r.lineComment(A,o.indent,h(b)):S&&c&&c(),A},ht}var $t,Ot={},Rt={};function Ct(){if($t)return Rt;$t=1;var e=S;return Rt.debug=function(e,...t){"debug"===e&&console.log(...t);},Rt.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Rt}var Tt,Pt,Lt,Nt={};function It(){if(Tt)return Nt;Tt=1;var e=Ne(),t=ct();const n="<<",r={identify:e=>e===n||"symbol"==typeof e&&e.description===n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t.Scalar(Symbol(n)),{addToJSMap:s}),stringify:()=>n};function s(t,n,r){if(r=t&&e.isAlias(r)?r.resolve(t.doc):r,e.isSeq(r))for(const e of r.items)i(t,n,e);else if(Array.isArray(r))for(const e of r)i(t,n,e);else i(t,n,r);}function i(t,n,r){const s=t&&e.isAlias(r)?r.resolve(t.doc):r;if(!e.isMap(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[e,t]of i)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:true,enumerable:true,configurable:true});return n}return Nt.addMergeToJSMap=s,Nt.isMergeKey=(n,s)=>(r.identify(s)||e.isScalar(s)&&(!s.type||s.type===t.Scalar.PLAIN)&&r.identify(s.value))&&n?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default),Nt.merge=r,Nt}function Mt(){if(Pt)return Ot;Pt=1;var e=Ct(),t=It(),n=Et(),r=Ne(),s=Xe();return Ot.addPairToJSMap=function(i,o,{key:a,value:c}){if(r.isNode(a)&&a.addToJSMap)a.addToJSMap(i,o,c);else if(t.isMergeKey(i,a))t.addMergeToJSMap(i,o,c);else {const t=s.toJS(a,"",i);if(o instanceof Map)o.set(t,s.toJS(c,t,i));else if(o instanceof Set)o.add(t);else {const u=function(t,s,i){if(null===s)return "";if("object"!=typeof s)return String(s);if(r.isNode(t)&&i?.doc){const r=n.createStringifyContext(i.doc,{});r.anchors=new Set;for(const e of i.anchors.keys())r.anchors.add(e.anchor);r.inFlow=true,r.inStringifyKey=true;const s=t.toString(r);if(!i.mapKeyWarned){let t=JSON.stringify(s);t.length>40&&(t=t.substring(0,36)+'..."'),e.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=true;}return s}return JSON.stringify(s)}(a,t,i),l=s.toJS(c,u,i);u in o?Object.defineProperty(o,u,{value:l,writable:true,enumerable:true,configurable:true}):o[u]=l;}}return o},Ot}function Dt(){if(Lt)return pt;Lt=1;var e=ut(),t=xt(),n=Mt(),r=Ne();let s=class e{constructor(e,t=null){Object.defineProperty(this,r.NODE_TYPE,{value:r.PAIR}),this.key=e,this.value=t;}clone(t){let{key:n,value:s}=this;return r.isNode(n)&&(n=n.clone(t)),r.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return n.addPairToJSMap(t,r,this)}toString(e,n,r){return e?.doc?t.stringifyPair(this,e,n,r):JSON.stringify(this)}};return pt.Pair=s,pt.createPair=function(t,n,r){const i=e.createNode(t,void 0,r),o=e.createNode(n,void 0,r);return new s(i,o)},pt}var jt,Ht,Ft,Bt={},zt={},Kt={},Ut={};function qt(){if(jt)return Ut;jt=1;var e=Ne(),t=Et(),n=mt();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let g=false;const m=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!g&&c.spaceBefore&&m.push(""),i(o,m,c.commentBefore,g),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!g&&t.spaceBefore&&m.push(""),i(o,m,t.commentBefore,g));}g=false;let f=t.stringify(c,d,()=>l=null,()=>g=true);l&&(f+=n.lineComment(f,u,h(l))),g&&l&&(g=false),m.push(a+f);}let y;if(0===m.length)y=c.start+c.end;else {y=m[0];for(let e=1;e<m.length;++e){const t=m[e];y+=t?`\n${p}${t}`:"\n";}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):g&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:true,type:null});let h=false,d=0;const g=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&g.push(""),i(s,g,c.commentBefore,false),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&g.push(""),i(s,g,t.commentBefore,false),t.comment&&(h=true));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=true)):null==c.value&&t?.comment&&(u=t.comment);}u&&(h=true);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(g.length>d||l.includes("\n"))&&(h=true),g.push(l),d=g.length;}const{start:m,end:y}=o;if(0===g.length)return m+y;if(!h){const e=g.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth;}if(h){let e=m;for(const t of g)e+=t?`\n${u}${c}${t}`:"\n";return `${e}\n${c}${y}`}return `${m}${l}${g.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart());}}return Ut.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ut}function Zt(){if(Ht)return Kt;Ht=1;var e=qt(),t=Mt(),n=lt(),r=Ne(),s=Dt(),i=ct();function o(e,t){const n=r.isScalar(t)?t.value:t;for(const s of e)if(r.isPair(s)){if(s.key===t||s.key===n)return s;if(r.isScalar(s.key)&&s.key.value===n)return s}}let a=class extends n.Collection{static get tagName(){return "tag:yaml.org,2002:map"}constructor(e){super(r.MAP,e),this.items=[];}static from(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new this(e),a=(e,a)=>{if("function"==typeof i)a=i.call(t,e,a);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==a||r)&&o.items.push(s.createPair(e,a,n));};if(t instanceof Map)for(const[e,n]of t)a(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))a(e,t[e]);return "function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=r.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new s.Pair(e.key,e.value):new s.Pair(e,e?.value);const a=o(this.items,n.key),c=this.schema?.sortMapEntries;if(a){if(!t)throw new Error(`Key ${n.key} already set`);r.isScalar(a.value)&&i.isScalarValue(n.value)?a.value.value=n.value:a.value=n.value;}else if(c){const e=this.items.findIndex(e=>c(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n);}else this.items.push(n);}delete(e){const t=o(this.items,e);if(!t)return false;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=o(this.items,e),s=n?.value;return (!t&&r.isScalar(s)?s.value:s)??void 0}has(e){return !!o(this.items,e)}set(e,t){this.add(new s.Pair(e,t),true);}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const e of this.items)t.addPairToJSMap(n,s,e);return s}toString(t,n,s){if(!t)return JSON.stringify(this);for(const e of this.items)if(!r.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return !t.allNullValues&&this.hasAllNullValues(false)&&(t=Object.assign({},t,{allNullValues:true})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Kt.YAMLMap=a,Kt.findPair=o,Kt}function Wt(){if(Ft)return zt;Ft=1;var e=Ne(),t=Zt();const n={collection:"map",default:true,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(t,n)=>(e.isMap(t)||n("Expected a mapping for this tag"),t),createNode:(e,n,r)=>t.YAMLMap.from(e,n,r)};return zt.map=n,zt}var Gt,Vt,Yt={},Qt={};function Jt(){if(Gt)return Qt;Gt=1;var e=ut(),t=qt(),n=lt(),r=Ne(),s=ct(),i=Xe();let o=class extends n.Collection{static get tagName(){return "tag:yaml.org,2002:seq"}constructor(e){super(r.SEQ,e),this.items=[];}add(e){this.items.push(e);}delete(e){const t=a(e);if("number"!=typeof t)return false;return this.items.splice(t,1).length>0}get(e,t){const n=a(e);if("number"!=typeof n)return;const s=this.items[n];return !t&&r.isScalar(s)?s.value:s}has(e){const t=a(e);return "number"==typeof t&&t<this.items.length}set(e,t){const n=a(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];r.isScalar(i)&&s.isScalarValue(t)?i.value=t:this.items[n]=t;}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(i.toJS(e,String(r++),t));return n}toString(e,n,r){return e?t.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let t=0;for(let o of n){if("function"==typeof s){const e=n instanceof Set?o:String(t++);o=s.call(n,e,o);}i.items.push(e.createNode(o,void 0,r));}}return i}};function a(e){let t=r.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}return Qt.YAMLSeq=o,Qt}function Xt(){if(Vt)return Yt;Vt=1;var e=Ne(),t=Jt();const n={collection:"seq",default:true,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(t,n)=>(e.isSeq(t)||n("Expected a sequence for this tag"),t),createNode:(e,n,r)=>t.YAMLSeq.from(e,n,r)};return Yt.seq=n,Yt}var en,tn={};function nn(){if(en)return tn;en=1;var e=kt();const t={identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:true},n),e.stringifyString(t,n,r,s))};return tn.string=t,tn}var rn,sn={},on$1={};function an(){if(rn)return on$1;rn=1;var e=ct();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e.Scalar(null),stringify:({source:e},n)=>"string"==typeof e&&t.test.test(e)?e:n.options.nullStr};return on$1.nullTag=t,on$1}var cn,un={};function ln(){if(cn)return un;cn=1;var e=ct();const t={identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new e.Scalar("t"===t[0]||"T"===t[0]),stringify({source:e,value:n},r){if(e&&t.test.test(e)){if(n===("t"===e[0]||"T"===e[0]))return e}return n?r.options.trueStr:r.options.falseStr}};return un.boolTag=t,un}var fn,pn,hn={},dn={};function gn(){if(fn)return dn;return fn=1,dn.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0";}return i},dn}function mn(){if(pn)return hn;pn=1;var e=ct(),t=gn();const n={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new e.Scalar(parseFloat(t)),r=t.indexOf(".");return -1!==r&&"0"===t[t.length-1]&&(n.minFractionDigits=t.length-r-1),n},stringify:t.stringifyNumber};return hn.float=s,hn.floatExp=r,hn.floatNaN=n,hn}var yn,vn={};function _n(){if(yn)return vn;yn=1;var e=gn();const t=e=>"bigint"==typeof e||Number.isInteger(e),n=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function r(n,r,s){const{value:i}=n;return t(i)&&i>=0?s+i.toString(r):e.stringifyNumber(n)}const s={identify:e=>t(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>n(e,2,8,r),stringify:e=>r(e,8,"0o")},i={identify:t,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},o={identify:e=>t(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return vn.int=i,vn.intHex=o,vn.intOct=s,vn}var bn,wn={};function Sn(){if(bn)return wn;bn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=ln(),i=mn(),o=_n();const a=[e.map,n.seq,r.string,t.nullTag,s.boolTag,o.intOct,o.int,o.intHex,i.floatNaN,i.floatExp,i.float];return wn.schema=a,wn}var An,kn={};function En(){if(An)return kn;An=1;var e=ct(),t=Wt(),n=Xt();function r(e){return "bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>r(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:s}],o={default:true,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return kn.schema=a,kn}var xn,$n={};function On(){if(xn)return $n;xn=1;var e=require$$0,t=ct(),n=kt();const r={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(t,n){if("function"==typeof e.Buffer)return e.Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t);return n}return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:r,type:s,value:i},o,a,c){if(!i)return "";const u=i;let l;if("function"==typeof e.Buffer)l=u instanceof e.Buffer?u.toString("base64"):e.Buffer.from(u.buffer).toString("base64");else {if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<u.length;++t)e+=String.fromCharCode(u[t]);l=btoa(e);}}if(s??(s=t.Scalar.BLOCK_LITERAL),s!==t.Scalar.QUOTE_DOUBLE){const e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),n=Math.ceil(l.length/e),r=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)r[t]=l.substr(s,e);l=r.join(s===t.Scalar.BLOCK_LITERAL?"\n":" ");}return n.stringifyString({comment:r,type:s,value:l},o,a,c)}};return $n.binary=r,$n}var Rn,Cn,Tn={},Pn={};function Ln(){if(Rn)return Pn;Rn=1;var e=Ne(),t=Dt(),n=ct(),r=Jt();function s(r,s){if(e.isSeq(r))for(let i=0;i<r.items.length;++i){let o=r.items[i];if(!e.isPair(o)){if(e.isMap(o)){o.items.length>1&&s("Each pair must have its own sequence indicator");const e=o.items[0]||new t.Pair(new n.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment;}o=e;}r.items[i]=e.isPair(o)?o:new t.Pair(o);}}else s("Expected a sequence for this tag");return r}function i(e,n,s){const{replacer:i}=s,o=new r.YAMLSeq(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let e of n){let r,c;if("function"==typeof i&&(e=i.call(n,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);r=e[0],c=e[1];}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);r=t[0],c=e[r];}else r=e;o.items.push(t.createPair(r,c,s));}return o}const o={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return Pn.createPairs=i,Pn.pairs=o,Pn.resolvePairs=s,Pn}function Nn(){if(Cn)return Tn;Cn=1;var e=Ne(),t=Xe(),n=Zt(),r=Jt(),s=Ln();class i extends r.YAMLSeq{constructor(){super(),this.add=n.YAMLMap.prototype.add.bind(this),this.delete=n.YAMLMap.prototype.delete.bind(this),this.get=n.YAMLMap.prototype.get.bind(this),this.has=n.YAMLMap.prototype.has.bind(this),this.set=n.YAMLMap.prototype.set.bind(this),this.tag=i.tag;}toJSON(n,r){if(!r)return super.toJSON(n);const s=new Map;r?.onCreate&&r.onCreate(s);for(const n of this.items){let i,o;if(e.isPair(n)?(i=t.toJS(n.key,"",r),o=t.toJS(n.value,i,r)):i=t.toJS(n,"",r),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o);}return s}static from(e,t,n){const r=s.createPairs(e,t,n),i=new this;return i.items=r.items,i}}i.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:i,default:false,tag:"tag:yaml.org,2002:omap",resolve(t,n){const r=s.resolvePairs(t,n),o=[];for(const{key:t}of r.items)e.isScalar(t)&&(o.includes(t.value)?n(`Ordered maps must not include duplicate keys: ${t.value}`):o.push(t.value));return Object.assign(new i,r)},createNode:(e,t,n)=>i.from(e,t,n)};return Tn.YAMLOMap=i,Tn.omap=o,Tn}var In,Mn={},Dn={};function jn(){if(In)return Dn;In=1;var e=ct();function t({value:e,source:t},s){return t&&(e?n:r).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const n={identify:e=>true===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(true),stringify:t},r={identify:e=>false===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(false),stringify:t};return Dn.falseTag=r,Dn.trueTag=n,Dn}var Hn,Fn={};function Bn(){if(Hn)return Fn;Hn=1;var e=ct(),t=gn();const n={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new e.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(-1!==r){const e=t.substring(r+1).replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length);}return n},stringify:t.stringifyNumber};return Fn.float=s,Fn.floatExp=r,Fn.floatNaN=n,Fn}var zn,Kn={};function Un(){if(zn)return Kn;zn=1;var e=gn();const t=e=>"bigint"==typeof e||Number.isInteger(e);function n(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;}const t=BigInt(e);return "-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return "-"===s?-1*i:i}function r(n,r,s){const{value:i}=n;if(t(i)){const e=i.toString(r);return i<0?"-"+s+e.substr(1):s+e}return e.stringifyNumber(n)}const s={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>n(e,2,2,r),stringify:e=>r(e,2,"0b")},i={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>n(e,1,8,r),stringify:e=>r(e,8,"0")},o={identify:t,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},a={identify:t,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return Kn.int=o,Kn.intBin=s,Kn.intHex=a,Kn.intOct=i,Kn}var qn,Zn={};function Wn(){if(qn)return Zn;qn=1;var e=Ne(),t=Dt(),n=Zt();class r extends n.YAMLMap{constructor(e){super(e),this.tag=r.tag;}add(r){let s;s=e.isPair(r)?r:r&&"object"==typeof r&&"key"in r&&"value"in r&&null===r.value?new t.Pair(r.key,null):new t.Pair(r,null);n.findPair(this.items,s.key)||this.items.push(s);}get(t,r){const s=n.findPair(this.items,t);return !r&&e.isPair(s)?e.isScalar(s.key)?s.key.value:s.key:s}set(e,r){if("boolean"!=typeof r)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof r);const s=n.findPair(this.items,e);s&&!r?this.items.splice(this.items.indexOf(s),1):!s&&r&&this.items.push(new t.Pair(e));}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),t,n);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let e of n)"function"==typeof s&&(e=s.call(n,e,e)),i.items.push(t.createPair(e,null,r));return i}}r.tag="tag:yaml.org,2002:set";const s={collection:"map",identify:e=>e instanceof Set,nodeClass:r,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>r.from(e,t,n),resolve(t,n){if(e.isMap(t)){if(t.hasAllNullValues(true))return Object.assign(new r,t);n("Set items must all have null values");}else n("Expected a mapping for this tag");return t}};return Zn.YAMLSet=r,Zn.set=s,Zn}var Gn,Vn,Yn,Qn,Jn={};function Xn(){if(Gn)return Jn;Gn=1;var e=gn();function t(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return "-"===n?s(-1)*i:i}function n(t){let{value:n}=t,r=e=>e;if("bigint"==typeof n)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return e.stringifyNumber(t);let s="";n<0&&(s="-",n*=r(-1));const i=r(60),o=[n%i];return n<60?o.unshift(0):(n=(n-o[0])/i,o.unshift(n%i),n>=60&&(n=(n-o[0])/i,o.unshift(n))),s+o.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const r={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:r})=>t(e,r),stringify:n},s={identify:e=>"number"==typeof e,default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,false),stringify:n},i={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(i.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,s,o,a,c,u]=n.map(Number),l=n[7]?Number((n[7]+"00").substr(1,3)):0;let f=Date.UTC(r,s-1,o,a||0,c||0,u||0,l);const p=n[8];if(p&&"Z"!==p){let e=t(p,false);Math.abs(e)<30&&(e*=60),f-=6e4*e;}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Jn.floatTime=s,Jn.intTime=r,Jn.timestamp=i,Jn}function er(){if(Vn)return Mn;Vn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=On(),i=jn(),o=Bn(),a=Un(),c=It(),u=Nn(),l=Ln(),f=Wn(),p=Xn();const h=[e.map,n.seq,r.string,t.nullTag,i.trueTag,i.falseTag,a.intBin,a.intOct,a.int,a.intHex,o.floatNaN,o.floatExp,o.float,s.binary,c.merge,u.omap,l.pairs,f.set,p.intTime,p.floatTime,p.timestamp];return Mn.schema=h,Mn}function tr(){if(Yn)return sn;Yn=1;var e=Wt(),t=an(),n=Xt(),r=nn(),s=ln(),i=mn(),o=_n(),a=Sn(),c=En(),u=On(),l=It(),f=Nn(),p=Ln(),h=er(),d=Wn(),g=Xn();const m=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:g.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:g.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:g.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":g.timestamp};return sn.coreKnownTags=v,sn.getTags=function(e,t,n){const r=m.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(m.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[];}if(Array.isArray(e))for(const t of e)s=s.concat(t);else "function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},sn}function nr(){if(Qn)return Bt;Qn=1;var e=Ne(),t=Wt(),n=Xt(),r=nn(),s=tr();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Bt.Schema=class o{constructor({compat:o,customTags:a,merge:c,resolveKnownTags:u,schema:l,sortMapEntries:f,toStringDefaults:p}){this.compat=Array.isArray(o)?s.getTags(o,"compat"):o?s.getTags(null,o):null,this.name="string"==typeof l&&l||"core",this.knownTags=u?s.coreKnownTags:{},this.tags=s.getTags(a,this.name,c),this.toStringOptions=p??null,Object.defineProperty(this,e.MAP,{value:t.map}),Object.defineProperty(this,e.SCALAR,{value:r.string}),Object.defineProperty(this,e.SEQ,{value:n.seq}),this.sortMapEntries="function"==typeof f?f:true===f?i:null;}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Bt}var rr,sr,ir={};function or(){if(rr)return ir;rr=1;var e=Ne(),t=Et(),n=mt();return ir.stringifyDocument=function(r,s){const i=[];let o=true===s.directives;if(false!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=true):r.directives.docStart&&(o=true);}o&&i.push("---");const a=t.createStringifyContext(r,s),{commentString:c}=a.options;if(r.commentBefore){1!==i.length&&i.unshift("");const e=c(r.commentBefore);i.unshift(n.indentComment(e,""));}let u=false,l=null;if(r.contents){if(e.isNode(r.contents)){if(r.contents.spaceBefore&&o&&i.push(""),r.contents.commentBefore){const e=c(r.contents.commentBefore);i.push(n.indentComment(e,""));}a.forceBlockIndent=!!r.comment,l=r.contents.comment;}const s=l?void 0:()=>u=true;let f=t.stringify(r.contents,a,()=>l=null,s);l&&(f+=n.lineComment(f,"",c(l))),"|"!==f[0]&&">"!==f[0]||"---"!==i[i.length-1]?i.push(f):i[i.length-1]=`--- ${f}`;}else i.push(t.stringify(r.contents,a));if(r.directives?.docEnd)if(r.comment){const e=c(r.comment);e.includes("\n")?(i.push("..."),i.push(n.indentComment(e,""))):i.push(`... ${e}`);}else i.push("...");else {let e=r.comment;e&&u&&(e=e.replace(/^\n+/,"")),e&&(u&&!l||""===i[i.length-1]||i.push(""),i.push(n.indentComment(c(e),"")));}return i.join("\n")+"\n"},ir}function ar(){if(sr)return Be;sr=1;var e=tt(),t=lt(),n=Ne(),r=Dt(),s=Xe(),i=nr(),o=or(),a=Ue(),c=Ge(),u=ut(),l=He();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return Be.Document=class p{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r);}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e);}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t);}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n;}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t;}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:g}=a.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:i??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:g},y=u.createNode(e,p,m);return c&&n.isCollection(y)&&(y.flow=true),d(),y}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new r.Pair(s,i)}delete(e){return !!f(this.contents)&&this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,true):!!f(this.contents)&&this.contents.deleteIn(e)}get(e,t){return n.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,r){return t.isEmptyPath(e)?!r&&n.isScalar(this.contents)?this.contents.value:this.contents:n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return !!n.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:!!n.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,n){null==this.contents?this.contents=t.collectionFromPath(this.schema,[e],n):f(this.contents)&&this.contents.set(e,n);}setIn(e,n){t.isEmptyPath(e)?this.contents=n:null==this.contents?this.contents=t.collectionFromPath(this.schema,Array.from(e),n):f(this.contents)&&this.contents.setIn(e,n);}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case "1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new l.Directives({version:"1.1"}),n={resolveKnownTags:false,schema:"yaml-1.1"};break;case "1.2":case "next":this.directives?this.directives.yaml.version=e:this.directives=new l.Directives({version:e}),n={resolveKnownTags:true,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else {if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new i.Schema(Object.assign(n,t));}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:true===n,mapKeyWarned:false,maxAliasCount:"number"==typeof r?r:100},u=s.toJS(this.contents,t??"",a);if("function"==typeof i)for(const{count:e,res:t}of a.anchors.values())i(t,e);return "function"==typeof o?c.applyReviver(o,{"":u},"",u):u}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return o.stringifyDocument(this,e)}},Be}var cr,ur={};function lr(){if(cr)return ur;cr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ur.YAMLError=e,ur.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ur.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ur.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1;}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o;}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`;}},ur}var fr,pr={},hr={},dr={},gr={},mr={};function yr(){if(fr)return mr;return fr=1,mr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=false,u=a,l=a,f="",p="",h=false,d=false,g=null,m=null,y=null,v=null,_=null,b=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=false),g&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),s.type){case "space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(g=s),l=true;break;case "comment":{l||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=s.source.substring(1)||" ";f?f+=p+e:f=e,p="",u=false;break}case "newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=true):p+=s.source,u=true,h=true,(m||y)&&(v=s),l=true;break;case "anchor":m&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true),m=s,w??(w=s.offset),u=false,l=false,d=true;break;case "tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=false,l=false,d=true;break;case n:(m||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),b&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),b=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=false;break;case "comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=false,l=false;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=false,l=false;}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:A,start:w??A}},mr}var vr,_r={};function br(){if(vr)return _r;return vr=1,_r.containsNewline=function e(t){if(!t)return null;switch(t.type){case "alias":case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":if(t.source.includes("\n"))return true;if(t.end)for(const e of t.end)if("newline"===e.type)return true;return false;case "flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return true;if(n.sep)for(const e of n.sep)if("newline"===e.type)return true;if(e(n.key)||e(n.value))return true}return false;default:return true}},_r}var wr,Sr={};function Ar(){if(wr)return Sr;wr=1;var e=br();return Sr.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const s=n.end[0];if(s.indent===t&&("]"===s.source||"}"===s.source)&&e.containsNewline(n)){r(s,"BAD_INDENT","Flow end indicator should be more indented than parent",true);}}},Sr}var kr,Er,xr={};function $r(){if(kr)return xr;kr=1;var e=Ne();return xr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(false===s)return false;const i="function"==typeof s?s:(t,n)=>t===n||e.isScalar(t)&&e.isScalar(n)&&t.value===n.value;return n.some(e=>i(e.key,r))},xr}function Or(){if(Er)return gr;Er=1;var e=Dt(),t=Zt(),n=yr(),r=br(),s=Ar(),i=$r();const o="All mapping items must start at the same column";return gr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=false);let d=l.offset,g=null;for(const t of l.items){const{start:p,key:m,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:m??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:true}),b=!_.found;if(b){if(m&&("block-seq"===m.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){g=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(m))&&f(m??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line");}else _.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=true;const w=_.end,S=m?a(u,m,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,m,f),u.atKey=false,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!m||"block-scalar"===m.type});if(d=A.end,A.found){b&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&_.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r);}else {b&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n);}}return g&&g<d&&f(g,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,g??d],h},gr}var Rr,Cr={};function Tr(){if(Rr)return Cr;Rr=1;var e=Jt(),t=yr(),n=Ar();return Cr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=false),i.atKey&&(i.atKey=false);let l=o.offset,f=null;for(const{start:e,value:c}of o.items){const p=t.resolveProps(e,{indicator:"seq-item-ind",next:c,offset:l,onError:a,parentIndent:o.indent,startOnNewline:true});if(!p.found){if(!(p.anchor||p.tag||c)){f=p.end,p.comment&&(u.comment=p.comment);continue}c&&"block-seq"===c.type?a(p.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator");}const h=c?r(i,c,p,a):s(i,p.end,e,null,p,a);i.schema.compat&&n.flowIndentCheck(o.indent,c,a),l=h.range[2],u.items.push(h);}return u.range=[o.offset,l,f??l],u},Cr}var Pr,Lr,Nr,Ir={},Mr={};function Dr(){if(Pr)return Mr;return Pr=1,Mr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=false,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case "space":i=true;break;case "comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";s?s+=o+t:s=t,o="";break}case "newline":s&&(o+=e),i=true;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`);}t+=e.length;}}return {comment:s,offset:t}},Mr}function jr(){if(Lr)return Ir;Lr=1;var e=Ne(),t=Dt(),n=Zt(),r=Jt(),s=Dr(),i=yr(),o=br(),a=$r();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Ir.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,g){const m="{"===h.start.source,y=m?"flow map":"flow sequence",v=new(g?.nodeClass??(m?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=true;const _=p.atRoot;_&&(p.atRoot=false),p.atKey&&(p.atKey=false);let b=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:g,key:_,sep:w,value:S}=s,A=i.resolveProps(g,{flow:y,indicator:"explicit-key-ind",next:_??w?.[0],offset:b,onError:d,parentIndent:h.indent,startOnNewline:false});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),b=A.end;continue}!m&&p.options.strict&&o.containsNewline(_)&&d(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of g)switch(e.type){case "comma":case "space":break;case "comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1);}}if(m||w||A.found){p.atKey=true;const e=A.end,r=_?l(p,_,A,d):f(p,e,g,null,A,d);u(_)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=false;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:false});if(o.found){if(!m&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),m){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E);}else {const e=new n.YAMLMap(p.schema);e.flow=true,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e);}b=k?k.range[2]:o.end;}else {const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),b=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c);}}const w=m?"}":"]",[S,...A]=h.end;let k=b;if(S&&S.source===w)k=S.offset+S.source.length;else {const e=y[0].toUpperCase()+y.substring(1);d(b,_?"MISSING_CHAR":"BAD_INDENT",_?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S);}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset];}else v.range=[h.offset,k,k];return v},Ir}function Hr(){if(Nr)return dr;Nr=1;var e=Ne(),t=ct(),n=Zt(),r=Jt(),s=Or(),i=Tr(),o=jr();function a(e,t,n,r,a,c){const u="block-map"===n.type?s.resolveBlockMap(e,t,n,r,c):"block-seq"===n.type?i.resolveBlockSeq(e,t,n,r,c):o.resolveFlowCollection(e,t,n,r,c),l=u.constructor;return "!"===a||a===l.tagName?(u.tag=l.tagName,u):(a&&(u.tag=a),u)}return dr.composeCollection=function(s,i,o,c,u){const l=c.tag,f=l?i.directives.tagName(l.source,e=>u(l,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===o.type){const{anchor:e,newlineAfterProp:t}=c,n=e&&l?e.offset>l.offset?e:l:e??l;if(n&&(!t||t.offset<n.offset)){u(n,"MISSING_CHAR","Missing newline after block sequence props");}}const p="block-map"===o.type?"map":"block-seq"===o.type?"seq":"{"===o.start.source?"map":"seq";if(!l||!f||"!"===f||f===n.YAMLMap.tagName&&"map"===p||f===r.YAMLSeq.tagName&&"seq"===p)return a(s,i,o,u,f);let h=i.schema.tags.find(e=>e.tag===f&&e.collection===p);if(!h){const e=i.schema.knownTags[f];if(!e||e.collection!==p)return e?u(l,"BAD_COLLECTION_TYPE",`${e.tag} used for ${p} collection, but expects ${e.collection??"scalar"}`,true):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,true),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:false})),h=e;}const d=a(s,i,o,u,f,h),g=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,m=e.isNode(g)?g:new t.Scalar(g);return m.range=d.range,m.tag=f,h?.format&&(m.format=h.format),m},dr}var Fr,Br={},zr={};function Kr(){if(Fr)return zr;Fr=1;var e=ct();return zr.resolveBlockScalar=function(t,n,r){const s=n.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let t=1;t<s.length;++t){const n=s[t];if(a||"-"!==n&&"+"!==n){const r=Number(n);!o&&r?o=r:-1===c&&(c=e+t);}else a=n;} -1!==c&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=false,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case "space":u=true;case "newline":f+=s.source.length;break;case "comment":if(n&&!u){r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");}f+=s.source.length,l=s.source.substring(1);break;case "error":r(s,"UNEXPECTED_TOKEN",s.message),f+=s.source.length;break;default:{r(s,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${s.type}`);const e=s.source;e&&"string"==typeof e&&(f+=e.length);}}}return {mode:i,indent:o,chomp:a,comment:l,length:f}}(n,t.options.strict,r);if(!i)return {value:"",type:null,comment:"",range:[s,s,s]};const o=">"===i.mode?e.Scalar.BLOCK_FOLDED:e.Scalar.BLOCK_LITERAL,a=n.source?function(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(n.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e;}if(0===c){const e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let t=s+i.length;return n.source&&(t+=n.source.length),{value:e,type:o,comment:i.comment,range:[s,t,t]}}let u=n.indent+i.indent,l=n.offset+i.length,f=0;for(let e=0;e<c;++e){const[n,s]=a[e];if(""!==s&&"\r"!==s){if(n.length<u){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(l+n.length,"MISSING_CHAR",e);}if(0===i.indent&&(u=n.length),f=e,0===u&&!t.atRoot){r(l,"BAD_INDENT","Block scalar values in collections must be indented");}break}0===i.indent&&n.length>u&&(u=n.length),l+=n.length+s.length+1;}for(let e=a.length-1;e>=c;--e)a[e][0].length>u&&(c=e+1);let p="",h="",d=false;for(let e=0;e<f;++e)p+=a[e][0].slice(u)+"\n";for(let t=f;t<c;++t){let[n,s]=a[t];l+=n.length+s.length+1;const c="\r"===s[s.length-1];if(c&&(s=s.slice(0,-1)),s&&n.length<u){const e=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-s.length-(c?2:1),"BAD_INDENT",e),n="";}o===e.Scalar.BLOCK_LITERAL?(p+=h+n.slice(u)+s,h="\n"):n.length>u||"\t"===s[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),p+=h+n.slice(u)+s,h="\n",d=true):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=false);}switch(i.chomp){case "-":break;case "+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n";}const g=s+i.length+n.source.length;return {value:p,type:o,comment:i.comment,range:[s,g,g]}},zr}var Ur,qr,Zr={};function Wr(){if(Ur)return Zr;Ur=1;var e=ct(),t=Dr();function n(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy");}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy;}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)""===r[1]?"\n"===i?s+=i:i="\n":(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+(r?.[1]??"")}function r(e,t){let n="",r=e[t+1];for(;!(" "!==r&&"\t"!==r&&"\n"!==r&&"\r"!==r||"\r"===r&&"\n"!==e[t+2]);)"\n"===r&&(n+="\n"),r=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const s={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function i(e,t,n,r){const s=e.substr(t,n),i=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(i)){const s=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}return String.fromCodePoint(i)}return Zr.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const g=(e,t,n)=>c(u+e,t,n);switch(l){case "scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case "\t":r="a tab character";break;case ",":r="flow indicator character ,";break;case "%":r="directive indicator character %";break;case "|":case ">":r=`block scalar indicator ${e[0]}`;break;case "@":case "`":r=`reserved character ${e[0]}`;}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,g);break;case "single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,g);break;case "double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s;}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s;}else {const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r;}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a);}else n+=a;}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,g);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const m=u+f.length,y=t.resolveEnd(p,m,a,c);return {value:d,type:h,comment:y.comment,range:[u,m,y.offset]}},Zr}function Gr(){if(qr)return Br;qr=1;var e=Ne(),t=ct(),n=Kr(),r=Wr();return Br.composeScalar=function(s,i,o,a){const{value:c,type:u,comment:l,range:f}="block-scalar"===i.type?n.resolveBlockScalar(s,i,a):r.resolveFlowScalar(i,s.options.strict,a),p=o?s.directives.tagName(o.source,e=>a(o,"TAG_RESOLVE_FAILED",e)):null;let h,d;h=s.options.stringKeys&&s.atKey?s.schema[e.SCALAR]:p?function(t,n,r,s,i){if("!"===r)return t[e.SCALAR];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===r){if(!e.default||!e.test)return e;o.push(e);}for(const e of o)if(e.test?.test(n))return e;const a=t.knownTags[r];if(a&&!a.collection)return t.tags.push(Object.assign({},a,{default:false,test:void 0})),a;return i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),t[e.SCALAR]}(s.schema,c,p,o,a):"scalar"===i.type?function({atKey:t,directives:n,schema:r},s,i,o){const a=r.tags.find(e=>(true===e.default||t&&"key"===e.default)&&e.test?.test(s))||r[e.SCALAR];if(r.compat){const t=r.compat.find(e=>e.default&&e.test?.test(s))??r[e.SCALAR];if(a.tag!==t.tag){o(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n.tagString(a.tag)} or ${n.tagString(t.tag)}`,true);}}return a}(s,c,i,a):s.schema[e.SCALAR];try{const n=h.resolve(c,e=>a(o??i,"TAG_RESOLVE_FAILED",e),s.options);d=e.isScalar(n)?n:new t.Scalar(n);}catch(e){const n=e instanceof Error?e.message:String(e);a(o??i,"TAG_RESOLVE_FAILED",n),d=new t.Scalar(c);}return d.range=f,d.source=c,u&&(d.type=u),p&&(d.tag=p),h.format&&(d.format=h.format),l&&(d.comment=l),d},Br}var Vr,Yr,Qr,Jr,Xr={};function es(){if(Vr)return Xr;return Vr=1,Xr.emptyScalarPosition=function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case "space":case "comment":case "newline":e-=n.source.length;continue}for(n=t[++r];"space"===n?.type;)e+=n.source.length,n=t[++r];break}}return e},Xr}function ts(){if(Yr)return hr;Yr=1;var e=tt(),t=Ne(),n=Hr(),r=Gr(),s=Dr(),i=es();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:g}=u;let m,y=true;switch(a.type){case "alias":m=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||g)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "block-scalar":m=r.composeScalar(i,a,g,l),d&&(m.anchor=d.source.substring(1));break;case "block-map":case "block-seq":case "flow-collection":m=n.composeCollection(o,i,a,u,l),d&&(m.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),m=c(i,a.offset,void 0,null,u,l),y=false;}if(d&&""===m.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(m)||"string"!=typeof m.value||m.tag&&"tag:yaml.org,2002:str"!==m.tag)){l(g??a,"NON_STRING_KEY","With stringKeys, all keys must be strings");}return p&&(m.spaceBefore=true),h&&("scalar"===a.type&&""===a.source?m.comment=h:m.commentBefore=h),i.options.keepSourceTokens&&y&&(m.srcToken=a),m}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=true),a&&(h.comment=a,h.range[2]=l),h}return hr.composeEmptyNode=c,hr.composeNode=a,hr}function ns(){if(Qr)return pr;Qr=1;var e=ar(),t=ts(),n=Dr(),r=yr();return pr.composeDoc=function(s,i,{offset:o,start:a,value:c,end:u},l){const f=Object.assign({_directives:i},s),p=new e.Document(void 0,f),h={atKey:false,atRoot:true,directives:p.directives,options:p.options,schema:p.schema},d=r.resolveProps(a,{indicator:"doc-start",next:c??u?.[0],offset:o,onError:l,parentIndent:0,startOnNewline:true});d.found&&(p.directives.docStart=true,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const g=p.contents.range[2],m=n.resolveEnd(u,g,false,l);return m.comment&&(p.comment=m.comment),p.range=[o,g,m.offset],p},pr}function rs(){if(Jr)return Te;Jr=1;var e=S,t=He(),n=ar(),r=lr(),s=Ne(),i=ns(),o=Dr();function a(e){if("number"==typeof e)return [e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return [t,t+("string"==typeof n?n.length:1)]}function c(e){let t="",n=false,r=false;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case "#":t+=(""===t?"":r?"\n\n":"\n")+(i.substring(1)||" "),n=true,r=false;break;case "%":"#"!==e[s+1]?.[0]&&(s+=1),n=false;break;default:n||(r=true),n=false;}}return {comment:t,afterEmptyLine:r}}return Te.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=false,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=a(e);s?this.warnings.push(new r.YAMLWarning(i,t,n)):this.errors.push(new r.YAMLParseError(i,t,n));},this.directives=new t.Directives({version:e.version||"1.2"}),this.options=e;}decorate(e,t){const{comment:n,afterEmptyLine:r}=c(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(s.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];s.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n;}else {const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n;}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[];}streamInfo(){return {comment:c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=false,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n);}*next(t){switch(e.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case "directive":this.directives.add(t.source,(e,n,r)=>{const s=a(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r);}),this.prelude.push(t.source),this.atDirectives=true;break;case "document":{const e=i.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,false),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=false;break}case "byte-order-mark":case "space":break;case "comment":case "newline":this.prelude.push(t.source);break;case "error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case "doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=true;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,true),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment;}this.doc.range[2]=e.offset;break}default:this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`));}}*end(e=false,t=-1){if(this.doc)this.decorate(this.doc,true),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,false),yield r;}}},Te}var ss,is={},os={};function as(){if(ss)return os;ss=1;var e=Kr(),t=Wr(),n=lr(),r=kt();function s(e,t){if(t)for(const n of t)switch(n.type){case "space":case "comment":e.push(n);break;case "newline":return e.push(n),true}return false}function i(e,t,n){switch(e.type){case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":e.type=n,e.source=t;break;case "block-scalar":{const r=e.props.slice(1);let s=t.length;"block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length);for(const e of r)e.offset+=s;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case "block-map":case "block-seq":{const r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{const r="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:s});}}}return os.createScalarToken=function(e,t){const{implicitKey:n=false,indent:i,inFlow:o=false,offset:a=-1,type:c="PLAIN"}=t,u=r.stringifyString({type:c,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:o,options:{blockQuote:true,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:"\n"}];switch(u[0]){case "|":case ">":{const e=u.indexOf("\n"),t=u.substring(0,e),n=u.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:a,indent:i,source:t}];return s(r,l)||r.push({type:"newline",offset:-1,indent:i,source:"\n"}),{type:"block-scalar",offset:a,indent:i,props:r,source:n}}case '"':return {type:"double-quoted-scalar",offset:a,indent:i,source:u,end:l};case "'":return {type:"single-quoted-scalar",offset:a,indent:i,source:u,end:l};default:return {type:"scalar",offset:a,indent:i,source:u,end:l}}},os.resolveAsScalar=function(r,s=true,i){if(r){const o=(e,t,r)=>{const s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!i)throw new n.YAMLParseError([s,s+1],t,r);i(s,t,r);};switch(r.type){case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return t.resolveFlowScalar(r,s,o);case "block-scalar":return e.resolveBlockScalar({options:{strict:s}},r,o)}}return null},os.setScalarValue=function(e,t,n={}){let{afterKey:o=false,implicitKey:a=false,inFlow:c=false,type:u}=n,l="indent"in e?e.indent:null;if(o&&"number"==typeof l&&(l+=2),!u)switch(e.type){case "single-quoted-scalar":u="QUOTE_SINGLE";break;case "double-quoted-scalar":u="QUOTE_DOUBLE";break;case "block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");u=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN";}const f=r.stringifyString({type:u,value:t},{implicitKey:a||null===l,indent:null!==l&&l>0?" ".repeat(l):"",inFlow:c,options:{blockQuote:true,lineWidth:-1}});switch(f[0]){case "|":case ">":!function(e,t){const n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=r,e.source=i;}else {const{offset:t}=e,n="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:n,source:r}];s(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:o,source:i});}}(e,f);break;case '"':i(e,f,"double-quoted-scalar");break;case "'":i(e,f,"single-quoted-scalar");break;default:i(e,f,"scalar");}},os}var cs,us={};function ls(){if(cs)return us;cs=1;function e(n){switch(n.type){case "block-scalar":{let t="";for(const r of n.props)t+=e(r);return t+n.source}case "block-map":case "block-seq":{let e="";for(const r of n.items)e+=t(r);return e}case "flow-collection":{let e=n.start.source;for(const r of n.items)e+=t(r);for(const t of n.end)e+=t.source;return e}case "document":{let e=t(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function t({start:t,key:n,sep:r,value:s}){let i="";for(const e of t)i+=e.source;if(n&&(i+=e(n)),r)for(const e of r)i+=e.source;return s&&(i+=e(s)),i}return us.stringify=n=>"type"in n?e(n):t(n),us}var fs,ps,hs={};function ds(){if(fs)return hs;fs=1;const e=Symbol("break visit"),t=Symbol("skip children"),n=Symbol("remove item");function r(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),s(Object.freeze([]),e,t);}function s(t,r,i){let o=i(r,t);if("symbol"==typeof o)return o;for(const a of ["key","value"]){const c=r[a];if(c&&"items"in c){for(let r=0;r<c.items.length;++r){const o=s(Object.freeze(t.concat([[a,r]])),c.items[r],i);if("number"==typeof o)r=o-1;else {if(o===e)return e;o===n&&(c.items.splice(r,1),r-=1);}}"function"==typeof o&&"key"===a&&(o=o(r,t));}}return "function"==typeof o?o(r,t):o}return r.BREAK=e,r.SKIP=t,r.REMOVE=n,r.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r];}return n},r.parentCollection=(e,t)=>{const n=r.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},hs.visit=r,hs}function gs(){if(ps)return is;ps=1;var e=as(),t=ls(),n=ds();return is.createScalarToken=e.createScalarToken,is.resolveAsScalar=e.resolveAsScalar,is.setScalarValue=e.setScalarValue,is.stringify=t.stringify,is.visit=n.visit,is.BOM="\ufeff",is.DOCUMENT="",is.FLOW_END="",is.SCALAR="",is.isCollection=e=>!!e&&"items"in e,is.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),is.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},is.tokenType=function(e){switch(e){case "\ufeff":return "byte-order-mark";case "":return "doc-mode";case "":return "flow-error-end";case "":return "scalar";case "---":return "doc-start";case "...":return "doc-end";case "":case "\n":case "\r\n":return "newline";case "-":return "seq-item-ind";case "?":return "explicit-key-ind";case ":":return "map-value-ind";case "{":return "flow-map-start";case "}":return "flow-map-end";case "[":return "flow-seq-start";case "]":return "flow-seq-end";case ",":return "comma"}switch(e[0]){case " ":case "\t":return "space";case "#":return "comment";case "%":return "directive-line";case "*":return "alias";case "&":return "anchor";case "!":return "tag";case "'":return "single-quoted-scalar";case '"':return "double-quoted-scalar";case "|":case ">":return "block-scalar-header"}return null},is}var ms,ys={};function vs(){if(ms)return ys;ms=1;var e=gs();function t(e){switch(e){case void 0:case " ":case "\n":case "\r":case "\t":return true;default:return false}}const n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s=new Set(",[]{}"),i=new Set(" ,[]{}\n\r\t"),o=e=>!e||i.has(e);return ys.Lexer=class{constructor(){this.atEnd=false,this.blockScalarIndent=-1,this.blockScalarKeep=false,this.buffer="",this.flowKey=false,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0;}*lex(e,t=false){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null;}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n);}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return !t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){const n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return "\n"===n||t>=this.indentNext||!n&&!this.atEnd?e+t:-1}if("-"===n||"."===n){const n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return ("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case "stream":return yield*this.parseStream();case "line-start":return yield*this.parseLineStart();case "block-start":return yield*this.parseBlockStart();case "doc":return yield*this.parseDocument();case "flow":return yield*this.parseFlowCollection();case "quoted-scalar":return yield*this.parseQuotedScalar();case "block-scalar":return yield*this.parseBlockScalar();case "plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){const r=t[n-1];if(" "===r||"\t"===r){e=n-1;break}n=t.indexOf("#",n+1);}for(;;){const n=t[e-1];if(" "!==n&&"\t"!==n)break;e-=1;}const r=(yield*this.pushCount(e))+(yield*this.pushSpaces(true));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(true);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(false),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return "doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case "#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel=1,"flow";case "}":case "]":return yield*this.pushCount(1),"doc";case "*":return yield*this.pushUntil(o),"doc";case '"':case "'":return yield*this.parseQuotedScalar();case "|":case ">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(true)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,s=-1;do{n=yield*this.pushNewline(),n>0?(r=yield*this.pushSpaces(false),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(true));}while(n+r>0);const i=this.getLine();if(null===i)return this.setNext("flow");if(-1!==s&&s<this.indentNext&&"#"!==i[0]||0===s&&(i.startsWith("---")||i.startsWith("..."))&&t(i[3])){if(!(s===this.indentNext-1&&1===this.flowLevel&&("]"===i[0]||"}"===i[0])))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart()}let a=0;for(;","===i[a];)a+=(yield*this.pushCount(1)),a+=(yield*this.pushSpaces(true)),this.flowKey=false;switch(a+=(yield*this.pushIndicators()),i[a]){case void 0:return "flow";case "#":return yield*this.pushCount(i.length-a),"flow";case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel+=1,"flow";case "}":case "]":return yield*this.pushCount(1),this.flowKey=true,this.flowLevel-=1,this.flowLevel?"flow":"doc";case "*":return yield*this.pushUntil(o),"flow";case '"':case "'":return this.flowKey=true,yield*this.parseQuotedScalar();case ":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=false,yield*this.pushCount(1),yield*this.pushSpaces(true),"flow"}default:return this.flowKey=false,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1);}const n=this.buffer.substring(0,t);let r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){const e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e);} -1!==r&&(t=r-("\r"===n[r-1]?2:1));}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length;}return yield*this.pushToIndex(t+1,false),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=false;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=true;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case " ":r+=1;break;case "\n":n=e,r=0;break;case "\r":{const t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){ -1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e);}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length;}}let s=n+1;for(t=this.buffer[s];" "===t;)t=this.buffer[++s];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++s];n=s-1;}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);const s=e;for(;" "===t;)t=this.buffer[--e];if(!("\n"===t&&e>=this.pos&&e+1+r>s))break;n=e;}return yield e.SCALAR,yield*this.pushToIndex(n+1,true),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let r,i=this.pos-1,o=this.pos-1;for(;r=this.buffer[++o];)if(":"===r){const e=this.buffer[o+1];if(t(e)||n&&s.has(e))break;i=o;}else if(t(r)){let e=this.buffer[o+1];if("\r"===r&&("\n"===e?(o+=1,r="\n",e=this.buffer[o+1]):i=o),"#"===e||n&&s.has(e))break;if("\n"===r){const e=this.continueScalar(o+1);if(-1===e)break;o=Math.max(o,e-2);}}else {if(n&&s.has(r))break;i=o;}return r||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(i+1,true),n?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield ""),0)}*pushIndicators(){switch(this.charAt(0)){case "!":return (yield*this.pushTag())+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "&":return (yield*this.pushUntil(o))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "-":case "?":case ":":{const e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&s.has(n))return e?this.flowKey&&(this.flowKey=false):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,false)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else {if("%"!==t||!n.has(this.buffer[e+1])||!n.has(this.buffer[e+2]))break;t=this.buffer[e+=3];}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];return "\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n];}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,false)}},ys}var _s,bs={};function ws(){if(_s)return bs;_s=1;return bs.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r;}if(this.lineStarts[t]===e)return {line:t+1,col:1};if(0===t)return {line:0,col:e};return {line:t,col:e-this.lineStarts[t-1]+1}};}},bs}var Ss,As={};function ks(){if(Ss)return As;Ss=1;var e=S,t=gs(),n=vs();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return true;return false}function s(e){for(let t=0;t<e.length;++t)switch(e[t].type){case "space":case "comment":case "newline":break;default:return t}return -1}function i(e){switch(e?.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "flow-collection":return true;default:return false}}function o(e){switch(e.type){case "document":return e.start;case "block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case "block-seq":return e.items[e.items.length-1].start;default:return []}}function a(e){if(0===e.length)return [];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case "doc-start":case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":case "newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function c(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||r(t.start,"explicit-key-ind")||r(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep);}return As.Parser=class{constructor(e){this.atNewLine=true,this.atScalar=false,this.indent=0,this.offset=0,this.onKeyLine=false,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e;}*parse(e,t=false){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end());}*next(n){if(this.source=n,e.env.LOG_TOKENS&&console.log("|",t.prettyToken(n)),this.atScalar)return this.atScalar=false,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=false,this.atScalar=true,this.type="scalar";else {switch(this.type=r,yield*this.step(),r){case "newline":this.atNewLine=true,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case "space":this.atNewLine&&" "===n[0]&&(this.indent+=n.length);break;case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case "doc-mode":case "flow-error-end":return;default:this.atNewLine=false;}this.offset+=n.length;}else {const e=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:n}),this.offset+=n.length;}}*end(){for(;this.stack.length>0;)yield*this.pop();}get sourceToken(){return {type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case "document":return yield*this.document(e);case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return yield*this.scalar(e);case "block-scalar":return yield*this.blockScalar(e);case "block-map":return yield*this.blockMap(e);case "block-seq":return yield*this.blockSequence(e);case "flow-collection":return yield*this.flowCollection(e);case "doc-end":return yield*this.documentEnd(e)}yield*this.pop();}else {for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else {const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&c(t),e.type){case "document":e.value=t;break;case "block-scalar":e.props.push(t);break;case "block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=true);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case "block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case "flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t);}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===s(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1));}}else {const e="Tried to pop an empty stack";yield {type:"error",offset:this.offset,source:"",message:e};}}*stream(){switch(this.type){case "directive-line":return void(yield {type:"directive",offset:this.offset,source:this.source});case "byte-order-mark":case "space":case "comment":case "newline":return void(yield this.sourceToken);case "doc-mode":case "doc-start":{const e={type:"document",offset:this.offset,start:[]};return "doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source};}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case "doc-start":return void(-1!==s(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case "anchor":case "tag":case "space":case "comment":case "newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source};}*scalar(e){if("map-value-ind"===this.type){const t=a(o(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=true,this.stack[this.stack.length-1]=r;}else yield*this.lineEnd(e);}*blockScalar(e){switch(this.type){case "space":case "comment":case "newline":return void e.props.push(this.sourceToken);case "scalar":if(e.source=this.source,this.atNewLine=true,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1;}yield*this.pop();break;default:yield*this.pop(),yield*this.step();}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case "newline":if(this.onKeyLine=false,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case "space":case "comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else {if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken);}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let o=[];if(s&&t.sep&&!t.value){const n=[];for(let r=0;r<t.sep.length;++r){const s=t.sep[r];switch(s.type){case "newline":n.push(r);break;case "space":break;case "comment":s.indent>e.indent&&(n.length=0);break;default:n.length=0;}}n.length>=2&&(o=t.sep.splice(n[1]));}switch(this.type){case "anchor":case "tag":return void(s||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=true):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case "explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:true})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]}):(t.start.push(this.sourceToken),t.explicitKey=true),void(this.onKeyLine=true);case "map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(i(t.key)&&!r(t.sep,"newline")){const e=a(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]});}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else {const e=a(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]});}else t.sep?t.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=true);case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:o,key:n,sep:[]}),this.onKeyLine=true):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=true))}default:{const s=this.startBlockValue(e);if(s){if("block-seq"===s.type){if(!t.explicitKey&&t.sep&&!r(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:o});return void this.stack.push(s)}}}}yield*this.pop(),yield*this.step();}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case "newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else t.start.push(this.sourceToken);return;case "space":case "comment":if(t.value)e.items.push({start:[this.sourceToken]});else {if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken);}return;case "anchor":case "tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case "seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||r(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step();}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1);}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case "comma":case "explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case "map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case "space":case "comment":case "newline":case "anchor":case "tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case "flow-map-end":case "flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step());}else {const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=a(o(t));c(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=true,this.stack[this.stack.length-1]=s;}else yield*this.lineEnd(e);}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1;}return {type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return this.flowScalar(this.type);case "block-scalar-header":return {type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case "flow-map-start":case "flow-seq-start":return {type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case "seq-item-ind":return {type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case "explicit-key-ind":{this.onKeyLine=true;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:true}]}}case "map-value-ind":{this.onKeyLine=true;const t=a(o(e));return {type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return "comment"===this.type&&(!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()));}*lineEnd(e){switch(this.type){case "comma":case "doc-start":case "doc-end":case "flow-seq-end":case "flow-map-end":case "map-value-ind":yield*this.pop(),yield*this.step();break;case "newline":this.onKeyLine=false;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop());}}},As}var Es,xs,$s={};function Os(){if(Es)return $s;Es=1;var e=rs(),t=ar(),n=lr(),r=Ct(),s=Ne(),i=ws(),o=ks();function a(e){const t=false!==e.prettyErrors;return {lineCounter:e.lineCounter||t&&new i.LineCounter||null,prettyErrors:t}}function c(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r);let l=null;for(const e of u.compose(c.parse(t),true,t.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=e;return i&&s&&(l.errors.forEach(n.prettifyError(t,s)),l.warnings.forEach(n.prettifyError(t,s))),l}return $s.parse=function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=c(e,n);if(!i)return null;if(i.warnings.forEach(e=>r.warn(i.options.logLevel,e)),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[];}return i.toJS(Object.assign({reviver:s},n))},$s.parseAllDocuments=function(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r),l=Array.from(u.compose(c.parse(t)));if(i&&s)for(const e of l)e.errors.forEach(n.prettifyError(t,s)),e.warnings.forEach(n.prettifyError(t,s));return l.length>0?l:Object.assign([],{empty:true},u.streamInfo())},$s.parseDocument=c,$s.stringify=function(e,n,r){let i=null;if("function"==typeof n||Array.isArray(n)?i=n:void 0===r&&n&&(r=n),"string"==typeof r&&(r=r.length),"number"==typeof r){const e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e};}if(void 0===e){const{keepUndefined:e}=r??n??{};if(!e)return}return s.isDocument(e)&&!i?e.toString(r):new t.Document(e,i,r).toString(r)},$s}var Rs=function(){if(xs)return Ce;xs=1;var e=rs(),t=ar(),n=nr(),r=lr(),s=tt(),i=Ne(),o=Dt(),a=ct(),c=Zt(),u=Jt(),l=gs(),f=vs(),p=ws(),h=ks(),d=Os(),g=je();return Ce.Composer=e.Composer,Ce.Document=t.Document,Ce.Schema=n.Schema,Ce.YAMLError=r.YAMLError,Ce.YAMLParseError=r.YAMLParseError,Ce.YAMLWarning=r.YAMLWarning,Ce.Alias=s.Alias,Ce.isAlias=i.isAlias,Ce.isCollection=i.isCollection,Ce.isDocument=i.isDocument,Ce.isMap=i.isMap,Ce.isNode=i.isNode,Ce.isPair=i.isPair,Ce.isScalar=i.isScalar,Ce.isSeq=i.isSeq,Ce.Pair=o.Pair,Ce.Scalar=a.Scalar,Ce.YAMLMap=c.YAMLMap,Ce.YAMLSeq=u.YAMLSeq,Ce.CST=l,Ce.Lexer=f.Lexer,Ce.LineCounter=p.LineCounter,Ce.Parser=h.Parser,Ce.parse=d.parse,Ce.parseAllDocuments=d.parseAllDocuments,Ce.parseDocument=d.parseDocument,Ce.stringify=d.stringify,Ce.visit=g.visit,Ce.visitAsync=g.visitAsync,Ce}(),Cs=U(Rs);function Ts(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:false}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r;}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Ps extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Ls extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Ns={};function Is(e){return Ns}function Ms(e,t){return "bigint"==typeof t?t.toString():t}function Ds(e){return {get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function js(e){return null==e}function Hs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Fs=Symbol("evaluating");function Bs(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Fs)return void 0===r&&(r=Fs,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function zs(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Ks(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Us(e){return JSON.stringify(e)}const qs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ws=Ds(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Gs(e){if(false===Zs(e))return false;const t=e.constructor;if(void 0===t)return true;const n=t.prototype;return false!==Zs(n)&&false!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Vs(e){return Gs(e)?{...e}:Array.isArray(e)?[...e]:e}const Ys=new Set(["string","number","symbol"]);function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Js(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Xs(e){const t=e;if(!t)return {};if("string"==typeof t)return {error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function ei(e,t=0){if(true===e.aborted)return true;for(let n=t;n<e.issues.length;n++)if(true!==e.issues[n]?.continue)return true;return false}function ti(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function ni(e){return "string"==typeof e?e:e?.message}function ri(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=ni(e.inst?._zod.def?.error?.(e))??ni(t?.error?.(e))??ni(n.customError?.(e))??ni(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function si(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ii(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const oi=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:false}),Object.defineProperty(e,"issues",{value:t,enumerable:false}),e.message=JSON.stringify(t,Ms,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ai=Ts("$ZodError",oi),ci=Ts("$ZodError",oi,{Parent:Error});const ui=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:false}):{async:false},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Ps;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ri(e,i,Is())));throw qs(t,s?.callee),t}return o.value},li=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:true}):{async:true};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ri(e,i,Is())));throw qs(t,s?.callee),t}return o.value},fi=e=>(t,n,r)=>{const s=r?{...r,async:false}:{async:false},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ps;return i.issues.length?{success:false,error:new(e??ai)(i.issues.map(e=>ri(e,s,Is())))}:{success:true,data:i.value}},pi=fi(ci),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:true}):{async:true};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:false,error:new e(i.issues.map(e=>ri(e,s,Is())))}:{success:true,data:i.value}},di=hi(ci),gi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},mi=e=>(t,n,r)=>ui(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return li(e)(t,n,s)},vi=e=>async(t,n,r)=>li(e)(t,n,r),_i=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fi(e)(t,n,s)},bi=e=>(t,n,r)=>fi(e)(t,n,r),wi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hi(e)(t,n,s)},Si=e=>async(t,n,r)=>hi(e)(t,n,r),Ai=/^[cC][^\s-]{8,}$/,ki=/^[0-9a-z]+$/,Ei=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xi=/^[0-9a-vA-V]{20}$/,$i=/^[A-Za-z0-9]{27}$/,Oi=/^[a-zA-Z0-9_-]{21}$/,Ri=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ci=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ti=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Pi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Li=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ni=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ii=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Di=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ji=/^[A-Za-z0-9_-]*$/,Hi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Fi=/^\+(?:[0-9]){6,14}[0-9]$/,Bi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zi=new RegExp(`^${Bi}$`);function Ki(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return "number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Ui=/^[^A-Z]*$/,qi=/^[^a-z]*$/,Zi=Ts("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Wi=Ts("$ZodCheckMaxLength",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum);}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=si(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Gi=Ts("$ZodCheckMinLength",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum);}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=si(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Vi=Ts("$ZodCheckLengthEquals",(e,t)=>{var n;Zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !js(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length;}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=si(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Yi=Ts("$ZodCheckStringFormat",(e,t)=>{var n,r;Zi.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern));}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(r=e._zod).check??(r.check=()=>{});}),Qi=Ts("$ZodCheckRegex",(e,t)=>{Yi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),Ji=Ts("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ui),Yi.init(e,t);}),Xi=Ts("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qi),Yi.init(e,t);}),eo=Ts("$ZodCheckIncludes",(e,t)=>{Zi.init(e,t);const n=Qs(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r);}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort});};}),to=Ts("$ZodCheckStartsWith",(e,t)=>{Zi.init(e,t);const n=new RegExp(`^${Qs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n);}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),no=Ts("$ZodCheckEndsWith",(e,t)=>{Zi.init(e,t);const n=new RegExp(`.*${Qs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n);}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};}),ro=Ts("$ZodCheckOverwrite",(e,t)=>{Zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class so{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e);}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const io={major:4,minor:1,patch:11},oo=Ts("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=io;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {const t=(e,t,n)=>{let r,s=ei(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&false===n?.async)throw new Ps;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=ei(e,t)));});else {if(e.issues.length===t)continue;s||(s=ei(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(ei(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new Ps;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:true});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(false===i.async)throw new Ps;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=pi(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return di(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ao=Ts("$ZodString",(e,t)=>{var n;oo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value);}catch(r){}return "string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n};}),co=Ts("$ZodStringFormat",(e,t)=>{Yi.init(e,t),ao.init(e,t);}),uo=Ts("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ci),co.init(e,t);}),lo=Ts("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ti(e));}else t.pattern??(t.pattern=Ti());co.init(e,t);}),fo=Ts("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Pi),co.init(e,t);}),po=Ts("$ZodURL",(e,t)=>{co.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Hi.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});}};}),ho=Ts("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),co.init(e,t);}),go$1=Ts("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Oi),co.init(e,t);}),mo=Ts("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ai),co.init(e,t);}),yo=Ts("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ki),co.init(e,t);}),vo=Ts("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ei),co.init(e,t);}),_o=Ts("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xi),co.init(e,t);}),bo=Ts("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$i),co.init(e,t);}),wo=Ts("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Ki({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Bi}T(?:${r})$`)}(t)),co.init(e,t);}),So=Ts("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zi),co.init(e,t);}),Ao=Ts("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Ki(t)}$`)),co.init(e,t);}),ko=Ts("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ri),co.init(e,t);}),Eo=Ts("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Li),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),xo=Ts("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ni),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6";}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`);}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort});}};}),$o=Ts("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ii),co.init(e,t);}),Oo=Ts("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mi),co.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`);}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort});}};});function Ro(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const Co=Ts("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Di),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Ro(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const To=Ts("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ji),co.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!ji.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Ro(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort});};}),Po=Ts("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Fi),co.init(e,t);});const Lo=Ts("$ZodJWT",(e,t)=>{co.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return !1;const[r]=n;if(!r)return !1;const s=JSON.parse(atob(r));return !("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return false}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort});};}),No=Ts("$ZodUnknown",(e,t)=>{oo.init(e,t),e._zod.parse=e=>e;}),Io=Ts("$ZodNever",(e,t)=>{oo.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Mo(e,t,n){e.issues.length&&t.issues.push(...ti(n,e.issues)),t.value[n]=e.value;}const Do=Ts("$ZodArray",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Mo(t,n,e))):Mo(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function jo(e,t,n,r){e.issues.length&&t.issues.push(...ti(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Ho(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return {...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fo(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type;for(const s of Object.keys(t)){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>jo(e,n,s,t))):jo(i,n,s,t);}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Bo=Ts("$ZodObject",(e,t)=>{oo.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}});}const r=Ds(()=>Ho(t));Bs(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e);}}return n});const s=Zs,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>jo(n,t,e,a))):jo(r,t,e,a);}return i?Fo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),zo=Ts("$ZodObjectJIT",(e,t)=>{Bo.init(e,t);const n=e._zod.parse,r=Ds(()=>Ho(t));let s;const i=Zs,o=!Ns.jitless,a=o&&Ws.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&false===f?.async&&true!==f.jitless?(s||(s=(e=>{const t=new so(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Us(e);return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=Us(e);t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `);}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return (t,n)=>a(e,t,n)})(t.shape)),l=s(l,f),c?Fo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ko(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!ei(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ri(e,r,Is())))}),t)}const Uo=Ts("$ZodUnion",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Bs(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Bs(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Bs(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Hs(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=false;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=true;else {if(0===t.issues.length)return t;a.push(t);}}return o?Promise.all(a).then(t=>Ko(t,s,e,i)):Ko(a,s,e,i)};}),qo=Ts("$ZodIntersection",(e,t)=>{oo.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>Wo(e,t,n)):Wo(e,s,i)};});function Zo(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return {valid:true,data:e};if(Gs(e)&&Gs(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=Zo(e[n],t[n]);if(!r.valid)return {valid:false,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data;}return {valid:true,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=Zo(e[r],t[r]);if(!s.valid)return {valid:false,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data);}return {valid:true,data:n}}return {valid:false,mergeErrorPath:[]}}function Wo(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ei(e))return e;const r=Zo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Go=Ts("$ZodRecord",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Gs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...ti(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...ti(e,o.issues)),n.value[e]=o.value);}let a;for(const e in s)o.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a});}else {n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ri(e,r,Is())),input:o,path:[o],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...ti(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...ti(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),Vo=Ts("$ZodEnum",(e,t)=>{oo.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Ys.has(typeof e)).map(e=>"string"==typeof e?Qs(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t};}),Yo=Ts("$ZodTransform",(e,t)=>{oo.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ls(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return (s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n))}if(s instanceof Promise)throw new Ps;return n.value=s,n};});function Qo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Jo=Ts("$ZodOptional",(e,t)=>{oo.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Bs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Bs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Hs(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Qo(t,e.value)):Qo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Xo=Ts("$ZodNullable",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),Bs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Hs(e.source)}|null)$`):void 0}),Bs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n);}),ea=Ts("$ZodDefault",(e,t)=>{oo.init(e,t),e._zod.optin="optional",Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ta(e,t)):ta(r,t)};});function ta(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const na=Ts("$ZodPrefault",(e,t)=>{oo.init(e,t),e._zod.optin="optional",Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n));}),ra=Ts("$ZodNonOptional",(e,t)=>{oo.init(e,t),Bs(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>sa(t,e)):sa(s,e)};});function sa(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ia=Ts("$ZodCatch",(e,t)=>{oo.init(e,t),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),Bs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ri(e,n,Is()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ri(e,n,Is()))},input:e.value}),e.issues=[]),e)};}),oa=Ts("$ZodPipe",(e,t)=>{oo.init(e,t),Bs(e._zod,"values",()=>t.in._zod.values),Bs(e._zod,"optin",()=>t.in._zod.optin),Bs(e._zod,"optout",()=>t.out._zod.optout),Bs(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>aa(e,t.in,n)):aa(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aa(e,t.out,n)):aa(r,t.out,n)};});function aa(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const ca=Ts("$ZodReadonly",(e,t)=>{oo.init(e,t),Bs(e._zod,"propValues",()=>t.innerType._zod.propValues),Bs(e._zod,"values",()=>t.innerType._zod.values),Bs(e._zod,"optin",()=>t.innerType._zod.optin),Bs(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ua):ua(r)};});function ua(e){return e.value=Object.freeze(e.value),e}const la=Ts("$ZodCustom",(e,t)=>{Zi.init(e,t),oo.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>fa(t,n,r,e));fa(s,n,r,e);};});function fa(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ii(e));}}class pa{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e);}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ha(){return new pa}const da=ha();function ga(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Xs(t)})}function ma(e,t){return new Wi({check:"max_length",...Xs(t),maximum:e})}function ya(e,t){return new Gi({check:"min_length",...Xs(t),minimum:e})}function va(e,t){return new Vi({check:"length_equals",...Xs(t),length:e})}function _a(e){return new ro({check:"overwrite",tx:e})}function ba(e){const t=function(e,t){const n=new Zi({check:"custom",...Xs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ii(e,n.value,t._zod.def));else {const r=e;r.fatal&&(r.continue=false),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ii(r));}},e(n.value,n)));return t}const wa=Ts("ZodISODateTime",(e,t)=>{wo.init(e,t),Ga.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Xs(t)})}(wa,e)}const Aa=Ts("ZodISODate",(e,t)=>{So.init(e,t),Ga.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Xs(t)})}(Aa,e)}const Ea=Ts("ZodISOTime",(e,t)=>{Ao.init(e,t),Ga.init(e,t);});function xa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Xs(t)})}(Ea,e)}const $a=Ts("ZodISODuration",(e,t)=>{ko.init(e,t),Ga.init(e,t);});function Oa(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Xs(t)})}($a,e)}const Ra=(e,t)=>{ai.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},s=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else {let e=r,s=0;for(;s<t.path.length;){const r=t.path[s];s===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],s++;}}};return s(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return {formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ms,2);}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ms,2);}},isEmpty:{get:()=>0===e.issues.length}});},Ca=Ts("ZodError",Ra),Ta=Ts("ZodError",Ra,{Parent:Error}),Pa=ui(Ta),La=li(Ta),Na=fi(Ta),Ia=hi(Ta),Ma=gi(Ta),Da=mi(Ta),ja=yi(Ta),Ha=vi(Ta),Fa=_i(Ta),Ba=bi(Ta),za=wi(Ta),Ka=Si(Ta),Ua=Ts("ZodType",(e,t)=>(oo.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ks(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Js(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Pa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Na(e,t,n),e.parseAsync=async(t,n)=>La(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ia(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ma(e,t,n),e.decode=(t,n)=>Da(e,t,n),e.encodeAsync=async(t,n)=>ja(e,t,n),e.decodeAsync=async(t,n)=>Ha(e,t,n),e.safeEncode=(t,n)=>Fa(e,t,n),e.safeDecode=(t,n)=>Ba(e,t,n),e.safeEncodeAsync=async(t,n)=>za(e,t,n),e.safeDecodeAsync=async(t,n)=>Ka(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Xs(n)})}(jc,e,t)}(t,n)),e.superRefine=t=>e.check(ba(t)),e.overwrite=t=>e.check(_a(t)),e.optional=()=>Oc(e),e.nullable=()=>Cc(e),e.nullish=()=>Oc(Cc(e)),e.nonoptional=t=>function(e,t){return new Lc({type:"nonoptional",innerType:e,...Xs(t)})}(e,t),e.array=()=>_c(e),e.or=t=>Sc([e,t]),e.and=t=>new Ac({type:"intersection",left:e,right:t}),e.transform=t=>Mc(e,new xc({type:"transform",transform:t})),e.default=t=>{return n=t,new Tc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():Vs(n)}});var n;},e.prefault=t=>{return n=t,new Pc({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():Vs(n)}});var n;},e.catch=t=>{return new Nc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Mc(e,t),e.readonly=()=>new Dc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return da.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>da.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return da.get(e);const n=e.clone();return da.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),qa=Ts("_ZodString",(e,t)=>{ao.init(e,t),Ua.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"regex",...Xs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new eo({check:"string_format",format:"includes",...Xs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new to({check:"string_format",format:"starts_with",...Xs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new no({check:"string_format",format:"ends_with",...Xs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ya(...t)),e.max=(...t)=>e.check(ma(...t)),e.length=(...t)=>e.check(va(...t)),e.nonempty=(...t)=>e.check(ya(1,...t)),e.lowercase=t=>e.check(function(e){return new Ji({check:"string_format",format:"lowercase",...Xs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Xi({check:"string_format",format:"uppercase",...Xs(e)})}(t)),e.trim=()=>e.check(_a(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return _a(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(_a(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(_a(e=>e.toUpperCase()));}),Za=Ts("ZodString",(e,t)=>{ao.init(e,t),qa.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Xs(t)})}(Va,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Xs(t)})}(Ja,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Xs(t)})}(hc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Xs(t)})}(Xa,t)),e.guid=t=>e.check(ga(Ya,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Xs(t)})}(Qa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Xs(t)})}(Qa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Xs(t)})}(Qa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Xs(t)})}(Qa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Xs(t)})}(ec,t)),e.guid=t=>e.check(ga(Ya,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Xs(t)})}(tc,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Xs(t)})}(nc,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Xs(t)})}(rc,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Xs(t)})}(lc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Xs(t)})}(fc,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Xs(t)})}(sc,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Xs(t)})}(ic,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Xs(t)})}(oc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Xs(t)})}(ac,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Xs(t)})}(cc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Xs(t)})}(uc,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Xs(t)})}(pc,t)),e.datetime=t=>e.check(Sa(t)),e.date=t=>e.check(ka(t)),e.time=t=>e.check(xa(t)),e.duration=t=>e.check(Oa(t));});function Wa(e){return function(e,t){return new e({type:"string",...Xs(t)})}(Za,e)}const Ga=Ts("ZodStringFormat",(e,t)=>{co.init(e,t),qa.init(e,t);}),Va=Ts("ZodEmail",(e,t)=>{fo.init(e,t),Ga.init(e,t);}),Ya=Ts("ZodGUID",(e,t)=>{uo.init(e,t),Ga.init(e,t);}),Qa=Ts("ZodUUID",(e,t)=>{lo.init(e,t),Ga.init(e,t);}),Ja=Ts("ZodURL",(e,t)=>{po.init(e,t),Ga.init(e,t);}),Xa=Ts("ZodEmoji",(e,t)=>{ho.init(e,t),Ga.init(e,t);}),ec=Ts("ZodNanoID",(e,t)=>{go$1.init(e,t),Ga.init(e,t);}),tc=Ts("ZodCUID",(e,t)=>{mo.init(e,t),Ga.init(e,t);}),nc=Ts("ZodCUID2",(e,t)=>{yo.init(e,t),Ga.init(e,t);}),rc=Ts("ZodULID",(e,t)=>{vo.init(e,t),Ga.init(e,t);}),sc=Ts("ZodXID",(e,t)=>{_o.init(e,t),Ga.init(e,t);}),ic=Ts("ZodKSUID",(e,t)=>{bo.init(e,t),Ga.init(e,t);}),oc=Ts("ZodIPv4",(e,t)=>{Eo.init(e,t),Ga.init(e,t);}),ac=Ts("ZodIPv6",(e,t)=>{xo.init(e,t),Ga.init(e,t);}),cc=Ts("ZodCIDRv4",(e,t)=>{$o.init(e,t),Ga.init(e,t);}),uc=Ts("ZodCIDRv6",(e,t)=>{Oo.init(e,t),Ga.init(e,t);}),lc=Ts("ZodBase64",(e,t)=>{Co.init(e,t),Ga.init(e,t);}),fc=Ts("ZodBase64URL",(e,t)=>{To.init(e,t),Ga.init(e,t);}),pc=Ts("ZodE164",(e,t)=>{Po.init(e,t),Ga.init(e,t);}),hc=Ts("ZodJWT",(e,t)=>{Lo.init(e,t),Ga.init(e,t);}),dc=Ts("ZodUnknown",(e,t)=>{No.init(e,t),Ua.init(e,t);});function gc(){return new dc({type:"unknown"})}const mc=Ts("ZodNever",(e,t)=>{Io.init(e,t),Ua.init(e,t);});function yc(e){return function(e,t){return new e({type:"never",...Xs(t)})}(mc,e)}const vc=Ts("ZodArray",(e,t)=>{Do.init(e,t),Ua.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ya(t,n)),e.nonempty=t=>e.check(ya(1,t)),e.max=(t,n)=>e.check(ma(t,n)),e.length=(t,n)=>e.check(va(t,n)),e.unwrap=()=>e.element;});function _c(e,t){return function(e,t,n){return new e({type:"array",element:t,...Xs(n)})}(vc,e,t)}const bc=Ts("ZodObject",(e,t)=>{zo.init(e,t),Ua.init(e,t),Bs(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ec({type:"enum",entries:n,...Xs(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:gc()}),e.loose=()=>e.clone({...e._zod.def,catchall:gc()}),e.strict=()=>e.clone({...e._zod.def,catchall:yc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Gs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ks(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return zs(this,"shape",n),n},checks:[]});return Js(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Gs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return zs(this,"shape",n),n},checks:e._zod.def.checks};return Js(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ks(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return zs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Js(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Js(e,Ks(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r]);}return zs(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Ks(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e];}return zs(this,"shape",r),r},checks:[]});return Js(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ks(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t]);}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return zs(this,"shape",s),s},checks:[]});return Js(t,r)}($c,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ks(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}));}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return zs(this,"shape",s),s},checks:[]});return Js(t,r)}(Lc,e,t[0]);});const wc=Ts("ZodUnion",(e,t)=>{Uo.init(e,t),Ua.init(e,t),e.options=t.options;});function Sc(e,t){return new wc({type:"union",options:e,...Xs(t)})}const Ac=Ts("ZodIntersection",(e,t)=>{qo.init(e,t),Ua.init(e,t);});const kc=Ts("ZodRecord",(e,t)=>{Go.init(e,t),Ua.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const Ec=Ts("ZodEnum",(e,t)=>{Vo.init(e,t),Ua.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r];}return new Ec({...t,checks:[],...Xs(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t];}return new Ec({...t,checks:[],...Xs(r),entries:s})};});const xc=Ts("ZodTransform",(e,t)=>{Yo.init(e,t),Ua.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ls(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ii(r,n.value,t));else {const t=r;t.fatal&&(t.continue=false),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ii(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const $c=Ts("ZodOptional",(e,t)=>{Jo.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function Oc(e){return new $c({type:"optional",innerType:e})}const Rc=Ts("ZodNullable",(e,t)=>{Xo.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function Cc(e){return new Rc({type:"nullable",innerType:e})}const Tc=Ts("ZodDefault",(e,t)=>{ea.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const Pc=Ts("ZodPrefault",(e,t)=>{na.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Lc=Ts("ZodNonOptional",(e,t)=>{ra.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Ts("ZodCatch",(e,t)=>{ia.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Ic=Ts("ZodPipe",(e,t)=>{oa.init(e,t),Ua.init(e,t),e.in=t.in,e.out=t.out;});function Mc(e,t){return new Ic({type:"pipe",in:e,out:t})}const Dc=Ts("ZodReadonly",(e,t)=>{ca.init(e,t),Ua.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const jc=Ts("ZodCustom",(e,t)=>{la.init(e,t),Ua.init(e,t);});const Hc=e=>{if(!e||"object"!=typeof e)return;const t=e,n={};for(const e of Object.keys(t)){const r=t[e];if("string"==typeof r){const t=r.trim();t&&(n[e]=[t]);}else if(Array.isArray(r)){const t=r.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0);t.length&&(n[e]=t);}}return Object.keys(n).length?n:void 0},Fc=(e,t)=>{const n=t?JSON.parse(e):Cs.parse(e);return n&&"object"==typeof n?n:{}},Bc=_c(Wa()).default([]).optional(),zc=Sc([Wa(),_c(Wa())]),Kc=(Uc=Wa(),qc=zc,new kc({type:"record",keyType:Uc,valueType:qc,...Xs(Zc)})).optional();var Uc,qc,Zc;const Wc=function(e,t){const n={type:"object",shape:e??{},...Xs(t)};return new bc(n)}({stanPath:Wa().min(1,{message:"stanPath must be a non-empty string"}),includes:Bc,excludes:Bc,imports:Kc}).strict(),Gc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Wc.parse(e)}catch(e){throw new Error((e=>e instanceof Ca?e.issues.map(e=>{const t=e.path.join(".")||"(root)";let n=e.message;return "stanPath"===t&&/Expected string/i.test(n)&&(n="stanPath must be a non-empty string"),`${t}: ${n}`}).join("\n"):String(e))(e))}},Vc=e=>{const t=Oe(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Fc(r,t.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core")){throw new Error(`stan-core: missing "stan-core" section in ${t}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`)}const i=Gc(s["stan-core"]),o=Hc(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Yc=async e=>{const t=Oe(e);if(!t)throw new Error("stan config not found");const n=t.replace(/\\/g,"/");return (async(e,t)=>{const n=await readFile(e,"utf8"),r=Fc(n,e.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(r,"stan-core"))throw new Error(`stan-core: missing "stan-core" section in ${t??e}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`);const s=Gc(r["stan-core"]),o=Hc(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Qc=e=>{try{return Vc(e).stanPath}catch{return Se}},Xc=async(e,n,s=false)=>{const i=de(e,n);if(await _e(e,n),!s){const e=resolve(i.outputAbs,P);if(existsSync(e))try{await copyFile(e,resolve(i.diffAbs,L));}catch{}const n=await readdir(i.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(i.outputAbs,e.name),{recursive:true,force:true});}return i.rootAbs},eu=async(e,t)=>{const n={};for(const r of t){const t=resolve(e,r),s=await readFile(t),o=createHash("sha256").update(s).digest("hex");n[r]=o;}return n},tu=e=>join(e,".archive.snapshot.json"),nu=async({cwd:e,stanPath:t,includes:n,excludes:r,anchors:s})=>{const{diffDir:i}=await be(e,t),o=await ge(e),a=await ve(o,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[],anchors:s??[]}),c=await eu(e,a),l=tu(i);return await writeFile(l,JSON.stringify(c,null,2),"utf8"),l},ru=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:a="createIfMissing",includeOutputDirInDiff:c=false,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:h}=await be(e,n),g=await ge(e),m=await ve(g,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[],anchors:l??[]}),y=await eu(e,m),v=tu(h),_=existsSync(v),b=_?JSON.parse(await readFile(v,"utf8")):{},w=_?m.filter(e=>!b[e]||b[e]!==y[e]):[...m],{textFiles:S,warningsBody:A}=await z(e,w),k=S;F(A,f);const E=join(p,`${r}.diff.tar`),x=await import('./index-ucZa1KMb-CSQ-GldX.js');if(c)await x.create({file:E,cwd:e,filter:j(n)},H(k,n));else if(0===k.length){const t=(e=>join(e,".stan_no_changes"))(h);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await x.create({file:E,cwd:e},r);}else {const t=Array.from(new Set([...k]));await x.create({file:E,cwd:e},t);}return "replace"===a?await writeFile(v,JSON.stringify(y,null,2),"utf8"):"createIfMissing"!==a||_||await writeFile(v,JSON.stringify(y,null,2),"utf8"),{diffPath:E}},su=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),iu=e=>{if(!e||!String(e).trim())return null;const t=su(String(e).trim());if(/^[/\\]/.test(t))return null;const n=t.split("/").filter(Boolean);if(n.some(e=>".."===e))return null;const r=n.join("/");return r.length?r:null},ou=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e);}const o=i.join("\n").trimEnd();return o.length?o:null},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),yu=e=>e.endsWith("\n")?e:e+"\n",vu=/[\u200B-\u200D\uFEFF]/g,_u=e=>!!/^diff --git /m.test(e)||(!(!/^---\s+(?:a\/|\S)/m.test(e)||!/^\+\+\+\s+(?:b\/|\S)/m.test(e))||!!/^@@\s+-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@/m.test(e)),bu=e=>{const t=mu(e).replace(vu,"");return yu(t)},wu=e=>{const t=(e=>{const t=e.split(/\r?\n/);let n=0;for(;n<t.length&&""===t[n].trim();)n+=1;let r=t.length-1;for(;r>=0&&""===t[r].trim();)r-=1;if(n>r)return e;const s=t[n].trim(),i=t[r].trim(),o=e=>/^```/.test(e),a=e=>{const s=t.slice(n+1,r);return [...t.slice(0,n),...s,...t.slice(r+1)].join("\n")};return o(s)&&o(i)||/^BEGIN[_ -]?PATCH/i.test(s)&&(c=i,/^END[_ -]?PATCH/i.test(c))||(e=>/^\*{3,}\s*BEGIN\s+PATCH/i.test(e)||/^\*{3,}\s*Begin\s+Patch/i.test(e))(s)&&(e=>/^\*{3,}\s*END\s+PATCH/i.test(e)||/^\*{3,}\s*End\s+Patch/i.test(e))(i)?a():e;var c;})(bu(e.trim())),n=bu(t),r=(e=>{const t=e.split("\n");for(let e=0;e<t.length;e+=1){const n=t[e];if(!n.match(/^`{3,}.*$/))continue;const r=(n.match(/^`+/)??[""])[0].length;for(let n=e+1;n<t.length;n+=1)if(new RegExp(`^\\\`{${r}{'}'}\\s*$`).test(t[n])){const r=t.slice(e+1,n).join("\n");if(_u(r))return r;e=n;break}}let n=e.search(/^diff --git /m);return n<0&&(n=e.search(/^---\s+(?:a\/|\S)/m)),n<0?null:e.slice(n).replace(/\n`{3,}\s*$/m,"\n")})(n);return yu(r?bu(r).trimEnd():n)},Su=e=>{const t=[],n=[],r=ou(e),s=r?{body:r}:null;if(!s)return {ops:t,errors:n};const i=s.body.split(/\r?\n/);let o=0;for(const e of i){o+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),i=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${o.toString()}: ${e}`);},u=e=>{e||c(`expected 1 path, got ${a.length.toString()}`);},l=e=>{e||c(`expected 2 paths, got ${a.length.toString()}`);},f=e=>iu(e);switch(i){case "mv":if(l(2===a.length),2===a.length){const e=f(a[0]),n=f(a[1]);e&&n?t.push({verb:"mv",src:e,dest:n}):c("mv: invalid repo-relative path");}break;case "rm":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rm",src:e}):c("rm: invalid repo-relative path");}break;case "rmdir":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rmdir",src:e}):c("rmdir: invalid repo-relative path");}break;case "mkdirp":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"mkdirp",src:e}):c("mkdirp: invalid repo-relative path");}break;default:c(`unknown verb "${i}"`);}}return {ops:t,errors:n}},Au=async(e,t,n=false)=>{const r=[],i=t=>((e,t)=>{const n=path.resolve(e,t),r=path.resolve(e)+path.sep,s=n===path.resolve(e)||n.startsWith(r);return {abs:n,ok:s}})(e,t);for(const e of t){const t={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:r}=i(e.src),{abs:s,ok:o}=i(e.dest);if(!r||!o)throw new Error("path escapes repo root");const a=await pathExists(t),c=await pathExists(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await ensureDir(path.dirname(s)),await move(t,s,{overwrite:!1}));}else if("rm"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");if(!await pathExists(t))throw new Error("path does not exist");n||await remove(t);}else if("rmdir"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");let o=null;try{o=await stat(t);}catch{o=null;}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await readdir(t)).length>0)throw new Error("directory not empty");n||await remove(t);}else if("mkdirp"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await ensureDir(t);}t.status="ok";}catch(e){t.status="failed";const n=e instanceof Error?e.message:String(e);t.message=n;}if(r.push(t),"failed"===t.status&&!n)break}return {ok:r.every(e=>"ok"===e.status),results:r}};function ku(e){return Array.isArray(e)?e.map(e=>ku(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function Eu(e){return Array.isArray(e)?e.map(e=>Eu(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function xu(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++;}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else {if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++;}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++;}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,a=0;for(;r<t.length&&(a<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?a++:" "===e&&(o++,a++);}if(o||1!==i.newLines||(i.newLines=0),a||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(a!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function $u(e,t,n){let r=true,s=false,i=false,o=1;return function a(){if(r&&!i){if(s?o++:r=false,e+o<=n)return e+o;i=true;}if(!s)return i||(r=true),t<=e-o?e-o++:(s=true,a())}}function Ou(e,t,n={}){let r;if(r="string"==typeof t?xu(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&(function(e){return e.includes("\r\n")&&!e.startsWith("\n")&&!e.match(/[^\r]\n/)}(e)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=ku(t):function(e){return !e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=Eu(t)));const r=e.split("\n"),s=t.hunks,i=n.compareLine||((e,t,n,r)=>t===r),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return e;let c="",u=false,l=false;for(let e=0;e<s[s.length-1].lines.length;e++){const t=s[s.length-1].lines[e];"\\"==t[0]&&("+"==c[0]?u=true:"-"==c[0]&&(l=true)),c=t;}if(u){if(l){if(!o&&""==r[r.length-1])return false}else if(""==r[r.length-1])r.pop();else if(!o)return false}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return false;function f(e,t,n,s=0,o=true,a=[],c=0){let u=0,l=false;for(;s<e.length;s++){const p=e[s],h=p.length>0?p[0]:" ",d=p.length>0?p.substr(1):p;if("-"===h){if(!i(t+1,r[t],h,d))return n&&null!=r[t]?(a[c]=r[t],f(e,t+1,n-1,s,false,a,c+1)):null;t++,u=0;}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=true;}if(" "===h){if(u++,a[c]=r[t],!i(t+1,r[t],h,d))return l||!n?null:r[t]&&(f(e,t+1,n-1,s+1,false,a,c+1)||f(e,t+1,n-1,s,false,a,c+1))||f(e,t,n-1,s+1,false,a,c);c++,o=true,l=false,t++;}}return c-=u,t-=u,a.length=c,{patchedLines:a,oldLineLastI:t-1}}const p=[];let h=0;for(let e=0;e<s.length;e++){const t=s[e];let n;const i=r.length-t.oldLines+o;let c;for(let e=0;e<=o;e++){c=t.oldStart+h-1;const r=$u(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return false;for(let e=a;e<c;e++)p.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){const t=n.patchedLines[e];p.push(t);}a=n.oldLineLastI+1,h=c+1-t.oldStart;}for(let e=a;e<r.length;e++)p.push(r[e]);return p.join("\n")}(e,r[0],n)}const Ru=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Cu=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Tu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Pu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Lu=e=>e.replace(/\n/g,"\r\n"),Nu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=xu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const a=o.some(e=>{const t=Cu(e.oldFileName),n=Cu(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!a)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const c=[],l=[];for(const e of o){const n=Cu(e.newFileName)??Cu(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^[./]+/,""),a=path.resolve(t,o),f=/\.md$/i.test(o);let h="",d=false,g=true;try{const e=await readFile(a,"utf8");h=e,d=/\r\n/.test(e);}catch{g=false;}const m=Tu(e.oldFileName);if(!g&&!m){l.push({path:o,reason:"target file not found"});continue}let y;!g&&m&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Pu(t)===Pu(r),fuzzFactor:f?1:0});}catch{l.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(false===y||"string"!=typeof y){l.push({path:o,reason:"unable to place hunk(s)"});continue}const v=d?Lu(y.replace(/\r/g,"")):y.replace(/\r/g,"");try{if(r){const e=s??path.join(t,".stan","patch",".sandbox"),n=path.resolve(e,o);await Ru(n),await writeFile(n,v,"utf8");}else {try{await Ru(a);}catch{}await writeFile(a,v,"utf8");}c.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:c,failed:l,sandboxRoot:s}},Iu=async e=>{const{cwd:t,patchAbs:n,cleaned:r,check:s,stripOrder:i=[1,0]}=e,o=i.flatMap(e=>((e,t)=>{const n=e?["--check"]:[];return [{args:[...n,"--3way","--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+nowarn-p${t.toString()}`},{args:[...n,"--3way","--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+ignore-p${t.toString()}`},{args:[...n,"--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+nowarn-p${t.toString()}`},{args:[...n,"--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+ignore-p${t.toString()}`}]})(s,e)),a=await(async(e,t,n,r="1"===process.env.STAN_DEBUG)=>{const s=[],i=[];for(const o of n){s.push(o.label);const n=await new Promise(n=>{const s=spawn("git",["apply",...o.args,t],{cwd:e,shell:false,windowsHide:true});let a="",c="";const u=s;u.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t);}),u.stdout?.on("data",e=>{const t=e.toString("utf8");a+=t,r&&process.stdout.write(t);}),s.on("close",e=>{i.push({label:o.label,code:e??0,stdout:a,stderr:c}),n(e??0);});});if(0===n)return {ok:true,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${n})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(a.ok)return {ok:true,result:a,js:null};const c=await Nu({cwd:t,cleaned:r,check:s});if(c.okFiles.length>0&&0===c.failed.length)return {ok:true,result:a,js:c};try{const e=await(async(e,t,n)=>{const r=t.replace(/\r\n/g,"\n").split("\n");let s=-1,i=null;for(let e=0;e<r.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(r[e])){const t=r[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){s=e+1,i=String(t[1]).trim().replace(/^[./]+/,"");break}}if(!i||!i.length)return null;const o=r.slice(s+1).join("\n");if(/^---\s+\/dev\/null/m.test(o))return null;const a=[];let c=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))c=!0;else if(c&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||a.push(t.slice(1));}}let f=a.join("\n");f.endsWith("\n")||(f+="\n");const h=n?path.join(e,".stan","patch",".sandbox","F"):e,d=path.resolve(h,i);return await mkdir(path.dirname(d),{recursive:!0}),await writeFile(d,f,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:a,js:e}}catch{}return {ok:false,result:a,js:c}};var Mu,Du={},ju={},Hu={};function Fu(){if(Mu)return Hu;return Mu=1,Object.defineProperty(Hu,"__esModule",{value:true}),Hu.splitWhen=Hu.flatten=void 0,Hu.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},Hu.splitWhen=function(e,t){const n=[[]];let r=0;for(const s of e)t(s)?(r++,n[r]=[]):n[r].push(s);return n},Hu}var Bu,zu={};function Ku(){if(Bu)return zu;return Bu=1,Object.defineProperty(zu,"__esModule",{value:true}),zu.isEnoentCodeError=void 0,zu.isEnoentCodeError=function(e){return "ENOENT"===e.code},zu}var Uu,qu={};var Zu,Wu={};function Gu(){if(Zu)return Wu;Zu=1,Object.defineProperty(Wu,"__esModule",{value:true}),Wu.convertPosixPathToPattern=Wu.convertWindowsPathToPattern=Wu.convertPathToPattern=Wu.escapePosixPath=Wu.escapeWindowsPath=Wu.escape=Wu.removeLeadingDotSegment=Wu.makeAbsolute=Wu.unixify=void 0;const e=$,t="win32"===x.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,i=/\\(?![!()+@[\]{}])/g;function o(e){return e.replace(r,"\\$2")}function a(e){return e.replace(n,"\\$2")}function c(e){return o(e).replace(s,"//$1").replace(i,"/")}function u(e){return a(e)}return Wu.unixify=function(e){return e.replace(/\\/g,"/")},Wu.makeAbsolute=function(t,n){return e.resolve(t,n)},Wu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Wu.escape=t?o:a,Wu.escapeWindowsPath=o,Wu.escapePosixPath=a,Wu.convertPathToPattern=t?c:u,Wu.convertWindowsPathToPattern=c,Wu.convertPosixPathToPattern=u,Wu}var Vu,Yu,Qu,Ju,Xu,el,tl={};function nl(){return Yu?Vu:(Yu=1,Vu=function(e){if("string"!=typeof e||""===e)return false;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return true;e=e.slice(t.index+t[0].length);}return false})}function rl(){if(Ju)return Qu;Ju=1;var e=nl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return true;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return true;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return true;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return true;if(-1===(a=e.indexOf("\\",n))||a>s)return true}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return true;if(-1!==o&&"("===e[n]&&"?"===e[n+1]&&/[:!=]/.test(e[n+2])&&")"!==e[n+3]&&(o=e.indexOf(")",n))>n&&(-1===(a=e.indexOf("\\",n))||a>o))return true;if(-1!==r&&"("===e[n]&&"|"!==e[n+1]&&(r<n&&(r=e.indexOf("|",n)),-1!==r&&")"!==e[r+1]&&(o=e.indexOf(")",r))>r&&(-1===(a=e.indexOf("\\",r))||a>o)))return true;if("\\"===e[n]){var c=e[n+1];n+=2;var u=t[c];if(u){var l=e.indexOf(u,n);-1!==l&&(n=l+1);}if("!"===e[n])return true}else n++;}return false},r=function(e){if("!"===e[0])return true;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return true;if("\\"===e[n]){var r=e[n+1];n+=2;var s=t[r];if(s){var i=e.indexOf(s,n);-1!==i&&(n=i+1);}if("!"===e[n])return true}else n++;}return false};return Qu=function(t,s){if("string"!=typeof t||""===t)return false;if(e(t))return true;var i=n;return s&&false===s.strict&&(i=r),i(t)}}var sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,gl,ml,yl,vl,_l,bl,wl,Sl,Al={};function kl(){return sl||(sl=1,(e=Al).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,s)=>false!==s&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=s,e.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&true!==r.escaped&&(r.value="\\"+r.value,r.escaped=true);},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=true,0)),e.isInvalidBrace=e=>!("brace"!==e.type||true!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&true===e.open&&true===e.close||(e.invalid=true,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||true===e.open||true===e.close,e.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const s=e[r];Array.isArray(s)?n(s):void 0!==s&&t.push(s);}return t};return n(e),t}),Al;var e;}function El(){if(ol)return il;ol=1;const e=kl();return il=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=true===t.invalid&&true===n.escapeInvalid;let a="";if(t.value)return (i||o)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)a+=r(e);return a};return r(t)}}function xl(){return cl?al:(cl=1,al=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function $l(){if(ll)return ul;ll=1;const e=xl(),t=(n,i,o)=>{if(false===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(false===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:true,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=false===a.strictZeros);let c=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(c))return t.cache[c].result;let u=Math.min(n,i),l=Math.max(n,i);if(1===Math.abs(u-l)){let e=n+"|"+i;return a.capture?`(${e})`:false===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],g=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){g=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0;}return l>=0&&(d=r(u,l,h,a)),h.negatives=g,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",false)||[],r=s(t,e,"",false)||[],i=s(e,t,"-?",true)||[];return n.concat(i).concat(r).join("|")}(g,d),true===a.capture?h.result=`(${h.result})`:false!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return {pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++;}return o&&(i+=true===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function r(e,t,r,s){let o,l=function(e,t){let n=1,r=1,s=a(e,n),o=new Set([t]);for(;e<=s&&s<=t;)o.add(s),n+=1,s=a(e,n);for(s=c(t+1,r)-1;e<s&&s<=t;)o.add(s),r+=1,s=c(t+1,r)-1;return o=[...o],o.sort(i),o}(e,t),f=[],h=e;for(let e=0;e<l.length;e++){let t=l[e],i=n(String(h),String(t),s),a="";r.isPadded||!o||o.pattern!==i.pattern?(r.isPadded&&(a=p(t,r,s)),i.string=a+i.pattern+u(i.count),f.push(i),h=t+1,o=i):(o.count.length>1&&o.count.pop(),o.count.push(i.count[0]),o.string=o.pattern+u(o.count),h=t+1);}return f}function s(e,t,n,r,s){let i=[];for(let s of e){let{string:e}=s;r||o(t,"string",e)||i.push(n+e),r&&o(t,"string",e)&&i.push(n+e);}return i}function i(e,t){return e>t?1:t>e?-1:0}function o(e,t,n){return e.some(e=>e[t]===n)}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function u(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function l(e,t,n){return `[${e}${t-e===1?"":"-"}${t}]`}function f(e){return /^-?(0+)\d/.test(e)}function p(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),s=false!==n.relaxZeros;switch(r){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},ul=t}function Ol(){if(pl)return fl;pl=1;const e=O,t=$l(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,s=e=>Number.isInteger(+e),i=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return false;for(;"0"===t[++n];);return n>0},o=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0");}return false===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},c=(e,n,r,s)=>{if(r)return t(e,n,{wrap:false,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=true===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),f=(e,t,n)=>{if(true===n.strictRanges)throw l([e,t]);return []},p=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(true===r.strictRanges)throw l([e,t]);return []}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),g=String(n);n=Math.max(Math.abs(n),1);let m=i(h)||i(d)||i(g),y=m?Math.max(h.length,d.length,g.length):0,v=false===m&&false===((e,t,n)=>"string"==typeof e||"string"==typeof t||true===n.stringify)(e,t,r),_=r.transform||(e=>t=>true===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),true,r);let b={negatives:[],positives:[]},w=e=>b[e<0?"negatives":"positives"].push(Math.abs(e)),S=[],A=0;for(;p?s>=f:s<=f;) true===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return true===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,s=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.map(e=>a(String(e),n)).join("|")),e.negatives.length&&(o=`-(${s}${e.negatives.map(e=>a(String(e),n)).join("|")})`),r=i&&o?`${i}|${o}`:i||o,t.wrap?`(${s}${r})`:r})(b,r,y):u(S,null,{wrap:false,...r}):S},h=(e,t,i,o={})=>{if(null==t&&r(e))return [e];if(!r(e)||!r(t))return f(e,t,o);if("function"==typeof i)return h(e,t,1,{transform:i});if(n(i))return h(e,t,0,i);let a={...o};return true===a.capture&&(a.wrap=true),i=i||a.step||1,s(i)?s(e)&&s(t)?p(e,t,i,a):((e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return f(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),o=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=o>a,p=Math.min(o,a),h=Math.max(o,a);if(r.toRegex&&1===n)return c(p,h,false,r);let d=[],g=0;for(;l?o>=a:o<=a;)d.push(i(o,g)),o=l?o-n:o+n,g++;return true===r.toRegex?u(d,null,{wrap:false,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(true===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return []})(i,a)};return fl=h}function Rl(){if(bl)return _l;bl=1;const e=El(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=vl?yl:(vl=1,yl={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return _l=(m,y={})=>{if("string"!=typeof m)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(m.length>_)throw new SyntaxError(`Input length (${m.length}), exceeds max characters (${_})`);const b={type:"root",input:m,nodes:[]},w=[b];let S=b,A=b,k=0;const E=m.length;let x,$=0,O=0;const R=()=>m[$++],C=e=>{if("text"===e.type&&"dot"===A.type&&(A.type="text"),!A||"text"!==A.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=A,A=e,e;A.value+=e.value;};for(C({type:"bos"});$<E;)if(S=w[w.length-1],x=R(),x!==g&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;$<E&&(e=R());)if(x+=e,e!==l)if(e!==n){if(e===f&&(k--,0===k))break}else x+=R();else k++;C({type:"text",value:x});continue}if(x!==o)if(x!==a){if(x===p||x===h||x===r){const e=x;let t;for(true!==y.keepQuotes&&(x="");$<E&&(t=R());)if(t!==n){if(t===e){ true===y.keepQuotes&&(x+=t);break}x+=t;}else x+=t+R();C({type:"text",value:x});continue}if(x===c){O++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:O,commas:0,ranges:0,nodes:[]}),w.push(S),C({type:"open",value:x});continue}if(x===u){if("brace"!==S.type){C({type:"text",value:x});continue}const e="close";S=w.pop(),S.close=true,C({type:e,value:x}),O--,S=w[w.length-1];continue}if(x===s&&O>0){if(S.ranges>0){S.ranges=0;const t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}];}C({type:"comma",value:x}),S.commas++;}else {if(x===i&&O>0&&0===S.commas){const e=S.nodes;if(0===O||0===e.length){C({type:"text",value:x});continue}if("dot"===A.type){if(S.range=[],A.value+=x,A.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=true,S.ranges=0,A.type="text";continue}S.ranges++,S.args=[];continue}if("range"===A.type){e.pop();const t=e[e.length-1];t.value+=A.value+x,A=t,S.ranges--;continue}C({type:"dot",value:x});continue}C({type:"text",value:x});}}else {if("paren"!==S.type){C({type:"text",value:x});continue}S=w.pop(),C({type:"text",value:x}),S=w[w.length-1];}else S=C({type:"paren",nodes:[]}),w.push(S),C({type:"text",value:x});}else C({type:"text",value:"\\"+x});else C({type:"text",value:(y.keepEscaping?x:"")+R()});do{if(S=w.pop(),"root"!==S.type){S.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=true),"close"===e.type&&(e.isClose=true),e.nodes||(e.type="text"),e.invalid=true);});const e=w[w.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes);}}while(w.length>0);return C({type:"eos"}),b},_l}function Cl(){if(Sl)return wl;Sl=1;const e=El(),t=function(){if(dl)return hl;dl=1;const e=Ol(),t=kl();return hl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=true===n.invalid&&true===r.escapeInvalid,c=true===o||true===a,u=true===r.escapeInvalid?"\\":"";let l="";if(true===n.isOpen)return u+n.value;if(true===n.isClose)return console.log("node.isClose",u,n.value),u+n.value;if("open"===n.type)return c?u+n.value:"(";if("close"===n.type)return c?u+n.value:")";if("comma"===n.type)return "comma"===n.prev.type?"":c?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const s=t.reduce(n.nodes),i=e(...s,{...r,wrap:false,toRegex:true,strictZeros:true});if(0!==i.length)return s.length>1&&i.length>1?`(${i})`:i}if(n.nodes)for(const e of n.nodes)l+=s(e,n);return l};return s(n)}}(),n=function(){if(ml)return gl;ml=1;const e=Ol(),t=El(),n=kl(),r=(e="",t="",s=false)=>{const i=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return s?n.flatten(t).map(e=>`{${e}}`):t;for(const n of e)if(Array.isArray(n))for(const e of n)i.push(r(e,t,s));else for(let e of t) true===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return gl=(s,i={})=>{const o=void 0===i.rangeLimit?1e3:i.rangeLimit,a=(s,c={})=>{s.queue=[];let u=c,l=c.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,l=u.queue;if(s.invalid||s.dollar)return void l.push(r(l.pop(),t(s,i)));if("brace"===s.type&&true!==s.invalid&&2===s.nodes.length)return void l.push(r(l.pop(),["{}"]));if(s.nodes&&s.ranges>0){const a=n.reduce(s.nodes);if(n.exceedsLimit(...a,i.step,o))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=e(...a,i);return 0===c.length&&(c=t(s,i)),l.push(r(l.pop(),c)),void(s.nodes=[])}const f=n.encloseBrace(s);let p=s.queue,h=s;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,p=h.queue;for(let e=0;e<s.nodes.length;e++){const t=s.nodes[e];"comma"!==t.type||"brace"!==s.type?"close"!==t.type?t.value&&"open"!==t.type?p.push(r(p.pop(),t.value)):t.nodes&&a(t,s):l.push(r(l.pop(),p,f)):(1===e&&p.push(""),p.push(""));}return p};return n.flatten(a(s))},gl}(),r=Rl(),s=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=s.create(r,t);Array.isArray(e)?n.push(...e):n.push(e);}else n=[].concat(s.create(e,t));return t&&true===t.expand&&true===t.nodupes&&(n=[...new Set(n)]),n};return s.parse=(e,t={})=>r(e,t),s.stringify=(t,n={})=>e("string"==typeof t?s.parse(t,n):t,n),s.compile=(e,n={})=>("string"==typeof e&&(e=s.parse(e,n)),t(e,n)),s.expand=(e,t={})=>{"string"==typeof e&&(e=s.parse(e,t));let r=n(e,t);return true===t.noempty&&(r=r.filter(Boolean)),true===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:true!==t.expand?s.compile(e,t):s.expand(e,t),wl=s}var Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul,ql={};function Zl(){if(Pl)return Tl;Pl=1;const e=$,t="\\\\/",n=`[^${t}]`,r="\\.",s="\\/",i="[^/]",o=`(?:${s}|$)`,a=`(?:^|${s})`,c=`${r}{1,2}${o}`,u={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:a},l={...u,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return Tl={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>true===e?l:u}}function Wl(){return Ll||(Ll=1,function(e){const t=$,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=Zl();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:true===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return -1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return true===t.negated&&(r=`(?:^(?!${r}).*$)`),r};}(ql)),ql}function Gl(){if(Hl)return jl;Hl=1;const e=$,t=function(){if(Il)return Nl;Il=1;const e=Wl(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=Zl(),m=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Nl=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(true===D||$===c){for(z++;true!==U()&&($=Z());)if($!==r)if($!==c){if(true!==D&&$===i&&($=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&$===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if($===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if($!==a){if(true!==b.noext&&true==($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,$===o&&R===C&&(F=true),true===S){for(;true!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if($===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if($===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||$!==o||R!==C){if(true!==b.noparen&&$===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&($=Z());)if($!==u){if($===d){B=true;break}}else j=K.backslashes=true,$=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,$=Z(),$===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&true===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):true===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(true===b.tokens&&(Y.maxDepth=0,m($)||k.push(K),Y.tokens=k),true===b.parts||true===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=true,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r;}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth);}Y.slashes=A,Y.parts=E;}return Y},Nl}(),n=function(){if(Dl)return Ml;Dl=1;const e=Zl(),t=Wl(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r);}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=t.isWindows(f),_=e.globChars(v),b=e.extglobChars(_),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:O,QMARK:R,QMARK_NO_DOT:C,STAR:T,START_ANCHOR:P}=_,L=e=>`(${y}(?:(?!${P}${e.dot?E:w}).)*?)`,N=p.dot?"":x,I=p.dot?R:C;let M=true===p.bash?L(p):T;p.capture&&(M=`(${M})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:m};l=t.removePrefix(l,D),d=l.length;const j=[],H=[],F=[];let B,z=g;const K=()=>D.index===d-1,U=D.peek=(e=1)=>l[D.index+e],q=D.advance=()=>l[++D.index]||"",Z=()=>l.slice(D.index+1),W=(e="",t=0)=>{D.consumed+=e,D.index+=t;},G=e=>{D.output+=null!=e.output?e.output:e.value,W(e.value);},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),D.start++,e++;return e%2!=0&&(D.negated=true,D.start++,true)},Y=e=>{D[e]++,F.push(e);},Q=e=>{D[e]--,F.pop();},J=e=>{if("globstar"===z.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=true===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=M,D.output+=z.output);}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&G(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,m.push(e),z=e;},X=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=z,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:D.output?"":k}),J({type:"paren",extglob:true,value:q(),output:r}),j.push(n);},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(p)),(r!==M||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(D.negatedExtglob=true);}J({type:"paren",extglob:true,value:B,output:n}),Q("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?R.repeat(i.length):""):0===o?I+(i?R.repeat(i.length):""):R.repeat(r.length):"."===s?w.repeat(r.length):"*"===s?n?n+s+(i?M:""):M:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&true!==p.bash)continue;if("."===e||";"===e)continue;if(!e){B+="\\",J({type:"text",value:B});continue}const t=/^\\+/.exec(Z());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(B+="\\")),true===p.unescape?B=q():B+=q(),0===D.brackets){J({type:"text",value:B});continue}}if(D.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(false!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=true,e.includes(":"))){const e=z.value.lastIndexOf("["),t=z.value.slice(0,e),n=z.value.slice(e+2),s=r[n];if(s){z.value=t+s,D.backtrack=true,q(),g.output||1!==m.indexOf(z)||(g.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),true===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,G({value:B});continue}if(1===D.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,G({value:B});continue}if('"'===B){D.quotes=1===D.quotes?0:1,true===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&true===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&D.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(true!==p.nobracket&&Z().includes("]"))Y("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`;}J({type:"bracket",value:B});continue}if("]"===B){if(true===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(true===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),true===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&true!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};H.push(e),J(e);continue}if("}"===B){const e=H[H.length-1];if(true===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(true===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=true;}if(true!==e.comma&&true!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value;}J({type:"brace",value:B,output:t}),Q("braces"),H.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,J({type:"text",value:B});continue}if(","===B){let e=B;const t=H[H.length-1];t&&"braces"===F[F.length-1]&&(t.comma=true,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),z=g;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(D.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=H[H.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=true;continue}if(D.braces+D.parens===0&&"bos"!==z.type&&"slash"!==z.type){J({type:"text",value:B,output:w});continue}J({type:"dot",value:B,output:w});continue}if("?"===B){if((!z||"("!==z.value)&&true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",B);continue}if(z&&"paren"===z.type){const e=U();let n=B;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===z.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Z()))&&(n=`\\${B}`),J({type:"text",value:B,output:n});continue}if(true!==p.dot&&("slash"===z.type||"bos"===z.type)){J({type:"qmark",value:B,output:C});continue}J({type:"qmark",value:B,output:R});continue}if("!"===B){if(true!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(true!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||false===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||D.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:true,value:B,output:""});continue}J({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const e=s.exec(Z());e&&(B+=e[0],D.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||true===z.star)){z.type="star",z.star=true,z.value+=B,z.output=M,D.backtrack=true,D.globstar=true,W(B);continue}let e=Z();if(true!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(true===p.noglobstar){W(B);continue}const t=z.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(true===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){J({type:"star",value:B,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3);}if("bos"===t.type&&K()){z.type="globstar",z.value+=B,z.output=L(p),D.output=z.output,D.globstar=true,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=L(p)+(p.strictSlashes?")":"|$)"),z.value+=B,D.globstar=true,D.output+=t.output+z.output,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${L(p)}${A}|${A}${n})`,z.value+=B,D.output+=t.output+z.output,D.globstar=true,W(B+q()),J({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){z.type="globstar",z.value+=B,z.output=`(?:^|${A}|${L(p)}${A})`,D.output=z.output,D.globstar=true,W(B+q()),J({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-z.output.length),z.type="globstar",z.output=L(p),z.value+=B,D.output+=z.output,D.globstar=true,W(B);continue}const n={type:"star",value:B,output:M};true!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||true!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=$,z.output+=$):true===p.dot?(D.output+=O,z.output+=O):(D.output+=N,z.output+=N),"*"!==U()&&(D.output+=k,z.output+=k)),J(n)):(n.output=B,J(n)):(n.output=".*?","bos"!==z.type&&"slash"!==z.type||(n.output=N+n.output),J(n));}for(;D.brackets>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets");}for(;D.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens");}for(;D.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces");}if(true===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),true===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix);}return D};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?g:d,b=i.dot?m:d,w=i.capture?"":"?:";let S=true===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>true===e.noglobstar?S:`(${w}(?:(?!${v}${e.dot?h:l}).)*?)`,k=e=>{switch(e){case "*":return `${_}${p}${S}`;case ".*":return `${l}${p}${S}`;case "*.*":return `${_}${S}${l}${p}${S}`;case "*/*":return `${_}${S}${f}${p}${b}${S}`;case "**":return _+A(i);case "**/*":return `(?:${_}${A(i)}${f})?${b}${p}${S}`;case "**/*.*":return `(?:${_}${A(i)}${f})?${b}${S}${l}${p}${S}`;case "**/.*":return `(?:${_}${A(i)}${f})?${l}${p}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=k(t[1]);if(!n)return;return n+l+t[2]}}},E=t.removePrefix(r,{negated:false,prefix:""});let x=k(E);return x&&true!==i.strictSlashes&&(x+=`${f}?`),x},Ml=u}(),r=Wl(),s=Zl(),i=(e,t,n=false)=>{if(Array.isArray(e)){const r=e.map(e=>i(e,t,n)),s=e=>{for(const t of r){const n=t(e);if(n)return n}return false};return s}const s=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},c=r.isWindows(t),u=s?i.compileRe(e,t):i.makeRe(e,t,false,true),l=u.state;delete u.state;let f=()=>false;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n);}const p=(n,r=false)=>{const{isMatch:s,match:o,output:p}=i.test(n,u,t,{glob:e,posix:c}),h={glob:e,state:l,regex:u,posix:c,input:n,output:p,match:o,isMatch:s};return "function"==typeof a.onResult&&a.onResult(h),false===s?(h.isMatch=false,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=false,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(p.state=l),p};return i.test=(e,t,n,{glob:s,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return {isMatch:false,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===s),false!==u&&true!==a.capture||(u=true===a.matchBase||true===a.basename?i.matchBase(e,t,n,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},i.matchBase=(t,n,s,o=r.isWindows(s))=>(n instanceof RegExp?n:i.makeRe(n,s)).test(e.basename(t)),i.isMatch=(e,t,n)=>i(t,n)(e),i.parse=(e,t)=>Array.isArray(e)?e.map(e=>i.parse(e,t)):n(e,{...t,fastpaths:false}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return true===r&&(u.state=e),u},i.makeRe=(e,t={},r=false,s=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=n.fastpaths(e,t)),o.output||(o=n(e,t)),i.compileRe(o,t,r,s)},i.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&true===t.debug)throw e;return /$^/}},i.constants=s,jl=i}function Vl(){return Bl?Fl:(Bl=1,Fl=Gl())}function Yl(){if(Ul)return tl;Ul=1,Object.defineProperty(tl,"__esModule",{value:true}),tl.isAbsolute=tl.partitionAbsoluteAndRelative=tl.removeDuplicateSlashes=tl.matchAny=tl.convertPatternsToRe=tl.makeRe=tl.getPatternParts=tl.expandBraceExpansion=tl.expandPatternsWithBraceExpansion=tl.isAffectDepthOfReadingPattern=tl.endsWithSlashGlobStar=tl.hasGlobStar=tl.getBaseDirectory=tl.isPatternRelatedToParentDirectory=tl.getPatternsOutsideCurrentDirectory=tl.getPatternsInsideCurrentDirectory=tl.getPositivePatterns=tl.getNegativePatterns=tl.isPositivePattern=tl.isNegativePattern=tl.convertToNegativePattern=tl.convertToPositivePattern=tl.isDynamicPattern=tl.isStaticPattern=void 0;const e=$,t=function(){if(el)return Xu;el=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Xu=function(a,c){Object.assign({flipBackslashes:true},c).flipBackslashes&&n&&a.indexOf("/")<0&&(a=a.replace(r,"/")),s.test(a)&&(a+="/"),a+="a";do{a=t(a);}while(e(a)||i.test(a));return a.replace(o,"$1")}}(),n=function(){if(Kl)return zl;Kl=1;const e=O,t=Cl(),n=Vl(),r=Wl(),s=e=>""===e||"./"===e,i=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},o=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,i=new Set,o=new Set,a=0,c=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e);};for(let o=0;o<t.length;o++){let u=n(String(t[o]),{...r,onResult:c},true),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,true);(l?!e.isMatch:e.isMatch)&&(l?s.add(e.output):(s.delete(e.output),i.add(e.output)));}}let u=(a===t.length?[...o]:[...i]).filter(e=>!s.has(e));if(r&&0===u.length){if(true===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(true===r.nonull||true===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};return o.match=o,o.matcher=(e,t)=>n(e,t),o.any=o.isMatch=(e,t,r)=>n(t,r)(e),o.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,s=[],i=new Set(o(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),s.push(e.output);}}));for(let e of s)i.has(e)||r.add(e);return [...r]},o.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some(e=>o.contains(t,e,r));if("string"==typeof n){if(s(t)||s(n))return false;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return true}return o.isMatch(t,n,{...r,contains:true})},o.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=o(Object.keys(e),t,n),i={};for(let t of s)i[t]=e[t];return i},o.some=(e,t,r)=>{let s=[].concat(e);for(let e of [].concat(t)){let t=n(String(e),r);if(s.some(e=>t(e)))return true}return false},o.every=(e,t,r)=>{let s=[].concat(e);for(let e of [].concat(t)){let t=n(String(e),r);if(!s.every(e=>t(e)))return false}return true},o.all=(t,r,s)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return [].concat(r).every(e=>n(e,s)(t))},o.capture=(e,t,s)=>{let i=r.isWindows(s),o=n.makeRe(String(e),{...s,capture:true}).exec(i?r.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>void 0===e?"":e)},o.makeRe=(...e)=>n.makeRe(...e),o.scan=(...e)=>n.scan(...e),o.parse=(e,r)=>{let s=[];for(let i of [].concat(e||[]))for(let e of t(String(i),r))s.push(n.parse(e,r));return s},o.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&true===n.nobrace||!i(e)?[e]:t(e,n)},o.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return o.braces(e,{...t,expand:true})},o.hasBraces=i,zl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return !l(e,t)}function l(e,t={}){return ""!==e&&(!(false!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(false===t.extglob||!o.test(e))||!(false===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return false;const n=e.indexOf("}",t+1);if(-1===n)return false;const r=e.slice(t,n);return a.test(r)}(e)))))}function f(e){return e.startsWith("!")&&"("!==e[1]}function p(e){return !f(e)}function h(e){return e.startsWith("..")||e.startsWith("./..")}function d(e){return e.endsWith("/**")}function g(e){const t=n.braces(e,{expand:true,nodupes:true,keepEscaping:true});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function m(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return tl.isStaticPattern=u,tl.isDynamicPattern=l,tl.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},tl.convertToNegativePattern=function(e){return "!"+e},tl.isNegativePattern=f,tl.isPositivePattern=p,tl.getNegativePatterns=function(e){return e.filter(f)},tl.getPositivePatterns=function(e){return e.filter(p)},tl.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},tl.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},tl.isPatternRelatedToParentDirectory=h,tl.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},tl.hasGlobStar=function(e){return e.includes("**")},tl.endsWithSlashGlobStar=d,tl.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},tl.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(g(t)),[])},tl.expandBraceExpansion=g,tl.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:true}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},tl.makeRe=m,tl.convertPatternsToRe=function(e,t){return e.map(e=>m(e,t))},tl.matchAny=function(e,t){return t.some(t=>t.test(e))},tl.removeDuplicateSlashes=function(e){return e.replace(c,"/")},tl.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},tl.isAbsolute=y,tl}var Ql,Jl,Xl,ef={};function tf(){if(Jl)return Ql;Jl=1;const e=R.PassThrough,t=Array.prototype.slice;function n(t,r){if(Array.isArray(t))for(let e=0,s=t.length;e<s;e++)t[e]=n(t[e],r);else {if(!t._readableState&&t.pipe&&(t=t.pipe(e(r))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause();}return t}return Ql=function(){const r=[],s=t.call(arguments);let i=false,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=false!==o.end,c=true===o.pipeError;null==o.objectMode&&(o.objectMode=true);null==o.highWaterMark&&(o.highWaterMark=65536);const u=e(o);function l(){for(let e=0,t=arguments.length;e<t;e++)r.push(n(arguments[e],o));return f(),this}function f(){if(i)return;i=true;let e=r.shift();if(!e)return void process.nextTick(p);Array.isArray(e)||(e=[e]);let t=e.length+1;function n(){--t>0||(i=false,f());}function s(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),c&&e.removeListener("error",r),n();}function r(e){u.emit("error",e);}if(e._readableState.endEmitted)return n();e.on("merge2UnpipeEnd",t),e.on("end",t),c&&e.on("error",r),e.pipe(u,{end:false}),e.resume();}for(let t=0;t<e.length;t++)s(e[t]);n();}function p(){i=false,u.emit("queueDrain"),a&&u.end();}u.setMaxListeners(0),u.add=l,u.on("unpipe",function(e){e.emit("merge2UnpipeEnd");}),s.length&&l.apply(null,s);return u},Ql}var nf,rf,sf,of={};function af(){if(nf)return of;return nf=1,Object.defineProperty(of,"__esModule",{value:true}),of.isEmpty=of.isString=void 0,of.isString=function(e){return "string"==typeof e},of.isEmpty=function(e){return ""===e},of}function cf(){if(rf)return ju;rf=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.string=ju.stream=ju.pattern=ju.path=ju.fs=ju.errno=ju.array=void 0;const e=Fu();ju.array=e;const t=Ku();ju.errno=t;const n=function(){if(Uu)return qu;Uu=1,Object.defineProperty(qu,"__esModule",{value:true}),qu.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t);}}return qu.createDirentFromStats=function(t,n){return new e(t,n)},qu}();ju.fs=n;const r=Gu();ju.path=r;const s=Yl();ju.pattern=s;const i=function(){if(Xl)return ef;Xl=1,Object.defineProperty(ef,"__esModule",{value:true}),ef.merge=void 0;const e=tf();function t(e){e.forEach(e=>e.emit("close"));}return ef.merge=function(n){const r=e(n);return n.forEach(e=>{e.once("error",e=>r.emit("error",e));}),r.once("close",()=>t(n)),r.once("end",()=>t(n)),r},ef}();ju.stream=i;const o=af();return ju.string=o,ju}var uf,lf={},ff={},pf={},hf={},df={},gf={},mf={},yf={},vf={};function _f(){if(uf)return vf;function e(e,t){e(t);}function t(e,t){e(null,t);}return uf=1,Object.defineProperty(vf,"__esModule",{value:true}),vf.read=void 0,vf.read=function(n,r,s){r.fs.lstat(n,(i,o)=>{null===i?o.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,i)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void e(s,n):void t(s,o);r.markSymbolicLink&&(i.isSymbolicLink=()=>true),t(s,i);}):t(s,o):e(s,i);});},vf}var bf,wf={};var Sf,Af,kf,Ef,xf,$f,Of,Rf={},Cf={};function Tf(){if(Af)return Rf;Af=1,Object.defineProperty(Rf,"__esModule",{value:true});const e=(Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)};}(Cf)),Cf);return Rf.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);}_getValue(e,t){return null!=e?e:t}},Rf}function Pf(){if(kf)return yf;kf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.statSync=yf.stat=yf.Settings=void 0;const e=_f(),t=(bf||(bf=1,Object.defineProperty(wf,"__esModule",{value:true}),wf.read=void 0,wf.read=function(e,t){const n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}),wf),n=Tf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return yf.Settings=n.default,yf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},yf.statSync=function(e,n){const s=r(n);return t.read(e,s)},yf}function Lf(){if(xf)return Ef;let e;return xf=1,Ef="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:K):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Nf,If={};function Mf(){if(Nf)return If;Nf=1,Object.defineProperty(If,"__esModule",{value:true}),If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const e=process.versions.node.split(".");if(void 0===e[0]||void 0===e[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const t=Number.parseInt(e[0],10),n=Number.parseInt(e[1],10),r=t>10,s=10===t&&n>=10;return If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,If}var Df,jf,Hf={},Ff={};function Bf(){if(jf)return Hf;jf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.fs=void 0;const e=function(){if(Df)return Ff;Df=1,Object.defineProperty(Ff,"__esModule",{value:true}),Ff.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t);}}return Ff.createDirentFromStats=function(t,n){return new e(t,n)},Ff}();return Hf.fs=e,Hf}var zf,Kf,Uf={};function qf(){if(zf)return Uf;return zf=1,Object.defineProperty(Uf,"__esModule",{value:true}),Uf.joinPathSegments=void 0,Uf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Uf}function Zf(){if(Kf)return mf;Kf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Pf(),t=function(){if(Of)return $f;Of=1,$f=function(t,n){let r,s,i,o=true;function a(t){function s(){n&&n(t,r),n=null;}o?e(s):s();}function c(e,t,n){r[e]=n,(0===--s||t)&&a(t);}Array.isArray(t)?(r=[],s=t.length):(i=Object.keys(t),r={},s=i.length),s?i?i.forEach(function(e){t[e](function(t,n){c(e,t,n);});}):t.forEach(function(e,t){e(function(e,n){c(t,e,n);});}):a(null),o=false;};const e=Lf();return $f}(),n=Mf(),r=Bf(),s=qf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:true},(o,u)=>{if(null!==o)return void a(i,o);const l=u.map(t=>({dirent:t,name:t.name,path:s.joinPathSegments(e,t.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void c(i,l);const f=l.map(e=>function(e,t){return n=>{e.dirent.isSymbolicLink()?t.fs.stat(e.path,(s,i)=>{if(null!==s)return t.throwErrorOnBrokenSymbolicLink?void n(s):void n(null,e);e.dirent=r.fs.createDirentFromStats(e.name,i),n(null,e);}):n(null,e);}}(e,n));t(f,(e,t)=>{null===e?c(i,t):a(i,e);});});}function o(n,i,o){i.fs.readdir(n,(u,l)=>{if(null!==u)return void a(o,u);const f=l.map(t=>{const o=s.joinPathSegments(n,t,i.pathSegmentSeparator);return n=>{e.stat(o,i.fsStatSettings,(e,s)=>{if(null!==e)return void n(e);const a={name:t,path:o,dirent:r.fs.createDirentFromStats(t,s)};i.stats&&(a.stats=s),n(null,a);});}});t(f,(e,t)=>{null===e?c(o,t):a(o,e);});});}function a(e,t){e(t);}function c(e,t){e(null,t);}return mf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r);},mf.readdirWithFileTypes=i,mf.readdir=o,mf}var Wf,Gf={};var Vf,Yf,Qf,Jf={},Xf={};function ep(){return Vf||(Vf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)};}(Xf)),Xf}function tp(){if(Qf)return gf;Qf=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.Settings=gf.scandirSync=gf.scandir=void 0;const e=Zf(),t=function(){if(Wf)return Gf;Wf=1,Object.defineProperty(Gf,"__esModule",{value:true}),Gf.readdir=Gf.readdirWithFileTypes=Gf.read=void 0;const e=Pf(),t=Mf(),n=Bf(),r=qf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:true}).map(s=>{const i={dirent:s,name:s.name,path:r.joinPathSegments(e,s.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(i.path);i.dirent=n.fs.createDirentFromStats(i.name,e);}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return i})}function i(t,s){return s.fs.readdirSync(t).map(i=>{const o=r.joinPathSegments(t,i,s.pathSegmentSeparator),a=e.statSync(o,s.fsStatSettings),c={name:i,path:o,dirent:n.fs.createDirentFromStats(i,a)};return s.stats&&(c.stats=a),c})}return Gf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Gf.readdirWithFileTypes=s,Gf.readdir=i,Gf}(),n=function(){if(Yf)return Jf;Yf=1,Object.defineProperty(Jf,"__esModule",{value:true});const e=$,t=Pf(),n=ep();return Jf.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Jf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},gf}var np,rp,sp,ip={exports:{}};function op(){if(sp)return ip.exports;sp=1;var e=rp?np:(rp=1,np=function(e){var t=new e,n=t;return {get:function(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r},release:function(e){n.next=e,n=e;}}});function t(t,s,i){if("function"==typeof t&&(i=s,s=t,t=null),!(i>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var o=e(r),a=null,c=null,u=0,l=null,f={push:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?c?(c.next=h,c=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked));},drain:n,saturated:n,pause:function(){f.paused=true;},paused:false,get concurrency(){return i},set concurrency(e){if(!(e>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(i=e,!f.paused)for(;a&&u<i;)u++,p();},running:function(){return u},resume:function(){if(!f.paused)return;if(f.paused=false,null===a)return u++,void p();for(;a&&u<i;)u++,p();},idle:function(){return 0===u&&0===f.length()},length:function(){var e=a,t=0;for(;e;)e=e.next,t++;return t},getQueue:function(){var e=a,t=[];for(;e;)t.push(e.value),e=e.next;return t},unshift:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?a?(h.next=a,a=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked));},empty:n,kill:function(){a=null,c=null,f.drain=n;},killAndDrain:function(){a=null,c=null,f.drain(),f.drain=n;},error:function(e){l=e;}};return f;function p(e){e&&o.release(e);var n=a;n&&u<=i?f.paused?u--:(c===a&&(c=null),a=n.next,n.next=null,s.call(t,n.value,n.worked),null===c&&f.empty()):0===--u&&f.drain();}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,r){var s=e.callback,i=e.errorHandler,o=e.value;e.value=null,e.callback=n,e.errorHandler&&i(t,o),s.call(e.context,t,r),e.release(e);};}return ip.exports=t,ip.exports.promise=function(e,r,s){"function"==typeof e&&(s=r,r=e,e=null);var i=t(e,function(e,t){r.call(this,e).then(function(e){t(null,e);},t);},s),o=i.push,a=i.unshift;return i.push=function(e){var t=new Promise(function(t,n){o(e,function(e,r){e?n(e):t(r);});});return t.catch(n),t},i.unshift=function(e){var t=new Promise(function(t,n){a(e,function(e,r){e?n(e):t(r);});});return t.catch(n),t},i.drained=function(){var e=new Promise(function(e){process.nextTick(function(){if(i.idle())e();else {var t=i.drain;i.drain=function(){"function"==typeof t&&t(),e(),i.drain=t;};}});});return e},i},ip.exports}var ap,cp={};function up(){if(ap)return cp;return ap=1,Object.defineProperty(cp,"__esModule",{value:true}),cp.joinPathSegments=cp.replacePathSegmentSeparator=cp.isAppliedFilter=cp.isFatalError=void 0,cp.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},cp.isAppliedFilter=function(e,t){return null===e||e(t)},cp.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},cp.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},cp}var lp,fp,pp,hp={};function dp(){if(lp)return hp;lp=1,Object.defineProperty(hp,"__esModule",{value:true});const e=up();return hp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},hp}function gp(){if(fp)return df;fp=1,Object.defineProperty(df,"__esModule",{value:true});const e=C,t=tp(),n=op(),r=up(),s=dp();class i extends s.default{constructor(r,s){super(r,s),this._settings=s,this._scandir=t.scandir,this._emitter=new e.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=false,this._isDestroyed=false,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end");};}read(){return this._isFatalError=false,this._isDestroyed=false,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath);}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=true,this._queue.killAndDrain();}onEntry(e){this._emitter.on("entry",e);}onError(e){this._emitter.once("error",e);}onEnd(e){this._emitter.once("end",e);}_pushToQueue(e,t){const n={directory:e,base:t};this._queue.push(n,e=>{null!==e&&this._handleError(e);});}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const t of r)this._handleEntry(t,e.base);t(null,void 0);}else t(n,void 0);});}_handleError(e){!this._isDestroyed&&r.isFatalError(this._settings,e)&&(this._isFatalError=true,this._isDestroyed=true,this._emitter.emit("error",e));}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const n=e.path;void 0!==t&&(e.path=r.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,void 0===t?void 0:e.path);}_emitEntry(e){this._emitter.emit("entry",e);}}return df.default=i,df}var mp,yp={};var vp,_p,bp={},wp={};function Sp(){if(_p)return bp;_p=1,Object.defineProperty(bp,"__esModule",{value:true});const e=function(){if(vp)return wp;vp=1,Object.defineProperty(wp,"__esModule",{value:true});const e=tp(),t=up(),n=dp();class r extends n.default{constructor(){super(...arguments),this._scandir=e.scandirSync,this._storage=[],this._queue=new Set;}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t});}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.directory,e.base);}_handleDirectory(e,t){try{const n=this._scandir(e,this._settings.fsScandirSettings);for(const e of n)this._handleEntry(e,t);}catch(e){this._handleError(e);}}_handleError(e){if(t.isFatalError(this._settings,e))throw e}_handleEntry(e,n){const r=e.path;void 0!==n&&(e.path=t.joinPathSegments(n,e.name,this._settings.pathSegmentSeparator)),t.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&t.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,void 0===n?void 0:e.path);}_pushToStorage(e){this._storage.push(e);}}return wp.default=r,wp}();return bp.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings);}read(){return this._reader.read()}},bp}var Ap,kp,Ep={};function xp(){if(kp)return pf;kp=1,Object.defineProperty(pf,"__esModule",{value:true}),pf.Settings=pf.walkStream=pf.walkSync=pf.walk=void 0;const e=function(){if(pp)return hf;pp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=gp();return hf.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings),this._storage=[];}read(e){this._reader.onError(t=>{!function(e,t){e(t);}(e,t);}),this._reader.onEntry(e=>{this._storage.push(e);}),this._reader.onEnd(()=>{!function(e,t){e(null,t);}(e,this._storage);}),this._reader.read();}},hf}(),t=function(){if(mp)return yp;mp=1,Object.defineProperty(yp,"__esModule",{value:true});const e=R,t=gp();return yp.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new t.default(this._root,this._settings),this._stream=new e.Readable({objectMode:true,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy();}});}read(){return this._reader.onError(e=>{this._stream.emit("error",e);}),this._reader.onEntry(e=>{this._stream.push(e);}),this._reader.onEnd(()=>{this._stream.push(null);}),this._reader.read(),this._stream}},yp}(),n=Sp(),r=function(){if(Ap)return Ep;Ap=1,Object.defineProperty(Ep,"__esModule",{value:true});const e=$,t=tp();return Ep.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.fsScandirSettings=new t.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Ep}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return pf.Settings=r.default,pf.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},pf.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},pf.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},pf}var $p,Op={};function Rp(){if($p)return Op;$p=1,Object.defineProperty(Op,"__esModule",{value:true});const e=$,t=Pf(),n=cf();return Op.default=class{constructor(e){this._settings=e,this._fsStatSettings=new t.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks});}_getFullEntryPath(t){return e.resolve(this._settings.cwd,t)}_makeEntry(e,t){const r={name:t,path:t,dirent:n.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return !n.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}},Op}var Cp,Tp,Pp={};function Lp(){if(Cp)return Pp;Cp=1,Object.defineProperty(Pp,"__esModule",{value:true});const e=R,t=Pf(),n=xp(),r=Rp();class s extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=t.stat;}dynamic(e,t){return this._walkStream(e,t)}static(t,n){const r=t.map(this._getFullEntryPath,this),s=new e.PassThrough({objectMode:true});s._write=(e,i,o)=>this._getEntry(r[e],t[e],n).then(t=>{null!==t&&n.entryFilter(t)&&s.push(t),e===r.length-1&&s.end(),o();}).catch(o);for(let e=0;e<r.length;e++)s.write(e);return s}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>null===e?t(r):n(e));})}}return Pp.default=s,Pp}var Np,Ip,Mp,Dp={},jp={},Hp={},Fp={};function Bp(){if(Ip)return Hp;Ip=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=function(){if(Np)return Fp;Np=1,Object.defineProperty(Fp,"__esModule",{value:true});const e=cf();return Fp.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage();}_fillStorage(){for(const e of this._patterns){const t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n});}}_getPatternSegments(t){return e.pattern.getPatternParts(t,this._micromatchOptions).map(t=>e.pattern.isDynamicPattern(t,this._settings)?{dynamic:true,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:false,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Fp}();class t extends e.default{match(e){const t=e.split("/"),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(const e of r){const r=e.sections[0];if(!e.complete&&n>r.length)return true;if(t.every((t,n)=>{const r=e.segments[n];return !(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return true}return false}}return Hp.default=t,Hp}var zp,Kp={};var Up,qp={};var Zp,Wp,Gp,Vp={};function Yp(){if(Wp)return Dp;Wp=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=$,t=function(){if(Mp)return jp;Mp=1,Object.defineProperty(jp,"__esModule",{value:true});const e=cf(),t=Bp();return jp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t;}getFilter(e,t,n){const r=this._getMatcher(t),s=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,s)}_getMatcher(e){return new t.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const n=t.filter(e.pattern.isAffectDepthOfReadingPattern);return e.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(t,n,r,s){if(this._isSkippedByDeep(t,n.path))return false;if(this._isSkippedSymbolicLink(n))return false;const i=e.path.removeLeadingDotSegment(n.path);return !this._isSkippedByPositivePatterns(i,r)&&this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,t){return this._settings.deep!==1/0&&this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){const n=t.split("/").length;return ""===e?n:n-e.split("/").length}_isSkippedSymbolicLink(e){return !this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return !this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(t,n){return !e.pattern.matchAny(t,n)}},jp}(),n=function(){if(zp)return Kp;zp=1,Object.defineProperty(Kp,"__esModule",{value:true});const e=cf();return Kp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map;}getFilter(t,n){const[r,s]=e.pattern.partitionAbsoluteAndRelative(n),i={positive:{all:e.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:true})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:true}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return false;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return false;const s=this._isMatchToPatternsSet(r,n,t.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(r),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0);}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return !!this._isMatchToPatterns(e,t.positive.all,n)&&(!this._isMatchToPatterns(e,t.negative.relative,n)&&!this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(t,n,r){if(0===n.length)return false;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return false;const s=e.pattern.matchAny(t,n);return !s&&r?e.pattern.matchAny(t+"/",n):s}},Kp}(),r=function(){if(Up)return qp;Up=1,Object.defineProperty(qp,"__esModule",{value:true});const e=cf();return qp.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},qp}(),s=function(){if(Zp)return Vp;Zp=1,Object.defineProperty(Vp,"__esModule",{value:true});const e=cf();return Vp.default=class{constructor(e){this._settings=e;}getTransformer(){return e=>this._transform(e)}_transform(t){let n=t.path;return this._settings.absolute&&(n=e.path.makeAbsolute(this._settings.cwd,n),n=e.path.unixify(n)),this._settings.markDirectories&&t.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:n}):n}},Vp}();return Dp.default=class{constructor(e){this._settings=e,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new t.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings);}_getRootDirectory(t){return e.resolve(this._settings.cwd,t.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return {basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return {dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:true,strictSlashes:false}}},Dp}function Qp(){if(Gp)return lf;Gp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=function(){if(Tp)return ff;Tp=1,Object.defineProperty(ff,"__esModule",{value:true});const e=xp(),t=Rp(),n=Lp();class r extends t.default{constructor(){super(...arguments),this._walkAsync=e.walk,this._readerStream=new n.default(this._settings);}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{null===e?n(t):r(e);});})}async static(e,t){const n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once("error",t),r.on("data",e=>n.push(e)),r.once("end",()=>e(n));})}}return ff.default=r,ff}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings);}async read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return (await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return lf.default=n,lf}var Jp,Xp={};var eh,th,nh={},rh={};function sh(){if(th)return nh;th=1,Object.defineProperty(nh,"__esModule",{value:true});const e=function(){if(eh)return rh;eh=1,Object.defineProperty(rh,"__esModule",{value:true});const e=Pf(),t=xp(),n=Rp();class r extends n.default{constructor(){super(...arguments),this._walkSync=t.walkSync,this._statSync=e.statSync;}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const n=[];for(const r of e){const e=this._getFullEntryPath(r),s=this._getEntry(e,r,t);null!==s&&t.entryFilter(s)&&n.push(s);}return n}_getEntry(e,t,n){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}return rh.default=r,rh}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings);}read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return nh.default=n,nh}var ih,oh,ah,ch={};var uh,lh,fh=function(){if(ah)return oh;ah=1;const e=function(){if(sf)return Du;sf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.convertPatternGroupToTask=Du.convertPatternGroupsToTasks=Du.groupPatternsByBaseDirectory=Du.getNegativePatternsAsPositive=Du.getPositivePatterns=Du.convertPatternsToTasks=Du.generate=void 0;const e=cf();function t(t,n){let r=t;return n.braceExpansion&&(r=e.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes("/")?e:`**/${e}`)),r.map(t=>e.pattern.removeDuplicateSlashes(t))}function n(t,n,r){const s=[],c=e.pattern.getPatternsOutsideCurrentDirectory(t),u=e.pattern.getPatternsInsideCurrentDirectory(t),l=i(c),f=i(u);return s.push(...o(l,n,r)),"."in f?s.push(a(".",u,n,r)):s.push(...o(f,n,r)),s}function r(t){return e.pattern.getPositivePatterns(t)}function s(t,n){return e.pattern.getNegativePatterns(t).concat(n).map(e.pattern.convertToPositivePattern)}function i(t){return t.reduce((t,n)=>{const r=e.pattern.getBaseDirectory(n);return r in t?t[r].push(n):t[r]=[n],t},{})}function o(e,t,n){return Object.keys(e).map(r=>a(r,e[r],t,n))}function a(t,n,r,s){return {dynamic:s,positive:n,negative:r,base:t,patterns:[].concat(n,r.map(e.pattern.convertToNegativePattern))}}return Du.generate=function(i,o){const a=t(i,o),c=t(o.ignore,o),u=r(a),l=s(a,c),f=u.filter(t=>e.pattern.isStaticPattern(t,o)),p=u.filter(t=>e.pattern.isDynamicPattern(t,o)),h=n(f,l,false),d=n(p,l,true);return h.concat(d)},Du.convertPatternsToTasks=n,Du.getPositivePatterns=r,Du.getNegativePatternsAsPositive=s,Du.groupPatternsByBaseDirectory=i,Du.convertPatternGroupsToTasks=o,Du.convertPatternGroupToTask=a,Du}(),t=Qp(),n=function(){if(Jp)return Xp;Jp=1,Object.defineProperty(Xp,"__esModule",{value:true});const e=R,t=Lp(),n=Yp();class r extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings);}read(t){const n=this._getRootDirectory(t),r=this._getReaderOptions(t),s=this.api(n,t,r),i=new e.Readable({objectMode:true,read:()=>{}});return s.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Xp.default=r,Xp}(),r=sh(),s=(ih||(ih=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=x,r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,false),this.baseNameMatch=this._getValue(this._options.baseNameMatch,false),this.braceExpansion=this._getValue(this._options.braceExpansion,true),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,false),this.extglob=this._getValue(this._options.extglob,true),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,true),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,false),this.objectMode=this._getValue(this._options.objectMode,false),this.onlyDirectories=this._getValue(this._options.onlyDirectories,false),this.onlyFiles=this._getValue(this._options.onlyFiles,true),this.stats=this._getValue(this._options.stats,false),this.suppressErrors=this._getValue(this._options.suppressErrors,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false),this.unique=this._getValue(this._options.unique,true),this.onlyDirectories&&(this.onlyFiles=false),this.stats&&(this.objectMode=true),this.ignore=[].concat(this.ignore);}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};}(ch)),ch),i$1=cf();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i$1.array.flatten(s)}function a(t,n,r){const i=[].concat(t),o=new s.default(r),a=e.generate(i,o),c=new n(o);return a.map(c.read,c)}function c(e){if(![].concat(e).every(e=>i$1.string.isString(e)&&!i$1.string.isEmpty(e)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}return function(t){function o(e,t){c(e);const n=a(e,r.default,t);return i$1.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i$1.stream.merge(r)}var l,f;t.glob=t,t.globSync=o,t.globStream=u,t.async=t,t.sync=o,t.stream=u,t.generateTasks=function(t,n){c(t);const r=[].concat(t),i=new s.default(n);return e.generate(r,i)},t.isDynamicPattern=function(e,t){c(e);const n=new s.default(t);return i$1.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i$1.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i$1.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i$1.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i$1.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i$1.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i$1.path.convertWindowsPathToPattern(e)};}(o||(o={})),oh=o}(),ph=U(fh);var hh=function(){if(lh)return uh;lh=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return uh=function(e,a){Object.assign({flipBackslashes:true},a).flipBackslashes&&n&&e.indexOf(r)<0&&(e=e.replace(s,r)),function(e){var t;switch(e.slice(-1)){case "}":t="{";break;case "]":t="[";break;default:return false}var n=e.indexOf(t);if(n<0)return false;return e.slice(n+1,-1).includes(r)}(e)&&(e+=r),e+="a";do{e=t(e);}while(o(e));return e.replace(i,"$1")}}(),dh=U(hh);const gh=e=>""!==e&&".."!==e,mh=e=>{if("string"!=typeof e||!e.trim())return null;const t=e.trim().replace(/[^A-Za-z0-9@/_-]/g,"_").replace(/\/{2,}/g,"/").trim().split("/").filter(e=>e.length>0);if(0===t.length)return null;for(const e of t)if(!gh(e))return null;return t.join("/")},yh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},vh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=de(t,n),o=path.join(i.rootAbs,"imports");await ensureDir(o);const a=Object.keys(r).sort();for(const e of a){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const a=path.join(o,i);await rm(a,{recursive:true,force:true}).catch(()=>{}),await ensureDir(a).catch(()=>{});const u=[];for(const e of n){const n=String(e??"").trim();if(!n)continue;const r=dh(n.replace(/\\/g,"/"));try{const e=await ph(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await yh(n))continue;const e=path.relative(path.isAbsolute(r)?r:path.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=path.join(a,e);await ensureDir(path.dirname(s)).catch(()=>{});try{await copyFile(n,s),u.push(s);}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>path.relative(t,e).replace(/\\/g,"/")));}}catch{}}},Sh=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return Ee({cwd:path.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=path.join(e,"dist","stan.system.md");return existsSync(n)?n:null};const kh="0.4.1";
4338
4352
 
4339
4353
  var index = /*#__PURE__*/Object.freeze({
4340
4354
  __proto__: null,
4341
- CORE_VERSION: wh,
4355
+ CORE_VERSION: kh,
4342
4356
  DEFAULT_OPEN_COMMAND: Ae,
4343
4357
  DEFAULT_STAN_PATH: Se,
4344
4358
  applyPatchPipeline: Iu,
@@ -4349,7 +4363,7 @@ var index = /*#__PURE__*/Object.freeze({
4349
4363
  ensureOutputDir: Xc,
4350
4364
  executeFileOps: Au,
4351
4365
  findConfigPathSync: Oe,
4352
- getPackagedSystemPromptPath: _h,
4366
+ getPackagedSystemPromptPath: Sh,
4353
4367
  loadConfig: Yc,
4354
4368
  loadConfigSync: Vc,
4355
4369
  parseFileOpsBlock: Su,
@@ -8024,6 +8038,7 @@ const cliDefaultsRunSchema = object({
8024
8038
  sequential: coerceBool,
8025
8039
  live: coerceBool,
8026
8040
  plan: coerceBool,
8041
+ facets: coerceBool,
8027
8042
  hangWarn: number().int().positive().optional(),
8028
8043
  hangKill: number().int().positive().optional(),
8029
8044
  hangKillGrace: number().int().positive().optional(),
@@ -11131,7 +11146,7 @@ function requireBinary () {
11131
11146
  if (hasRequiredBinary) return binary;
11132
11147
  hasRequiredBinary = 1;
11133
11148
 
11134
- var node_buffer = require$$0$1;
11149
+ var node_buffer = require$$0;
11135
11150
  var Scalar = requireScalar();
11136
11151
  var stringifyString = requireStringifyString();
11137
11152
 
@@ -16793,6 +16808,18 @@ const DBG_SCOPE_SNAP_CONTEXT_LEGACY = 'snap.context:legacy';
16793
16808
  * Load and validate stan-cli configuration from stan.config.*.
16794
16809
  * Strategy: prefer top-level "stan-cli"; temporary fallback to legacy top-level keys.
16795
16810
  */
16811
+ /** Phase‑2: accept legacy only when explicitly enabled by env. */
16812
+ const legacyAccepted$1 = () => {
16813
+ try {
16814
+ const v = String(process.env.STAN_ACCEPT_LEGACY ?? '')
16815
+ .trim()
16816
+ .toLowerCase();
16817
+ return v === '1' || v === 'true';
16818
+ }
16819
+ catch {
16820
+ return false;
16821
+ }
16822
+ };
16796
16823
  const formatZodError = (e) => e instanceof ZodError
16797
16824
  ? e.issues
16798
16825
  .map((i) => `${i.path.join('.') || '(root)'}: ${i.message}`)
@@ -16850,6 +16877,15 @@ const loadCliConfig = async (cwd) => {
16850
16877
  // Transitional: legacy top-level keys only (no "stan-cli")
16851
16878
  const legacy = pickLegacyCliSection(root);
16852
16879
  if (Object.keys(legacy).length > 0) {
16880
+ // Phase‑2 gate: require env to proceed with legacy acceptance.
16881
+ if (!legacyAccepted$1()) {
16882
+ const rel = cfgPath.replace(/\\/g, '/');
16883
+ throw new Error([
16884
+ `stan-cli: legacy configuration detected in ${rel} (missing top-level "stan-cli").`,
16885
+ `Run "stan init" to migrate your config (a .bak is written next to the file),`,
16886
+ `or set STAN_ACCEPT_LEGACY=1 to temporarily accept legacy keys during the transition.`,
16887
+ ].join(' '));
16888
+ }
16853
16889
  // Debug-visible notice to help users migrate via `stan init`
16854
16890
  debugFallback(DBG_SCOPE_CLI_CONFIG_LOAD, `using legacy top-level CLI keys from ${cfgPath.replace(/\\/g, '/')}; run "stan init" to migrate`);
16855
16891
  // Also emit the run-scoped legacy engine notice to satisfy transitional tests
@@ -16877,6 +16913,15 @@ const loadCliConfigSync = (cwd) => {
16877
16913
  }
16878
16914
  const legacy = pickLegacyCliSection(root);
16879
16915
  if (Object.keys(legacy).length > 0) {
16916
+ // Phase‑2 gate: require env to proceed with legacy acceptance.
16917
+ if (!legacyAccepted$1()) {
16918
+ const rel = cfgPath.replace(/\\/g, '/');
16919
+ throw new Error([
16920
+ `stan-cli: legacy configuration detected in ${rel} (missing top-level "stan-cli").`,
16921
+ `Run "stan init" to migrate your config (a .bak is written next to the file),`,
16922
+ `or set STAN_ACCEPT_LEGACY=1 to temporarily accept legacy keys during the transition.`,
16923
+ ].join(' '));
16924
+ }
16880
16925
  debugFallback(DBG_SCOPE_CLI_CONFIG_LOAD_SYNC, `using legacy top-level CLI keys from ${cfgPath.replace(/\\/g, '/')}; run "stan init" to migrate`);
16881
16926
  // Mirror the run-scoped legacy engine notice here as well for symmetry.
16882
16927
  if (!Object.prototype.hasOwnProperty.call(root, 'stan-core')) {
@@ -16998,6 +17043,41 @@ const updateDocsMetaPrompt = async (cwd, stanPath, prompt) => {
16998
17043
  await ensureDir(path.dirname(p));
16999
17044
  await writeFile(p, JSON.stringify(next, null, 2), 'utf8');
17000
17045
  };
17046
+ const updateDocsMetaOverlay = async (cwd, stanPath, overlay) => {
17047
+ const p = metaPath(cwd, stanPath);
17048
+ let base = {};
17049
+ try {
17050
+ const raw = await readFile(p, 'utf8');
17051
+ const v = JSON.parse(raw);
17052
+ if (v && typeof v === 'object')
17053
+ base = v;
17054
+ }
17055
+ catch {
17056
+ base = {};
17057
+ }
17058
+ const next = {
17059
+ ...base,
17060
+ overlay: {
17061
+ ...(base.overlay ?? {}),
17062
+ enabled: overlay.enabled,
17063
+ activated: overlay.activated ??
17064
+ base.overlay?.activated,
17065
+ deactivated: overlay.deactivated ??
17066
+ base.overlay?.deactivated,
17067
+ effective: overlay.effective ??
17068
+ base.overlay
17069
+ ?.effective,
17070
+ autosuspended: overlay.autosuspended ??
17071
+ base.overlay
17072
+ ?.autosuspended,
17073
+ anchorsKept: overlay.anchorsKept ??
17074
+ base.overlay
17075
+ ?.anchorsKept,
17076
+ },
17077
+ };
17078
+ await ensureDir(path.dirname(p));
17079
+ await writeFile(p, JSON.stringify(next, null, 2), 'utf8');
17080
+ };
17001
17081
 
17002
17082
  /** src/stan/version.ts
17003
17083
  * Version and docs/baseline status helpers for CLI printing and preflight checks.
@@ -17290,6 +17370,8 @@ const runDefaults = (dir = cwdSafe()) => {
17290
17370
  : 'auto';
17291
17371
  // Plan header default: true unless explicitly overridden in cliDefaults.run.plan
17292
17372
  const plan = typeof runIn.plan === 'boolean' ? runIn.plan : true;
17373
+ // Overlay default: off unless cliDefaults.run.facets is true
17374
+ const facets = typeof runIn.facets === 'boolean' ? Boolean(runIn.facets) : false;
17293
17375
  return {
17294
17376
  archive: pickBool('archive'),
17295
17377
  combine: pickBool('combine'),
@@ -17301,6 +17383,7 @@ const runDefaults = (dir = cwdSafe()) => {
17301
17383
  hangKill: pickNum('hangKill', RUN_BASE_DEFAULTS.hangKill),
17302
17384
  hangKillGrace: pickNum('hangKillGrace', RUN_BASE_DEFAULTS.hangKillGrace),
17303
17385
  prompt,
17386
+ facets,
17304
17387
  };
17305
17388
  };
17306
17389
 
@@ -17359,6 +17442,10 @@ const ensureStanGitignore = async (cwd, stanPath) => {
17359
17442
  `${rel('diff')}/`,
17360
17443
  `${rel('dist')}/`,
17361
17444
  `${rel('patch')}/`,
17445
+ // System files: ephemeral state/metadata should never be committed.
17446
+ // Keep these gitignored explicitly (and add deterministically if absent).
17447
+ `${rel('system/facet.state.json')}`,
17448
+ `${rel('system/.docs.meta.json')}`,
17362
17449
  ];
17363
17450
  let gi = existsSync(giPath) ? await readFile(giPath, 'utf8') : '';
17364
17451
  const existing = new Set(gi.split(/\r?\n/).map((l) => l.trim()));
@@ -17392,7 +17479,7 @@ const readPackageJsonScripts = async (cwd) => {
17392
17479
  };
17393
17480
  /** Ask user for config values; preserve script set optionally. */
17394
17481
  const promptForConfig = async (cwd, pkgScripts, defaults, preserveScriptsFromDefaults) => {
17395
- const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
17482
+ const { default: inquirer } = (await import('./index-CoyGQCX9.js'));
17396
17483
  const scriptKeys = Object.keys(pkgScripts);
17397
17484
  const defaultSelected = defaults?.scripts
17398
17485
  ? Object.keys(defaults.scripts).filter((k) => scriptKeys.includes(k))
@@ -17563,7 +17650,7 @@ const maybeMigrateLegacyToNamespaced = async (base, existingPath, opts) => {
17563
17650
  let proceed = Boolean(opts?.force);
17564
17651
  if (!proceed && legacyPresent) {
17565
17652
  try {
17566
- const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
17653
+ const { default: inquirer } = (await import('./index-CoyGQCX9.js'));
17567
17654
  const ans = (await inquirer.prompt([
17568
17655
  {
17569
17656
  type: 'confirm',
@@ -17900,7 +17987,7 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
17900
17987
  else {
17901
17988
  try {
17902
17989
  if (!dryRun) {
17903
- const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
17990
+ const { default: inquirer } = (await import('./index-CoyGQCX9.js'));
17904
17991
  const ans = (await inquirer.prompt([
17905
17992
  {
17906
17993
  type: 'confirm',
@@ -19307,6 +19394,18 @@ const normalizeImports = (raw) => {
19307
19394
  }
19308
19395
  return Object.keys(out).length ? out : undefined;
19309
19396
  };
19397
+ /** Phase‑2: accept legacy engine shape only when explicitly enabled by env. */
19398
+ const legacyAccepted = () => {
19399
+ try {
19400
+ const v = String(process.env.STAN_ACCEPT_LEGACY ?? '')
19401
+ .trim()
19402
+ .toLowerCase();
19403
+ return v === '1' || v === 'true';
19404
+ }
19405
+ catch {
19406
+ return false;
19407
+ }
19408
+ };
19310
19409
  /**
19311
19410
  * Resolve effective engine ContextConfig with a legacy extractor.
19312
19411
  *
@@ -19344,6 +19443,16 @@ const resolveEffectiveEngineConfig = async (cwd, debugScope = DBG_SCOPE_EFFECTIV
19344
19443
  })();
19345
19444
  return { stanPath };
19346
19445
  }
19446
+ // Phase‑2 gate: config file exists but top‑level "stan-core" is missing.
19447
+ // Accept legacy only when env allows; otherwise fail early with clear guidance.
19448
+ if (!legacyAccepted()) {
19449
+ const rel = p.replace(/\\/g, '/');
19450
+ throw new Error([
19451
+ `stan: legacy engine configuration detected in ${rel} (missing top-level "stan-core").`,
19452
+ `Run "stan init" to migrate your config,`,
19453
+ `or set STAN_ACCEPT_LEGACY=1 to temporarily accept legacy keys during the transition.`,
19454
+ ].join(' '));
19455
+ }
19347
19456
  // Legacy root keys extractor (transitional)
19348
19457
  const stanPathRaw = root['stanPath'];
19349
19458
  const stanPath = typeof stanPathRaw === 'string' && stanPathRaw.trim().length
@@ -19384,6 +19493,140 @@ const resolveEffectiveEngineConfig = async (cwd, debugScope = DBG_SCOPE_EFFECTIV
19384
19493
  return { stanPath: stanPathFallback };
19385
19494
  };
19386
19495
 
19496
+ // src/runner/overlay/facets.ts
19497
+ const posix = (p) => p.replace(/\\+/g, '/').replace(/^\.\/+/, '');
19498
+ const toAbs = (cwd, rel) => path.join(cwd, rel);
19499
+ const safeReadJson = async (abs) => {
19500
+ try {
19501
+ const raw = await readFile(abs, 'utf8');
19502
+ const v = JSON.parse(raw);
19503
+ return (v && typeof v === 'object' ? v : null) ?? null;
19504
+ }
19505
+ catch {
19506
+ return null;
19507
+ }
19508
+ };
19509
+ const stripGlobTail = (s) => {
19510
+ // Normalize common subtree globs; keep simple semantics for ramp-up safety roots.
19511
+ let out = s.trim();
19512
+ if (out.endsWith('/**'))
19513
+ out = out.slice(0, -3);
19514
+ if (out.endsWith('/*'))
19515
+ out = out.slice(0, -2);
19516
+ return posix(out).replace(/\/+$/, ''); // drop trailing slash
19517
+ };
19518
+ const isUnder = (childRel, root) => {
19519
+ const c = posix(childRel);
19520
+ const r = posix(root);
19521
+ return c === r || c.startsWith(r.length ? r + '/' : '');
19522
+ };
19523
+ const readFacetMeta = async (cwd, stanPath) => {
19524
+ const abs = toAbs(cwd, path.join(stanPath, 'system', 'facet.meta.json'));
19525
+ const meta = await safeReadJson(abs);
19526
+ return meta ?? {};
19527
+ };
19528
+ const readFacetState = async (cwd, stanPath) => {
19529
+ const abs = toAbs(cwd, path.join(stanPath, 'system', 'facet.state.json'));
19530
+ const st = await safeReadJson(abs);
19531
+ return st ?? {};
19532
+ };
19533
+ /**
19534
+ * Compute the effective overlay (excludes + anchors) for this run.
19535
+ * - Per-run overrides take precedence over state; missing facets default active.
19536
+ * - Naked -f sets overlay ON with all facets active (no hiding).
19537
+ * - Ramp-up safety: if an inactive facet has no anchor present under any of its
19538
+ * excluded subtree roots, aut0-suspend the drop (treat as active) and report it.
19539
+ */
19540
+ const computeFacetOverlay = async (input) => {
19541
+ const { cwd, stanPath } = input;
19542
+ const meta = await readFacetMeta(cwd, stanPath);
19543
+ const state = await readFacetState(cwd, stanPath);
19544
+ const facetNames = Object.keys(meta);
19545
+ // Base effective map from state (missing facets => active by default).
19546
+ const effective = {};
19547
+ for (const name of facetNames) {
19548
+ effective[name] = typeof state[name] === 'boolean' ? state[name] : true;
19549
+ }
19550
+ // Apply per-run overrides
19551
+ if (Array.isArray(input.activate)) {
19552
+ for (const n of input.activate)
19553
+ effective[n] = true;
19554
+ }
19555
+ if (Array.isArray(input.deactivate)) {
19556
+ for (const n of input.deactivate)
19557
+ effective[n] = false;
19558
+ }
19559
+ if (input.nakedActivateAll) {
19560
+ for (const n of facetNames)
19561
+ effective[n] = true;
19562
+ }
19563
+ const anchorsOverlaySet = new Set();
19564
+ const excludesOverlayArr = [];
19565
+ const autosuspended = [];
19566
+ const anchorsKeptCounts = {};
19567
+ // Always include all anchors (keep docs breadcrumbs visible even when overlay off)
19568
+ for (const name of facetNames) {
19569
+ const inc = (meta[name]?.include ?? []).map(posix);
19570
+ anchorsKeptCounts[name] = 0;
19571
+ for (const a of inc) {
19572
+ anchorsOverlaySet.add(a);
19573
+ }
19574
+ }
19575
+ // If overlay disabled, do not add any excludes, but still report anchorsKept counts.
19576
+ if (!input.enabled) {
19577
+ // Count anchors that exist physically for metadata
19578
+ for (const name of facetNames) {
19579
+ const inc = (meta[name]?.include ?? []).map(posix);
19580
+ anchorsKeptCounts[name] = inc.filter((a) => existsSync(toAbs(cwd, a))).length;
19581
+ }
19582
+ return {
19583
+ enabled: false,
19584
+ excludesOverlay: [],
19585
+ anchorsOverlay: Array.from(anchorsOverlaySet),
19586
+ effective,
19587
+ autosuspended,
19588
+ anchorsKeptCounts,
19589
+ };
19590
+ }
19591
+ // Ramp-up safety + excludes aggregation
19592
+ for (const name of facetNames) {
19593
+ const isActive = effective[name] !== false;
19594
+ const exRoots = (meta[name]?.exclude ?? [])
19595
+ .map(stripGlobTail)
19596
+ .filter(Boolean);
19597
+ const inc = (meta[name]?.include ?? []).map(posix);
19598
+ // Count anchors present on disk (for metadata)
19599
+ anchorsKeptCounts[name] = inc.filter((a) => existsSync(toAbs(cwd, a))).length;
19600
+ if (isActive) {
19601
+ continue; // no drop for this facet
19602
+ }
19603
+ // Check if any include anchor exists under an excluded root
19604
+ const hasAnchorUnderRoot = inc.length > 0 &&
19605
+ exRoots.some((root) => inc.some((a) => isUnder(a, root) && existsSync(toAbs(cwd, a))));
19606
+ if (!hasAnchorUnderRoot) {
19607
+ // Auto-suspend this facet's drop for this run
19608
+ effective[name] = true;
19609
+ autosuspended.push(name);
19610
+ continue;
19611
+ }
19612
+ // Aggregate excludes for truly inactive facets with anchors present
19613
+ for (const root of exRoots) {
19614
+ if (root)
19615
+ excludesOverlayArr.push(root.endsWith('/') ? root : root);
19616
+ }
19617
+ }
19618
+ // Deduplicate anchors overlay
19619
+ const anchorsOverlay = Array.from(anchorsOverlaySet);
19620
+ return {
19621
+ enabled: true,
19622
+ excludesOverlay: excludesOverlayArr,
19623
+ anchorsOverlay,
19624
+ effective,
19625
+ autosuspended,
19626
+ anchorsKeptCounts,
19627
+ };
19628
+ };
19629
+
19387
19630
  // src/stan/run/plan.ts
19388
19631
  /**
19389
19632
  * Render a readable, multi‑line summary of the run plan (pure).
@@ -19418,6 +19661,10 @@ const renderRunPlan = (cwd, args) => {
19418
19661
  `hang kill grace: ${typeof behavior.hangKillGrace === 'number'
19419
19662
  ? behavior.hangKillGrace.toString()
19420
19663
  : 'n/a'}s`,
19664
+ // Optional Facet view (supplied by action via RunnerConfig.overlayPlan)
19665
+ ...(Array.isArray(config.overlayPlan) && config.overlayPlan.length
19666
+ ? ['facet view:', ...config.overlayPlan.map((l) => ` ${l}`)]
19667
+ : []),
19421
19668
  ];
19422
19669
  return `stan:\n ${lines.join('\n ')}`;
19423
19670
  };
@@ -26901,7 +27148,7 @@ function requireTreeKill () {
26901
27148
  if (hasRequiredTreeKill) return treeKill$1;
26902
27149
  hasRequiredTreeKill = 1;
26903
27150
 
26904
- var childProcess = require$$0$2;
27151
+ var childProcess = require$$0$1;
26905
27152
  var spawn = childProcess.spawn;
26906
27153
  var exec = childProcess.exec;
26907
27154
 
@@ -27204,6 +27451,7 @@ const archivePhase = async (args, opts) => {
27204
27451
  includeOutputDir: includeOutputs,
27205
27452
  includes: config.includes ?? [],
27206
27453
  excludes: config.excludes ?? [],
27454
+ anchors: config.anchors ?? [],
27207
27455
  });
27208
27456
  opts?.progress?.done?.('full', archivePath, startedFull, Date.now());
27209
27457
  if (!silent) {
@@ -27222,6 +27470,7 @@ const archivePhase = async (args, opts) => {
27222
27470
  baseName: 'archive',
27223
27471
  includes: config.includes ?? [],
27224
27472
  excludes: config.excludes ?? [],
27473
+ anchors: config.anchors ?? [],
27225
27474
  updateSnapshot: 'createIfMissing',
27226
27475
  includeOutputDirInDiff: includeOutputs,
27227
27476
  });
@@ -27268,7 +27517,7 @@ const archivePrintable = (kind) => {
27268
27517
  const resolveCorePromptPath = () => {
27269
27518
  // Primary: engine helper
27270
27519
  try {
27271
- const p = _h();
27520
+ const p = Sh();
27272
27521
  if (p && existsSync(p))
27273
27522
  return p;
27274
27523
  }
@@ -27367,7 +27616,7 @@ const resolvePromptSource = (cwd, stanPath, choice) => {
27367
27616
  }
27368
27617
  return {
27369
27618
  abs: coreAbs,
27370
- display: `@karmaniverous/stan-core@${wh}`,
27619
+ display: `@karmaniverous/stan-core@${kh}`,
27371
27620
  kind: 'core',
27372
27621
  };
27373
27622
  }
@@ -27384,7 +27633,7 @@ const resolvePromptSource = (cwd, stanPath, choice) => {
27384
27633
  if (coreAbs && existsSync(coreAbs)) {
27385
27634
  return {
27386
27635
  abs: coreAbs,
27387
- display: `@karmaniverous/stan-core@${wh}`,
27636
+ display: `@karmaniverous/stan-core@${kh}`,
27388
27637
  kind: 'core',
27389
27638
  };
27390
27639
  }
@@ -27481,6 +27730,7 @@ const runArchiveStage = async (args) => {
27481
27730
  includes: config.includes ?? [],
27482
27731
  excludes: config.excludes ?? [],
27483
27732
  imports: config.imports,
27733
+ anchors: config.anchors ?? [],
27484
27734
  };
27485
27735
  const progress = {
27486
27736
  start: (k) => ui.onArchiveStart(k),
@@ -29789,16 +30039,6 @@ const registerRunAction = (cmd, getFlagPresence) => {
29789
30039
  const config = await resolveEffectiveEngineConfig(runCwd, 'run.action:engine-legacy');
29790
30040
  // CLI defaults and scripts for runner config/derivation
29791
30041
  const cliCfg = loadCliConfigSync(runCwd);
29792
- const runnerConfig = {
29793
- stanPath: config.stanPath,
29794
- scripts: cliCfg.scripts,
29795
- // Propagate selection context for the archive phase (legacy-friendly).
29796
- // These originate from the resolved engine ContextConfig above, which may
29797
- // be synthesized from legacy root keys during the transitional window.
29798
- includes: config.includes ?? [],
29799
- excludes: config.excludes ?? [],
29800
- imports: config.imports,
29801
- };
29802
30042
  // Loop header + reversal guard
29803
30043
  try {
29804
30044
  const st = await readLoopState(runCwd, config.stanPath);
@@ -29829,15 +30069,110 @@ const registerRunAction = (cmd, getFlagPresence) => {
29829
30069
  scripts: cliCfg.scripts,
29830
30070
  scriptsDefault: cliCfg.cliDefaults?.run?.scripts,
29831
30071
  });
30072
+ // Facet overlay — determine defaults and per-run overrides (renamed flags)
30073
+ const eff = runDefaults(runCwd);
30074
+ const src = cmd;
30075
+ const fromCli = (n) => src.getOptionValueSource?.(n) === 'cli';
30076
+ // -f, --facets [names...] → overlay ON; activate listed facets; naked -f = all active
30077
+ // -F, --no-facets [names...] → overlay ON; deactivate listed facets; naked -F = overlay OFF
30078
+ const toStringArray = (v) => Array.isArray(v)
30079
+ ? v.filter((x) => typeof x === 'string')
30080
+ : [];
30081
+ const facetsOpt = options.facets;
30082
+ const noFacetsOpt = options.noFacets;
30083
+ const activateNames = toStringArray(facetsOpt);
30084
+ const deactivateNames = toStringArray(noFacetsOpt);
30085
+ const facetsProvided = fromCli('facets');
30086
+ const noFacetsProvided = fromCli('noFacets');
30087
+ const nakedActivateAll = facetsProvided && activateNames.length === 0;
30088
+ // Determine overlay enablement with new semantics
30089
+ let overlayEnabled = eff.facets;
30090
+ if (facetsProvided) {
30091
+ overlayEnabled = true;
30092
+ }
30093
+ if (noFacetsProvided) {
30094
+ overlayEnabled = deactivateNames.length === 0 ? false : true;
30095
+ }
30096
+ // Compute overlay for plan + engine inputs
30097
+ let overlay = null;
30098
+ try {
30099
+ overlay = await computeFacetOverlay({
30100
+ cwd: runCwd,
30101
+ stanPath: config.stanPath,
30102
+ enabled: overlayEnabled,
30103
+ activate: activateNames.length ? activateNames : undefined,
30104
+ deactivate: deactivateNames.length ? deactivateNames : undefined,
30105
+ nakedActivateAll,
30106
+ });
30107
+ }
30108
+ catch {
30109
+ overlay = {
30110
+ enabled: overlayEnabled,
30111
+ excludesOverlay: [],
30112
+ anchorsOverlay: [],
30113
+ effective: {},
30114
+ autosuspended: [],
30115
+ anchorsKeptCounts: {},
30116
+ };
30117
+ }
30118
+ const runnerConfig = {
30119
+ stanPath: config.stanPath,
30120
+ scripts: cliCfg.scripts,
30121
+ // Propagate selection context for the archive phase (legacy-friendly).
30122
+ // These originate from the resolved engine ContextConfig above, which may
30123
+ // be synthesized from legacy root keys during the transitional window.
30124
+ includes: config.includes ?? [],
30125
+ excludes: [
30126
+ ...(config.excludes ?? []),
30127
+ ...((overlay?.enabled ? overlay.excludesOverlay : []) ?? []),
30128
+ ],
30129
+ imports: config.imports,
30130
+ // High-precedence re-includes (core enforces reserved denials/binary screen)
30131
+ ...(overlay?.anchorsOverlay?.length
30132
+ ? { anchors: overlay.anchorsOverlay }
30133
+ : {}),
30134
+ // Optional facet view lines for the plan
30135
+ overlayPlan: (() => {
30136
+ if (!overlay)
30137
+ return undefined;
30138
+ const lines = [];
30139
+ lines.push(`overlay: ${overlay.enabled ? 'on' : 'off'}`);
30140
+ if (overlay.enabled) {
30141
+ const inactive = Object.entries(overlay.effective)
30142
+ .filter(([, v]) => v === false)
30143
+ .map(([k]) => k);
30144
+ const auto = overlay.autosuspended;
30145
+ const anchorsTotal = Object.values(overlay.anchorsKeptCounts).reduce((a, b) => a + b, 0);
30146
+ lines.push(`facets inactive: ${inactive.length ? inactive.join(', ') : 'none'}`);
30147
+ if (auto.length)
30148
+ lines.push(`auto-suspended: ${auto.join(', ')}`);
30149
+ lines.push(`anchors kept: ${anchorsTotal.toString()}`);
30150
+ }
30151
+ return lines;
30152
+ })(),
30153
+ };
29832
30154
  const planBody = renderRunPlan(runCwd, {
29833
30155
  selection: derived.selection,
29834
30156
  config: runnerConfig,
29835
30157
  mode: derived.mode,
29836
30158
  behavior: derived.behavior,
29837
30159
  });
29838
- // Resolve plan semantics:
29839
30160
  const planOpt = options.plan;
29840
30161
  const noPlanFlag = Boolean(options.noPlan);
30162
+ // Persist overlay metadata (best-effort)
30163
+ try {
30164
+ await updateDocsMetaOverlay(runCwd, config.stanPath, {
30165
+ enabled: overlay?.enabled ?? false,
30166
+ activated: activateNames,
30167
+ deactivated: deactivateNames,
30168
+ effective: overlay?.effective,
30169
+ autosuspended: overlay?.autosuspended,
30170
+ anchorsKept: overlay?.anchorsKeptCounts,
30171
+ });
30172
+ }
30173
+ catch {
30174
+ /* best-effort */
30175
+ }
29841
30176
  // Default print-plan behavior from config
29842
30177
  // DRY: derive from runDefaults so runtime and help tagging share the same source.
29843
30178
  const defaultPrintPlan = runDefaults(runCwd).plan;
@@ -29973,6 +30308,17 @@ const registerRunOptions = (cli) => {
29973
30308
  optHangWarn.default(eff.hangWarn);
29974
30309
  optHangKill.default(eff.hangKill);
29975
30310
  optHangKillGrace.default(eff.hangKillGrace);
30311
+ // Facet overlay (renamed)
30312
+ // -f, --facets [names...] → overlay ON; activate specific facets; naked -f = all facets active
30313
+ // -F, --no-facets [names...] → overlay ON; deactivate specific facets; naked -F = overlay OFF
30314
+ const optFacets = new Option('-f, --facets [names...]', 'activate specific facets for this run (naked form treats all facets active)');
30315
+ const optNoFacets = new Option('-F, --no-facets [names...]', 'deactivate facets for this run (naked form disables overlay)');
30316
+ // Tag default overlay state from cliDefaults.run.facets
30317
+ tagDefault(eff.facets ? optFacets : optNoFacets);
30318
+ cmd.addOption(optFacets).addOption(optNoFacets);
30319
+ // Overlay event presence (action resolves behavior)
30320
+ cmd.on('option:facets', () => void 0);
30321
+ cmd.on('option:no-facets', () => void 0);
29976
30322
  // Help footer
29977
30323
  cmd.addHelpText('after', () => renderAvailableScriptsHelp(process.cwd()));
29978
30324
  return {
@@ -30695,4 +31041,4 @@ const makeCli = () => {
30695
31041
  // to avoid file/folder name conflicts and follow the decomposition policy.
30696
31042
  void makeCli().parseAsync();
30697
31043
 
30698
- export { requireColorConvert as a, getDefaultExportFromCjs as g, onExit as o, requireEmojiRegex as r };
31044
+ export { requireEmojiRegex as a, requireColorConvert as b, getDefaultExportFromCjs as g, onExit as o, requireIsFullwidthCodePoint as r };