@karmaniverous/stan-core 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("node:fs"),t=require("node:fs/promises"),n=require("node:path"),r=require("fs-extra"),s=require("node:process"),i=require("node:url"),o=require("process"),a=require("buffer"),c=require("node:crypto"),u=require("node:child_process"),l=require("os"),f=require("path"),p=require("util"),h=require("stream"),d=require("events"),g=require("fs"),m="undefined"!=typeof document?document.currentScript:null;const y="archive.tar",v="archive.prev.tar",_=e=>e.replace(/\\/g,"/"),b=(e,t)=>{const n=_(e).replace(/\/+$/,""),r=_(t);return r===n||r.startsWith(`${n}/`)},w=(e,t)=>{const n=_(e);return b(`${n}/diff`,t)||b(`${n}/patch`,t)},S=b,A=e=>{const t=e.replace(/\\/g,"/");return e=>!(w(t,e)||((e,t)=>{const n=_(e);return _(t)===`${n}/output/${y}`||_(t)===`${n}/output/archive.diff.tar`||_(t)===`${n}/output/archive.warnings.txt`})(t,e))},k=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},E=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n)},x=1048576,O=async(e,r)=>{const s=[],i=[],o=[];await Promise.all(r.map(async r=>{const a=r.replace(/\\/g,"/");const c=n.resolve(e,r);let u=null;try{u=await t.stat(c)}catch{return}const l=u?.size??0;let f,p=!1;try{p=await(async e=>{try{const n=await t.open(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:t}=await n.read(e,0,e.length,0);for(let n=0;n<t;n+=1)if(0===e[n])return!0;return!1}finally{await n.close().catch(()=>{})}}catch{return!1}})(c)}catch{p=!1}if(p)return void i.push({path:a,size:l});s.push(a);try{if(l<=x||l<5*x){f=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await t.readFile(c,"utf8"))}}catch{}(l>x||"number"==typeof f&&f>3e3)&&o.push({path:a,size:l,loc:f})}));const a=[];if(i.length>0){a.push(`Binary files excluded from archive (${i.length.toString()}):`);for(const e of i)a.push(` - ${e.path} (${e.size.toString()} bytes)`);a.push("")}if(o.length>0){a.push(`Large text files (included; consider excludes if unwanted) (${o.length.toString()}):`);for(const e of o){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),a.push(t.join(" "))}a.push(""),a.push(`Thresholds: size > ${x.toString()} bytes or LOC > ${3e3.toString()}`)}0===a.length&&a.push("No archive warnings.");const c=a.join("\n")+(a.length?"\n":"");return{textFiles:s,excludedBinaries:i,largeText:o,warningsBody:c}};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C,T={exports:{}};var P,L,N,I,D,M,j,F,H,B,z,K=(C||(C=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=()=>!1,g=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",_={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},b=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i)}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(m,_[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=!1,o=e;0===o.indexOf("!")&&(r=!0,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=!0);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=!0,this._rules.push(t)}}add(e){return this._added=!1,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=!1,i=!1;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=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){p(this,f,!0),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,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,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,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}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)}(T)),T.exports),U=R(K),q={};function Z(){if(L)return P;L=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 P={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=>!0===e?u:c}}function W(){return N||(N=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=Z();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!0===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}}(q)),q}function G(){if(D)return I;D=1;const e=W(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=Z(),m=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return I=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,D=!1,M=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(!0===M||O===c){for(z++;!0!==U()&&(O=Z());)if(O!==r)if(O!==c){if(!0!==M&&O===i&&(O=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==M&&O===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===h&&(z--,0===z)){M=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(O!==a){if(!0!==b.noext){if(!0===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,O===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}}if(O===t){if(x===t&&(D=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||O!==o||R!==C){if(!0!==b.noparen&&O===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&(O=Z());)if(O!==u){if(O===d){B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,O=Z(),O===c&&(M=!0)}!0===b.noext&&(I=!1,N=!1);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&!0===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):!0===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===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:D,negated:F,negatedExtglob:H};if(!0===b.tokens&&(Y.maxDepth=0,m(O)||k.push(K),Y.tokens=k),!0===b.parts||!0===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=!0,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},I}function V(){if(j)return M;j=1;const e=Z(),t=W(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=e.globChars(p.windows),_=e.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH: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=!0===p.bash?P(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=t.removePrefix(l,D),d=l.length;const M=[],j=[],F=[];let H,B=g;const z=()=>D.index===d-1,K=D.peek=(e=1)=>l[D.index+e],U=D.advance=()=>l[++D.index]||"",q=()=>l.slice(D.index+1),Z=(e="",t=0)=>{D.consumed+=e,D.index+=t},W=e=>{D.output+=null!=e.output?e.output:e.value,Z(e.value)},G=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},V=e=>{D[e]++,F.push(e)},Y=e=>{D[e]--,F.pop()},Q=e=>{if("globstar"===B.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||M.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,D.output+=B.output)}if(M.length&&"paren"!==e.type&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&W(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,m.push(e),B=e},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=B,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:D.output?"":A}),Q({type:"paren",extglob:!0,value:U(),output:r}),M.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:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(D.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:H,output:n}),Y("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,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!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!z();){if(H=U(),"\0"===H)continue;if("\\"===H){const e=K();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",Q({type:"text",value:H});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(H+="\\")),!0===p.unescape?H=U():H+=U(),0===D.brackets){Q({type:"text",value:H});continue}}if(D.brackets>0&&("]"!==H||"["===B.value||"[^"===B.value)){if(!1!==p.posix&&":"===H){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=!0,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,D.backtrack=!0,U(),g.output||1!==m.indexOf(B)||(g.output=A);continue}}}("["===H&&":"!==K()||"-"===H&&"]"===K())&&(H=`\\${H}`),"]"!==H||"["!==B.value&&"[^"!==B.value||(H=`\\${H}`),!0===p.posix&&"!"===H&&"["===B.value&&(H="^"),B.value+=H,W({value:H});continue}if(1===D.quotes&&'"'!==H){H=t.escapeRegex(H),B.value+=H,W({value:H});continue}if('"'===H){D.quotes=1===D.quotes?0:1,!0===p.keepQuotes&&Q({type:"text",value:H});continue}if("("===H){V("parens"),Q({type:"paren",value:H});continue}if(")"===H){if(0===D.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=M[M.length-1];if(e&&D.parens===e.parens+1){X(M.pop());continue}Q({type:"paren",value:H,output:D.parens?")":"\\)"}),Y("parens");continue}if("["===H){if(!0!==p.nobracket&&q().includes("]"))V("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));H=`\\${H}`}Q({type:"bracket",value:H});continue}if("]"===H){if(!0===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:H,output:`\\${H}`});continue}if(0===D.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:H,output:`\\${H}`});continue}Y("brackets");const e=B.value.slice(1);if(!0===B.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),B.value+=H,W({value:H}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(D.output=D.output.slice(0,-B.value.length),!0===p.literalBrackets){D.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,D.output+=B.value;continue}if("{"===H&&!0!==p.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};j.push(e),Q(e);continue}if("}"===H){const e=j[j.length-1];if(!0===p.nobrace||!e){Q({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value}Q({type:"brace",value:H,output:t}),Y("braces"),j.pop();continue}if("|"===H){M.length>0&&M[M.length-1].conditions++,Q({type:"text",value:H});continue}if(","===H){let e=H;const t=j[j.length-1];t&&"braces"===F[F.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===B.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),B=g;continue}Q({type:"slash",value:H,output:S});continue}if("."===H){if(D.braces>0&&"dot"===B.type){"."===B.value&&(B.output=b);const e=j[j.length-1];B.type="dots",B.output+=H,B.value+=H,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:H,output:b});continue}Q({type:"dot",value:H,output:b});continue}if("?"===H){if(!(B&&"("===B.value)&&!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",H);continue}if(B&&"paren"===B.type){const e=K();let t=H;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${H}`),Q({type:"text",value:H,output:t});continue}if(!0!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:H,output:R});continue}Q({type:"qmark",value:H,output:$});continue}if("!"===H){if(!0!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",H);continue}if(!0!==p.nonegate&&0===D.index){G();continue}}if("+"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",H);continue}if(B&&"("===B.value||!1===p.regex){Q({type:"plus",value:H,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||D.parens>0){Q({type:"plus",value:H});continue}Q({type:"plus",value:w});continue}if("@"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:!0,value:H,output:""});continue}Q({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=s.exec(q());e&&(H+=e[0],D.index+=e[0].length),Q({type:"text",value:H});continue}if(B&&("globstar"===B.type||!0===B.star)){B.type="star",B.star=!0,B.value+=H,B.output=I,D.backtrack=!0,D.globstar=!0,Z(H);continue}let e=q();if(!0!==p.noextglob&&/^\([^?]/.test(e)){J("star",H);continue}if("star"===B.type){if(!0===p.noglobstar){Z(H);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:H,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=M.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:H,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3)}if("bos"===t.type&&z()){B.type="globstar",B.value+=H,B.output=P(p),D.output=B.output,D.globstar=!0,Z(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){D.output=D.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=P(p)+(p.strictSlashes?")":"|$)"),B.value+=H,D.globstar=!0,D.output+=t.output+B.output,Z(H);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+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${P(p)}${S}|${S}${n})`,B.value+=H,D.output+=t.output+B.output,D.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=H,B.output=`(?:^|${S}|${P(p)}${S})`,D.output=B.output,D.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-B.output.length),B.type="globstar",B.output=P(p),B.value+=H,D.output+=B.output,D.globstar=!0,Z(H);continue}const n={type:"star",value:H,output:I};!0!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||!0!==p.regex?(D.index!==D.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(D.output+=x,B.output+=x):!0===p.dot?(D.output+=O,B.output+=O):(D.output+=L,B.output+=L),"*"!==K()&&(D.output+=A,B.output+=A)),Q(n)):(n.output=H,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=L+n.output),Q(n))}for(;D.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Y("brackets")}for(;D.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Y("parens")}for(;D.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Y("braces")}if(!0===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===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{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?g:h,b=i.capture?"":"?:";let w=!0===i.bash?".*?":m;i.capture&&(w=`(${w})`);const S=e=>!0===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:!1,prefix:""});let E=A(k);return E&&!0!==i.strictSlashes&&(E+=`${l}?`),E},M=u}function Y(){if(H)return F;H=1;const e=G(),t=V(),n=W(),r=Z(),s=(e,t,n=!1)=>{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!1};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,!1,!0),u=c.state;delete c.state;let l=()=>!1;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n)}const f=(n,r=!1)=>{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),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=!1,!!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:!1,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===i),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===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:!1}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return!0===r&&(u.state=e),u},s.makeRe=(e,n={},r=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===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&&!0===t.debug)throw e;return/$^/}},s.constants=r,F=s}function Q(){if(z)return B;z=1;const e=Y(),t=W();function n(n,r,s=!1){return!r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),B=n}var J=R(Q());const X=(e,t)=>{const r=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const s=`${r}/system`,i=`${r}/output`,o=`${r}/diff`,a=`${r}/dist`,c=`${r}/patch`,u=`${r}/imports`;return{rootRel:r,systemRel:s,outputRel:i,diffRel:o,distRel:a,patchRel:c,importsRel:u,rootAbs:n.resolve(e,r),systemAbs:n.resolve(e,s),outputAbs:n.resolve(e,i),diffAbs:n.resolve(e,o),distAbs:n.resolve(e,a),patchAbs:n.resolve(e,c),importsAbs:n.resolve(e,u)}},ee=async e=>{const r=[],s=["."];for(;s.length;){const i=s.pop(),o=n.resolve(e,i),a=await t.readdir(o,{withFileTypes:!0});for(const e of a){const t="."===i?e.name:n.join(i,e.name);e.isDirectory()?s.push(t):r.push(t.replace(/\\/g,"/"))}}return r},te=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},ne=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>te(e,t):()=>!1;var n;const r=J(t,{dot:!0});return e=>r(e)},re=async(r,{cwd:s,stanPath:i,includeOutputDir:o,includes:a=[],excludes:c=[],anchors:u=[]})=>{const l=i.replace(/\\/g,"/"),f=((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)})(r,l),p=await(async r=>{const s=n.resolve(r,".gitignore");if(!e.existsSync(s))return null;try{const e=await t.readFile(s,"utf8"),n=U();return n.add(e),n}catch{return null}})(s),h=[e=>te(e,"node_modules"),e=>te(e,".git"),...p?[e=>p.ignores(e)]:[],...c.map(ne),...f.map(e=>t=>te(t,e)),e=>w(l,e)];o||h.push(e=>S(`${l}/output`,e));const d=r.filter(e=>!h.some(t=>t(e)));if(a.length>0){const e=a.map(ne),t=[e=>w(l,e),...o?[]:[e=>S(`${l}/output`,e)]],n=new Set(d);for(const t of r)e.some(e=>e(t))&&n.add(t);const s=c.map(ne),i=new Set(r.filter(e=>n.has(e)&&!t.some(t=>t(e))&&!s.some(t=>t(e))));if(u.length>0){const e=u.map(ne);for(const t of r){!(w(l,t)||!o&&S(`${l}/output`,t))&&e.some(e=>e(t))&&i.add(t)}}return r.filter(e=>i.has(e))}if(u.length>0){const e=u.map(ne),t=new Set(d);for(const n of r){!(w(l,n)||!o&&S(`${l}/output`,n))&&e.some(e=>e(n))&&t.add(n)}return r.filter(e=>t.has(e))}return d},se=async(e,t)=>{const n=X(e,t);return await r.ensureDir(n.rootAbs),await r.ensureDir(n.outputAbs),await r.ensureDir(n.diffAbs),await r.ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ie=async(e,t)=>{const n=await se(e,t);return{outDir:n.outputAbs,diffDir:n.diffAbs}},oe=".stan",ae=e=>e instanceof URL?i.fileURLToPath(e):e;function ce({cwd:t}={}){const r=function(t,{cwd:r=s.cwd(),type:i="file",stopAt:o}={}){let a=n.resolve(ae(r)??"");const{root:c}=n.parse(a);o=n.resolve(a,ae(o)??c);const u=n.isAbsolute(t);for(;a;){const r=u?t:n.join(a,t);try{const t=e.statSync(r,{throwIfNoEntry:!1});if("file"===i&&t?.isFile()||"directory"===i&&t?.isDirectory())return r}catch{}if(a===o||a===c)break;a=n.dirname(a)}}("package.json",{cwd:t});return r&&n.dirname(r)}const ue=["stan.config.yml","stan.config.yaml","stan.config.json"],le=t=>{for(const r of ue){const s=n.resolve(t,r);if(e.existsSync(s))return s}return null},fe=e=>{const t=le(e);if(t)return t;const r=new Set;let s=e;for(;s;){const e=ce({cwd:s});if(!e||r.has(e))break;r.add(e);const t=le(e);if(t)return t;const i=n.dirname(e);if(i===e||r.has(i))break;s=i}return null};var pe,he={},de={},ge={},me={};function ye(){if(pe)return me;pe=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!0}return!1}return me.ALIAS=e,me.DOC=t,me.MAP=n,me.NODE_TYPE=o,me.PAIR=r,me.SCALAR=s,me.SEQ=i,me.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,me.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,me.isCollection=c,me.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,me.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,me.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return!0}return!1},me.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,me.isScalar=a,me.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,me}var ve,_e,be={};function we(){if(ve)return be;ve=1;var e=ye();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,be.visit=s,be.visitAsync=o,be}function Se(){if(_e)return ge;_e=1;var e=ye(),t=we();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=!1,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=!0;break;case"1.2":this.atNextDocument=!1,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=!1);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!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}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]=!0)}),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:!1,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},ge.Directives=s,ge}var Ae,ke={},Ee={},xe={};function Oe(){if(Ae)return xe;Ae=1;var e=ye(),t=we();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 xe.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!0},xe.anchorNames=n,xe.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}},xe.findNewAnchor=r,xe}var $e,Re={},Ce={};function Te(){if($e)return Ce;return $e=1,Ce.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)},Ce}var Pe,Le,Ne,Ie={};function De(){if(Pe)return Ie;Pe=1;var e=ye();return Ie.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)},Ie}function Me(){if(Le)return Re;Le=1;var e=Te(),t=ye(),n=De();return Re.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:!0,mapAsMap:!0===s,mapKeyWarned:!1,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}},Re}function je(){if(Ne)return Ee;Ne=1;var e=Oe(),t=we(),n=ye(),r=Me(),s=De();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 Ee.Alias=i,Ee}var Fe,He,Be,ze={},Ke={},Ue={};function qe(){if(Fe)return Ue;Fe=1;var e=ye(),t=Me(),n=De();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",Ue.Scalar=r,Ue.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,Ue}function Ze(){if(He)return Ke;He=1;var e=je(),t=ye(),n=qe();return Ke.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},Ke}function We(){if(Be)return ze;Be=1;var e=Ze(),t=ye(),n=Me();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:!1,keepUndefined:!1,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:!0,enumerable:!1,writable:!0})}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,!0);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,!0);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,!0);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!1;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,!0);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,!0);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 ze.Collection=i,ze.collectionFromPath=r,ze.isEmptyPath=s,ze}var Ge,Ve={},Ye={},Qe={},Je={};function Xe(){if(Ge)return Je;Ge=1;function e(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return Je.indentComment=e,Je.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,Je.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),Je}var et,tt,nt,rt,st={},it={};function ot(){if(et)return it;et=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 it.FOLD_BLOCK=e,it.FOLD_FLOW="flow",it.FOLD_QUOTED=t,it.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,g,m=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):m=a-o);let y=!1,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(m=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(_=v,r[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}b=v}if("\n"===o)i===e&&(v=n(r,v,s.length)),m=v+s.length+f,d=void 0;else{if(" "===o&&g&&" "!==g&&"\n"!==g&&"\t"!==g){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v)}if(v>=m)if(d)p.push(d),m=d+f,d=void 0;else if(i===t){for(;" "===g||"\t"===g;)g=o,o=r[v+=1],y=!0;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=!0,m=e+f,d=void 0}else y=!0}g=o}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`)}return w},it}function at(){if(tt)return st;tt=1;var e=qe(),t=ot();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,!1))}function i(e,i){if(!1===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,!1))}function o(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=s;else{const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{a=/\n+(?!\n|$)/g}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const g=u.indent||(u.forceBlockIndent||r(c)?" ":""),m="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(c,d,g.length));if(!c)return m?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let _=c.substring(v);const b=_.indexOf("\n");-1===b?y="-":c===_||b!==_.length-1?(y="+",f&&f()):y="",_&&(c=c.slice(0,-_.length),"\n"===_[_.length-1]&&(_=_.slice(0,-1)),_=_.replace(a,`$&${g}`));let w,S=!1,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=!0;else{if("\n"!==e)break;A=w}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${g}`));let E=(S?g?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!m){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let s=!1;const o=n(u,!0);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=!0});const a=t.foldFlowLines(`${k}${r}${_}`,g,t.FOLD_BLOCK,o);if(!s)return`>${E}\n${g}${a}`}return`|${E}\n${g}${k}${c=c.replace(/\n+/g,`$&${g}`)}${_}`}return st.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:g}=a;g!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(g=e.Scalar.QUOTE_DOUBLE);const m=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:g,inFlow:m}=i;if(h&&f.includes("\n")||m&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||m||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!m&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=!0,c(s,i,a,u);if(h&&d===g)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,!1))}(d,u,l,f);default:return null}};let y=m(g);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=m(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},st}function ct(){if(nt)return Qe;nt=1;var e=Oe(),t=ye(),n=Xe(),r=at();return Qe.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case"block":s=!1;break;case"flow":s=!0;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}},Qe.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},Qe}function ut(){if(rt)return Ye;rt=1;var e=ye(),t=qe(),n=ct(),r=Xe();return Ye.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:g}}=o;let m=e.isNode(s)&&s.comment||null;if(g){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!g&&(!s||m&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(g||!u),indent:f+p});let v,_,b,w=!1,S=!1,A=n.stringify(s,o,()=>w=!0,()=>S=!0);if(!y&&!o.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!g||null==i&&y)return A=`? ${A}`,m&&!w?A+=r.lineComment(A,o.indent,h(m)):S&&c&&c(),A;w&&(m=null),y?(m&&(A+=r.lineComment(A,o.indent,h(m))),A=`? ${A}\n${f}:`):(A=`${A}:`,m&&(A+=r.lineComment(A,o.indent,h(m)))),e.isNode(i)?(v=!!i.spaceBefore,_=i.commentBefore,b=i.comment):(v=!1,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=!1,y||m||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=!1,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=!1;const E=n.stringify(i,o,()=>k=!0,()=>S=!0);let x=" ";if(m||v||_){if(x=v?"\n":"",_){const e=h(_);x+=`\n${r.indentComment(e,o.indent)}`}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n")}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=!1;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=!0)}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},Ye}var lt,ft={},pt={};function ht(){if(lt)return pt;lt=1;var e=o;return pt.debug=function(e,...t){"debug"===e&&console.log(...t)},pt.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n))},pt}var dt,gt,mt,yt={};function vt(){if(dt)return yt;dt=1;var e=ye(),t=qe();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:!0,enumerable:!0,configurable:!0});return n}return yt.addMergeToJSMap=s,yt.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),yt.merge=r,yt}function _t(){if(gt)return ft;gt=1;var e=ht(),t=vt(),n=ct(),r=ye(),s=De();return ft.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=!0,r.inStringifyKey=!0;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=!0}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:!0,enumerable:!0,configurable:!0}):o[u]=l}}return o},ft}function bt(){if(mt)return Ve;mt=1;var e=Ze(),t=ut(),n=_t(),r=ye();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 Ve.Pair=s,Ve.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)},Ve}var wt,St,At,kt={},Et={},xt={},Ot={};function $t(){if(wt)return Ot;wt=1;var e=ye(),t=ct(),n=Xe();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let g=!1;const m=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!g&&c.spaceBefore&&m.push(""),i(o,m,c.commentBefore,g),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!g&&t.spaceBefore&&m.push(""),i(o,m,t.commentBefore,g))}g=!1;let f=t.stringify(c,d,()=>l=null,()=>g=!0);l&&(f+=n.lineComment(f,u,h(l))),g&&l&&(g=!1),m.push(a+f)}let y;if(0===m.length)y=c.start+c.end;else{y=m[0];for(let e=1;e<m.length;++e){const t=m[e];y+=t?`\n${p}${t}`:"\n"}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):g&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:!0,type:null});let h=!1,d=0;const g=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&g.push(""),i(s,g,c.commentBefore,!1),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&g.push(""),i(s,g,t.commentBefore,!1),t.comment&&(h=!0));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=!0)):null==c.value&&t?.comment&&(u=t.comment)}u&&(h=!0);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(g.length>d||l.includes("\n"))&&(h=!0),g.push(l),d=g.length}const{start:m,end:y}=o;if(0===g.length)return m+y;if(!h){const e=g.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth}if(h){let e=m;for(const t of g)e+=t?`\n${u}${c}${t}`:"\n";return`${e}\n${c}${y}`}return`${m}${l}${g.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart())}}return Ot.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?s:r)(e,t,n)},Ot}function Rt(){if(St)return xt;St=1;var e=$t(),t=_t(),n=We(),r=ye(),s=bt(),i=qe();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!1;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),!0)}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(!1)&&(t=Object.assign({},t,{allNullValues:!0})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return xt.YAMLMap=a,xt.findPair=o,xt}function Ct(){if(At)return Et;At=1;var e=ye(),t=Rt();const n={collection:"map",default:!0,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 Et.map=n,Et}var Tt,Pt,Lt={},Nt={};function It(){if(Tt)return Nt;Tt=1;var e=Ze(),t=$t(),n=We(),r=ye(),s=qe(),i=De();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!1;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 Nt.YAMLSeq=o,Nt}function Dt(){if(Pt)return Lt;Pt=1;var e=ye(),t=It();const n={collection:"seq",default:!0,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 Lt.seq=n,Lt}var Mt,jt={};function Ft(){if(Mt)return jt;Mt=1;var e=at();const t={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:!0},n),e.stringifyString(t,n,r,s))};return jt.string=t,jt}var Ht,Bt={},zt={};function Kt(){if(Ht)return zt;Ht=1;var e=qe();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,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 zt.nullTag=t,zt}var Ut,qt={};function Zt(){if(Ut)return qt;Ut=1;var e=qe();const t={identify:e=>"boolean"==typeof e,default:!0,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 qt.boolTag=t,qt}var Wt,Gt,Vt={},Yt={};function Qt(){if(Wt)return Yt;return Wt=1,Yt.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},Yt}function Jt(){if(Gt)return Vt;Gt=1;var e=qe(),t=Qt();const n={identify:e=>"number"==typeof e,default:!0,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:!0,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:!0,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 Vt.float=s,Vt.floatExp=r,Vt.floatNaN=n,Vt}var Xt,en={};function tn(){if(Xt)return en;Xt=1;var e=Qt();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:!0,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:!0,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:!0,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 en.int=i,en.intHex=o,en.intOct=s,en}var nn,rn={};function sn(){if(nn)return rn;nn=1;var e=Ct(),t=Kt(),n=Dt(),r=Ft(),s=Zt(),i=Jt(),o=tn();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 rn.schema=a,rn}var on,an={};function cn(){if(on)return an;on=1;var e=qe(),t=Ct(),n=Dt();function r(e){return"bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:!0,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:!0,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:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return an.schema=a,an}var un,ln={};function fn(){if(un)return ln;un=1;var e=a,t=qe(),n=at();const r={identify:e=>e instanceof Uint8Array,default:!1,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 ln.binary=r,ln}var pn,hn,dn={},gn={};function mn(){if(pn)return gn;pn=1;var e=ye(),t=bt(),n=qe(),r=It();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:!1,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return gn.createPairs=i,gn.pairs=o,gn.resolvePairs=s,gn}function yn(){if(hn)return dn;hn=1;var e=ye(),t=De(),n=Rt(),r=It(),s=mn();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:!1,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 dn.YAMLOMap=i,dn.omap=o,dn}var vn,_n={},bn={};function wn(){if(vn)return bn;vn=1;var e=qe();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=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(!0),stringify:t},r={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(!1),stringify:t};return bn.falseTag=r,bn.trueTag=n,bn}var Sn,An={};function kn(){if(Sn)return An;Sn=1;var e=qe(),t=Qt();const n={identify:e=>"number"==typeof e,default:!0,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:!0,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:!0,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 An.float=s,An.floatExp=r,An.floatNaN=n,An}var En,xn={};function On(){if(En)return xn;En=1;var e=Qt();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:!0,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:!0,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:!0,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:!0,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 xn.int=o,xn.intBin=s,xn.intHex=a,xn.intOct=i,xn}var $n,Rn={};function Cn(){if($n)return Rn;$n=1;var e=ye(),t=bt(),n=Rt();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(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),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:!1,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(!0))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 Rn.YAMLSet=r,Rn.set=s,Rn}var Tn,Pn,Ln,Nn,In={};function Dn(){if(Tn)return In;Tn=1;var e=Qt();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:!0,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:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,!1),stringify:n},i={identify:e=>e instanceof Date,default:!0,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,!1);Math.abs(e)<30&&(e*=60),f-=6e4*e}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return In.floatTime=s,In.intTime=r,In.timestamp=i,In}function Mn(){if(Pn)return _n;Pn=1;var e=Ct(),t=Kt(),n=Dt(),r=Ft(),s=fn(),i=wn(),o=kn(),a=On(),c=vt(),u=yn(),l=mn(),f=Cn(),p=Dn();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 _n.schema=h,_n}function jn(){if(Ln)return Bt;Ln=1;var e=Ct(),t=Kt(),n=Dt(),r=Ft(),s=Zt(),i=Jt(),o=tn(),a=sn(),c=cn(),u=fn(),l=vt(),f=yn(),p=mn(),h=Mn(),d=Cn(),g=Dn();const m=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:g.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:g.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:g.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":g.timestamp};return Bt.coreKnownTags=v,Bt.getTags=function(e,t,n){const r=m.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(m.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},Bt}function Fn(){if(Nn)return kt;Nn=1;var e=ye(),t=Ct(),n=Dt(),r=Ft(),s=jn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return kt.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:!0===f?i:null}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},kt}var Hn,Bn,zn={};function Kn(){if(Hn)return zn;Hn=1;var e=ye(),t=ct(),n=Xe();return zn.stringifyDocument=function(r,s){const i=[];let o=!0===s.directives;if(!1!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=!0):r.directives.docStart&&(o=!0)}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=!1,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=!0;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"},zn}function Un(){if(Bn)return ke;Bn=1;var e=je(),t=We(),n=ye(),r=bt(),s=De(),i=Fn(),o=Kn(),a=Oe(),c=Te(),u=Ze(),l=Se();function f(e){if(n.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}return ke.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:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r)}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e)}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t)}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:g}=a.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:g},y=u.createNode(e,p,m);return c&&n.isCollection(y)&&(y.flow=!0),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,!0):!!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:!1,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:!0,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:!0===n,mapKeyWarned:!1,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:!0,jsonArg:e,mapAsMap:!1,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)}},ke}var qn,Zn={};function Wn(){if(qn)return Zn;qn=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}return Zn.YAMLError=e,Zn.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Zn.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Zn.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`}},Zn}var Gn,Vn={},Yn={},Qn={},Jn={},Xn={};function er(){if(Gn)return Xn;return Gn=1,Xn.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,f="",p="",h=!1,d=!1,g=null,m=null,y=null,v=null,_=null,b=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),g&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),s.type){case"space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(g=s),l=!0;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=!1;break}case"newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=!0):p+=s.source,u=!0,h=!0,(m||y)&&(v=s),l=!0;break;case"anchor":m&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case"tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case n:(m||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),b&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),b=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=!1,l=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,l=!1}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:A,start:w??A}},Xn}var tr,nr={};function rr(){if(tr)return nr;return tr=1,nr.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!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}},nr}var sr,ir={};function or(){if(sr)return ir;sr=1;var e=rr();return ir.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",!0)}}},ir}var ar,cr,ur={};function lr(){if(ar)return ur;ar=1;var e=ye();return ur.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(!1===s)return!1;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))},ur}function fr(){if(cr)return Jn;cr=1;var e=bt(),t=Rt(),n=er(),r=rr(),s=or(),i=lr();const o="All mapping items must start at the same column";return Jn.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=!1);let d=l.offset,g=null;for(const t of l.items){const{start:p,key:m,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:m??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:!0}),b=!_.found;if(b){if(m&&("block-seq"===m.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){g=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(m))&&f(m??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=!0;const w=_.end,S=m?a(u,m,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,m,f),u.atKey=!1,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!m||"block-scalar"===m.type});if(d=A.end,A.found){b&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&_.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r)}else{b&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n)}}return g&&g<d&&f(g,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,g??d],h},Jn}var pr,hr={};function dr(){if(pr)return hr;pr=1;var e=It(),t=er(),n=or();return hr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);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:!0});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},hr}var gr,mr,yr,vr={},_r={};function br(){if(gr)return _r;return gr=1,_r.resolveEnd=function(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":i=!0;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=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:s,offset:t}},_r}function wr(){if(mr)return vr;mr=1;var e=ye(),t=bt(),n=Rt(),r=It(),s=br(),i=er(),o=rr(),a=lr();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return vr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,g){const m="{"===h.start.source,y=m?"flow map":"flow sequence",v=new(g?.nodeClass??(m?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=!0;const _=p.atRoot;_&&(p.atRoot=!1),p.atKey&&(p.atKey=!1);let b=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:g,key:_,sep:w,value:S}=s,A=i.resolveProps(g,{flow:y,indicator:"explicit-key-ind",next:_??w?.[0],offset:b,onError:d,parentIndent:h.indent,startOnNewline:!1});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),b=A.end;continue}!m&&p.options.strict&&o.containsNewline(_)&&d(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of g)switch(e.type){case"comma":case"space":break;case"comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1)}}if(m||w||A.found){p.atKey=!0;const e=A.end,r=_?l(p,_,A,d):f(p,e,g,null,A,d);u(_)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=!1;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:!1});if(o.found){if(!m&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),m){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E)}else{const e=new n.YAMLMap(p.schema);e.flow=!0,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e)}b=k?k.range[2]:o.end}else{const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),b=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c)}}const w=m?"}":"]",[S,...A]=h.end;let k=b;if(S&&S.source===w)k=S.offset+S.source.length;else{const e=y[0].toUpperCase()+y.substring(1);d(b,_?"MISSING_CHAR":"BAD_INDENT",_?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S)}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset]}else v.range=[h.offset,k,k];return v},vr}function Sr(){if(yr)return Qn;yr=1;var e=ye(),t=qe(),n=Rt(),r=It(),s=fr(),i=dr(),o=wr();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 Qn.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"}`,!0):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:!1})),h=e}const d=a(s,i,o,u,f,h),g=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,m=e.isNode(g)?g:new t.Scalar(g);return m.range=d.range,m.tag=f,h?.format&&(m.format=h.format),m},Qn}var Ar,kr={},Er={};function xr(){if(Ar)return Er;Ar=1;var e=qe();return Er.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=!1,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case"space":u=!0;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=!1;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=!0):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n"}const g=s+i.length+n.source.length;return{value:p,type:o,comment:i.comment,range:[s,g,g]}},Er}var Or,$r,Rr={};function Cr(){if(Or)return Rr;Or=1;var e=qe(),t=br();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 Rr.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const g=(e,t,n)=>c(u+e,t,n);switch(l){case"scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,g);break;case"single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,g);break;case"double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s}else{const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a)}else n+=a}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,g);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const m=u+f.length,y=t.resolveEnd(p,m,a,c);return{value:d,type:h,comment:y.comment,range:[u,m,y.offset]}},Rr}function Tr(){if($r)return kr;$r=1;var e=ye(),t=qe(),n=xr(),r=Cr();return kr.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:!1,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=>(!0===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)}`,!0)}}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},kr}var Pr,Lr,Nr,Ir,Dr={};function Mr(){if(Pr)return Dr;return Pr=1,Dr.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},Dr}function jr(){if(Lr)return Yn;Lr=1;var e=je(),t=ye(),n=Sr(),r=Tr(),s=br(),i=Mr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:g}=u;let m,y=!0;switch(a.type){case"alias":m=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||g)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":m=r.composeScalar(i,a,g,l),d&&(m.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=n.composeCollection(o,i,a,u,l),d&&(m.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),m=c(i,a.offset,void 0,null,u,l),y=!1}if(d&&""===m.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(m)||"string"!=typeof m.value||m.tag&&"tag:yaml.org,2002:str"!==m.tag)){l(g??a,"NON_STRING_KEY","With stringKeys, all keys must be strings")}return p&&(m.spaceBefore=!0),h&&("scalar"===a.type&&""===a.source?m.comment=h:m.commentBefore=h),i.options.keepSourceTokens&&y&&(m.srcToken=a),m}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),a&&(h.comment=a,h.range[2]=l),h}return Yn.composeEmptyNode=c,Yn.composeNode=a,Yn}function Fr(){if(Nr)return Vn;Nr=1;var e=Un(),t=jr(),n=br(),r=er();return Vn.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:!1,atRoot:!0,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:!0});d.found&&(p.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const g=p.contents.range[2],m=n.resolveEnd(u,g,!1,l);return m.comment&&(p.comment=m.comment),p.range=[o,g,m.offset],p},Vn}function Hr(){if(Ir)return de;Ir=1;var e=o,t=Se(),n=Un(),r=Wn(),s=ye(),i=Fr(),a=br();function c(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 u(e){let t="",n=!1,r=!1;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=!0,r=!1;break;case"%":"#"!==e[s+1]?.[0]&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}return de.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=c(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}=u(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:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,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=c(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r)}),this.prelude.push(t.source),this.atDirectives=!0;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,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;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(c(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(c(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=a.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),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(c(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),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,!1),yield r}}},de}var Br,zr={},Kr={};function Ur(){if(Br)return Kr;Br=1;var e=xr(),t=Cr(),n=Wn(),r=at();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),!0}return!1}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 Kr.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:i,inFlow:o=!1,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:!0,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}}},Kr.resolveAsScalar=function(r,s=!0,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},Kr.setScalarValue=function(e,t,n={}){let{afterKey:o=!1,implicitKey:a=!1,inFlow:c=!1,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:!0,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")}},Kr}var qr,Zr={};function Wr(){if(qr)return Zr;qr=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 Zr.stringify=n=>"type"in n?e(n):t(n),Zr}var Gr,Vr,Yr={};function Qr(){if(Gr)return Yr;Gr=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")},Yr.visit=r,Yr}function Jr(){if(Vr)return zr;Vr=1;var e=Ur(),t=Wr(),n=Qr();return zr.createScalarToken=e.createScalarToken,zr.resolveAsScalar=e.resolveAsScalar,zr.setScalarValue=e.setScalarValue,zr.stringify=t.stringify,zr.visit=n.visit,zr.BOM="\ufeff",zr.DOCUMENT="",zr.FLOW_END="",zr.SCALAR="",zr.isCollection=e=>!!e&&"items"in e,zr.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),zr.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},zr.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},zr}var Xr,es={};function ts(){if(Xr)return es;Xr=1;var e=Jr();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}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 es.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){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(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(!0);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(!1),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(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);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=!1,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(!0)),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(!1),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(!0))}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(!0)),this.flowKey=!1;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=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(o),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,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,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;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,!0),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,!0),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(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(o))+(yield*this.pushSpaces(!0))+(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=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(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,!1)}{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,!1)}}*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,!1)}},es}var ns,rs={};function ss(){if(ns)return rs;ns=1;return rs.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}}}},rs}var is,os={};function as(){if(is)return os;is=1;var e=o,t=Jr(),n=ts();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}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!0;default:return!1}}function a(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 c(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 u(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 os.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){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=!1,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,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=!1}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&&u(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=!0);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=c(a(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=!0,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=!0,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=!1,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=!0):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:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);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=c(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=c(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=!0);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=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}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=c(a(t));u(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=!0,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=!0;const t=c(a(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=c(a(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=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},os}var cs,us,ls={};function fs(){if(cs)return ls;cs=1;var e=Hr(),t=Un(),n=Wn(),r=ht(),s=ye(),i=ss(),o=as();function a(e){const t=!1!==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),!0,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 ls.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))},ls.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:!0},u.streamInfo())},ls.parseDocument=c,ls.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)},ls}var ps=function(){if(us)return he;us=1;var e=Hr(),t=Un(),n=Fn(),r=Wn(),s=je(),i=ye(),o=bt(),a=qe(),c=Rt(),u=It(),l=Jr(),f=ts(),p=ss(),h=as(),d=fs(),g=we();return he.Composer=e.Composer,he.Document=t.Document,he.Schema=n.Schema,he.YAMLError=r.YAMLError,he.YAMLParseError=r.YAMLParseError,he.YAMLWarning=r.YAMLWarning,he.Alias=s.Alias,he.isAlias=i.isAlias,he.isCollection=i.isCollection,he.isDocument=i.isDocument,he.isMap=i.isMap,he.isNode=i.isNode,he.isPair=i.isPair,he.isScalar=i.isScalar,he.isSeq=i.isSeq,he.Pair=o.Pair,he.Scalar=a.Scalar,he.YAMLMap=c.YAMLMap,he.YAMLSeq=u.YAMLSeq,he.CST=l,he.Lexer=f.Lexer,he.LineCounter=p.LineCounter,he.Parser=h.Parser,he.parse=d.parse,he.parseAllDocuments=d.parseAllDocuments,he.parseDocument=d.parseDocument,he.stringify=d.stringify,he.visit=g.visit,he.visitAsync=g.visitAsync,he}(),hs=R(ps);function ds(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(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 gs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ms extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ys={};function vs(e){return ys}function _s(e,t){return"bigint"==typeof t?t.toString():t}function bs(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ws(e){return null==e}function Ss(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const As=Symbol("evaluating");function ks(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==As)return void 0===r&&(r=As,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Es(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Os(e){return JSON.stringify(e)}const $s="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Rs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Cs=bs(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ts(e){if(!1===Rs(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Rs(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ps(e){return Ts(e)?{...e}:Array.isArray(e)?[...e]:e}const Ls=new Set(["string","number","symbol"]);function Ns(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Is(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Ds(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 Ms(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function js(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fs(e){return"string"==typeof e?e:e?.message}function Hs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Fs(e.inst?._zod.def?.error?.(e))??Fs(t?.error?.(e))??Fs(n.customError?.(e))??Fs(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Bs(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function zs(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ks=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,_s,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Us=ds("$ZodError",Ks),qs=ds("$ZodError",Ks,{Parent:Error});const Zs=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new gs;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Hs(e,i,vs())));throw $s(t,s?.callee),t}return o.value},Ws=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};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=>Hs(e,i,vs())));throw $s(t,s?.callee),t}return o.value},Gs=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new gs;return i.issues.length?{success:!1,error:new(e??Us)(i.issues.map(e=>Hs(e,s,vs())))}:{success:!0,data:i.value}},Vs=Gs(qs),Ys=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Hs(e,s,vs())))}:{success:!0,data:i.value}},Qs=Ys(qs),Js=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zs(e)(t,n,s)},Xs=e=>(t,n,r)=>Zs(e)(t,n,r),ei=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ws(e)(t,n,s)},ti=e=>async(t,n,r)=>Ws(e)(t,n,r),ni=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Gs(e)(t,n,s)},ri=e=>(t,n,r)=>Gs(e)(t,n,r),si=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ys(e)(t,n,s)},ii=e=>async(t,n,r)=>Ys(e)(t,n,r),oi=/^[cC][^\s-]{8,}$/,ai=/^[0-9a-z]+$/,ci=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ui=/^[0-9a-vA-V]{20}$/,li=/^[A-Za-z0-9]{27}$/,fi=/^[a-zA-Z0-9_-]{21}$/,pi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hi=/^([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})$/,di=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)$/,gi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const mi=/^(?:(?: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])$/,yi=/^(([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}|:))$/,vi=/^((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])$/,_i=/^(([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])$/,bi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wi=/^[A-Za-z0-9_-]*$/,Si=/^(?=.{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])?)*\.?$/,Ai=/^\+(?:[0-9]){6,14}[0-9]$/,ki="(?:(?:\\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])))",Ei=new RegExp(`^${ki}$`);function xi(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 Oi=/^[^A-Z]*$/,$i=/^[^a-z]*$/,Ri=ds("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ci=ds("$ZodCheckMaxLength",(e,t)=>{var n;Ri.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ws(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=Bs(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ti=ds("$ZodCheckMinLength",(e,t)=>{var n;Ri.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ws(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=Bs(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pi=ds("$ZodCheckLengthEquals",(e,t)=>{var n;Ri.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ws(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=Bs(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Li=ds("$ZodCheckStringFormat",(e,t)=>{var n,r;Ri.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=()=>{})}),Ni=ds("$ZodCheckRegex",(e,t)=>{Li.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})}}),Ii=ds("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Oi),Li.init(e,t)}),Di=ds("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$i),Li.init(e,t)}),Mi=ds("$ZodCheckIncludes",(e,t)=>{Ri.init(e,t);const n=Ns(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})}}),ji=ds("$ZodCheckStartsWith",(e,t)=>{Ri.init(e,t);const n=new RegExp(`^${Ns(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})}}),Fi=ds("$ZodCheckEndsWith",(e,t)=>{Ri.init(e,t);const n=new RegExp(`.*${Ns(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})}}),Hi=ds("$ZodCheckOverwrite",(e,t)=>{Ri.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Bi{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 zi={major:4,minor:1,patch:11},Ki=ds("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zi;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=Ms(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&&!1===n?.async)throw new gs;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ms(e,t)))});else{if(e.issues.length===t)continue;s||(s=Ms(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ms(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new gs;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:!0});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(!1===i.async)throw new gs;return o.then(e=>t(e,r,i))}return t(o,r,i)}}e["~standard"]={validate:t=>{try{const n=Vs(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Qs(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Ui=ds("$ZodString",(e,t)=>{var n;Ki.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}}),qi=ds("$ZodStringFormat",(e,t)=>{Li.init(e,t),Ui.init(e,t)}),Zi=ds("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hi),qi.init(e,t)}),Wi=ds("$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=di(e))}else t.pattern??(t.pattern=di());qi.init(e,t)}),Gi=ds("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gi),qi.init(e,t)}),Vi=ds("$ZodURL",(e,t)=>{qi.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:Si.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})}}}),Yi=ds("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),qi.init(e,t)}),Qi=ds("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=fi),qi.init(e,t)}),Ji=ds("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oi),qi.init(e,t)}),Xi=ds("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ai),qi.init(e,t)}),eo=ds("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ci),qi.init(e,t)}),to=ds("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ui),qi.init(e,t)}),no=ds("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=li),qi.init(e,t)}),ro=ds("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=xi({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(`^${ki}T(?:${r})$`)}(t)),qi.init(e,t)}),so=ds("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ei),qi.init(e,t)}),io=ds("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${xi(t)}$`)),qi.init(e,t)}),oo=ds("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=pi),qi.init(e,t)}),ao=ds("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mi),qi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),co=ds("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yi),qi.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})}}}),uo=ds("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=vi),qi.init(e,t)}),lo=ds("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_i),qi.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 fo(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const po=ds("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bi),qi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{fo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const ho=ds("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=wi),qi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!wi.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return fo(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})}}),go=ds("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ai),qi.init(e,t)});const mo=ds("$ZodJWT",(e,t)=>{qi.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!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yo=ds("$ZodUnknown",(e,t)=>{Ki.init(e,t),e._zod.parse=e=>e}),vo=ds("$ZodNever",(e,t)=>{Ki.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function _o(e,t,n){e.issues.length&&t.issues.push(...js(n,e.issues)),t.value[n]=e.value}const bo=ds("$ZodArray",(e,t)=>{Ki.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=>_o(t,n,e))):_o(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function wo(e,t,n,r){e.issues.length&&t.issues.push(...js(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function So(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 Ao(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=>wo(e,n,s,t))):wo(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 ko=ds("$ZodObject",(e,t)=>{Ki.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=bs(()=>So(t));ks(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=Rs,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=>wo(n,t,e,a))):wo(r,t,e,a)}return i?Ao(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Eo=ds("$ZodObjectJIT",(e,t)=>{ko.init(e,t);const n=e._zod.parse,r=bs(()=>So(t));let s;const i=Rs,o=!ys.jitless,a=o&&Cs.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&!1===f?.async&&!0!==f.jitless?(s||(s=(e=>{const t=new Bi(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Os(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=Os(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?Ao([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function xo(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=>!Ms(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=>Hs(e,r,vs())))}),t)}const Oo=ds("$ZodUnion",(e,t)=>{Ki.init(e,t),ks(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),ks(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),ks(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ks(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=>Ss(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=!1;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=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>xo(t,s,e,i)):xo(a,s,e,i)}}),$o=ds("$ZodIntersection",(e,t)=>{Ki.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])=>Co(e,t,n)):Co(e,s,i)}});function Ro(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ts(e)&&Ts(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=Ro(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=Ro(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Co(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ms(e))return e;const r=Ro(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 To=ds("$ZodRecord",(e,t)=>{Ki.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Ts(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(...js(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...js(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=>Hs(e,r,vs())),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(...js(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...js(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Po=ds("$ZodEnum",(e,t)=>{Ki.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=>Ls.has(typeof e)).map(e=>"string"==typeof e?Ns(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}}),Lo=ds("$ZodTransform",(e,t)=>{Ki.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ms(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 gs;return n.value=s,n}});function No(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Io=ds("$ZodOptional",(e,t)=>{Ki.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ks(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ks(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ss(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=>No(t,e.value)):No(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Do=ds("$ZodNullable",(e,t)=>{Ki.init(e,t),ks(e._zod,"optin",()=>t.innerType._zod.optin),ks(e._zod,"optout",()=>t.innerType._zod.optout),ks(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ss(e.source)}|null)$`):void 0}),ks(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)}),Mo=ds("$ZodDefault",(e,t)=>{Ki.init(e,t),e._zod.optin="optional",ks(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=>jo(e,t)):jo(r,t)}});function jo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Fo=ds("$ZodPrefault",(e,t)=>{Ki.init(e,t),e._zod.optin="optional",ks(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))}),Ho=ds("$ZodNonOptional",(e,t)=>{Ki.init(e,t),ks(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=>Bo(t,e)):Bo(s,e)}});function Bo(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 zo=ds("$ZodCatch",(e,t)=>{Ki.init(e,t),ks(e._zod,"optin",()=>t.innerType._zod.optin),ks(e._zod,"optout",()=>t.innerType._zod.optout),ks(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=>Hs(e,n,vs()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Hs(e,n,vs()))},input:e.value}),e.issues=[]),e)}}),Ko=ds("$ZodPipe",(e,t)=>{Ki.init(e,t),ks(e._zod,"values",()=>t.in._zod.values),ks(e._zod,"optin",()=>t.in._zod.optin),ks(e._zod,"optout",()=>t.out._zod.optout),ks(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=>Uo(e,t.in,n)):Uo(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Uo(e,t.out,n)):Uo(r,t.out,n)}});function Uo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const qo=ds("$ZodReadonly",(e,t)=>{Ki.init(e,t),ks(e._zod,"propValues",()=>t.innerType._zod.propValues),ks(e._zod,"values",()=>t.innerType._zod.values),ks(e._zod,"optin",()=>t.innerType._zod.optin),ks(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(Zo):Zo(r)}});function Zo(e){return e.value=Object.freeze(e.value),e}const Wo=ds("$ZodCustom",(e,t)=>{Ri.init(e,t),Ki.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=>Go(t,n,r,e));Go(s,n,r,e)}});function Go(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(zs(e))}}class Vo{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 Yo(){return new Vo}const Qo=Yo();function Jo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ds(t)})}function Xo(e,t){return new Ci({check:"max_length",...Ds(t),maximum:e})}function ea(e,t){return new Ti({check:"min_length",...Ds(t),minimum:e})}function ta(e,t){return new Pi({check:"length_equals",...Ds(t),length:e})}function na(e){return new Hi({check:"overwrite",tx:e})}function ra(e){const t=function(e,t){const n=new Ri({check:"custom",...Ds(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(zs(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),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(zs(r))}},e(n.value,n)));return t}const sa=ds("ZodISODateTime",(e,t)=>{ro.init(e,t),Ta.init(e,t)});function ia(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ds(t)})}(sa,e)}const oa=ds("ZodISODate",(e,t)=>{so.init(e,t),Ta.init(e,t)});function aa(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ds(t)})}(oa,e)}const ca=ds("ZodISOTime",(e,t)=>{io.init(e,t),Ta.init(e,t)});function ua(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ds(t)})}(ca,e)}const la=ds("ZodISODuration",(e,t)=>{oo.init(e,t),Ta.init(e,t)});function fa(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ds(t)})}(la,e)}const pa=(e,t)=>{Us.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},s=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,s=0;for(;s<t.path.length;){const r=t.path[s];s===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],s++}}};return s(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,_s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,_s,2)}},isEmpty:{get:()=>0===e.issues.length}})},ha=ds("ZodError",pa),da=ds("ZodError",pa,{Parent:Error}),ga=Zs(da),ma=Ws(da),ya=Gs(da),va=Ys(da),_a=Js(da),ba=Xs(da),wa=ei(da),Sa=ti(da),Aa=ni(da),ka=ri(da),Ea=si(da),xa=ii(da),Oa=ds("ZodType",(e,t)=>(Ki.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(xs(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Is(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ga(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ya(e,t,n),e.parseAsync=async(t,n)=>ma(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>va(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_a(e,t,n),e.decode=(t,n)=>ba(e,t,n),e.encodeAsync=async(t,n)=>wa(e,t,n),e.decodeAsync=async(t,n)=>Sa(e,t,n),e.safeEncode=(t,n)=>Aa(e,t,n),e.safeDecode=(t,n)=>ka(e,t,n),e.safeEncodeAsync=async(t,n)=>Ea(e,t,n),e.safeDecodeAsync=async(t,n)=>xa(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,...Ds(n)})}(wc,e,t)}(t,n)),e.superRefine=t=>e.check(ra(t)),e.overwrite=t=>e.check(na(t)),e.optional=()=>fc(e),e.nullable=()=>hc(e),e.nullish=()=>fc(hc(e)),e.nonoptional=t=>function(e,t){return new mc({type:"nonoptional",innerType:e,...Ds(t)})}(e,t),e.array=()=>nc(e),e.or=t=>ic([e,t]),e.and=t=>new oc({type:"intersection",left:e,right:t}),e.transform=t=>_c(e,new uc({type:"transform",transform:t})),e.default=t=>{return n=t,new dc({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ps(n)}});var n},e.prefault=t=>{return n=t,new gc({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ps(n)}});var n},e.catch=t=>{return new yc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>_c(e,t),e.readonly=()=>new bc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Qo.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Qo.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Qo.get(e);const n=e.clone();return Qo.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),$a=ds("_ZodString",(e,t)=>{Ui.init(e,t),Oa.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 Ni({check:"string_format",format:"regex",...Ds(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Mi({check:"string_format",format:"includes",...Ds(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new ji({check:"string_format",format:"starts_with",...Ds(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Fi({check:"string_format",format:"ends_with",...Ds(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ea(...t)),e.max=(...t)=>e.check(Xo(...t)),e.length=(...t)=>e.check(ta(...t)),e.nonempty=(...t)=>e.check(ea(1,...t)),e.lowercase=t=>e.check(function(e){return new Ii({check:"string_format",format:"lowercase",...Ds(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Di({check:"string_format",format:"uppercase",...Ds(e)})}(t)),e.trim=()=>e.check(na(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return na(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(na(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(na(e=>e.toUpperCase()))}),Ra=ds("ZodString",(e,t)=>{Ui.init(e,t),$a.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ds(t)})}(Pa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ds(t)})}(Ia,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ds(t)})}(Ya,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ds(t)})}(Da,t)),e.guid=t=>e.check(Jo(La,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ds(t)})}(Na,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ds(t)})}(Na,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ds(t)})}(Na,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ds(t)})}(Na,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ds(t)})}(Ma,t)),e.guid=t=>e.check(Jo(La,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ds(t)})}(ja,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ds(t)})}(Fa,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ds(t)})}(Ha,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ds(t)})}(Wa,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ds(t)})}(Ga,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ds(t)})}(Ba,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ds(t)})}(za,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ds(t)})}(Ka,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ds(t)})}(Ua,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ds(t)})}(qa,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ds(t)})}(Za,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ds(t)})}(Va,t)),e.datetime=t=>e.check(ia(t)),e.date=t=>e.check(aa(t)),e.time=t=>e.check(ua(t)),e.duration=t=>e.check(fa(t))});function Ca(e){return function(e,t){return new e({type:"string",...Ds(t)})}(Ra,e)}const Ta=ds("ZodStringFormat",(e,t)=>{qi.init(e,t),$a.init(e,t)}),Pa=ds("ZodEmail",(e,t)=>{Gi.init(e,t),Ta.init(e,t)}),La=ds("ZodGUID",(e,t)=>{Zi.init(e,t),Ta.init(e,t)}),Na=ds("ZodUUID",(e,t)=>{Wi.init(e,t),Ta.init(e,t)}),Ia=ds("ZodURL",(e,t)=>{Vi.init(e,t),Ta.init(e,t)}),Da=ds("ZodEmoji",(e,t)=>{Yi.init(e,t),Ta.init(e,t)}),Ma=ds("ZodNanoID",(e,t)=>{Qi.init(e,t),Ta.init(e,t)}),ja=ds("ZodCUID",(e,t)=>{Ji.init(e,t),Ta.init(e,t)}),Fa=ds("ZodCUID2",(e,t)=>{Xi.init(e,t),Ta.init(e,t)}),Ha=ds("ZodULID",(e,t)=>{eo.init(e,t),Ta.init(e,t)}),Ba=ds("ZodXID",(e,t)=>{to.init(e,t),Ta.init(e,t)}),za=ds("ZodKSUID",(e,t)=>{no.init(e,t),Ta.init(e,t)}),Ka=ds("ZodIPv4",(e,t)=>{ao.init(e,t),Ta.init(e,t)}),Ua=ds("ZodIPv6",(e,t)=>{co.init(e,t),Ta.init(e,t)}),qa=ds("ZodCIDRv4",(e,t)=>{uo.init(e,t),Ta.init(e,t)}),Za=ds("ZodCIDRv6",(e,t)=>{lo.init(e,t),Ta.init(e,t)}),Wa=ds("ZodBase64",(e,t)=>{po.init(e,t),Ta.init(e,t)}),Ga=ds("ZodBase64URL",(e,t)=>{ho.init(e,t),Ta.init(e,t)}),Va=ds("ZodE164",(e,t)=>{go.init(e,t),Ta.init(e,t)}),Ya=ds("ZodJWT",(e,t)=>{mo.init(e,t),Ta.init(e,t)}),Qa=ds("ZodUnknown",(e,t)=>{yo.init(e,t),Oa.init(e,t)});function Ja(){return new Qa({type:"unknown"})}const Xa=ds("ZodNever",(e,t)=>{vo.init(e,t),Oa.init(e,t)});function ec(e){return function(e,t){return new e({type:"never",...Ds(t)})}(Xa,e)}const tc=ds("ZodArray",(e,t)=>{bo.init(e,t),Oa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ea(t,n)),e.nonempty=t=>e.check(ea(1,t)),e.max=(t,n)=>e.check(Xo(t,n)),e.length=(t,n)=>e.check(ta(t,n)),e.unwrap=()=>e.element});function nc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ds(n)})}(tc,e,t)}const rc=ds("ZodObject",(e,t)=>{Eo.init(e,t),Oa.init(e,t),ks(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new cc({type:"enum",entries:n,...Ds(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:Ja()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ja()}),e.strict=()=>e.clone({...e._zod.def,catchall:ec()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ts(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=xs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Es(this,"shape",n),n},checks:[]});return Is(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Ts(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 Es(this,"shape",n),n},checks:e._zod.def.checks};return Is(e,n)}(e,t),e.merge=t=>function(e,t){const n=xs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Es(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Is(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Is(e,xs(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 Es(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=xs(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 Es(this,"shape",r),r},checks:[]});return Is(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=xs(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 Es(this,"shape",s),s},checks:[]});return Is(t,r)}(lc,e,t[0]),e.required=(...t)=>function(e,t,n){const r=xs(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 Es(this,"shape",s),s},checks:[]});return Is(t,r)}(mc,e,t[0])});const sc=ds("ZodUnion",(e,t)=>{Oo.init(e,t),Oa.init(e,t),e.options=t.options});function ic(e,t){return new sc({type:"union",options:e,...Ds(t)})}const oc=ds("ZodIntersection",(e,t)=>{$o.init(e,t),Oa.init(e,t)});const ac=ds("ZodRecord",(e,t)=>{To.init(e,t),Oa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});const cc=ds("ZodEnum",(e,t)=>{Po.init(e,t),Oa.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 cc({...t,checks:[],...Ds(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 cc({...t,checks:[],...Ds(r),entries:s})}});const uc=ds("ZodTransform",(e,t)=>{Lo.init(e,t),Oa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ms(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(zs(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(zs(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});const lc=ds("ZodOptional",(e,t)=>{Io.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new lc({type:"optional",innerType:e})}const pc=ds("ZodNullable",(e,t)=>{Do.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hc(e){return new pc({type:"nullable",innerType:e})}const dc=ds("ZodDefault",(e,t)=>{Mo.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const gc=ds("ZodPrefault",(e,t)=>{Fo.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const mc=ds("ZodNonOptional",(e,t)=>{Ho.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const yc=ds("ZodCatch",(e,t)=>{zo.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const vc=ds("ZodPipe",(e,t)=>{Ko.init(e,t),Oa.init(e,t),e.in=t.in,e.out=t.out});function _c(e,t){return new vc({type:"pipe",in:e,out:t})}const bc=ds("ZodReadonly",(e,t)=>{qo.init(e,t),Oa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const wc=ds("ZodCustom",(e,t)=>{Wo.init(e,t),Oa.init(e,t)});const Sc=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},Ac=(e,t)=>{const n=t?JSON.parse(e):hs.parse(e);return n&&"object"==typeof n?n:{}},kc=nc(Ca()).default([]).optional(),Ec=ic([Ca(),nc(Ca())]),xc=(Oc=Ca(),$c=Ec,new ac({type:"record",keyType:Oc,valueType:$c,...Ds(Rc)})).optional();var Oc,$c,Rc;const Cc=function(e,t){const n={type:"object",shape:e??{},...Ds(t)};return new rc(n)}({stanPath:Ca().min(1,{message:"stanPath must be a non-empty string"}),includes:kc,excludes:kc,imports:xc}).strict(),Tc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Cc.parse(e)}catch(e){throw new Error((e=>e instanceof ha?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))}},Pc=t=>{const n=fe(t);if(!n)throw new Error("stan config not found");const r=e.readFileSync(n,"utf8"),s=Ac(r,n.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core")){throw new Error(`stan-core: missing "stan-core" section in ${n}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`)}const i=Tc(s["stan-core"]),o=Sc(i.imports);return{stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Lc=async e=>{const n=fe(e);if(!n)throw new Error("stan config not found");const r=n.replace(/\\/g,"/");return(async(e,n)=>{const r=await t.readFile(e,"utf8"),s=Ac(r,e.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core"))throw new Error(`stan-core: missing "stan-core" section in ${n??e}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`);const i=Tc(s["stan-core"]),o=Sc(i.imports);return{stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}})(n,r)},Nc=async(e,r)=>{const s={};for(const i of r){const r=n.resolve(e,i),o=await t.readFile(r),a=c.createHash("sha256").update(o).digest("hex");s[i]=a}return s},Ic=e=>n.join(e,".archive.snapshot.json"),Dc=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),Mc=e=>{if(!e||!String(e).trim())return null;const t=Dc(String(e).trim());if(/^[/\\]/.test(t))return null;const n=t.split("/").filter(Boolean);if(n.some(e=>".."===e))return null;const r=n.join("/");return r.length?r:null},jc=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e)}const o=i.join("\n").trimEnd();return o.length?o:null},Fc=/^###\s+Patch:\s+(.+?)\s*$/m,Hc=/^###\s+Full Listing:\s+(.+?)\s*$/m,Bc=/^##\s+Commit Message\s*$/m,zc=/^##\s+.*$|^###\s+.*$/m,Kc=e=>{const t=[],n=[];{const t=new RegExp(zc.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(Bc.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(Fc);if(a&&a[1]){t.push({kind:"patch",path:Dc(a[1].trim()),start:s,body:o});continue}const c=o.match(Hc);c&&c[1]&&t.push({kind:"full",path:Dc(c[1].trim()),start:s,body:o})}return t},Uc=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:Dc(r[1]??""),b:Dc(r[2]??"")});return n},qc=e=>{const t=[];((e,t)=>{const n=jc(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=>Mc(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=Kc(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=Uc(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=Dc(t.path??"(unknown)");e.set(n,t)}for(const n of r){const r=Dc(n.path??"(unknown)"),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{const e=n[n.length-1];e&&"commit"===e.kind||t.push("Commit Message is not last")}if(r.length>0){const e=[];for(const t of r){const n=Uc(t.body);if(n.length>0){const t=Dc(n[0].b??"");t&&e.push(t)}else{const n=Dc(t.path??"");n&&e.push(n)}}const n=e=>".stan/system/stan.todo.md"===Dc(e),s=e=>{const t=Dc(e);if(!t)return!1;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:[]}},Zc={extractBlocks:Kc,parseDiffHeaders:Uc,isCommitLast:e=>{if(!e.match(Bc))return!1;const t=e.search(Bc);if(t<0)return!1;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return!1;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${s}{'}'}\\s*$`,"m");if(!n.match(i))return!1;const o=n.search(i);if(o<0)return!1;return 0===n.slice(o+s).trim().length}},Wc=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),Gc=e=>e.endsWith("\n")?e:e+"\n",Vc=/[\u200B-\u200D\uFEFF]/g,Yc=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)),Qc=e=>{const t=Wc(e).replace(Vc,"");return Gc(t)};function Jc(e){return Array.isArray(e)?e.map(e=>Jc(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 Xc(e){return Array.isArray(e)?e.map(e=>Xc(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 tu(e,t,n){let r=!0,s=!1,i=!1,o=1;return function a(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,a())}}function nu(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=Jc(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=Xc(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=!1,l=!1;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=!0:"-"==c[0]&&(l=!0)),c=t}if(u){if(l){if(!o&&""==r[r.length-1])return!1}else if(""==r[r.length-1])r.pop();else if(!o)return!1}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return!1;function f(e,t,n,s=0,o=!0,a=[],c=0){let u=0,l=!1;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,!1,a,c+1)):null;t++,u=0}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=!0}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,!1,a,c+1)||f(e,t+1,n-1,s,!1,a,c+1))||f(e,t,n-1,s+1,!1,a,c);c++,o=!0,l=!1,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=tu(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return!1;for(let e=a;e<c;e++)p.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){const t=n.patchedLines[e];p.push(t)}a=n.oldLineLastI+1,h=c+1-t.oldStart}for(let e=a;e<r.length;e++)p.push(r[e]);return p.join("\n")}(e,r[0],n)}const ru=async e=>{const t=n.dirname(e);try{await r.ensureDir(t)}catch{}},su=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},iu=e=>"string"==typeof e&&"/dev/null"===e.trim(),ou=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),au=e=>e.replace(/\n/g,"\r\n"),cu=async e=>{const{cwd:r,cleaned:s,check:i,sandboxRoot:o}=e;let a;try{a=eu(s)}catch{return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:o}}const c=a.some(e=>{const t=su(e.oldFileName),n=su(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!a.length||!c)return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:o};const u=[],l=[];for(const e of a){const s=su(e.newFileName)??su(e.oldFileName);if(!s){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const a=s.replace(/^[./]+/,""),c=n.resolve(r,a),f=/\.md$/i.test(a);let p="",h=!1,d=!0;try{const e=await t.readFile(c,"utf8");p=e,h=/\r\n/.test(e)}catch{d=!1}const g=iu(e.oldFileName);if(!d&&!g){l.push({path:a,reason:"target file not found"});continue}let m;!d&&g&&(p="",h=!1);try{m=nu(p,e,{compareLine:(e,t,n,r)=>ou(t)===ou(r),fuzzFactor:f?1:0})}catch{l.push({path:a,reason:"unable to parse or place hunk(s)"});continue}if(!1===m||"string"!=typeof m){l.push({path:a,reason:"unable to place hunk(s)"});continue}const y=h?au(m.replace(/\r/g,"")):m.replace(/\r/g,"");try{if(i){const e=o??n.join(r,".stan","patch",".sandbox"),s=n.resolve(e,a);await ru(s),await t.writeFile(s,y,"utf8")}else{try{await ru(c)}catch{}await t.writeFile(c,y,"utf8")}u.push(a)}catch{l.push({path:a,reason:"write failed"})}}return{okFiles:u,failed:l,sandboxRoot:o}};var uu,lu={},fu={},pu={};function hu(){if(uu)return pu;return uu=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.splitWhen=pu.flatten=void 0,pu.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},pu.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},pu}var du,gu={};function mu(){if(du)return gu;return du=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.isEnoentCodeError=void 0,gu.isEnoentCodeError=function(e){return"ENOENT"===e.code},gu}var yu,vu={};var _u,bu={};function wu(){if(_u)return bu;_u=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.convertPosixPathToPattern=bu.convertWindowsPathToPattern=bu.convertPathToPattern=bu.escapePosixPath=bu.escapeWindowsPath=bu.escape=bu.removeLeadingDotSegment=bu.makeAbsolute=bu.unixify=void 0;const e=f,t="win32"===l.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 bu.unixify=function(e){return e.replace(/\\/g,"/")},bu.makeAbsolute=function(t,n){return e.resolve(t,n)},bu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},bu.escape=t?o:a,bu.escapeWindowsPath=o,bu.escapePosixPath=a,bu.convertPathToPattern=t?c:u,bu.convertWindowsPathToPattern=c,bu.convertPosixPathToPattern=u,bu}var Su,Au,ku,Eu,xu,Ou,$u={};function Ru(){return Au?Su:(Au=1,Su=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1})}function Cu(){if(Eu)return ku;Eu=1;var e=Ru(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return!0;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return!0;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return!0;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return!0;if(-1===(a=e.indexOf("\\",n))||a>s)return!0}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return!0;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!0;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!0;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!0}else n++}return!1},r=function(e){if("!"===e[0])return!0;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return!0;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!0}else n++}return!1};return ku=function(t,s){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var i=n;return s&&!1===s.strict&&(i=r),i(t)}}var Tu,Pu,Lu,Nu,Iu,Du,Mu,ju,Fu,Hu,Bu,zu,Ku,Uu,qu,Zu,Wu,Gu,Vu,Yu={};function Qu(){return Tu||(Tu=1,function(e){e.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)=>!1!==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)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges|0)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges|0?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===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}}(Yu)),Yu}function Ju(){if(Lu)return Pu;Lu=1;const e=Qu();return Pu=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=!0===t.invalid&&!0===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 Xu(){return Iu?Nu:(Iu=1,Nu=function(e){return"number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function el(){if(Mu)return Du;Mu=1;const e=Xu(),t=(n,i,o)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===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})`:!1===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],g=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){g=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0}return l>=0&&(d=r(u,l,h,a)),h.negatives=g,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",!1)||[],r=s(t,e,"",!1)||[],i=s(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(g,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++}return o&&(i+=!0===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=!1!==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={},Du=t}function tl(){if(Fu)return ju;Fu=1;const e=p,t=el(),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!1;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!1===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:!1,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=!0===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(!0===n.strictRanges)throw l([e,t]);return[]},h=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),g=String(n);n=Math.max(Math.abs(n),1);let m=i(h)||i(d)||i(g),y=m?Math.max(h.length,d.length,g.length):0,v=!1===m&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),_=r.transform||(e=>t=>!0===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),!0,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;)!0===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return!0===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:!1,...r}):S},d=(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 d(e,t,1,{transform:i});if(n(i))return d(e,t,0,i);let a={...o};return!0===a.capture&&(a.wrap=!0),i=i||a.step||1,s(i)?s(e)&&s(t)?h(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,!1,r);let d=[],g=0;for(;l?o>=a:o<=a;)d.push(i(o,g)),o=l?o-n:o+n,g++;return!0===r.toRegex?u(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?d(e,t,1,i):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(i,a)};return ju=d}function nl(){if(Wu)return Zu;Wu=1;const e=Ju(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=qu?Uu:(qu=1,Uu={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 Zu=(m,y={})=>{if("string"!=typeof m)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(m.length>_)throw new SyntaxError(`Input length (${m.length}), exceeds max characters (${_})`);const b={type:"root",input:m,nodes:[]},w=[b];let S=b,A=b,k=0;const E=m.length;let x,O=0,$=0;const R=()=>m[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!==g&&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(!0!==y.keepQuotes&&(x="");O<E&&(t=R());)if(t!==n){if(t===e){!0===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)||!0===S.dollar;S=C({type:"brace",open:!0,close:!1,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=!0,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=!0,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=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});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(Vu)return Gu;Vu=1;const e=Ju(),t=function(){if(Bu)return Hu;Bu=1;const e=tl(),t=Qu();return Hu=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=!0===n.invalid&&!0===r.escapeInvalid,c=!0===o||!0===a,u=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return u+n.value;if(!0===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:!1,toRegex:!0,strictZeros:!0});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(Ku)return zu;Ku=1;const e=tl(),t=Ju(),n=Qu(),r=(e="",t="",s=!1)=>{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)!0===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return zu=(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&&!0!==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))},zu}(),r=nl(),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&&!0===t.expand&&!0===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!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?s.compile(e,t):s.expand(e,t),Gu=s}var sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,gl,ml,yl,vl={};function _l(){if(il)return sl;il=1;const e=f,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 sl={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=>!0===e?l:u}}function bl(){return ol||(ol=1,function(e){const t=f,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=_l();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:!0===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!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(vl)),vl}function wl(){if(pl)return fl;pl=1;const e=f,t=function(){if(cl)return al;cl=1;const e=bl(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=_l(),m=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return al=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,D=!1,M=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(!0===M||O===c){for(z++;!0!==U()&&(O=Z());)if(O!==r)if(O!==c){if(!0!==M&&O===i&&(O=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==M&&O===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===h&&(z--,0===z)){M=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(O!==a){if(!0!==b.noext&&!0==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,O===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(O===t){if(x===t&&(D=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||O!==o||R!==C){if(!0!==b.noparen&&O===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&(O=Z());)if(O!==u){if(O===d){B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,O=Z(),O===c&&(M=!0)}!0===b.noext&&(I=!1,N=!1);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&!0===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):!0===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===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:D,negated:F,negatedExtglob:H};if(!0===b.tokens&&(Y.maxDepth=0,m(O)||k.push(K),Y.tokens=k),!0===b.parts||!0===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=!0,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},al}(),n=function(){if(ll)return ul;ll=1;const e=_l(),t=bl(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=t.isWindows(f),_=e.globChars(v),b=e.extglobChars(_),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH: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 D=!0===p.bash?L(p):T;p.capture&&(D=`(${D})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=t.removePrefix(l,M),d=l.length;const j=[],F=[],H=[];let B,z=g;const K=()=>M.index===d-1,U=M.peek=(e=1)=>l[M.index+e],q=M.advance=()=>l[++M.index]||"",Z=()=>l.slice(M.index+1),W=(e="",t=0)=>{M.consumed+=e,M.index+=t},G=e=>{M.output+=null!=e.output?e.output:e.value,W(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},Y=e=>{M[e]++,H.push(e)},Q=e=>{M[e]--,H.pop()},J=e=>{if("globstar"===z.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=D,M.output+=z.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&G(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,m.push(e),z=e},X=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=z,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:M.output?"":k}),J({type:"paren",extglob:!0,value:q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=D;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(p)),(r!==D||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(M.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:B,output:n}),Q("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,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?D:""):D:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&!0!==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,M.index+=n,n%2!=0&&(B+="\\")),!0===p.unescape?B=q():B+=q(),0===M.brackets){J({type:"text",value:B});continue}}if(M.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(!1!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=!0,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,M.backtrack=!0,q(),g.output||1!==m.indexOf(z)||(g.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),!0===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,G({value:B});continue}if(1===M.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,G({value:B});continue}if('"'===B){M.quotes=1===M.quotes?0:1,!0===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===M.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&M.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:M.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(!0!==p.nobracket&&Z().includes("]"))Y("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`}J({type:"bracket",value:B});continue}if("]"===B){if(!0===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===M.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(!0===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(M.output=M.output.slice(0,-z.value.length),!0===p.literalBrackets){M.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,M.output+=z.value;continue}if("{"===B&&!0!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};F.push(e),J(e);continue}if("}"===B){const e=F[F.length-1];if(!0===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(!0===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value}J({type:"brace",value:B,output:t}),Q("braces"),F.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=F[F.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",m.pop(),z=g;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(M.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=F[F.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=!0;continue}if(M.braces+M.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)&&!0!==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(!0!==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(!0!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(!0!==p.nonegate&&0===M.index){V();continue}}if("+"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||!1===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||M.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:!0,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],M.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||!0===z.star)){z.type="star",z.star=!0,z.value+=B,z.output=D,M.backtrack=!0,M.globstar=!0,W(B);continue}let e=Z();if(!0!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(!0===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(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=M.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[M.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),M.output=z.output,M.globstar=!0,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){M.output=M.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=L(p)+(p.strictSlashes?")":"|$)"),z.value+=B,M.globstar=!0,M.output+=t.output+z.output,W(B);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+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${L(p)}${A}|${A}${n})`,z.value+=B,M.output+=t.output+z.output,M.globstar=!0,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})`,M.output=z.output,M.globstar=!0,W(B+q()),J({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-z.output.length),z.type="globstar",z.output=L(p),z.value+=B,M.output+=z.output,M.globstar=!0,W(B);continue}const n={type:"star",value:B,output:D};!0!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||!0!==p.regex?(M.index!==M.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(M.output+=O,z.output+=O):!0===p.dot?(M.output+=$,z.output+=$):(M.output+=N,z.output+=N),"*"!==U()&&(M.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(;M.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Q("brackets")}for(;M.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Q("parens")}for(;M.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Q("braces")}if(!0===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),!0===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 u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?g:d,b=i.dot?m:d,w=i.capture?"":"?:";let S=!0===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>!0===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:!1,prefix:""});let x=k(E);return x&&!0!==i.strictSlashes&&(x+=`${f}?`),x},ul=u}(),r=bl(),s=_l(),i=(e,t,n=!1)=>{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!1};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,!1,!0),l=u.state;delete u.state;let f=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n)}const p=(n,r=!1)=>{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),!1===s?(h.isMatch=!1,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!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:!1,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===s),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===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:!1}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return!0===r&&(u.state=e),u},i.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===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&&!0===t.debug)throw e;return/$^/}},i.constants=s,fl=i}function Sl(){return dl?hl:(dl=1,hl=wl())}function Al(){if(yl)return $u;yl=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.isAbsolute=$u.partitionAbsoluteAndRelative=$u.removeDuplicateSlashes=$u.matchAny=$u.convertPatternsToRe=$u.makeRe=$u.getPatternParts=$u.expandBraceExpansion=$u.expandPatternsWithBraceExpansion=$u.isAffectDepthOfReadingPattern=$u.endsWithSlashGlobStar=$u.hasGlobStar=$u.getBaseDirectory=$u.isPatternRelatedToParentDirectory=$u.getPatternsOutsideCurrentDirectory=$u.getPatternsInsideCurrentDirectory=$u.getPositivePatterns=$u.getNegativePatterns=$u.isPositivePattern=$u.isNegativePattern=$u.convertToNegativePattern=$u.convertToPositivePattern=$u.isDynamicPattern=$u.isStaticPattern=void 0;const e=f,t=function(){if(Ou)return xu;Ou=1;var e=Cu(),t=f.posix.dirname,n="win32"===l.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return xu=function(a,c){Object.assign({flipBackslashes:!0},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(ml)return gl;ml=1;const e=p,t=rl(),n=Sl(),r=bl(),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},!0),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,!0);(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(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===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!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return o.isMatch(t,n,{...r,contains:!0})},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!0}return!1},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!1}return!0},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:!0}).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&&!0===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:!0})},o.hasBraces=i,gl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return!h(e,t)}function h(e,t={}){return""!==e&&(!(!1!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(!1===t.extglob||!o.test(e))||!(!1===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return!1;const n=e.indexOf("}",t+1);if(-1===n)return!1;const r=e.slice(t,n);return a.test(r)}(e)))))}function d(e){return e.startsWith("!")&&"("!==e[1]}function g(e){return!d(e)}function m(e){return e.startsWith("..")||e.startsWith("./..")}function y(e){return e.endsWith("/**")}function v(e){const t=n.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function _(e,t){return n.makeRe(e,t)}function b(t){return e.isAbsolute(t)}return $u.isStaticPattern=u,$u.isDynamicPattern=h,$u.convertToPositivePattern=function(e){return d(e)?e.slice(1):e},$u.convertToNegativePattern=function(e){return"!"+e},$u.isNegativePattern=d,$u.isPositivePattern=g,$u.getNegativePatterns=function(e){return e.filter(d)},$u.getPositivePatterns=function(e){return e.filter(g)},$u.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!m(e))},$u.getPatternsOutsideCurrentDirectory=function(e){return e.filter(m)},$u.isPatternRelatedToParentDirectory=m,$u.getBaseDirectory=function(e){return t(e,{flipBackslashes:!1})},$u.hasGlobStar=function(e){return e.includes("**")},$u.endsWithSlashGlobStar=y,$u.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return y(t)||u(n)},$u.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(v(t)),[])},$u.expandBraceExpansion=v,$u.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},$u.makeRe=_,$u.convertPatternsToRe=function(e,t){return e.map(e=>_(e,t))},$u.matchAny=function(e,t){return t.some(t=>t.test(e))},$u.removeDuplicateSlashes=function(e){return e.replace(c,"/")},$u.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)b(r)?t.push(r):n.push(r);return[t,n]},$u.isAbsolute=b,$u}var kl,El,xl,Ol={};function $l(){if(El)return kl;El=1;const e=h.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 kl=function(){const r=[],s=t.call(arguments);let i=!1,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=!1!==o.end,c=!0===o.pipeError;null==o.objectMode&&(o.objectMode=!0);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=!0;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=!1,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:!1}),e.resume()}for(let t=0;t<e.length;t++)s(e[t]);n()}function p(){i=!1,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},kl}var Rl,Cl,Tl,Pl={};function Ll(){if(Rl)return Pl;return Rl=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.isEmpty=Pl.isString=void 0,Pl.isString=function(e){return"string"==typeof e},Pl.isEmpty=function(e){return""===e},Pl}function Nl(){if(Cl)return fu;Cl=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.string=fu.stream=fu.pattern=fu.path=fu.fs=fu.errno=fu.array=void 0;const e=hu();fu.array=e;const t=mu();fu.errno=t;const n=function(){if(yu)return vu;yu=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.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 vu.createDirentFromStats=function(t,n){return new e(t,n)},vu}();fu.fs=n;const r=wu();fu.path=r;const s=Al();fu.pattern=s;const i=function(){if(xl)return Ol;xl=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.merge=void 0;const e=$l();function t(e){e.forEach(e=>e.emit("close"))}return Ol.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},Ol}();fu.stream=i;const o=Ll();return fu.string=o,fu}var Il,Dl={},Ml={},jl={},Fl={},Hl={},Bl={},zl={},Kl={},Ul={};function ql(){if(Il)return Ul;function e(e,t){e(t)}function t(e,t){e(null,t)}return Il=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.read=void 0,Ul.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=()=>!0),t(s,i)}):t(s,o):e(s,i)})},Ul}var Zl,Wl={};var Gl,Vl,Yl,Ql,Jl,Xl,ef,tf={},nf={};function rf(){if(Vl)return tf;Vl=1,Object.defineProperty(tf,"__esModule",{value:!0});const e=(Gl||(Gl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=g;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)}}(nf)),nf);return tf.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return null!=e?e:t}},tf}function sf(){if(Yl)return Kl;Yl=1,Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.statSync=Kl.stat=Kl.Settings=void 0;const e=ql(),t=(Zl||(Zl=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.read=void 0,Wl.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}}),Wl),n=rf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return Kl.Settings=n.default,Kl.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},Kl.statSync=function(e,n){const s=r(n);return t.read(e,s)},Kl}function of(){if(Jl)return Ql;let e;return Jl=1,Ql="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:$):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var af,cf={};function uf(){if(af)return cf;af=1,Object.defineProperty(cf,"__esModule",{value:!0}),cf.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 cf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,cf}var lf,ff,pf={},hf={};function df(){if(ff)return pf;ff=1,Object.defineProperty(pf,"__esModule",{value:!0}),pf.fs=void 0;const e=function(){if(lf)return hf;lf=1,Object.defineProperty(hf,"__esModule",{value:!0}),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 pf.fs=e,pf}var gf,mf,yf={};function vf(){if(gf)return yf;return gf=1,Object.defineProperty(yf,"__esModule",{value:!0}),yf.joinPathSegments=void 0,yf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},yf}function _f(){if(mf)return zl;mf=1,Object.defineProperty(zl,"__esModule",{value:!0}),zl.readdir=zl.readdirWithFileTypes=zl.read=void 0;const e=sf(),t=function(){if(ef)return Xl;ef=1,Xl=function(t,n){let r,s,i,o=!0;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=!1};const e=of();return Xl}(),n=uf(),r=df(),s=vf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:!0},(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 zl.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r)},zl.readdirWithFileTypes=i,zl.readdir=o,zl}var bf,wf={};var Sf,Af,kf,Ef={},xf={};function Of(){return Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=g;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}}(xf)),xf}function $f(){if(kf)return Bl;kf=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.Settings=Bl.scandirSync=Bl.scandir=void 0;const e=_f(),t=function(){if(bf)return wf;bf=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.readdir=wf.readdirWithFileTypes=wf.read=void 0;const e=sf(),t=uf(),n=df(),r=vf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).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(Af)return Ef;Af=1,Object.defineProperty(Ef,"__esModule",{value:!0});const e=f,t=sf(),n=Of();return Ef.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},Ef}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return Bl.Settings=n.default,Bl.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},Bl.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},Bl}var Rf,Cf,Tf,Pf={exports:{}};function Lf(){if(Tf)return Pf.exports;Tf=1;var e=Cf?Rf:(Cf=1,Rf=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=!0},paused:!1,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=!1,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 Pf.exports=t,Pf.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(){return 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}}})})},i},Pf.exports}var Nf,If={};function Df(){if(Nf)return If;return Nf=1,Object.defineProperty(If,"__esModule",{value:!0}),If.joinPathSegments=If.replacePathSegmentSeparator=If.isAppliedFilter=If.isFatalError=void 0,If.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},If.isAppliedFilter=function(e,t){return null===e||e(t)},If.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},If.joinPathSegments=function(e,t,n){return""===e?t:e.endsWith(n)?e+t:e+n+t},If}var Mf,jf,Ff,Hf={};function Bf(){if(Mf)return Hf;Mf=1,Object.defineProperty(Hf,"__esModule",{value:!0});const e=Df();return Hf.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator)}},Hf}function zf(){if(jf)return Hl;jf=1,Object.defineProperty(Hl,"__esModule",{value:!0});const e=d,t=$f(),n=Lf(),r=Df(),s=Bf();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=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,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=!0,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=!0,this._isDestroyed=!0,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 Hl.default=i,Hl}var Kf,Uf={};var qf,Zf,Wf={},Gf={};function Vf(){if(Zf)return Wf;Zf=1,Object.defineProperty(Wf,"__esModule",{value:!0});const e=function(){if(qf)return Gf;qf=1,Object.defineProperty(Gf,"__esModule",{value:!0});const e=$f(),t=Df(),n=Bf();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 Gf.default=r,Gf}();return Wf.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()}},Wf}var Yf,Qf,Jf={};function Xf(){if(Qf)return jl;Qf=1,Object.defineProperty(jl,"__esModule",{value:!0}),jl.Settings=jl.walkStream=jl.walkSync=jl.walk=void 0;const e=function(){if(Ff)return Fl;Ff=1,Object.defineProperty(Fl,"__esModule",{value:!0});const e=zf();return Fl.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()}},Fl}(),t=function(){if(Kf)return Uf;Kf=1,Object.defineProperty(Uf,"__esModule",{value:!0});const e=h,t=zf();return Uf.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:!0,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}},Uf}(),n=Vf(),r=function(){if(Yf)return Jf;Yf=1,Object.defineProperty(Jf,"__esModule",{value:!0});const e=f,t=$f();return Jf.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}},Jf}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return jl.Settings=r.default,jl.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n)},jl.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},jl.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},jl}var ep,tp={};function np(){if(ep)return tp;ep=1,Object.defineProperty(tp,"__esModule",{value:!0});const e=f,t=sf(),n=Nl();return tp.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}},tp}var rp,sp,ip={};function op(){if(rp)return ip;rp=1,Object.defineProperty(ip,"__esModule",{value:!0});const e=h,t=sf(),n=Xf(),r=np();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:!0});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 ip.default=s,ip}var ap,cp,up,lp={},fp={},pp={},hp={};function dp(){if(cp)return pp;cp=1,Object.defineProperty(pp,"__esModule",{value:!0});const e=function(){if(ap)return hp;ap=1,Object.defineProperty(hp,"__esModule",{value:!0});const e=Nl();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:!0,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:!1,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!0;if(t.every((t,n)=>{const r=e.segments[n];return!(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return!0}return!1}}return pp.default=t,pp}var gp,mp={};var yp,vp={};var _p,bp,wp,Sp={};function Ap(){if(bp)return lp;bp=1,Object.defineProperty(lp,"__esModule",{value:!0});const e=f,t=function(){if(up)return fp;up=1,Object.defineProperty(fp,"__esModule",{value:!0});const e=Nl(),t=dp();return fp.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!1;if(this._isSkippedSymbolicLink(n))return!1;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)}},fp}(),n=function(){if(gp)return mp;gp=1,Object.defineProperty(mp,"__esModule",{value:!0});const e=Nl();return mp.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:!0})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;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!1;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return!1;const s=e.pattern.matchAny(t,n);return!s&&r?e.pattern.matchAny(t+"/",n):s}},mp}(),r=function(){if(yp)return vp;yp=1,Object.defineProperty(vp,"__esModule",{value:!0});const e=Nl();return vp.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},vp}(),s=function(){if(_p)return Sp;_p=1,Object.defineProperty(Sp,"__esModule",{value:!0});const e=Nl();return Sp.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}},Sp}();return lp.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:!0,strictSlashes:!1}}},lp}function kp(){if(wp)return Dl;wp=1,Object.defineProperty(Dl,"__esModule",{value:!0});const e=function(){if(sp)return Ml;sp=1,Object.defineProperty(Ml,"__esModule",{value:!0});const e=Xf(),t=np(),n=op();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 Ml.default=r,Ml}(),t=Ap();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 Dl.default=n,Dl}var Ep,xp={};var Op,$p,Rp={},Cp={};function Tp(){if($p)return Rp;$p=1,Object.defineProperty(Rp,"__esModule",{value:!0});const e=function(){if(Op)return Cp;Op=1,Object.defineProperty(Cp,"__esModule",{value:!0});const e=sf(),t=Xf(),n=np();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 Cp.default=r,Cp}(),t=Ap();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 Rp.default=n,Rp}var Pp,Lp,Np,Ip={};var Dp,Mp,jp=function(){if(Np)return Lp;Np=1;const e=function(){if(Tl)return lu;Tl=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.convertPatternGroupToTask=lu.convertPatternGroupsToTasks=lu.groupPatternsByBaseDirectory=lu.getNegativePatternsAsPositive=lu.getPositivePatterns=lu.convertPatternsToTasks=lu.generate=void 0;const e=Nl();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 lu.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,!1),d=n(p,l,!0);return h.concat(d)},lu.convertPatternsToTasks=n,lu.getPositivePatterns=r,lu.getNegativePatternsAsPositive=s,lu.groupPatternsByBaseDirectory=i,lu.convertPatternGroupsToTasks=o,lu.convertPatternGroupToTask=a,lu}(),t=kp(),n=function(){if(Ep)return xp;Ep=1,Object.defineProperty(xp,"__esModule",{value:!0});const e=h,t=op(),n=Ap();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:!0,read:()=>{}});return s.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return xp.default=r,xp}(),r=Tp(),s=(Pp||(Pp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=g,n=l,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,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),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,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),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)}}}(Ip)),Ip),i=Nl();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i.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.string.isString(e)&&!i.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.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i.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.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i.path.convertWindowsPathToPattern(e)}}(o||(o={})),Lp=o}(),Fp=R(jp);var Hp=function(){if(Mp)return Dp;Mp=1;var e=Cu(),t=f.posix.dirname,n="win32"===l.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return!!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return Dp=function(e,a){Object.assign({flipBackslashes:!0},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!1}var n=e.indexOf(t);if(n<0)return!1;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")}}(),Bp=R(Hp);const zp=e=>""!==e&&".."!==e,Kp=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(!zp(e))return null;return t.join("/")},Up=async e=>{try{return(await t.stat(e)).isFile()}catch{return!1}},qp=e=>String(e).replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),Zp=e=>{const t=qp(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=qp(t);return e===n||e.startsWith(n+"/")})(qp(e),t):()=>!1;var n;const r=J(t,{dot:!0});return e=>r(qp(e))};const Wp="0.4.0";exports.CORE_VERSION=Wp,exports.DEFAULT_OPEN_COMMAND="code -g {file}",exports.DEFAULT_STAN_PATH=oe,exports.__internal=Zc,exports.applyPatchPipeline=async e=>{const{cwd:r,patchAbs:s,cleaned:i,check:o,stripOrder:a=[1,0]}=e,c=a.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()}`}]})(o,e)),l=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=u.spawn("git",["apply",...o.args,t],{cwd:e,shell:!1,windowsHide:!0});let a="",c="";const l=s;l.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t)}),l.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:!0,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${n})`)}return{ok:!1,tried:s,lastCode:1,captures:i}})(r,s,c);if(l.ok)return{ok:!0,result:l,js:null};const f=await cu({cwd:r,cleaned:i,check:o});if(f.okFiles.length>0&&0===f.failed.length)return{ok:!0,result:l,js:f};try{const e=await(async(e,r,s)=>{const i=r.replace(/\r\n/g,"\n").split("\n");let o=-1,a=null;for(let e=0;e<i.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(i[e])){const t=i[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){o=e+1,a=String(t[1]).trim().replace(/^[./]+/,"");break}}if(!a||!a.length)return null;const c=i.slice(o+1).join("\n");if(/^---\s+\/dev\/null/m.test(c))return null;const u=[];let l=!1;for(let e=o+1;e<i.length;e+=1){const t=i[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||u.push(t.slice(1))}}let f=u.join("\n");f.endsWith("\n")||(f+="\n");const p=s?n.join(e,".stan","patch",".sandbox","F"):e,h=n.resolve(p,a);return await t.mkdir(n.dirname(h),{recursive:!0}),await t.writeFile(h,f,"utf8"),{okFiles:[a],failed:[],sandboxRoot:s?p:void 0}})(r,i,o);if(e)return{ok:!0,result:l,js:e}}catch{}return{ok:!1,result:l,js:f}},exports.applyWithJsDiff=cu,exports.assembleSystemMonolith=async(s,i)=>{const o=n.join(s,i,"system"),a=n.join(o,"parts"),c=n.join(o,"stan.system.md");if(await r.ensureDir(o),!e.existsSync(a))return{target:c,action:"skipped-no-parts",partsDir:a};const u=(await t.readdir(a,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));if(0===u.length)return{target:c,action:"skipped-no-md",partsDir:a};const l=[];for(const e of u){const r=n.join(a,e),s=Wc(await t.readFile(r,"utf8")).trimEnd();l.push(s)}const f=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(i)+l.join("\n\n")+"\n";return await t.writeFile(c,f,"utf8"),{target:c,action:"written"}},exports.createArchive=async(r,s,i={})=>{const{includeOutputDir:o=!1,fileName:a,includes:c=[],excludes:u=[],anchors:l=[]}=i;let f=a??"archive.tar";f.endsWith(".tar")||(f+=".tar");const{outDir:p,diffDir:h}=await ie(r,s),d=await ee(r),g=await re(d,{cwd:r,stanPath:s,includeOutputDir:o,includes:c,excludes:u,anchors:l}),m=n.resolve(p,f),y=n.resolve(h,v);if(e.existsSync(m))try{await t.copyFile(m,y)}catch{}const{textFiles:_,warningsBody:b}=await O(r,g),w=_;E(b,i.onArchiveWarnings);const S=await Promise.resolve().then(function(){return require("./index-C_cc6L9q.js")});if(o?await S.create({file:m,cwd:r,filter:A(s)},k(w,s)):await S.create({file:m,cwd:r,filter:A(s)},w),!e.existsSync(y))try{await t.copyFile(m,y)}catch{}return m},exports.createArchiveDiff=async({cwd:r,stanPath:s,baseName:i,includes:o,excludes:a,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=!1,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:h}=await ie(r,s),d=await ee(r),g=await re(d,{cwd:r,stanPath:s,includeOutputDir:!1,includes:o??[],excludes:a??[],anchors:l??[]}),m=await Nc(r,g),y=Ic(h),v=e.existsSync(y),_=v?JSON.parse(await t.readFile(y,"utf8")):{},b=v?g.filter(e=>!_[e]||_[e]!==m[e]):[...g],{textFiles:w,warningsBody:S}=await O(r,b),x=w;E(S,f);const $=n.join(p,`${i}.diff.tar`),R=await Promise.resolve().then(function(){return require("./index-C_cc6L9q.js")});if(u)await R.create({file:$,cwd:r,filter:A(s)},k(x,s));else if(0===x.length){const e=(e=>n.join(e,".stan_no_changes"))(h);await t.writeFile(e,"no changes","utf8");const i=[`${s.replace(/\\/g,"/")}/diff/.stan_no_changes`];await R.create({file:$,cwd:r},i)}else{const e=Array.from(new Set([...x]));await R.create({file:$,cwd:r},e)}return"replace"===c?await t.writeFile(y,JSON.stringify(m,null,2),"utf8"):"createIfMissing"!==c||v||await t.writeFile(y,JSON.stringify(m,null,2),"utf8"),{diffPath:$}},exports.detectAndCleanPatch=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})(Qc(e.trim())),n=Qc(t),r=(e=>{const t=e.split("\n");for(let e=0;e<t.length;e+=1){const n=t[e];if(!n.match(/^`{3,}.*$/))continue;const r=(n.match(/^`+/)??[""])[0].length;for(let n=e+1;n<t.length;n+=1)if(new RegExp(`^\\\`{${r}{'}'}\\s*$`).test(t[n])){const r=t.slice(e+1,n).join("\n");if(Yc(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 Gc(r?Qc(r).trimEnd():n)},exports.ensureOutputDir=async(r,s,i=!1)=>{const o=X(r,s);if(await se(r,s),!i){const r=n.resolve(o.outputAbs,y);if(e.existsSync(r))try{await t.copyFile(r,n.resolve(o.diffAbs,v))}catch{}const s=await t.readdir(o.outputAbs,{withFileTypes:!0});for(const t of s)e.rmSync(n.resolve(o.outputAbs,t.name),{recursive:!0,force:!0})}return o.rootAbs},exports.executeFileOps=async(e,s,i=!1)=>{const o=[],a=t=>((e,t)=>{const r=n.resolve(e,t),s=n.resolve(e)+n.sep,i=r===n.resolve(e)||r.startsWith(s);return{abs:r,ok:i}})(e,t);for(const e of s){const s={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:s}=a(e.src),{abs:o,ok:c}=a(e.dest);if(!s||!c)throw new Error("path escapes repo root");const u=await r.pathExists(t),l=await r.pathExists(o);if(!u)throw new Error("source does not exist");if(l)throw new Error("destination exists (no overwrite)");i||(await r.ensureDir(n.dirname(o)),await r.move(t,o,{overwrite:!1}))}else if("rm"===e.verb){const{abs:t,ok:n}=a(e.src);if(!n)throw new Error("path escapes repo root");if(!await r.pathExists(t))throw new Error("path does not exist");i||await r.remove(t)}else if("rmdir"===e.verb){const{abs:n,ok:s}=a(e.src);if(!s)throw new Error("path escapes repo root");let o=null;try{o=await t.stat(n)}catch{o=null}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await t.readdir(n)).length>0)throw new Error("directory not empty");i||await r.remove(n)}else if("mkdirp"===e.verb){const{abs:t,ok:n}=a(e.src);if(!n)throw new Error("path escapes repo root");i||await r.ensureDir(t)}s.status="ok"}catch(e){s.status="failed";const t=e instanceof Error?e.message:String(e);s.message=t}if(o.push(s),"failed"===s.status&&!i)break}return{ok:o.every(e=>"ok"===e.status),results:o}},exports.findConfigPathSync=fe,exports.getPackagedSystemPromptPath=()=>{const t=(()=>{try{const e=i.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("index.js",document.baseURI).href);return ce({cwd:n.dirname(e)})??null}catch{return null}})();if(!t)return null;const r=n.join(t,"dist","stan.system.md");return e.existsSync(r)?r:null},exports.loadConfig=Lc,exports.loadConfigSync=Pc,exports.makeGlobMatcher=e=>{const t=(e??[]).map(Zp);return 0===t.length?()=>!1:e=>{const n=qp(e);for(const e of t)if(e(n))return!0;return!1}},exports.parseFileOpsBlock=e=>{const t=[],n=[],r=jc(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=>Mc(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}},exports.prepareImports=async e=>{const{cwd:s,stanPath:i,map:o,onStage:a}=e;if(!o||"object"!=typeof o)return;const c=X(s,i),u=n.join(c.rootAbs,"imports");await r.ensureDir(u);const l=Object.keys(o).sort();for(const e of l){const i=o[e]??[];if(!Array.isArray(i)||0===i.length)continue;const c=Kp(e);if(!c)continue;const l=n.join(u,c);await t.rm(l,{recursive:!0,force:!0}).catch(()=>{}),await r.ensureDir(l).catch(()=>{});const f=[];for(const e of i){const i=String(e??"").trim();if(!i)continue;const o=Bp(i.replace(/\\/g,"/"));try{const e=await Fp(i,{cwd:s,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const i of e){if(!await Up(i))continue;const e=n.relative(n.isAbsolute(o)?o:n.resolve(s,o),i).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const a=n.join(l,e);await r.ensureDir(n.dirname(a)).catch(()=>{});try{await t.copyFile(i,a),f.push(a)}catch{}}}catch{}}try{if("function"==typeof a){a(c,f.map(e=>n.relative(s,e).replace(/\\/g,"/")))}}catch{}}},exports.resolveStanPath=async e=>{try{return(await Lc(e)).stanPath}catch{return oe}},exports.resolveStanPathSync=e=>{try{return Pc(e).stanPath}catch{return oe}},exports.validateOrThrow=e=>{const t=qc(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},exports.validateResponseMessage=qc,exports.writeArchiveSnapshot=async({cwd:e,stanPath:n,includes:r,excludes:s,anchors:i})=>{const{diffDir:o}=await ie(e,n),a=await ee(e),c=await re(a,{cwd:e,stanPath:n,includeOutputDir:!1,includes:r??[],excludes:s??[],anchors:i??[]}),u=await Nc(e,c),l=Ic(o);return await t.writeFile(l,JSON.stringify(u,null,2),"utf8"),l};
1
+ "use strict";var e=require("node:fs"),t=require("node:fs/promises"),n=require("node:path"),r=require("fs-extra"),s=require("node:process"),i=require("node:url"),o=require("process"),a=require("buffer"),c=require("node:crypto"),u=require("node:child_process"),l=require("os"),f=require("path"),p=require("util"),h=require("stream"),d=require("events"),g=require("fs"),m="undefined"!=typeof document?document.currentScript:null;const y="archive.tar",v="archive.prev.tar",_=e=>e.replace(/\\/g,"/"),b=(e,t)=>{const n=_(e).replace(/\/+$/,""),r=_(t);return r===n||r.startsWith(`${n}/`)},w=(e,t)=>{const n=_(e);return b(`${n}/diff`,t)||b(`${n}/patch`,t)},S=b,A=e=>{const t=e.replace(/\\/g,"/");return e=>!(w(t,e)||((e,t)=>{const n=_(e);return _(t)===`${n}/output/${y}`||_(t)===`${n}/output/archive.diff.tar`||_(t)===`${n}/output/archive.warnings.txt`})(t,e))},k=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},E=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n)},x=1048576,O=async(e,r)=>{const s=[],i=[],o=[];await Promise.all(r.map(async r=>{const a=r.replace(/\\/g,"/");const c=n.resolve(e,r);let u=0;try{u=(await t.stat(c)).size}catch{return}let l,f=!1;try{f=await(async e=>{try{const n=await t.open(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:t}=await n.read(e,0,e.length,0);for(let n=0;n<t;n+=1)if(0===e[n])return!0;return!1}finally{await n.close().catch(()=>{})}}catch{return!1}})(c)}catch{f=!1}if(f)return void i.push({path:a,size:u});s.push(a);try{if(u<=x||u<5*x){l=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await t.readFile(c,"utf8"))}}catch{}(u>x||"number"==typeof l&&l>3e3)&&o.push({path:a,size:u,loc:l})}));const a=[];if(i.length>0){a.push(`Binary files excluded from archive (${i.length.toString()}):`);for(const e of i)a.push(` - ${e.path} (${e.size.toString()} bytes)`);a.push("")}if(o.length>0){a.push(`Large text files (included; consider excludes if unwanted) (${o.length.toString()}):`);for(const e of o){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),a.push(t.join(" "))}a.push(""),a.push(`Thresholds: size > ${x.toString()} bytes or LOC > ${3e3.toString()}`)}0===a.length&&a.push("No archive warnings.");const c=a.join("\n")+(a.length?"\n":"");return{textFiles:s,excludedBinaries:i,largeText:o,warningsBody:c}};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C,T={exports:{}};var P,L,N,I,D,M,j,F,H,B,z,K=(C||(C=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=()=>!1,g=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",_={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},b=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i)}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(m,_[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=!1,o=e;0===o.indexOf("!")&&(r=!0,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=!0);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=!0,this._rules.push(t)}}add(e){return this._added=!1,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=!1,i=!1;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=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){p(this,f,!0),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,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,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,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}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)}(T)),T.exports),U=R(K),q={};function Z(){if(L)return P;L=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 P={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=>!0===e?u:c}}function W(){return N||(N=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=Z();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!0===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}}(q)),q}function G(){if(D)return I;D=1;const e=W(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=Z(),m=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return I=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,D=!1,M=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(!0===M||O===c){for(z++;!0!==U()&&(O=Z());)if(O!==r)if(O!==c){if(!0!==M&&O===i&&(O=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==M&&O===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===h&&(z--,0===z)){M=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(O!==a){if(!0!==b.noext){if(!0===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,O===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}}if(O===t){if(x===t&&(D=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||O!==o||R!==C){if(!0!==b.noparen&&O===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&(O=Z());)if(O!==u){if(O===d){B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,O=Z(),O===c&&(M=!0)}!0===b.noext&&(I=!1,N=!1);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&!0===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):!0===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===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:D,negated:F,negatedExtglob:H};if(!0===b.tokens&&(Y.maxDepth=0,m(O)||k.push(K),Y.tokens=k),!0===b.parts||!0===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=!0,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},I}function V(){if(j)return M;j=1;const e=Z(),t=W(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=e.globChars(p.windows),_=e.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH: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=!0===p.bash?P(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=t.removePrefix(l,D),d=l.length;const M=[],j=[],F=[];let H,B=g;const z=()=>D.index===d-1,K=D.peek=(e=1)=>l[D.index+e],U=D.advance=()=>l[++D.index]||"",q=()=>l.slice(D.index+1),Z=(e="",t=0)=>{D.consumed+=e,D.index+=t},W=e=>{D.output+=null!=e.output?e.output:e.value,Z(e.value)},G=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},V=e=>{D[e]++,F.push(e)},Y=e=>{D[e]--,F.pop()},Q=e=>{if("globstar"===B.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||M.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,D.output+=B.output)}if(M.length&&"paren"!==e.type&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&W(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,m.push(e),B=e},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=B,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:D.output?"":A}),Q({type:"paren",extglob:!0,value:U(),output:r}),M.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:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(D.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:H,output:n}),Y("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,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!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!z();){if(H=U(),"\0"===H)continue;if("\\"===H){const e=K();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",Q({type:"text",value:H});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(H+="\\")),!0===p.unescape?H=U():H+=U(),0===D.brackets){Q({type:"text",value:H});continue}}if(D.brackets>0&&("]"!==H||"["===B.value||"[^"===B.value)){if(!1!==p.posix&&":"===H){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=!0,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,D.backtrack=!0,U(),g.output||1!==m.indexOf(B)||(g.output=A);continue}}}("["===H&&":"!==K()||"-"===H&&"]"===K())&&(H=`\\${H}`),"]"!==H||"["!==B.value&&"[^"!==B.value||(H=`\\${H}`),!0===p.posix&&"!"===H&&"["===B.value&&(H="^"),B.value+=H,W({value:H});continue}if(1===D.quotes&&'"'!==H){H=t.escapeRegex(H),B.value+=H,W({value:H});continue}if('"'===H){D.quotes=1===D.quotes?0:1,!0===p.keepQuotes&&Q({type:"text",value:H});continue}if("("===H){V("parens"),Q({type:"paren",value:H});continue}if(")"===H){if(0===D.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=M[M.length-1];if(e&&D.parens===e.parens+1){X(M.pop());continue}Q({type:"paren",value:H,output:D.parens?")":"\\)"}),Y("parens");continue}if("["===H){if(!0!==p.nobracket&&q().includes("]"))V("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));H=`\\${H}`}Q({type:"bracket",value:H});continue}if("]"===H){if(!0===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:H,output:`\\${H}`});continue}if(0===D.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:H,output:`\\${H}`});continue}Y("brackets");const e=B.value.slice(1);if(!0===B.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),B.value+=H,W({value:H}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(D.output=D.output.slice(0,-B.value.length),!0===p.literalBrackets){D.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,D.output+=B.value;continue}if("{"===H&&!0!==p.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};j.push(e),Q(e);continue}if("}"===H){const e=j[j.length-1];if(!0===p.nobrace||!e){Q({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value}Q({type:"brace",value:H,output:t}),Y("braces"),j.pop();continue}if("|"===H){M.length>0&&M[M.length-1].conditions++,Q({type:"text",value:H});continue}if(","===H){let e=H;const t=j[j.length-1];t&&"braces"===F[F.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===B.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),B=g;continue}Q({type:"slash",value:H,output:S});continue}if("."===H){if(D.braces>0&&"dot"===B.type){"."===B.value&&(B.output=b);const e=j[j.length-1];B.type="dots",B.output+=H,B.value+=H,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:H,output:b});continue}Q({type:"dot",value:H,output:b});continue}if("?"===H){if(!(B&&"("===B.value)&&!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",H);continue}if(B&&"paren"===B.type){const e=K();let t=H;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${H}`),Q({type:"text",value:H,output:t});continue}if(!0!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:H,output:R});continue}Q({type:"qmark",value:H,output:$});continue}if("!"===H){if(!0!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",H);continue}if(!0!==p.nonegate&&0===D.index){G();continue}}if("+"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",H);continue}if(B&&"("===B.value||!1===p.regex){Q({type:"plus",value:H,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||D.parens>0){Q({type:"plus",value:H});continue}Q({type:"plus",value:w});continue}if("@"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:!0,value:H,output:""});continue}Q({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=s.exec(q());e&&(H+=e[0],D.index+=e[0].length),Q({type:"text",value:H});continue}if(B&&("globstar"===B.type||!0===B.star)){B.type="star",B.star=!0,B.value+=H,B.output=I,D.backtrack=!0,D.globstar=!0,Z(H);continue}let e=q();if(!0!==p.noextglob&&/^\([^?]/.test(e)){J("star",H);continue}if("star"===B.type){if(!0===p.noglobstar){Z(H);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:H,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=M.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:H,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3)}if("bos"===t.type&&z()){B.type="globstar",B.value+=H,B.output=P(p),D.output=B.output,D.globstar=!0,Z(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){D.output=D.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=P(p)+(p.strictSlashes?")":"|$)"),B.value+=H,D.globstar=!0,D.output+=t.output+B.output,Z(H);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+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${P(p)}${S}|${S}${n})`,B.value+=H,D.output+=t.output+B.output,D.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=H,B.output=`(?:^|${S}|${P(p)}${S})`,D.output=B.output,D.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-B.output.length),B.type="globstar",B.output=P(p),B.value+=H,D.output+=B.output,D.globstar=!0,Z(H);continue}const n={type:"star",value:H,output:I};!0!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||!0!==p.regex?(D.index!==D.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(D.output+=x,B.output+=x):!0===p.dot?(D.output+=O,B.output+=O):(D.output+=L,B.output+=L),"*"!==K()&&(D.output+=A,B.output+=A)),Q(n)):(n.output=H,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=L+n.output),Q(n))}for(;D.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Y("brackets")}for(;D.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Y("parens")}for(;D.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Y("braces")}if(!0===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===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{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?g:h,b=i.capture?"":"?:";let w=!0===i.bash?".*?":m;i.capture&&(w=`(${w})`);const S=e=>!0===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:!1,prefix:""});let E=A(k);return E&&!0!==i.strictSlashes&&(E+=`${l}?`),E},M=u}function Y(){if(H)return F;H=1;const e=G(),t=V(),n=W(),r=Z(),s=(e,t,n=!1)=>{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!1};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,!1,!0),u=c.state;delete c.state;let l=()=>!1;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n)}const f=(n,r=!1)=>{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),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=!1,!!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:!1,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===i),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===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:!1}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return!0===r&&(u.state=e),u},s.makeRe=(e,n={},r=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===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&&!0===t.debug)throw e;return/$^/}},s.constants=r,F=s}function Q(){if(z)return B;z=1;const e=Y(),t=W();function n(n,r,s=!1){return!r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),B=n}var J=R(Q());const X=async e=>{const r=[],s=["."];for(;s.length;){const i=s.pop(),o=n.resolve(e,i),a=await t.readdir(o,{withFileTypes:!0});for(const e of a){const t="."===i?e.name:n.join(i,e.name);e.isDirectory()?s.push(t):r.push(t.replace(/\\/g,"/"))}}return r},ee=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},te=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>ee(e,t):()=>!1;var n;const r=J(t,{dot:!0});return e=>r(e)},ne=async(r,{cwd:s,stanPath:i,includeOutputDir:o,includes:a=[],excludes:c=[],anchors:u=[]})=>{const l=i.replace(/\\/g,"/"),f=((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)})(r,l),p=await(async r=>{const s=n.resolve(r,".gitignore");if(!e.existsSync(s))return null;try{const e=await t.readFile(s,"utf8"),n=U();return n.add(e),n}catch{return null}})(s),h=[e=>ee(e,"node_modules"),e=>ee(e,".git"),...p?[e=>p.ignores(e)]:[],...c.map(te),...f.map(e=>t=>ee(t,e)),e=>w(l,e)];o||h.push(e=>S(`${l}/output`,e));const d=r.filter(e=>!h.some(t=>t(e)));if(a.length>0){const e=a.map(te),t=[e=>w(l,e),...o?[]:[e=>S(`${l}/output`,e)]],n=new Set(d);for(const t of r)e.some(e=>e(t))&&n.add(t);const s=c.map(te),i=new Set(r.filter(e=>n.has(e)&&!t.some(t=>t(e))&&!s.some(t=>t(e))));if(u.length>0){const e=u.map(te);for(const t of r){!(w(l,t)||!o&&S(`${l}/output`,t))&&e.some(e=>e(t))&&i.add(t)}}return r.filter(e=>i.has(e))}if(u.length>0){const e=u.map(te),t=new Set(d);for(const n of r){!(w(l,n)||!o&&S(`${l}/output`,n))&&e.some(e=>e(n))&&t.add(n)}return r.filter(e=>t.has(e))}return d},re=async(e,t)=>{const n=(await(async()=>{try{const e=await Promise.resolve().then(function(){return Ic}),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 r.ensureDir(n.rootAbs),await r.ensureDir(n.outputAbs),await r.ensureDir(n.diffAbs),await r.ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},se=async(e,t)=>{const n=await re(e,t);return{outDir:n.outputAbs,diffDir:n.diffAbs}},ie=".stan",oe=e=>e instanceof URL?i.fileURLToPath(e):e;function ae({cwd:t}={}){const r=function(t,{cwd:r=s.cwd(),type:i="file",stopAt:o}={}){let a=n.resolve(oe(r)??"");const{root:c}=n.parse(a);o=n.resolve(a,oe(o)??c);const u=n.isAbsolute(t);for(;a;){const r=u?t:n.join(a,t);try{const t=e.statSync(r,{throwIfNoEntry:!1});if("file"===i&&t?.isFile()||"directory"===i&&t?.isDirectory())return r}catch{}if(a===o||a===c)break;a=n.dirname(a)}}("package.json",{cwd:t});return r&&n.dirname(r)}const ce=["stan.config.yml","stan.config.yaml","stan.config.json"],ue=t=>{for(const r of ce){const s=n.resolve(t,r);if(e.existsSync(s))return s}return null},le=e=>{const t=ue(e);if(t)return t;const r=new Set;let s=e;for(;s;){const e=ae({cwd:s});if(!e||r.has(e))break;r.add(e);const t=ue(e);if(t)return t;const i=n.dirname(e);if(i===e||r.has(i))break;s=i}return null};var fe,pe={},he={},de={},ge={};function me(){if(fe)return ge;fe=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!0}return!1}return ge.ALIAS=e,ge.DOC=t,ge.MAP=n,ge.NODE_TYPE=o,ge.PAIR=r,ge.SCALAR=s,ge.SEQ=i,ge.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,ge.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,ge.isCollection=c,ge.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,ge.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,ge.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return!0}return!1},ge.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,ge.isScalar=a,ge.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,ge}var ye,ve,_e={};function be(){if(ye)return _e;ye=1;var e=me();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,_e.visit=s,_e.visitAsync=o,_e}function we(){if(ve)return de;ve=1;var e=me(),t=be();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=!1,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=!0;break;case"1.2":this.atNextDocument=!1,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=!1);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!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}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]=!0)}),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:!1,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},de.Directives=s,de}var Se,Ae={},ke={},Ee={};function xe(){if(Se)return Ee;Se=1;var e=me(),t=be();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 Ee.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!0},Ee.anchorNames=n,Ee.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}},Ee.findNewAnchor=r,Ee}var Oe,$e={},Re={};function Ce(){if(Oe)return Re;return Oe=1,Re.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)},Re}var Te,Pe,Le,Ne={};function Ie(){if(Te)return Ne;Te=1;var e=me();return Ne.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)},Ne}function De(){if(Pe)return $e;Pe=1;var e=Ce(),t=me(),n=Ie();return $e.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:!0,mapAsMap:!0===s,mapKeyWarned:!1,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}},$e}function Me(){if(Le)return ke;Le=1;var e=xe(),t=be(),n=me(),r=De(),s=Ie();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 ke.Alias=i,ke}var je,Fe,He,Be={},ze={},Ke={};function Ue(){if(je)return Ke;je=1;var e=me(),t=De(),n=Ie();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",Ke.Scalar=r,Ke.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,Ke}function qe(){if(Fe)return ze;Fe=1;var e=Me(),t=me(),n=Ue();return ze.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},ze}function Ze(){if(He)return Be;He=1;var e=qe(),t=me(),n=De();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:!1,keepUndefined:!1,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:!0,enumerable:!1,writable:!0})}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,!0);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,!0);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,!0);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!1;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,!0);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,!0);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 Be.Collection=i,Be.collectionFromPath=r,Be.isEmptyPath=s,Be}var We,Ge={},Ve={},Ye={},Qe={};function Je(){if(We)return Qe;We=1;function e(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return Qe.indentComment=e,Qe.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,Qe.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),Qe}var Xe,et,tt,nt,rt={},st={};function it(){if(Xe)return st;Xe=1;const e="block",t="quoted";function n(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,s=t+1,i=e[s]}return r}return st.FOLD_BLOCK=e,st.FOLD_FLOW="flow",st.FOLD_QUOTED=t,st.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,g,m=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):m=a-o);let y=!1,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(m=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(_=v,r[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}b=v}if("\n"===o)i===e&&(v=n(r,v,s.length)),m=v+s.length+f,d=void 0;else{if(" "===o&&g&&" "!==g&&"\n"!==g&&"\t"!==g){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v)}if(v>=m)if(d)p.push(d),m=d+f,d=void 0;else if(i===t){for(;" "===g||"\t"===g;)g=o,o=r[v+=1],y=!0;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=!0,m=e+f,d=void 0}else y=!0}g=o}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`)}return w},st}function ot(){if(et)return rt;et=1;var e=Ue(),t=it();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,!1))}function i(e,i){if(!1===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,!1))}function o(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=s;else{const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{a=/\n+(?!\n|$)/g}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const g=u.indent||(u.forceBlockIndent||r(c)?" ":""),m="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(c,d,g.length));if(!c)return m?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let _=c.substring(v);const b=_.indexOf("\n");-1===b?y="-":c===_||b!==_.length-1?(y="+",f&&f()):y="",_&&(c=c.slice(0,-_.length),"\n"===_[_.length-1]&&(_=_.slice(0,-1)),_=_.replace(a,`$&${g}`));let w,S=!1,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=!0;else{if("\n"!==e)break;A=w}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${g}`));let E=(S?g?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!m){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let s=!1;const o=n(u,!0);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=!0});const a=t.foldFlowLines(`${k}${r}${_}`,g,t.FOLD_BLOCK,o);if(!s)return`>${E}\n${g}${a}`}return`|${E}\n${g}${k}${c=c.replace(/\n+/g,`$&${g}`)}${_}`}return rt.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:g}=a;g!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(g=e.Scalar.QUOTE_DOUBLE);const m=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:g,inFlow:m}=i;if(h&&f.includes("\n")||m&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||m||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!m&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=!0,c(s,i,a,u);if(h&&d===g)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,!1))}(d,u,l,f);default:return null}};let y=m(g);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=m(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},rt}function at(){if(tt)return Ye;tt=1;var e=xe(),t=me(),n=Je(),r=ot();return Ye.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case"block":s=!1;break;case"flow":s=!0;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}},Ye.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},Ye}function ct(){if(nt)return Ve;nt=1;var e=me(),t=Ue(),n=at(),r=Je();return Ve.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:g}}=o;let m=e.isNode(s)&&s.comment||null;if(g){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!g&&(!s||m&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(g||!u),indent:f+p});let v,_,b,w=!1,S=!1,A=n.stringify(s,o,()=>w=!0,()=>S=!0);if(!y&&!o.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!g||null==i&&y)return A=`? ${A}`,m&&!w?A+=r.lineComment(A,o.indent,h(m)):S&&c&&c(),A;w&&(m=null),y?(m&&(A+=r.lineComment(A,o.indent,h(m))),A=`? ${A}\n${f}:`):(A=`${A}:`,m&&(A+=r.lineComment(A,o.indent,h(m)))),e.isNode(i)?(v=!!i.spaceBefore,_=i.commentBefore,b=i.comment):(v=!1,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=!1,y||m||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=!1,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=!1;const E=n.stringify(i,o,()=>k=!0,()=>S=!0);let x=" ";if(m||v||_){if(x=v?"\n":"",_){const e=h(_);x+=`\n${r.indentComment(e,o.indent)}`}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n")}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=!1;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=!0)}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},Ve}var ut,lt={},ft={};function pt(){if(ut)return ft;ut=1;var e=o;return ft.debug=function(e,...t){"debug"===e&&console.log(...t)},ft.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n))},ft}var ht,dt,gt,mt={};function yt(){if(ht)return mt;ht=1;var e=me(),t=Ue();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:!0,enumerable:!0,configurable:!0});return n}return mt.addMergeToJSMap=s,mt.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),mt.merge=r,mt}function vt(){if(dt)return lt;dt=1;var e=pt(),t=yt(),n=at(),r=me(),s=Ie();return lt.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=!0,r.inStringifyKey=!0;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=!0}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:!0,enumerable:!0,configurable:!0}):o[u]=l}}return o},lt}function _t(){if(gt)return Ge;gt=1;var e=qe(),t=ct(),n=vt(),r=me();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 Ge.Pair=s,Ge.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)},Ge}var bt,wt,St,At={},kt={},Et={},xt={};function Ot(){if(bt)return xt;bt=1;var e=me(),t=at(),n=Je();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let g=!1;const m=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!g&&c.spaceBefore&&m.push(""),i(o,m,c.commentBefore,g),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!g&&t.spaceBefore&&m.push(""),i(o,m,t.commentBefore,g))}g=!1;let f=t.stringify(c,d,()=>l=null,()=>g=!0);l&&(f+=n.lineComment(f,u,h(l))),g&&l&&(g=!1),m.push(a+f)}let y;if(0===m.length)y=c.start+c.end;else{y=m[0];for(let e=1;e<m.length;++e){const t=m[e];y+=t?`\n${p}${t}`:"\n"}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):g&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:!0,type:null});let h=!1,d=0;const g=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&g.push(""),i(s,g,c.commentBefore,!1),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&g.push(""),i(s,g,t.commentBefore,!1),t.comment&&(h=!0));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=!0)):null==c.value&&t?.comment&&(u=t.comment)}u&&(h=!0);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(g.length>d||l.includes("\n"))&&(h=!0),g.push(l),d=g.length}const{start:m,end:y}=o;if(0===g.length)return m+y;if(!h){const e=g.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth}if(h){let e=m;for(const t of g)e+=t?`\n${u}${c}${t}`:"\n";return`${e}\n${c}${y}`}return`${m}${l}${g.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart())}}return xt.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?s:r)(e,t,n)},xt}function $t(){if(wt)return Et;wt=1;var e=Ot(),t=vt(),n=Ze(),r=me(),s=_t(),i=Ue();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!1;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),!0)}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(!1)&&(t=Object.assign({},t,{allNullValues:!0})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Et.YAMLMap=a,Et.findPair=o,Et}function Rt(){if(St)return kt;St=1;var e=me(),t=$t();const n={collection:"map",default:!0,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 kt.map=n,kt}var Ct,Tt,Pt={},Lt={};function Nt(){if(Ct)return Lt;Ct=1;var e=qe(),t=Ot(),n=Ze(),r=me(),s=Ue(),i=Ie();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!1;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 Lt.YAMLSeq=o,Lt}function It(){if(Tt)return Pt;Tt=1;var e=me(),t=Nt();const n={collection:"seq",default:!0,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 Pt.seq=n,Pt}var Dt,Mt={};function jt(){if(Dt)return Mt;Dt=1;var e=ot();const t={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:!0},n),e.stringifyString(t,n,r,s))};return Mt.string=t,Mt}var Ft,Ht={},Bt={};function zt(){if(Ft)return Bt;Ft=1;var e=Ue();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,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 Bt.nullTag=t,Bt}var Kt,Ut={};function qt(){if(Kt)return Ut;Kt=1;var e=Ue();const t={identify:e=>"boolean"==typeof e,default:!0,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 Ut.boolTag=t,Ut}var Zt,Wt,Gt={},Vt={};function Yt(){if(Zt)return Vt;return Zt=1,Vt.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},Vt}function Qt(){if(Wt)return Gt;Wt=1;var e=Ue(),t=Yt();const n={identify:e=>"number"==typeof e,default:!0,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:!0,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:!0,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 Gt.float=s,Gt.floatExp=r,Gt.floatNaN=n,Gt}var Jt,Xt={};function en(){if(Jt)return Xt;Jt=1;var e=Yt();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:!0,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:!0,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:!0,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 Xt.int=i,Xt.intHex=o,Xt.intOct=s,Xt}var tn,nn={};function rn(){if(tn)return nn;tn=1;var e=Rt(),t=zt(),n=It(),r=jt(),s=qt(),i=Qt(),o=en();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 nn.schema=a,nn}var sn,on={};function an(){if(sn)return on;sn=1;var e=Ue(),t=Rt(),n=It();function r(e){return"bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:!0,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:!0,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:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return on.schema=a,on}var cn,un={};function ln(){if(cn)return un;cn=1;var e=a,t=Ue(),n=ot();const r={identify:e=>e instanceof Uint8Array,default:!1,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 un.binary=r,un}var fn,pn,hn={},dn={};function gn(){if(fn)return dn;fn=1;var e=me(),t=_t(),n=Ue(),r=Nt();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:!1,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return dn.createPairs=i,dn.pairs=o,dn.resolvePairs=s,dn}function mn(){if(pn)return hn;pn=1;var e=me(),t=Ie(),n=$t(),r=Nt(),s=gn();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:!1,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 hn.YAMLOMap=i,hn.omap=o,hn}var yn,vn={},_n={};function bn(){if(yn)return _n;yn=1;var e=Ue();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=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(!0),stringify:t},r={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(!1),stringify:t};return _n.falseTag=r,_n.trueTag=n,_n}var wn,Sn={};function An(){if(wn)return Sn;wn=1;var e=Ue(),t=Yt();const n={identify:e=>"number"==typeof e,default:!0,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:!0,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:!0,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 Sn.float=s,Sn.floatExp=r,Sn.floatNaN=n,Sn}var kn,En={};function xn(){if(kn)return En;kn=1;var e=Yt();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:!0,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:!0,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:!0,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:!0,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 En.int=o,En.intBin=s,En.intHex=a,En.intOct=i,En}var On,$n={};function Rn(){if(On)return $n;On=1;var e=me(),t=_t(),n=$t();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(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),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:!1,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(!0))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 $n.YAMLSet=r,$n.set=s,$n}var Cn,Tn,Pn,Ln,Nn={};function In(){if(Cn)return Nn;Cn=1;var e=Yt();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:!0,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:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,!1),stringify:n},i={identify:e=>e instanceof Date,default:!0,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,!1);Math.abs(e)<30&&(e*=60),f-=6e4*e}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Nn.floatTime=s,Nn.intTime=r,Nn.timestamp=i,Nn}function Dn(){if(Tn)return vn;Tn=1;var e=Rt(),t=zt(),n=It(),r=jt(),s=ln(),i=bn(),o=An(),a=xn(),c=yt(),u=mn(),l=gn(),f=Rn(),p=In();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 vn.schema=h,vn}function Mn(){if(Pn)return Ht;Pn=1;var e=Rt(),t=zt(),n=It(),r=jt(),s=qt(),i=Qt(),o=en(),a=rn(),c=an(),u=ln(),l=yt(),f=mn(),p=gn(),h=Dn(),d=Rn(),g=In();const m=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:g.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:g.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:g.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":g.timestamp};return Ht.coreKnownTags=v,Ht.getTags=function(e,t,n){const r=m.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(m.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},Ht}function jn(){if(Ln)return At;Ln=1;var e=me(),t=Rt(),n=It(),r=jt(),s=Mn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return At.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:!0===f?i:null}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},At}var Fn,Hn,Bn={};function zn(){if(Fn)return Bn;Fn=1;var e=me(),t=at(),n=Je();return Bn.stringifyDocument=function(r,s){const i=[];let o=!0===s.directives;if(!1!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=!0):r.directives.docStart&&(o=!0)}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=!1,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=!0;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"},Bn}function Kn(){if(Hn)return Ae;Hn=1;var e=Me(),t=Ze(),n=me(),r=_t(),s=Ie(),i=jn(),o=zn(),a=xe(),c=Ce(),u=qe(),l=we();function f(e){if(n.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}return Ae.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:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r)}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e)}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t)}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:g}=a.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:g},y=u.createNode(e,p,m);return c&&n.isCollection(y)&&(y.flow=!0),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,!0):!!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:!1,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:!0,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:!0===n,mapKeyWarned:!1,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:!0,jsonArg:e,mapAsMap:!1,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)}},Ae}var Un,qn={};function Zn(){if(Un)return qn;Un=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}return qn.YAMLError=e,qn.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},qn.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},qn.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`}},qn}var Wn,Gn={},Vn={},Yn={},Qn={},Jn={};function Xn(){if(Wn)return Jn;return Wn=1,Jn.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,f="",p="",h=!1,d=!1,g=null,m=null,y=null,v=null,_=null,b=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),g&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),s.type){case"space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(g=s),l=!0;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=!1;break}case"newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=!0):p+=s.source,u=!0,h=!0,(m||y)&&(v=s),l=!0;break;case"anchor":m&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case"tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case n:(m||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),b&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),b=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=!1,l=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,l=!1}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:A,start:w??A}},Jn}var er,tr={};function nr(){if(er)return tr;return er=1,tr.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!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}},tr}var rr,sr={};function ir(){if(rr)return sr;rr=1;var e=nr();return sr.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const s=n.end[0];if(s.indent===t&&("]"===s.source||"}"===s.source)&&e.containsNewline(n)){r(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}},sr}var or,ar,cr={};function ur(){if(or)return cr;or=1;var e=me();return cr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(!1===s)return!1;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))},cr}function lr(){if(ar)return Qn;ar=1;var e=_t(),t=$t(),n=Xn(),r=nr(),s=ir(),i=ur();const o="All mapping items must start at the same column";return Qn.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=!1);let d=l.offset,g=null;for(const t of l.items){const{start:p,key:m,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:m??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:!0}),b=!_.found;if(b){if(m&&("block-seq"===m.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){g=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(m))&&f(m??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=!0;const w=_.end,S=m?a(u,m,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,m,f),u.atKey=!1,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!m||"block-scalar"===m.type});if(d=A.end,A.found){b&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&_.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r)}else{b&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n)}}return g&&g<d&&f(g,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,g??d],h},Qn}var fr,pr={};function hr(){if(fr)return pr;fr=1;var e=Nt(),t=Xn(),n=ir();return pr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);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:!0});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},pr}var dr,gr,mr,yr={},vr={};function _r(){if(dr)return vr;return dr=1,vr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":i=!0;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=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:s,offset:t}},vr}function br(){if(gr)return yr;gr=1;var e=me(),t=_t(),n=$t(),r=Nt(),s=_r(),i=Xn(),o=nr(),a=ur();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return yr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,g){const m="{"===h.start.source,y=m?"flow map":"flow sequence",v=new(g?.nodeClass??(m?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=!0;const _=p.atRoot;_&&(p.atRoot=!1),p.atKey&&(p.atKey=!1);let b=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:g,key:_,sep:w,value:S}=s,A=i.resolveProps(g,{flow:y,indicator:"explicit-key-ind",next:_??w?.[0],offset:b,onError:d,parentIndent:h.indent,startOnNewline:!1});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),b=A.end;continue}!m&&p.options.strict&&o.containsNewline(_)&&d(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of g)switch(e.type){case"comma":case"space":break;case"comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1)}}if(m||w||A.found){p.atKey=!0;const e=A.end,r=_?l(p,_,A,d):f(p,e,g,null,A,d);u(_)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=!1;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:!1});if(o.found){if(!m&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),m){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E)}else{const e=new n.YAMLMap(p.schema);e.flow=!0,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e)}b=k?k.range[2]:o.end}else{const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),b=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c)}}const w=m?"}":"]",[S,...A]=h.end;let k=b;if(S&&S.source===w)k=S.offset+S.source.length;else{const e=y[0].toUpperCase()+y.substring(1);d(b,_?"MISSING_CHAR":"BAD_INDENT",_?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S)}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset]}else v.range=[h.offset,k,k];return v},yr}function wr(){if(mr)return Yn;mr=1;var e=me(),t=Ue(),n=$t(),r=Nt(),s=lr(),i=hr(),o=br();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 Yn.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"}`,!0):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:!1})),h=e}const d=a(s,i,o,u,f,h),g=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,m=e.isNode(g)?g:new t.Scalar(g);return m.range=d.range,m.tag=f,h?.format&&(m.format=h.format),m},Yn}var Sr,Ar={},kr={};function Er(){if(Sr)return kr;Sr=1;var e=Ue();return kr.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=!1,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case"space":u=!0;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=!1;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=!0):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n"}const g=s+i.length+n.source.length;return{value:p,type:o,comment:i.comment,range:[s,g,g]}},kr}var xr,Or,$r={};function Rr(){if(xr)return $r;xr=1;var e=Ue(),t=_r();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 $r.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const g=(e,t,n)=>c(u+e,t,n);switch(l){case"scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,g);break;case"single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,g);break;case"double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s}else{const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a)}else n+=a}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,g);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const m=u+f.length,y=t.resolveEnd(p,m,a,c);return{value:d,type:h,comment:y.comment,range:[u,m,y.offset]}},$r}function Cr(){if(Or)return Ar;Or=1;var e=me(),t=Ue(),n=Er(),r=Rr();return Ar.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:!1,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=>(!0===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)}`,!0)}}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},Ar}var Tr,Pr,Lr,Nr,Ir={};function Dr(){if(Tr)return Ir;return Tr=1,Ir.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},Ir}function Mr(){if(Pr)return Vn;Pr=1;var e=Me(),t=me(),n=wr(),r=Cr(),s=_r(),i=Dr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:g}=u;let m,y=!0;switch(a.type){case"alias":m=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||g)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":m=r.composeScalar(i,a,g,l),d&&(m.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=n.composeCollection(o,i,a,u,l),d&&(m.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),m=c(i,a.offset,void 0,null,u,l),y=!1}if(d&&""===m.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(m)||"string"!=typeof m.value||m.tag&&"tag:yaml.org,2002:str"!==m.tag)){l(g??a,"NON_STRING_KEY","With stringKeys, all keys must be strings")}return p&&(m.spaceBefore=!0),h&&("scalar"===a.type&&""===a.source?m.comment=h:m.commentBefore=h),i.options.keepSourceTokens&&y&&(m.srcToken=a),m}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),a&&(h.comment=a,h.range[2]=l),h}return Vn.composeEmptyNode=c,Vn.composeNode=a,Vn}function jr(){if(Lr)return Gn;Lr=1;var e=Kn(),t=Mr(),n=_r(),r=Xn();return Gn.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:!1,atRoot:!0,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:!0});d.found&&(p.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const g=p.contents.range[2],m=n.resolveEnd(u,g,!1,l);return m.comment&&(p.comment=m.comment),p.range=[o,g,m.offset],p},Gn}function Fr(){if(Nr)return he;Nr=1;var e=o,t=we(),n=Kn(),r=Zn(),s=me(),i=jr(),a=_r();function c(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 u(e){let t="",n=!1,r=!1;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=!0,r=!1;break;case"%":"#"!==e[s+1]?.[0]&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}return he.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=c(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}=u(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:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,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=c(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r)}),this.prelude.push(t.source),this.atDirectives=!0;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,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;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(c(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(c(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=a.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),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(c(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),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,!1),yield r}}},he}var Hr,Br={},zr={};function Kr(){if(Hr)return zr;Hr=1;var e=Er(),t=Rr(),n=Zn(),r=ot();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),!0}return!1}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 zr.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:i,inFlow:o=!1,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:!0,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}}},zr.resolveAsScalar=function(r,s=!0,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},zr.setScalarValue=function(e,t,n={}){let{afterKey:o=!1,implicitKey:a=!1,inFlow:c=!1,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:!0,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")}},zr}var Ur,qr={};function Zr(){if(Ur)return qr;Ur=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 qr.stringify=n=>"type"in n?e(n):t(n),qr}var Wr,Gr,Vr={};function Yr(){if(Wr)return Vr;Wr=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")},Vr.visit=r,Vr}function Qr(){if(Gr)return Br;Gr=1;var e=Kr(),t=Zr(),n=Yr();return Br.createScalarToken=e.createScalarToken,Br.resolveAsScalar=e.resolveAsScalar,Br.setScalarValue=e.setScalarValue,Br.stringify=t.stringify,Br.visit=n.visit,Br.BOM="\ufeff",Br.DOCUMENT="",Br.FLOW_END="",Br.SCALAR="",Br.isCollection=e=>!!e&&"items"in e,Br.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),Br.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},Br.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},Br}var Jr,Xr={};function es(){if(Jr)return Xr;Jr=1;var e=Qr();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}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 Xr.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){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(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(!0);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(!1),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(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);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=!1,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(!0)),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(!1),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(!0))}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(!0)),this.flowKey=!1;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=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(o),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,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,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;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,!0),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,!0),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(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(o))+(yield*this.pushSpaces(!0))+(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=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(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,!1)}{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,!1)}}*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,!1)}},Xr}var ts,ns={};function rs(){if(ts)return ns;ts=1;return ns.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}}}},ns}var ss,is={};function os(){if(ss)return is;ss=1;var e=o,t=Qr(),n=es();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}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!0;default:return!1}}function a(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 c(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 u(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 is.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){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=!1,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,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=!1}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&&u(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=!0);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=c(a(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=!0,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=!0,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=!1,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=!0):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:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);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=c(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=c(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=!0);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=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}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=c(a(t));u(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=!0,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=!0;const t=c(a(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=c(a(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=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},is}var as,cs,us={};function ls(){if(as)return us;as=1;var e=Fr(),t=Kn(),n=Zn(),r=pt(),s=me(),i=rs(),o=os();function a(e){const t=!1!==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),!0,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 us.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))},us.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:!0},u.streamInfo())},us.parseDocument=c,us.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)},us}var fs=function(){if(cs)return pe;cs=1;var e=Fr(),t=Kn(),n=jn(),r=Zn(),s=Me(),i=me(),o=_t(),a=Ue(),c=$t(),u=Nt(),l=Qr(),f=es(),p=rs(),h=os(),d=ls(),g=be();return pe.Composer=e.Composer,pe.Document=t.Document,pe.Schema=n.Schema,pe.YAMLError=r.YAMLError,pe.YAMLParseError=r.YAMLParseError,pe.YAMLWarning=r.YAMLWarning,pe.Alias=s.Alias,pe.isAlias=i.isAlias,pe.isCollection=i.isCollection,pe.isDocument=i.isDocument,pe.isMap=i.isMap,pe.isNode=i.isNode,pe.isPair=i.isPair,pe.isScalar=i.isScalar,pe.isSeq=i.isSeq,pe.Pair=o.Pair,pe.Scalar=a.Scalar,pe.YAMLMap=c.YAMLMap,pe.YAMLSeq=u.YAMLSeq,pe.CST=l,pe.Lexer=f.Lexer,pe.LineCounter=p.LineCounter,pe.Parser=h.Parser,pe.parse=d.parse,pe.parseAllDocuments=d.parseAllDocuments,pe.parseDocument=d.parseDocument,pe.stringify=d.stringify,pe.visit=g.visit,pe.visitAsync=g.visitAsync,pe}(),ps=R(fs);function hs(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(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 ds extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ms={};function ys(e){return ms}function vs(e,t){return"bigint"==typeof t?t.toString():t}function _s(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bs(e){return null==e}function ws(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ss=Symbol("evaluating");function As(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ss)return void 0===r&&(r=Ss,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ks(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Es(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function xs(e){return JSON.stringify(e)}const Os="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Rs=_s(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Cs(e){if(!1===$s(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==$s(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ts(e){return Cs(e)?{...e}:Array.isArray(e)?[...e]:e}const Ps=new Set(["string","number","symbol"]);function Ls(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ns(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Is(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 Ds(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ms(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 Fs(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 Hs(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Bs(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const zs=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ks=hs("$ZodError",zs),Us=hs("$ZodError",zs,{Parent:Error});const qs=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new ds;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Fs(e,i,ys())));throw Os(t,s?.callee),t}return o.value},Zs=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};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=>Fs(e,i,ys())));throw Os(t,s?.callee),t}return o.value},Ws=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ds;return i.issues.length?{success:!1,error:new(e??Ks)(i.issues.map(e=>Fs(e,s,ys())))}:{success:!0,data:i.value}},Gs=Ws(Us),Vs=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Fs(e,s,ys())))}:{success:!0,data:i.value}},Ys=Vs(Us),Qs=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qs(e)(t,n,s)},Js=e=>(t,n,r)=>qs(e)(t,n,r),Xs=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zs(e)(t,n,s)},ei=e=>async(t,n,r)=>Zs(e)(t,n,r),ti=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ws(e)(t,n,s)},ni=e=>(t,n,r)=>Ws(e)(t,n,r),ri=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vs(e)(t,n,s)},si=e=>async(t,n,r)=>Vs(e)(t,n,r),ii=/^[cC][^\s-]{8,}$/,oi=/^[0-9a-z]+$/,ai=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ci=/^[0-9a-vA-V]{20}$/,ui=/^[A-Za-z0-9]{27}$/,li=/^[a-zA-Z0-9_-]{21}$/,fi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pi=/^([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})$/,hi=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)$/,di=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const gi=/^(?:(?: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])$/,mi=/^(([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}|:))$/,yi=/^((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])$/,vi=/^(([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])$/,_i=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bi=/^[A-Za-z0-9_-]*$/,wi=/^(?=.{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])?)*\.?$/,Si=/^\+(?:[0-9]){6,14}[0-9]$/,Ai="(?:(?:\\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])))",ki=new RegExp(`^${Ai}$`);function Ei(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 xi=/^[^A-Z]*$/,Oi=/^[^a-z]*$/,$i=hs("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ri=hs("$ZodCheckMaxLength",(e,t)=>{var n;$i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!bs(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=Hs(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ci=hs("$ZodCheckMinLength",(e,t)=>{var n;$i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!bs(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=Hs(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ti=hs("$ZodCheckLengthEquals",(e,t)=>{var n;$i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!bs(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=Hs(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pi=hs("$ZodCheckStringFormat",(e,t)=>{var n,r;$i.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=()=>{})}),Li=hs("$ZodCheckRegex",(e,t)=>{Pi.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})}}),Ni=hs("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xi),Pi.init(e,t)}),Ii=hs("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Oi),Pi.init(e,t)}),Di=hs("$ZodCheckIncludes",(e,t)=>{$i.init(e,t);const n=Ls(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})}}),Mi=hs("$ZodCheckStartsWith",(e,t)=>{$i.init(e,t);const n=new RegExp(`^${Ls(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=hs("$ZodCheckEndsWith",(e,t)=>{$i.init(e,t);const n=new RegExp(`.*${Ls(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})}}),Fi=hs("$ZodCheckOverwrite",(e,t)=>{$i.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Hi{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 Bi={major:4,minor:1,patch:12},zi=hs("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bi;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=Ds(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&&!1===n?.async)throw new ds;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ds(e,t)))});else{if(e.issues.length===t)continue;s||(s=Ds(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ds(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new ds;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:!0});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(!1===i.async)throw new ds;return o.then(e=>t(e,r,i))}return t(o,r,i)}}e["~standard"]={validate:t=>{try{const n=Gs(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Ys(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Ki=hs("$ZodString",(e,t)=>{var n;zi.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}}),Ui=hs("$ZodStringFormat",(e,t)=>{Pi.init(e,t),Ki.init(e,t)}),qi=hs("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pi),Ui.init(e,t)}),Zi=hs("$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=hi(e))}else t.pattern??(t.pattern=hi());Ui.init(e,t)}),Wi=hs("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=di),Ui.init(e,t)}),Gi=hs("$ZodURL",(e,t)=>{Ui.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:wi.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})}}}),Vi=hs("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ui.init(e,t)}),Yi=hs("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=li),Ui.init(e,t)}),Qi=hs("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ii),Ui.init(e,t)}),Ji=hs("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=oi),Ui.init(e,t)}),Xi=hs("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ai),Ui.init(e,t)}),eo=hs("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ci),Ui.init(e,t)}),to=hs("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ui),Ui.init(e,t)}),no=hs("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Ei({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(`^${Ai}T(?:${r})$`)}(t)),Ui.init(e,t)}),ro=hs("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ki),Ui.init(e,t)}),so=hs("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Ei(t)}$`)),Ui.init(e,t)}),io=hs("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fi),Ui.init(e,t)}),oo=hs("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=gi),Ui.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),ao=hs("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mi),Ui.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})}}}),co=hs("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=yi),Ui.init(e,t)}),uo=hs("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vi),Ui.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 lo(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const fo=hs("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=_i),Ui.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{lo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const po=hs("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bi),Ui.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!bi.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return lo(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})}}),ho=hs("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Si),Ui.init(e,t)});const go=hs("$ZodJWT",(e,t)=>{Ui.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!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),mo=hs("$ZodUnknown",(e,t)=>{zi.init(e,t),e._zod.parse=e=>e}),yo=hs("$ZodNever",(e,t)=>{zi.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function vo(e,t,n){e.issues.length&&t.issues.push(...Ms(n,e.issues)),t.value[n]=e.value}const _o=hs("$ZodArray",(e,t)=>{zi.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=>vo(t,n,e))):vo(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function bo(e,t,n,r){e.issues.length&&t.issues.push(...Ms(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function wo(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 So(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=>bo(e,n,s,t))):bo(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 Ao=hs("$ZodObject",(e,t)=>{zi.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=_s(()=>wo(t));As(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=$s,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=>bo(n,t,e,a))):bo(r,t,e,a)}return i?So(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),ko=hs("$ZodObjectJIT",(e,t)=>{Ao.init(e,t);const n=e._zod.parse,r=_s(()=>wo(t));let s;const i=$s,o=!ms.jitless,a=o&&Rs.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&!1===f?.async&&!0!==f.jitless?(s||(s=(e=>{const t=new Hi(["shape","payload","ctx"]),n=r.value,s=e=>{const t=xs(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=xs(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?So([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Eo(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=>!Ds(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=>Fs(e,r,ys())))}),t)}const xo=hs("$ZodUnion",(e,t)=>{zi.init(e,t),As(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),As(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),As(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),As(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=>ws(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=!1;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=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>Eo(t,s,e,i)):Eo(a,s,e,i)}}),Oo=hs("$ZodIntersection",(e,t)=>{zi.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])=>Ro(e,t,n)):Ro(e,s,i)}});function $o(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Cs(e)&&Cs(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=$o(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=$o(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ro(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ds(e))return e;const r=$o(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 Co=hs("$ZodRecord",(e,t)=>{zi.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Cs(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(...Ms(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Ms(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=>Fs(e,r,ys())),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(...Ms(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...Ms(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),To=hs("$ZodEnum",(e,t)=>{zi.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=>Ps.has(typeof e)).map(e=>"string"==typeof e?Ls(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}}),Po=hs("$ZodTransform",(e,t)=>{zi.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new gs(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 ds;return n.value=s,n}});function Lo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const No=hs("$ZodOptional",(e,t)=>{zi.init(e,t),e._zod.optin="optional",e._zod.optout="optional",As(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),As(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ws(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=>Lo(t,e.value)):Lo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Io=hs("$ZodNullable",(e,t)=>{zi.init(e,t),As(e._zod,"optin",()=>t.innerType._zod.optin),As(e._zod,"optout",()=>t.innerType._zod.optout),As(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ws(e.source)}|null)$`):void 0}),As(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)}),Do=hs("$ZodDefault",(e,t)=>{zi.init(e,t),e._zod.optin="optional",As(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=>Mo(e,t)):Mo(r,t)}});function Mo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const jo=hs("$ZodPrefault",(e,t)=>{zi.init(e,t),e._zod.optin="optional",As(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))}),Fo=hs("$ZodNonOptional",(e,t)=>{zi.init(e,t),As(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=>Ho(t,e)):Ho(s,e)}});function Ho(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 Bo=hs("$ZodCatch",(e,t)=>{zi.init(e,t),As(e._zod,"optin",()=>t.innerType._zod.optin),As(e._zod,"optout",()=>t.innerType._zod.optout),As(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=>Fs(e,n,ys()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Fs(e,n,ys()))},input:e.value}),e.issues=[]),e)}}),zo=hs("$ZodPipe",(e,t)=>{zi.init(e,t),As(e._zod,"values",()=>t.in._zod.values),As(e._zod,"optin",()=>t.in._zod.optin),As(e._zod,"optout",()=>t.out._zod.optout),As(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=>Ko(e,t.in,n)):Ko(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ko(e,t.out,n)):Ko(r,t.out,n)}});function Ko(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Uo=hs("$ZodReadonly",(e,t)=>{zi.init(e,t),As(e._zod,"propValues",()=>t.innerType._zod.propValues),As(e._zod,"values",()=>t.innerType._zod.values),As(e._zod,"optin",()=>t.innerType._zod.optin),As(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(qo):qo(r)}});function qo(e){return e.value=Object.freeze(e.value),e}const Zo=hs("$ZodCustom",(e,t)=>{$i.init(e,t),zi.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=>Wo(t,n,r,e));Wo(s,n,r,e)}});function Wo(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(Bs(e))}}class Go{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 Vo(){return new Go}const Yo=Vo();function Qo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Is(t)})}function Jo(e,t){return new Ri({check:"max_length",...Is(t),maximum:e})}function Xo(e,t){return new Ci({check:"min_length",...Is(t),minimum:e})}function ea(e,t){return new Ti({check:"length_equals",...Is(t),length:e})}function ta(e){return new Fi({check:"overwrite",tx:e})}function na(e){const t=function(e,t){const n=new $i({check:"custom",...Is(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Bs(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),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(Bs(r))}},e(n.value,n)));return t}const ra=hs("ZodISODateTime",(e,t)=>{no.init(e,t),Ca.init(e,t)});function sa(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Is(t)})}(ra,e)}const ia=hs("ZodISODate",(e,t)=>{ro.init(e,t),Ca.init(e,t)});function oa(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Is(t)})}(ia,e)}const aa=hs("ZodISOTime",(e,t)=>{so.init(e,t),Ca.init(e,t)});function ca(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Is(t)})}(aa,e)}const ua=hs("ZodISODuration",(e,t)=>{io.init(e,t),Ca.init(e,t)});function la(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Is(t)})}(ua,e)}const fa=(e,t)=>{Ks.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,vs,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vs,2)}},isEmpty:{get:()=>0===e.issues.length}})},pa=hs("ZodError",fa),ha=hs("ZodError",fa,{Parent:Error}),da=qs(ha),ga=Zs(ha),ma=Ws(ha),ya=Vs(ha),va=Qs(ha),_a=Js(ha),ba=Xs(ha),wa=ei(ha),Sa=ti(ha),Aa=ni(ha),ka=ri(ha),Ea=si(ha),xa=hs("ZodType",(e,t)=>(zi.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Es(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Ns(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>da(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ma(e,t,n),e.parseAsync=async(t,n)=>ga(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ya(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>va(e,t,n),e.decode=(t,n)=>_a(e,t,n),e.encodeAsync=async(t,n)=>ba(e,t,n),e.decodeAsync=async(t,n)=>wa(e,t,n),e.safeEncode=(t,n)=>Sa(e,t,n),e.safeDecode=(t,n)=>Aa(e,t,n),e.safeEncodeAsync=async(t,n)=>ka(e,t,n),e.safeDecodeAsync=async(t,n)=>Ea(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,...Is(n)})}(bc,e,t)}(t,n)),e.superRefine=t=>e.check(na(t)),e.overwrite=t=>e.check(ta(t)),e.optional=()=>lc(e),e.nullable=()=>pc(e),e.nullish=()=>lc(pc(e)),e.nonoptional=t=>function(e,t){return new gc({type:"nonoptional",innerType:e,...Is(t)})}(e,t),e.array=()=>tc(e),e.or=t=>sc([e,t]),e.and=t=>new ic({type:"intersection",left:e,right:t}),e.transform=t=>vc(e,new cc({type:"transform",transform:t})),e.default=t=>{return n=t,new hc({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ts(n)}});var n},e.prefault=t=>{return n=t,new dc({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ts(n)}});var n},e.catch=t=>{return new mc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>vc(e,t),e.readonly=()=>new _c({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Yo.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Yo.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Yo.get(e);const n=e.clone();return Yo.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Oa=hs("_ZodString",(e,t)=>{Ki.init(e,t),xa.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 Li({check:"string_format",format:"regex",...Is(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Di({check:"string_format",format:"includes",...Is(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Mi({check:"string_format",format:"starts_with",...Is(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new ji({check:"string_format",format:"ends_with",...Is(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Xo(...t)),e.max=(...t)=>e.check(Jo(...t)),e.length=(...t)=>e.check(ea(...t)),e.nonempty=(...t)=>e.check(Xo(1,...t)),e.lowercase=t=>e.check(function(e){return new Ni({check:"string_format",format:"lowercase",...Is(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ii({check:"string_format",format:"uppercase",...Is(e)})}(t)),e.trim=()=>e.check(ta(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ta(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ta(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ta(e=>e.toUpperCase()))}),$a=hs("ZodString",(e,t)=>{Ki.init(e,t),Oa.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Is(t)})}(Ta,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Is(t)})}(Na,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Is(t)})}(Va,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Is(t)})}(Ia,t)),e.guid=t=>e.check(Qo(Pa,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Is(t)})}(La,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Is(t)})}(La,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Is(t)})}(La,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Is(t)})}(La,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Is(t)})}(Da,t)),e.guid=t=>e.check(Qo(Pa,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Is(t)})}(Ma,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Is(t)})}(ja,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Is(t)})}(Fa,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Is(t)})}(Za,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Is(t)})}(Wa,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Is(t)})}(Ha,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Is(t)})}(Ba,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Is(t)})}(za,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Is(t)})}(Ka,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Is(t)})}(Ua,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Is(t)})}(qa,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Is(t)})}(Ga,t)),e.datetime=t=>e.check(sa(t)),e.date=t=>e.check(oa(t)),e.time=t=>e.check(ca(t)),e.duration=t=>e.check(la(t))});function Ra(e){return function(e,t){return new e({type:"string",...Is(t)})}($a,e)}const Ca=hs("ZodStringFormat",(e,t)=>{Ui.init(e,t),Oa.init(e,t)}),Ta=hs("ZodEmail",(e,t)=>{Wi.init(e,t),Ca.init(e,t)}),Pa=hs("ZodGUID",(e,t)=>{qi.init(e,t),Ca.init(e,t)}),La=hs("ZodUUID",(e,t)=>{Zi.init(e,t),Ca.init(e,t)}),Na=hs("ZodURL",(e,t)=>{Gi.init(e,t),Ca.init(e,t)}),Ia=hs("ZodEmoji",(e,t)=>{Vi.init(e,t),Ca.init(e,t)}),Da=hs("ZodNanoID",(e,t)=>{Yi.init(e,t),Ca.init(e,t)}),Ma=hs("ZodCUID",(e,t)=>{Qi.init(e,t),Ca.init(e,t)}),ja=hs("ZodCUID2",(e,t)=>{Ji.init(e,t),Ca.init(e,t)}),Fa=hs("ZodULID",(e,t)=>{Xi.init(e,t),Ca.init(e,t)}),Ha=hs("ZodXID",(e,t)=>{eo.init(e,t),Ca.init(e,t)}),Ba=hs("ZodKSUID",(e,t)=>{to.init(e,t),Ca.init(e,t)}),za=hs("ZodIPv4",(e,t)=>{oo.init(e,t),Ca.init(e,t)}),Ka=hs("ZodIPv6",(e,t)=>{ao.init(e,t),Ca.init(e,t)}),Ua=hs("ZodCIDRv4",(e,t)=>{co.init(e,t),Ca.init(e,t)}),qa=hs("ZodCIDRv6",(e,t)=>{uo.init(e,t),Ca.init(e,t)}),Za=hs("ZodBase64",(e,t)=>{fo.init(e,t),Ca.init(e,t)}),Wa=hs("ZodBase64URL",(e,t)=>{po.init(e,t),Ca.init(e,t)}),Ga=hs("ZodE164",(e,t)=>{ho.init(e,t),Ca.init(e,t)}),Va=hs("ZodJWT",(e,t)=>{go.init(e,t),Ca.init(e,t)}),Ya=hs("ZodUnknown",(e,t)=>{mo.init(e,t),xa.init(e,t)});function Qa(){return new Ya({type:"unknown"})}const Ja=hs("ZodNever",(e,t)=>{yo.init(e,t),xa.init(e,t)});function Xa(e){return function(e,t){return new e({type:"never",...Is(t)})}(Ja,e)}const ec=hs("ZodArray",(e,t)=>{_o.init(e,t),xa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Xo(t,n)),e.nonempty=t=>e.check(Xo(1,t)),e.max=(t,n)=>e.check(Jo(t,n)),e.length=(t,n)=>e.check(ea(t,n)),e.unwrap=()=>e.element});function tc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Is(n)})}(ec,e,t)}const nc=hs("ZodObject",(e,t)=>{ko.init(e,t),xa.init(e,t),As(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ac({type:"enum",entries:n,...Is(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:Qa()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qa()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Cs(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=Es(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return ks(this,"shape",n),n},checks:[]});return Ns(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Cs(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 ks(this,"shape",n),n},checks:e._zod.def.checks};return Ns(e,n)}(e,t),e.merge=t=>function(e,t){const n=Es(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ks(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ns(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ns(e,Es(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 ks(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Es(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 ks(this,"shape",r),r},checks:[]});return Ns(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Es(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 ks(this,"shape",s),s},checks:[]});return Ns(t,r)}(uc,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Es(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 ks(this,"shape",s),s},checks:[]});return Ns(t,r)}(gc,e,t[0])});const rc=hs("ZodUnion",(e,t)=>{xo.init(e,t),xa.init(e,t),e.options=t.options});function sc(e,t){return new rc({type:"union",options:e,...Is(t)})}const ic=hs("ZodIntersection",(e,t)=>{Oo.init(e,t),xa.init(e,t)});const oc=hs("ZodRecord",(e,t)=>{Co.init(e,t),xa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});const ac=hs("ZodEnum",(e,t)=>{To.init(e,t),xa.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 ac({...t,checks:[],...Is(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 ac({...t,checks:[],...Is(r),entries:s})}});const cc=hs("ZodTransform",(e,t)=>{Po.init(e,t),xa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new gs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Bs(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Bs(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});const uc=hs("ZodOptional",(e,t)=>{No.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new uc({type:"optional",innerType:e})}const fc=hs("ZodNullable",(e,t)=>{Io.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pc(e){return new fc({type:"nullable",innerType:e})}const hc=hs("ZodDefault",(e,t)=>{Do.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const dc=hs("ZodPrefault",(e,t)=>{jo.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const gc=hs("ZodNonOptional",(e,t)=>{Fo.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const mc=hs("ZodCatch",(e,t)=>{Bo.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const yc=hs("ZodPipe",(e,t)=>{zo.init(e,t),xa.init(e,t),e.in=t.in,e.out=t.out});function vc(e,t){return new yc({type:"pipe",in:e,out:t})}const _c=hs("ZodReadonly",(e,t)=>{Uo.init(e,t),xa.init(e,t),e.unwrap=()=>e._zod.def.innerType});const bc=hs("ZodCustom",(e,t)=>{Zo.init(e,t),xa.init(e,t)});const wc=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},Sc=(e,t)=>{const n=t?JSON.parse(e):ps.parse(e);return n&&"object"==typeof n?n:{}},Ac=tc(Ra()).default([]).optional(),kc=sc([Ra(),tc(Ra())]),Ec=(xc=Ra(),Oc=kc,new oc({type:"record",keyType:xc,valueType:Oc,...Is($c)})).optional();var xc,Oc,$c;const Rc=function(e,t){const n={type:"object",shape:e??{},...Is(t)};return new nc(n)}({stanPath:Ra().min(1,{message:"stanPath must be a non-empty string"}),includes:Ac,excludes:Ac,imports:Ec}).strict(),Cc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Rc.parse(e)}catch(e){throw new Error((e=>e instanceof pa?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))}},Tc=t=>{const n=le(t);if(!n)throw new Error("stan config not found");const r=e.readFileSync(n,"utf8"),s=Sc(r,n.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core")){throw new Error(`stan-core: missing "stan-core" section in ${n}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`)}const i=Cc(s["stan-core"]),o=wc(i.imports);return{stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Pc=async e=>{const n=le(e);if(!n)throw new Error("stan config not found");const r=n.replace(/\\/g,"/");return(async(e,n)=>{const r=await t.readFile(e,"utf8"),s=Sc(r,e.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core"))throw new Error(`stan-core: missing "stan-core" section in ${n??e}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`);const i=Cc(s["stan-core"]),o=wc(i.imports);return{stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}})(n,r)},Lc=(e,t)=>{const r=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const s=`${r}/system`,i=`${r}/output`,o=`${r}/diff`,a=`${r}/dist`,c=`${r}/patch`,u=`${r}/imports`;return{rootRel:r,systemRel:s,outputRel:i,diffRel:o,distRel:a,patchRel:c,importsRel:u,rootAbs:n.resolve(e,r),systemAbs:n.resolve(e,s),outputAbs:n.resolve(e,i),diffAbs:n.resolve(e,o),distAbs:n.resolve(e,a),patchAbs:n.resolve(e,c),importsAbs:n.resolve(e,u)}};var Nc={makeStanDirs:Lc},Ic=Object.freeze({__proto__:null,default:Nc,makeStanDirs:Lc});const Dc=async(e,r)=>{const s={};for(const i of r){const r=n.resolve(e,i),o=await t.readFile(r),a=c.createHash("sha256").update(o).digest("hex");s[i]=a}return s},Mc=e=>n.join(e,".archive.snapshot.json"),jc=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),Fc=e=>{if("string"!=typeof e||!e.trim())return null;const t=jc(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},Hc=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},Bc=/^###\s+Patch:\s+(.+?)\s*$/m,zc=/^###\s+Full Listing:\s+(.+?)\s*$/m,Kc=/^##\s+Commit Message\s*$/m,Uc=/^##\s+.*$|^###\s+.*$/m,qc=e=>{const t=[],n=[];{const t=new RegExp(Uc.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(Kc.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(Bc);if(a&&a[1]){t.push({kind:"patch",path:jc(a[1].trim()),start:s,body:o});continue}const c=o.match(zc);c&&c[1]&&t.push({kind:"full",path:jc(c[1].trim()),start:s,body:o})}return t},Zc=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:jc(r[1]),b:jc(r[2])});return n},Wc=e=>{const t=[];((e,t)=>{const n=Hc(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=>Fc(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=qc(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=Zc(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=jc("string"==typeof t.path?t.path:"(unknown)");e.set(n,t)}for(const n of r){const r=jc(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=Zc(t.body);if(n.length>0){const t=n[0]?.b,r="string"==typeof t?jc(t):"";r.length&&e.push(r)}else{const n=t.path?jc(t.path):"";n.length&&e.push(n)}}const n=e=>".stan/system/stan.todo.md"===jc(e),s=e=>{const t=jc(e);if(!t)return!1;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:[]}},Gc={extractBlocks:qc,parseDiffHeaders:Zc,isCommitLast:e=>{if(!e.match(Kc))return!1;const t=e.search(Kc);if(t<0)return!1;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return!1;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${String(s)}{'}}\\s*$`,"m");if(!n.match(i))return!1;const o=n.search(i);if(o<0)return!1;return 0===n.slice(o+s).trim().length}},Vc=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),Yc=e=>e.endsWith("\n")?e:e+"\n",Qc=/[\u200B-\u200D\uFEFF]/g,Jc=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)),Xc=e=>{const t=Vc(e).replace(Qc,"");return Yc(t)};function eu(e){return Array.isArray(e)?e.map(e=>eu(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((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 tu(e){return Array.isArray(e)?e.map(e=>tu(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 nu(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 ru(e,t,n){let r=!0,s=!1,i=!1,o=1;return function a(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,a())}}function su(e,t,n={}){let r;if(r="string"==typeof t?nu(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=eu(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=tu(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=!1,l=!1;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=!0:"-"==c[0]&&(l=!0)),c=t}if(u){if(l){if(!o&&""==r[r.length-1])return!1}else if(""==r[r.length-1])r.pop();else if(!o)return!1}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return!1;function f(e,t,n,s=0,o=!0,a=[],c=0){let u=0,l=!1;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,!1,a,c+1)):null;t++,u=0}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=!0}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,!1,a,c+1)||f(e,t+1,n-1,s,!1,a,c+1))||f(e,t,n-1,s+1,!1,a,c);c++,o=!0,l=!1,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=ru(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return!1;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 iu=async e=>{const t=n.dirname(e);try{await r.ensureDir(t)}catch{}},ou=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},au=e=>"string"==typeof e&&"/dev/null"===e.trim(),cu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),uu=e=>e.replace(/\n/g,"\r\n"),lu=async e=>{const{cwd:r,cleaned:s,check:i,sandboxRoot:o}=e;let a;try{a=nu(s)}catch{return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:o}}const c=a.some(e=>{const t=ou(e.oldFileName),n=ou(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!a.length||!c)return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:o};const u=[],l=[];for(const e of a){const s=ou(e.newFileName)??ou(e.oldFileName);if(!s){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const a=s.replace(/^[./]+/,""),c=n.resolve(r,a),f=/\.md$/i.test(a);let p="",h=!1,d=!0;try{const e=await t.readFile(c,"utf8");p=e,h=/\r\n/.test(e)}catch{d=!1}const g=au(e.oldFileName);if(!d&&!g){l.push({path:a,reason:"target file not found"});continue}let m;!d&&g&&(p="",h=!1);try{m=su(p,e,{compareLine:(e,t,n,r)=>cu(t)===cu(r),fuzzFactor:f?1:0})}catch{l.push({path:a,reason:"unable to parse or place hunk(s)"});continue}if(!1===m||"string"!=typeof m){l.push({path:a,reason:"unable to place hunk(s)"});continue}const y=h?uu(m.replace(/\r/g,"")):m.replace(/\r/g,"");try{if(i){const e=o??n.join(r,".stan","patch",".sandbox"),s=n.resolve(e,a);await iu(s),await t.writeFile(s,y,"utf8")}else{try{await iu(c)}catch{}await t.writeFile(c,y,"utf8")}u.push(a)}catch{l.push({path:a,reason:"write failed"})}}return{okFiles:u,failed:l,sandboxRoot:o}};var fu,pu={},hu={},du={};function gu(){if(fu)return du;return fu=1,Object.defineProperty(du,"__esModule",{value:!0}),du.splitWhen=du.flatten=void 0,du.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},du.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},du}var mu,yu={};function vu(){if(mu)return yu;return mu=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.isEnoentCodeError=void 0,yu.isEnoentCodeError=function(e){return"ENOENT"===e.code},yu}var _u,bu={};var wu,Su={};function Au(){if(wu)return Su;wu=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.convertPosixPathToPattern=Su.convertWindowsPathToPattern=Su.convertPathToPattern=Su.escapePosixPath=Su.escapeWindowsPath=Su.escape=Su.removeLeadingDotSegment=Su.makeAbsolute=Su.unixify=void 0;const e=f,t="win32"===l.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 Su.unixify=function(e){return e.replace(/\\/g,"/")},Su.makeAbsolute=function(t,n){return e.resolve(t,n)},Su.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Su.escape=t?o:a,Su.escapeWindowsPath=o,Su.escapePosixPath=a,Su.convertPathToPattern=t?c:u,Su.convertWindowsPathToPattern=c,Su.convertPosixPathToPattern=u,Su}var ku,Eu,xu,Ou,$u,Ru,Cu={};function Tu(){return Eu?ku:(Eu=1,ku=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1})}function Pu(){if(Ou)return xu;Ou=1;var e=Tu(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return!0;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return!0;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return!0;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return!0;if(-1===(a=e.indexOf("\\",n))||a>s)return!0}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return!0;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!0;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!0;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!0}else n++}return!1},r=function(e){if("!"===e[0])return!0;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return!0;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!0}else n++}return!1};return xu=function(t,s){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var i=n;return s&&!1===s.strict&&(i=r),i(t)}}var Lu,Nu,Iu,Du,Mu,ju,Fu,Hu,Bu,zu,Ku,Uu,qu,Zu,Wu,Gu,Vu,Yu,Qu,Ju={};function Xu(){return Lu||(Lu=1,function(e){e.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)=>!1!==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)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges|0)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges|0?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===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}}(Ju)),Ju}function el(){if(Iu)return Nu;Iu=1;const e=Xu();return Nu=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=!0===t.invalid&&!0===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 tl(){return Mu?Du:(Mu=1,Du=function(e){return"number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function nl(){if(Fu)return ju;Fu=1;const e=tl(),t=(n,i,o)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===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})`:!1===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],g=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){g=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0}return l>=0&&(d=r(u,l,h,a)),h.negatives=g,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",!1)||[],r=s(t,e,"",!1)||[],i=s(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(g,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++}return o&&(i+=!0===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=!1!==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={},ju=t}function rl(){if(Bu)return Hu;Bu=1;const e=p,t=nl(),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!1;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!1===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:!1,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=!0===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(!0===n.strictRanges)throw l([e,t]);return[]},h=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),g=String(n);n=Math.max(Math.abs(n),1);let m=i(h)||i(d)||i(g),y=m?Math.max(h.length,d.length,g.length):0,v=!1===m&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),_=r.transform||(e=>t=>!0===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),!0,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;)!0===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return!0===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:!1,...r}):S},d=(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 d(e,t,1,{transform:i});if(n(i))return d(e,t,0,i);let a={...o};return!0===a.capture&&(a.wrap=!0),i=i||a.step||1,s(i)?s(e)&&s(t)?h(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,!1,r);let d=[],g=0;for(;l?o>=a:o<=a;)d.push(i(o,g)),o=l?o-n:o+n,g++;return!0===r.toRegex?u(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?d(e,t,1,i):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(i,a)};return Hu=d}function sl(){if(Vu)return Gu;Vu=1;const e=el(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=Wu?Zu:(Wu=1,Zu={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 Gu=(m,y={})=>{if("string"!=typeof m)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(m.length>_)throw new SyntaxError(`Input length (${m.length}), exceeds max characters (${_})`);const b={type:"root",input:m,nodes:[]},w=[b];let S=b,A=b,k=0;const E=m.length;let x,O=0,$=0;const R=()=>m[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!==g&&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(!0!==y.keepQuotes&&(x="");O<E&&(t=R());)if(t!==n){if(t===e){!0===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)||!0===S.dollar;S=C({type:"brace",open:!0,close:!1,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=!0,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=!0,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=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});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 il(){if(Qu)return Yu;Qu=1;const e=el(),t=function(){if(Ku)return zu;Ku=1;const e=rl(),t=Xu();return zu=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=!0===n.invalid&&!0===r.escapeInvalid,c=!0===o||!0===a,u=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return u+n.value;if(!0===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:!1,toRegex:!0,strictZeros:!0});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(qu)return Uu;qu=1;const e=rl(),t=el(),n=Xu(),r=(e="",t="",s=!1)=>{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)!0===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return Uu=(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&&!0!==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))},Uu}(),r=sl(),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&&!0===t.expand&&!0===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!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?s.compile(e,t):s.expand(e,t),Yu=s}var ol,al,cl,ul,ll,fl,pl,hl,dl,gl,ml,yl,vl,_l,bl={};function wl(){if(al)return ol;al=1;const e=f,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 ol={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=>!0===e?l:u}}function Sl(){return cl||(cl=1,function(e){const t=f,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=wl();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:!0===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!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(bl)),bl}function Al(){if(dl)return hl;dl=1;const e=f,t=function(){if(ll)return ul;ll=1;const e=Sl(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=wl(),m=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return ul=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,D=!1,M=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(!0===M||O===c){for(z++;!0!==U()&&(O=Z());)if(O!==r)if(O!==c){if(!0!==M&&O===i&&(O=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==M&&O===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===h&&(z--,0===z)){M=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(O!==a){if(!0!==b.noext&&!0==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,O===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(O===t){if(x===t&&(D=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if(O===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===g){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||O!==o||R!==C){if(!0!==b.noparen&&O===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&(O=Z());)if(O!==u){if(O===d){B=!0;break}}else j=K.backslashes=!0,O=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,O=Z(),O===c&&(M=!0)}!0===b.noext&&(I=!1,N=!1);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&!0===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):!0===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===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:D,negated:F,negatedExtglob:H};if(!0===b.tokens&&(Y.maxDepth=0,m(O)||k.push(K),Y.tokens=k),!0===b.parts||!0===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=!0,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},ul}(),n=function(){if(pl)return fl;pl=1;const e=wl(),t=Sl(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:p.prepend||""},m=[g],y=p.capture?"":"?:",v=t.isWindows(f),_=e.globChars(v),b=e.extglobChars(_),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH: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 D=!0===p.bash?L(p):T;p.capture&&(D=`(${D})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=t.removePrefix(l,M),d=l.length;const j=[],F=[],H=[];let B,z=g;const K=()=>M.index===d-1,U=M.peek=(e=1)=>l[M.index+e],q=M.advance=()=>l[++M.index]||"",Z=()=>l.slice(M.index+1),W=(e="",t=0)=>{M.consumed+=e,M.index+=t},G=e=>{M.output+=null!=e.output?e.output:e.value,W(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},Y=e=>{M[e]++,H.push(e)},Q=e=>{M[e]--,H.pop()},J=e=>{if("globstar"===z.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=D,M.output+=z.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&G(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,m.push(e),z=e},X=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=z,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:M.output?"":k}),J({type:"paren",extglob:!0,value:q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=D;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(p)),(r!==D||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(M.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:B,output:n}),Q("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,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?D:""):D:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&!0!==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,M.index+=n,n%2!=0&&(B+="\\")),!0===p.unescape?B=q():B+=q(),0===M.brackets){J({type:"text",value:B});continue}}if(M.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(!1!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=!0,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,M.backtrack=!0,q(),g.output||1!==m.indexOf(z)||(g.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),!0===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,G({value:B});continue}if(1===M.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,G({value:B});continue}if('"'===B){M.quotes=1===M.quotes?0:1,!0===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===M.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&M.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:M.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(!0!==p.nobracket&&Z().includes("]"))Y("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`}J({type:"bracket",value:B});continue}if("]"===B){if(!0===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===M.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(!0===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(M.output=M.output.slice(0,-z.value.length),!0===p.literalBrackets){M.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,M.output+=z.value;continue}if("{"===B&&!0!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};F.push(e),J(e);continue}if("}"===B){const e=F[F.length-1];if(!0===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(!0===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value}J({type:"brace",value:B,output:t}),Q("braces"),F.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=F[F.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",m.pop(),z=g;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(M.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=F[F.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=!0;continue}if(M.braces+M.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)&&!0!==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(!0!==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(!0!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(!0!==p.nonegate&&0===M.index){V();continue}}if("+"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||!1===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||M.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:!0,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],M.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||!0===z.star)){z.type="star",z.star=!0,z.value+=B,z.output=D,M.backtrack=!0,M.globstar=!0,W(B);continue}let e=Z();if(!0!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(!0===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(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=M.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[M.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),M.output=z.output,M.globstar=!0,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){M.output=M.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=L(p)+(p.strictSlashes?")":"|$)"),z.value+=B,M.globstar=!0,M.output+=t.output+z.output,W(B);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+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${L(p)}${A}|${A}${n})`,z.value+=B,M.output+=t.output+z.output,M.globstar=!0,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})`,M.output=z.output,M.globstar=!0,W(B+q()),J({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-z.output.length),z.type="globstar",z.output=L(p),z.value+=B,M.output+=z.output,M.globstar=!0,W(B);continue}const n={type:"star",value:B,output:D};!0!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||!0!==p.regex?(M.index!==M.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(M.output+=O,z.output+=O):!0===p.dot?(M.output+=$,z.output+=$):(M.output+=N,z.output+=N),"*"!==U()&&(M.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(;M.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Q("brackets")}for(;M.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Q("parens")}for(;M.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Q("braces")}if(!0===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),!0===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 u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?g:d,b=i.dot?m:d,w=i.capture?"":"?:";let S=!0===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>!0===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:!1,prefix:""});let x=k(E);return x&&!0!==i.strictSlashes&&(x+=`${f}?`),x},fl=u}(),r=Sl(),s=wl(),i=(e,t,n=!1)=>{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!1};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,!1,!0),l=u.state;delete u.state;let f=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n)}const p=(n,r=!1)=>{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),!1===s?(h.isMatch=!1,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!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:!1,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===s),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===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:!1}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return!0===r&&(u.state=e),u},i.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===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&&!0===t.debug)throw e;return/$^/}},i.constants=s,hl=i}function kl(){return ml?gl:(ml=1,gl=Al())}function El(){if(_l)return Cu;_l=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.isAbsolute=Cu.partitionAbsoluteAndRelative=Cu.removeDuplicateSlashes=Cu.matchAny=Cu.convertPatternsToRe=Cu.makeRe=Cu.getPatternParts=Cu.expandBraceExpansion=Cu.expandPatternsWithBraceExpansion=Cu.isAffectDepthOfReadingPattern=Cu.endsWithSlashGlobStar=Cu.hasGlobStar=Cu.getBaseDirectory=Cu.isPatternRelatedToParentDirectory=Cu.getPatternsOutsideCurrentDirectory=Cu.getPatternsInsideCurrentDirectory=Cu.getPositivePatterns=Cu.getNegativePatterns=Cu.isPositivePattern=Cu.isNegativePattern=Cu.convertToNegativePattern=Cu.convertToPositivePattern=Cu.isDynamicPattern=Cu.isStaticPattern=void 0;const e=f,t=function(){if(Ru)return $u;Ru=1;var e=Pu(),t=f.posix.dirname,n="win32"===l.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return $u=function(a,c){Object.assign({flipBackslashes:!0},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(vl)return yl;vl=1;const e=p,t=il(),n=kl(),r=Sl(),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},!0),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,!0);(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(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===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!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return o.isMatch(t,n,{...r,contains:!0})},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!0}return!1},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!1}return!0},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:!0}).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&&!0===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:!0})},o.hasBraces=i,yl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return!h(e,t)}function h(e,t={}){return""!==e&&(!(!1!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(!1===t.extglob||!o.test(e))||!(!1===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return!1;const n=e.indexOf("}",t+1);if(-1===n)return!1;const r=e.slice(t,n);return a.test(r)}(e)))))}function d(e){return e.startsWith("!")&&"("!==e[1]}function g(e){return!d(e)}function m(e){return e.startsWith("..")||e.startsWith("./..")}function y(e){return e.endsWith("/**")}function v(e){const t=n.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function _(e,t){return n.makeRe(e,t)}function b(t){return e.isAbsolute(t)}return Cu.isStaticPattern=u,Cu.isDynamicPattern=h,Cu.convertToPositivePattern=function(e){return d(e)?e.slice(1):e},Cu.convertToNegativePattern=function(e){return"!"+e},Cu.isNegativePattern=d,Cu.isPositivePattern=g,Cu.getNegativePatterns=function(e){return e.filter(d)},Cu.getPositivePatterns=function(e){return e.filter(g)},Cu.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!m(e))},Cu.getPatternsOutsideCurrentDirectory=function(e){return e.filter(m)},Cu.isPatternRelatedToParentDirectory=m,Cu.getBaseDirectory=function(e){return t(e,{flipBackslashes:!1})},Cu.hasGlobStar=function(e){return e.includes("**")},Cu.endsWithSlashGlobStar=y,Cu.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return y(t)||u(n)},Cu.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(v(t)),[])},Cu.expandBraceExpansion=v,Cu.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},Cu.makeRe=_,Cu.convertPatternsToRe=function(e,t){return e.map(e=>_(e,t))},Cu.matchAny=function(e,t){return t.some(t=>t.test(e))},Cu.removeDuplicateSlashes=function(e){return e.replace(c,"/")},Cu.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)b(r)?t.push(r):n.push(r);return[t,n]},Cu.isAbsolute=b,Cu}var xl,Ol,$l,Rl={};function Cl(){if(Ol)return xl;Ol=1;const e=h.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 xl=function(){const r=[],s=t.call(arguments);let i=!1,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=!1!==o.end,c=!0===o.pipeError;null==o.objectMode&&(o.objectMode=!0);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=!0;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=!1,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:!1}),e.resume()}for(let t=0;t<e.length;t++)s(e[t]);n()}function p(){i=!1,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},xl}var Tl,Pl,Ll,Nl={};function Il(){if(Tl)return Nl;return Tl=1,Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.isEmpty=Nl.isString=void 0,Nl.isString=function(e){return"string"==typeof e},Nl.isEmpty=function(e){return""===e},Nl}function Dl(){if(Pl)return hu;Pl=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.string=hu.stream=hu.pattern=hu.path=hu.fs=hu.errno=hu.array=void 0;const e=gu();hu.array=e;const t=vu();hu.errno=t;const n=function(){if(_u)return bu;_u=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.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 bu.createDirentFromStats=function(t,n){return new e(t,n)},bu}();hu.fs=n;const r=Au();hu.path=r;const s=El();hu.pattern=s;const i=function(){if($l)return Rl;$l=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.merge=void 0;const e=Cl();function t(e){e.forEach(e=>e.emit("close"))}return Rl.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},Rl}();hu.stream=i;const o=Il();return hu.string=o,hu}var Ml,jl={},Fl={},Hl={},Bl={},zl={},Kl={},Ul={},ql={},Zl={};function Wl(){if(Ml)return Zl;function e(e,t){e(t)}function t(e,t){e(null,t)}return Ml=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.read=void 0,Zl.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=()=>!0),t(s,i)}):t(s,o):e(s,i)})},Zl}var Gl,Vl={};var Yl,Ql,Jl,Xl,ef,tf,nf,rf={},sf={};function of(){if(Ql)return rf;Ql=1,Object.defineProperty(rf,"__esModule",{value:!0});const e=(Yl||(Yl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=g;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)}}(sf)),sf);return rf.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return null!=e?e:t}},rf}function af(){if(Jl)return ql;Jl=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.statSync=ql.stat=ql.Settings=void 0;const e=Wl(),t=(Gl||(Gl=1,Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.read=void 0,Vl.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}}),Vl),n=of();function r(e={}){return e instanceof n.default?e:new n.default(e)}return ql.Settings=n.default,ql.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},ql.statSync=function(e,n){const s=r(n);return t.read(e,s)},ql}function cf(){if(ef)return Xl;let e;return ef=1,Xl="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:$):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var uf,lf={};function ff(){if(uf)return lf;uf=1,Object.defineProperty(lf,"__esModule",{value:!0}),lf.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 lf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,lf}var pf,hf,df={},gf={};function mf(){if(hf)return df;hf=1,Object.defineProperty(df,"__esModule",{value:!0}),df.fs=void 0;const e=function(){if(pf)return gf;pf=1,Object.defineProperty(gf,"__esModule",{value:!0}),gf.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 gf.createDirentFromStats=function(t,n){return new e(t,n)},gf}();return df.fs=e,df}var yf,vf,_f={};function bf(){if(yf)return _f;return yf=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.joinPathSegments=void 0,_f.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},_f}function wf(){if(vf)return Ul;vf=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.readdir=Ul.readdirWithFileTypes=Ul.read=void 0;const e=af(),t=function(){if(nf)return tf;nf=1,tf=function(t,n){let r,s,i,o=!0;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=!1};const e=cf();return tf}(),n=ff(),r=mf(),s=bf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:!0},(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 Ul.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r)},Ul.readdirWithFileTypes=i,Ul.readdir=o,Ul}var Sf,Af={};var kf,Ef,xf,Of={},$f={};function Rf(){return kf||(kf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=g;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)}}($f)),$f}function Cf(){if(xf)return Kl;xf=1,Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.Settings=Kl.scandirSync=Kl.scandir=void 0;const e=wf(),t=function(){if(Sf)return Af;Sf=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.readdir=Af.readdirWithFileTypes=Af.read=void 0;const e=af(),t=ff(),n=mf(),r=bf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).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 Af.read=function(e,n){return!n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Af.readdirWithFileTypes=s,Af.readdir=i,Af}(),n=function(){if(Ef)return Of;Ef=1,Object.defineProperty(Of,"__esModule",{value:!0});const e=f,t=af(),n=Rf();return Of.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},Of}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return Kl.Settings=n.default,Kl.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},Kl.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},Kl}var Tf,Pf,Lf,Nf={exports:{}};function If(){if(Lf)return Nf.exports;Lf=1;var e=Pf?Tf:(Pf=1,Tf=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=!0},paused:!1,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=!1,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 Nf.exports=t,Nf.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(){return 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}}})})},i},Nf.exports}var Df,Mf={};function jf(){if(Df)return Mf;return Df=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.joinPathSegments=Mf.replacePathSegmentSeparator=Mf.isAppliedFilter=Mf.isFatalError=void 0,Mf.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},Mf.isAppliedFilter=function(e,t){return null===e||e(t)},Mf.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},Mf.joinPathSegments=function(e,t,n){return""===e?t:e.endsWith(n)?e+t:e+n+t},Mf}var Ff,Hf,Bf,zf={};function Kf(){if(Ff)return zf;Ff=1,Object.defineProperty(zf,"__esModule",{value:!0});const e=jf();return zf.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator)}},zf}function Uf(){if(Hf)return zl;Hf=1,Object.defineProperty(zl,"__esModule",{value:!0});const e=d,t=Cf(),n=If(),r=jf(),s=Kf();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=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,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=!0,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=!0,this._isDestroyed=!0,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 zl.default=i,zl}var qf,Zf={};var Wf,Gf,Vf={},Yf={};function Qf(){if(Gf)return Vf;Gf=1,Object.defineProperty(Vf,"__esModule",{value:!0});const e=function(){if(Wf)return Yf;Wf=1,Object.defineProperty(Yf,"__esModule",{value:!0});const e=Cf(),t=jf(),n=Kf();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 Yf.default=r,Yf}();return Vf.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()}},Vf}var Jf,Xf,ep={};function tp(){if(Xf)return Hl;Xf=1,Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.Settings=Hl.walkStream=Hl.walkSync=Hl.walk=void 0;const e=function(){if(Bf)return Bl;Bf=1,Object.defineProperty(Bl,"__esModule",{value:!0});const e=Uf();return Bl.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()}},Bl}(),t=function(){if(qf)return Zf;qf=1,Object.defineProperty(Zf,"__esModule",{value:!0});const e=h,t=Uf();return Zf.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:!0,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}},Zf}(),n=Qf(),r=function(){if(Jf)return ep;Jf=1,Object.defineProperty(ep,"__esModule",{value:!0});const e=f,t=Cf();return ep.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.fsScandirSettings=new t.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},ep}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return Hl.Settings=r.default,Hl.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n)},Hl.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},Hl.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},Hl}var np,rp={};function sp(){if(np)return rp;np=1,Object.defineProperty(rp,"__esModule",{value:!0});const e=f,t=af(),n=Dl();return rp.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}},rp}var ip,op,ap={};function cp(){if(ip)return ap;ip=1,Object.defineProperty(ap,"__esModule",{value:!0});const e=h,t=af(),n=tp(),r=sp();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:!0});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 ap.default=s,ap}var up,lp,fp,pp={},hp={},dp={},gp={};function mp(){if(lp)return dp;lp=1,Object.defineProperty(dp,"__esModule",{value:!0});const e=function(){if(up)return gp;up=1,Object.defineProperty(gp,"__esModule",{value:!0});const e=Dl();return gp.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:!0,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:!1,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},gp}();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!0;if(t.every((t,n)=>{const r=e.segments[n];return!(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return!0}return!1}}return dp.default=t,dp}var yp,vp={};var _p,bp={};var wp,Sp,Ap,kp={};function Ep(){if(Sp)return pp;Sp=1,Object.defineProperty(pp,"__esModule",{value:!0});const e=f,t=function(){if(fp)return hp;fp=1,Object.defineProperty(hp,"__esModule",{value:!0});const e=Dl(),t=mp();return hp.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!1;if(this._isSkippedSymbolicLink(n))return!1;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)}},hp}(),n=function(){if(yp)return vp;yp=1,Object.defineProperty(vp,"__esModule",{value:!0});const e=Dl();return vp.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:!0})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;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!1;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return!1;const s=e.pattern.matchAny(t,n);return!s&&r?e.pattern.matchAny(t+"/",n):s}},vp}(),r=function(){if(_p)return bp;_p=1,Object.defineProperty(bp,"__esModule",{value:!0});const e=Dl();return bp.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},bp}(),s=function(){if(wp)return kp;wp=1,Object.defineProperty(kp,"__esModule",{value:!0});const e=Dl();return kp.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}},kp}();return pp.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:!0,strictSlashes:!1}}},pp}function xp(){if(Ap)return jl;Ap=1,Object.defineProperty(jl,"__esModule",{value:!0});const e=function(){if(op)return Fl;op=1,Object.defineProperty(Fl,"__esModule",{value:!0});const e=tp(),t=sp(),n=cp();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 Fl.default=r,Fl}(),t=Ep();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 jl.default=n,jl}var Op,$p={};var Rp,Cp,Tp={},Pp={};function Lp(){if(Cp)return Tp;Cp=1,Object.defineProperty(Tp,"__esModule",{value:!0});const e=function(){if(Rp)return Pp;Rp=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=af(),t=tp(),n=sp();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 Pp.default=r,Pp}(),t=Ep();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 Tp.default=n,Tp}var Np,Ip,Dp,Mp={};var jp,Fp,Hp=function(){if(Dp)return Ip;Dp=1;const e=function(){if(Ll)return pu;Ll=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.convertPatternGroupToTask=pu.convertPatternGroupsToTasks=pu.groupPatternsByBaseDirectory=pu.getNegativePatternsAsPositive=pu.getPositivePatterns=pu.convertPatternsToTasks=pu.generate=void 0;const e=Dl();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 pu.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,!1),d=n(p,l,!0);return h.concat(d)},pu.convertPatternsToTasks=n,pu.getPositivePatterns=r,pu.getNegativePatternsAsPositive=s,pu.groupPatternsByBaseDirectory=i,pu.convertPatternGroupsToTasks=o,pu.convertPatternGroupToTask=a,pu}(),t=xp(),n=function(){if(Op)return $p;Op=1,Object.defineProperty($p,"__esModule",{value:!0});const e=h,t=cp(),n=Ep();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:!0,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 $p.default=r,$p}(),r=Lp(),s=(Np||(Np=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=g,n=l,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,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),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,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),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)}}}(Mp)),Mp),i=Dl();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i.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.string.isString(e)&&!i.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.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i.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.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i.path.convertWindowsPathToPattern(e)}}(o||(o={})),Ip=o}(),Bp=R(Hp);var zp=function(){if(Fp)return jp;Fp=1;var e=Pu(),t=f.posix.dirname,n="win32"===l.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return!!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return jp=function(e,a){Object.assign({flipBackslashes:!0},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!1}var n=e.indexOf(t);if(n<0)return!1;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")}}(),Kp=R(zp);const Up=e=>""!==e&&".."!==e,qp=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(!Up(e))return null;return t.join("/")},Zp=async e=>{try{return(await t.stat(e)).isFile()}catch{return!1}},Wp=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),Gp=e=>{const t=Wp(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=Wp(t);return e===n||e.startsWith(n+"/")})(Wp(e),t):()=>!1;var n;const r=J(t,{dot:!0});return e=>r(Wp(e))};const Vp="0.4.2";exports.CORE_VERSION=Vp,exports.DEFAULT_OPEN_COMMAND="code -g {file}",exports.DEFAULT_STAN_PATH=ie,exports.__internal=Gc,exports.applyPatchPipeline=async e=>{const{cwd:r,patchAbs:s,cleaned:i,check:o,stripOrder:a=[1,0]}=e,c=a.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()}`}]})(o,e)),l=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=u.spawn("git",["apply",...o.args,t],{cwd:e,shell:!1,windowsHide:!0});let a="",c="";const l=s;l.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t)}),l.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:!0,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${String(n)})`)}return{ok:!1,tried:s,lastCode:1,captures:i}})(r,s,c);if(l.ok)return{ok:!0,result:l,js:null};const f=await lu({cwd:r,cleaned:i,check:o});if(f.okFiles.length>0&&0===f.failed.length)return{ok:!0,result:l,js:f};try{const e=await(async(e,r,s)=>{const i=r.replace(/\r\n/g,"\n").split("\n");let o=-1,a=null;for(let e=0;e<i.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(i[e])){const t=i[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){o=e+1,a=t[1].trim().replace(/^[./]+/,"");break}}if(!a||!a.length)return null;const c=i.slice(o+1).join("\n");if(/^---\s+\/dev\/null/m.test(c))return null;const u=[];let l=!1;for(let e=o+1;e<i.length;e+=1){const t=i[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||u.push(t.slice(1))}}let f=u.join("\n");f.endsWith("\n")||(f+="\n");const p=s?n.join(e,".stan","patch",".sandbox","F"):e,h=n.resolve(p,a);return await t.mkdir(n.dirname(h),{recursive:!0}),await t.writeFile(h,f,"utf8"),{okFiles:[a],failed:[],sandboxRoot:s?p:void 0}})(r,i,o);if(e)return{ok:!0,result:l,js:e}}catch{}return{ok:!1,result:l,js:f}},exports.applyWithJsDiff=lu,exports.assembleSystemMonolith=async(s,i)=>{const o=n.join(s,i,"system"),a=n.join(o,"parts"),c=n.join(o,"stan.system.md");if(await r.ensureDir(o),!e.existsSync(a))return{target:c,action:"skipped-no-parts",partsDir:a};const u=(await t.readdir(a,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));if(0===u.length)return{target:c,action:"skipped-no-md",partsDir:a};const l=[];for(const e of u){const r=n.join(a,e),s=Vc(await t.readFile(r,"utf8")).trimEnd();l.push(s)}const f=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(i)+l.join("\n\n")+"\n";return await t.writeFile(c,f,"utf8"),{target:c,action:"written"}},exports.createArchive=async(r,s,i={})=>{const{includeOutputDir:o=!1,fileName:a,includes:c=[],excludes:u=[],anchors:l=[]}=i;let f=a??"archive.tar";f.endsWith(".tar")||(f+=".tar");const{outDir:p,diffDir:h}=await se(r,s),d=await X(r),g=await ne(d,{cwd:r,stanPath:s,includeOutputDir:o,includes:c,excludes:u,anchors:l}),m=n.resolve(p,f),y=n.resolve(h,v);if(e.existsSync(m))try{await t.copyFile(m,y)}catch{}const{textFiles:_,warningsBody:b}=await O(r,g),w=_;E(b,i.onArchiveWarnings);const S=await Promise.resolve().then(function(){return require("./index-C_cc6L9q.js")});if(o?await S.create({file:m,cwd:r,filter:A(s)},k(w,s)):await S.create({file:m,cwd:r,filter:A(s)},w),!e.existsSync(y))try{await t.copyFile(m,y)}catch{}return m},exports.createArchiveDiff=async({cwd:r,stanPath:s,baseName:i,includes:o,excludes:a,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=!1,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:h}=await se(r,s),d=await X(r),g=await ne(d,{cwd:r,stanPath:s,includeOutputDir:!1,includes:o??[],excludes:a??[],anchors:l??[]}),m=await Dc(r,g),y=Mc(h),v=e.existsSync(y),_=v?JSON.parse(await t.readFile(y,"utf8")):{},b=v?g.filter(e=>!_[e]||_[e]!==m[e]):[...g],{textFiles:w,warningsBody:S}=await O(r,b),x=w;E(S,f);const $=n.join(p,`${i}.diff.tar`),R=await Promise.resolve().then(function(){return require("./index-C_cc6L9q.js")});if(u)await R.create({file:$,cwd:r,filter:A(s)},k(x,s));else if(0===x.length){const e=(e=>n.join(e,".stan_no_changes"))(h);await t.writeFile(e,"no changes","utf8");const i=[`${s.replace(/\\/g,"/")}/diff/.stan_no_changes`];await R.create({file:$,cwd:r},i)}else{const e=Array.from(new Set([...x]));await R.create({file:$,cwd:r},e)}return"replace"===c?await t.writeFile(y,JSON.stringify(m,null,2),"utf8"):"createIfMissing"!==c||v||await t.writeFile(y,JSON.stringify(m,null,2),"utf8"),{diffPath:$}},exports.detectAndCleanPatch=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})(Xc(e.trim())),n=Xc(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(Jc(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 Yc(r?Xc(r).trimEnd():n)},exports.ensureOutputDir=async(r,s,i=!1)=>{const o=Lc(r,s);if(await re(r,s),!i){const r=n.resolve(o.outputAbs,y);if(e.existsSync(r))try{await t.copyFile(r,n.resolve(o.diffAbs,v))}catch{}const s=await t.readdir(o.outputAbs,{withFileTypes:!0});for(const t of s)e.rmSync(n.resolve(o.outputAbs,t.name),{recursive:!0,force:!0})}return o.rootAbs},exports.executeFileOps=async(e,s,i=!1)=>{const o=[],a=t=>((e,t)=>{const r=n.resolve(e,t),s=n.resolve(e)+n.sep,i=r===n.resolve(e)||r.startsWith(s);return{abs:r,ok:i}})(e,t);for(const e of s){const s={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:s}=a(e.src),{abs:o,ok:c}=a(e.dest);if(!s||!c)throw new Error("path escapes repo root");const u=await r.pathExists(t),l=await r.pathExists(o);if(!u)throw new Error("source does not exist");if(l)throw new Error("destination exists (no overwrite)");i||(await r.ensureDir(n.dirname(o)),await r.move(t,o,{overwrite:!1}))}else if("rm"===e.verb){const{abs:t,ok:n}=a(e.src);if(!n)throw new Error("path escapes repo root");if(!await r.pathExists(t))throw new Error("path does not exist");i||await r.remove(t)}else if("rmdir"===e.verb){const{abs:n,ok:s}=a(e.src);if(!s)throw new Error("path escapes repo root");let o=null;try{o=await t.stat(n)}catch{o=null}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await t.readdir(n)).length>0)throw new Error("directory not empty");i||await r.remove(n)}else{const{abs:t,ok:n}=a(e.src);if(!n)throw new Error("path escapes repo root");i||await r.ensureDir(t)}s.status="ok"}catch(e){s.status="failed";const t=e instanceof Error?e.message:String(e);s.message=t}if(o.push(s),"failed"===s.status&&!i)break}return{ok:o.every(e=>"ok"===e.status),results:o}},exports.findConfigPathSync=le,exports.getPackagedSystemPromptPath=()=>{const t=(()=>{try{const e=i.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("index.js",document.baseURI).href);return ae({cwd:n.dirname(e)})??null}catch{return null}})();if(!t)return null;const r=n.join(t,"dist","stan.system.md");return e.existsSync(r)?r:null},exports.loadConfig=Pc,exports.loadConfigSync=Tc,exports.makeGlobMatcher=e=>{const t=e.map(Gp);return 0===t.length?()=>!1:e=>{const n=Wp(e);for(const e of t)if(e(n))return!0;return!1}},exports.parseFileOpsBlock=e=>{const t=[],n=[],r=Hc(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=>Fc(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}},exports.prepareImports=async e=>{const{cwd:s,stanPath:i,map:o,onStage:a}=e;if(!o||"object"!=typeof o)return;const c=Lc(s,i),u=n.join(c.rootAbs,"imports");await r.ensureDir(u);const l=Object.keys(o).sort();for(const e of l){const i=o[e]??[];if(!Array.isArray(i)||0===i.length)continue;const c=qp(e);if(!c)continue;const l=n.join(u,c);await t.rm(l,{recursive:!0,force:!0}).catch(()=>{}),await r.ensureDir(l).catch(()=>{});const f=[];for(const e of i){const i=e.trim();if(!i)continue;const o=Kp(i.replace(/\\/g,"/"));try{const e=await Bp(i,{cwd:s,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const i of e){if(!await Zp(i))continue;const e=n.relative(n.isAbsolute(o)?o:n.resolve(s,o),i).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const a=n.join(l,e);await r.ensureDir(n.dirname(a)).catch(()=>{});try{await t.copyFile(i,a),f.push(a)}catch{}}}catch{}}try{if("function"==typeof a){a(c,f.map(e=>n.relative(s,e).replace(/\\/g,"/")))}}catch{}}},exports.resolveStanPath=async e=>{try{return(await Pc(e)).stanPath}catch{return ie}},exports.resolveStanPathSync=e=>{try{return Tc(e).stanPath}catch{return ie}},exports.validateOrThrow=e=>{const t=Wc(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},exports.validateResponseMessage=Wc,exports.writeArchiveSnapshot=async({cwd:e,stanPath:n,includes:r,excludes:s,anchors:i})=>{const{diffDir:o}=await se(e,n),a=await X(e),c=await ne(a,{cwd:e,stanPath:n,includeOutputDir:!1,includes:r??[],excludes:s??[],anchors:i??[]}),u=await Dc(e,c),l=Mc(o);return await t.writeFile(l,JSON.stringify(u,null,2),"utf8"),l};