@karmaniverous/stan-cli 0.11.7 → 0.12.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/README.md +16 -16
- package/dist/cjs/classifier-Bqzr65UC-D9z0tWqn.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cli/{capture-DKrVoDyl.js → capture-CiVimFuL.js} +1 -1
- package/dist/cli/classifier-Bqzr65UC-BlsMFS8t.js +7 -0
- package/dist/cli/{config-fallback-CV720XTz.js → config-fallback-CL_TDiMw.js} +1 -1
- package/dist/cli/{context-PS5ukh8q.js → context-BzEQ3A1v.js} +1 -1
- package/dist/cli/{index-Cq8YEju6.js → index-DXJaQ46Q.js} +1236 -867
- package/dist/cli/stan.js +904 -170
- package/dist/mjs/classifier-Bqzr65UC-DJLYQY2b.js +1 -0
- package/dist/mjs/index.js +1 -1
- package/dist/types/index.d.ts +30 -2
- package/package.json +27 -27
- package/dist/cjs/classifier-DeYwffC_-CjzCgatc.js +0 -1
- package/dist/cli/classifier-DeYwffC_-DftahF7h.js +0 -7
- package/dist/mjs/classifier-DeYwffC_-C7wwqop3.js +0 -1
package/dist/cli/stan.js
CHANGED
|
@@ -3,7 +3,7 @@ import c, { readFileSync, existsSync, rmSync, createWriteStream } from 'node:fs'
|
|
|
3
3
|
import { readFile, copyFile, readdir, writeFile, stat, mkdir, rm, realpath, appendFile } from 'node:fs/promises';
|
|
4
4
|
import path, { dirname, resolve, join, delimiter } from 'node:path';
|
|
5
5
|
import { ensureDir, pathExists, move, remove } from 'fs-extra';
|
|
6
|
-
import process$
|
|
6
|
+
import process$3 from 'node:process';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import w from 'process';
|
|
9
9
|
import require$$0 from 'buffer';
|
|
@@ -23,7 +23,7 @@ import clipboardy from 'clipboardy';
|
|
|
23
23
|
import require$$0$2 from 'child_process';
|
|
24
24
|
import { createRequire } from 'node:module';
|
|
25
25
|
|
|
26
|
-
const T="archive.tar",P="archive.prev.tar",L=e=>e.replace(/\\/g,"/"),N=(e,t)=>{const n=L(e).replace(/\/+$/,""),r=L(t);return r===n||r.startsWith(`${n}/`)},I=(e,t)=>{const n=L(e);return N(`${n}/diff`,t)||N(`${n}/patch`,t)},M=N,D=e=>{const t=e.replace(/\\/g,"/");return e=>!(I(t,e)||((e,t)=>{const n=L(e);return L(t)===`${n}/output/${T}`||L(t)===`${n}/output/archive.diff.tar`||L(t)===`${n}/output/archive.warnings.txt`})(t,e))},j=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},H=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);};var F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,K={exports:{}};var U,q,Z,W,G,V,Y,Q,J,X,ee,te=(z||(z=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,m=[[/^\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}(?=$|\\/$)`]],g=/(^|\\\/)?\\\*$/,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(g,_[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=>m.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 O{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 $=e=>new O(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=$,$.default=$,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(K)),K.exports),ne=B(te),re={};function se(){if(q)return U;q=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 U={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 ie(){return Z||(Z=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=se();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};}(re)),re}function oe(){if(G)return W;G=1;const e=ie(),{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:m}=se(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return W=(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=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===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(O!==a){if(true!==b.noext){if(true===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){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!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=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,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(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,g(O)||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},W}function ae(){if(Y)return V;Y=1;const e=se(),t=ie(),{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 m={type:"bos",value:"",output:p.prepend||""},g=[m],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:O,QMARK:$,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?$: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:g};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],H=[];let F,B=m;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,g.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?$.repeat(i.length):""):0===o?N+(i?$.repeat(i.length):""):$.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(),m.output||1!==g.indexOf(B)||(m.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=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.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="",g.pop(),B=m;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:$});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+=O,B.output+=O):(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:m,STAR:g,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?m:h,b=i.capture?"":"?:";let w=true===i.bash?".*?":g;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},V=u}function ce(){if(J)return Q;J=1;const e=oe(),t=ae(),n=ie(),r=se(),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,Q=s}function ue(){if(ee)return X;ee=1;const e=ce(),t=ie();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),X=n}var le=B(ue());const fe=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),i=resolve(e,r),o=await readdir(i,{withFileTypes:true});for(const e of o){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t},pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},he=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>pe(e,t):()=>false;var n;const r=le(t,{dot:true});return e=>r(e)},de=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=ne();return t.add(e),t}catch{return null}})(n),h=[e=>pe(e,"node_modules"),e=>pe(e,".git"),...f?[e=>f.ignores(e)]:[],...a.map(he),...l.map(e=>t=>pe(t,e)),e=>I(u,e)];s||h.push(e=>M(`${u}/output`,e));const d=e.filter(e=>!h.some(t=>t(e)));if(o.length>0){const t=o.map(he),n=[e=>I(u,e),...s?[]:[e=>M(`${u}/output`,e)]],r=new Set(d);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(he),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(he);for(const n of e){!(I(u,n)||!s&&M(`${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(he),n=new Set(d);for(const r of e){!(I(u,r)||!s&&M(`${u}/output`,r))&&t.some(e=>e(r))&&n.add(r);}return e.filter(e=>n.has(e))}return d},me=async(e,t)=>{const n=(await(async()=>{try{const e=await Promise.resolve().then(function(){return Qc}),t=e.makeStanDirs,n=e.default?.makeStanDirs,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("makeStanDirs export not found in ./paths")})())(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}},ge=async(e,t)=>{const n=await me(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}},ye=async(e,n,r={})=>{const{includeOutputDir:s=false,fileName:i,includes:a=[],excludes:c=[],anchors:u=[]}=r;let l=i??"archive.tar";l.endsWith(".tar")||(l+=".tar");const{outDir:f,diffDir:h}=await ge(e,n),d=await fe(e),m=await de(d,{cwd:e,stanPath:n,includeOutputDir:s,includes:a,excludes:c,anchors:u}),g=resolve(f,l),y=resolve(h,P);if(existsSync(g))try{await copyFile(g,y);}catch{}const v=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:_,warningsBody:b}=await v(e,m),w=_;H(b,r.onArchiveWarnings);const S=await import('./index-ucZa1KMb-CNGeWGvV.js');if(s?await S.create({file:g,cwd:e,filter:D(n)},j(w,n)):await S.create({file:g,cwd:e,filter:D(n)},w),!existsSync(y))try{await copyFile(g,y);}catch{}return g},ve=".stan",_e="code -g {file}",be=e=>e instanceof URL?fileURLToPath(e):e;function we({cwd:t}={}){const n=function(t,{cwd:n=process$2.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(be(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,be(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 Se=["stan.config.yml","stan.config.yaml","stan.config.json"],Ae=e=>{for(const n of Se){const r=resolve(e,n);if(existsSync(r))return r}return null},ke=e=>{const t=Ae(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=we({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ae(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Ee,xe={},Oe={},$e={},Re={};function Ce(){if(Ee)return Re;Ee=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 Re.ALIAS=e,Re.DOC=t,Re.MAP=n,Re.NODE_TYPE=o,Re.PAIR=r,Re.SCALAR=s,Re.SEQ=i,Re.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Re.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Re.isCollection=c,Re.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Re.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Re.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Re.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Re.isScalar=a,Re.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Re}var Te,Pe,Le={};function Ne(){if(Te)return Le;Te=1;var e=Ce();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,Le.visit=s,Le.visitAsync=o,Le}function Ie(){if(Pe)return $e;Pe=1;var e=Ce(),t=Ne();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:"},$e.Directives=s,$e}var Me,De={},je={},He={};function Fe(){if(Me)return He;Me=1;var e=Ce(),t=Ne();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 He.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},He.anchorNames=n,He.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}},He.findNewAnchor=r,He}var Be,ze={},Ke={};function Ue(){if(Be)return Ke;return Be=1,Ke.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)},Ke}var qe,Ze,We,Ge={};function Ve(){if(qe)return Ge;qe=1;var e=Ce();return Ge.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)},Ge}function Ye(){if(Ze)return ze;Ze=1;var e=Ue(),t=Ce(),n=Ve();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 Qe(){if(We)return je;We=1;var e=Fe(),t=Ne(),n=Ce(),r=Ye(),s=Ve();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 je.Alias=i,je}var Je,Xe,et,tt={},nt={},rt={};function st(){if(Je)return rt;Je=1;var e=Ce(),t=Ye(),n=Ve();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",rt.Scalar=r,rt.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,rt}function it(){if(Xe)return nt;Xe=1;var e=Qe(),t=Ce(),n=st();return nt.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},nt}function ot(){if(et)return tt;et=1;var e=it(),t=Ce(),n=Ye();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 tt.Collection=i,tt.collectionFromPath=r,tt.isEmptyPath=s,tt}var at,ct={},ut={},lt={},ft={};function pt(){if(at)return ft;at=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ft.indentComment=e,ft.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ft.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ft}var ht,dt,mt,gt,yt={},vt={};function _t(){if(ht)return vt;ht=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 vt.FOLD_BLOCK=e,vt.FOLD_FLOW="flow",vt.FOLD_QUOTED=t,vt.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,m,g=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):g=a-o);let y=false,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(g=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)),g=v+s.length+f,d=void 0;else {if(" "===o&&m&&" "!==m&&"\n"!==m&&"\t"!==m){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v);}if(v>=g)if(d)p.push(d),g=d+f,d=void 0;else if(i===t){for(;" "===m||"\t"===m;)m=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,g=e+f,d=void 0;}else y=true;}m=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},vt}function bt(){if(dt)return yt;dt=1;var e=st(),t=_t();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 m=u.indent||(u.forceBlockIndent||r(c)?" ":""),g="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,m.length));if(!c)return g?"|\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,`$&${m}`));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,`$&${m}`));let E=(S?m?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!g){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);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}${_}`,m,t.FOLD_BLOCK,o);if(!s)return `>${E}\n${m}${a}`}return `|${E}\n${m}${k}${c=c.replace(/\n+/g,`$&${m}`)}${_}`}return yt.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:m}=a;m!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=e.Scalar.QUOTE_DOUBLE);const g=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:m,inFlow:g}=i;if(h&&f.includes("\n")||g&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||g||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!g&&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===m)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=g(m);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=g(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},yt}function wt(){if(mt)return lt;mt=1;var e=Fe(),t=Ce(),n=pt(),r=bt();return lt.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}},lt.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},lt}function St(){if(gt)return ut;gt=1;var e=Ce(),t=st(),n=wt(),r=pt();return ut.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:m}}=o;let g=e.isNode(s)&&s.comment||null;if(m){if(g)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=!m&&(!s||g&&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&&(m||!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(m)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&&!m||null==i&&y)return A=`? ${A}`,g&&!w?A+=r.lineComment(A,o.indent,h(g)):S&&c&&c(),A;w&&(g=null),y?(g&&(A+=r.lineComment(A,o.indent,h(g))),A=`? ${A}\n${f}:`):(A=`${A}:`,g&&(A+=r.lineComment(A,o.indent,h(g)))),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||g||!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(g||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},ut}var At,kt={},Et={};function xt(){if(At)return Et;At=1;var e=w;return Et.debug=function(e,...t){"debug"===e&&console.log(...t);},Et.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Et}var Ot,$t,Rt,Ct={};function Tt(){if(Ot)return Ct;Ot=1;var e=Ce(),t=st();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 Ct.addMergeToJSMap=s,Ct.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),Ct.merge=r,Ct}function Pt(){if($t)return kt;$t=1;var e=xt(),t=Tt(),n=wt(),r=Ce(),s=Ve();return kt.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},kt}function Lt(){if(Rt)return ct;Rt=1;var e=it(),t=St(),n=Pt(),r=Ce();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 ct.Pair=s,ct.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)},ct}var Nt,It,Mt,Dt={},jt={},Ht={},Ft={};function Bt(){if(Nt)return Ft;Nt=1;var e=Ce(),t=wt(),n=pt();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 m=false;const g=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!m&&c.spaceBefore&&g.push(""),i(o,g,c.commentBefore,m),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!m&&t.spaceBefore&&g.push(""),i(o,g,t.commentBefore,m));}m=false;let f=t.stringify(c,d,()=>l=null,()=>m=true);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=false),g.push(a+f);}let y;if(0===g.length)y=c.start+c.end;else {y=g[0];for(let e=1;e<g.length;++e){const t=g[e];y+=t?`\n${p}${t}`:"\n";}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):m&&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 m=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&m.push(""),i(s,m,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&&m.push(""),i(s,m,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&&(m.length>d||l.includes("\n"))&&(h=true),m.push(l),d=m.length;}const{start:g,end:y}=o;if(0===m.length)return g+y;if(!h){const e=m.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth;}if(h){let e=g;for(const t of m)e+=t?`\n${u}${c}${t}`:"\n";return `${e}\n${c}${y}`}return `${g}${l}${m.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 Ft.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ft}function zt(){if(It)return Ht;It=1;var e=Bt(),t=Pt(),n=ot(),r=Ce(),s=Lt(),i=st();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 Ht.YAMLMap=a,Ht.findPair=o,Ht}function Kt(){if(Mt)return jt;Mt=1;var e=Ce(),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 jt.map=n,jt}var Ut,qt,Zt={},Wt={};function Gt(){if(Ut)return Wt;Ut=1;var e=it(),t=Bt(),n=ot(),r=Ce(),s=st(),i=Ve();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 Wt.YAMLSeq=o,Wt}function Vt(){if(qt)return Zt;qt=1;var e=Ce(),t=Gt();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 Zt.seq=n,Zt}var Yt,Qt={};function Jt(){if(Yt)return Qt;Yt=1;var e=bt();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 Qt.string=t,Qt}var Xt,en={},tn={};function nn(){if(Xt)return tn;Xt=1;var e=st();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 tn.nullTag=t,tn}var rn,sn={};function on$1(){if(rn)return sn;rn=1;var e=st();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 sn.boolTag=t,sn}var an,cn,un={},ln={};function fn(){if(an)return ln;return an=1,ln.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},ln}function pn(){if(cn)return un;cn=1;var e=st(),t=fn();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 un.float=s,un.floatExp=r,un.floatNaN=n,un}var hn,dn={};function mn(){if(hn)return dn;hn=1;var e=fn();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 dn.int=i,dn.intHex=o,dn.intOct=s,dn}var gn,yn={};function vn(){if(gn)return yn;gn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn();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 yn.schema=a,yn}var _n,bn={};function wn(){if(_n)return bn;_n=1;var e=st(),t=Kt(),n=Vt();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 bn.schema=a,bn}var Sn,An={};function kn(){if(Sn)return An;Sn=1;var e=require$$0,t=st(),n=bt();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 An.binary=r,An}var En,xn,On={},$n={};function Rn(){if(En)return $n;En=1;var e=Ce(),t=Lt(),n=st(),r=Gt();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 $n.createPairs=i,$n.pairs=o,$n.resolvePairs=s,$n}function Cn(){if(xn)return On;xn=1;var e=Ce(),t=Ve(),n=zt(),r=Gt(),s=Rn();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 On.YAMLOMap=i,On.omap=o,On}var Tn,Pn={},Ln={};function Nn(){if(Tn)return Ln;Tn=1;var e=st();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 Ln.falseTag=r,Ln.trueTag=n,Ln}var In,Mn={};function Dn(){if(In)return Mn;In=1;var e=st(),t=fn();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 Mn.float=s,Mn.floatExp=r,Mn.floatNaN=n,Mn}var jn,Hn={};function Fn(){if(jn)return Hn;jn=1;var e=fn();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 Hn.int=o,Hn.intBin=s,Hn.intHex=a,Hn.intOct=i,Hn}var Bn,zn={};function Kn(){if(Bn)return zn;Bn=1;var e=Ce(),t=Lt(),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 Un,qn,Zn,Wn,Gn={};function Vn(){if(Un)return Gn;Un=1;var e=fn();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 Gn.floatTime=s,Gn.intTime=r,Gn.timestamp=i,Gn}function Yn(){if(qn)return Pn;qn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=kn(),i=Nn(),o=Dn(),a=Fn(),c=Tt(),u=Cn(),l=Rn(),f=Kn(),p=Vn();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 Pn.schema=h,Pn}function Qn(){if(Zn)return en;Zn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn(),a=vn(),c=wn(),u=kn(),l=Tt(),f=Cn(),p=Rn(),h=Yn(),d=Kn(),m=Vn();const g=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:m.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:m.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:m.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":m.timestamp};return en.coreKnownTags=v,en.getTags=function(e,t,n){const r=g.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(g.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},[])},en}function Jn(){if(Wn)return Dt;Wn=1;var e=Ce(),t=Kt(),n=Vt(),r=Jt(),s=Qn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Dt.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}},Dt}var Xn,er,tr={};function nr(){if(Xn)return tr;Xn=1;var e=Ce(),t=wt(),n=pt();return tr.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"},tr}function rr(){if(er)return De;er=1;var e=Qe(),t=ot(),n=Ce(),r=Lt(),s=Ve(),i=Jn(),o=nr(),a=Fe(),c=Ue(),u=it(),l=Ie();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return De.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:m}=a.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:i??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);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)}},De}var sr,ir={};function or(){if(sr)return ir;sr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ir.YAMLError=e,ir.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ir.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ir.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`;}},ir}var ar,cr={},ur={},lr={},fr={},pr={};function hr(){if(ar)return pr;return ar=1,pr.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,m=null,g=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),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case "space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(m=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,(g||y)&&(v=s),l=true;break;case "anchor":g&&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),g=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:(g||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"),m&&(u&&m.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:g,tag:y,newlineAfterProp:v,end:A,start:w??A}},pr}var dr,mr={};function gr(){if(dr)return mr;return dr=1,mr.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}},mr}var yr,vr={};function _r(){if(yr)return vr;yr=1;var e=gr();return vr.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);}}},vr}var br,wr,Sr={};function Ar(){if(br)return Sr;br=1;var e=Ce();return Sr.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))},Sr}function kr(){if(wr)return fr;wr=1;var e=Lt(),t=zt(),n=hr(),r=gr(),s=_r(),i=Ar();const o="All mapping items must start at the same column";return fr.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,m=null;for(const t of l.items){const{start:p,key:g,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:g??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:true}),b=!_.found;if(b){if(g&&("block-seq"===g.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){m=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(g))&&f(g??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=g?a(u,g,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,g,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:!g||"block-scalar"===g.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 m&&m<d&&f(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,m??d],h},fr}var Er,xr={};function Or(){if(Er)return xr;Er=1;var e=Gt(),t=hr(),n=_r();return xr.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},xr}var $r,Rr,Cr,Tr={},Pr={};function Lr(){if($r)return Pr;return $r=1,Pr.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}},Pr}function Nr(){if(Rr)return Tr;Rr=1;var e=Ce(),t=Lt(),n=zt(),r=Gt(),s=Lr(),i=hr(),o=gr(),a=Ar();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Tr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,m){const g="{"===h.start.source,y=g?"flow map":"flow sequence",v=new(m?.nodeClass??(g?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:m,key:_,sep:w,value:S}=s,A=i.resolveProps(m,{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}!g&&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 m)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(g||w||A.found){p.atKey=true;const e=A.end,r=_?l(p,_,A,d):f(p,e,m,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(!g&&!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),g){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=g?"}":"]",[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},Tr}function Ir(){if(Cr)return lr;Cr=1;var e=Ce(),t=st(),n=zt(),r=Gt(),s=kr(),i=Or(),o=Nr();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 lr.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),m=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,g=e.isNode(m)?m:new t.Scalar(m);return g.range=d.range,g.tag=f,h?.format&&(g.format=h.format),g},lr}var Mr,Dr={},jr={};function Hr(){if(Mr)return jr;Mr=1;var e=st();return jr.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 m=s+i.length+n.source.length;return {value:p,type:o,comment:i.comment,range:[s,m,m]}},jr}var Fr,Br,zr={};function Kr(){if(Fr)return zr;Fr=1;var e=st(),t=Lr();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 m=(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,m);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,m);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,m);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 g=u+f.length,y=t.resolveEnd(p,g,a,c);return {value:d,type:h,comment:y.comment,range:[u,g,y.offset]}},zr}function Ur(){if(Br)return Dr;Br=1;var e=Ce(),t=st(),n=Hr(),r=Kr();return Dr.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},Dr}var qr,Zr,Wr,Gr,Vr={};function Yr(){if(qr)return Vr;return qr=1,Vr.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},Vr}function Qr(){if(Zr)return ur;Zr=1;var e=Qe(),t=Ce(),n=Ir(),r=Ur(),s=Lr(),i=Yr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:m}=u;let g,y=true;switch(a.type){case "alias":g=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||m)&&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":g=r.composeScalar(i,a,m,l),d&&(g.anchor=d.source.substring(1));break;case "block-map":case "block-seq":case "flow-collection":g=n.composeCollection(o,i,a,u,l),d&&(g.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),g=c(i,a.offset,void 0,null,u,l),y=false;}if(d&&""===g.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(g)||"string"!=typeof g.value||g.tag&&"tag:yaml.org,2002:str"!==g.tag)){l(m??a,"NON_STRING_KEY","With stringKeys, all keys must be strings");}return p&&(g.spaceBefore=true),h&&("scalar"===a.type&&""===a.source?g.comment=h:g.commentBefore=h),i.options.keepSourceTokens&&y&&(g.srcToken=a),g}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 ur.composeEmptyNode=c,ur.composeNode=a,ur}function Jr(){if(Wr)return cr;Wr=1;var e=rr(),t=Qr(),n=Lr(),r=hr();return cr.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 m=p.contents.range[2],g=n.resolveEnd(u,m,false,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},cr}function Xr(){if(Gr)return Oe;Gr=1;var e=w,t=Ie(),n=rr(),r=or(),s=Ce(),i=Jr(),o=Lr();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 Oe.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;}}},Oe}var es,ts={},ns={};function rs(){if(es)return ns;es=1;var e=Hr(),t=Kr(),n=or(),r=bt();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 ns.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}}},ns.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},ns.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");}},ns}var ss,is={};function os(){if(ss)return is;ss=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 is.stringify=n=>"type"in n?e(n):t(n),is}var as,cs,us={};function ls(){if(as)return us;as=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")},us.visit=r,us}function fs(){if(cs)return ts;cs=1;var e=rs(),t=os(),n=ls();return ts.createScalarToken=e.createScalarToken,ts.resolveAsScalar=e.resolveAsScalar,ts.setScalarValue=e.setScalarValue,ts.stringify=t.stringify,ts.visit=n.visit,ts.BOM="\ufeff",ts.DOCUMENT="",ts.FLOW_END="",ts.SCALAR="",ts.isCollection=e=>!!e&&"items"in e,ts.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),ts.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},ts.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},ts}var ps,hs={};function ds(){if(ps)return hs;ps=1;var e=fs();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 hs.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)}},hs}var ms,gs={};function ys(){if(ms)return gs;ms=1;return gs.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}};}},gs}var vs,_s={};function bs(){if(vs)return _s;vs=1;var e=w,t=fs(),n=ds();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 _s.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());}}},_s}var ws,Ss,As={};function ks(){if(ws)return As;ws=1;var e=Xr(),t=rr(),n=or(),r=xt(),s=Ce(),i=ys(),o=bs();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 As.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))},As.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())},As.parseDocument=c,As.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)},As}var Es=function(){if(Ss)return xe;Ss=1;var e=Xr(),t=rr(),n=Jn(),r=or(),s=Qe(),i=Ce(),o=Lt(),a=st(),c=zt(),u=Gt(),l=fs(),f=ds(),p=ys(),h=bs(),d=ks(),m=Ne();return xe.Composer=e.Composer,xe.Document=t.Document,xe.Schema=n.Schema,xe.YAMLError=r.YAMLError,xe.YAMLParseError=r.YAMLParseError,xe.YAMLWarning=r.YAMLWarning,xe.Alias=s.Alias,xe.isAlias=i.isAlias,xe.isCollection=i.isCollection,xe.isDocument=i.isDocument,xe.isMap=i.isMap,xe.isNode=i.isNode,xe.isPair=i.isPair,xe.isScalar=i.isScalar,xe.isSeq=i.isSeq,xe.Pair=o.Pair,xe.Scalar=a.Scalar,xe.YAMLMap=c.YAMLMap,xe.YAMLSeq=u.YAMLSeq,xe.CST=l,xe.Lexer=f.Lexer,xe.LineCounter=p.LineCounter,xe.Parser=h.Parser,xe.parse=d.parse,xe.parseAllDocuments=d.parseAllDocuments,xe.parseDocument=d.parseDocument,xe.stringify=d.stringify,xe.visit=m.visit,xe.visitAsync=m.visitAsync,xe}(),xs=B(Es);function Os(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 $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Rs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Cs={};function Ts(e){return Cs}function Ps(e,t){return "bigint"==typeof t?t.toString():t}function Ls(e){return {get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ns(e){return null==e}function Is(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ms=Symbol("evaluating");function Ds(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ms)return void 0===r&&(r=Ms,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function js(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Hs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}const Bs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ks=Ls(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Us(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 qs(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const Zs=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vs(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 Ys(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 Qs(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function Js(e){return "string"==typeof e?e:e?.message}function Xs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Js(e.inst?._zod.def?.error?.(e))??Js(t?.error?.(e))??Js(n.customError?.(e))??Js(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ti(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ni=(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,Ps,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ri=Os("$ZodError",ni),si=Os("$ZodError",ni,{Parent:Error});const ii=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 $s;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},oi=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=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},ai=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 $s;return i.issues.length?{success:false,error:new(e??ri)(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},ci=ai(si),ui=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=>Xs(e,s,Ts())))}:{success:true,data:i.value}},li=ui(si),fi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ii(e)(t,n,s)},pi=e=>(t,n,r)=>ii(e)(t,n,r),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oi(e)(t,n,s)},di=e=>async(t,n,r)=>oi(e)(t,n,r),mi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},gi=e=>(t,n,r)=>ai(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>async(t,n,r)=>ui(e)(t,n,r),_i=/^[cC][^\s-]{8,}$/,bi=/^[0-9a-z]+$/,wi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Si=/^[0-9a-vA-V]{20}$/,Ai=/^[A-Za-z0-9]{27}$/,ki=/^[a-zA-Z0-9_-]{21}$/,Ei=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xi=/^([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})$/,Oi=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)$/,$i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ri=/^(?:(?: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])$/,Ci=/^(([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}|:))$/,Ti=/^((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])$/,Pi=/^(([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])$/,Li=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ni=/^[A-Za-z0-9_-]*$/,Ii=/^(?=.{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])?)*\.?$/,Mi=/^\+(?:[0-9]){6,14}[0-9]$/,Di="(?:(?:\\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])))",ji=new RegExp(`^${Di}$`);function Hi(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 Fi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,zi=Os("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Ki=Os("$ZodCheckMaxLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Ui=Os("$ZodCheckMinLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),qi=Os("$ZodCheckLengthEquals",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(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});};}),Zi=Os("$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=()=>{});}),Wi=Os("$ZodCheckRegex",(e,t)=>{Zi.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});};}),Gi=Os("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fi),Zi.init(e,t);}),Vi=Os("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bi),Zi.init(e,t);}),Yi=Os("$ZodCheckIncludes",(e,t)=>{zi.init(e,t);const n=Ws(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});};}),Qi=Os("$ZodCheckStartsWith",(e,t)=>{zi.init(e,t);const n=new RegExp(`^${Ws(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});};}),Ji=Os("$ZodCheckEndsWith",(e,t)=>{zi.init(e,t);const n=new RegExp(`.*${Ws(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});};}),Xi=Os("$ZodCheckOverwrite",(e,t)=>{zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class eo{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 to={major:4,minor:1,patch:12},no=Os("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;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=Ys(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 $s;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ys(e,t)));});else {if(e.issues.length===t)continue;s||(s=Ys(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ys(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new $s;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 $s;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=ci(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return li(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ro=Os("$ZodString",(e,t)=>{var n;no.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};}),so=Os("$ZodStringFormat",(e,t)=>{Zi.init(e,t),ro.init(e,t);}),io=Os("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xi),so.init(e,t);}),oo=Os("$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=Oi(e));}else t.pattern??(t.pattern=Oi());so.init(e,t);}),ao=Os("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$i),so.init(e,t);}),co=Os("$ZodURL",(e,t)=>{so.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:Ii.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});}};}),uo=Os("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),so.init(e,t);}),lo=Os("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ki),so.init(e,t);}),fo=Os("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_i),so.init(e,t);}),po=Os("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bi),so.init(e,t);}),ho=Os("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wi),so.init(e,t);}),mo=Os("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Si),so.init(e,t);}),go$1=Os("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ai),so.init(e,t);}),yo=Os("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Hi({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(`^${Di}T(?:${r})$`)}(t)),so.init(e,t);}),vo=Os("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ji),so.init(e,t);}),_o=Os("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Hi(t)}$`)),so.init(e,t);}),bo=Os("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ei),so.init(e,t);}),wo=Os("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ri),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),So=Os("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ci),so.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});}};}),Ao=Os("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ti),so.init(e,t);}),ko=Os("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pi),so.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 Eo(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const xo=Os("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Li),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Eo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const Oo=Os("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ni),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!Ni.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Eo(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});};}),$o=Os("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mi),so.init(e,t);});const Ro=Os("$ZodJWT",(e,t)=>{so.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});};}),Co=Os("$ZodUnknown",(e,t)=>{no.init(e,t),e._zod.parse=e=>e;}),To=Os("$ZodNever",(e,t)=>{no.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Po(e,t,n){e.issues.length&&t.issues.push(...Qs(n,e.issues)),t.value[n]=e.value;}const Lo=Os("$ZodArray",(e,t)=>{no.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=>Po(t,n,e))):Po(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function No(e,t,n,r){e.issues.length&&t.issues.push(...Qs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Io(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 Mo(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=>No(e,n,s,t))):No(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 Do=Os("$ZodObject",(e,t)=>{no.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=Ls(()=>Io(t));Ds(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=>No(n,t,e,a))):No(r,t,e,a);}return i?Mo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),jo=Os("$ZodObjectJIT",(e,t)=>{Do.init(e,t);const n=e._zod.parse,r=Ls(()=>Io(t));let s;const i=zs,o=!Cs.jitless,a=o&&Ks.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 eo(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fs(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=Fs(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?Mo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ho(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=>!Ys(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=>Xs(e,r,Ts())))}),t)}const Fo=Os("$ZodUnion",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ds(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ds(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ds(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=>Is(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=>Ho(t,s,e,i)):Ho(a,s,e,i)};}),Bo=Os("$ZodIntersection",(e,t)=>{no.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])=>Ko(e,t,n)):Ko(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(Us(e)&&Us(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 Ko(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ys(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 Uo=Os("$ZodRecord",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Us(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(...Qs(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...Qs(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=>Xs(e,r,Ts())),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(...Qs(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...Qs(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),qo=Os("$ZodEnum",(e,t)=>{no.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=>Zs.has(typeof e)).map(e=>"string"==typeof e?Ws(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};}),Zo=Os("$ZodTransform",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(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 $s;return n.value=s,n};});function Wo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Go=Os("$ZodOptional",(e,t)=>{no.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ds(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(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=>Wo(t,e.value)):Wo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Vo=Os("$ZodNullable",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(e.source)}|null)$`):void 0}),Ds(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);}),Yo=Os("$ZodDefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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=>Qo(e,t)):Qo(r,t)};});function Qo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Jo=Os("$ZodPrefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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));}),Xo=Os("$ZodNonOptional",(e,t)=>{no.init(e,t),Ds(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=>ea(t,e)):ea(s,e)};});function ea(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 ta=Os("$ZodCatch",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(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=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)};}),na=Os("$ZodPipe",(e,t)=>{no.init(e,t),Ds(e._zod,"values",()=>t.in._zod.values),Ds(e._zod,"optin",()=>t.in._zod.optin),Ds(e._zod,"optout",()=>t.out._zod.optout),Ds(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=>ra(e,t.in,n)):ra(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ra(e,t.out,n)):ra(r,t.out,n)};});function ra(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const sa=Os("$ZodReadonly",(e,t)=>{no.init(e,t),Ds(e._zod,"propValues",()=>t.innerType._zod.propValues),Ds(e._zod,"values",()=>t.innerType._zod.values),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(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(ia):ia(r)};});function ia(e){return e.value=Object.freeze(e.value),e}const oa=Os("$ZodCustom",(e,t)=>{zi.init(e,t),no.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=>aa(t,n,r,e));aa(s,n,r,e);};});function aa(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(ti(e));}}class ca{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 ua(){return new ca}const la=ua();function fa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Vs(t)})}function pa(e,t){return new Ki({check:"max_length",...Vs(t),maximum:e})}function ha(e,t){return new Ui({check:"min_length",...Vs(t),minimum:e})}function da(e,t){return new qi({check:"length_equals",...Vs(t),length:e})}function ma(e){return new Xi({check:"overwrite",tx:e})}function ga(e){const t=function(e,t){const n=new zi({check:"custom",...Vs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ti(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(ti(r));}},e(n.value,n)));return t}const ya=Os("ZodISODateTime",(e,t)=>{yo.init(e,t),Ua.init(e,t);});function va(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Vs(t)})}(ya,e)}const _a=Os("ZodISODate",(e,t)=>{vo.init(e,t),Ua.init(e,t);});function ba(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vs(t)})}(_a,e)}const wa=Os("ZodISOTime",(e,t)=>{_o.init(e,t),Ua.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vs(t)})}(wa,e)}const Aa=Os("ZodISODuration",(e,t)=>{bo.init(e,t),Ua.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vs(t)})}(Aa,e)}const Ea=(e,t)=>{ri.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else {let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++;}}};return r(e),n}(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,Ps,2);}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ps,2);}},isEmpty:{get:()=>0===e.issues.length}});},xa=Os("ZodError",Ea),Oa=Os("ZodError",Ea,{Parent:Error}),$a=ii(Oa),Ra=oi(Oa),Ca=ai(Oa),Ta=ui(Oa),Pa=fi(Oa),La=pi(Oa),Na=hi(Oa),Ia=di(Oa),Ma=mi(Oa),Da=gi(Oa),ja=yi(Oa),Ha=vi(Oa),Fa=Os("ZodType",(e,t)=>(no.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Hs(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Gs(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>$a(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ca(e,t,n),e.parseAsync=async(t,n)=>Ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ta(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Pa(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Na(e,t,n),e.decodeAsync=async(t,n)=>Ia(e,t,n),e.safeEncode=(t,n)=>Ma(e,t,n),e.safeDecode=(t,n)=>Da(e,t,n),e.safeEncodeAsync=async(t,n)=>ja(e,t,n),e.safeDecodeAsync=async(t,n)=>Ha(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,...Vs(n)})}(Nc,e,t)}(t,n)),e.superRefine=t=>e.check(ga(t)),e.overwrite=t=>e.check(ma(t)),e.optional=()=>kc(e),e.nullable=()=>xc(e),e.nullish=()=>kc(xc(e)),e.nonoptional=t=>function(e,t){return new Rc({type:"nonoptional",innerType:e,...Vs(t)})}(e,t),e.array=()=>mc(e),e.or=t=>vc([e,t]),e.and=t=>new _c({type:"intersection",left:e,right:t}),e.transform=t=>Pc(e,new Sc({type:"transform",transform:t})),e.default=t=>{return n=t,new Oc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.prefault=t=>{return n=t,new $c({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.catch=t=>{return new Cc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Pc(e,t),e.readonly=()=>new Lc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return la.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>la.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return la.get(e);const n=e.clone();return la.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ba=Os("_ZodString",(e,t)=>{ro.init(e,t),Fa.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 Wi({check:"string_format",format:"regex",...Vs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Yi({check:"string_format",format:"includes",...Vs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"starts_with",...Vs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ji({check:"string_format",format:"ends_with",...Vs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ha(...t)),e.max=(...t)=>e.check(pa(...t)),e.length=(...t)=>e.check(da(...t)),e.nonempty=(...t)=>e.check(ha(1,...t)),e.lowercase=t=>e.check(function(e){return new Gi({check:"string_format",format:"lowercase",...Vs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Vi({check:"string_format",format:"uppercase",...Vs(e)})}(t)),e.trim=()=>e.check(ma(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ma(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ma(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ma(e=>e.toUpperCase()));}),za=Os("ZodString",(e,t)=>{ro.init(e,t),Ba.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Vs(t)})}(qa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Vs(t)})}(Ga,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Vs(t)})}(uc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Vs(t)})}(Va,t)),e.guid=t=>e.check(fa(Za,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Vs(t)})}(Wa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Vs(t)})}(Wa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Vs(t)})}(Wa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Vs(t)})}(Wa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Vs(t)})}(Ya,t)),e.guid=t=>e.check(fa(Za,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Vs(t)})}(Qa,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Vs(t)})}(Ja,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Vs(t)})}(Xa,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Vs(t)})}(oc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Vs(t)})}(ac,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Vs(t)})}(ec,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Vs(t)})}(tc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Vs(t)})}(nc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Vs(t)})}(rc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Vs(t)})}(sc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Vs(t)})}(ic,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Vs(t)})}(cc,t)),e.datetime=t=>e.check(va(t)),e.date=t=>e.check(ba(t)),e.time=t=>e.check(Sa(t)),e.duration=t=>e.check(ka(t));});function Ka(e){return function(e,t){return new e({type:"string",...Vs(t)})}(za,e)}const Ua=Os("ZodStringFormat",(e,t)=>{so.init(e,t),Ba.init(e,t);}),qa=Os("ZodEmail",(e,t)=>{ao.init(e,t),Ua.init(e,t);}),Za=Os("ZodGUID",(e,t)=>{io.init(e,t),Ua.init(e,t);}),Wa=Os("ZodUUID",(e,t)=>{oo.init(e,t),Ua.init(e,t);}),Ga=Os("ZodURL",(e,t)=>{co.init(e,t),Ua.init(e,t);}),Va=Os("ZodEmoji",(e,t)=>{uo.init(e,t),Ua.init(e,t);}),Ya=Os("ZodNanoID",(e,t)=>{lo.init(e,t),Ua.init(e,t);}),Qa=Os("ZodCUID",(e,t)=>{fo.init(e,t),Ua.init(e,t);}),Ja=Os("ZodCUID2",(e,t)=>{po.init(e,t),Ua.init(e,t);}),Xa=Os("ZodULID",(e,t)=>{ho.init(e,t),Ua.init(e,t);}),ec=Os("ZodXID",(e,t)=>{mo.init(e,t),Ua.init(e,t);}),tc=Os("ZodKSUID",(e,t)=>{go$1.init(e,t),Ua.init(e,t);}),nc=Os("ZodIPv4",(e,t)=>{wo.init(e,t),Ua.init(e,t);}),rc=Os("ZodIPv6",(e,t)=>{So.init(e,t),Ua.init(e,t);}),sc=Os("ZodCIDRv4",(e,t)=>{Ao.init(e,t),Ua.init(e,t);}),ic=Os("ZodCIDRv6",(e,t)=>{ko.init(e,t),Ua.init(e,t);}),oc=Os("ZodBase64",(e,t)=>{xo.init(e,t),Ua.init(e,t);}),ac=Os("ZodBase64URL",(e,t)=>{Oo.init(e,t),Ua.init(e,t);}),cc=Os("ZodE164",(e,t)=>{$o.init(e,t),Ua.init(e,t);}),uc=Os("ZodJWT",(e,t)=>{Ro.init(e,t),Ua.init(e,t);}),lc=Os("ZodUnknown",(e,t)=>{Co.init(e,t),Fa.init(e,t);});function fc(){return new lc({type:"unknown"})}const pc=Os("ZodNever",(e,t)=>{To.init(e,t),Fa.init(e,t);});function hc(e){return function(e,t){return new e({type:"never",...Vs(t)})}(pc,e)}const dc=Os("ZodArray",(e,t)=>{Lo.init(e,t),Fa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ha(t,n)),e.nonempty=t=>e.check(ha(1,t)),e.max=(t,n)=>e.check(pa(t,n)),e.length=(t,n)=>e.check(da(t,n)),e.unwrap=()=>e.element;});function mc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vs(n)})}(dc,e,t)}const gc=Os("ZodObject",(e,t)=>{jo.init(e,t),Fa.init(e,t),Ds(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wc({type:"enum",entries:n,...Vs(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:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:hc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Us(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=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return js(this,"shape",n),n},checks:[]});return Gs(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:e._zod.def.checks};return Gs(e,n)}(e,t),e.merge=t=>function(e,t){const n=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return js(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gs(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Gs(e,Hs(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 js(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Hs(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 js(this,"shape",r),r},checks:[]});return Gs(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Hs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Ac,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Hs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Rc,e,t[0]);});const yc=Os("ZodUnion",(e,t)=>{Fo.init(e,t),Fa.init(e,t),e.options=t.options;});function vc(e,t){return new yc({type:"union",options:e,...Vs(t)})}const _c=Os("ZodIntersection",(e,t)=>{Bo.init(e,t),Fa.init(e,t);});const bc=Os("ZodRecord",(e,t)=>{Uo.init(e,t),Fa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const wc=Os("ZodEnum",(e,t)=>{qo.init(e,t),Fa.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 wc({...t,checks:[],...Vs(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 wc({...t,checks:[],...Vs(r),entries:s})};});const Sc=Os("ZodTransform",(e,t)=>{Zo.init(e,t),Fa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ti(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(ti(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const Ac=Os("ZodOptional",(e,t)=>{Go.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function kc(e){return new Ac({type:"optional",innerType:e})}const Ec=Os("ZodNullable",(e,t)=>{Vo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function xc(e){return new Ec({type:"nullable",innerType:e})}const Oc=Os("ZodDefault",(e,t)=>{Yo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const $c=Os("ZodPrefault",(e,t)=>{Jo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Rc=Os("ZodNonOptional",(e,t)=>{Xo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Cc=Os("ZodCatch",(e,t)=>{ta.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Tc=Os("ZodPipe",(e,t)=>{na.init(e,t),Fa.init(e,t),e.in=t.in,e.out=t.out;});function Pc(e,t){return new Tc({type:"pipe",in:e,out:t})}const Lc=Os("ZodReadonly",(e,t)=>{sa.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Os("ZodCustom",(e,t)=>{oa.init(e,t),Fa.init(e,t);});const Ic=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},Mc=(e,t)=>{const n=t?JSON.parse(e):xs.parse(e);return n&&"object"==typeof n?n:{}},Dc=mc(Ka()).default([]).optional(),jc=vc([Ka(),mc(Ka())]),Hc=(Fc=Ka(),Bc=jc,new bc({type:"record",keyType:Fc,valueType:Bc,...Vs(zc)})).optional();var Fc,Bc,zc;const Kc=function(e,t){const n={type:"object",shape:e??{},...Vs(t)};return new gc(n)}({stanPath:Ka().min(1,{message:"stanPath must be a non-empty string"}),includes:Dc,excludes:Dc,imports:Hc}).strict(),Uc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Kc.parse(e)}catch(e){throw new Error((e=>e instanceof xa?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))}},qc=e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Mc(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=Uc(s["stan-core"]),o=Ic(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Zc=async e=>{const t=ke(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=Mc(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=Uc(r["stan-core"]),o=Ic(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Wc=e=>{try{return qc(e).stanPath}catch{return ve}},Gc=async e=>{try{return (await Zc(e)).stanPath}catch{return ve}},Vc=(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)}};var Yc={makeStanDirs:Vc},Qc=Object.freeze({__proto__:null,default:Yc,makeStanDirs:Vc});const Jc=async(e,n,i=false)=>{const a=Vc(e,n);if(await me(e,n),!i){const e=resolve(a.outputAbs,T);if(existsSync(e))try{await copyFile(e,resolve(a.diffAbs,P));}catch{}const n=await readdir(a.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(a.outputAbs,e.name),{recursive:true,force:true});}return a.rootAbs},Xc=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},eu=e=>join(e,".archive.snapshot.json"),tu=async({cwd:e,stanPath:t,includes:n,excludes:r,anchors:s})=>{const{diffDir:i}=await ge(e,t),o=await fe(e),c=await de(o,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[],anchors:s??[]}),u=await Xc(e,c),l=eu(i);return await writeFile(l,JSON.stringify(u,null,2),"utf8"),l},nu=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=false,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:d}=await ge(e,n),m=await fe(e),g=await de(m,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[],anchors:l??[]}),y=await Xc(e,g),v=eu(d),_=existsSync(v),b=_?JSON.parse(await readFile(v,"utf8")):{},w=_?g.filter(e=>!b[e]||b[e]!==y[e]):[...g],S=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:A,warningsBody:k}=await S(e,w),E=A;H(k,f);const x=join(p,`${r}.diff.tar`),O=await import('./index-ucZa1KMb-CNGeWGvV.js');if(u)await O.create({file:x,cwd:e,filter:D(n)},j(E,n));else if(0===E.length){const t=(e=>join(e,".stan_no_changes"))(d);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await O.create({file:x,cwd:e},r);}else {const t=Array.from(new Set([...E]));await O.create({file:x,cwd:e},t);}return "replace"===c?await writeFile(v,JSON.stringify(y,null,2),"utf8"):"createIfMissing"!==c||_||await writeFile(v,JSON.stringify(y,null,2),"utf8"),{diffPath:x}},ru=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),su=e=>{if("string"!=typeof e||!e.trim())return null;const t=ru(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},iu=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=t.index+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},ou=/^###\s+Patch:\s+(.+?)\s*$/m,au=/^###\s+Full Listing:\s+(.+?)\s*$/m,cu=/^##\s+Commit Message\s*$/m,uu=/^##\s+.*$|^###\s+.*$/m,lu=e=>{const t=[],n=[];{const t=new RegExp(uu.source,"gm");let r;for(;r=t.exec(e);)n.push(r.index);}n.push(e.length);for(let r=0;r<n.length-1;r+=1){const s=n[r],i=n[r+1],o=e.slice(s,i);if(cu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(ou);if(a&&a[1]){t.push({kind:"patch",path:ru(a[1].trim()),start:s,body:o});continue}const c=o.match(au);c&&c[1]&&t.push({kind:"full",path:ru(c[1].trim()),start:s,body:o});}return t},fu=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:ru(r[1]),b:ru(r[2])});return n},pu=e=>{const t=[];((e,t)=>{const n=iu(e);if(!n)return;const r=n.split(/\r?\n/);for(let e=0;e<r.length;e+=1){const n=r[e].trim();if(!n)continue;const s=n.split(/\s+/),i=s[0],o=s.slice(1),a=`File Ops line ${(e+1).toString()}`,c=e=>t.push(`${a}: ${e}`),u=e=>su(e);if(/^(mv|rm|rmdir|mkdirp)$/.test(i)){if("mv"===i){if(2!==o.length){c(`expected 2 paths, got ${o.length.toString()}`);continue}const e=u(o[0]),t=u(o[1]);e&&t||c("mv: invalid repo-relative path");continue}1===o.length?u(o[0])||c(`${i}: invalid repo-relative path`):c(`expected 1 path, got ${o.length.toString()}`);}else c(`unknown verb "${i}"`);}})(e,t);const n=lu(e),r=n.filter(e=>"patch"===e.kind),s=n.filter(e=>"full"===e.kind),i=n.filter(e=>"commit"===e.kind);0===r.length&&t.push("No Patch blocks found");{const e=new Map;for(const n of r){const r=n.path??"(unknown)",s=e.get(r)??[];s.push(n),e.set(r,s);const i=fu(n.body);0===i.length?t.push(`Patch for ${r} has no "diff --git a/<path> b/<path>" header; emit a plain unified diff with git-style headers (wrappers like "*** Begin Patch" are not allowed)`):1!==i.length&&t.push(`Patch for ${r} contains multiple "diff --git" headers (found ${i.length.toString()}; expected 1)`);const o=/(^|\n)\*{3,}\s*(Begin|End)\s+Patch\b|(^|\n)Index:\s|(^|\n)\*{3,}\s*Add\s+File:/i;try{o.test(n.body)&&t.push(`Patch for ${r} contains a forbidden wrapper ("*** Begin Patch", "*** Add File:", or "Index:"). Use plain unified diff only.`);}catch{}}for(const[n,r]of e.entries())r.length>1&&t.push(`Multiple Patch blocks found for ${n} (${r.length.toString()})`);}{const e=new Map;for(const t of s){const n=ru("string"==typeof t.path?t.path:"(unknown)");e.set(n,t);}for(const n of r){const r=ru(n.path),s=e.get(r);!s||n.start<s.start||t.push(`Ordering violation for ${r}: Full Listing appears before Patch`);}}if(0===i.length)t.push('Missing "## Commit Message" section');else {"commit"!==n[n.length-1].kind&&t.push("Commit Message is not last");}if(r.length>0){const e=[];for(const t of r){const n=fu(t.body);if(n.length>0){const t=n[0]?.b,r="string"==typeof t?ru(t):"";r.length&&e.push(r);}else {const n=t.path?ru(t.path):"";n.length&&e.push(n);}}const n=e=>".stan/system/stan.todo.md"===ru(e),s=e=>{const t=ru(e);if(!t)return false;const n=(t.split("/").pop()??t).toLowerCase();return "readme.md"===n||"changelog.md"===n||"contributing.md"===n||"license"===n||"license.md"===n||(t.startsWith("docs/")||t.startsWith("docs-src/")||t.startsWith("diagrams/"))},i=e.filter(e=>!n(e));if(!(i.length>0&&i.every(e=>s(e)))){e.some(e=>n(e))||t.push('Doc cadence violation: Patch present but no Patch for ".stan/system/stan.todo.md"');}}return {ok:0===t.length,errors:t,warnings:[]}},hu=e=>{const t=pu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},du={extractBlocks:lu,parseDiffHeaders:fu,isCommitLast:e=>{if(!e.match(cu))return false;const t=e.search(cu);if(t<0)return false;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return false;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${String(s)}{'}}\\s*$`,"m");if(!n.match(i))return false;const o=n.search(i);if(o<0)return false;return 0===n.slice(o+s).trim().length}},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),gu=e=>e.endsWith("\n")?e:e+"\n",yu=/[\u200B-\u200D\uFEFF]/g,vu=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)),_u=e=>{const t=mu(e).replace(yu,"");return gu(t)},bu=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;})(_u(e.trim())),n=_u(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(t[n].trimEnd()==="`".repeat(r)){const r=t.slice(e+1,n).join("\n");if(vu(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 gu(r?_u(r).trimEnd():n)},wu=e=>{const t=[],n=[],r=iu(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=>su(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}},Su=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 {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 Au(e){return Array.isArray(e)?e.map(e=>Au(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 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(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function Eu(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 xu(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?Eu(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=Au(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=ku(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=xu(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 $u=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Ru=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Cu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Tu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Pu=e=>e.replace(/\n/g,"\r\n"),Lu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=Eu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const c=o.some(e=>{const t=Ru(e.oldFileName),n=Ru(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!c)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const u=[],l=[];for(const e of o){const n=Ru(e.newFileName)??Ru(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^\.\//,"").replace(/\\/g,"/"),c=path.resolve(t,o),p=/\.md$/i.test(o);let h="",d=false,m=true;try{const e=await readFile(c,"utf8");h=e,d=/\r\n/.test(e);}catch{m=false;}const g=Cu(e.oldFileName);if(!m&&!g){l.push({path:o,reason:"target file not found"});continue}let y;!m&&g&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Tu(t)===Tu(r),fuzzFactor:p?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?Pu(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 $u(n),await writeFile(n,v,"utf8");}else {try{await $u(c);}catch{}await writeFile(c,v,"utf8");}u.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:u,failed:l,sandboxRoot:s}},Nu=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)),c=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 ${String(n)})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(c.ok)return {ok:true,result:c,js:null};const l=await Lu({cwd:t,cleaned:r,check:s});if(l.okFiles.length>0&&0===l.failed.length)return {ok:true,result:c,js:l};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=t[1].trim().replace(/^\.\//,"").replace(/\\/g,"/");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 c=[];let l=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||c.push(t.slice(1));}}let p=c.join("\n");p.endsWith("\n")||(p+="\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,p,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:c,js:e}}catch{}return {ok:false,result:c,js:l}};var Iu,Mu={},Du={},ju={};function Hu(){if(Iu)return ju;return Iu=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.splitWhen=ju.flatten=void 0,ju.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},ju.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},ju}var Fu,Bu={};function zu(){if(Fu)return Bu;return Fu=1,Object.defineProperty(Bu,"__esModule",{value:true}),Bu.isEnoentCodeError=void 0,Bu.isEnoentCodeError=function(e){return "ENOENT"===e.code},Bu}var Ku,Uu={};var qu,Zu={};function Wu(){if(qu)return Zu;qu=1,Object.defineProperty(Zu,"__esModule",{value:true}),Zu.convertPosixPathToPattern=Zu.convertWindowsPathToPattern=Zu.convertPathToPattern=Zu.escapePosixPath=Zu.escapeWindowsPath=Zu.escape=Zu.removeLeadingDotSegment=Zu.makeAbsolute=Zu.unixify=void 0;const e=x,t="win32"===E.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 Zu.unixify=function(e){return e.replace(/\\/g,"/")},Zu.makeAbsolute=function(t,n){return e.resolve(t,n)},Zu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Zu.escape=t?o:a,Zu.escapeWindowsPath=o,Zu.escapePosixPath=a,Zu.convertPathToPattern=t?c:u,Zu.convertWindowsPathToPattern=c,Zu.convertPosixPathToPattern=u,Zu}var Gu,Vu,Yu,Qu,Ju,Xu,el={};function tl(){return Vu?Gu:(Vu=1,Gu=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 nl(){if(Qu)return Yu;Qu=1;var e=tl(),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 Yu=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 rl,sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,ml,gl,yl,vl,_l,bl,wl,Sl={};function Al(){return rl||(rl=1,(e=Sl).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}),Sl;var e;}function kl(){if(il)return sl;il=1;const e=Al();return sl=(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 El(){return al?ol:(al=1,ol=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function xl(){if(ul)return cl;ul=1;const e=El(),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=[],m=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){m=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=m,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("|")}(m,d),true===a.capture?h.result=`(${h.result})`:false!==a.wrap&&d.length+m.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={},cl=t}function Ol(){if(fl)return ll;fl=1;const e=O,t=xl(),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),m=String(n);n=Math.max(Math.abs(n),1);let g=i(h)||i(d)||i(m),y=g?Math.max(h.length,d.length,m.length):0,v=false===g&&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=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;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 ll=h}function $l(){if(_l)return vl;_l=1;const e=kl(),{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:m}=yl?gl:(yl=1,gl={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 vl=(g,y={})=>{if("string"!=typeof g)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(g.length>_)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${_})`);const b={type:"root",input:g,nodes:[]},w=[b];let S=b,A=b,k=0;const E=g.length;let x,O=0,$=0;const R=()=>g[O++],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"});O<E;)if(S=w[w.length-1],x=R(),x!==m&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;O<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="");O<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){$++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:$,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}),$--,S=w[w.length-1];continue}if(x===s&&$>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&&$>0&&0===S.commas){const e=S.nodes;if(0===$||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}}function Rl(){if(wl)return bl;wl=1;const e=kl(),t=function(){if(hl)return pl;hl=1;const e=Ol(),t=Al();return pl=(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 dl;ml=1;const e=Ol(),t=kl(),n=Al(),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 dl=(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))},dl}(),r=$l(),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),bl=s}var Cl,Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul={};function ql(){if(Tl)return Cl;Tl=1;const e=x,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 Cl={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 Zl(){return Pl||(Pl=1,function(e){const t=x,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=ql();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};}(Ul)),Ul}function Wl(){if(jl)return Dl;jl=1;const e=x,t=function(){if(Nl)return Ll;Nl=1;const e=Zl(),{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:m}=ql(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Ll=(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=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===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(O!==a){if(true!==b.noext&&true==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){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!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=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,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(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,g(O)||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},Ll}(),n=function(){if(Ml)return Il;Ml=1;const e=ql(),t=Zl(),{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 m={type:"bos",value:"",output:p.prepend||""},g=[m],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:O,NO_DOTS_SLASH:$,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:g};l=t.removePrefix(l,D),d=l.length;const j=[],H=[],F=[];let B,z=m;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,g.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(),m.output||1!==g.indexOf(z)||(m.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=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.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="",g.pop(),z=m;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+=O,z.output+=O):true===p.dot?(D.output+=$,z.output+=$):(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:m,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?m:d,b=i.dot?g: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},Il=u}(),r=Zl(),s=ql(),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,Dl=i}function Gl(){return Fl?Hl:(Fl=1,Hl=Wl())}function Vl(){if(Kl)return el;Kl=1,Object.defineProperty(el,"__esModule",{value:true}),el.isAbsolute=el.partitionAbsoluteAndRelative=el.removeDuplicateSlashes=el.matchAny=el.convertPatternsToRe=el.makeRe=el.getPatternParts=el.expandBraceExpansion=el.expandPatternsWithBraceExpansion=el.isAffectDepthOfReadingPattern=el.endsWithSlashGlobStar=el.hasGlobStar=el.getBaseDirectory=el.isPatternRelatedToParentDirectory=el.getPatternsOutsideCurrentDirectory=el.getPatternsInsideCurrentDirectory=el.getPositivePatterns=el.getNegativePatterns=el.isPositivePattern=el.isNegativePattern=el.convertToNegativePattern=el.convertToPositivePattern=el.isDynamicPattern=el.isStaticPattern=void 0;const e=x,t=function(){if(Xu)return Ju;Xu=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Ju=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(zl)return Bl;zl=1;const e=O,t=Rl(),n=Gl(),r=Zl(),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,Bl=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 m(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 g(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return el.isStaticPattern=u,el.isDynamicPattern=l,el.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},el.convertToNegativePattern=function(e){return "!"+e},el.isNegativePattern=f,el.isPositivePattern=p,el.getNegativePatterns=function(e){return e.filter(f)},el.getPositivePatterns=function(e){return e.filter(p)},el.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},el.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},el.isPatternRelatedToParentDirectory=h,el.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},el.hasGlobStar=function(e){return e.includes("**")},el.endsWithSlashGlobStar=d,el.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},el.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},el.expandBraceExpansion=m,el.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},el.makeRe=g,el.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},el.matchAny=function(e,t){return t.some(t=>t.test(e))},el.removeDuplicateSlashes=function(e){return e.replace(c,"/")},el.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},el.isAbsolute=y,el}var Yl,Ql,Jl,Xl={};function ef(){if(Ql)return Yl;Ql=1;const e=$.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 Yl=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},Yl}var tf,nf,rf,sf={};function of(){if(tf)return sf;return tf=1,Object.defineProperty(sf,"__esModule",{value:true}),sf.isEmpty=sf.isString=void 0,sf.isString=function(e){return "string"==typeof e},sf.isEmpty=function(e){return ""===e},sf}function af(){if(nf)return Du;nf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.string=Du.stream=Du.pattern=Du.path=Du.fs=Du.errno=Du.array=void 0;const e=Hu();Du.array=e;const t=zu();Du.errno=t;const n=function(){if(Ku)return Uu;Ku=1,Object.defineProperty(Uu,"__esModule",{value:true}),Uu.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 Uu.createDirentFromStats=function(t,n){return new e(t,n)},Uu}();Du.fs=n;const r=Wu();Du.path=r;const s=Vl();Du.pattern=s;const i=function(){if(Jl)return Xl;Jl=1,Object.defineProperty(Xl,"__esModule",{value:true}),Xl.merge=void 0;const e=ef();function t(e){e.forEach(e=>e.emit("close"));}return Xl.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},Xl}();Du.stream=i;const o=of();return Du.string=o,Du}var cf,uf={},lf={},ff={},pf={},hf={},df={},mf={},gf={},yf={};function vf(){if(cf)return yf;function e(e,t){e(t);}function t(e,t){e(null,t);}return cf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.read=void 0,yf.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);});},yf}var _f,bf={};var wf,Sf,Af,kf,Ef,xf,Of,$f={},Rf={};function Cf(){if(Sf)return $f;Sf=1,Object.defineProperty($f,"__esModule",{value:true});const e=(wf||(wf=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)};}(Rf)),Rf);return $f.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}},$f}function Tf(){if(Af)return gf;Af=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.statSync=gf.stat=gf.Settings=void 0;const e=vf(),t=(_f||(_f=1,Object.defineProperty(bf,"__esModule",{value:true}),bf.read=void 0,bf.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}}),bf),n=Cf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.statSync=function(e,n){const s=r(n);return t.read(e,s)},gf}function Pf(){if(Ef)return kf;let e;return Ef=1,kf="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:F):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Lf,Nf={};function If(){if(Lf)return Nf;Lf=1,Object.defineProperty(Nf,"__esModule",{value:true}),Nf.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 Nf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,Nf}var Mf,Df,jf={},Hf={};function Ff(){if(Df)return jf;Df=1,Object.defineProperty(jf,"__esModule",{value:true}),jf.fs=void 0;const e=function(){if(Mf)return Hf;Mf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.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 Hf.createDirentFromStats=function(t,n){return new e(t,n)},Hf}();return jf.fs=e,jf}var Bf,zf,Kf={};function Uf(){if(Bf)return Kf;return Bf=1,Object.defineProperty(Kf,"__esModule",{value:true}),Kf.joinPathSegments=void 0,Kf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Kf}function qf(){if(zf)return mf;zf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Tf(),t=function(){if(Of)return xf;Of=1,xf=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=Pf();return xf}(),n=If(),r=Ff(),s=Uf();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 Zf,Wf={};var Gf,Vf,Yf,Qf={},Jf={};function Xf(){return Gf||(Gf=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)};}(Jf)),Jf}function ep(){if(Yf)return df;Yf=1,Object.defineProperty(df,"__esModule",{value:true}),df.Settings=df.scandirSync=df.scandir=void 0;const e=qf(),t=function(){if(Zf)return Wf;Zf=1,Object.defineProperty(Wf,"__esModule",{value:true}),Wf.readdir=Wf.readdirWithFileTypes=Wf.read=void 0;const e=Tf(),t=If(),n=Ff(),r=Uf();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 Wf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Wf.readdirWithFileTypes=s,Wf.readdir=i,Wf}(),n=function(){if(Vf)return Qf;Vf=1,Object.defineProperty(Qf,"__esModule",{value:true});const e=x,t=Tf(),n=Xf();return Qf.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}},Qf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return df.Settings=n.default,df.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},df.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},df}var tp,np,rp,sp={exports:{}};function ip(){if(rp)return sp.exports;rp=1;var e=np?tp:(np=1,tp=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 sp.exports=t,sp.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},sp.exports}var op,ap={};function cp(){if(op)return ap;return op=1,Object.defineProperty(ap,"__esModule",{value:true}),ap.joinPathSegments=ap.replacePathSegmentSeparator=ap.isAppliedFilter=ap.isFatalError=void 0,ap.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},ap.isAppliedFilter=function(e,t){return null===e||e(t)},ap.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},ap.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},ap}var up,lp,fp,pp={};function hp(){if(up)return pp;up=1,Object.defineProperty(pp,"__esModule",{value:true});const e=cp();return pp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},pp}function dp(){if(lp)return hf;lp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=R,t=ep(),n=ip(),r=cp(),s=hp();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 hf.default=i,hf}var mp,gp={};var yp,vp,_p={},bp={};function wp(){if(vp)return _p;vp=1,Object.defineProperty(_p,"__esModule",{value:true});const e=function(){if(yp)return bp;yp=1,Object.defineProperty(bp,"__esModule",{value:true});const e=ep(),t=cp(),n=hp();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 bp.default=r,bp}();return _p.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()}},_p}var Sp,Ap,kp={};function Ep(){if(Ap)return ff;Ap=1,Object.defineProperty(ff,"__esModule",{value:true}),ff.Settings=ff.walkStream=ff.walkSync=ff.walk=void 0;const e=function(){if(fp)return pf;fp=1,Object.defineProperty(pf,"__esModule",{value:true});const e=dp();return pf.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();}},pf}(),t=function(){if(mp)return gp;mp=1,Object.defineProperty(gp,"__esModule",{value:true});const e=$,t=dp();return gp.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}},gp}(),n=wp(),r=function(){if(Sp)return kp;Sp=1,Object.defineProperty(kp,"__esModule",{value:true});const e=x,t=ep();return kp.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}},kp}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return ff.Settings=r.default,ff.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},ff.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},ff.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},ff}var xp,Op={};function $p(){if(xp)return Op;xp=1,Object.defineProperty(Op,"__esModule",{value:true});const e=x,t=Tf(),n=af();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 Rp,Cp,Tp={};function Pp(){if(Rp)return Tp;Rp=1,Object.defineProperty(Tp,"__esModule",{value:true});const e=$,t=Tf(),n=Ep(),r=$p();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 Tp.default=s,Tp}var Lp,Np,Ip,Mp={},Dp={},jp={},Hp={};function Fp(){if(Np)return jp;Np=1,Object.defineProperty(jp,"__esModule",{value:true});const e=function(){if(Lp)return Hp;Lp=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=af();return Hp.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))}},Hp}();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 jp.default=t,jp}var Bp,zp={};var Kp,Up={};var qp,Zp,Wp,Gp={};function Vp(){if(Zp)return Mp;Zp=1,Object.defineProperty(Mp,"__esModule",{value:true});const e=x,t=function(){if(Ip)return Dp;Ip=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=af(),t=Fp();return Dp.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)}},Dp}(),n=function(){if(Bp)return zp;Bp=1,Object.defineProperty(zp,"__esModule",{value:true});const e=af();return zp.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}},zp}(),r=function(){if(Kp)return Up;Kp=1,Object.defineProperty(Up,"__esModule",{value:true});const e=af();return Up.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},Up}(),s=function(){if(qp)return Gp;qp=1,Object.defineProperty(Gp,"__esModule",{value:true});const e=af();return Gp.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}},Gp}();return Mp.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}}},Mp}function Yp(){if(Wp)return uf;Wp=1,Object.defineProperty(uf,"__esModule",{value:true});const e=function(){if(Cp)return lf;Cp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=Ep(),t=$p(),n=Pp();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 lf.default=r,lf}(),t=Vp();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 uf.default=n,uf}var Qp,Jp={};var Xp,eh,th={},nh={};function rh(){if(eh)return th;eh=1,Object.defineProperty(th,"__esModule",{value:true});const e=function(){if(Xp)return nh;Xp=1,Object.defineProperty(nh,"__esModule",{value:true});const e=Tf(),t=Ep(),n=$p();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 nh.default=r,nh}(),t=Vp();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 th.default=n,th}var sh,ih,oh,ah={};var ch,uh,lh=function(){if(oh)return ih;oh=1;const e=function(){if(rf)return Mu;rf=1,Object.defineProperty(Mu,"__esModule",{value:true}),Mu.convertPatternGroupToTask=Mu.convertPatternGroupsToTasks=Mu.groupPatternsByBaseDirectory=Mu.getNegativePatternsAsPositive=Mu.getPositivePatterns=Mu.convertPatternsToTasks=Mu.generate=void 0;const e=af();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 Mu.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)},Mu.convertPatternsToTasks=n,Mu.getPositivePatterns=r,Mu.getNegativePatternsAsPositive=s,Mu.groupPatternsByBaseDirectory=i,Mu.convertPatternGroupsToTasks=o,Mu.convertPatternGroupToTask=a,Mu}(),t=Yp(),n=function(){if(Qp)return Jp;Qp=1,Object.defineProperty(Jp,"__esModule",{value:true});const e=$,t=Pp(),n=Vp();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 Jp.default=r,Jp}(),r=rh(),s=(sh||(sh=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=E,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)}};}(ah)),ah),i$1=af();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={})),ih=o}(),fh=B(lh);var ph=function(){if(uh)return ch;uh=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return ch=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")}}(),hh=B(ph);const dh=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(!dh(e))return null;return t.join("/")},gh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},yh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=Vc(t,n),a=path.join(i.rootAbs,"imports");await ensureDir(a);const c=Object.keys(r).sort();for(const e of c){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const c=path.join(a,i);await rm(c,{recursive:true,force:true}).catch(()=>{}),await ensureDir(c).catch(()=>{});const u=[];for(const e of n){const n=e.trim();if(!n)continue;const r=hh(n.replace(/\\/g,"/"));try{const e=await fh(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await gh(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(c,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{}}},vh=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),_h=e=>{const t=vh(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=vh(t);return e===n||e.startsWith(n+"/")})(vh(e),t):()=>false;var n;const r=le(t,{dot:true});return e=>r(vh(e))},bh=e=>{const t=e.map(_h);return 0===t.length?()=>false:e=>{const n=vh(e);for(const e of t)if(e(n))return true;return false}},wh=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return we({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},Sh=async(e,n)=>{const r=path.join(e,n,"system"),o=path.join(r,"parts"),c=path.join(r,"stan.system.md");if(await ensureDir(r),!existsSync(o))return {target:c,action:"skipped-no-parts",partsDir:o};const u=(await readdir(o,{withFileTypes:true})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:true}));if(0===u.length)return {target:c,action:"skipped-no-md",partsDir:o};const l=[];for(const e of u){const t=path.join(o,e),n=mu(await readFile(t,"utf8")).trimEnd();l.push(n);}const p=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(n)+l.join("\n\n")+"\n";return await writeFile(c,p,"utf8"),{target:c,action:"written"}};const Ah="0.4.5";
|
|
26
|
+
const T="archive.tar",P="archive.prev.tar",L=e=>e.replace(/\\/g,"/"),N=(e,t)=>{const n=L(e).replace(/\/+$/,""),r=L(t);return r===n||r.startsWith(`${n}/`)},I=(e,t)=>{const n=L(e);return N(`${n}/diff`,t)||N(`${n}/patch`,t)},M=N,D=e=>{const t=e.replace(/\\/g,"/");return e=>!(I(t,e)||((e,t)=>{const n=L(e);return L(t)===`${n}/output/${T}`||L(t)===`${n}/output/archive.diff.tar`||L(t)===`${n}/output/archive.warnings.txt`})(t,e))},j=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},H=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);};var F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,K={exports:{}};var U,q,Z,W,G,V,Y,Q,J,X,ee,te=(z||(z=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,m=[[/^\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}(?=$|\\/$)`]],g=/(^|\\\/)?\\\*$/,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(g,_[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=>m.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 O{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 $=e=>new O(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=$,$.default=$,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(K)),K.exports),ne=B(te),re={};function se(){if(q)return U;q=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 U={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 ie(){return Z||(Z=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=se();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};}(re)),re}function oe(){if(G)return W;G=1;const e=ie(),{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:m}=se(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return W=(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=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===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(O!==a){if(true!==b.noext){if(true===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){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!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=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,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(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,g(O)||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},W}function ae(){if(Y)return V;Y=1;const e=se(),t=ie(),{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 m={type:"bos",value:"",output:p.prepend||""},g=[m],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:O,QMARK:$,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?$: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:g};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],H=[];let F,B=m;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,g.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?$.repeat(i.length):""):0===o?N+(i?$.repeat(i.length):""):$.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(),m.output||1!==g.indexOf(B)||(m.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=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.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="",g.pop(),B=m;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:$});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+=O,B.output+=O):(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:m,STAR:g,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?m:h,b=i.capture?"":"?:";let w=true===i.bash?".*?":g;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},V=u}function ce(){if(J)return Q;J=1;const e=oe(),t=ae(),n=ie(),r=se(),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,Q=s}function ue(){if(ee)return X;ee=1;const e=ce(),t=ie();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),X=n}var le=B(ue());async function fe(e){const t=[],n=["."];for(;n.length;){const r=n.pop(),i=resolve(e,r),o=await readdir(i,{withFileTypes:true});for(const e of o){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t}const pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},he=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>pe(e,t):()=>false;var n;const r=le(t,{dot:true});return e=>r(e)};async function de(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=ne();return t.add(e),t}catch{return null}})(n),h=[e=>pe(e,"node_modules"),e=>pe(e,".git"),...f?[e=>f.ignores(e)]:[],...a.map(he),...l.map(e=>t=>pe(t,e)),e=>I(u,e)];s||h.push(e=>M(`${u}/output`,e));const d=e.filter(e=>!h.some(t=>t(e)));if(o.length>0){const t=o.map(he),n=[e=>I(u,e),...s?[]:[e=>M(`${u}/output`,e)]],r=new Set(d);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(he),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(he);for(const n of e){!(I(u,n)||!s&&M(`${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(he),n=new Set(d);for(const r of e){!(I(u,r)||!s&&M(`${u}/output`,r))&&t.some(e=>e(r))&&n.add(r);}return e.filter(e=>n.has(e))}return d}async function me(e,t){const n=(await(async()=>{try{const e=await Promise.resolve().then(function(){return Qc}),t=e.makeStanDirs,n=e.default?.makeStanDirs,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("makeStanDirs export not found in ./paths")})())(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}}async function ge(e,t){const n=await me(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}}async function ye(e,n,r={}){const{includeOutputDir:s=false,fileName:i,includes:a=[],excludes:c=[],anchors:u=[]}=r;let l=i??"archive.tar";l.endsWith(".tar")||(l+=".tar");const{outDir:f,diffDir:h}=await ge(e,n),d=await fe(e),m=await de(d,{cwd:e,stanPath:n,includeOutputDir:s,includes:a,excludes:c,anchors:u}),g=resolve(f,l),y=resolve(h,P);if(existsSync(g))try{await copyFile(g,y);}catch{}const v=await(async()=>{try{const e=await import('./classifier-Bqzr65UC-BlsMFS8t.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:_,warningsBody:b}=await v(e,m),w=_;H(b,r.onArchiveWarnings);const S=await import('./index-ucZa1KMb-CNGeWGvV.js');if(s?await S.create({file:g,cwd:e,filter:D(n)},j(w,n)):await S.create({file:g,cwd:e,filter:D(n)},w),!existsSync(y))try{await copyFile(g,y);}catch{}return g}const ve=".stan",_e="code -g {file}",be=e=>e instanceof URL?fileURLToPath(e):e;function we({cwd:t}={}){const n=function(t,{cwd:n=process$3.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(be(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,be(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 Se=["stan.config.yml","stan.config.yaml","stan.config.json"],Ae=e=>{for(const n of Se){const r=resolve(e,n);if(existsSync(r))return r}return null},ke=e=>{const t=Ae(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=we({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ae(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Ee,xe={},Oe={},$e={},Re={};function Ce(){if(Ee)return Re;Ee=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 Re.ALIAS=e,Re.DOC=t,Re.MAP=n,Re.NODE_TYPE=o,Re.PAIR=r,Re.SCALAR=s,Re.SEQ=i,Re.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Re.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Re.isCollection=c,Re.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Re.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Re.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Re.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Re.isScalar=a,Re.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Re}var Te,Pe,Le={};function Ne(){if(Te)return Le;Te=1;var e=Ce();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,Le.visit=s,Le.visitAsync=o,Le}function Ie(){if(Pe)return $e;Pe=1;var e=Ce(),t=Ne();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:"},$e.Directives=s,$e}var Me,De={},je={},He={};function Fe(){if(Me)return He;Me=1;var e=Ce(),t=Ne();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 He.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},He.anchorNames=n,He.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}},He.findNewAnchor=r,He}var Be,ze={},Ke={};function Ue(){if(Be)return Ke;return Be=1,Ke.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)},Ke}var qe,Ze,We,Ge={};function Ve(){if(qe)return Ge;qe=1;var e=Ce();return Ge.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)},Ge}function Ye(){if(Ze)return ze;Ze=1;var e=Ue(),t=Ce(),n=Ve();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 Qe(){if(We)return je;We=1;var e=Fe(),t=Ne(),n=Ce(),r=Ye(),s=Ve();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 je.Alias=i,je}var Je,Xe,et,tt={},nt={},rt={};function st(){if(Je)return rt;Je=1;var e=Ce(),t=Ye(),n=Ve();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",rt.Scalar=r,rt.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,rt}function it(){if(Xe)return nt;Xe=1;var e=Qe(),t=Ce(),n=st();return nt.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},nt}function ot(){if(et)return tt;et=1;var e=it(),t=Ce(),n=Ye();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 tt.Collection=i,tt.collectionFromPath=r,tt.isEmptyPath=s,tt}var at,ct={},ut={},lt={},ft={};function pt(){if(at)return ft;at=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ft.indentComment=e,ft.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ft.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ft}var ht,dt,mt,gt,yt={},vt={};function _t(){if(ht)return vt;ht=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 vt.FOLD_BLOCK=e,vt.FOLD_FLOW="flow",vt.FOLD_QUOTED=t,vt.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,m,g=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):g=a-o);let y=false,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(g=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)),g=v+s.length+f,d=void 0;else {if(" "===o&&m&&" "!==m&&"\n"!==m&&"\t"!==m){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v);}if(v>=g)if(d)p.push(d),g=d+f,d=void 0;else if(i===t){for(;" "===m||"\t"===m;)m=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,g=e+f,d=void 0;}else y=true;}m=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},vt}function bt(){if(dt)return yt;dt=1;var e=st(),t=_t();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 m=u.indent||(u.forceBlockIndent||r(c)?" ":""),g="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,m.length));if(!c)return g?"|\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,`$&${m}`));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,`$&${m}`));let E=(S?m?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!g){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);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}${_}`,m,t.FOLD_BLOCK,o);if(!s)return `>${E}\n${m}${a}`}return `|${E}\n${m}${k}${c=c.replace(/\n+/g,`$&${m}`)}${_}`}return yt.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:m}=a;m!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=e.Scalar.QUOTE_DOUBLE);const g=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:m,inFlow:g}=i;if(h&&f.includes("\n")||g&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||g||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!g&&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===m)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=g(m);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=g(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},yt}function wt(){if(mt)return lt;mt=1;var e=Fe(),t=Ce(),n=pt(),r=bt();return lt.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}},lt.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},lt}function St(){if(gt)return ut;gt=1;var e=Ce(),t=st(),n=wt(),r=pt();return ut.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:m}}=o;let g=e.isNode(s)&&s.comment||null;if(m){if(g)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=!m&&(!s||g&&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&&(m||!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(m)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&&!m||null==i&&y)return A=`? ${A}`,g&&!w?A+=r.lineComment(A,o.indent,h(g)):S&&c&&c(),A;w&&(g=null),y?(g&&(A+=r.lineComment(A,o.indent,h(g))),A=`? ${A}\n${f}:`):(A=`${A}:`,g&&(A+=r.lineComment(A,o.indent,h(g)))),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||g||!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(g||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},ut}var At,kt={},Et={};function xt(){if(At)return Et;At=1;var e=w;return Et.debug=function(e,...t){"debug"===e&&console.log(...t);},Et.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Et}var Ot,$t,Rt,Ct={};function Tt(){if(Ot)return Ct;Ot=1;var e=Ce(),t=st();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 Ct.addMergeToJSMap=s,Ct.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),Ct.merge=r,Ct}function Pt(){if($t)return kt;$t=1;var e=xt(),t=Tt(),n=wt(),r=Ce(),s=Ve();return kt.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},kt}function Lt(){if(Rt)return ct;Rt=1;var e=it(),t=St(),n=Pt(),r=Ce();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 ct.Pair=s,ct.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)},ct}var Nt,It,Mt,Dt={},jt={},Ht={},Ft={};function Bt(){if(Nt)return Ft;Nt=1;var e=Ce(),t=wt(),n=pt();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 m=false;const g=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!m&&c.spaceBefore&&g.push(""),i(o,g,c.commentBefore,m),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!m&&t.spaceBefore&&g.push(""),i(o,g,t.commentBefore,m));}m=false;let f=t.stringify(c,d,()=>l=null,()=>m=true);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=false),g.push(a+f);}let y;if(0===g.length)y=c.start+c.end;else {y=g[0];for(let e=1;e<g.length;++e){const t=g[e];y+=t?`\n${p}${t}`:"\n";}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):m&&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 m=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&m.push(""),i(s,m,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&&m.push(""),i(s,m,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&&(m.length>d||l.includes("\n"))&&(h=true),m.push(l),d=m.length;}const{start:g,end:y}=o;if(0===m.length)return g+y;if(!h){const e=m.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth;}if(h){let e=g;for(const t of m)e+=t?`\n${u}${c}${t}`:"\n";return `${e}\n${c}${y}`}return `${g}${l}${m.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 Ft.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ft}function zt(){if(It)return Ht;It=1;var e=Bt(),t=Pt(),n=ot(),r=Ce(),s=Lt(),i=st();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 Ht.YAMLMap=a,Ht.findPair=o,Ht}function Kt(){if(Mt)return jt;Mt=1;var e=Ce(),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 jt.map=n,jt}var Ut,qt,Zt={},Wt={};function Gt(){if(Ut)return Wt;Ut=1;var e=it(),t=Bt(),n=ot(),r=Ce(),s=st(),i=Ve();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 Wt.YAMLSeq=o,Wt}function Vt(){if(qt)return Zt;qt=1;var e=Ce(),t=Gt();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 Zt.seq=n,Zt}var Yt,Qt={};function Jt(){if(Yt)return Qt;Yt=1;var e=bt();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 Qt.string=t,Qt}var Xt,en={},tn={};function nn(){if(Xt)return tn;Xt=1;var e=st();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 tn.nullTag=t,tn}var rn,sn={};function on$1(){if(rn)return sn;rn=1;var e=st();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 sn.boolTag=t,sn}var an,cn,un={},ln={};function fn(){if(an)return ln;return an=1,ln.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},ln}function pn(){if(cn)return un;cn=1;var e=st(),t=fn();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 un.float=s,un.floatExp=r,un.floatNaN=n,un}var hn,dn={};function mn(){if(hn)return dn;hn=1;var e=fn();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 dn.int=i,dn.intHex=o,dn.intOct=s,dn}var gn,yn={};function vn(){if(gn)return yn;gn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn();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 yn.schema=a,yn}var _n,bn={};function wn(){if(_n)return bn;_n=1;var e=st(),t=Kt(),n=Vt();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 bn.schema=a,bn}var Sn,An={};function kn(){if(Sn)return An;Sn=1;var e=require$$0,t=st(),n=bt();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 An.binary=r,An}var En,xn,On={},$n={};function Rn(){if(En)return $n;En=1;var e=Ce(),t=Lt(),n=st(),r=Gt();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 $n.createPairs=i,$n.pairs=o,$n.resolvePairs=s,$n}function Cn(){if(xn)return On;xn=1;var e=Ce(),t=Ve(),n=zt(),r=Gt(),s=Rn();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 On.YAMLOMap=i,On.omap=o,On}var Tn,Pn={},Ln={};function Nn(){if(Tn)return Ln;Tn=1;var e=st();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 Ln.falseTag=r,Ln.trueTag=n,Ln}var In,Mn={};function Dn(){if(In)return Mn;In=1;var e=st(),t=fn();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 Mn.float=s,Mn.floatExp=r,Mn.floatNaN=n,Mn}var jn,Hn={};function Fn(){if(jn)return Hn;jn=1;var e=fn();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 Hn.int=o,Hn.intBin=s,Hn.intHex=a,Hn.intOct=i,Hn}var Bn,zn={};function Kn(){if(Bn)return zn;Bn=1;var e=Ce(),t=Lt(),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 Un,qn,Zn,Wn,Gn={};function Vn(){if(Un)return Gn;Un=1;var e=fn();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 Gn.floatTime=s,Gn.intTime=r,Gn.timestamp=i,Gn}function Yn(){if(qn)return Pn;qn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=kn(),i=Nn(),o=Dn(),a=Fn(),c=Tt(),u=Cn(),l=Rn(),f=Kn(),p=Vn();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 Pn.schema=h,Pn}function Qn(){if(Zn)return en;Zn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn(),a=vn(),c=wn(),u=kn(),l=Tt(),f=Cn(),p=Rn(),h=Yn(),d=Kn(),m=Vn();const g=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:m.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:m.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:m.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":m.timestamp};return en.coreKnownTags=v,en.getTags=function(e,t,n){const r=g.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(g.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},[])},en}function Jn(){if(Wn)return Dt;Wn=1;var e=Ce(),t=Kt(),n=Vt(),r=Jt(),s=Qn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Dt.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}},Dt}var Xn,er,tr={};function nr(){if(Xn)return tr;Xn=1;var e=Ce(),t=wt(),n=pt();return tr.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"},tr}function rr(){if(er)return De;er=1;var e=Qe(),t=ot(),n=Ce(),r=Lt(),s=Ve(),i=Jn(),o=nr(),a=Fe(),c=Ue(),u=it(),l=Ie();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return De.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:m}=a.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:i??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);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)}},De}var sr,ir={};function or(){if(sr)return ir;sr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ir.YAMLError=e,ir.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ir.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ir.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`;}},ir}var ar,cr={},ur={},lr={},fr={},pr={};function hr(){if(ar)return pr;return ar=1,pr.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,m=null,g=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),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case "space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(m=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,(g||y)&&(v=s),l=true;break;case "anchor":g&&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),g=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:(g||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"),m&&(u&&m.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:g,tag:y,newlineAfterProp:v,end:A,start:w??A}},pr}var dr,mr={};function gr(){if(dr)return mr;return dr=1,mr.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}},mr}var yr,vr={};function _r(){if(yr)return vr;yr=1;var e=gr();return vr.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);}}},vr}var br,wr,Sr={};function Ar(){if(br)return Sr;br=1;var e=Ce();return Sr.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))},Sr}function kr(){if(wr)return fr;wr=1;var e=Lt(),t=zt(),n=hr(),r=gr(),s=_r(),i=Ar();const o="All mapping items must start at the same column";return fr.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,m=null;for(const t of l.items){const{start:p,key:g,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:g??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:true}),b=!_.found;if(b){if(g&&("block-seq"===g.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){m=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(g))&&f(g??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=g?a(u,g,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,g,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:!g||"block-scalar"===g.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 m&&m<d&&f(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,m??d],h},fr}var Er,xr={};function Or(){if(Er)return xr;Er=1;var e=Gt(),t=hr(),n=_r();return xr.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},xr}var $r,Rr,Cr,Tr={},Pr={};function Lr(){if($r)return Pr;return $r=1,Pr.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}},Pr}function Nr(){if(Rr)return Tr;Rr=1;var e=Ce(),t=Lt(),n=zt(),r=Gt(),s=Lr(),i=hr(),o=gr(),a=Ar();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Tr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,m){const g="{"===h.start.source,y=g?"flow map":"flow sequence",v=new(m?.nodeClass??(g?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:m,key:_,sep:w,value:S}=s,A=i.resolveProps(m,{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}!g&&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 m)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(g||w||A.found){p.atKey=true;const e=A.end,r=_?l(p,_,A,d):f(p,e,m,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(!g&&!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),g){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=g?"}":"]",[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},Tr}function Ir(){if(Cr)return lr;Cr=1;var e=Ce(),t=st(),n=zt(),r=Gt(),s=kr(),i=Or(),o=Nr();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 lr.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),m=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,g=e.isNode(m)?m:new t.Scalar(m);return g.range=d.range,g.tag=f,h?.format&&(g.format=h.format),g},lr}var Mr,Dr={},jr={};function Hr(){if(Mr)return jr;Mr=1;var e=st();return jr.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 m=s+i.length+n.source.length;return {value:p,type:o,comment:i.comment,range:[s,m,m]}},jr}var Fr,Br,zr={};function Kr(){if(Fr)return zr;Fr=1;var e=st(),t=Lr();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 m=(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,m);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,m);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,m);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 g=u+f.length,y=t.resolveEnd(p,g,a,c);return {value:d,type:h,comment:y.comment,range:[u,g,y.offset]}},zr}function Ur(){if(Br)return Dr;Br=1;var e=Ce(),t=st(),n=Hr(),r=Kr();return Dr.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},Dr}var qr,Zr,Wr,Gr,Vr={};function Yr(){if(qr)return Vr;return qr=1,Vr.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},Vr}function Qr(){if(Zr)return ur;Zr=1;var e=Qe(),t=Ce(),n=Ir(),r=Ur(),s=Lr(),i=Yr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:m}=u;let g,y=true;switch(a.type){case "alias":g=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||m)&&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":g=r.composeScalar(i,a,m,l),d&&(g.anchor=d.source.substring(1));break;case "block-map":case "block-seq":case "flow-collection":g=n.composeCollection(o,i,a,u,l),d&&(g.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),g=c(i,a.offset,void 0,null,u,l),y=false;}if(d&&""===g.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(g)||"string"!=typeof g.value||g.tag&&"tag:yaml.org,2002:str"!==g.tag)){l(m??a,"NON_STRING_KEY","With stringKeys, all keys must be strings");}return p&&(g.spaceBefore=true),h&&("scalar"===a.type&&""===a.source?g.comment=h:g.commentBefore=h),i.options.keepSourceTokens&&y&&(g.srcToken=a),g}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 ur.composeEmptyNode=c,ur.composeNode=a,ur}function Jr(){if(Wr)return cr;Wr=1;var e=rr(),t=Qr(),n=Lr(),r=hr();return cr.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 m=p.contents.range[2],g=n.resolveEnd(u,m,false,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},cr}function Xr(){if(Gr)return Oe;Gr=1;var e=w,t=Ie(),n=rr(),r=or(),s=Ce(),i=Jr(),o=Lr();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 Oe.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;}}},Oe}var es,ts={},ns={};function rs(){if(es)return ns;es=1;var e=Hr(),t=Kr(),n=or(),r=bt();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 ns.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}}},ns.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},ns.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");}},ns}var ss,is={};function os(){if(ss)return is;ss=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 is.stringify=n=>"type"in n?e(n):t(n),is}var as,cs,us={};function ls(){if(as)return us;as=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")},us.visit=r,us}function fs(){if(cs)return ts;cs=1;var e=rs(),t=os(),n=ls();return ts.createScalarToken=e.createScalarToken,ts.resolveAsScalar=e.resolveAsScalar,ts.setScalarValue=e.setScalarValue,ts.stringify=t.stringify,ts.visit=n.visit,ts.BOM="\ufeff",ts.DOCUMENT="",ts.FLOW_END="",ts.SCALAR="",ts.isCollection=e=>!!e&&"items"in e,ts.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),ts.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},ts.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},ts}var ps,hs={};function ds(){if(ps)return hs;ps=1;var e=fs();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 hs.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)}},hs}var ms,gs={};function ys(){if(ms)return gs;ms=1;return gs.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}};}},gs}var vs,_s={};function bs(){if(vs)return _s;vs=1;var e=w,t=fs(),n=ds();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 _s.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());}}},_s}var ws,Ss,As={};function ks(){if(ws)return As;ws=1;var e=Xr(),t=rr(),n=or(),r=xt(),s=Ce(),i=ys(),o=bs();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 As.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))},As.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())},As.parseDocument=c,As.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)},As}var Es=function(){if(Ss)return xe;Ss=1;var e=Xr(),t=rr(),n=Jn(),r=or(),s=Qe(),i=Ce(),o=Lt(),a=st(),c=zt(),u=Gt(),l=fs(),f=ds(),p=ys(),h=bs(),d=ks(),m=Ne();return xe.Composer=e.Composer,xe.Document=t.Document,xe.Schema=n.Schema,xe.YAMLError=r.YAMLError,xe.YAMLParseError=r.YAMLParseError,xe.YAMLWarning=r.YAMLWarning,xe.Alias=s.Alias,xe.isAlias=i.isAlias,xe.isCollection=i.isCollection,xe.isDocument=i.isDocument,xe.isMap=i.isMap,xe.isNode=i.isNode,xe.isPair=i.isPair,xe.isScalar=i.isScalar,xe.isSeq=i.isSeq,xe.Pair=o.Pair,xe.Scalar=a.Scalar,xe.YAMLMap=c.YAMLMap,xe.YAMLSeq=u.YAMLSeq,xe.CST=l,xe.Lexer=f.Lexer,xe.LineCounter=p.LineCounter,xe.Parser=h.Parser,xe.parse=d.parse,xe.parseAllDocuments=d.parseAllDocuments,xe.parseDocument=d.parseDocument,xe.stringify=d.stringify,xe.visit=m.visit,xe.visitAsync=m.visitAsync,xe}(),xs=B(Es);function Os(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 $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Rs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Cs={};function Ts(e){return Cs}function Ps(e,t){return "bigint"==typeof t?t.toString():t}function Ls(e){return {get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ns(e){return null==e}function Is(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ms=Symbol("evaluating");function Ds(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ms)return void 0===r&&(r=Ms,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function js(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Hs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}const Bs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ks=Ls(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Us(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 qs(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const Zs=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vs(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 Ys(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 Qs(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function Js(e){return "string"==typeof e?e:e?.message}function Xs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Js(e.inst?._zod.def?.error?.(e))??Js(t?.error?.(e))??Js(n.customError?.(e))??Js(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ti(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ni=(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,Ps,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ri=Os("$ZodError",ni),si=Os("$ZodError",ni,{Parent:Error});const ii=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 $s;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},oi=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=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},ai=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 $s;return i.issues.length?{success:false,error:new(e??ri)(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},ci=ai(si),ui=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=>Xs(e,s,Ts())))}:{success:true,data:i.value}},li=ui(si),fi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ii(e)(t,n,s)},pi=e=>(t,n,r)=>ii(e)(t,n,r),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oi(e)(t,n,s)},di=e=>async(t,n,r)=>oi(e)(t,n,r),mi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},gi=e=>(t,n,r)=>ai(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>async(t,n,r)=>ui(e)(t,n,r),_i=/^[cC][^\s-]{8,}$/,bi=/^[0-9a-z]+$/,wi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Si=/^[0-9a-vA-V]{20}$/,Ai=/^[A-Za-z0-9]{27}$/,ki=/^[a-zA-Z0-9_-]{21}$/,Ei=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xi=/^([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})$/,Oi=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)$/,$i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ri=/^(?:(?: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])$/,Ci=/^(([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}|:))$/,Ti=/^((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])$/,Pi=/^(([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])$/,Li=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ni=/^[A-Za-z0-9_-]*$/,Ii=/^(?=.{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])?)*\.?$/,Mi=/^\+(?:[0-9]){6,14}[0-9]$/,Di="(?:(?:\\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])))",ji=new RegExp(`^${Di}$`);function Hi(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 Fi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,zi=Os("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Ki=Os("$ZodCheckMaxLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Ui=Os("$ZodCheckMinLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),qi=Os("$ZodCheckLengthEquals",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(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});};}),Zi=Os("$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=()=>{});}),Wi=Os("$ZodCheckRegex",(e,t)=>{Zi.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});};}),Gi=Os("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fi),Zi.init(e,t);}),Vi=Os("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bi),Zi.init(e,t);}),Yi=Os("$ZodCheckIncludes",(e,t)=>{zi.init(e,t);const n=Ws(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});};}),Qi=Os("$ZodCheckStartsWith",(e,t)=>{zi.init(e,t);const n=new RegExp(`^${Ws(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});};}),Ji=Os("$ZodCheckEndsWith",(e,t)=>{zi.init(e,t);const n=new RegExp(`.*${Ws(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});};}),Xi=Os("$ZodCheckOverwrite",(e,t)=>{zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class eo{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 to={major:4,minor:1,patch:12},no=Os("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;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=Ys(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 $s;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ys(e,t)));});else {if(e.issues.length===t)continue;s||(s=Ys(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ys(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new $s;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 $s;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=ci(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return li(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ro=Os("$ZodString",(e,t)=>{var n;no.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};}),so=Os("$ZodStringFormat",(e,t)=>{Zi.init(e,t),ro.init(e,t);}),io=Os("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xi),so.init(e,t);}),oo=Os("$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=Oi(e));}else t.pattern??(t.pattern=Oi());so.init(e,t);}),ao=Os("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$i),so.init(e,t);}),co=Os("$ZodURL",(e,t)=>{so.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:Ii.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});}};}),uo=Os("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),so.init(e,t);}),lo=Os("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ki),so.init(e,t);}),fo=Os("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_i),so.init(e,t);}),po=Os("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bi),so.init(e,t);}),ho=Os("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wi),so.init(e,t);}),mo=Os("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Si),so.init(e,t);}),go$1=Os("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ai),so.init(e,t);}),yo=Os("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Hi({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(`^${Di}T(?:${r})$`)}(t)),so.init(e,t);}),vo=Os("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ji),so.init(e,t);}),_o=Os("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Hi(t)}$`)),so.init(e,t);}),bo=Os("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ei),so.init(e,t);}),wo=Os("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ri),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),So=Os("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ci),so.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});}};}),Ao=Os("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ti),so.init(e,t);}),ko=Os("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pi),so.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 Eo(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const xo=Os("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Li),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Eo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const Oo=Os("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ni),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!Ni.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Eo(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});};}),$o=Os("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mi),so.init(e,t);});const Ro=Os("$ZodJWT",(e,t)=>{so.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});};}),Co=Os("$ZodUnknown",(e,t)=>{no.init(e,t),e._zod.parse=e=>e;}),To=Os("$ZodNever",(e,t)=>{no.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Po(e,t,n){e.issues.length&&t.issues.push(...Qs(n,e.issues)),t.value[n]=e.value;}const Lo=Os("$ZodArray",(e,t)=>{no.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=>Po(t,n,e))):Po(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function No(e,t,n,r){e.issues.length&&t.issues.push(...Qs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Io(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 Mo(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=>No(e,n,s,t))):No(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 Do=Os("$ZodObject",(e,t)=>{no.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=Ls(()=>Io(t));Ds(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=>No(n,t,e,a))):No(r,t,e,a);}return i?Mo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),jo=Os("$ZodObjectJIT",(e,t)=>{Do.init(e,t);const n=e._zod.parse,r=Ls(()=>Io(t));let s;const i=zs,o=!Cs.jitless,a=o&&Ks.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 eo(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fs(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=Fs(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?Mo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ho(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=>!Ys(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=>Xs(e,r,Ts())))}),t)}const Fo=Os("$ZodUnion",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ds(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ds(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ds(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=>Is(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=>Ho(t,s,e,i)):Ho(a,s,e,i)};}),Bo=Os("$ZodIntersection",(e,t)=>{no.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])=>Ko(e,t,n)):Ko(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(Us(e)&&Us(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 Ko(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ys(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 Uo=Os("$ZodRecord",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Us(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(...Qs(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...Qs(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=>Xs(e,r,Ts())),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(...Qs(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...Qs(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),qo=Os("$ZodEnum",(e,t)=>{no.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=>Zs.has(typeof e)).map(e=>"string"==typeof e?Ws(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};}),Zo=Os("$ZodTransform",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(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 $s;return n.value=s,n};});function Wo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Go=Os("$ZodOptional",(e,t)=>{no.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ds(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(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=>Wo(t,e.value)):Wo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Vo=Os("$ZodNullable",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(e.source)}|null)$`):void 0}),Ds(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);}),Yo=Os("$ZodDefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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=>Qo(e,t)):Qo(r,t)};});function Qo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Jo=Os("$ZodPrefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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));}),Xo=Os("$ZodNonOptional",(e,t)=>{no.init(e,t),Ds(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=>ea(t,e)):ea(s,e)};});function ea(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 ta=Os("$ZodCatch",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(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=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)};}),na=Os("$ZodPipe",(e,t)=>{no.init(e,t),Ds(e._zod,"values",()=>t.in._zod.values),Ds(e._zod,"optin",()=>t.in._zod.optin),Ds(e._zod,"optout",()=>t.out._zod.optout),Ds(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=>ra(e,t.in,n)):ra(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ra(e,t.out,n)):ra(r,t.out,n)};});function ra(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const sa=Os("$ZodReadonly",(e,t)=>{no.init(e,t),Ds(e._zod,"propValues",()=>t.innerType._zod.propValues),Ds(e._zod,"values",()=>t.innerType._zod.values),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(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(ia):ia(r)};});function ia(e){return e.value=Object.freeze(e.value),e}const oa=Os("$ZodCustom",(e,t)=>{zi.init(e,t),no.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=>aa(t,n,r,e));aa(s,n,r,e);};});function aa(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(ti(e));}}class ca{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 ua(){return new ca}const la=ua();function fa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Vs(t)})}function pa(e,t){return new Ki({check:"max_length",...Vs(t),maximum:e})}function ha(e,t){return new Ui({check:"min_length",...Vs(t),minimum:e})}function da(e,t){return new qi({check:"length_equals",...Vs(t),length:e})}function ma(e){return new Xi({check:"overwrite",tx:e})}function ga(e){const t=function(e,t){const n=new zi({check:"custom",...Vs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ti(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(ti(r));}},e(n.value,n)));return t}const ya=Os("ZodISODateTime",(e,t)=>{yo.init(e,t),Ua.init(e,t);});function va(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Vs(t)})}(ya,e)}const _a$1=Os("ZodISODate",(e,t)=>{vo.init(e,t),Ua.init(e,t);});function ba(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vs(t)})}(_a$1,e)}const wa=Os("ZodISOTime",(e,t)=>{_o.init(e,t),Ua.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vs(t)})}(wa,e)}const Aa=Os("ZodISODuration",(e,t)=>{bo.init(e,t),Ua.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vs(t)})}(Aa,e)}const Ea=(e,t)=>{ri.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else {let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++;}}};return r(e),n}(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,Ps,2);}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ps,2);}},isEmpty:{get:()=>0===e.issues.length}});},xa=Os("ZodError",Ea),Oa=Os("ZodError",Ea,{Parent:Error}),$a=ii(Oa),Ra=oi(Oa),Ca=ai(Oa),Ta=ui(Oa),Pa=fi(Oa),La=pi(Oa),Na=hi(Oa),Ia=di(Oa),Ma=mi(Oa),Da=gi(Oa),ja=yi(Oa),Ha=vi(Oa),Fa=Os("ZodType",(e,t)=>(no.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Hs(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Gs(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>$a(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ca(e,t,n),e.parseAsync=async(t,n)=>Ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ta(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Pa(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Na(e,t,n),e.decodeAsync=async(t,n)=>Ia(e,t,n),e.safeEncode=(t,n)=>Ma(e,t,n),e.safeDecode=(t,n)=>Da(e,t,n),e.safeEncodeAsync=async(t,n)=>ja(e,t,n),e.safeDecodeAsync=async(t,n)=>Ha(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,...Vs(n)})}(Nc,e,t)}(t,n)),e.superRefine=t=>e.check(ga(t)),e.overwrite=t=>e.check(ma(t)),e.optional=()=>kc(e),e.nullable=()=>xc(e),e.nullish=()=>kc(xc(e)),e.nonoptional=t=>function(e,t){return new Rc({type:"nonoptional",innerType:e,...Vs(t)})}(e,t),e.array=()=>mc(e),e.or=t=>vc([e,t]),e.and=t=>new _c({type:"intersection",left:e,right:t}),e.transform=t=>Pc(e,new Sc({type:"transform",transform:t})),e.default=t=>{return n=t,new Oc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.prefault=t=>{return n=t,new $c({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.catch=t=>{return new Cc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Pc(e,t),e.readonly=()=>new Lc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return la.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>la.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return la.get(e);const n=e.clone();return la.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ba=Os("_ZodString",(e,t)=>{ro.init(e,t),Fa.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 Wi({check:"string_format",format:"regex",...Vs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Yi({check:"string_format",format:"includes",...Vs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"starts_with",...Vs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ji({check:"string_format",format:"ends_with",...Vs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ha(...t)),e.max=(...t)=>e.check(pa(...t)),e.length=(...t)=>e.check(da(...t)),e.nonempty=(...t)=>e.check(ha(1,...t)),e.lowercase=t=>e.check(function(e){return new Gi({check:"string_format",format:"lowercase",...Vs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Vi({check:"string_format",format:"uppercase",...Vs(e)})}(t)),e.trim=()=>e.check(ma(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ma(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ma(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ma(e=>e.toUpperCase()));}),za=Os("ZodString",(e,t)=>{ro.init(e,t),Ba.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Vs(t)})}(qa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Vs(t)})}(Ga,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Vs(t)})}(uc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Vs(t)})}(Va,t)),e.guid=t=>e.check(fa(Za,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Vs(t)})}(Wa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Vs(t)})}(Wa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Vs(t)})}(Wa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Vs(t)})}(Wa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Vs(t)})}(Ya,t)),e.guid=t=>e.check(fa(Za,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Vs(t)})}(Qa,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Vs(t)})}(Ja,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Vs(t)})}(Xa,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Vs(t)})}(oc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Vs(t)})}(ac,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Vs(t)})}(ec,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Vs(t)})}(tc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Vs(t)})}(nc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Vs(t)})}(rc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Vs(t)})}(sc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Vs(t)})}(ic,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Vs(t)})}(cc,t)),e.datetime=t=>e.check(va(t)),e.date=t=>e.check(ba(t)),e.time=t=>e.check(Sa(t)),e.duration=t=>e.check(ka(t));});function Ka(e){return function(e,t){return new e({type:"string",...Vs(t)})}(za,e)}const Ua=Os("ZodStringFormat",(e,t)=>{so.init(e,t),Ba.init(e,t);}),qa=Os("ZodEmail",(e,t)=>{ao.init(e,t),Ua.init(e,t);}),Za=Os("ZodGUID",(e,t)=>{io.init(e,t),Ua.init(e,t);}),Wa=Os("ZodUUID",(e,t)=>{oo.init(e,t),Ua.init(e,t);}),Ga=Os("ZodURL",(e,t)=>{co.init(e,t),Ua.init(e,t);}),Va=Os("ZodEmoji",(e,t)=>{uo.init(e,t),Ua.init(e,t);}),Ya=Os("ZodNanoID",(e,t)=>{lo.init(e,t),Ua.init(e,t);}),Qa=Os("ZodCUID",(e,t)=>{fo.init(e,t),Ua.init(e,t);}),Ja=Os("ZodCUID2",(e,t)=>{po.init(e,t),Ua.init(e,t);}),Xa=Os("ZodULID",(e,t)=>{ho.init(e,t),Ua.init(e,t);}),ec=Os("ZodXID",(e,t)=>{mo.init(e,t),Ua.init(e,t);}),tc=Os("ZodKSUID",(e,t)=>{go$1.init(e,t),Ua.init(e,t);}),nc=Os("ZodIPv4",(e,t)=>{wo.init(e,t),Ua.init(e,t);}),rc=Os("ZodIPv6",(e,t)=>{So.init(e,t),Ua.init(e,t);}),sc=Os("ZodCIDRv4",(e,t)=>{Ao.init(e,t),Ua.init(e,t);}),ic=Os("ZodCIDRv6",(e,t)=>{ko.init(e,t),Ua.init(e,t);}),oc=Os("ZodBase64",(e,t)=>{xo.init(e,t),Ua.init(e,t);}),ac=Os("ZodBase64URL",(e,t)=>{Oo.init(e,t),Ua.init(e,t);}),cc=Os("ZodE164",(e,t)=>{$o.init(e,t),Ua.init(e,t);}),uc=Os("ZodJWT",(e,t)=>{Ro.init(e,t),Ua.init(e,t);}),lc=Os("ZodUnknown",(e,t)=>{Co.init(e,t),Fa.init(e,t);});function fc(){return new lc({type:"unknown"})}const pc=Os("ZodNever",(e,t)=>{To.init(e,t),Fa.init(e,t);});function hc(e){return function(e,t){return new e({type:"never",...Vs(t)})}(pc,e)}const dc=Os("ZodArray",(e,t)=>{Lo.init(e,t),Fa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ha(t,n)),e.nonempty=t=>e.check(ha(1,t)),e.max=(t,n)=>e.check(pa(t,n)),e.length=(t,n)=>e.check(da(t,n)),e.unwrap=()=>e.element;});function mc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vs(n)})}(dc,e,t)}const gc=Os("ZodObject",(e,t)=>{jo.init(e,t),Fa.init(e,t),Ds(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wc({type:"enum",entries:n,...Vs(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:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:hc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Us(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=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return js(this,"shape",n),n},checks:[]});return Gs(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:e._zod.def.checks};return Gs(e,n)}(e,t),e.merge=t=>function(e,t){const n=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return js(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gs(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Gs(e,Hs(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 js(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Hs(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 js(this,"shape",r),r},checks:[]});return Gs(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Hs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Ac,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Hs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Rc,e,t[0]);});const yc=Os("ZodUnion",(e,t)=>{Fo.init(e,t),Fa.init(e,t),e.options=t.options;});function vc(e,t){return new yc({type:"union",options:e,...Vs(t)})}const _c=Os("ZodIntersection",(e,t)=>{Bo.init(e,t),Fa.init(e,t);});const bc=Os("ZodRecord",(e,t)=>{Uo.init(e,t),Fa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const wc=Os("ZodEnum",(e,t)=>{qo.init(e,t),Fa.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 wc({...t,checks:[],...Vs(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 wc({...t,checks:[],...Vs(r),entries:s})};});const Sc=Os("ZodTransform",(e,t)=>{Zo.init(e,t),Fa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ti(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(ti(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const Ac=Os("ZodOptional",(e,t)=>{Go.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function kc(e){return new Ac({type:"optional",innerType:e})}const Ec=Os("ZodNullable",(e,t)=>{Vo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function xc(e){return new Ec({type:"nullable",innerType:e})}const Oc=Os("ZodDefault",(e,t)=>{Yo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const $c=Os("ZodPrefault",(e,t)=>{Jo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Rc=Os("ZodNonOptional",(e,t)=>{Xo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Cc=Os("ZodCatch",(e,t)=>{ta.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Tc=Os("ZodPipe",(e,t)=>{na.init(e,t),Fa.init(e,t),e.in=t.in,e.out=t.out;});function Pc(e,t){return new Tc({type:"pipe",in:e,out:t})}const Lc=Os("ZodReadonly",(e,t)=>{sa.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Os("ZodCustom",(e,t)=>{oa.init(e,t),Fa.init(e,t);});const Ic=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},Mc=(e,t)=>{const n=t?JSON.parse(e):xs.parse(e);return n&&"object"==typeof n?n:{}},Dc=mc(Ka()).default([]).optional(),jc=vc([Ka(),mc(Ka())]),Hc=(Fc=Ka(),Bc=jc,new bc({type:"record",keyType:Fc,valueType:Bc,...Vs(zc)})).optional();var Fc,Bc,zc;const Kc=function(e,t){const n={type:"object",shape:e??{},...Vs(t)};return new gc(n)}({stanPath:Ka().min(1,{message:"stanPath must be a non-empty string"}),includes:Dc,excludes:Dc,imports:Hc}).strict(),Uc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Kc.parse(e)}catch(e){throw new Error((e=>e instanceof xa?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))}},qc=e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Mc(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=Uc(s["stan-core"]),o=Ic(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Zc=async e=>{const t=ke(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=Mc(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=Uc(r["stan-core"]),o=Ic(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Wc=e=>{try{return qc(e).stanPath}catch{return ve}},Gc=async e=>{try{return (await Zc(e)).stanPath}catch{return ve}};function Vc(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)}}var Yc={makeStanDirs:Vc},Qc=Object.freeze({__proto__:null,default:Yc,makeStanDirs:Vc});const Jc=async(e,n,i=false)=>{const a=Vc(e,n);if(await me(e,n),!i){const e=resolve(a.outputAbs,T);if(existsSync(e))try{await copyFile(e,resolve(a.diffAbs,P));}catch{}const n=await readdir(a.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(a.outputAbs,e.name),{recursive:true,force:true});}return a.rootAbs},Xc=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},eu=e=>join(e,".archive.snapshot.json");async function tu({cwd:e,stanPath:t,includes:n,excludes:r,anchors:s}){const{diffDir:i}=await ge(e,t),o=await fe(e),c=await de(o,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[],anchors:s??[]}),u=await Xc(e,c),l=eu(i);return await writeFile(l,JSON.stringify(u,null,2),"utf8"),l}async function nu({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=false,anchors:l,onArchiveWarnings:f}){const{outDir:p,diffDir:d}=await ge(e,n),m=await fe(e),g=await de(m,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[],anchors:l??[]}),y=await Xc(e,g),v=eu(d),_=existsSync(v),b=_?JSON.parse(await readFile(v,"utf8")):{},w=_?g.filter(e=>!b[e]||b[e]!==y[e]):[...g],S=await(async()=>{try{const e=await import('./classifier-Bqzr65UC-BlsMFS8t.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:A,warningsBody:k}=await S(e,w),E=A;H(k,f);const x=join(p,`${r}.diff.tar`),O=await import('./index-ucZa1KMb-CNGeWGvV.js');if(u)await O.create({file:x,cwd:e,filter:D(n)},j(E,n));else if(0===E.length){const t=(e=>join(e,".stan_no_changes"))(d);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await O.create({file:x,cwd:e},r);}else {const t=Array.from(new Set([...E]));await O.create({file:x,cwd:e},t);}return "replace"===c?await writeFile(v,JSON.stringify(y,null,2),"utf8"):"createIfMissing"!==c||_||await writeFile(v,JSON.stringify(y,null,2),"utf8"),{diffPath:x}}const ru=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),su=e=>{if("string"!=typeof e||!e.trim())return null;const t=ru(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},iu=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=t.index+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},ou=/^###\s+Patch:\s+(.+?)\s*$/m,au=/^###\s+Full Listing:\s+(.+?)\s*$/m,cu=/^##\s+Commit Message\s*$/m,uu=/^##\s+.*$|^###\s+.*$/m,lu=e=>{const t=[],n=[];{const t=new RegExp(uu.source,"gm");let r;for(;r=t.exec(e);)n.push(r.index);}n.push(e.length);for(let r=0;r<n.length-1;r+=1){const s=n[r],i=n[r+1],o=e.slice(s,i);if(cu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(ou);if(a&&a[1]){t.push({kind:"patch",path:ru(a[1].trim()),start:s,body:o});continue}const c=o.match(au);c&&c[1]&&t.push({kind:"full",path:ru(c[1].trim()),start:s,body:o});}return t},fu=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:ru(r[1]),b:ru(r[2])});return n},pu=e=>{const t=[];((e,t)=>{const n=iu(e);if(!n)return;const r=n.split(/\r?\n/);for(let e=0;e<r.length;e+=1){const n=r[e].trim();if(!n)continue;const s=n.split(/\s+/),i=s[0],o=s.slice(1),a=`File Ops line ${(e+1).toString()}`,c=e=>t.push(`${a}: ${e}`),u=e=>su(e);if(/^(mv|rm|rmdir|mkdirp)$/.test(i)){if("mv"===i){if(2!==o.length){c(`expected 2 paths, got ${o.length.toString()}`);continue}const e=u(o[0]),t=u(o[1]);e&&t||c("mv: invalid repo-relative path");continue}1===o.length?u(o[0])||c(`${i}: invalid repo-relative path`):c(`expected 1 path, got ${o.length.toString()}`);}else c(`unknown verb "${i}"`);}})(e,t);const n=lu(e),r=n.filter(e=>"patch"===e.kind),s=n.filter(e=>"full"===e.kind),i=n.filter(e=>"commit"===e.kind);0===r.length&&t.push("No Patch blocks found");{const e=new Map;for(const n of r){const r=n.path??"(unknown)",s=e.get(r)??[];s.push(n),e.set(r,s);const i=fu(n.body);0===i.length?t.push(`Patch for ${r} has no "diff --git a/<path> b/<path>" header; emit a plain unified diff with git-style headers (wrappers like "*** Begin Patch" are not allowed)`):1!==i.length&&t.push(`Patch for ${r} contains multiple "diff --git" headers (found ${i.length.toString()}; expected 1)`);const o=/(^|\n)\*{3,}\s*(Begin|End)\s+Patch\b|(^|\n)Index:\s|(^|\n)\*{3,}\s*Add\s+File:/i;try{o.test(n.body)&&t.push(`Patch for ${r} contains a forbidden wrapper ("*** Begin Patch", "*** Add File:", or "Index:"). Use plain unified diff only.`);}catch{}}for(const[n,r]of e.entries())r.length>1&&t.push(`Multiple Patch blocks found for ${n} (${r.length.toString()})`);}{const e=new Map;for(const t of s){const n=ru("string"==typeof t.path?t.path:"(unknown)");e.set(n,t);}for(const n of r){const r=ru(n.path),s=e.get(r);!s||n.start<s.start||t.push(`Ordering violation for ${r}: Full Listing appears before Patch`);}}if(0===i.length)t.push('Missing "## Commit Message" section');else {"commit"!==n[n.length-1].kind&&t.push("Commit Message is not last");}if(r.length>0){const e=[];for(const t of r){const n=fu(t.body);if(n.length>0){const t=n[0]?.b,r="string"==typeof t?ru(t):"";r.length&&e.push(r);}else {const n=t.path?ru(t.path):"";n.length&&e.push(n);}}const n=e=>".stan/system/stan.todo.md"===ru(e),s=e=>{const t=ru(e);if(!t)return false;const n=(t.split("/").pop()??t).toLowerCase();return "readme.md"===n||"changelog.md"===n||"contributing.md"===n||"license"===n||"license.md"===n||(t.startsWith("docs/")||t.startsWith("docs-src/")||t.startsWith("diagrams/"))},i=e.filter(e=>!n(e));if(!(i.length>0&&i.every(e=>s(e)))){e.some(e=>n(e))||t.push('Doc cadence violation: Patch present but no Patch for ".stan/system/stan.todo.md"');}}return {ok:0===t.length,errors:t,warnings:[]}},hu=e=>{const t=pu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},du={extractBlocks:lu,parseDiffHeaders:fu,isCommitLast:e=>{if(!e.match(cu))return false;const t=e.search(cu);if(t<0)return false;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return false;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${String(s)}{'}}\\s*$`,"m");if(!n.match(i))return false;const o=n.search(i);if(o<0)return false;return 0===n.slice(o+s).trim().length}},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),gu=e=>e.endsWith("\n")?e:e+"\n",yu=/[\u200B-\u200D\uFEFF]/g,vu=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)),_u=e=>{const t=mu(e).replace(yu,"");return gu(t)},bu=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;})(_u(e.trim())),n=_u(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(t[n].trimEnd()==="`".repeat(r)){const r=t.slice(e+1,n).join("\n");if(vu(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 gu(r?_u(r).trimEnd():n)},wu=e=>{const t=[],n=[],r=iu(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=>su(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}},Su=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 {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 Au(e){return Array.isArray(e)?e.map(e=>Au(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 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(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function Eu(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 xu(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?Eu(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=Au(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=ku(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=xu(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 $u=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Ru=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Cu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Tu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Pu=e=>e.replace(/\n/g,"\r\n"),Lu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=Eu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const c=o.some(e=>{const t=Ru(e.oldFileName),n=Ru(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!c)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const u=[],l=[];for(const e of o){const n=Ru(e.newFileName)??Ru(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^\.\//,"").replace(/\\/g,"/"),c=path.resolve(t,o),p=/\.md$/i.test(o);let h="",d=false,m=true;try{const e=await readFile(c,"utf8");h=e,d=/\r\n/.test(e);}catch{m=false;}const g=Cu(e.oldFileName);if(!m&&!g){l.push({path:o,reason:"target file not found"});continue}let y;!m&&g&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Tu(t)===Tu(r),fuzzFactor:p?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?Pu(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 $u(n),await writeFile(n,v,"utf8");}else {try{await $u(c);}catch{}await writeFile(c,v,"utf8");}u.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:u,failed:l,sandboxRoot:s}},Nu=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)),c=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 ${String(n)})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(c.ok)return {ok:true,result:c,js:null};const l=await Lu({cwd:t,cleaned:r,check:s});if(l.okFiles.length>0&&0===l.failed.length)return {ok:true,result:c,js:l};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=t[1].trim().replace(/^\.\//,"").replace(/\\/g,"/");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 c=[];let l=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||c.push(t.slice(1));}}let p=c.join("\n");p.endsWith("\n")||(p+="\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,p,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:c,js:e}}catch{}return {ok:false,result:c,js:l}};var Iu,Mu={},Du={},ju={};function Hu(){if(Iu)return ju;return Iu=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.splitWhen=ju.flatten=void 0,ju.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},ju.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},ju}var Fu,Bu={};function zu(){if(Fu)return Bu;return Fu=1,Object.defineProperty(Bu,"__esModule",{value:true}),Bu.isEnoentCodeError=void 0,Bu.isEnoentCodeError=function(e){return "ENOENT"===e.code},Bu}var Ku,Uu={};var qu,Zu={};function Wu(){if(qu)return Zu;qu=1,Object.defineProperty(Zu,"__esModule",{value:true}),Zu.convertPosixPathToPattern=Zu.convertWindowsPathToPattern=Zu.convertPathToPattern=Zu.escapePosixPath=Zu.escapeWindowsPath=Zu.escape=Zu.removeLeadingDotSegment=Zu.makeAbsolute=Zu.unixify=void 0;const e=x,t="win32"===E.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 Zu.unixify=function(e){return e.replace(/\\/g,"/")},Zu.makeAbsolute=function(t,n){return e.resolve(t,n)},Zu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Zu.escape=t?o:a,Zu.escapeWindowsPath=o,Zu.escapePosixPath=a,Zu.convertPathToPattern=t?c:u,Zu.convertWindowsPathToPattern=c,Zu.convertPosixPathToPattern=u,Zu}var Gu,Vu,Yu,Qu,Ju,Xu,el={};function tl(){return Vu?Gu:(Vu=1,Gu=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 nl(){if(Qu)return Yu;Qu=1;var e=tl(),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 Yu=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 rl,sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,ml,gl,yl,vl,_l,bl,wl,Sl={};function Al(){return rl||(rl=1,(e=Sl).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}),Sl;var e;}function kl(){if(il)return sl;il=1;const e=Al();return sl=(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 El(){return al?ol:(al=1,ol=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function xl(){if(ul)return cl;ul=1;const e=El(),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=[],m=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){m=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=m,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("|")}(m,d),true===a.capture?h.result=`(${h.result})`:false!==a.wrap&&d.length+m.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={},cl=t}function Ol(){if(fl)return ll;fl=1;const e=O,t=xl(),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),m=String(n);n=Math.max(Math.abs(n),1);let g=i(h)||i(d)||i(m),y=g?Math.max(h.length,d.length,m.length):0,v=false===g&&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=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;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 ll=h}function $l(){if(_l)return vl;_l=1;const e=kl(),{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:m}=yl?gl:(yl=1,gl={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 vl=(g,y={})=>{if("string"!=typeof g)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(g.length>_)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${_})`);const b={type:"root",input:g,nodes:[]},w=[b];let S=b,A=b,k=0;const E=g.length;let x,O=0,$=0;const R=()=>g[O++],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"});O<E;)if(S=w[w.length-1],x=R(),x!==m&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;O<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="");O<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){$++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:$,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}),$--,S=w[w.length-1];continue}if(x===s&&$>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&&$>0&&0===S.commas){const e=S.nodes;if(0===$||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}}function Rl(){if(wl)return bl;wl=1;const e=kl(),t=function(){if(hl)return pl;hl=1;const e=Ol(),t=Al();return pl=(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 dl;ml=1;const e=Ol(),t=kl(),n=Al(),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 dl=(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))},dl}(),r=$l(),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),bl=s}var Cl,Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul={};function ql(){if(Tl)return Cl;Tl=1;const e=x,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 Cl={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 Zl(){return Pl||(Pl=1,function(e){const t=x,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=ql();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};}(Ul)),Ul}function Wl(){if(jl)return Dl;jl=1;const e=x,t=function(){if(Nl)return Ll;Nl=1;const e=Zl(),{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:m}=ql(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Ll=(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=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===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(O!==a){if(true!==b.noext&&true==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){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!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=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,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(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,g(O)||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},Ll}(),n=function(){if(Ml)return Il;Ml=1;const e=ql(),t=Zl(),{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 m={type:"bos",value:"",output:p.prepend||""},g=[m],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:O,NO_DOTS_SLASH:$,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:g};l=t.removePrefix(l,D),d=l.length;const j=[],H=[],F=[];let B,z=m;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,g.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(),m.output||1!==g.indexOf(z)||(m.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=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.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="",g.pop(),z=m;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+=O,z.output+=O):true===p.dot?(D.output+=$,z.output+=$):(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:m,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?m:d,b=i.dot?g: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},Il=u}(),r=Zl(),s=ql(),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,Dl=i}function Gl(){return Fl?Hl:(Fl=1,Hl=Wl())}function Vl(){if(Kl)return el;Kl=1,Object.defineProperty(el,"__esModule",{value:true}),el.isAbsolute=el.partitionAbsoluteAndRelative=el.removeDuplicateSlashes=el.matchAny=el.convertPatternsToRe=el.makeRe=el.getPatternParts=el.expandBraceExpansion=el.expandPatternsWithBraceExpansion=el.isAffectDepthOfReadingPattern=el.endsWithSlashGlobStar=el.hasGlobStar=el.getBaseDirectory=el.isPatternRelatedToParentDirectory=el.getPatternsOutsideCurrentDirectory=el.getPatternsInsideCurrentDirectory=el.getPositivePatterns=el.getNegativePatterns=el.isPositivePattern=el.isNegativePattern=el.convertToNegativePattern=el.convertToPositivePattern=el.isDynamicPattern=el.isStaticPattern=void 0;const e=x,t=function(){if(Xu)return Ju;Xu=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Ju=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(zl)return Bl;zl=1;const e=O,t=Rl(),n=Gl(),r=Zl(),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,Bl=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 m(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 g(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return el.isStaticPattern=u,el.isDynamicPattern=l,el.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},el.convertToNegativePattern=function(e){return "!"+e},el.isNegativePattern=f,el.isPositivePattern=p,el.getNegativePatterns=function(e){return e.filter(f)},el.getPositivePatterns=function(e){return e.filter(p)},el.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},el.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},el.isPatternRelatedToParentDirectory=h,el.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},el.hasGlobStar=function(e){return e.includes("**")},el.endsWithSlashGlobStar=d,el.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},el.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},el.expandBraceExpansion=m,el.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},el.makeRe=g,el.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},el.matchAny=function(e,t){return t.some(t=>t.test(e))},el.removeDuplicateSlashes=function(e){return e.replace(c,"/")},el.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},el.isAbsolute=y,el}var Yl,Ql,Jl,Xl={};function ef(){if(Ql)return Yl;Ql=1;const e=$.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 Yl=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},Yl}var tf,nf,rf,sf={};function of(){if(tf)return sf;return tf=1,Object.defineProperty(sf,"__esModule",{value:true}),sf.isEmpty=sf.isString=void 0,sf.isString=function(e){return "string"==typeof e},sf.isEmpty=function(e){return ""===e},sf}function af(){if(nf)return Du;nf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.string=Du.stream=Du.pattern=Du.path=Du.fs=Du.errno=Du.array=void 0;const e=Hu();Du.array=e;const t=zu();Du.errno=t;const n=function(){if(Ku)return Uu;Ku=1,Object.defineProperty(Uu,"__esModule",{value:true}),Uu.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 Uu.createDirentFromStats=function(t,n){return new e(t,n)},Uu}();Du.fs=n;const r=Wu();Du.path=r;const s=Vl();Du.pattern=s;const i=function(){if(Jl)return Xl;Jl=1,Object.defineProperty(Xl,"__esModule",{value:true}),Xl.merge=void 0;const e=ef();function t(e){e.forEach(e=>e.emit("close"));}return Xl.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},Xl}();Du.stream=i;const o=of();return Du.string=o,Du}var cf,uf={},lf={},ff={},pf={},hf={},df={},mf={},gf={},yf={};function vf(){if(cf)return yf;function e(e,t){e(t);}function t(e,t){e(null,t);}return cf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.read=void 0,yf.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);});},yf}var _f,bf={};var wf,Sf,Af,kf,Ef,xf,Of,$f={},Rf={};function Cf(){if(Sf)return $f;Sf=1,Object.defineProperty($f,"__esModule",{value:true});const e=(wf||(wf=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)};}(Rf)),Rf);return $f.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}},$f}function Tf(){if(Af)return gf;Af=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.statSync=gf.stat=gf.Settings=void 0;const e=vf(),t=(_f||(_f=1,Object.defineProperty(bf,"__esModule",{value:true}),bf.read=void 0,bf.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}}),bf),n=Cf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.statSync=function(e,n){const s=r(n);return t.read(e,s)},gf}function Pf(){if(Ef)return kf;let e;return Ef=1,kf="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:F):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Lf,Nf={};function If(){if(Lf)return Nf;Lf=1,Object.defineProperty(Nf,"__esModule",{value:true}),Nf.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 Nf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,Nf}var Mf,Df,jf={},Hf={};function Ff(){if(Df)return jf;Df=1,Object.defineProperty(jf,"__esModule",{value:true}),jf.fs=void 0;const e=function(){if(Mf)return Hf;Mf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.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 Hf.createDirentFromStats=function(t,n){return new e(t,n)},Hf}();return jf.fs=e,jf}var Bf,zf,Kf={};function Uf(){if(Bf)return Kf;return Bf=1,Object.defineProperty(Kf,"__esModule",{value:true}),Kf.joinPathSegments=void 0,Kf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Kf}function qf(){if(zf)return mf;zf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Tf(),t=function(){if(Of)return xf;Of=1,xf=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=Pf();return xf}(),n=If(),r=Ff(),s=Uf();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 Zf,Wf={};var Gf,Vf,Yf,Qf={},Jf={};function Xf(){return Gf||(Gf=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)};}(Jf)),Jf}function ep(){if(Yf)return df;Yf=1,Object.defineProperty(df,"__esModule",{value:true}),df.Settings=df.scandirSync=df.scandir=void 0;const e=qf(),t=function(){if(Zf)return Wf;Zf=1,Object.defineProperty(Wf,"__esModule",{value:true}),Wf.readdir=Wf.readdirWithFileTypes=Wf.read=void 0;const e=Tf(),t=If(),n=Ff(),r=Uf();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 Wf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Wf.readdirWithFileTypes=s,Wf.readdir=i,Wf}(),n=function(){if(Vf)return Qf;Vf=1,Object.defineProperty(Qf,"__esModule",{value:true});const e=x,t=Tf(),n=Xf();return Qf.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}},Qf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return df.Settings=n.default,df.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},df.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},df}var tp,np,rp,sp={exports:{}};function ip(){if(rp)return sp.exports;rp=1;var e=np?tp:(np=1,tp=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 sp.exports=t,sp.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},sp.exports}var op,ap={};function cp(){if(op)return ap;return op=1,Object.defineProperty(ap,"__esModule",{value:true}),ap.joinPathSegments=ap.replacePathSegmentSeparator=ap.isAppliedFilter=ap.isFatalError=void 0,ap.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},ap.isAppliedFilter=function(e,t){return null===e||e(t)},ap.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},ap.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},ap}var up,lp,fp,pp={};function hp(){if(up)return pp;up=1,Object.defineProperty(pp,"__esModule",{value:true});const e=cp();return pp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},pp}function dp(){if(lp)return hf;lp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=R,t=ep(),n=ip(),r=cp(),s=hp();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 hf.default=i,hf}var mp,gp={};var yp,vp,_p={},bp={};function wp(){if(vp)return _p;vp=1,Object.defineProperty(_p,"__esModule",{value:true});const e=function(){if(yp)return bp;yp=1,Object.defineProperty(bp,"__esModule",{value:true});const e=ep(),t=cp(),n=hp();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 bp.default=r,bp}();return _p.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()}},_p}var Sp,Ap,kp={};function Ep(){if(Ap)return ff;Ap=1,Object.defineProperty(ff,"__esModule",{value:true}),ff.Settings=ff.walkStream=ff.walkSync=ff.walk=void 0;const e=function(){if(fp)return pf;fp=1,Object.defineProperty(pf,"__esModule",{value:true});const e=dp();return pf.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();}},pf}(),t=function(){if(mp)return gp;mp=1,Object.defineProperty(gp,"__esModule",{value:true});const e=$,t=dp();return gp.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}},gp}(),n=wp(),r=function(){if(Sp)return kp;Sp=1,Object.defineProperty(kp,"__esModule",{value:true});const e=x,t=ep();return kp.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}},kp}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return ff.Settings=r.default,ff.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},ff.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},ff.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},ff}var xp,Op={};function $p(){if(xp)return Op;xp=1,Object.defineProperty(Op,"__esModule",{value:true});const e=x,t=Tf(),n=af();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 Rp,Cp,Tp={};function Pp(){if(Rp)return Tp;Rp=1,Object.defineProperty(Tp,"__esModule",{value:true});const e=$,t=Tf(),n=Ep(),r=$p();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 Tp.default=s,Tp}var Lp,Np,Ip,Mp={},Dp={},jp={},Hp={};function Fp(){if(Np)return jp;Np=1,Object.defineProperty(jp,"__esModule",{value:true});const e=function(){if(Lp)return Hp;Lp=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=af();return Hp.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))}},Hp}();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 jp.default=t,jp}var Bp,zp={};var Kp,Up={};var qp,Zp,Wp,Gp={};function Vp(){if(Zp)return Mp;Zp=1,Object.defineProperty(Mp,"__esModule",{value:true});const e=x,t=function(){if(Ip)return Dp;Ip=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=af(),t=Fp();return Dp.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)}},Dp}(),n=function(){if(Bp)return zp;Bp=1,Object.defineProperty(zp,"__esModule",{value:true});const e=af();return zp.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}},zp}(),r=function(){if(Kp)return Up;Kp=1,Object.defineProperty(Up,"__esModule",{value:true});const e=af();return Up.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},Up}(),s=function(){if(qp)return Gp;qp=1,Object.defineProperty(Gp,"__esModule",{value:true});const e=af();return Gp.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}},Gp}();return Mp.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}}},Mp}function Yp(){if(Wp)return uf;Wp=1,Object.defineProperty(uf,"__esModule",{value:true});const e=function(){if(Cp)return lf;Cp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=Ep(),t=$p(),n=Pp();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 lf.default=r,lf}(),t=Vp();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 uf.default=n,uf}var Qp,Jp={};var Xp,eh,th={},nh={};function rh(){if(eh)return th;eh=1,Object.defineProperty(th,"__esModule",{value:true});const e=function(){if(Xp)return nh;Xp=1,Object.defineProperty(nh,"__esModule",{value:true});const e=Tf(),t=Ep(),n=$p();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 nh.default=r,nh}(),t=Vp();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 th.default=n,th}var sh,ih,oh,ah={};var ch,uh,lh=function(){if(oh)return ih;oh=1;const e=function(){if(rf)return Mu;rf=1,Object.defineProperty(Mu,"__esModule",{value:true}),Mu.convertPatternGroupToTask=Mu.convertPatternGroupsToTasks=Mu.groupPatternsByBaseDirectory=Mu.getNegativePatternsAsPositive=Mu.getPositivePatterns=Mu.convertPatternsToTasks=Mu.generate=void 0;const e=af();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 Mu.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)},Mu.convertPatternsToTasks=n,Mu.getPositivePatterns=r,Mu.getNegativePatternsAsPositive=s,Mu.groupPatternsByBaseDirectory=i,Mu.convertPatternGroupsToTasks=o,Mu.convertPatternGroupToTask=a,Mu}(),t=Yp(),n=function(){if(Qp)return Jp;Qp=1,Object.defineProperty(Jp,"__esModule",{value:true});const e=$,t=Pp(),n=Vp();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 Jp.default=r,Jp}(),r=rh(),s=(sh||(sh=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=E,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)}};}(ah)),ah),i$1=af();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={})),ih=o}(),fh=B(lh);var ph=function(){if(uh)return ch;uh=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return ch=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")}}(),hh=B(ph);const dh=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(!dh(e))return null;return t.join("/")},gh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},yh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=Vc(t,n),a=path.join(i.rootAbs,"imports");await ensureDir(a);const c=Object.keys(r).sort();for(const e of c){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const c=path.join(a,i);await rm(c,{recursive:true,force:true}).catch(()=>{}),await ensureDir(c).catch(()=>{});const u=[];for(const e of n){const n=e.trim();if(!n)continue;const r=hh(n.replace(/\\/g,"/"));try{const e=await fh(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await gh(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(c,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{}}},vh=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),_h=e=>{const t=vh(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=vh(t);return e===n||e.startsWith(n+"/")})(vh(e),t):()=>false;var n;const r=le(t,{dot:true});return e=>r(vh(e))},bh=e=>{const t=e.map(_h);return 0===t.length?()=>false:e=>{const n=vh(e);for(const e of t)if(e(n))return true;return false}},wh=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return we({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},Sh=async(e,n)=>{const r=path.join(e,n,"system"),o=path.join(r,"parts"),c=path.join(r,"stan.system.md");if(await ensureDir(r),!existsSync(o))return {target:c,action:"skipped-no-parts",partsDir:o};const u=(await readdir(o,{withFileTypes:true})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:true}));if(0===u.length)return {target:c,action:"skipped-no-md",partsDir:o};const l=[];for(const e of u){const t=path.join(o,e),n=mu(await readFile(t,"utf8")).trimEnd();l.push(n);}const p=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(n)+l.join("\n\n")+"\n";return await writeFile(c,p,"utf8"),{target:c,action:"written"}};const Ah="0.4.6";
|
|
27
27
|
|
|
28
28
|
var index = /*#__PURE__*/Object.freeze({
|
|
29
29
|
__proto__: null,
|
|
@@ -1540,7 +1540,7 @@ function requireCommand () {
|
|
|
1540
1540
|
const childProcess = require$$1;
|
|
1541
1541
|
const path$1 = path;
|
|
1542
1542
|
const fs = c;
|
|
1543
|
-
const process = process$
|
|
1543
|
+
const process = process$3;
|
|
1544
1544
|
|
|
1545
1545
|
const { Argument, humanReadableArgName } = requireArgument();
|
|
1546
1546
|
const { CommanderError } = requireError();
|
|
@@ -4367,21 +4367,30 @@ const {
|
|
|
4367
4367
|
/** A special constant with type `never` */
|
|
4368
4368
|
function $constructor(name, initializer, params) {
|
|
4369
4369
|
function init(inst, def) {
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4370
|
+
if (!inst._zod) {
|
|
4371
|
+
Object.defineProperty(inst, "_zod", {
|
|
4372
|
+
value: {
|
|
4373
|
+
def,
|
|
4374
|
+
constr: _,
|
|
4375
|
+
traits: new Set(),
|
|
4376
|
+
},
|
|
4377
|
+
enumerable: false,
|
|
4378
|
+
});
|
|
4379
|
+
}
|
|
4380
|
+
if (inst._zod.traits.has(name)) {
|
|
4381
|
+
return;
|
|
4382
|
+
}
|
|
4376
4383
|
inst._zod.traits.add(name);
|
|
4377
4384
|
initializer(inst, def);
|
|
4378
4385
|
// support prototype modifications
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4386
|
+
const proto = _.prototype;
|
|
4387
|
+
const keys = Object.keys(proto);
|
|
4388
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4389
|
+
const k = keys[i];
|
|
4390
|
+
if (!(k in inst)) {
|
|
4391
|
+
inst[k] = proto[k].bind(inst);
|
|
4392
|
+
}
|
|
4382
4393
|
}
|
|
4383
|
-
inst._zod.constr = _;
|
|
4384
|
-
inst._zod.def = def;
|
|
4385
4394
|
}
|
|
4386
4395
|
// doesn't work if Parent has a constructor with arguments
|
|
4387
4396
|
const Parent = params?.Parent ?? Object;
|
|
@@ -4516,6 +4525,14 @@ function mergeDefs(...defs) {
|
|
|
4516
4525
|
function esc(str) {
|
|
4517
4526
|
return JSON.stringify(str);
|
|
4518
4527
|
}
|
|
4528
|
+
function slugify(input) {
|
|
4529
|
+
return input
|
|
4530
|
+
.toLowerCase()
|
|
4531
|
+
.trim()
|
|
4532
|
+
.replace(/[^\w\s-]/g, "")
|
|
4533
|
+
.replace(/[\s_-]+/g, "-")
|
|
4534
|
+
.replace(/^-+|-+$/g, "");
|
|
4535
|
+
}
|
|
4519
4536
|
const captureStackTrace = ("captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { });
|
|
4520
4537
|
function isObject$1(data) {
|
|
4521
4538
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
@@ -4541,6 +4558,8 @@ function isPlainObject(o) {
|
|
|
4541
4558
|
const ctor = o.constructor;
|
|
4542
4559
|
if (ctor === undefined)
|
|
4543
4560
|
return true;
|
|
4561
|
+
if (typeof ctor !== "function")
|
|
4562
|
+
return true;
|
|
4544
4563
|
// modified prototype
|
|
4545
4564
|
const prot = ctor.prototype;
|
|
4546
4565
|
if (isObject$1(prot) === false)
|
|
@@ -5004,9 +5023,6 @@ const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?:
|
|
|
5004
5023
|
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
5005
5024
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
5006
5025
|
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
5007
|
-
// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
|
|
5008
|
-
// export const hostname: RegExp = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
|
|
5009
|
-
const hostname = /^(?=.{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])?)*\.?$/;
|
|
5010
5026
|
// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
|
|
5011
5027
|
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
5012
5028
|
// const dateSource = `((\\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])))`;
|
|
@@ -5496,8 +5512,8 @@ class Doc {
|
|
|
5496
5512
|
|
|
5497
5513
|
const version = {
|
|
5498
5514
|
major: 4,
|
|
5499
|
-
minor:
|
|
5500
|
-
patch:
|
|
5515
|
+
minor: 2,
|
|
5516
|
+
patch: 1,
|
|
5501
5517
|
};
|
|
5502
5518
|
|
|
5503
5519
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
@@ -5567,16 +5583,6 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
5567
5583
|
}
|
|
5568
5584
|
return payload;
|
|
5569
5585
|
};
|
|
5570
|
-
// const handleChecksResult = (
|
|
5571
|
-
// checkResult: ParsePayload,
|
|
5572
|
-
// originalResult: ParsePayload,
|
|
5573
|
-
// ctx: ParseContextInternal
|
|
5574
|
-
// ): util.MaybeAsync<ParsePayload> => {
|
|
5575
|
-
// // if the checks mutated the value && there are no issues, re-parse the result
|
|
5576
|
-
// if (checkResult.value !== originalResult.value && !checkResult.issues.length)
|
|
5577
|
-
// return inst._zod.parse(checkResult, ctx);
|
|
5578
|
-
// return originalResult;
|
|
5579
|
-
// };
|
|
5580
5586
|
const handleCanaryResult = (canary, payload, ctx) => {
|
|
5581
5587
|
// abort if the canary is aborted
|
|
5582
5588
|
if (aborted(canary)) {
|
|
@@ -5700,7 +5706,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
|
5700
5706
|
code: "invalid_format",
|
|
5701
5707
|
format: "url",
|
|
5702
5708
|
note: "Invalid hostname",
|
|
5703
|
-
pattern: hostname.source,
|
|
5709
|
+
pattern: def.hostname.source,
|
|
5704
5710
|
input: payload.value,
|
|
5705
5711
|
inst,
|
|
5706
5712
|
continue: !def.abort,
|
|
@@ -5790,18 +5796,12 @@ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def
|
|
|
5790
5796
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
5791
5797
|
def.pattern ?? (def.pattern = ipv4);
|
|
5792
5798
|
$ZodStringFormat.init(inst, def);
|
|
5793
|
-
inst._zod.
|
|
5794
|
-
const bag = inst._zod.bag;
|
|
5795
|
-
bag.format = `ipv4`;
|
|
5796
|
-
});
|
|
5799
|
+
inst._zod.bag.format = `ipv4`;
|
|
5797
5800
|
});
|
|
5798
5801
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
5799
5802
|
def.pattern ?? (def.pattern = ipv6);
|
|
5800
5803
|
$ZodStringFormat.init(inst, def);
|
|
5801
|
-
inst._zod.
|
|
5802
|
-
const bag = inst._zod.bag;
|
|
5803
|
-
bag.format = `ipv6`;
|
|
5804
|
-
});
|
|
5804
|
+
inst._zod.bag.format = `ipv6`;
|
|
5805
5805
|
inst._zod.check = (payload) => {
|
|
5806
5806
|
try {
|
|
5807
5807
|
// @ts-ignore
|
|
@@ -5871,9 +5871,7 @@ function isValidBase64(data) {
|
|
|
5871
5871
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
5872
5872
|
def.pattern ?? (def.pattern = base64);
|
|
5873
5873
|
$ZodStringFormat.init(inst, def);
|
|
5874
|
-
inst._zod.
|
|
5875
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
5876
|
-
});
|
|
5874
|
+
inst._zod.bag.contentEncoding = "base64";
|
|
5877
5875
|
inst._zod.check = (payload) => {
|
|
5878
5876
|
if (isValidBase64(payload.value))
|
|
5879
5877
|
return;
|
|
@@ -5897,9 +5895,7 @@ function isValidBase64URL(data) {
|
|
|
5897
5895
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
5898
5896
|
def.pattern ?? (def.pattern = base64url);
|
|
5899
5897
|
$ZodStringFormat.init(inst, def);
|
|
5900
|
-
inst._zod.
|
|
5901
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
5902
|
-
});
|
|
5898
|
+
inst._zod.bag.contentEncoding = "base64url";
|
|
5903
5899
|
inst._zod.check = (payload) => {
|
|
5904
5900
|
if (isValidBase64URL(payload.value))
|
|
5905
5901
|
return;
|
|
@@ -5983,9 +5979,9 @@ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
|
5983
5979
|
return payload;
|
|
5984
5980
|
};
|
|
5985
5981
|
});
|
|
5986
|
-
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$
|
|
5982
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
5987
5983
|
$ZodCheckNumberFormat.init(inst, def);
|
|
5988
|
-
$ZodNumber.init(inst, def); // no format
|
|
5984
|
+
$ZodNumber.init(inst, def); // no format checks
|
|
5989
5985
|
});
|
|
5990
5986
|
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
5991
5987
|
$ZodType.init(inst, def);
|
|
@@ -6099,7 +6095,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
6099
6095
|
const keySet = def.keySet;
|
|
6100
6096
|
const _catchall = def.catchall._zod;
|
|
6101
6097
|
const t = _catchall.def.type;
|
|
6102
|
-
for (const key
|
|
6098
|
+
for (const key in input) {
|
|
6103
6099
|
if (keySet.has(key))
|
|
6104
6100
|
continue;
|
|
6105
6101
|
if (t === "never") {
|
|
@@ -6430,11 +6426,13 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
6430
6426
|
return payload;
|
|
6431
6427
|
}
|
|
6432
6428
|
const proms = [];
|
|
6433
|
-
|
|
6434
|
-
|
|
6429
|
+
const values = def.keyType._zod.values;
|
|
6430
|
+
if (values) {
|
|
6435
6431
|
payload.value = {};
|
|
6432
|
+
const recordKeys = new Set();
|
|
6436
6433
|
for (const key of values) {
|
|
6437
6434
|
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
6435
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
6438
6436
|
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
6439
6437
|
if (result instanceof Promise) {
|
|
6440
6438
|
proms.push(result.then((result) => {
|
|
@@ -6454,7 +6452,7 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
6454
6452
|
}
|
|
6455
6453
|
let unrecognized;
|
|
6456
6454
|
for (const key in input) {
|
|
6457
|
-
if (!
|
|
6455
|
+
if (!recordKeys.has(key)) {
|
|
6458
6456
|
unrecognized = unrecognized ?? [];
|
|
6459
6457
|
unrecognized.push(key);
|
|
6460
6458
|
}
|
|
@@ -6478,15 +6476,21 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
6478
6476
|
throw new Error("Async schemas not supported in object keys currently");
|
|
6479
6477
|
}
|
|
6480
6478
|
if (keyResult.issues.length) {
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6479
|
+
if (def.mode === "loose") {
|
|
6480
|
+
// Pass through unchanged
|
|
6481
|
+
payload.value[key] = input[key];
|
|
6482
|
+
}
|
|
6483
|
+
else {
|
|
6484
|
+
// Default "strict" behavior: error on invalid key
|
|
6485
|
+
payload.issues.push({
|
|
6486
|
+
code: "invalid_key",
|
|
6487
|
+
origin: "record",
|
|
6488
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
6489
|
+
input: key,
|
|
6490
|
+
path: [key],
|
|
6491
|
+
inst,
|
|
6492
|
+
});
|
|
6493
|
+
}
|
|
6490
6494
|
continue;
|
|
6491
6495
|
}
|
|
6492
6496
|
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
@@ -6749,8 +6753,8 @@ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
|
6749
6753
|
$ZodType.init(inst, def);
|
|
6750
6754
|
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
6751
6755
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
6752
|
-
defineLazy(inst._zod, "optin", () => def.innerType
|
|
6753
|
-
defineLazy(inst._zod, "optout", () => def.innerType
|
|
6756
|
+
defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
|
|
6757
|
+
defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
|
|
6754
6758
|
inst._zod.parse = (payload, ctx) => {
|
|
6755
6759
|
if (ctx.direction === "backward") {
|
|
6756
6760
|
return def.innerType._zod.run(payload, ctx);
|
|
@@ -6798,6 +6802,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
6798
6802
|
}
|
|
6799
6803
|
}
|
|
6800
6804
|
|
|
6805
|
+
var _a;
|
|
6801
6806
|
class $ZodRegistry {
|
|
6802
6807
|
constructor() {
|
|
6803
6808
|
this._map = new WeakMap();
|
|
@@ -6847,7 +6852,8 @@ class $ZodRegistry {
|
|
|
6847
6852
|
function registry() {
|
|
6848
6853
|
return new $ZodRegistry();
|
|
6849
6854
|
}
|
|
6850
|
-
|
|
6855
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
6856
|
+
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
6851
6857
|
|
|
6852
6858
|
function _string(Class, params) {
|
|
6853
6859
|
return new Class({
|
|
@@ -7262,6 +7268,10 @@ function _toLowerCase() {
|
|
|
7262
7268
|
function _toUpperCase() {
|
|
7263
7269
|
return _overwrite((input) => input.toUpperCase());
|
|
7264
7270
|
}
|
|
7271
|
+
// slugify
|
|
7272
|
+
function _slugify() {
|
|
7273
|
+
return _overwrite((input) => slugify(input));
|
|
7274
|
+
}
|
|
7265
7275
|
function _array(Class, element, params) {
|
|
7266
7276
|
return new Class({
|
|
7267
7277
|
type: "array",
|
|
@@ -7313,6 +7323,671 @@ function _check(fn, params) {
|
|
|
7313
7323
|
return ch;
|
|
7314
7324
|
}
|
|
7315
7325
|
|
|
7326
|
+
// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {
|
|
7327
|
+
// return {
|
|
7328
|
+
// processor: inputs.processor,
|
|
7329
|
+
// metadataRegistry: inputs.metadata ?? globalRegistry,
|
|
7330
|
+
// target: inputs.target ?? "draft-2020-12",
|
|
7331
|
+
// unrepresentable: inputs.unrepresentable ?? "throw",
|
|
7332
|
+
// };
|
|
7333
|
+
// }
|
|
7334
|
+
function initializeContext(params) {
|
|
7335
|
+
// Normalize target: convert old non-hyphenated versions to hyphenated versions
|
|
7336
|
+
let target = params?.target ?? "draft-2020-12";
|
|
7337
|
+
if (target === "draft-4")
|
|
7338
|
+
target = "draft-04";
|
|
7339
|
+
if (target === "draft-7")
|
|
7340
|
+
target = "draft-07";
|
|
7341
|
+
return {
|
|
7342
|
+
processors: params.processors ?? {},
|
|
7343
|
+
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
7344
|
+
target,
|
|
7345
|
+
unrepresentable: params?.unrepresentable ?? "throw",
|
|
7346
|
+
override: params?.override ?? (() => { }),
|
|
7347
|
+
io: params?.io ?? "output",
|
|
7348
|
+
counter: 0,
|
|
7349
|
+
seen: new Map(),
|
|
7350
|
+
cycles: params?.cycles ?? "ref",
|
|
7351
|
+
reused: params?.reused ?? "inline",
|
|
7352
|
+
external: params?.external ?? undefined,
|
|
7353
|
+
};
|
|
7354
|
+
}
|
|
7355
|
+
function process$2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
7356
|
+
var _a;
|
|
7357
|
+
const def = schema._zod.def;
|
|
7358
|
+
// check for schema in seens
|
|
7359
|
+
const seen = ctx.seen.get(schema);
|
|
7360
|
+
if (seen) {
|
|
7361
|
+
seen.count++;
|
|
7362
|
+
// check if cycle
|
|
7363
|
+
const isCycle = _params.schemaPath.includes(schema);
|
|
7364
|
+
if (isCycle) {
|
|
7365
|
+
seen.cycle = _params.path;
|
|
7366
|
+
}
|
|
7367
|
+
return seen.schema;
|
|
7368
|
+
}
|
|
7369
|
+
// initialize
|
|
7370
|
+
const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };
|
|
7371
|
+
ctx.seen.set(schema, result);
|
|
7372
|
+
// custom method overrides default behavior
|
|
7373
|
+
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
7374
|
+
if (overrideSchema) {
|
|
7375
|
+
result.schema = overrideSchema;
|
|
7376
|
+
}
|
|
7377
|
+
else {
|
|
7378
|
+
const params = {
|
|
7379
|
+
..._params,
|
|
7380
|
+
schemaPath: [..._params.schemaPath, schema],
|
|
7381
|
+
path: _params.path,
|
|
7382
|
+
};
|
|
7383
|
+
const parent = schema._zod.parent;
|
|
7384
|
+
if (parent) {
|
|
7385
|
+
// schema was cloned from another schema
|
|
7386
|
+
result.ref = parent;
|
|
7387
|
+
process$2(parent, ctx, params);
|
|
7388
|
+
ctx.seen.get(parent).isParent = true;
|
|
7389
|
+
}
|
|
7390
|
+
else if (schema._zod.processJSONSchema) {
|
|
7391
|
+
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
7392
|
+
}
|
|
7393
|
+
else {
|
|
7394
|
+
const _json = result.schema;
|
|
7395
|
+
const processor = ctx.processors[def.type];
|
|
7396
|
+
if (!processor) {
|
|
7397
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
7398
|
+
}
|
|
7399
|
+
processor(schema, ctx, _json, params);
|
|
7400
|
+
}
|
|
7401
|
+
}
|
|
7402
|
+
// metadata
|
|
7403
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
7404
|
+
if (meta)
|
|
7405
|
+
Object.assign(result.schema, meta);
|
|
7406
|
+
if (ctx.io === "input" && isTransforming(schema)) {
|
|
7407
|
+
// examples/defaults only apply to output type of pipe
|
|
7408
|
+
delete result.schema.examples;
|
|
7409
|
+
delete result.schema.default;
|
|
7410
|
+
}
|
|
7411
|
+
// set prefault as default
|
|
7412
|
+
if (ctx.io === "input" && result.schema._prefault)
|
|
7413
|
+
(_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
|
7414
|
+
delete result.schema._prefault;
|
|
7415
|
+
// pulling fresh from ctx.seen in case it was overwritten
|
|
7416
|
+
const _result = ctx.seen.get(schema);
|
|
7417
|
+
return _result.schema;
|
|
7418
|
+
}
|
|
7419
|
+
function extractDefs(ctx, schema
|
|
7420
|
+
// params: EmitParams
|
|
7421
|
+
) {
|
|
7422
|
+
// iterate over seen map;
|
|
7423
|
+
const root = ctx.seen.get(schema);
|
|
7424
|
+
if (!root)
|
|
7425
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
7426
|
+
// returns a ref to the schema
|
|
7427
|
+
// defId will be empty if the ref points to an external schema (or #)
|
|
7428
|
+
const makeURI = (entry) => {
|
|
7429
|
+
// comparing the seen objects because sometimes
|
|
7430
|
+
// multiple schemas map to the same seen object.
|
|
7431
|
+
// e.g. lazy
|
|
7432
|
+
// external is configured
|
|
7433
|
+
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
7434
|
+
if (ctx.external) {
|
|
7435
|
+
const externalId = ctx.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${ctx.counter++}`;
|
|
7436
|
+
// check if schema is in the external registry
|
|
7437
|
+
const uriGenerator = ctx.external.uri ?? ((id) => id);
|
|
7438
|
+
if (externalId) {
|
|
7439
|
+
return { ref: uriGenerator(externalId) };
|
|
7440
|
+
}
|
|
7441
|
+
// otherwise, add to __shared
|
|
7442
|
+
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
7443
|
+
entry[1].defId = id; // set defId so it will be reused if needed
|
|
7444
|
+
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
|
|
7445
|
+
}
|
|
7446
|
+
if (entry[1] === root) {
|
|
7447
|
+
return { ref: "#" };
|
|
7448
|
+
}
|
|
7449
|
+
// self-contained schema
|
|
7450
|
+
const uriPrefix = `#`;
|
|
7451
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
7452
|
+
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
7453
|
+
return { defId, ref: defUriPrefix + defId };
|
|
7454
|
+
};
|
|
7455
|
+
// stored cached version in `def` property
|
|
7456
|
+
// remove all properties, set $ref
|
|
7457
|
+
const extractToDef = (entry) => {
|
|
7458
|
+
// if the schema is already a reference, do not extract it
|
|
7459
|
+
if (entry[1].schema.$ref) {
|
|
7460
|
+
return;
|
|
7461
|
+
}
|
|
7462
|
+
const seen = entry[1];
|
|
7463
|
+
const { ref, defId } = makeURI(entry);
|
|
7464
|
+
seen.def = { ...seen.schema };
|
|
7465
|
+
// defId won't be set if the schema is a reference to an external schema
|
|
7466
|
+
// or if the schema is the root schema
|
|
7467
|
+
if (defId)
|
|
7468
|
+
seen.defId = defId;
|
|
7469
|
+
// wipe away all properties except $ref
|
|
7470
|
+
const schema = seen.schema;
|
|
7471
|
+
for (const key in schema) {
|
|
7472
|
+
delete schema[key];
|
|
7473
|
+
}
|
|
7474
|
+
schema.$ref = ref;
|
|
7475
|
+
};
|
|
7476
|
+
// throw on cycles
|
|
7477
|
+
// break cycles
|
|
7478
|
+
if (ctx.cycles === "throw") {
|
|
7479
|
+
for (const entry of ctx.seen.entries()) {
|
|
7480
|
+
const seen = entry[1];
|
|
7481
|
+
if (seen.cycle) {
|
|
7482
|
+
throw new Error("Cycle detected: " +
|
|
7483
|
+
`#/${seen.cycle?.join("/")}/<root>` +
|
|
7484
|
+
'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
|
|
7485
|
+
}
|
|
7486
|
+
}
|
|
7487
|
+
}
|
|
7488
|
+
// extract schemas into $defs
|
|
7489
|
+
for (const entry of ctx.seen.entries()) {
|
|
7490
|
+
const seen = entry[1];
|
|
7491
|
+
// convert root schema to # $ref
|
|
7492
|
+
if (schema === entry[0]) {
|
|
7493
|
+
extractToDef(entry); // this has special handling for the root schema
|
|
7494
|
+
continue;
|
|
7495
|
+
}
|
|
7496
|
+
// extract schemas that are in the external registry
|
|
7497
|
+
if (ctx.external) {
|
|
7498
|
+
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
7499
|
+
if (schema !== entry[0] && ext) {
|
|
7500
|
+
extractToDef(entry);
|
|
7501
|
+
continue;
|
|
7502
|
+
}
|
|
7503
|
+
}
|
|
7504
|
+
// extract schemas with `id` meta
|
|
7505
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
7506
|
+
if (id) {
|
|
7507
|
+
extractToDef(entry);
|
|
7508
|
+
continue;
|
|
7509
|
+
}
|
|
7510
|
+
// break cycles
|
|
7511
|
+
if (seen.cycle) {
|
|
7512
|
+
// any
|
|
7513
|
+
extractToDef(entry);
|
|
7514
|
+
continue;
|
|
7515
|
+
}
|
|
7516
|
+
// extract reused schemas
|
|
7517
|
+
if (seen.count > 1) {
|
|
7518
|
+
if (ctx.reused === "ref") {
|
|
7519
|
+
extractToDef(entry);
|
|
7520
|
+
// biome-ignore lint:
|
|
7521
|
+
continue;
|
|
7522
|
+
}
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
}
|
|
7526
|
+
function finalize(ctx, schema) {
|
|
7527
|
+
//
|
|
7528
|
+
// iterate over seen map;
|
|
7529
|
+
const root = ctx.seen.get(schema);
|
|
7530
|
+
if (!root)
|
|
7531
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
7532
|
+
// flatten _refs
|
|
7533
|
+
const flattenRef = (zodSchema) => {
|
|
7534
|
+
const seen = ctx.seen.get(zodSchema);
|
|
7535
|
+
const schema = seen.def ?? seen.schema;
|
|
7536
|
+
const _cached = { ...schema };
|
|
7537
|
+
// already seen
|
|
7538
|
+
if (seen.ref === null) {
|
|
7539
|
+
return;
|
|
7540
|
+
}
|
|
7541
|
+
// flatten ref if defined
|
|
7542
|
+
const ref = seen.ref;
|
|
7543
|
+
seen.ref = null; // prevent recursion
|
|
7544
|
+
if (ref) {
|
|
7545
|
+
flattenRef(ref);
|
|
7546
|
+
// merge referenced schema into current
|
|
7547
|
+
const refSchema = ctx.seen.get(ref).schema;
|
|
7548
|
+
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
7549
|
+
schema.allOf = schema.allOf ?? [];
|
|
7550
|
+
schema.allOf.push(refSchema);
|
|
7551
|
+
}
|
|
7552
|
+
else {
|
|
7553
|
+
Object.assign(schema, refSchema);
|
|
7554
|
+
Object.assign(schema, _cached); // prevent overwriting any fields in the original schema
|
|
7555
|
+
}
|
|
7556
|
+
}
|
|
7557
|
+
// execute overrides
|
|
7558
|
+
if (!seen.isParent)
|
|
7559
|
+
ctx.override({
|
|
7560
|
+
zodSchema: zodSchema,
|
|
7561
|
+
jsonSchema: schema,
|
|
7562
|
+
path: seen.path ?? [],
|
|
7563
|
+
});
|
|
7564
|
+
};
|
|
7565
|
+
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
7566
|
+
flattenRef(entry[0]);
|
|
7567
|
+
}
|
|
7568
|
+
const result = {};
|
|
7569
|
+
if (ctx.target === "draft-2020-12") {
|
|
7570
|
+
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
7571
|
+
}
|
|
7572
|
+
else if (ctx.target === "draft-07") {
|
|
7573
|
+
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
7574
|
+
}
|
|
7575
|
+
else if (ctx.target === "draft-04") {
|
|
7576
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
7577
|
+
}
|
|
7578
|
+
else if (ctx.target === "openapi-3.0") ;
|
|
7579
|
+
else ;
|
|
7580
|
+
if (ctx.external?.uri) {
|
|
7581
|
+
const id = ctx.external.registry.get(schema)?.id;
|
|
7582
|
+
if (!id)
|
|
7583
|
+
throw new Error("Schema is missing an `id` property");
|
|
7584
|
+
result.$id = ctx.external.uri(id);
|
|
7585
|
+
}
|
|
7586
|
+
Object.assign(result, root.def ?? root.schema);
|
|
7587
|
+
// build defs object
|
|
7588
|
+
const defs = ctx.external?.defs ?? {};
|
|
7589
|
+
for (const entry of ctx.seen.entries()) {
|
|
7590
|
+
const seen = entry[1];
|
|
7591
|
+
if (seen.def && seen.defId) {
|
|
7592
|
+
defs[seen.defId] = seen.def;
|
|
7593
|
+
}
|
|
7594
|
+
}
|
|
7595
|
+
// set definitions in result
|
|
7596
|
+
if (ctx.external) ;
|
|
7597
|
+
else {
|
|
7598
|
+
if (Object.keys(defs).length > 0) {
|
|
7599
|
+
if (ctx.target === "draft-2020-12") {
|
|
7600
|
+
result.$defs = defs;
|
|
7601
|
+
}
|
|
7602
|
+
else {
|
|
7603
|
+
result.definitions = defs;
|
|
7604
|
+
}
|
|
7605
|
+
}
|
|
7606
|
+
}
|
|
7607
|
+
try {
|
|
7608
|
+
// this "finalizes" this schema and ensures all cycles are removed
|
|
7609
|
+
// each call to finalize() is functionally independent
|
|
7610
|
+
// though the seen map is shared
|
|
7611
|
+
const finalized = JSON.parse(JSON.stringify(result));
|
|
7612
|
+
Object.defineProperty(finalized, "~standard", {
|
|
7613
|
+
value: {
|
|
7614
|
+
...schema["~standard"],
|
|
7615
|
+
jsonSchema: {
|
|
7616
|
+
input: createStandardJSONSchemaMethod(schema, "input"),
|
|
7617
|
+
output: createStandardJSONSchemaMethod(schema, "output"),
|
|
7618
|
+
},
|
|
7619
|
+
},
|
|
7620
|
+
enumerable: false,
|
|
7621
|
+
writable: false,
|
|
7622
|
+
});
|
|
7623
|
+
return finalized;
|
|
7624
|
+
}
|
|
7625
|
+
catch (_err) {
|
|
7626
|
+
throw new Error("Error converting schema to JSON.");
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7629
|
+
function isTransforming(_schema, _ctx) {
|
|
7630
|
+
const ctx = _ctx ?? { seen: new Set() };
|
|
7631
|
+
if (ctx.seen.has(_schema))
|
|
7632
|
+
return false;
|
|
7633
|
+
ctx.seen.add(_schema);
|
|
7634
|
+
const def = _schema._zod.def;
|
|
7635
|
+
if (def.type === "transform")
|
|
7636
|
+
return true;
|
|
7637
|
+
if (def.type === "array")
|
|
7638
|
+
return isTransforming(def.element, ctx);
|
|
7639
|
+
if (def.type === "set")
|
|
7640
|
+
return isTransforming(def.valueType, ctx);
|
|
7641
|
+
if (def.type === "lazy")
|
|
7642
|
+
return isTransforming(def.getter(), ctx);
|
|
7643
|
+
if (def.type === "promise" ||
|
|
7644
|
+
def.type === "optional" ||
|
|
7645
|
+
def.type === "nonoptional" ||
|
|
7646
|
+
def.type === "nullable" ||
|
|
7647
|
+
def.type === "readonly" ||
|
|
7648
|
+
def.type === "default" ||
|
|
7649
|
+
def.type === "prefault") {
|
|
7650
|
+
return isTransforming(def.innerType, ctx);
|
|
7651
|
+
}
|
|
7652
|
+
if (def.type === "intersection") {
|
|
7653
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
7654
|
+
}
|
|
7655
|
+
if (def.type === "record" || def.type === "map") {
|
|
7656
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
7657
|
+
}
|
|
7658
|
+
if (def.type === "pipe") {
|
|
7659
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
7660
|
+
}
|
|
7661
|
+
if (def.type === "object") {
|
|
7662
|
+
for (const key in def.shape) {
|
|
7663
|
+
if (isTransforming(def.shape[key], ctx))
|
|
7664
|
+
return true;
|
|
7665
|
+
}
|
|
7666
|
+
return false;
|
|
7667
|
+
}
|
|
7668
|
+
if (def.type === "union") {
|
|
7669
|
+
for (const option of def.options) {
|
|
7670
|
+
if (isTransforming(option, ctx))
|
|
7671
|
+
return true;
|
|
7672
|
+
}
|
|
7673
|
+
return false;
|
|
7674
|
+
}
|
|
7675
|
+
if (def.type === "tuple") {
|
|
7676
|
+
for (const item of def.items) {
|
|
7677
|
+
if (isTransforming(item, ctx))
|
|
7678
|
+
return true;
|
|
7679
|
+
}
|
|
7680
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
7681
|
+
return true;
|
|
7682
|
+
return false;
|
|
7683
|
+
}
|
|
7684
|
+
return false;
|
|
7685
|
+
}
|
|
7686
|
+
/**
|
|
7687
|
+
* Creates a toJSONSchema method for a schema instance.
|
|
7688
|
+
* This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
|
|
7689
|
+
*/
|
|
7690
|
+
const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
7691
|
+
const ctx = initializeContext({ ...params, processors });
|
|
7692
|
+
process$2(schema, ctx);
|
|
7693
|
+
extractDefs(ctx, schema);
|
|
7694
|
+
return finalize(ctx, schema);
|
|
7695
|
+
};
|
|
7696
|
+
const createStandardJSONSchemaMethod = (schema, io) => (params) => {
|
|
7697
|
+
const { libraryOptions, target } = params ?? {};
|
|
7698
|
+
const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors: {} });
|
|
7699
|
+
process$2(schema, ctx);
|
|
7700
|
+
extractDefs(ctx, schema);
|
|
7701
|
+
return finalize(ctx, schema);
|
|
7702
|
+
};
|
|
7703
|
+
|
|
7704
|
+
const formatMap = {
|
|
7705
|
+
guid: "uuid",
|
|
7706
|
+
url: "uri",
|
|
7707
|
+
datetime: "date-time",
|
|
7708
|
+
json_string: "json-string",
|
|
7709
|
+
regex: "", // do not set
|
|
7710
|
+
};
|
|
7711
|
+
// ==================== SIMPLE TYPE PROCESSORS ====================
|
|
7712
|
+
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
7713
|
+
const json = _json;
|
|
7714
|
+
json.type = "string";
|
|
7715
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod
|
|
7716
|
+
.bag;
|
|
7717
|
+
if (typeof minimum === "number")
|
|
7718
|
+
json.minLength = minimum;
|
|
7719
|
+
if (typeof maximum === "number")
|
|
7720
|
+
json.maxLength = maximum;
|
|
7721
|
+
// custom pattern overrides format
|
|
7722
|
+
if (format) {
|
|
7723
|
+
json.format = formatMap[format] ?? format;
|
|
7724
|
+
if (json.format === "")
|
|
7725
|
+
delete json.format; // empty format is not valid
|
|
7726
|
+
}
|
|
7727
|
+
if (contentEncoding)
|
|
7728
|
+
json.contentEncoding = contentEncoding;
|
|
7729
|
+
if (patterns && patterns.size > 0) {
|
|
7730
|
+
const regexes = [...patterns];
|
|
7731
|
+
if (regexes.length === 1)
|
|
7732
|
+
json.pattern = regexes[0].source;
|
|
7733
|
+
else if (regexes.length > 1) {
|
|
7734
|
+
json.allOf = [
|
|
7735
|
+
...regexes.map((regex) => ({
|
|
7736
|
+
...(ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0"
|
|
7737
|
+
? { type: "string" }
|
|
7738
|
+
: {}),
|
|
7739
|
+
pattern: regex.source,
|
|
7740
|
+
})),
|
|
7741
|
+
];
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7744
|
+
};
|
|
7745
|
+
const numberProcessor = (schema, ctx, _json, _params) => {
|
|
7746
|
+
const json = _json;
|
|
7747
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
7748
|
+
if (typeof format === "string" && format.includes("int"))
|
|
7749
|
+
json.type = "integer";
|
|
7750
|
+
else
|
|
7751
|
+
json.type = "number";
|
|
7752
|
+
if (typeof exclusiveMinimum === "number") {
|
|
7753
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
7754
|
+
json.minimum = exclusiveMinimum;
|
|
7755
|
+
json.exclusiveMinimum = true;
|
|
7756
|
+
}
|
|
7757
|
+
else {
|
|
7758
|
+
json.exclusiveMinimum = exclusiveMinimum;
|
|
7759
|
+
}
|
|
7760
|
+
}
|
|
7761
|
+
if (typeof minimum === "number") {
|
|
7762
|
+
json.minimum = minimum;
|
|
7763
|
+
if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
|
|
7764
|
+
if (exclusiveMinimum >= minimum)
|
|
7765
|
+
delete json.minimum;
|
|
7766
|
+
else
|
|
7767
|
+
delete json.exclusiveMinimum;
|
|
7768
|
+
}
|
|
7769
|
+
}
|
|
7770
|
+
if (typeof exclusiveMaximum === "number") {
|
|
7771
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
7772
|
+
json.maximum = exclusiveMaximum;
|
|
7773
|
+
json.exclusiveMaximum = true;
|
|
7774
|
+
}
|
|
7775
|
+
else {
|
|
7776
|
+
json.exclusiveMaximum = exclusiveMaximum;
|
|
7777
|
+
}
|
|
7778
|
+
}
|
|
7779
|
+
if (typeof maximum === "number") {
|
|
7780
|
+
json.maximum = maximum;
|
|
7781
|
+
if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
|
|
7782
|
+
if (exclusiveMaximum <= maximum)
|
|
7783
|
+
delete json.maximum;
|
|
7784
|
+
else
|
|
7785
|
+
delete json.exclusiveMaximum;
|
|
7786
|
+
}
|
|
7787
|
+
}
|
|
7788
|
+
if (typeof multipleOf === "number")
|
|
7789
|
+
json.multipleOf = multipleOf;
|
|
7790
|
+
};
|
|
7791
|
+
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
7792
|
+
json.type = "boolean";
|
|
7793
|
+
};
|
|
7794
|
+
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
7795
|
+
json.not = {};
|
|
7796
|
+
};
|
|
7797
|
+
const unknownProcessor = (_schema, _ctx, _json, _params) => {
|
|
7798
|
+
// empty schema accepts anything
|
|
7799
|
+
};
|
|
7800
|
+
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
7801
|
+
const def = schema._zod.def;
|
|
7802
|
+
const values = getEnumValues(def.entries);
|
|
7803
|
+
// Number enums can have both string and number values
|
|
7804
|
+
if (values.every((v) => typeof v === "number"))
|
|
7805
|
+
json.type = "number";
|
|
7806
|
+
if (values.every((v) => typeof v === "string"))
|
|
7807
|
+
json.type = "string";
|
|
7808
|
+
json.enum = values;
|
|
7809
|
+
};
|
|
7810
|
+
const customProcessor = (_schema, ctx, _json, _params) => {
|
|
7811
|
+
if (ctx.unrepresentable === "throw") {
|
|
7812
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
7813
|
+
}
|
|
7814
|
+
};
|
|
7815
|
+
const transformProcessor = (_schema, ctx, _json, _params) => {
|
|
7816
|
+
if (ctx.unrepresentable === "throw") {
|
|
7817
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
7818
|
+
}
|
|
7819
|
+
};
|
|
7820
|
+
// ==================== COMPOSITE TYPE PROCESSORS ====================
|
|
7821
|
+
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
7822
|
+
const json = _json;
|
|
7823
|
+
const def = schema._zod.def;
|
|
7824
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
7825
|
+
if (typeof minimum === "number")
|
|
7826
|
+
json.minItems = minimum;
|
|
7827
|
+
if (typeof maximum === "number")
|
|
7828
|
+
json.maxItems = maximum;
|
|
7829
|
+
json.type = "array";
|
|
7830
|
+
json.items = process$2(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
7831
|
+
};
|
|
7832
|
+
const objectProcessor = (schema, ctx, _json, params) => {
|
|
7833
|
+
const json = _json;
|
|
7834
|
+
const def = schema._zod.def;
|
|
7835
|
+
json.type = "object";
|
|
7836
|
+
json.properties = {};
|
|
7837
|
+
const shape = def.shape;
|
|
7838
|
+
for (const key in shape) {
|
|
7839
|
+
json.properties[key] = process$2(shape[key], ctx, {
|
|
7840
|
+
...params,
|
|
7841
|
+
path: [...params.path, "properties", key],
|
|
7842
|
+
});
|
|
7843
|
+
}
|
|
7844
|
+
// required keys
|
|
7845
|
+
const allKeys = new Set(Object.keys(shape));
|
|
7846
|
+
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
7847
|
+
const v = def.shape[key]._zod;
|
|
7848
|
+
if (ctx.io === "input") {
|
|
7849
|
+
return v.optin === undefined;
|
|
7850
|
+
}
|
|
7851
|
+
else {
|
|
7852
|
+
return v.optout === undefined;
|
|
7853
|
+
}
|
|
7854
|
+
}));
|
|
7855
|
+
if (requiredKeys.size > 0) {
|
|
7856
|
+
json.required = Array.from(requiredKeys);
|
|
7857
|
+
}
|
|
7858
|
+
// catchall
|
|
7859
|
+
if (def.catchall?._zod.def.type === "never") {
|
|
7860
|
+
// strict
|
|
7861
|
+
json.additionalProperties = false;
|
|
7862
|
+
}
|
|
7863
|
+
else if (!def.catchall) {
|
|
7864
|
+
// regular
|
|
7865
|
+
if (ctx.io === "output")
|
|
7866
|
+
json.additionalProperties = false;
|
|
7867
|
+
}
|
|
7868
|
+
else if (def.catchall) {
|
|
7869
|
+
json.additionalProperties = process$2(def.catchall, ctx, {
|
|
7870
|
+
...params,
|
|
7871
|
+
path: [...params.path, "additionalProperties"],
|
|
7872
|
+
});
|
|
7873
|
+
}
|
|
7874
|
+
};
|
|
7875
|
+
const unionProcessor = (schema, ctx, json, params) => {
|
|
7876
|
+
const def = schema._zod.def;
|
|
7877
|
+
// Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches)
|
|
7878
|
+
// This includes both z.xor() and discriminated unions
|
|
7879
|
+
const isExclusive = def.inclusive === false;
|
|
7880
|
+
const options = def.options.map((x, i) => process$2(x, ctx, {
|
|
7881
|
+
...params,
|
|
7882
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i],
|
|
7883
|
+
}));
|
|
7884
|
+
if (isExclusive) {
|
|
7885
|
+
json.oneOf = options;
|
|
7886
|
+
}
|
|
7887
|
+
else {
|
|
7888
|
+
json.anyOf = options;
|
|
7889
|
+
}
|
|
7890
|
+
};
|
|
7891
|
+
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7892
|
+
const def = schema._zod.def;
|
|
7893
|
+
const a = process$2(def.left, ctx, {
|
|
7894
|
+
...params,
|
|
7895
|
+
path: [...params.path, "allOf", 0],
|
|
7896
|
+
});
|
|
7897
|
+
const b = process$2(def.right, ctx, {
|
|
7898
|
+
...params,
|
|
7899
|
+
path: [...params.path, "allOf", 1],
|
|
7900
|
+
});
|
|
7901
|
+
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
7902
|
+
const allOf = [
|
|
7903
|
+
...(isSimpleIntersection(a) ? a.allOf : [a]),
|
|
7904
|
+
...(isSimpleIntersection(b) ? b.allOf : [b]),
|
|
7905
|
+
];
|
|
7906
|
+
json.allOf = allOf;
|
|
7907
|
+
};
|
|
7908
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
7909
|
+
const json = _json;
|
|
7910
|
+
const def = schema._zod.def;
|
|
7911
|
+
json.type = "object";
|
|
7912
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
7913
|
+
json.propertyNames = process$2(def.keyType, ctx, {
|
|
7914
|
+
...params,
|
|
7915
|
+
path: [...params.path, "propertyNames"],
|
|
7916
|
+
});
|
|
7917
|
+
}
|
|
7918
|
+
json.additionalProperties = process$2(def.valueType, ctx, {
|
|
7919
|
+
...params,
|
|
7920
|
+
path: [...params.path, "additionalProperties"],
|
|
7921
|
+
});
|
|
7922
|
+
};
|
|
7923
|
+
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7924
|
+
const def = schema._zod.def;
|
|
7925
|
+
const inner = process$2(def.innerType, ctx, params);
|
|
7926
|
+
const seen = ctx.seen.get(schema);
|
|
7927
|
+
if (ctx.target === "openapi-3.0") {
|
|
7928
|
+
seen.ref = def.innerType;
|
|
7929
|
+
json.nullable = true;
|
|
7930
|
+
}
|
|
7931
|
+
else {
|
|
7932
|
+
json.anyOf = [inner, { type: "null" }];
|
|
7933
|
+
}
|
|
7934
|
+
};
|
|
7935
|
+
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7936
|
+
const def = schema._zod.def;
|
|
7937
|
+
process$2(def.innerType, ctx, params);
|
|
7938
|
+
const seen = ctx.seen.get(schema);
|
|
7939
|
+
seen.ref = def.innerType;
|
|
7940
|
+
};
|
|
7941
|
+
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7942
|
+
const def = schema._zod.def;
|
|
7943
|
+
process$2(def.innerType, ctx, params);
|
|
7944
|
+
const seen = ctx.seen.get(schema);
|
|
7945
|
+
seen.ref = def.innerType;
|
|
7946
|
+
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7947
|
+
};
|
|
7948
|
+
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7949
|
+
const def = schema._zod.def;
|
|
7950
|
+
process$2(def.innerType, ctx, params);
|
|
7951
|
+
const seen = ctx.seen.get(schema);
|
|
7952
|
+
seen.ref = def.innerType;
|
|
7953
|
+
if (ctx.io === "input")
|
|
7954
|
+
json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7955
|
+
};
|
|
7956
|
+
const catchProcessor = (schema, ctx, json, params) => {
|
|
7957
|
+
const def = schema._zod.def;
|
|
7958
|
+
process$2(def.innerType, ctx, params);
|
|
7959
|
+
const seen = ctx.seen.get(schema);
|
|
7960
|
+
seen.ref = def.innerType;
|
|
7961
|
+
let catchValue;
|
|
7962
|
+
try {
|
|
7963
|
+
catchValue = def.catchValue(undefined);
|
|
7964
|
+
}
|
|
7965
|
+
catch {
|
|
7966
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
7967
|
+
}
|
|
7968
|
+
json.default = catchValue;
|
|
7969
|
+
};
|
|
7970
|
+
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
7971
|
+
const def = schema._zod.def;
|
|
7972
|
+
const innerType = ctx.io === "input" ? (def.in._zod.def.type === "transform" ? def.out : def.in) : def.out;
|
|
7973
|
+
process$2(innerType, ctx, params);
|
|
7974
|
+
const seen = ctx.seen.get(schema);
|
|
7975
|
+
seen.ref = innerType;
|
|
7976
|
+
};
|
|
7977
|
+
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7978
|
+
const def = schema._zod.def;
|
|
7979
|
+
process$2(def.innerType, ctx, params);
|
|
7980
|
+
const seen = ctx.seen.get(schema);
|
|
7981
|
+
seen.ref = def.innerType;
|
|
7982
|
+
json.readOnly = true;
|
|
7983
|
+
};
|
|
7984
|
+
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7985
|
+
const def = schema._zod.def;
|
|
7986
|
+
process$2(def.innerType, ctx, params);
|
|
7987
|
+
const seen = ctx.seen.get(schema);
|
|
7988
|
+
seen.ref = def.innerType;
|
|
7989
|
+
};
|
|
7990
|
+
|
|
7316
7991
|
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
7317
7992
|
$ZodISODateTime.init(inst, def);
|
|
7318
7993
|
ZodStringFormat.init(inst, def);
|
|
@@ -7404,6 +8079,13 @@ const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
|
7404
8079
|
|
|
7405
8080
|
const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
7406
8081
|
$ZodType.init(inst, def);
|
|
8082
|
+
Object.assign(inst["~standard"], {
|
|
8083
|
+
jsonSchema: {
|
|
8084
|
+
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
8085
|
+
output: createStandardJSONSchemaMethod(inst, "output"),
|
|
8086
|
+
},
|
|
8087
|
+
});
|
|
8088
|
+
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
7407
8089
|
inst.def = def;
|
|
7408
8090
|
inst.type = def.type;
|
|
7409
8091
|
Object.defineProperty(inst, "_def", { value: def });
|
|
@@ -7485,6 +8167,7 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
7485
8167
|
const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
7486
8168
|
$ZodString.init(inst, def);
|
|
7487
8169
|
ZodType.init(inst, def);
|
|
8170
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
|
|
7488
8171
|
const bag = inst._zod.bag;
|
|
7489
8172
|
inst.format = bag.format ?? null;
|
|
7490
8173
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -7505,6 +8188,7 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
7505
8188
|
inst.normalize = (...args) => inst.check(_normalize(...args));
|
|
7506
8189
|
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
7507
8190
|
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
8191
|
+
inst.slugify = () => inst.check(_slugify());
|
|
7508
8192
|
});
|
|
7509
8193
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
7510
8194
|
$ZodString.init(inst, def);
|
|
@@ -7641,6 +8325,7 @@ const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
|
7641
8325
|
const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
7642
8326
|
$ZodNumber.init(inst, def);
|
|
7643
8327
|
ZodType.init(inst, def);
|
|
8328
|
+
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json);
|
|
7644
8329
|
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
7645
8330
|
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
7646
8331
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
@@ -7679,6 +8364,7 @@ function int$2(params) {
|
|
|
7679
8364
|
const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
7680
8365
|
$ZodBoolean.init(inst, def);
|
|
7681
8366
|
ZodType.init(inst, def);
|
|
8367
|
+
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json);
|
|
7682
8368
|
});
|
|
7683
8369
|
function boolean(params) {
|
|
7684
8370
|
return _boolean(ZodBoolean, params);
|
|
@@ -7686,6 +8372,7 @@ function boolean(params) {
|
|
|
7686
8372
|
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
7687
8373
|
$ZodUnknown.init(inst, def);
|
|
7688
8374
|
ZodType.init(inst, def);
|
|
8375
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor();
|
|
7689
8376
|
});
|
|
7690
8377
|
function unknown() {
|
|
7691
8378
|
return _unknown(ZodUnknown);
|
|
@@ -7693,6 +8380,7 @@ function unknown() {
|
|
|
7693
8380
|
const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
7694
8381
|
$ZodNever.init(inst, def);
|
|
7695
8382
|
ZodType.init(inst, def);
|
|
8383
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json);
|
|
7696
8384
|
});
|
|
7697
8385
|
function never(params) {
|
|
7698
8386
|
return _never(ZodNever, params);
|
|
@@ -7700,6 +8388,7 @@ function never(params) {
|
|
|
7700
8388
|
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
7701
8389
|
$ZodArray.init(inst, def);
|
|
7702
8390
|
ZodType.init(inst, def);
|
|
8391
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
7703
8392
|
inst.element = def.element;
|
|
7704
8393
|
inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
|
|
7705
8394
|
inst.nonempty = (params) => inst.check(_minLength(1, params));
|
|
@@ -7713,6 +8402,7 @@ function array(element, params) {
|
|
|
7713
8402
|
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
7714
8403
|
$ZodObjectJIT.init(inst, def);
|
|
7715
8404
|
ZodType.init(inst, def);
|
|
8405
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
7716
8406
|
defineLazy(inst, "shape", () => {
|
|
7717
8407
|
return def.shape;
|
|
7718
8408
|
});
|
|
@@ -7745,6 +8435,7 @@ function object(shape, params) {
|
|
|
7745
8435
|
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
7746
8436
|
$ZodUnion.init(inst, def);
|
|
7747
8437
|
ZodType.init(inst, def);
|
|
8438
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
7748
8439
|
inst.options = def.options;
|
|
7749
8440
|
});
|
|
7750
8441
|
function union(options, params) {
|
|
@@ -7757,6 +8448,7 @@ function union(options, params) {
|
|
|
7757
8448
|
const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
7758
8449
|
$ZodIntersection.init(inst, def);
|
|
7759
8450
|
ZodType.init(inst, def);
|
|
8451
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
7760
8452
|
});
|
|
7761
8453
|
function intersection(left, right) {
|
|
7762
8454
|
return new ZodIntersection({
|
|
@@ -7768,6 +8460,7 @@ function intersection(left, right) {
|
|
|
7768
8460
|
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
7769
8461
|
$ZodRecord.init(inst, def);
|
|
7770
8462
|
ZodType.init(inst, def);
|
|
8463
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
7771
8464
|
inst.keyType = def.keyType;
|
|
7772
8465
|
inst.valueType = def.valueType;
|
|
7773
8466
|
});
|
|
@@ -7782,6 +8475,7 @@ function record(keyType, valueType, params) {
|
|
|
7782
8475
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
7783
8476
|
$ZodEnum.init(inst, def);
|
|
7784
8477
|
ZodType.init(inst, def);
|
|
8478
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json);
|
|
7785
8479
|
inst.enum = def.entries;
|
|
7786
8480
|
inst.options = Object.values(def.entries);
|
|
7787
8481
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -7829,6 +8523,7 @@ function _enum(values, params) {
|
|
|
7829
8523
|
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
7830
8524
|
$ZodTransform.init(inst, def);
|
|
7831
8525
|
ZodType.init(inst, def);
|
|
8526
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
|
|
7832
8527
|
inst._zod.parse = (payload, _ctx) => {
|
|
7833
8528
|
if (_ctx.direction === "backward") {
|
|
7834
8529
|
throw new $ZodEncodeError(inst.constructor.name);
|
|
@@ -7869,6 +8564,7 @@ function transform(fn) {
|
|
|
7869
8564
|
const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
|
|
7870
8565
|
$ZodOptional.init(inst, def);
|
|
7871
8566
|
ZodType.init(inst, def);
|
|
8567
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
7872
8568
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7873
8569
|
});
|
|
7874
8570
|
function optional(innerType) {
|
|
@@ -7880,6 +8576,7 @@ function optional(innerType) {
|
|
|
7880
8576
|
const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
|
|
7881
8577
|
$ZodNullable.init(inst, def);
|
|
7882
8578
|
ZodType.init(inst, def);
|
|
8579
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
7883
8580
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7884
8581
|
});
|
|
7885
8582
|
function nullable(innerType) {
|
|
@@ -7891,6 +8588,7 @@ function nullable(innerType) {
|
|
|
7891
8588
|
const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
|
|
7892
8589
|
$ZodDefault.init(inst, def);
|
|
7893
8590
|
ZodType.init(inst, def);
|
|
8591
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
7894
8592
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7895
8593
|
inst.removeDefault = inst.unwrap;
|
|
7896
8594
|
});
|
|
@@ -7906,6 +8604,7 @@ function _default(innerType, defaultValue) {
|
|
|
7906
8604
|
const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
|
|
7907
8605
|
$ZodPrefault.init(inst, def);
|
|
7908
8606
|
ZodType.init(inst, def);
|
|
8607
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
7909
8608
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7910
8609
|
});
|
|
7911
8610
|
function prefault(innerType, defaultValue) {
|
|
@@ -7920,6 +8619,7 @@ function prefault(innerType, defaultValue) {
|
|
|
7920
8619
|
const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
7921
8620
|
$ZodNonOptional.init(inst, def);
|
|
7922
8621
|
ZodType.init(inst, def);
|
|
8622
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
7923
8623
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7924
8624
|
});
|
|
7925
8625
|
function nonoptional(innerType, params) {
|
|
@@ -7932,6 +8632,7 @@ function nonoptional(innerType, params) {
|
|
|
7932
8632
|
const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
7933
8633
|
$ZodCatch.init(inst, def);
|
|
7934
8634
|
ZodType.init(inst, def);
|
|
8635
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
7935
8636
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7936
8637
|
inst.removeCatch = inst.unwrap;
|
|
7937
8638
|
});
|
|
@@ -7945,6 +8646,7 @@ function _catch(innerType, catchValue) {
|
|
|
7945
8646
|
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
7946
8647
|
$ZodPipe.init(inst, def);
|
|
7947
8648
|
ZodType.init(inst, def);
|
|
8649
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
7948
8650
|
inst.in = def.in;
|
|
7949
8651
|
inst.out = def.out;
|
|
7950
8652
|
});
|
|
@@ -7959,6 +8661,7 @@ function pipe(in_, out) {
|
|
|
7959
8661
|
const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
7960
8662
|
$ZodReadonly.init(inst, def);
|
|
7961
8663
|
ZodType.init(inst, def);
|
|
8664
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
7962
8665
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
7963
8666
|
});
|
|
7964
8667
|
function readonly(innerType) {
|
|
@@ -7970,6 +8673,7 @@ function readonly(innerType) {
|
|
|
7970
8673
|
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
7971
8674
|
$ZodCustom.init(inst, def);
|
|
7972
8675
|
ZodType.init(inst, def);
|
|
8676
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
|
|
7973
8677
|
});
|
|
7974
8678
|
function refine(fn, _params = {}) {
|
|
7975
8679
|
return _refine(ZodCustom, fn, _params);
|
|
@@ -8905,7 +9609,7 @@ function requireAlias () {
|
|
|
8905
9609
|
data = anchors.get(source);
|
|
8906
9610
|
}
|
|
8907
9611
|
/* istanbul ignore if */
|
|
8908
|
-
if (
|
|
9612
|
+
if (data?.res === undefined) {
|
|
8909
9613
|
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
8910
9614
|
throw new ReferenceError(msg);
|
|
8911
9615
|
}
|
|
@@ -10049,7 +10753,7 @@ function requireStringifyPair () {
|
|
|
10049
10753
|
ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
|
|
10050
10754
|
}
|
|
10051
10755
|
if (valueStr === '' && !ctx.inFlow) {
|
|
10052
|
-
if (ws === '\n')
|
|
10756
|
+
if (ws === '\n' && valueComment)
|
|
10053
10757
|
ws = '\n\n';
|
|
10054
10758
|
}
|
|
10055
10759
|
else {
|
|
@@ -10915,7 +11619,7 @@ function requireStringifyNumber () {
|
|
|
10915
11619
|
const num = typeof value === 'number' ? value : Number(value);
|
|
10916
11620
|
if (!isFinite(num))
|
|
10917
11621
|
return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';
|
|
10918
|
-
let n = JSON.stringify(value);
|
|
11622
|
+
let n = Object.is(value, -0) ? '-0' : JSON.stringify(value);
|
|
10919
11623
|
if (!format &&
|
|
10920
11624
|
minFractionDigits &&
|
|
10921
11625
|
(!tag || tag === 'tag:yaml.org,2002:float') &&
|
|
@@ -12503,7 +13207,7 @@ function requireErrors () {
|
|
|
12503
13207
|
if (/[^ ]/.test(lineStr)) {
|
|
12504
13208
|
let count = 1;
|
|
12505
13209
|
const end = error.linePos[1];
|
|
12506
|
-
if (end
|
|
13210
|
+
if (end?.line === line && end.col > col) {
|
|
12507
13211
|
count = Math.max(1, Math.min(end.col - col, 80 - ci));
|
|
12508
13212
|
}
|
|
12509
13213
|
const pointer = ' '.repeat(ci) + '^'.repeat(count);
|
|
@@ -12934,7 +13638,7 @@ function requireResolveBlockSeq () {
|
|
|
12934
13638
|
});
|
|
12935
13639
|
if (!props.found) {
|
|
12936
13640
|
if (props.anchor || props.tag || value) {
|
|
12937
|
-
if (value
|
|
13641
|
+
if (value?.type === 'block-seq')
|
|
12938
13642
|
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
|
|
12939
13643
|
else
|
|
12940
13644
|
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
|
|
@@ -13153,7 +13857,7 @@ function requireResolveFlowCollection () {
|
|
|
13153
13857
|
}
|
|
13154
13858
|
}
|
|
13155
13859
|
else if (value) {
|
|
13156
|
-
if ('source' in value && value.source
|
|
13860
|
+
if ('source' in value && value.source?.[0] === ':')
|
|
13157
13861
|
onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
|
|
13158
13862
|
else
|
|
13159
13863
|
onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
|
|
@@ -13197,7 +13901,7 @@ function requireResolveFlowCollection () {
|
|
|
13197
13901
|
const expectedEnd = isMap ? '}' : ']';
|
|
13198
13902
|
const [ce, ...ee] = fc.end;
|
|
13199
13903
|
let cePos = offset;
|
|
13200
|
-
if (ce
|
|
13904
|
+
if (ce?.source === expectedEnd)
|
|
13201
13905
|
cePos = ce.offset + ce.source.length;
|
|
13202
13906
|
else {
|
|
13203
13907
|
const name = fcName[0].toUpperCase() + fcName.substring(1);
|
|
@@ -13295,7 +13999,7 @@ function requireComposeCollection () {
|
|
|
13295
13999
|
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
|
|
13296
14000
|
if (!tag) {
|
|
13297
14001
|
const kt = ctx.schema.knownTags[tagName];
|
|
13298
|
-
if (kt
|
|
14002
|
+
if (kt?.collection === expType) {
|
|
13299
14003
|
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
|
|
13300
14004
|
tag = kt;
|
|
13301
14005
|
}
|
|
@@ -15840,7 +16544,7 @@ function requireParser () {
|
|
|
15840
16544
|
}
|
|
15841
16545
|
*step() {
|
|
15842
16546
|
const top = this.peek(1);
|
|
15843
|
-
if (this.type === 'doc-end' &&
|
|
16547
|
+
if (this.type === 'doc-end' && top?.type !== 'doc-end') {
|
|
15844
16548
|
while (this.stack.length > 0)
|
|
15845
16549
|
yield* this.pop();
|
|
15846
16550
|
this.stack.push({
|
|
@@ -16372,7 +17076,7 @@ function requireParser () {
|
|
|
16372
17076
|
do {
|
|
16373
17077
|
yield* this.pop();
|
|
16374
17078
|
top = this.peek(1);
|
|
16375
|
-
} while (top
|
|
17079
|
+
} while (top?.type === 'flow-collection');
|
|
16376
17080
|
}
|
|
16377
17081
|
else if (fc.end.length === 0) {
|
|
16378
17082
|
switch (this.type) {
|
|
@@ -17091,7 +17795,7 @@ const renderAvailableScriptsHelp = (cwd) => {
|
|
|
17091
17795
|
const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
17092
17796
|
|
|
17093
17797
|
function findUpSync(name, {
|
|
17094
|
-
cwd = process$
|
|
17798
|
+
cwd = process$3.cwd(),
|
|
17095
17799
|
type = 'file',
|
|
17096
17800
|
stopAt,
|
|
17097
17801
|
} = {}) {
|
|
@@ -17686,7 +18390,7 @@ async function readPackageJsonScripts(cwd) {
|
|
|
17686
18390
|
}
|
|
17687
18391
|
/** Ask user for config values; preserve script set optionally. */
|
|
17688
18392
|
async function promptForConfig(cwd, pkgScripts, defaults, preserveScriptsFromDefaults) {
|
|
17689
|
-
const { default: inquirer } = (await import('./index-
|
|
18393
|
+
const { default: inquirer } = (await import('./index-DXJaQ46Q.js'));
|
|
17690
18394
|
const scriptKeys = Object.keys(pkgScripts);
|
|
17691
18395
|
const defaultSelected = defaults?.scripts
|
|
17692
18396
|
? Object.keys(defaults.scripts).filter((k) => scriptKeys.includes(k))
|
|
@@ -17884,7 +18588,7 @@ async function maybeMigrateLegacyToNamespaced(base, existingPath, opts) {
|
|
|
17884
18588
|
let proceed = Boolean(opts?.force);
|
|
17885
18589
|
if (!proceed && legacyPresent) {
|
|
17886
18590
|
try {
|
|
17887
|
-
const { default: inquirer } = (await import('./index-
|
|
18591
|
+
const { default: inquirer } = (await import('./index-DXJaQ46Q.js'));
|
|
17888
18592
|
const ans = (await inquirer.prompt([
|
|
17889
18593
|
{
|
|
17890
18594
|
type: 'confirm',
|
|
@@ -17996,7 +18700,7 @@ const handleSnapshot = async (args) => {
|
|
|
17996
18700
|
}
|
|
17997
18701
|
try {
|
|
17998
18702
|
if (!dryRun) {
|
|
17999
|
-
const { default: inquirer } = (await import('./index-
|
|
18703
|
+
const { default: inquirer } = (await import('./index-DXJaQ46Q.js'));
|
|
18000
18704
|
const ans = (await inquirer.prompt([
|
|
18001
18705
|
{
|
|
18002
18706
|
type: 'confirm',
|
|
@@ -18503,14 +19207,14 @@ const ansiStyles$1 = assembleStyles();
|
|
|
18503
19207
|
|
|
18504
19208
|
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
|
|
18505
19209
|
/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
|
|
18506
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$
|
|
19210
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$3.argv) {
|
|
18507
19211
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
18508
19212
|
const position = argv.indexOf(prefix + flag);
|
|
18509
19213
|
const terminatorPosition = argv.indexOf('--');
|
|
18510
19214
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
18511
19215
|
}
|
|
18512
19216
|
|
|
18513
|
-
const {env} = process$
|
|
19217
|
+
const {env} = process$3;
|
|
18514
19218
|
|
|
18515
19219
|
let flagForceColor;
|
|
18516
19220
|
if (
|
|
@@ -18596,7 +19300,7 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
|
18596
19300
|
return min;
|
|
18597
19301
|
}
|
|
18598
19302
|
|
|
18599
|
-
if (process$
|
|
19303
|
+
if (process$3.platform === 'win32') {
|
|
18600
19304
|
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
18601
19305
|
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
18602
19306
|
const osRelease = os$1.release().split('.');
|
|
@@ -22597,9 +23301,9 @@ var hasRequiredDrawBorder;
|
|
|
22597
23301
|
function requireDrawBorder () {
|
|
22598
23302
|
if (hasRequiredDrawBorder) return drawBorder;
|
|
22599
23303
|
hasRequiredDrawBorder = 1;
|
|
22600
|
-
(function (exports) {
|
|
22601
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22602
|
-
exports.createTableBorderGetter = exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = exports.createSeparatorGetter = exports.drawBorderSegments = void 0;
|
|
23304
|
+
(function (exports$1) {
|
|
23305
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
23306
|
+
exports$1.createTableBorderGetter = exports$1.drawBorderBottom = exports$1.drawBorderJoin = exports$1.drawBorderTop = exports$1.drawBorder = exports$1.createSeparatorGetter = exports$1.drawBorderSegments = void 0;
|
|
22603
23307
|
const drawContent_1 = /*@__PURE__*/ requireDrawContent();
|
|
22604
23308
|
const drawBorderSegments = (columnWidths, parameters) => {
|
|
22605
23309
|
const { separator, horizontalBorderIndex, spanningCellManager } = parameters;
|
|
@@ -22626,7 +23330,7 @@ function requireDrawBorder () {
|
|
|
22626
23330
|
return range.extractBorderContent(horizontalBorderIndex);
|
|
22627
23331
|
});
|
|
22628
23332
|
};
|
|
22629
|
-
exports.drawBorderSegments = drawBorderSegments;
|
|
23333
|
+
exports$1.drawBorderSegments = drawBorderSegments;
|
|
22630
23334
|
const createSeparatorGetter = (dependencies) => {
|
|
22631
23335
|
const { separator, spanningCellManager, horizontalBorderIndex, rowCount } = dependencies;
|
|
22632
23336
|
// eslint-disable-next-line complexity
|
|
@@ -22721,23 +23425,23 @@ function requireDrawBorder () {
|
|
|
22721
23425
|
return separator.join;
|
|
22722
23426
|
};
|
|
22723
23427
|
};
|
|
22724
|
-
exports.createSeparatorGetter = createSeparatorGetter;
|
|
23428
|
+
exports$1.createSeparatorGetter = createSeparatorGetter;
|
|
22725
23429
|
const drawBorder = (columnWidths, parameters) => {
|
|
22726
|
-
const borderSegments = (0, exports.drawBorderSegments)(columnWidths, parameters);
|
|
23430
|
+
const borderSegments = (0, exports$1.drawBorderSegments)(columnWidths, parameters);
|
|
22727
23431
|
const { drawVerticalLine, horizontalBorderIndex, spanningCellManager } = parameters;
|
|
22728
23432
|
return (0, drawContent_1.drawContent)({
|
|
22729
23433
|
contents: borderSegments,
|
|
22730
23434
|
drawSeparator: drawVerticalLine,
|
|
22731
23435
|
elementType: 'border',
|
|
22732
23436
|
rowIndex: horizontalBorderIndex,
|
|
22733
|
-
separatorGetter: (0, exports.createSeparatorGetter)(parameters),
|
|
23437
|
+
separatorGetter: (0, exports$1.createSeparatorGetter)(parameters),
|
|
22734
23438
|
spanningCellManager,
|
|
22735
23439
|
}) + '\n';
|
|
22736
23440
|
};
|
|
22737
|
-
exports.drawBorder = drawBorder;
|
|
23441
|
+
exports$1.drawBorder = drawBorder;
|
|
22738
23442
|
const drawBorderTop = (columnWidths, parameters) => {
|
|
22739
23443
|
const { border } = parameters;
|
|
22740
|
-
const result = (0, exports.drawBorder)(columnWidths, {
|
|
23444
|
+
const result = (0, exports$1.drawBorder)(columnWidths, {
|
|
22741
23445
|
...parameters,
|
|
22742
23446
|
separator: {
|
|
22743
23447
|
body: border.topBody,
|
|
@@ -22751,10 +23455,10 @@ function requireDrawBorder () {
|
|
|
22751
23455
|
}
|
|
22752
23456
|
return result;
|
|
22753
23457
|
};
|
|
22754
|
-
exports.drawBorderTop = drawBorderTop;
|
|
23458
|
+
exports$1.drawBorderTop = drawBorderTop;
|
|
22755
23459
|
const drawBorderJoin = (columnWidths, parameters) => {
|
|
22756
23460
|
const { border } = parameters;
|
|
22757
|
-
return (0, exports.drawBorder)(columnWidths, {
|
|
23461
|
+
return (0, exports$1.drawBorder)(columnWidths, {
|
|
22758
23462
|
...parameters,
|
|
22759
23463
|
separator: {
|
|
22760
23464
|
body: border.joinBody,
|
|
@@ -22770,10 +23474,10 @@ function requireDrawBorder () {
|
|
|
22770
23474
|
},
|
|
22771
23475
|
});
|
|
22772
23476
|
};
|
|
22773
|
-
exports.drawBorderJoin = drawBorderJoin;
|
|
23477
|
+
exports$1.drawBorderJoin = drawBorderJoin;
|
|
22774
23478
|
const drawBorderBottom = (columnWidths, parameters) => {
|
|
22775
23479
|
const { border } = parameters;
|
|
22776
|
-
return (0, exports.drawBorder)(columnWidths, {
|
|
23480
|
+
return (0, exports$1.drawBorder)(columnWidths, {
|
|
22777
23481
|
...parameters,
|
|
22778
23482
|
separator: {
|
|
22779
23483
|
body: border.bottomBody,
|
|
@@ -22783,21 +23487,21 @@ function requireDrawBorder () {
|
|
|
22783
23487
|
},
|
|
22784
23488
|
});
|
|
22785
23489
|
};
|
|
22786
|
-
exports.drawBorderBottom = drawBorderBottom;
|
|
23490
|
+
exports$1.drawBorderBottom = drawBorderBottom;
|
|
22787
23491
|
const createTableBorderGetter = (columnWidths, parameters) => {
|
|
22788
23492
|
return (index, size) => {
|
|
22789
23493
|
const drawBorderParameters = { ...parameters,
|
|
22790
23494
|
horizontalBorderIndex: index };
|
|
22791
23495
|
if (index === 0) {
|
|
22792
|
-
return (0, exports.drawBorderTop)(columnWidths, drawBorderParameters);
|
|
23496
|
+
return (0, exports$1.drawBorderTop)(columnWidths, drawBorderParameters);
|
|
22793
23497
|
}
|
|
22794
23498
|
else if (index === size) {
|
|
22795
|
-
return (0, exports.drawBorderBottom)(columnWidths, drawBorderParameters);
|
|
23499
|
+
return (0, exports$1.drawBorderBottom)(columnWidths, drawBorderParameters);
|
|
22796
23500
|
}
|
|
22797
|
-
return (0, exports.drawBorderJoin)(columnWidths, drawBorderParameters);
|
|
23501
|
+
return (0, exports$1.drawBorderJoin)(columnWidths, drawBorderParameters);
|
|
22798
23502
|
};
|
|
22799
23503
|
};
|
|
22800
|
-
exports.createTableBorderGetter = createTableBorderGetter;
|
|
23504
|
+
exports$1.createTableBorderGetter = createTableBorderGetter;
|
|
22801
23505
|
|
|
22802
23506
|
} (drawBorder));
|
|
22803
23507
|
return drawBorder;
|
|
@@ -22918,8 +23622,8 @@ var hasRequiredValidators;
|
|
|
22918
23622
|
function requireValidators () {
|
|
22919
23623
|
if (hasRequiredValidators) return validators;
|
|
22920
23624
|
hasRequiredValidators = 1;
|
|
22921
|
-
(function (exports) {
|
|
22922
|
-
exports["config.json"] = validate43;
|
|
23625
|
+
(function (exports$1) {
|
|
23626
|
+
exports$1["config.json"] = validate43;
|
|
22923
23627
|
const schema13 = {
|
|
22924
23628
|
"properties": {
|
|
22925
23629
|
"spanningCells": {
|
|
@@ -24703,7 +25407,7 @@ function requireValidators () {
|
|
|
24703
25407
|
validate43.errors = vErrors;
|
|
24704
25408
|
return errors === 0;
|
|
24705
25409
|
}
|
|
24706
|
-
exports["streamConfig.json"] = validate86;
|
|
25410
|
+
exports$1["streamConfig.json"] = validate86;
|
|
24707
25411
|
function validate87(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
24708
25412
|
let vErrors = null;
|
|
24709
25413
|
let errors = 0;
|
|
@@ -25575,9 +26279,9 @@ var hasRequiredMapDataUsingRowHeights;
|
|
|
25575
26279
|
function requireMapDataUsingRowHeights () {
|
|
25576
26280
|
if (hasRequiredMapDataUsingRowHeights) return mapDataUsingRowHeights;
|
|
25577
26281
|
hasRequiredMapDataUsingRowHeights = 1;
|
|
25578
|
-
(function (exports) {
|
|
25579
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25580
|
-
exports.mapDataUsingRowHeights = exports.padCellVertically = void 0;
|
|
26282
|
+
(function (exports$1) {
|
|
26283
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
26284
|
+
exports$1.mapDataUsingRowHeights = exports$1.padCellVertically = void 0;
|
|
25581
26285
|
const utils_1 = /*@__PURE__*/ requireUtils();
|
|
25582
26286
|
const wrapCell_1 = /*@__PURE__*/ requireWrapCell();
|
|
25583
26287
|
const createEmptyStrings = (length) => {
|
|
@@ -25597,7 +26301,7 @@ function requireMapDataUsingRowHeights () {
|
|
|
25597
26301
|
...createEmptyStrings(Math.ceil(availableLines / 2)),
|
|
25598
26302
|
];
|
|
25599
26303
|
};
|
|
25600
|
-
exports.padCellVertically = padCellVertically;
|
|
26304
|
+
exports$1.padCellVertically = padCellVertically;
|
|
25601
26305
|
const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => {
|
|
25602
26306
|
const nColumns = unmappedRows[0].length;
|
|
25603
26307
|
const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => {
|
|
@@ -25616,7 +26320,7 @@ function requireMapDataUsingRowHeights () {
|
|
|
25616
26320
|
return;
|
|
25617
26321
|
}
|
|
25618
26322
|
const cellLines = (0, wrapCell_1.wrapCell)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord);
|
|
25619
|
-
const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment);
|
|
26323
|
+
const paddedCellLines = (0, exports$1.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment);
|
|
25620
26324
|
paddedCellLines.forEach((cellLine, cellLineIndex) => {
|
|
25621
26325
|
outputRow[cellLineIndex][cellIndex] = cellLine;
|
|
25622
26326
|
});
|
|
@@ -25625,7 +26329,7 @@ function requireMapDataUsingRowHeights () {
|
|
|
25625
26329
|
});
|
|
25626
26330
|
return (0, utils_1.flatten)(mappedRows);
|
|
25627
26331
|
};
|
|
25628
|
-
exports.mapDataUsingRowHeights = mapDataUsingRowHeights;
|
|
26332
|
+
exports$1.mapDataUsingRowHeights = mapDataUsingRowHeights;
|
|
25629
26333
|
|
|
25630
26334
|
} (mapDataUsingRowHeights));
|
|
25631
26335
|
return mapDataUsingRowHeights;
|
|
@@ -25638,13 +26342,13 @@ var hasRequiredPadTableData;
|
|
|
25638
26342
|
function requirePadTableData () {
|
|
25639
26343
|
if (hasRequiredPadTableData) return padTableData;
|
|
25640
26344
|
hasRequiredPadTableData = 1;
|
|
25641
|
-
(function (exports) {
|
|
25642
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25643
|
-
exports.padTableData = exports.padString = void 0;
|
|
26345
|
+
(function (exports$1) {
|
|
26346
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
26347
|
+
exports$1.padTableData = exports$1.padString = void 0;
|
|
25644
26348
|
const padString = (input, paddingLeft, paddingRight) => {
|
|
25645
26349
|
return ' '.repeat(paddingLeft) + input + ' '.repeat(paddingRight);
|
|
25646
26350
|
};
|
|
25647
|
-
exports.padString = padString;
|
|
26351
|
+
exports$1.padString = padString;
|
|
25648
26352
|
const padTableData = (rows, config) => {
|
|
25649
26353
|
return rows.map((cells, rowIndex) => {
|
|
25650
26354
|
return cells.map((cell, cellIndex) => {
|
|
@@ -25655,11 +26359,11 @@ function requirePadTableData () {
|
|
|
25655
26359
|
return cell;
|
|
25656
26360
|
}
|
|
25657
26361
|
const { paddingLeft, paddingRight } = config.columns[cellIndex];
|
|
25658
|
-
return (0, exports.padString)(cell, paddingLeft, paddingRight);
|
|
26362
|
+
return (0, exports$1.padString)(cell, paddingLeft, paddingRight);
|
|
25659
26363
|
});
|
|
25660
26364
|
});
|
|
25661
26365
|
};
|
|
25662
|
-
exports.padTableData = padTableData;
|
|
26366
|
+
exports$1.padTableData = padTableData;
|
|
25663
26367
|
|
|
25664
26368
|
} (padTableData));
|
|
25665
26369
|
return padTableData;
|
|
@@ -25706,7 +26410,7 @@ var hasRequiredLodash_truncate;
|
|
|
25706
26410
|
function requireLodash_truncate () {
|
|
25707
26411
|
if (hasRequiredLodash_truncate) return lodash_truncate.exports;
|
|
25708
26412
|
hasRequiredLodash_truncate = 1;
|
|
25709
|
-
(function (module, exports) {
|
|
26413
|
+
(function (module, exports$1) {
|
|
25710
26414
|
/** Used as default options for `_.truncate`. */
|
|
25711
26415
|
var DEFAULT_TRUNC_LENGTH = 30,
|
|
25712
26416
|
DEFAULT_TRUNC_OMISSION = '...';
|
|
@@ -25777,7 +26481,7 @@ function requireLodash_truncate () {
|
|
|
25777
26481
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
25778
26482
|
|
|
25779
26483
|
/** Detect free variable `exports`. */
|
|
25780
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
26484
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
25781
26485
|
|
|
25782
26486
|
/** Detect free variable `module`. */
|
|
25783
26487
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -26339,29 +27043,29 @@ var hasRequiredTruncateTableData;
|
|
|
26339
27043
|
function requireTruncateTableData () {
|
|
26340
27044
|
if (hasRequiredTruncateTableData) return truncateTableData;
|
|
26341
27045
|
hasRequiredTruncateTableData = 1;
|
|
26342
|
-
(function (exports) {
|
|
27046
|
+
(function (exports$1) {
|
|
26343
27047
|
var __importDefault = (truncateTableData && truncateTableData.__importDefault) || function (mod) {
|
|
26344
27048
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26345
27049
|
};
|
|
26346
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26347
|
-
exports.truncateTableData = exports.truncateString = void 0;
|
|
27050
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
27051
|
+
exports$1.truncateTableData = exports$1.truncateString = void 0;
|
|
26348
27052
|
const lodash_truncate_1 = __importDefault(requireLodash_truncate());
|
|
26349
27053
|
const truncateString = (input, length) => {
|
|
26350
27054
|
return (0, lodash_truncate_1.default)(input, { length,
|
|
26351
27055
|
omission: '…' });
|
|
26352
27056
|
};
|
|
26353
|
-
exports.truncateString = truncateString;
|
|
27057
|
+
exports$1.truncateString = truncateString;
|
|
26354
27058
|
/**
|
|
26355
27059
|
* @todo Make it work with ASCII content.
|
|
26356
27060
|
*/
|
|
26357
27061
|
const truncateTableData$1 = (rows, truncates) => {
|
|
26358
27062
|
return rows.map((cells) => {
|
|
26359
27063
|
return cells.map((cell, cellIndex) => {
|
|
26360
|
-
return (0, exports.truncateString)(cell, truncates[cellIndex]);
|
|
27064
|
+
return (0, exports$1.truncateString)(cell, truncates[cellIndex]);
|
|
26361
27065
|
});
|
|
26362
27066
|
});
|
|
26363
27067
|
};
|
|
26364
|
-
exports.truncateTableData = truncateTableData$1;
|
|
27068
|
+
exports$1.truncateTableData = truncateTableData$1;
|
|
26365
27069
|
|
|
26366
27070
|
} (truncateTableData));
|
|
26367
27071
|
return truncateTableData;
|
|
@@ -26556,18 +27260,18 @@ var hasRequiredCalculateMaximumColumnWidths;
|
|
|
26556
27260
|
function requireCalculateMaximumColumnWidths () {
|
|
26557
27261
|
if (hasRequiredCalculateMaximumColumnWidths) return calculateMaximumColumnWidths;
|
|
26558
27262
|
hasRequiredCalculateMaximumColumnWidths = 1;
|
|
26559
|
-
(function (exports) {
|
|
27263
|
+
(function (exports$1) {
|
|
26560
27264
|
var __importDefault = (calculateMaximumColumnWidths && calculateMaximumColumnWidths.__importDefault) || function (mod) {
|
|
26561
27265
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26562
27266
|
};
|
|
26563
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26564
|
-
exports.calculateMaximumColumnWidths = exports.calculateMaximumCellWidth = void 0;
|
|
27267
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
27268
|
+
exports$1.calculateMaximumColumnWidths = exports$1.calculateMaximumCellWidth = void 0;
|
|
26565
27269
|
const string_width_1 = __importDefault(requireStringWidth());
|
|
26566
27270
|
const utils_1 = /*@__PURE__*/ requireUtils();
|
|
26567
27271
|
const calculateMaximumCellWidth = (cell) => {
|
|
26568
27272
|
return Math.max(...cell.split('\n').map(string_width_1.default));
|
|
26569
27273
|
};
|
|
26570
|
-
exports.calculateMaximumCellWidth = calculateMaximumCellWidth;
|
|
27274
|
+
exports$1.calculateMaximumCellWidth = calculateMaximumCellWidth;
|
|
26571
27275
|
/**
|
|
26572
27276
|
* Produces an array of values that describe the largest value length (width) in every column.
|
|
26573
27277
|
*/
|
|
@@ -26585,12 +27289,12 @@ function requireCalculateMaximumColumnWidths () {
|
|
|
26585
27289
|
if (isSpanningCell(rowIndex, cellIndex)) {
|
|
26586
27290
|
return;
|
|
26587
27291
|
}
|
|
26588
|
-
columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports.calculateMaximumCellWidth)(cell));
|
|
27292
|
+
columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports$1.calculateMaximumCellWidth)(cell));
|
|
26589
27293
|
});
|
|
26590
27294
|
});
|
|
26591
27295
|
return columnWidths;
|
|
26592
27296
|
};
|
|
26593
|
-
exports.calculateMaximumColumnWidths = calculateMaximumColumnWidths$1;
|
|
27297
|
+
exports$1.calculateMaximumColumnWidths = calculateMaximumColumnWidths$1;
|
|
26594
27298
|
|
|
26595
27299
|
} (calculateMaximumColumnWidths));
|
|
26596
27300
|
return calculateMaximumColumnWidths;
|
|
@@ -27040,7 +27744,7 @@ var hasRequiredSrc;
|
|
|
27040
27744
|
function requireSrc () {
|
|
27041
27745
|
if (hasRequiredSrc) return src;
|
|
27042
27746
|
hasRequiredSrc = 1;
|
|
27043
|
-
(function (exports) {
|
|
27747
|
+
(function (exports$1) {
|
|
27044
27748
|
var __createBinding = (src && src.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27045
27749
|
if (k2 === undefined) k2 = k;
|
|
27046
27750
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -27048,18 +27752,18 @@ function requireSrc () {
|
|
|
27048
27752
|
if (k2 === undefined) k2 = k;
|
|
27049
27753
|
o[k2] = m[k];
|
|
27050
27754
|
}));
|
|
27051
|
-
var __exportStar = (src && src.__exportStar) || function(m, exports) {
|
|
27052
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27755
|
+
var __exportStar = (src && src.__exportStar) || function(m, exports$1) {
|
|
27756
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
27053
27757
|
};
|
|
27054
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27055
|
-
exports.getBorderCharacters = exports.createStream = exports.table = void 0;
|
|
27758
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
27759
|
+
exports$1.getBorderCharacters = exports$1.createStream = exports$1.table = void 0;
|
|
27056
27760
|
const createStream_1 = /*@__PURE__*/ requireCreateStream();
|
|
27057
|
-
Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } });
|
|
27761
|
+
Object.defineProperty(exports$1, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } });
|
|
27058
27762
|
const getBorderCharacters_1 = /*@__PURE__*/ requireGetBorderCharacters();
|
|
27059
|
-
Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } });
|
|
27763
|
+
Object.defineProperty(exports$1, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } });
|
|
27060
27764
|
const table_1 = /*@__PURE__*/ requireTable();
|
|
27061
|
-
Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } });
|
|
27062
|
-
__exportStar(/*@__PURE__*/ requireApi(), exports);
|
|
27765
|
+
Object.defineProperty(exports$1, "table", { enumerable: true, get: function () { return table_1.table; } });
|
|
27766
|
+
__exportStar(/*@__PURE__*/ requireApi(), exports$1);
|
|
27063
27767
|
|
|
27064
27768
|
} (src));
|
|
27065
27769
|
return src;
|
|
@@ -28921,7 +29625,7 @@ const sha256File = async (abs) => {
|
|
|
28921
29625
|
.digest('hex');
|
|
28922
29626
|
};
|
|
28923
29627
|
|
|
28924
|
-
/** Build FULL and DIFF base configs; DIFF
|
|
29628
|
+
/** Build FULL and DIFF base configs; DIFF honors anchors (changed-only via snapshot). */
|
|
28925
29629
|
const makeBaseConfigs = (config) => {
|
|
28926
29630
|
const full = {
|
|
28927
29631
|
stanPath: config.stanPath,
|
|
@@ -28935,6 +29639,7 @@ const makeBaseConfigs = (config) => {
|
|
|
28935
29639
|
includes: config.includes ?? [],
|
|
28936
29640
|
excludes: config.excludes ?? [],
|
|
28937
29641
|
imports: config.imports,
|
|
29642
|
+
anchors: config.anchors ?? [],
|
|
28938
29643
|
};
|
|
28939
29644
|
return { full, diff };
|
|
28940
29645
|
};
|
|
@@ -31314,6 +32019,9 @@ const computeFacetOverlay = async (input) => {
|
|
|
31314
32019
|
const meta = await readFacetMeta(cwd, stanPath);
|
|
31315
32020
|
const state = await readFacetState(cwd, stanPath);
|
|
31316
32021
|
const facetNames = Object.keys(meta);
|
|
32022
|
+
const explicitOff = new Set(Array.isArray(input.deactivate)
|
|
32023
|
+
? input.deactivate.filter((s) => typeof s === 'string')
|
|
32024
|
+
: []);
|
|
31317
32025
|
// Narrow a facet definition object safely (avoid optional-chaining on meta[name]).
|
|
31318
32026
|
const defOf = (name) => {
|
|
31319
32027
|
const raw = meta[name];
|
|
@@ -31387,6 +32095,15 @@ const computeFacetOverlay = async (input) => {
|
|
|
31387
32095
|
catch {
|
|
31388
32096
|
/* best-effort */
|
|
31389
32097
|
}
|
|
32098
|
+
// Also anchor docs metadata so assistants can see prompt/overlay baselines.
|
|
32099
|
+
// This file is gitignored but safe to include (subject to reserved denials).
|
|
32100
|
+
try {
|
|
32101
|
+
const docsMeta = posix(path.join(stanPath, 'system', '.docs.meta.json'));
|
|
32102
|
+
anchorsOverlaySet.add(docsMeta);
|
|
32103
|
+
}
|
|
32104
|
+
catch {
|
|
32105
|
+
/* best-effort */
|
|
32106
|
+
}
|
|
31390
32107
|
// If overlay disabled, do not add any excludes, but still report anchorsKept counts.
|
|
31391
32108
|
if (!input.enabled) {
|
|
31392
32109
|
// Count anchors that exist physically for metadata
|
|
@@ -31428,10 +32145,13 @@ const computeFacetOverlay = async (input) => {
|
|
|
31428
32145
|
inc.length > 0 &&
|
|
31429
32146
|
exRoots.some((root) => inc.some((a) => isUnder(a, root) && existsSync(toAbs(cwd, a))));
|
|
31430
32147
|
if (hasRoots && !hasAnchorUnderRoot) {
|
|
31431
|
-
//
|
|
31432
|
-
|
|
31433
|
-
|
|
31434
|
-
|
|
32148
|
+
// Option Y: explicit per-run deactivation wins.
|
|
32149
|
+
// Only auto-suspend when the facet is inactive due to default/state (not an explicit --facets-off).
|
|
32150
|
+
if (!explicitOff.has(name)) {
|
|
32151
|
+
effective[name] = true;
|
|
32152
|
+
autosuspended.push(name);
|
|
32153
|
+
continue;
|
|
32154
|
+
}
|
|
31435
32155
|
}
|
|
31436
32156
|
// Aggregate subtree excludes for truly inactive facets with anchors present under roots (if any).
|
|
31437
32157
|
for (const rootRaw of exRoots) {
|
|
@@ -31550,13 +32270,7 @@ const buildOverlayInputs = async (args) => {
|
|
|
31550
32270
|
overlapKeptCounts: {},
|
|
31551
32271
|
};
|
|
31552
32272
|
}
|
|
31553
|
-
|
|
31554
|
-
// - If explicit per‑run overrides (-f/-F names) are provided, we still derive
|
|
31555
|
-
// engine excludes/leaf‑globs so callers can observe the intended mapping.
|
|
31556
|
-
const shouldMap = enabled ||
|
|
31557
|
-
(Array.isArray(args.activateNames) && args.activateNames.length > 0) ||
|
|
31558
|
-
(Array.isArray(args.deactivateNames) && args.deactivateNames.length > 0) ||
|
|
31559
|
-
args.nakedActivateAll;
|
|
32273
|
+
const shouldMap = enabled;
|
|
31560
32274
|
// Map overlay excludes to effective deny-list globs for the engine:
|
|
31561
32275
|
// - subtree roots like "docs" -> "docs/**"
|
|
31562
32276
|
// - existing glob patterns (contain *, ?, or [) pass through unchanged.
|
|
@@ -31614,28 +32328,37 @@ const buildOverlayInputs = async (args) => {
|
|
|
31614
32328
|
const resolveOverlayForRun = async (args) => {
|
|
31615
32329
|
const { cwd, stanPath, cmd, options } = args;
|
|
31616
32330
|
const eff = getRunDefaults(cwd);
|
|
31617
|
-
// Parse per-run facet flags
|
|
32331
|
+
// Parse per-run facet flags (Commander sources are required to disambiguate defaults vs CLI intent).
|
|
31618
32332
|
const getSrc = (name) => getOptionSource(cmd, name);
|
|
31619
|
-
|
|
31620
|
-
|
|
31621
|
-
|
|
31622
|
-
const
|
|
31623
|
-
const
|
|
31624
|
-
|
|
31625
|
-
const
|
|
32333
|
+
// Boolean overlay enablement flag (Commander negation stores this on "facets"):
|
|
32334
|
+
// --facets => options.facets === true (source=cli)
|
|
32335
|
+
// --no-facets => options.facets === false (source=cli)
|
|
32336
|
+
const facetsFlag = options.facets;
|
|
32337
|
+
const facetsFlagProvided = getSrc('facets') === 'cli';
|
|
32338
|
+
// Per-run overrides (do not persist to facet.state.json).
|
|
32339
|
+
const facetsOnOpt = options.facetsOn;
|
|
32340
|
+
const facetsOffOpt = options.facetsOff;
|
|
32341
|
+
const activateNames = toStringArray$1(facetsOnOpt);
|
|
32342
|
+
const deactivateNames = toStringArray$1(facetsOffOpt);
|
|
32343
|
+
const facetsOnProvided = getSrc('facetsOn') === 'cli';
|
|
32344
|
+
const facetsOffProvided = getSrc('facetsOff') === 'cli';
|
|
31626
32345
|
// Determine overlay enablement: defaults or per-run overrides
|
|
31627
32346
|
let overlayEnabled = eff.facets;
|
|
31628
|
-
if (
|
|
32347
|
+
if (facetsFlagProvided) {
|
|
32348
|
+
// Explicit --facets/--no-facets wins (Commander negation shape).
|
|
32349
|
+
overlayEnabled = Boolean(facetsFlag);
|
|
32350
|
+
}
|
|
32351
|
+
else if (facetsOnProvided || facetsOffProvided) {
|
|
32352
|
+
// Per-run overrides imply overlay ON (unless user explicitly disables via --no-facets, which conflicts).
|
|
31629
32353
|
overlayEnabled = true;
|
|
31630
|
-
|
|
31631
|
-
overlayEnabled = deactivateNames.length === 0 ? false : true;
|
|
32354
|
+
}
|
|
31632
32355
|
const overlayInputs = await buildOverlayInputs({
|
|
31633
32356
|
cwd,
|
|
31634
32357
|
stanPath,
|
|
31635
32358
|
enabled: overlayEnabled,
|
|
31636
32359
|
activateNames,
|
|
31637
32360
|
deactivateNames,
|
|
31638
|
-
nakedActivateAll,
|
|
32361
|
+
nakedActivateAll: false,
|
|
31639
32362
|
});
|
|
31640
32363
|
return {
|
|
31641
32364
|
overlayInputs,
|
|
@@ -31666,7 +32389,7 @@ const resolveScriptsForRun = async (args) => {
|
|
|
31666
32389
|
let scriptsMap = cliCfg.scripts || {};
|
|
31667
32390
|
if (Object.keys(scriptsMap).length === 0) {
|
|
31668
32391
|
try {
|
|
31669
|
-
const { readCliScriptsFallback } = await import('./config-fallback-
|
|
32392
|
+
const { readCliScriptsFallback } = await import('./config-fallback-CL_TDiMw.js');
|
|
31670
32393
|
scriptsMap = readCliScriptsFallback(cwd);
|
|
31671
32394
|
}
|
|
31672
32395
|
catch {
|
|
@@ -31680,7 +32403,7 @@ const resolveScriptsForRun = async (args) => {
|
|
|
31680
32403
|
})();
|
|
31681
32404
|
if (typeof scriptsDefaultCfg === 'undefined') {
|
|
31682
32405
|
try {
|
|
31683
|
-
const { readRunScriptsDefaultFallback } = await import('./config-fallback-
|
|
32406
|
+
const { readRunScriptsDefaultFallback } = await import('./config-fallback-CL_TDiMw.js');
|
|
31684
32407
|
scriptsDefaultCfg = readRunScriptsDefaultFallback(cwd);
|
|
31685
32408
|
}
|
|
31686
32409
|
catch {
|
|
@@ -31952,11 +32675,18 @@ const registerRunOptions = (cli) => {
|
|
|
31952
32675
|
optHangWarn.default(eff.hangWarn);
|
|
31953
32676
|
optHangKill.default(eff.hangKill);
|
|
31954
32677
|
optHangKillGrace.default(eff.hangKillGrace);
|
|
31955
|
-
// Facet overlay (
|
|
31956
|
-
// -f, --facets
|
|
31957
|
-
// -F, --no-facets
|
|
31958
|
-
|
|
31959
|
-
|
|
32678
|
+
// Facet overlay (breaking change):
|
|
32679
|
+
// -f, --facets → overlay ON for this run
|
|
32680
|
+
// -F, --no-facets → overlay OFF for this run
|
|
32681
|
+
// Per-run overrides (do not persist to facet.state.json):
|
|
32682
|
+
// --facets-on <names...> → force these facets active for this run
|
|
32683
|
+
// --facets-off <names...> → force these facets inactive for this run
|
|
32684
|
+
const optFacets = new Option('-f, --facets', 'enable facet overlay for this run');
|
|
32685
|
+
const optNoFacets = new Option('-F, --no-facets', 'disable facet overlay for this run');
|
|
32686
|
+
const optFacetsOn = new Option('--facets-on <names...>', 'force named facets active for this run (does not persist)');
|
|
32687
|
+
const optFacetsOff = new Option('--facets-off <names...>', 'force named facets inactive for this run (does not persist)');
|
|
32688
|
+
// Prevent ambiguous combinations (explicit overlay-off cannot be combined with per-run overrides).
|
|
32689
|
+
optNoFacets.conflicts(['facetsOn', 'facetsOff']);
|
|
31960
32690
|
// Tag default overlay state from cliDefaults.run.facets
|
|
31961
32691
|
try {
|
|
31962
32692
|
tagDefault(eff.facets ? optFacets : optNoFacets, true);
|
|
@@ -31964,7 +32694,11 @@ const registerRunOptions = (cli) => {
|
|
|
31964
32694
|
catch {
|
|
31965
32695
|
/* best‑effort */
|
|
31966
32696
|
}
|
|
31967
|
-
cmd
|
|
32697
|
+
cmd
|
|
32698
|
+
.addOption(optFacets)
|
|
32699
|
+
.addOption(optNoFacets)
|
|
32700
|
+
.addOption(optFacetsOn)
|
|
32701
|
+
.addOption(optFacetsOff);
|
|
31968
32702
|
// Overlay event presence (action resolves behavior)
|
|
31969
32703
|
cmd.on('option:facets', () => void 0);
|
|
31970
32704
|
cmd.on('option:no-facets', () => void 0);
|
|
@@ -32164,7 +32898,7 @@ function utcStamp() {
|
|
|
32164
32898
|
* named/default export shape differences under Vitest SSR/bundlers.
|
|
32165
32899
|
*/
|
|
32166
32900
|
const resolveCaptureSnapshotAndArchives = async () => {
|
|
32167
|
-
const modUnknown = await import('./capture-
|
|
32901
|
+
const modUnknown = await import('./capture-CiVimFuL.js');
|
|
32168
32902
|
// 1) named export
|
|
32169
32903
|
try {
|
|
32170
32904
|
const named = modUnknown
|
|
@@ -32343,7 +33077,7 @@ async function handleSnap(opts) {
|
|
|
32343
33077
|
maxUndos: 10,
|
|
32344
33078
|
};
|
|
32345
33079
|
try {
|
|
32346
|
-
const ctxMod = (await import('./context-
|
|
33080
|
+
const ctxMod = (await import('./context-BzEQ3A1v.js'));
|
|
32347
33081
|
if (typeof ctxMod.resolveContext === 'function') {
|
|
32348
33082
|
ctx = await ctxMod.resolveContext(cwd);
|
|
32349
33083
|
}
|
|
@@ -32595,4 +33329,4 @@ const makeCli = () => {
|
|
|
32595
33329
|
// to avoid file/folder name conflicts and follow the decomposition policy.
|
|
32596
33330
|
void makeCli().parseAsync();
|
|
32597
33331
|
|
|
32598
|
-
export { ARCH_DIR as A, DBG_SCOPE_SNAP_CONTEXT_LEGACY as D, Nu as N, STATE_FILE as S,
|
|
33332
|
+
export { ARCH_DIR as A, DBG_SCOPE_SNAP_CONTEXT_LEGACY as D, Nu as N, STATE_FILE as S, readJson as a, writeJson as b, SNAP_DIR as c, effective as d, ensureDirs as e, getDefaultExportFromCjs as g, index as i, loadCliConfig as l, normalizeScriptsNode as n, onExit as o, pickCliNode as p, readRawConfigSync as r, within as w };
|