1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/.yarn/releases/yarn-3.8.3.cjs

876 lines
2.1 MiB
JavaScript
Raw Normal View History

2024-10-01 04:19:50 +02:00
#!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
2024-10-01 04:49:34 +02:00
(()=>{var Lge=Object.create;var lS=Object.defineProperty;var Oge=Object.getOwnPropertyDescriptor;var Mge=Object.getOwnPropertyNames;var Kge=Object.getPrototypeOf,Uge=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var Hge=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ct=(r,e)=>{for(var t in e)lS(r,t,{get:e[t],enumerable:!0})},jge=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mge(e))!Uge.call(r,n)&&n!==t&&lS(r,n,{get:()=>e[n],enumerable:!(i=Oge(e,n))||i.enumerable});return r};var ve=(r,e,t)=>(t=r!=null?Lge(Kge(r)):{},jge(e||!r||!r.__esModule?lS(t,"default",{value:r,enumerable:!0}):t,r));var kK=I((nZe,PK)=>{PK.exports=xK;xK.sync=lfe;var SK=J("fs");function Afe(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i<t.length;i++){var n=t[i].toLowerCase();if(n&&r.substr(-n.length).toLowerCase()===n)return!0}return!1}function vK(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:Afe(e,t)}function xK(r,e,t){SK.stat(r,function(i,n){t(i,i?!1:vK(n,r,e))})}function lfe(r,e){return vK(SK.statSync(r),r,e)}});var TK=I((sZe,NK)=>{NK.exports=RK;RK.sync=cfe;var DK=J("fs");function RK(r,e,t){DK.stat(r,function(i,n){t(i,i?!1:FK(n,e))})}function cfe(r,e){return FK(DK.statSync(r),e)}function FK(r,e){return r.isFile()&&ufe(r,e)}function ufe(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var OK=I((aZe,LK)=>{var oZe=J("fs"),AI;process.platform==="win32"||global.TESTING_WINDOWS?AI=kK():AI=TK();LK.exports=SS;SS.sync=gfe;function SS(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){SS(r,e||{},function(s,o){s?n(s):i(o)})})}AI(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function gfe(r,e){try{return AI.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var YK=I((AZe,GK)=>{var kg=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",MK=J("path"),ffe=kg?";":":",KK=OK(),UK=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),HK=(r,e)=>{let t=e.colon||ffe,i=r.match(/\//)||kg&&r.match(/\\/)?[""]:[...kg?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=kg?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=kg?n.split(t):[""];return kg&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},jK=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=HK(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(UK(r));let h=i[c],p=/^".*"$/.test(h)?h.slice(1,-1):h,d=MK.join(p,r),m=!p&&/^\.[\\\/]/.test(r)?r.slice(0,2)+d:d;u(l(m,c,0))}),l=(c,u,g)=>new Promise((h,p)=>{if(g===n.length)return h(a(u+1));let d=n[g];KK(c+d,{pathExt:s},(m,y)=>{if(!m&&y)if(e.all)o.push(c+d);else return h(c+d);return h(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},hfe=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=HK(r,e),s=[];for(let o=0;o<t.length;o++){let a=t[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=MK.join(l,r),u=!l&&/^\.[\\\/]/.test(r)?r.slice(0,2)+c:c;for(let g=0;g<i.length;g++){let h=u+i[g];try{if(KK.sync(h,{pathExt:n}))if(e.all)s.push(h);else return h}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw UK(r)};GK.exports=jK;jK.sync=hfe});var JK=I((lZe,vS)=>{"use strict";var qK=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};vS.expor
`,Tn=Ue(`\\
`,!1),ns=function(){return""},ss="\\",ut=Ue("\\",!1),wo=/^[\\$"`]/,At=Ve(["\\","$",'"',"`"],!1,!1),ln=function(C){return C},b="\\a",Nt=Ue("\\a",!1),pg=function(){return"a"},Ll="\\b",bp=Ue("\\b",!1),Sp=function(){return"\b"},vp=/^[Ee]/,xp=Ve(["E","e"],!1,!1),Pp=function(){return"\x1B"},j="\\f",Et=Ue("\\f",!1),yA=function(){return"\f"},zi="\\n",Ol=Ue("\\n",!1),ze=function(){return`
`},fa="\\r",dg=Ue("\\r",!1),OE=function(){return"\r"},kp="\\t",ME=Ue("\\t",!1),sr=function(){return" "},Ln="\\v",Ml=Ue("\\v",!1),Dp=function(){return"\v"},Ks=/^[\\'"?]/,ha=Ve(["\\","'",'"',"?"],!1,!1),cn=function(C){return String.fromCharCode(parseInt(C,16))},Ne="\\x",Cg=Ue("\\x",!1),Kl="\\u",Us=Ue("\\u",!1),Ul="\\U",wA=Ue("\\U",!1),mg=function(C){return String.fromCodePoint(parseInt(C,16))},Eg=/^[0-7]/,pa=Ve([["0","7"]],!1,!1),da=/^[0-9a-fA-f]/,tt=Ve([["0","9"],["a","f"],["A","f"]],!1,!1),Bo=nt(),BA="{}",Rp=Ue("{}",!1),Ca=function(){return"{}"},Hl="-",jl=Ue("-",!1),QA="+",ma=Ue("+",!1),Fp=".",KE=Ue(".",!1),Gl=function(C,Q,R){return{type:"number",value:(C==="-"?-1:1)*parseFloat(Q.join("")+"."+R.join(""))}},UE=function(C,Q){return{type:"number",value:(C==="-"?-1:1)*parseInt(Q.join(""))}},Np=function(C){return{type:"variable",...C}},Yl=function(C){return{type:"variable",name:C}},Or=function(C){return C},HE="*",Hs=Ue("*",!1),js="/",Ig=Ue("/",!1),bA=function(C,Q,R){return{type:Q==="*"?"multiplication":"division",right:R}},D=function(C,Q){return Q.reduce((R,U)=>({left:R,...U}),C)},Y=function(C,Q,R){return{type:Q==="+"?"addition":"subtraction",right:R}},pe="$((",Le=Ue("$((",!1),ke="))",Je=Ue("))",!1),pt=function(C){return C},Xt="$(",Ea=Ue("$(",!1),D1=function(C){return C},Gs="${",yg=Ue("${",!1),Jb=":-",R1=Ue(":-",!1),F1=function(C,Q){return{name:C,defaultValue:Q}},Wb=":-}",N1=Ue(":-}",!1),T1=function(C){return{name:C,defaultValue:[]}},zb=":+",L1=Ue(":+",!1),O1=function(C,Q){return{name:C,alternativeValue:Q}},Vb=":+}",M1=Ue(":+}",!1),K1=function(C){return{name:C,alternativeValue:[]}},Xb=function(C){return{name:C}},U1="$",H1=Ue("$",!1),j1=function(C){return e.isGlobPattern(C)},G1=function(C){return C},Zb=/^[a-zA-Z0-9_]/,_b=Ve([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),$b=function(){return Ie()},ql=/^[$@*?#a-zA-Z0-9_\-]/,jE=Ve(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),eS=/^[()}<>$|&; \t"']/,tS=Ve(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),rS=/^[<>&; \t"']/,GE=Ve(["<",">","&",";"," "," ",'"',"'"],!1,!1),Jl=/^[ \t]/,wg=Ve([" "," "],!1,!1),f=0,E=0,w=[{line:1,column:1}],k=0,L=[],T=0,ee;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function Ie(){return r.substring(E,f)}function Oe(){return ii(E,f)}function it(C,Q){throw Q=Q!==void 0?Q:ii(E,f),On([Ii(C)],r.substring(E,f),Q)}function at(C,Q){throw Q=Q!==void 0?Q:ii(E,f),yi(C,Q)}function Ue(C,Q){return{type:"literal",text:C,ignoreCase:Q}}function Ve(C,Q,R){return{type:"class",parts:C,inverted:Q,ignoreCase:R}}function nt(){return{type:"any"}}function wt(){return{type:"end"}}function Ii(C){return{type:"other",description:C}}function un(C){var Q=w[C],R;if(Q)return Q;for(R=C-1;!w[R];)R--;for(Q=w[R],Q={line:Q.line,column:Q.column};R<C;)r.charCodeAt(R)===10?(Q.line++,Q.column=1):Q.column++,R++;return w[C]=Q,Q}function ii(C,Q){var R=un(C),U=un(Q);return{start:{offset:C,line:R.line,column:R.column},end:{offset:Q,line:U.line,column:U.column}}}function Be(C){f<k||(f>k&&(k=f,L=[]),L.push(C))}function yi(C,Q){return new $l(C,null,null,Q)}function On(C,Q,R){return new $l($l.buildMessage(C,Q),C,Q,R)}function Ia(){var C,Q,R;for(C=f,Q=[],R=Me();R!==t;)Q.push(R),R=Me();return Q!==t?(R=vr(),R===t&&(R=null),R!==t?(E=C,Q=s(R),C=Q):(f=C,C=t)):(f=C,C=t),C}function vr(){var C,Q,R,U,le;if(C=f,Q=iS(),Q!==t){for(R=[],U=Me();U!==t;)R.push(U),U=Me();R!==t?(U=Y1(),U!==t?(le=mge(),le===t&&(le=null),le!==t?(E=C,Q=o(Q,U,le),C=Q):(f=C,C=t)):(f=C,C=t)):(f=C,C=t)}else f=C,C=t;if(C===t)if(C=f,Q=iS(),Q!==t){for(R=[],U=Me();U!==t;)R.push(U),U=Me();R!==t?(U=Y1(),U===t&&(U=null),U!==t?(E=C,Q=a(Q,U),C=Q):(f=C,C=t)):(f=C,C=t)}else f=C,C=t;return C}function mge(){var C,Q,R,U,le;for(C=f,Q=[],R=Me();R!==t;)Q.push(R),R=Me();if(Q!==t)if(R=vr(),R!==t){for(U=[],le=Me();le!==t;)U.push(le),le=Me();U!==t?(E=C,Q=l(R),C=Q):(f=C,C=t)}else f=C,C=t;else f=C,C=t;return C}function Y1(){var C;return r.charCodeAt(f)===59?(C=c,f++):(C=t,T===0&&Be(u)),C===t&&(r.charCodeAt(f)===38?(C=g,f++):(C=t,T===0&&Be(h))),C}function iS(){
2024-10-01 04:19:50 +02:00
\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;o<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>t/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),BU.repeat(" ",e)+i+a+s+`
`+BU.repeat(" ",e+this.position-n+i.length)+"^"};HS.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`:
2024-10-01 04:49:34 +02:00
`+t)),i};QU.exports=HS});var ni=I((OZe,vU)=>{"use strict";var SU=Ng(),qfe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Jfe=["scalar","sequence","mapping"];function Wfe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function zfe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(qfe.indexOf(t)===-1)throw new SU('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=Wfe(e.styleAliases||null),Jfe.indexOf(this.kind)===-1)throw new SU('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}vU.exports=zfe});var nc=I((MZe,PU)=>{"use strict";var xU=ic(),pI=Ng(),Vfe=ni();function jS(r,e,t){var i=[];return r.include.forEach(function(n){t=jS(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function Xfe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return r}function Tg(r){this.include=r.include||[],this.implicit=r.implicit||[],this.explicit=r.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new pI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=jS(this,"implicit",[]),this.compiledExplicit=jS(this,"explicit",[]),this.compiledTypeMap=Xfe(this.compiledImplicit,this.compiledExplicit)}Tg.DEFAULT=null;Tg.create=function(){var e,t;switch(arguments.length){case 1:e=Tg.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new pI("Wrong number of arguments for Schema.create function")}if(e=xU.toArray(e),t=xU.toArray(t),!e.every(function(i){return i instanceof Tg}))throw new pI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(i){return i instanceof Vfe}))throw new pI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Tg({include:e,explicit:t})};PU.exports=Tg});var DU=I((KZe,kU)=>{"use strict";var Zfe=ni();kU.exports=new Zfe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var FU=I((UZe,RU)=>{"use strict";var _fe=ni();RU.exports=new _fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var TU=I((HZe,NU)=>{"use strict";var $fe=ni();NU.exports=new $fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var dI=I((jZe,LU)=>{"use strict";var ehe=nc();LU.exports=new ehe({explicit:[DU(),FU(),TU()]})});var MU=I((GZe,OU)=>{"use strict";var the=ni();function rhe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function ihe(){return null}function nhe(r){return r===null}OU.exports=new the("tag:yaml.org,2002:null",{kind:"scalar",resolve:rhe,construct:ihe,predicate:nhe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var UU=I((YZe,KU)=>{"use strict";var she=ni();function ohe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function ahe(r){return r==="true"||r==="True"||r==="TRUE"}function Ahe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}KU.exports=new she("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ohe,construct:ahe,predicate:Ahe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE"
\r`;function Fhe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=qS;for(t=0;t<n;t++)if(e=s.indexOf(r.charAt(t)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function Nhe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=qS,o=0,a=[];for(e=0;e<n;e++)e%4===0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),sc?sc.from?sc.from(a):new sc(a):a}function The(r){var e="",t=0,i,n,s=r.length,o=qS;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function Lhe(r){return sc&&sc.isBuffer(r)}t2.exports=new Rhe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Fhe,construct:Nhe,predicate:Lhe,represent:The})});var n2=I(($Ze,i2)=>{"use strict";var Ohe=ni(),Mhe=Object.prototype.hasOwnProperty,Khe=Object.prototype.toString;function Uhe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t<i;t+=1){if(n=a[t],o=!1,Khe.call(n)!=="[object Object]")return!1;for(s in n)if(Mhe.call(n,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function Hhe(r){return r!==null?r:[]}i2.exports=new Ohe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Uhe,construct:Hhe})});var o2=I((e_e,s2)=>{"use strict";var jhe=ni(),Ghe=Object.prototype.toString;function Yhe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(i=o[e],Ghe.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[e]=[n[0],i[n[0]]]}return!0}function qhe(r){if(r===null)return[];var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)i=o[e],n=Object.keys(i),s[e]=[n[0],i[n[0]]];return s}s2.exports=new jhe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Yhe,construct:qhe})});var A2=I((t_e,a2)=>{"use strict";var Jhe=ni(),Whe=Object.prototype.hasOwnProperty;function zhe(r){if(r===null)return!0;var e,t=r;for(e in t)if(Whe.call(t,e)&&t[e]!==null)return!1;return!0}function Vhe(r){return r!==null?r:{}}a2.exports=new Jhe("tag:yaml.org,2002:set",{kind:"mapping",resolve:zhe,construct:Vhe})});var Lg=I((r_e,l2)=>{"use strict";var Xhe=nc();l2.exports=new Xhe({include:[YS()],implicit:[ZU(),$U()],explicit:[r2(),n2(),o2(),A2()]})});var u2=I((i_e,c2)=>{"use strict";var Zhe=ni();function _he(){return!0}function $he(){}function epe(){return""}function tpe(r){return typeof r>"u"}c2.exports=new Zhe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:_he,construct:$he,predicate:tpe,represent:epe})});var f2=I((n_e,g2)=>{"use strict";var rpe=ni();function ipe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function npe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function spe(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function ope(r){return Object.prototype.toString.call(r)==="[object RegExp]"}g2.exports=new rpe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:ipe,construct:npe,predicate:ope,represent:spe})});var d2=I((s_e,p2)=>{"use strict";var CI;try{h2=J,CI=h2("esprima")}catch{typeof window<"u"&&(CI=window.esprima)}var h2,ape=ni();function Ape(r){if(r===null)return!1;try{var e="("+r+")",t=CI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function lpe(r){var e="("+r+")",t=CI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=
`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function ype(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var D2=new Array(256),R2=new Array(256);for(oc=0;oc<256;oc++)D2[oc]=y2(oc)?1:0,R2[oc]=y2(oc);var oc;function wpe(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||fpe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function F2(r,e){return new b2(e,new gpe(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function gt(r,e){throw F2(r,e)}function II(r,e){r.onWarning&&r.onWarning.call(null,F2(r,e))}var w2={YAML:function(e,t,i){var n,s,o;e.version!==null&&gt(e,"duplication of %YAML directive"),i.length!==1&&gt(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&gt(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&gt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&II(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&gt(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],P2.test(n)||gt(e,"ill-formed tag handle (first argument) of the TAG directive"),kA.call(e.tagMap,n)&&gt(e,'there is a previously declared suffix for "'+n+'" tag handle'),k2.test(s)||gt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function PA(r,e,t,i){var n,s,o,a;if(e<t){if(a=r.input.slice(e,t),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||gt(r,"expected valid JSON character");else ppe.test(a)&&gt(r,"the stream contains non-printable characters");r.result+=a}}function B2(r,e,t,i){var n,s,o,a;for(Qa.isObject(t)||gt(r,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(t),o=0,a=n.length;o<a;o+=1)s=n[o],kA.call(e,s)||(e[s]=t[s],i[s]=!0)}function Mg(r,e,t,i,n,s,o,a){var l,c;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,c=n.length;l<c;l+=1)Array.isArray(n[l])&&gt(r,"nested arrays are not supported inside keys"),typeof n=="object"&&I2(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&I2(n)==="[object Object]"&&(n="[object Object]"),n=String(n),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(l=0,c=s.length;l<c;l+=1)B2(r,e,s[l],t);else B2(r,e,s,t);else!r.json&&!kA.call(t,n)&&kA.call(e,n)&&(r.line=o||r.line,r.position=a||r.position,gt(r,"duplicated mapping key")),e[n]=s,delete t[n];return e}function WS(r){var e;e=r.input.charCodeAt(r.position),e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):gt(r,"a line break is expected"),r.line+=1,r.lineStart=r.position}function Jr(r,e,t){for(var i=0,n=r.input.charCodeAt(r.position);n!==0;){for(;ac(n);)n=r.input.charCodeAt(++r.position);if(e&&n===35)do n=r.input.charCodeAt(++r.position);while(n!==10&&n!==13&&n!==0);if(vo(n))for(WS(r),n=r.input.charCodeAt(r.position),i++,r.lineIndent=0;n===32;)r.lineIndent++,n=r.input.charCodeAt(++r.position);else break}return t!==-1&&i!==0&&r.lineIndent<t&&II(r,"deficient indentation"),i}function yI(r){var e=r.position,t;return t=r.input.charCodeAt(e),!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||hn(t)))}function zS(r,e){e===1?r.result+=" ":e>1&&(r.result+=Qa.repeat(`
`,e-1))}function Bpe(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,h=r.result,p;if(p=r.input.charCodeAt(r.position),hn(p)||Og(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(n=r.input.charCodeAt(r.position+1),hn(n)||t&&Og(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;p!==0;){if(p===58){if(n=r.input.charCodeAt(r.position+1),hn(n)||t&&Og(n))break}else if(p===35){if(i=r.input.charCodeAt(r.position-1),hn(i))break}else{if(r.position===r.lineStart&&yI(r)||t&&Og(p))break;if(vo(p))if(l=r.line,c=r.lineStart,u=r.lineIndent,Jr(r,!1,-1),r.lineIndent>=e){a=!0,p=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(PA(r,s,o,!1),zS(r,r.line-l),s=o=r.position,a=!1),ac(p)||(o=r.position+1),p=r.input.charCodeAt(++r.position)}return PA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=h,!1)}function Qpe(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(PA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else vo(t)?(PA(r,i,n,!0),zS(r,Jr(r,!1,e)),i=n=r.position):r.position===r.lineStart&&yI(r)?gt(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);gt(r,"unexpected end of the stream within a single quoted scalar")}function bpe(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return PA(r,t,r.position,!0),r.position++,!0;if(a===92){if(PA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),vo(a))Jr(r,!1,e);else if(a<256&&D2[a])r.result+=R2[a],r.position++;else if((o=Epe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=mpe(a))>=0?s=(s<<4)+o:gt(r,"expected hexadecimal character");r.result+=ype(s),r.position++}else gt(r,"unknown escape sequence");t=i=r.position}else vo(a)?(PA(r,t,i,!0),zS(r,Jr(r,!1,e)),t=i=r.position):r.position===r.lineStart&&yI(r)?gt(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}gt(r,"unexpected end of the stream within a double quoted scalar")}function Spe(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,h={},p,d,m,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if(Jr(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||gt(r,"missed comma between flow collection entries"),d=p=m=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),hn(a)&&(c=u=!0,r.position++,Jr(r,!0,e))),i=r.line,Kg(r,e,mI,!1,!0),d=r.tag,p=r.result,Jr(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),Jr(r,!0,e),Kg(r,e,mI,!1,!0),m=r.result),g?Mg(r,s,h,d,p,m):c?s.push(Mg(r,null,h,d,p,m)):s.push(p),Jr(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}gt(r,"unexpected end of the stream within a flow collection")}function vpe(r,e){var t,i,n=JS,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)JS===n?n=g===43?E2:hpe:gt(r,"repeat of a chomping mode identifier");else if((u=Ipe(g))>=0)u===0?gt(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?gt(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(ac(g)){do g=r.input.charCodeAt(++r.position);while(ac(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!vo(g)&&g!==0)}for(;g!==0;){for(WS(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndent<a)&&g===32;)r.lineIndent++,g=r.input.charCodeAt(++r.position);if(!o&&r.lineIndent>a&&(a=r
2024-10-01 04:19:50 +02:00
`,s?1+l:l):n===JS&&s&&(r.result+=`
`);break}for(i?ac(g)?(c=!0,r.result+=Qa.repeat(`
`,s?1+l:l)):c?(c=!1,r.result+=Qa.repeat(`
`,l+1)):l===0?s&&(r.result+=" "):r.result+=Qa.repeat(`
`,l):r.result+=Qa.repeat(`
2024-10-01 04:49:34 +02:00
`,s?1+l:l),s=!0,o=!0,l=0,t=r.position;!vo(g)&&g!==0;)g=r.input.charCodeAt(++r.position);PA(r,t,r.position,!1)}return!0}function Q2(r,e){var t,i=r.tag,n=r.anchor,s=[],o,a=!1,l;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),l=r.input.charCodeAt(r.position);l!==0&&!(l!==45||(o=r.input.charCodeAt(r.position+1),!hn(o)));){if(a=!0,r.position++,Jr(r,!0,-1)&&r.lineIndent<=e){s.push(null),l=r.input.charCodeAt(r.position);continue}if(t=r.line,Kg(r,e,x2,!1,!0),s.push(r.result),Jr(r,!0,-1),l=r.input.charCodeAt(r.position),(r.line===t||r.lineIndent>e)&&l!==0)gt(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return a?(r.tag=i,r.anchor=n,r.kind="sequence",r.result=s,!0):!1}function xpe(r,e,t){var i,n,s,o,a=r.tag,l=r.anchor,c={},u={},g=null,h=null,p=null,d=!1,m=!1,y;for(r.anchor!==null&&(r.anchorMap[r.anchor]=c),y=r.input.charCodeAt(r.position);y!==0;){if(i=r.input.charCodeAt(r.position+1),s=r.line,o=r.position,(y===63||y===58)&&hn(i))y===63?(d&&(Mg(r,c,u,g,h,null),g=h=p=null),m=!0,d=!0,n=!0):d?(d=!1,n=!0):gt(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,y=i;else if(Kg(r,t,v2,!1,!0))if(r.line===s){for(y=r.input.charCodeAt(r.position);ac(y);)y=r.input.charCodeAt(++r.position);if(y===58)y=r.input.charCodeAt(++r.position),hn(y)||gt(r,"a whitespace character is expected after the key-value separator within a block mapping"),d&&(Mg(r,c,u,g,h,null),g=h=p=null),m=!0,d=!1,n=!1,g=r.tag,h=r.result;else if(m)gt(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=a,r.anchor=l,!0}else if(m)gt(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=a,r.anchor=l,!0;else break;if((r.line===s||r.lineIndent>e)&&(Kg(r,e,EI,!0,n)&&(d?h=r.result:p=r.result),d||(Mg(r,c,u,g,h,p,s,o),g=h=p=null),Jr(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)gt(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return d&&Mg(r,c,u,g,h,null),m&&(r.tag=a,r.anchor=l,r.kind="mapping",r.result=c),m}function Ppe(r){var e,t=!1,i=!1,n,s,o;if(o=r.input.charCodeAt(r.position),o!==33)return!1;if(r.tag!==null&&gt(r,"duplication of a tag property"),o=r.input.charCodeAt(++r.position),o===60?(t=!0,o=r.input.charCodeAt(++r.position)):o===33?(i=!0,n="!!",o=r.input.charCodeAt(++r.position)):n="!",e=r.position,t){do o=r.input.charCodeAt(++r.position);while(o!==0&&o!==62);r.position<r.length?(s=r.input.slice(e,r.position),o=r.input.charCodeAt(++r.position)):gt(r,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!hn(o);)o===33&&(i?gt(r,"tag suffix cannot contain exclamation marks"):(n=r.input.slice(e-1,r.position+1),P2.test(n)||gt(r,"named tag handle cannot contain such characters"),i=!0,e=r.position+1)),o=r.input.charCodeAt(++r.position);s=r.input.slice(e,r.position),Cpe.test(s)&&gt(r,"tag suffix cannot contain flow indicator characters")}return s&&!k2.test(s)&&gt(r,"tag name cannot contain such characters: "+s),t?r.tag=s:kA.call(r.tagMap,n)?r.tag=r.tagMap[n]+s:n==="!"?r.tag="!"+s:n==="!!"?r.tag="tag:yaml.org,2002:"+s:gt(r,'undeclared tag handle "'+n+'"'),!0}function kpe(r){var e,t;if(t=r.input.charCodeAt(r.position),t!==38)return!1;for(r.anchor!==null&&gt(r,"duplication of an anchor property"),t=r.input.charCodeAt(++r.position),e=r.position;t!==0&&!hn(t)&&!Og(t);)t=r.input.charCodeAt(++r.position);return r.position===e&&gt(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(e,r.position),!0}function Dpe(r){var e,t,i;if(i=r.input.charCodeAt(r.position),i!==42)return!1;for(i=r.input.charCodeAt(++r.position),e=r.position;i!==0&&!hn(i)&&!Og(i);)i=r.input.charCodeAt(++r.position);return r.position===e&&gt(r,"name of an alias node must contain at least one character"),t=r.input.slice(e,r.position),kA.call(r.anchorMap,t)||gt(r,'unidentified alias "'+t+'"'),r.result=r.anchorMap[t],Jr(r,!0,-1),!0}function Kg(r,e,t,i,n){var s,o,a,l=1,c=!1,u=!1,g,h,p,d,m;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,s
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));var t=new wpe(r,e),i=r.indexOf("\0");for(i!==-1&&(t.position=i,gt(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Rpe(t);return t.documents}function T2(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var i=N2(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function L2(r,e){var t=N2(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new b2("expected a single document in the stream, but found more")}}function Fpe(r,e,t){return typeof e=="object"&&e!==null&&typeof t>"u"&&(t=e,e=null),T2(r,e,Qa.extend({schema:S2},t))}function Npe(r,e){return L2(r,Qa.extend({schema:S2},e))}_p.exports.loadAll=T2;_p.exports.load=L2;_p.exports.safeLoadAll=Fpe;_p.exports.safeLoad=Npe});var oH=I((l_e,_S)=>{"use strict";var ed=ic(),td=Ng(),Tpe=Zp(),Lpe=Lg(),q2=Object.prototype.toString,J2=Object.prototype.hasOwnProperty,Ope=9,$p=10,Mpe=13,Kpe=32,Upe=33,Hpe=34,W2=35,jpe=37,Gpe=38,Ype=39,qpe=42,z2=44,Jpe=45,V2=58,Wpe=61,zpe=62,Vpe=63,Xpe=64,X2=91,Z2=93,Zpe=96,_2=123,_pe=124,$2=125,Ni={};Ni[0]="\\0";Ni[7]="\\a";Ni[8]="\\b";Ni[9]="\\t";Ni[10]="\\n";Ni[11]="\\v";Ni[12]="\\f";Ni[13]="\\r";Ni[27]="\\e";Ni[34]='\\"';Ni[92]="\\\\";Ni[133]="\\N";Ni[160]="\\_";Ni[8232]="\\L";Ni[8233]="\\P";var $pe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function ede(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n<s;n+=1)o=i[n],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=r.compiledTypeMap.fallback[o],l&&J2.call(l.styleAliases,a)&&(a=l.styleAliases[a]),t[o]=a;return t}function M2(r){var e,t,i;if(e=r.toString(16).toUpperCase(),r<=255)t="x",i=2;else if(r<=65535)t="u",i=4;else if(r<=4294967295)t="U",i=8;else throw new td("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+ed.repeat("0",i-e.length)+e}function tde(r){this.schema=r.schema||Tpe,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=ed.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=ede(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function K2(r,e){for(var t=ed.repeat(" ",e),i=0,n=-1,s="",o,a=r.length;i<a;)n=r.indexOf(`
2024-10-01 04:19:50 +02:00
`,i),n===-1?(o=r.slice(i),i=a):(o=r.slice(i,n+1),i=n+1),o.length&&o!==`
`&&(s+=t),s+=o;return s}function VS(r,e){return`
2024-10-01 04:49:34 +02:00
`+ed.repeat(" ",r.indent*e)}function rde(r,e){var t,i,n;for(t=0,i=r.implicitTypes.length;t<i;t+=1)if(n=r.implicitTypes[t],n.resolve(e))return!0;return!1}function ZS(r){return r===Kpe||r===Ope}function Ug(r){return 32<=r&&r<=126||161<=r&&r<=55295&&r!==8232&&r!==8233||57344<=r&&r<=65533&&r!==65279||65536<=r&&r<=1114111}function ide(r){return Ug(r)&&!ZS(r)&&r!==65279&&r!==Mpe&&r!==$p}function U2(r,e){return Ug(r)&&r!==65279&&r!==z2&&r!==X2&&r!==Z2&&r!==_2&&r!==$2&&r!==V2&&(r!==W2||e&&ide(e))}function nde(r){return Ug(r)&&r!==65279&&!ZS(r)&&r!==Jpe&&r!==Vpe&&r!==V2&&r!==z2&&r!==X2&&r!==Z2&&r!==_2&&r!==$2&&r!==W2&&r!==Gpe&&r!==qpe&&r!==Upe&&r!==_pe&&r!==Wpe&&r!==zpe&&r!==Ype&&r!==Hpe&&r!==jpe&&r!==Xpe&&r!==Zpe}function eH(r){var e=/^\n* /;return e.test(r)}var tH=1,rH=2,iH=3,nH=4,wI=5;function sde(r,e,t,i,n){var s,o,a,l=!1,c=!1,u=i!==-1,g=-1,h=nde(r.charCodeAt(0))&&!ZS(r.charCodeAt(r.length-1));if(e)for(s=0;s<r.length;s++){if(o=r.charCodeAt(s),!Ug(o))return wI;a=s>0?r.charCodeAt(s-1):null,h=h&&U2(o,a)}else{for(s=0;s<r.length;s++){if(o=r.charCodeAt(s),o===$p)l=!0,u&&(c=c||s-g-1>i&&r[g+1]!==" ",g=s);else if(!Ug(o))return wI;a=s>0?r.charCodeAt(s-1):null,h=h&&U2(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?h&&!n(r)?tH:rH:t>9&&eH(r)?wI:c?nH:iH}function ode(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&$pe.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return rde(r,l)}switch(sde(e,o,r.indent,s,a)){case tH:return e;case rH:return"'"+e.replace(/'/g,"''")+"'";case iH:return"|"+H2(e,r.indent)+j2(K2(e,n));case nH:return">"+H2(e,r.indent)+j2(K2(ade(e,s),n));case wI:return'"'+Ade(e,s)+'"';default:throw new td("impossible error: invalid scalar style")}}()}function H2(r,e){var t=eH(r)?String(e):"",i=r[r.length-1]===`
2024-10-01 04:19:50 +02:00
`,n=i&&(r[r.length-2]===`
`||r===`
`),s=n?"+":i?"":"-";return t+s+`
`}function j2(r){return r[r.length-1]===`
`?r.slice(0,-1):r}function ade(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(`
2024-10-01 04:49:34 +02:00
`);return c=c!==-1?c:r.length,t.lastIndex=c,G2(r.slice(0,c),e)}(),n=r[0]===`
2024-10-01 04:19:50 +02:00
`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?`
2024-10-01 04:49:34 +02:00
`:"")+G2(l,e),n=s}return i}function G2(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=`
2024-10-01 04:19:50 +02:00
`+r.slice(n,s),n=s+1),o=a;return l+=`
`,r.length-n>e&&o>n?l+=r.slice(n,o)+`
2024-10-01 04:49:34 +02:00
`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function Ade(r){for(var e="",t,i,n,s=0;s<r.length;s++){if(t=r.charCodeAt(s),t>=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=M2((t-55296)*1024+i-56320+65536),s++;continue}n=Ni[t],e+=!n&&Ug(t)?r[s]:n||M2(t)}return e}function lde(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s<o;s+=1)Ac(r,e,t[s],!1,!1)&&(s!==0&&(i+=","+(r.condenseFlow?"":" ")),i+=r.dump);r.tag=n,r.dump="["+i+"]"}function cde(r,e,t,i){var n="",s=r.tag,o,a;for(o=0,a=t.length;o<a;o+=1)Ac(r,e+1,t[o],!0,!0)&&((!i||o!==0)&&(n+=VS(r,e)),r.dump&&$p===r.dump.charCodeAt(0)?n+="-":n+="- ",n+=r.dump);r.tag=s,r.dump=n||"[]"}function ude(r,e,t){var i="",n=r.tag,s=Object.keys(t),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",o!==0&&(u+=", "),r.condenseFlow&&(u+='"'),l=s[o],c=t[l],Ac(r,e,l,!1,!1)&&(r.dump.length>1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),Ac(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function gde(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,h;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new td("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)h="",(!i||a!==0)&&(h+=VS(r,e)),c=o[a],u=t[c],Ac(r,e+1,c,!0,!0,!0)&&(g=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024,g&&(r.dump&&$p===r.dump.charCodeAt(0)?h+="?":h+="? "),h+=r.dump,g&&(h+=VS(r,e)),Ac(r,e+1,u,!0,g)&&(r.dump&&$p===r.dump.charCodeAt(0)?h+=":":h+=": ",h+=r.dump,n+=h));r.tag=s,r.dump=n||"{}"}function Y2(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s<o;s+=1)if(a=n[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r.tag=t?a.tag:"?",a.represent){if(l=r.styleMap[a.tag]||a.defaultStyle,q2.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(J2.call(a.represent,l))i=a.represent[l](e,l);else throw new td("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function Ac(r,e,t,i,n,s){r.tag=null,r.dump=t,Y2(r,t,!1)||Y2(r,t,!0);var o=q2.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(gde(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(ude(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(cde(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(lde(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&ode(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new td("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function fde(r,e){var t=[],i=[],n,s;for(XS(r,t,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(t[i[n]]);e.usedDuplicates=new Array(s)}function XS(r,e,t){var i,n,s;if(r!==null&&typeof r=="object")if(n=e.indexOf(r),n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(r),Array.isArray(r))for(n=0,s=r.length;n<s;n+=1)XS(r[n],e,t);else for(i=Object.keys(r),n=0,s=i.length;n<s;n+=1)XS(r[i[n]],e,t)}function sH(r,e){e=e||{};var t=new tde(e);return t.noRefs||fde(r,t),Ac(t,0,r,!0,!0)?t.dump+`
`:""}function hde(r,e){return sH(r,ed.extend({schema:Lpe},e))}_S.exports.dump=sH;_S.exports.safeDump=hde});var AH=I((c_e,Rr)=>{"use strict";var BI=O2(),aH=oH();function QI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Rr.exports.Type=ni();Rr.exports.Schema=nc();Rr.exports.FAILSAFE_SCHEMA=dI();Rr.exports.JSON_SCHEMA=GS();Rr.exports.CORE_SCHEMA=YS();Rr.exports.DEFAULT_SAFE_SCHEMA=Lg();Rr.exports.DEFAULT_FULL_SCHEMA=Zp();Rr.exports.load=BI.load;Rr.exports.loadAll=BI.loadAll;Rr.exports.safeLoad=BI.safeLoad;Rr.exports.safeLoadAll=BI.safeLoadAll;Rr.exports.dump=aH.dump;Rr.exports.safeDump=aH.safeDump;Rr.exports.YAMLException=Ng();Rr.exports.MINIMAL_SCHEMA=dI();Rr.exports.SAFE_SCHEMA=Lg();Rr.exports.DEFAULT_SCHEMA=Zp();Rr.exports.scan=QI("scan");Rr.exports.parse=QI("parse");Rr.exports.compose=QI("compose");Rr.exports.addConstructor=QI("addConstructor")});var cH=I((u_e,lH)=>{"use strict";var pde=AH();lH.exports=pde});var gH=I((g_e,uH)=>{"use strict";function dde(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function lc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,lc)}dde(lc,Error);lc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g<c.parts.length;g++)u+=c.parts[g]instanceof Array?s(c.parts[g][0])+"-"+s(c.parts[g][1]):s(c.parts[g]);return"["+(c.inverted?"^":"")+u+"]"},any:function(c){return"any character"},end:function(c){return"end of input"},other:function(c){return c.description}};function i(c){return c.charCodeAt(0).toString(16).toUpperCase()}function n(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+i(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+i(u)})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+i(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+i(u)})}function o(c){return t[c.type](c)}function a(c){var u=new Array(c.length),g,h;for(g=0;g<c.length;g++)u[g]=o(c[g]);if(u.sort(),u.length>0){for(g=1,h=1;g<u.length;g++)u[g-1]!==u[g]&&(u[h]=u[g],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+n(c)+'"':"end of input"}return"Expected "+a(r)+" but "+l(e)+" found."};function Cde(r,e){e=e!==void 0?e:{};var t={},i={Start:Us},n=Us,s=function(D){return[].concat(...D)},o="-",a=sr("-",!1),l=function(D){return D},c=function(D){return Object.assign({},...D)},u="#",g=sr("#",!1),h=Ml(),p=function(){return{}},d=":",m=sr(":",!1),y=function(D,Y){return{[D]:Y}},B=",",S=sr(",",!1),P=function(D,Y){return Y},F=function(D,Y,pe){return Object.assign({},...[D].concat(Y).map(Le=>({[Le]:pe})))},H=function(D){return D},q=function(D){return D},_=Ks("correct indentation"),X=" ",W=sr(" ",!1),Z=function(D){return D.length===bA*Ig},A=function(D){return D.length===(bA+1)*Ig},ne=function(){return bA++,!0},ue=function(){return bA--,!0},te=function(){return dg()},O=Ks("pseudostring"),N=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,ce=Ln(["\r",`
2024-10-01 04:19:50 +02:00
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),he=/^[^\r\n\t ,\][{}:#"']/,Pe=Ln(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),De=function(){return dg().replace(/^ *| *$/g,"")},Re="--",se=sr("--",!1),Ae=/^[a-zA-Z\/0-9]/,ye=Ln([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),ge=/^[^\r\n\t :,]/,oe=Ln(["\r",`
2024-10-01 04:49:34 +02:00
`," "," ",":",","],!0,!1),Ye="null",ie=sr("null",!1),G=function(){return null},fe="true",re=sr("true",!1),de=function(){return!0},Ze="false",vt=sr("false",!1),mt=function(){return!1},Lr=Ks("string"),ti='"',ui=sr('"',!1),gr=function(){return""},gi=function(D){return D},ri=function(D){return D.join("")},Ms=/^[^"\\\0-\x1F\x7F]/,fr=Ln(['"',"\\",["\0",""],"\x7F"],!0,!1),Ei='\\"',rs=sr('\\"',!1),ua=function(){return'"'},CA="\\\\",gg=sr("\\\\",!1),is=function(){return"\\"},mA="\\/",ga=sr("\\/",!1),wp=function(){return"/"},EA="\\b",IA=sr("\\b",!1),yr=function(){return"\b"},Nl="\\f",fg=sr("\\f",!1),Io=function(){return"\f"},hg="\\n",Bp=sr("\\n",!1),Qp=function(){return`
`},Sr="\\r",Ri=sr("\\r",!1),yo=function(){return"\r"},Nn="\\t",ae=sr("\\t",!1),yt=function(){return" "},Tl="\\u",Tn=sr("\\u",!1),ns=function(D,Y,pe,Le){return String.fromCharCode(parseInt(`0x${D}${Y}${pe}${Le}`))},ss=/^[0-9a-fA-F]/,ut=Ln([["0","9"],["a","f"],["A","F"]],!1,!1),wo=Ks("blank space"),At=/^[ \t]/,ln=Ln([" "," "],!1,!1),b=Ks("white space"),Nt=/^[ \t\n\r]/,pg=Ln([" "," ",`
2024-10-01 04:19:50 +02:00
`,"\r"],!1,!1),Ll=`\r
`,bp=sr(`\r
`,!1),Sp=`
`,vp=sr(`
2024-10-01 04:49:34 +02:00
`,!1),xp="\r",Pp=sr("\r",!1),j=0,Et=0,yA=[{line:1,column:1}],zi=0,Ol=[],ze=0,fa;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function dg(){return r.substring(Et,j)}function OE(){return cn(Et,j)}function kp(D,Y){throw Y=Y!==void 0?Y:cn(Et,j),Kl([Ks(D)],r.substring(Et,j),Y)}function ME(D,Y){throw Y=Y!==void 0?Y:cn(Et,j),Cg(D,Y)}function sr(D,Y){return{type:"literal",text:D,ignoreCase:Y}}function Ln(D,Y,pe){return{type:"class",parts:D,inverted:Y,ignoreCase:pe}}function Ml(){return{type:"any"}}function Dp(){return{type:"end"}}function Ks(D){return{type:"other",description:D}}function ha(D){var Y=yA[D],pe;if(Y)return Y;for(pe=D-1;!yA[pe];)pe--;for(Y=yA[pe],Y={line:Y.line,column:Y.column};pe<D;)r.charCodeAt(pe)===10?(Y.line++,Y.column=1):Y.column++,pe++;return yA[D]=Y,Y}function cn(D,Y){var pe=ha(D),Le=ha(Y);return{start:{offset:D,line:pe.line,column:pe.column},end:{offset:Y,line:Le.line,column:Le.column}}}function Ne(D){j<zi||(j>zi&&(zi=j,Ol=[]),Ol.push(D))}function Cg(D,Y){return new lc(D,null,null,Y)}function Kl(D,Y,pe){return new lc(lc.buildMessage(D,Y),D,Y,pe)}function Us(){var D;return D=mg(),D}function Ul(){var D,Y,pe;for(D=j,Y=[],pe=wA();pe!==t;)Y.push(pe),pe=wA();return Y!==t&&(Et=D,Y=s(Y)),D=Y,D}function wA(){var D,Y,pe,Le,ke;return D=j,Y=da(),Y!==t?(r.charCodeAt(j)===45?(pe=o,j++):(pe=t,ze===0&&Ne(a)),pe!==t?(Le=Or(),Le!==t?(ke=pa(),ke!==t?(Et=D,Y=l(ke),D=Y):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t),D}function mg(){var D,Y,pe;for(D=j,Y=[],pe=Eg();pe!==t;)Y.push(pe),pe=Eg();return Y!==t&&(Et=D,Y=c(Y)),D=Y,D}function Eg(){var D,Y,pe,Le,ke,Je,pt,Xt,Ea;if(D=j,Y=Or(),Y===t&&(Y=null),Y!==t){if(pe=j,r.charCodeAt(j)===35?(Le=u,j++):(Le=t,ze===0&&Ne(g)),Le!==t){if(ke=[],Je=j,pt=j,ze++,Xt=js(),ze--,Xt===t?pt=void 0:(j=pt,pt=t),pt!==t?(r.length>j?(Xt=r.charAt(j),j++):(Xt=t,ze===0&&Ne(h)),Xt!==t?(pt=[pt,Xt],Je=pt):(j=Je,Je=t)):(j=Je,Je=t),Je!==t)for(;Je!==t;)ke.push(Je),Je=j,pt=j,ze++,Xt=js(),ze--,Xt===t?pt=void 0:(j=pt,pt=t),pt!==t?(r.length>j?(Xt=r.charAt(j),j++):(Xt=t,ze===0&&Ne(h)),Xt!==t?(pt=[pt,Xt],Je=pt):(j=Je,Je=t)):(j=Je,Je=t);else ke=t;ke!==t?(Le=[Le,ke],pe=Le):(j=pe,pe=t)}else j=pe,pe=t;if(pe===t&&(pe=null),pe!==t){if(Le=[],ke=Hs(),ke!==t)for(;ke!==t;)Le.push(ke),ke=Hs();else Le=t;Le!==t?(Et=D,Y=p(),D=Y):(j=D,D=t)}else j=D,D=t}else j=D,D=t;if(D===t&&(D=j,Y=da(),Y!==t?(pe=Rp(),pe!==t?(Le=Or(),Le===t&&(Le=null),Le!==t?(r.charCodeAt(j)===58?(ke=d,j++):(ke=t,ze===0&&Ne(m)),ke!==t?(Je=Or(),Je===t&&(Je=null),Je!==t?(pt=pa(),pt!==t?(Et=D,Y=y(pe,pt),D=Y):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t),D===t&&(D=j,Y=da(),Y!==t?(pe=Ca(),pe!==t?(Le=Or(),Le===t&&(Le=null),Le!==t?(r.charCodeAt(j)===58?(ke=d,j++):(ke=t,ze===0&&Ne(m)),ke!==t?(Je=Or(),Je===t&&(Je=null),Je!==t?(pt=pa(),pt!==t?(Et=D,Y=y(pe,pt),D=Y):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t),D===t))){if(D=j,Y=da(),Y!==t)if(pe=Ca(),pe!==t)if(Le=Or(),Le!==t)if(ke=jl(),ke!==t){if(Je=[],pt=Hs(),pt!==t)for(;pt!==t;)Je.push(pt),pt=Hs();else Je=t;Je!==t?(Et=D,Y=y(pe,ke),D=Y):(j=D,D=t)}else j=D,D=t;else j=D,D=t;else j=D,D=t;else j=D,D=t;if(D===t)if(D=j,Y=da(),Y!==t)if(pe=Ca(),pe!==t){if(Le=[],ke=j,Je=Or(),Je===t&&(Je=null),Je!==t?(r.charCodeAt(j)===44?(pt=B,j++):(pt=t,ze===0&&Ne(S)),pt!==t?(Xt=Or(),Xt===t&&(Xt=null),Xt!==t?(Ea=Ca(),Ea!==t?(Et=ke,Je=P(pe,Ea),ke=Je):(j=ke,ke=t)):(j=ke,ke=t)):(j=ke,ke=t)):(j=ke,ke=t),ke!==t)for(;ke!==t;)Le.push(ke),ke=j,Je=Or(),Je===t&&(Je=null),Je!==t?(r.charCodeAt(j)===44?(pt=B,j++):(pt=t,ze===0&&Ne(S)),pt!==t?(Xt=Or(),Xt===t&&(Xt=null),Xt!==t?(Ea=Ca(),Ea!==t?(Et=ke,Je=P(pe,Ea),ke=Je):(j=ke,ke=t)):(j=ke,ke=t)):(j=ke,ke=t)):(j=ke,ke=t);else Le=t;Le!==t?(ke=Or(),ke===t&&(ke=null),ke!==t?(r.charCodeAt(j)===58?(Je=d,j++):(Je=t,ze===0&&Ne(m)),Je!==t?(pt=Or(),pt===t&&(pt=null),pt!==t?(Xt=pa(),Xt!==t?(Et=D,Y=F(pe,Le,Xt),D=Y):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)):(j=D,D=t)}else j=D,D=t;else j=D,D=t}return D}function pa(){var D,Y,pe,Le,ke,Je,pt;if(D=j,Y=j,ze++,pe=j,Le=js(),Le!==t?(ke=tt(),ke!==t?(r.charCodeAt(j)===45?(Je=o,j+
2024-10-01 04:19:50 +02:00
`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var d=this.positiveInteger();return{type:"GroupBackReference",value:d}},r.prototype.characterClassEscape=function(){var d,m=!1;switch(this.popChar()){case"d":d=u;break;case"D":d=u,m=!0;break;case"s":d=h;break;case"S":d=h,m=!0;break;case"w":d=g;break;case"W":d=g,m=!0;break}return a(d),{type:"Set",value:d,complement:m}},r.prototype.controlEscapeAtom=function(){var d;switch(this.popChar()){case"f":d=n("\f");break;case"n":d=n(`
`);break;case"r":d=n("\r");break;case"t":d=n(" ");break;case"v":d=n("\v");break}return a(d),{type:"Character",value:d}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var d=this.popChar();if(/[a-zA-Z]/.test(d)===!1)throw Error("Invalid ");var m=d.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:m}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var d=this.popChar();return{type:"Character",value:n(d)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var d=this.popChar();return{type:"Character",value:n(d)}}},r.prototype.characterClass=function(){var d=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var y=this.classAtom(),B=y.type==="Character";if(B&&this.isRangeDash()){this.consumeChar("-");var S=this.classAtom(),P=S.type==="Character";if(P){if(S.value<y.value)throw Error("Range out of order in character class");d.push({from:y.value,to:S.value})}else s(y.value,d),d.push(n("-")),s(S.value,d)}else s(y.value,d)}return this.consumeChar("]"),{type:"Set",complement:m,value:d}},r.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},r.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:n("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.group=function(){var d=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),d=!1;break;default:this.groupIdx++;break}var m=this.disjunction();this.consumeChar(")");var y={type:"Group",capturing:d,value:m};return d&&(y.idx=this.groupIdx),y},r.prototype.positiveInteger=function(){var d=this.popChar();if(i.test(d)===!1)throw Error("Expecting a positive integer");for(;t.test(this.peekChar(0));)d+=this.popChar();return parseInt(d,10)},r.prototype.integerIncludingZero=function(){var d=this.popChar();if(t.test(d)===!1)throw Error("Expecting an integer");for(;t.test(this.peekChar(0));)d+=this.popChar();return parseInt(d,10)},r.prototype.patternCharacter=function(){var d=this.popChar();switch(d){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:n(d)}}},r.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},r.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},r.prototype.isDigit=function(){return t.test(this.peekChar(0))},r.prototype.isClassAtom=function(d){switch(d===void 0&&(d=0),this.peekChar(d)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},r.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},r.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},r.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},r.prototype.isQuantifier=function(){var d=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(d)}},r.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},r.prototype.parseHexDigits=function(d){for(var m="",y=0;y<d;y++){var B=this.popChar();if(e.test(B)===!1)throw Error("Expecting a HexDecimal digits");m+=B}var S=parseInt(m,16);return{type:"Character",value:S}},r.prototype.peekChar=function(d){return d===void 0&&(d=0),this.input[this.idx+d]},r.prototype.popChar=function(){var d=this.peekChar(0);return this.consumeChar(),d},r.prototype.consumeChar=function(d){if(d!==void 0&&this.input[this.idx]!==d)throw Error("Expected: '"+d+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(d){return{begin:d,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(d){return d.charCodeAt(0)}function s(d,m){d.length!==void 0?d.forEach(function(y){m.push(y)}):m.push(d)}function o(d,m){if(d[m]===!0)throw"duplicate flag "+m;d[m]=!0}function a(d){if(d===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var h=[n(" "),n("\f"),n(`
2024-10-01 04:49:34 +02:00
`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function p(){}return p.prototype.visitChildren=function(d){for(var m in d){var y=d[m];d.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(B){this.visit(B)},this))}},p.prototype.visit=function(d){switch(d.type){case"Pattern":this.visitPattern(d);break;case"Flags":this.visitFlags(d);break;case"Disjunction":this.visitDisjunction(d);break;case"Alternative":this.visitAlternative(d);break;case"StartAnchor":this.visitStartAnchor(d);break;case"EndAnchor":this.visitEndAnchor(d);break;case"WordBoundary":this.visitWordBoundary(d);break;case"NonWordBoundary":this.visitNonWordBoundary(d);break;case"Lookahead":this.visitLookahead(d);break;case"NegativeLookahead":this.visitNegativeLookahead(d);break;case"Character":this.visitCharacter(d);break;case"Set":this.visitSet(d);break;case"Group":this.visitGroup(d);break;case"GroupBackReference":this.visitGroupBackReference(d);break;case"Quantifier":this.visitQuantifier(d);break}this.visitChildren(d)},p.prototype.visitPattern=function(d){},p.prototype.visitFlags=function(d){},p.prototype.visitDisjunction=function(d){},p.prototype.visitAlternative=function(d){},p.prototype.visitStartAnchor=function(d){},p.prototype.visitEndAnchor=function(d){},p.prototype.visitWordBoundary=function(d){},p.prototype.visitNonWordBoundary=function(d){},p.prototype.visitLookahead=function(d){},p.prototype.visitNegativeLookahead=function(d){},p.prototype.visitCharacter=function(d){},p.prototype.visitSet=function(d){},p.prototype.visitGroup=function(d){},p.prototype.visitGroupBackReference=function(d){},p.prototype.visitQuantifier=function(d){},{RegExpParser:r,BaseRegExpVisitor:p,VERSION:"0.5.0"}})});var ey=I(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.clearRegExpParserCache=Xg.getRegExpAst=void 0;var xEe=_I(),$I={},PEe=new xEe.RegExpParser;function kEe(r){var e=r.toString();if($I.hasOwnProperty(e))return $I[e];var t=PEe.pattern(e);return $I[e]=t,t}Xg.getRegExpAst=kEe;function DEe(){$I={}}Xg.clearRegExpParserCache=DEe});var zG=I(mn=>{"use strict";var REe=mn&&mn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(mn,"__esModule",{value:!0});mn.canMatchCharCode=mn.firstCharOptimizedIndices=mn.getOptimizedStartCodesIndices=mn.failedOptimizationPrefixMsg=void 0;var qG=_I(),us=Kt(),JG=ey(),Pa=Rv(),WG="Complement Sets are not supported for first char optimization";mn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
`;function FEe(r,e){e===void 0&&(e=!1);try{var t=(0,JG.getRegExpAst)(r),i=ry(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===WG)e&&(0,us.PRINT_WARNING)(""+mn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` >
2024-10-01 04:19:50 +02:00
`)+` Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=`
This will disable the lexer's first char optimizations.
2024-10-01 04:49:34 +02:00
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,us.PRINT_ERROR)(mn.failedOptimizationPrefixMsg+`
2024-10-01 04:19:50 +02:00
`+(" Failed parsing: < "+r.toString()+` >
2024-10-01 04:49:34 +02:00
`)+(" Using the regexp-to-ast library version: "+qG.VERSION+`
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}mn.getOptimizedStartCodesIndices=FEe;function ry(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i<r.value.length;i++)ry(r.value[i],e,t);break;case"Alternative":for(var n=r.value,i=0;i<n.length;i++){var s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=s;switch(o.type){case"Character":ty(o.value,e,t);break;case"Set":if(o.complement===!0)throw Error(WG);(0,us.forEach)(o.value,function(c){if(typeof c=="number")ty(c,e,t);else{var u=c;if(t===!0)for(var g=u.from;g<=u.to;g++)ty(g,e,t);else{for(var g=u.from;g<=u.to&&g<Pa.minOptimizationVal;g++)ty(g,e,t);if(u.to>=Pa.minOptimizationVal)for(var h=u.from>=Pa.minOptimizationVal?u.from:Pa.minOptimizationVal,p=u.to,d=(0,Pa.charCodeToOptimizedIndex)(h),m=(0,Pa.charCodeToOptimizedIndex)(p),y=d;y<=m;y++)e[y]=y}}});break;case"Group":ry(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Dv(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,us.values)(e)}mn.firstCharOptimizedIndices=ry;function ty(r,e,t){var i=(0,Pa.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&NEe(r,e)}function NEe(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,Pa.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,Pa.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function YG(r,e){return(0,us.find)(r.value,function(t){if(typeof t=="number")return(0,us.contains)(e,t);var i=t;return(0,us.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function Dv(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,us.isArray)(r.value)?(0,us.every)(r.value,Dv):Dv(r.value):!1}var TEe=function(r){REe(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,us.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?YG(t,this.targetCharCodes)===void 0&&(this.found=!0):YG(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(qG.BaseRegExpVisitor);function LEe(r,e){if(e instanceof RegExp){var t=(0,JG.getRegExpAst)(e),i=new TEe(r);return i.visit(t),i.found}else return(0,us.find)(e,function(n){return(0,us.contains)(r,n.charCodeAt(0))})!==void 0}mn.canMatchCharCode=LEe});var Rv=I(We=>{"use strict";var VG=We&&We.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(We,"__esModule",{value:!0});We.charCodeToOptimizedIndex=We.minOptimizationVal=We.buildLineBreakIssueMessage=We.LineTerminatorOptimizedTester=We.isShortPattern=We.isCustomPattern=We.cloneEmptyGroups=We.performWarningRuntimeChecks=We.performRuntimeChecks=We.addStickyFlag=We.addStartOfInput=We.findUnreachablePatterns=We.findModesThatDoNotExist=We.findInvalidGroupType=We.findDuplicatePatterns=We.findUnsupportedFlags=We.findStartOfInputAnchor=We.findEmptyMatchRegExps=We.findEndOfInputAnchor=We.findInvalidPatterns=We.findMissingPatterns=We.validatePatterns=We.analyzeTokenTypes=We.enableSticky=We.disableSticky=We.SUPPORT_STICKY=We.MODES=We.DEFAULT_MODE=void 0;var XG=_I(),tr=Qd(),Se=Kt(),Zg=zG(),ZG=ey(),ko="PATTERN";We.DEFAULT_MODE="defaultMode";We.MODES="modes";We.SUPPORT_STI
`],tracer:function(S,P){return P()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){VEe()});var i;t("Reject Lexer.NA",function(){i=(0,Se.reject)(r,function(S){return S[ko]===tr.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,Se.map)(i,function(S){var P=S[ko];if((0,Se.isRegExp)(P)){var F=P.source;return F.length===1&&F!=="^"&&F!=="$"&&F!=="."&&!P.ignoreCase?F:F.length===2&&F[0]==="\\"&&!(0,Se.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],F[1])?F[1]:e.useSticky?Tv(P):Nv(P)}else{if((0,Se.isFunction)(P))return n=!0,{exec:P};if((0,Se.has)(P,"exec"))return n=!0,P;if(typeof P=="string"){if(P.length===1)return P;var H=P.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),q=new RegExp(H);return e.useSticky?Tv(q):Nv(q)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,Se.map)(i,function(S){return S.tokenTypeIdx}),a=(0,Se.map)(i,function(S){var P=S.GROUP;if(P!==tr.Lexer.SKIPPED){if((0,Se.isString)(P))return P;if((0,Se.isUndefined)(P))return!1;throw Error("non exhaustive match")}}),l=(0,Se.map)(i,function(S){var P=S.LONGER_ALT;if(P){var F=(0,Se.isArray)(P)?(0,Se.map)(P,function(H){return(0,Se.indexOf)(i,H)}):[(0,Se.indexOf)(i,P)];return F}}),c=(0,Se.map)(i,function(S){return S.PUSH_MODE}),u=(0,Se.map)(i,function(S){return(0,Se.has)(S,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var S=uY(e.lineTerminatorCharacters);g=(0,Se.map)(i,function(P){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Se.map)(i,function(P){if((0,Se.has)(P,"LINE_BREAKS"))return P.LINE_BREAKS;if(lY(P,S)===!1)return(0,Zg.canMatchCharCode)(S,P.PATTERN)}))});var h,p,d,m;t("Misc Mapping #2",function(){h=(0,Se.map)(i,Ov),p=(0,Se.map)(s,AY),d=(0,Se.reduce)(i,function(S,P){var F=P.GROUP;return(0,Se.isString)(F)&&F!==tr.Lexer.SKIPPED&&(S[F]=[]),S},{}),m=(0,Se.map)(s,function(S,P){return{pattern:s[P],longerAlt:l[P],canLineTerminator:g[P],isCustom:h[P],short:p[P],group:a[P],push:c[P],pop:u[P],tokenTypeIdx:o[P],tokenType:i[P]}})});var y=!0,B=[];return e.safeMode||t("First Char Optimization",function(){B=(0,Se.reduce)(i,function(S,P,F){if(typeof P.PATTERN=="string"){var H=P.PATTERN.charCodeAt(0),q=Lv(H);Fv(S,q,m[F])}else if((0,Se.isArray)(P.START_CHARS_HINT)){var _;(0,Se.forEach)(P.START_CHARS_HINT,function(W){var Z=typeof W=="string"?W.charCodeAt(0):W,A=Lv(Z);_!==A&&(_=A,Fv(S,A,m[F]))})}else if((0,Se.isRegExp)(P.PATTERN))if(P.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,Se.PRINT_ERROR)(""+Zg.failedOptimizationPrefixMsg+(" Unable to analyze < "+P.PATTERN.toString()+` > pattern.
2024-10-01 04:19:50 +02:00
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var X=(0,Zg.getOptimizedStartCodesIndices)(P.PATTERN,e.ensureOptimizations);(0,Se.isEmpty)(X)&&(y=!1),(0,Se.forEach)(X,function(W){Fv(S,W,m[F])})}else e.ensureOptimizations&&(0,Se.PRINT_ERROR)(""+Zg.failedOptimizationPrefixMsg+(" TokenType: <"+P.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
`)+` This will disable the lexer's first char optimizations.
2024-10-01 04:49:34 +02:00
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return S},[])}),t("ArrayPacking",function(){B=(0,Se.packArray)(B)}),{emptyGroups:d,patternIdxToConfig:m,charCodeToPatternIdxToConfig:B,hasCustom:n,canBeOptimized:y}}We.analyzeTokenTypes=KEe;function UEe(r,e){var t=[],i=_G(r);t=t.concat(i.errors);var n=$G(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(HEe(s)),t=t.concat(sY(s)),t=t.concat(oY(s,e)),t=t.concat(aY(s)),t}We.validatePatterns=UEe;function HEe(r){var e=[],t=(0,Se.filter)(r,function(i){return(0,Se.isRegExp)(i[ko])});return e=e.concat(eY(t)),e=e.concat(rY(t)),e=e.concat(iY(t)),e=e.concat(nY(t)),e=e.concat(tY(t)),e}function _G(r){var e=(0,Se.filter)(r,function(n){return!(0,Se.has)(n,ko)}),t=(0,Se.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:tr.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Se.difference)(r,e);return{errors:t,valid:i}}We.findMissingPatterns=_G;function $G(r){var e=(0,Se.filter)(r,function(n){var s=n[ko];return!(0,Se.isRegExp)(s)&&!(0,Se.isFunction)(s)&&!(0,Se.has)(s,"exec")&&!(0,Se.isString)(s)}),t=(0,Se.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:tr.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Se.difference)(r,e);return{errors:t,valid:i}}We.findInvalidPatterns=$G;var jEe=/[^\\][\$]/;function eY(r){var e=function(n){VG(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(XG.BaseRegExpVisitor),t=(0,Se.filter)(r,function(n){var s=n[ko];try{var o=(0,ZG.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return jEe.test(s.source)}}),i=(0,Se.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error:
2024-10-01 04:19:50 +02:00
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
2024-10-01 04:49:34 +02:00
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:tr.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}We.findEndOfInputAnchor=eY;function tY(r){var e=(0,Se.filter)(r,function(i){var n=i[ko];return n.test("")}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:tr.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}We.findEmptyMatchRegExps=tY;var GEe=/[^\\[][\^]|^\^/;function rY(r){var e=function(n){VG(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(XG.BaseRegExpVisitor),t=(0,Se.filter)(r,function(n){var s=n[ko];try{var o=(0,ZG.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return GEe.test(s.source)}}),i=(0,Se.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error:
2024-10-01 04:19:50 +02:00
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
2024-10-01 04:49:34 +02:00
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:tr.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}We.findStartOfInputAnchor=rY;function iY(r){var e=(0,Se.filter)(r,function(i){var n=i[ko];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:tr.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}We.findUnsupportedFlags=iY;function nY(r){var e=[],t=(0,Se.map)(r,function(s){return(0,Se.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Se.contains)(e,a)&&a.PATTERN!==tr.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Se.compact)(t);var i=(0,Se.filter)(t,function(s){return s.length>1}),n=(0,Se.map)(i,function(s){var o=(0,Se.map)(s,function(l){return l.name}),a=(0,Se.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:tr.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}We.findDuplicatePatterns=nY;function sY(r){var e=(0,Se.filter)(r,function(i){if(!(0,Se.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==tr.Lexer.SKIPPED&&n!==tr.Lexer.NA&&!(0,Se.isString)(n)}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:tr.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}We.findInvalidGroupType=sY;function oY(r,e){var t=(0,Se.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Se.contains)(e,n.PUSH_MODE)}),i=(0,Se.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:tr.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}We.findModesThatDoNotExist=oY;function aY(r){var e=[],t=(0,Se.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===tr.Lexer.NA||((0,Se.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Se.isRegExp)(o)&&qEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Se.forEach)(r,function(i,n){(0,Se.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n<a&&YEe(o,i.PATTERN)){var c="Token: ->"+l.name+`<- can never be matched.
2024-10-01 04:19:50 +02:00
`+("Because it appears AFTER the Token Type ->"+i.name+"<-")+`in the lexer's definition.
2024-10-01 04:49:34 +02:00
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:tr.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}We.findUnreachablePatterns=aY;function YEe(r,e){if((0,Se.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,Se.isFunction)(e))return e(r,0,[],{});if((0,Se.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function qEe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Se.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function Nv(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}We.addStartOfInput=Nv;function Tv(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}We.addStickyFlag=Tv;function JEe(r,e,t){var i=[];return(0,Se.has)(r,We.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+We.DEFAULT_MODE+`> property in its definition
2024-10-01 04:19:50 +02:00
`,type:tr.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Se.has)(r,We.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+We.MODES+`> property in its definition
`,type:tr.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Se.has)(r,We.MODES)&&(0,Se.has)(r,We.DEFAULT_MODE)&&!(0,Se.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+We.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist
`,type:tr.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Se.has)(r,We.MODES)&&(0,Se.forEach)(r.modes,function(n,s){(0,Se.forEach)(n,function(o,a){(0,Se.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`>
2024-10-01 04:49:34 +02:00
`),type:tr.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}We.performRuntimeChecks=JEe;function WEe(r,e,t){var i=[],n=!1,s=(0,Se.compact)((0,Se.flatten)((0,Se.mapValues)(r.modes,function(l){return l}))),o=(0,Se.reject)(s,function(l){return l[ko]===tr.Lexer.NA}),a=uY(t);return e&&(0,Se.forEach)(o,function(l){var c=lY(l,a);if(c!==!1){var u=cY(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Se.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,Zg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found.
2024-10-01 04:19:50 +02:00
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
2024-10-01 04:49:34 +02:00
for details.`,type:tr.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}We.performWarningRuntimeChecks=WEe;function zEe(r){var e={},t=(0,Se.keys)(r);return(0,Se.forEach)(t,function(i){var n=r[i];if((0,Se.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}We.cloneEmptyGroups=zEe;function Ov(r){var e=r.PATTERN;if((0,Se.isRegExp)(e))return!1;if((0,Se.isFunction)(e))return!0;if((0,Se.has)(e,"exec"))return!0;if((0,Se.isString)(e))return!1;throw Error("non exhaustive match")}We.isCustomPattern=Ov;function AY(r){return(0,Se.isString)(r)&&r.length===1?r.charCodeAt(0):!1}We.isShortPattern=AY;We.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t<e;t++){var i=r.charCodeAt(t);if(i===10)return this.lastIndex=t+1,!0;if(i===13)return r.charCodeAt(t+1)===10?this.lastIndex=t+2:this.lastIndex=t+1,!0}return!1},lastIndex:0};function lY(r,e){if((0,Se.has)(r,"LINE_BREAKS"))return!1;if((0,Se.isRegExp)(r.PATTERN)){try{(0,Zg.canMatchCharCode)(e,r.PATTERN)}catch(t){return{issue:tr.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}else{if((0,Se.isString)(r.PATTERN))return!1;if(Ov(r))return{issue:tr.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function cY(r,e){if(e.issue===tr.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
2024-10-01 04:19:50 +02:00
`+(" The problem is in the <"+r.name+`> Token Type
`)+(" Root cause: "+e.errMsg+`.
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===tr.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
`+(" The problem is in the <"+r.name+`> Token Type
2024-10-01 04:49:34 +02:00
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}We.buildLineBreakIssueMessage=cY;function uY(r){var e=(0,Se.map)(r,function(t){return(0,Se.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function Fv(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}We.minOptimizationVal=256;var iy=[];function Lv(r){return r<We.minOptimizationVal?r:iy[r]}We.charCodeToOptimizedIndex=Lv;function VEe(){if((0,Se.isEmpty)(iy)){iy=new Array(65536);for(var r=0;r<65536;r++)iy[r]=r>255?255+~~(r/255):r}}});var _g=I(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.isTokenType=Rt.hasExtendingTokensTypesMapProperty=Rt.hasExtendingTokensTypesProperty=Rt.hasCategoriesProperty=Rt.hasShortKeyProperty=Rt.singleAssignCategoriesToksMap=Rt.assignCategoriesMapProp=Rt.assignCategoriesTokensProp=Rt.assignTokenDefaultProps=Rt.expandCategories=Rt.augmentTokenTypes=Rt.tokenIdxToClass=Rt.tokenShortNameIdx=Rt.tokenStructuredMatcherNoCategories=Rt.tokenStructuredMatcher=void 0;var Vr=Kt();function XEe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Rt.tokenStructuredMatcher=XEe;function ZEe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Rt.tokenStructuredMatcherNoCategories=ZEe;Rt.tokenShortNameIdx=1;Rt.tokenIdxToClass={};function _Ee(r){var e=gY(r);fY(e),pY(e),hY(e),(0,Vr.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Rt.augmentTokenTypes=_Ee;function gY(r){for(var e=(0,Vr.cloneArr)(r),t=r,i=!0;i;){t=(0,Vr.compact)((0,Vr.flatten)((0,Vr.map)(t,function(s){return s.CATEGORIES})));var n=(0,Vr.difference)(t,e);e=e.concat(n),(0,Vr.isEmpty)(n)?i=!1:t=n}return e}Rt.expandCategories=gY;function fY(r){(0,Vr.forEach)(r,function(e){dY(e)||(Rt.tokenIdxToClass[Rt.tokenShortNameIdx]=e,e.tokenTypeIdx=Rt.tokenShortNameIdx++),Mv(e)&&!(0,Vr.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Mv(e)||(e.CATEGORIES=[]),CY(e)||(e.categoryMatches=[]),mY(e)||(e.categoryMatchesMap={})})}Rt.assignTokenDefaultProps=fY;function hY(r){(0,Vr.forEach)(r,function(e){e.categoryMatches=[],(0,Vr.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Rt.tokenIdxToClass[i].tokenTypeIdx)})})}Rt.assignCategoriesTokensProp=hY;function pY(r){(0,Vr.forEach)(r,function(e){Kv([],e)})}Rt.assignCategoriesMapProp=pY;function Kv(r,e){(0,Vr.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,Vr.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,Vr.contains)(i,t)||Kv(i,t)})}Rt.singleAssignCategoriesToksMap=Kv;function dY(r){return(0,Vr.has)(r,"tokenTypeIdx")}Rt.hasShortKeyProperty=dY;function Mv(r){return(0,Vr.has)(r,"CATEGORIES")}Rt.hasCategoriesProperty=Mv;function CY(r){return(0,Vr.has)(r,"categoryMatches")}Rt.hasExtendingTokensTypesProperty=CY;function mY(r){return(0,Vr.has)(r,"categoryMatchesMap")}Rt.hasExtendingTokensTypesMapProperty=mY;function $Ee(r){return(0,Vr.has)(r,"tokenTypeIdx")}Rt.isTokenType=$Ee});var Uv=I(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.defaultLexerErrorProvider=void 0;ny.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Qd=I(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Lexer=Ec.LexerDefinitionErrorType=void 0;var Zs=Rv(),rr=Kt(),eIe=_g(),tIe=Uv(),rIe=ey(),iIe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=
2024-10-01 04:19:50 +02:00
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:tIe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(bd);var nIe=function(){function r(e,t){var i=this;if(t===void 0&&(t=bd),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=(0,rr.merge)(bd,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===bd.lineTerminatorsPattern)i.config.lineTerminatorsPattern=Zs.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===bd.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,rr.isArray)(e)?(s={modes:{}},s.modes[Zs.DEFAULT_MODE]=(0,rr.cloneArr)(e),s[Zs.DEFAULT_MODE]=Zs.DEFAULT_MODE):(o=!1,s=(0,rr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Zs.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,Zs.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,rr.forEach)(s.modes,function(u,g){s.modes[g]=(0,rr.reject)(u,function(h){return(0,rr.isUndefined)(h)})});var a=(0,rr.keys)(s.modes);if((0,rr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Zs.validatePatterns)(u,a))}),(0,rr.isEmpty)(i.lexerDefinitionErrors)){(0,eIe.augmentTokenTypes)(u);var h;i.TRACE_INIT("analyzeTokenTypes",function(){h=(0,Zs.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=h.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=h.charCodeToPatternIdxToConfig,i.emptyGroups=(0,rr.merge)(i.emptyGroups,h.emptyGroups),i.hasCustom=h.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=h.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,rr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,rr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+c)}(0,rr.forEach)(i.lexerDefinitionWarning,function(u){(0,rr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(Zs.SUPPORT_STICKY?(i.chopInput=rr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=rr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=rr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=rr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=rr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,rr.reduce)(i.canModeBeOptimized,function(g,h,p){return h===!1&&g.push(p),g},[]);if(t.ensureOptimizations&&!(0,rr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,rIe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,rr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,rr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,rr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
2024-10-01 04:49:34 +02:00
`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,h,p,d,m,y,B,S,P,F=e,H=F.length,q=0,_=0,X=this.hasCustom?0:Math.floor(e.length/10),W=new Array(X),Z=[],A=this.trackStartLines?1:void 0,ne=this.trackStartLines?1:void 0,ue=(0,Zs.cloneEmptyGroups)(this.emptyGroups),te=this.trackStartLines,O=this.config.lineTerminatorsPattern,N=0,ce=[],he=[],Pe=[],De=[];Object.freeze(De);var Re=void 0;function se(){return ce}function Ae(fr){var Ei=(0,Zs.charCodeToOptimizedIndex)(fr),rs=he[Ei];return rs===void 0?De:rs}var ye=function(fr){if(Pe.length===1&&fr.tokenType.PUSH_MODE===void 0){var Ei=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(fr);Z.push({offset:fr.startOffset,line:fr.startLine!==void 0?fr.startLine:void 0,column:fr.startColumn!==void 0?fr.startColumn:void 0,length:fr.image.length,message:Ei})}else{Pe.pop();var rs=(0,rr.last)(Pe);ce=i.patternIdxToConfig[rs],he=i.charCodeToPatternIdxToConfig[rs],N=ce.length;var ua=i.canModeBeOptimized[rs]&&i.config.safeMode===!1;he&&ua?Re=Ae:Re=se}};function ge(fr){Pe.push(fr),he=this.charCodeToPatternIdxToConfig[fr],ce=this.patternIdxToConfig[fr],N=ce.length,N=ce.length;var Ei=this.canModeBeOptimized[fr]&&this.config.safeMode===!1;he&&Ei?Re=Ae:Re=se}ge.call(this,t);for(var oe;q<H;){c=null;var Ye=F.charCodeAt(q),ie=Re(Ye),G=ie.length;for(n=0;n<G;n++){oe=ie[n];var fe=oe.pattern;u=null;var re=oe.short;if(re!==!1?Ye===re&&(c=fe):oe.isCustom===!0?(P=fe.exec(F,q,W,ue),P!==null?(c=P[0],P.payload!==void 0&&(u=P.payload)):c=null):(this.updateLastIndex(fe,q),c=this.match(fe,e,q)),c!==null){if(l=oe.longerAlt,l!==void 0){var de=l.length;for(o=0;o<de;o++){var Ze=ce[l[o]],vt=Ze.pattern;if(g=null,Ze.isCustom===!0?(P=vt.exec(F,q,W,ue),P!==null?(a=P[0],P.payload!==void 0&&(g=P.payload)):a=null):(this.updateLastIndex(vt,q),a=this.match(vt,e,q)),a&&a.length>c.length){c=a,u=g,oe=Ze;break}}}break}}if(c!==null){if(h=c.length,p=oe.group,p!==void 0&&(d=oe.tokenTypeIdx,m=this.createTokenInstance(c,q,d,oe.tokenType,A,ne,h),this.handlePayload(m,u),p===!1?_=this.addToken(W,_,m):ue[p].push(m)),e=this.chopInput(e,h),q=q+h,ne=this.computeNewColumn(ne,h),te===!0&&oe.canLineTerminator===!0){var mt=0,Lr=void 0,ti=void 0;O.lastIndex=0;do Lr=O.test(c),Lr===!0&&(ti=O.lastIndex-1,mt++);while(Lr===!0);mt!==0&&(A=A+mt,ne=h-ti,this.updateTokenEndLineColumnLocation(m,p,ti,mt,A,ne,h))}this.handleModes(oe,ye,ge,m)}else{for(var ui=q,gr=A,gi=ne,ri=!1;!ri&&q<H;)for(B=F.charCodeAt(q),e=this.chopInput(e,1),q++,s=0;s<N;s++){var Ms=ce[s],fe=Ms.pattern,re=Ms.short;if(re!==!1?F.charCodeAt(q)===re&&(ri=!0):Ms.isCustom===!0?ri=fe.exec(F,q,W,ue)!==null:(this.updateLastIndex(fe,q),ri=fe.exec(e)!==null),ri===!0)break}y=q-ui,S=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(F,ui,y,gr,gi),Z.push({offset:ui,line:gr,column:gi,length:y,message:S})}}return this.hasCustom||(W.length=_),{tokens:W,groups:ue,errors:Z}},r.prototype.handleModes=function(e,t,i,n){if(e.pop===!0){var s=e.push;t(n),s!==void 0&&i.call(this,s)}else e.push!==void 0&&i.call(this,e.push)},r.prototype.chopInput=function(e,t){return e.substring(t)},r.prototype.updateLastIndex=function(e,t){e.lastIndex=t},r.prototype.updateTokenEndLineColumnLocation=function(e,t,i,n,s,o,a){var l,c;t!==void 0&&(l=i===a-1,c=l?-1:0,n===1&&l===!0||(e.endLine=s+c,e.endColumn=o-1+-c))},r.prototype.computeNewColumn=function(e,t){return e+t},r.prototype.createTokenInstance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null},r.prototype.createOffsetOnlyToken=function(e,t,i,n){return{image:e,startOffset:t,tokenTypeIdx:i,tokenType:n}},r.prototype.createStartOnlyToken=function(e,t,i,n,s,o){return{image:e,startOffset:t,startLine:s,startColumn:o,tokenTypeIdx:i,tokenType:n}},r.prototype.createFullToken=function(e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:i,tokenType:n}},r.prototype.addToken=function(e,t,i){return 666},r.prototype.addTokenUsingPush=function(e,t,i){return e.push(i),t},r.prototype.addTokenUsingMemberA
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,_s.has)(r,EY)&&(t.CATEGORIES=r[EY]),(0,Hv.augmentTokenTypes)([t]),(0,_s.has)(r,IY)&&(t.LABEL=r[IY]),(0,_s.has)(r,yY)&&(t.GROUP=r[yY]),(0,_s.has)(r,BY)&&(t.POP_MODE=r[BY]),(0,_s.has)(r,wY)&&(t.PUSH_MODE=r[wY]),(0,_s.has)(r,QY)&&(t.LONGER_ALT=r[QY]),(0,_s.has)(r,bY)&&(t.LINE_BREAKS=r[bY]),(0,_s.has)(r,SY)&&(t.START_CHARS_HINT=r[SY]),t}Si.EOF=xY({name:"EOF",pattern:sIe.Lexer.NA});(0,Hv.augmentTokenTypes)([Si.EOF]);function cIe(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}Si.createTokenInstance=cIe;function uIe(r,e){return(0,Hv.tokenStructuredMatcher)(r,e)}Si.tokenMatcher=uIe});var En=I(qt=>{"use strict";var ka=qt&&qt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(qt,"__esModule",{value:!0});qt.serializeProduction=qt.serializeGrammar=qt.Terminal=qt.Alternation=qt.RepetitionWithSeparator=qt.Repetition=qt.RepetitionMandatoryWithSeparator=qt.RepetitionMandatory=qt.Option=qt.Alternative=qt.Rule=qt.NonTerminal=qt.AbstractProduction=void 0;var or=Kt(),gIe=NA(),Do=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,or.forEach)(this.definition,function(t){t.accept(e)})},r}();qt.AbstractProduction=Do;var PY=function(r){ka(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(Do);qt.NonTerminal=PY;var kY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.Rule=kY;var DY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.Alternative=DY;var RY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.Option=RY;var FY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.RepetitionMandatory=FY;var NY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.RepetitionMandatoryWithSeparator=NY;var TY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.Repetition=TY;var LY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return e}(Do);qt.RepetitionWithSeparator=LY;var OY=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,or.assign)(i,(0,or.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition
2024-10-01 04:19:50 +02:00
but found: '`+a+"'";if(n)return o+n+l;var c=(0,$s.reduce)(e,function(p,d){return p.concat(d)},[]),u=(0,$s.map)(c,function(p){return"["+(0,$s.map)(p,function(d){return(0,ef.tokenLabel)(d)}).join(", ")+"]"}),g=(0,$s.map)(u,function(p,d){return" "+(d+1)+". "+p}),h=`one of these possible Token sequences:
`+g.join(`
`);return o+h+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,$s.first)(t).image,a=`
but found: '`+o+"'";if(i)return s+i+a;var l=(0,$s.map)(e,function(u){return"["+(0,$s.map)(u,function(g){return(0,ef.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences::
`+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Da.defaultParserErrorProvider);Da.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
2024-10-01 04:49:34 +02:00
inside top level rule: ->`+r.name+"<-";return t}};Da.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Wv.Terminal?u.terminalType.name:u instanceof Wv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,$s.first)(e),s=n.idx,o=(0,VY.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+`
2024-10-01 04:19:50 +02:00
appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-.
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar.
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>.
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,$s.map)(r.prefixPath,function(n){return(0,ef.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
`+("in <OR"+t+"> inside <"+r.topLevelRule.name+`> Rule,
`)+("<"+e+`> may appears as a prefix path in all these alternatives.
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,$s.map)(r.prefixPath,function(n){return(0,ef.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in <OR"+t+">"+(" inside <"+r.topLevelRule.name+`> Rule,
`)+("<"+e+`> may appears as a prefix path in all these alternatives.
`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
2024-10-01 04:49:34 +02:00
For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,VY.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens.
2024-10-01 04:19:50 +02:00
This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in <OR"+r.alternation.idx+"> inside <"+r.topLevelRule.name+`> Rule.
`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives:
`+("<OR"+r.alternation.idx+"> inside <"+r.topLevelRule.name+`> Rule.
has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=xIe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar.
`+("rule: <"+e+`> can be invoked from itself (directly or indirectly)
`)+(`without consuming any Tokens. The grammar path that causes this is:
`+i+`
`)+` To fix this refactor your grammar to remove the left recursion.
2024-10-01 04:49:34 +02:00
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Wv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var _Y=I(TA=>{"use strict";var PIe=TA&&TA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(TA,"__esModule",{value:!0});TA.GastRefResolverVisitor=TA.resolveGrammar=void 0;var kIe=Yn(),XY=Kt(),DIe=$g();function RIe(r,e){var t=new ZY(r,e);return t.resolveRefs(),t.errors}TA.resolveGrammar=RIe;var ZY=function(r){PIe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,XY.forEach)((0,XY.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:kIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(DIe.GAstVisitor);TA.GastRefResolverVisitor=ZY});var Dd=I(Fr=>{"use strict";var Ic=Fr&&Fr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.nextPossibleTokensAfter=Fr.possiblePathsFrom=Fr.NextTerminalAfterAtLeastOneSepWalker=Fr.NextTerminalAfterAtLeastOneWalker=Fr.NextTerminalAfterManySepWalker=Fr.NextTerminalAfterManyWalker=Fr.AbstractNextTerminalAfterProductionWalker=Fr.NextAfterTokenWalker=Fr.AbstractNextPossibleTokensWalker=void 0;var $Y=ay(),Lt=Kt(),FIe=qv(),kt=En(),eq=function(r){Ic(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Lt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Lt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Lt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}($Y.RestWalker);Fr.AbstractNextPossibleTokensWalker=eq;var NIe=function(r){Ic(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminal
2024-10-01 04:19:50 +02:00
`+(""+s.join(`
`).replace(/\n/g,`
2024-10-01 04:49:34 +02:00
`)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}vi.createBaseSemanticVisitorConstructor=Sye;function vye(r,e,t){var i=function(){};(0,Td.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,hs.forEach)(e,function(s){n[s]=Rq}),i.prototype=n,i.prototype.constructor=i,i}vi.createBaseVisitorConstructorWithDefaults=vye;var ax;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(ax=vi.CstVisitorDefinitionError||(vi.CstVisitorDefinitionError={}));function Fq(r,e){var t=Nq(r,e),i=Tq(r,e);return t.concat(i)}vi.validateVisitor=Fq;function Nq(r,e){var t=(0,hs.map)(e,function(i){if(!(0,hs.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,Td.functionName)(r.constructor)+" CST Visitor.",type:ax.MISSING_METHOD,methodName:i}});return(0,hs.compact)(t)}vi.validateMissingCstMethods=Nq;var xye=["constructor","visit","validateVisitor"];function Tq(r,e){var t=[];for(var i in r)(0,hs.isFunction)(r[i])&&!(0,hs.contains)(xye,i)&&!(0,hs.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,Td.functionName)(r.constructor)+` CST Visitor
2024-10-01 04:19:50 +02:00
There is no Grammar Rule corresponding to this method's name.
2024-10-01 04:49:34 +02:00
`,type:ax.REDUNDANT_METHOD,methodName:i});return t}vi.validateRedundantMethods=Tq});var Mq=I(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.TreeBuilder=void 0;var sf=Pq(),Xr=Kt(),Oq=Lq(),Pye=Yn(),kye=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,Xr.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:Pye.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Xr.NOOP,this.cstFinallyStateUpdate=Xr.NOOP,this.cstPostTerminal=Xr.NOOP,this.cstPostNonTerminal=Xr.NOOP,this.cstPostRule=Xr.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=sf.setNodeLocationFull,this.setNodeLocationFromNode=sf.setNodeLocationFull,this.cstPostRule=Xr.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Xr.NOOP,this.setNodeLocationFromNode=Xr.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=sf.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=sf.setNodeLocationOnlyOffset,this.cstPostRule=Xr.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Xr.NOOP,this.setNodeLocationFromNode=Xr.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Xr.NOOP,this.setNodeLocationFromNode=Xr.NOOP,this.cstPostRule=Xr.NOOP,this.setInitialNodeLocation=Xr.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,sf.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,sf.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,Xr.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,Oq.createBaseSemanticVisitorConstructor)(this.className,(0,Xr.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,Xr.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,Oq.createBaseVisitorConstructorWithDefaults)(this.className,(0,Xr.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortNa
2024-10-01 04:19:50 +02:00
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
2024-10-01 04:49:34 +02:00
For Further details.`);if((0,Pr.isArray)(e)){if((0,Pr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty.
2024-10-01 04:19:50 +02:00
Note that the first argument for the parser constructor
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
2024-10-01 04:49:34 +02:00
For Further details.`)}if((0,Pr.isArray)(e))this.tokensMap=(0,Pr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Pr.has)(e,"modes")&&(0,Pr.every)((0,Pr.flatten)((0,Pr.values)(e.modes)),Ld.isTokenType)){var i=(0,Pr.flatten)((0,Pr.values)(e.modes)),n=(0,Pr.uniq)(i);this.tokensMap=(0,Pr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Pr.isObject)(e))this.tokensMap=(0,Pr.cloneObj)(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=qq.EOF;var s=(0,Pr.every)((0,Pr.values)(e),function(o){return(0,Pr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Ld.tokenStructuredMatcherNoCategories:Ld.tokenStructuredMatcher,(0,Ld.augmentTokenTypes)((0,Pr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Pr.has)(i,"resyncEnabled")?i.resyncEnabled:Yq.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Pr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:Yq.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<<qn.BITS_FOR_METHOD_TYPE+qn.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;function a(u){try{if(this.outputCst===!0){t.apply(this,u);var g=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(g),g}else return t.apply(this,u)}catch(h){return this.invokeRuleCatch(h,n,s)}finally{this.ruleFinallyStateUpdate()}}var l=function(u,g){return u===void 0&&(u=0),this.ruleInvocationStateUpdate(o,e,u),a.call(this,g)},c="ruleName";return l[c]=e,l.originalGrammarAction=t,l},r.prototype.invokeRuleCatch=function(e,t,i){var n=this.RULE_STACK.length===1,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,yy.isRecognitionException)(e)){var o=e;if(s){var a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){var l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return i();else{if(this.outputCst){var l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,o.partialCstResult=l}throw o}}else{if(n)return this.moveToTerminatedState(),i();throw o}}else throw e},r.prototype.optionInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.OPTION_IDX,t);return this.optionInternalLogic(e,t,i)},r.prototype.optionInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(e.DEF!==void 0){if(o=e.DEF,a=e.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=e;if(s.call(this)===!0)return o.call(this)},r.prototype.atLeastOneInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,i)},r.prototype.atLeastOneInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(t.DEF!==void 0){if(o=t.DEF,a=t.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=t;if(s.call(this)===!0)for(var c=this.doSingleRepetition(o);s.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);else throw this.raiseEarlyExitException(e,Gq.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,qn.AT_LEAST_ONE_IDX,e,of.NextTerminalAfterAtLeastOneWalker)},r.prototype.atLeastOneSepFirstInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,i)},r.prototype.atLeastOneSepFirstInternalLogic=function(e,t,i){var n=this,s=t.DEF,o=t.SEP,a=this.getLaFuncFromCache(i);if(a.call(this)===!0){s.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,l,s,of.NextTerminalAfterAtLeastOneSepWalker],l,qn.AT_LEAST_ONE_SEP_IDX,e,of.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,Gq.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)},r.prototype.manyInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.MANY_IDX,e);return this.manyInternalLogic(e,t,i)},r.prototype.manyInternalLogic=function(e,t,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(t.DEF!==void 0){if(o=t.DEF,a=t.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=t;for(var c=!0;s.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],s,qn.MANY_IDX,e,of.NextTerminalAfterManyWalker,c)},r.prototype.manySepFirstInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,i)},r.prototype.manySepFirstInternalLogic=function(e,t,i){var n=this,s=t.DEF,o=t.SEP,a=this.getLaFuncFromCache(i);if(a.call(this)===!0){s.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),o)};this.tokenMatcher(this.LA(1)
2024-10-01 04:19:50 +02:00
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(nJ);var Jye={name:`This CSTNode indicates the Parser is in Recording Phase
2024-10-01 04:49:34 +02:00
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Wye=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return Yye.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new Lo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
2024-10-01 04:19:50 +02:00
This error was thrown during the "grammar recording phase" For more info see:
2024-10-01 04:49:34 +02:00
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return Od.call(this,Lo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){Od.call(this,Lo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Od.call(this,Lo.RepetitionMandatoryWithSeparator,t,e,_q)},r.prototype.manyInternalRecord=function(e,t){Od.call(this,Lo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){Od.call(this,Lo.RepetitionWithSeparator,t,e,_q)},r.prototype.orInternalRecord=function(e,t){return zye.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(by(t),!e||(0,wn.has)(e,"ruleName")===!1){var n=new Error("<SUBRULE"+eJ(t)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(`
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,wn.peek)(this.recordingProdStack),o=e.ruleName,a=new Lo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?Jye:Sy},r.prototype.consumeInternalRecord=function(e,t,i){if(by(t),!(0,tJ.hasShortKeyProperty)(e)){var n=new Error("<CONSUME"+eJ(t)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(`
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,wn.peek)(this.recordingProdStack),o=new Lo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),nJ},r}();vy.GastRecorder=Wye;function Od(r,e,t,i){i===void 0&&(i=!1),by(t);var n=(0,wn.peek)(this.recordingProdStack),s=(0,wn.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,wn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),Sy}function zye(r,e){var t=this;by(e);var i=(0,wn.peek)(this.recordingProdStack),n=(0,wn.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new Lo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,wn.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,wn.some)(s,function(l){return(0,wn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,wn.forEach)(s,function(l){var c=new Lo.Alternative({definition:[]});o.definition.push(c),(0,wn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,wn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),Sy}function eJ(r){return r===0?"":""+r}function by(r){if(r<0||r>$q){var e=new Error("Invalid DSL Method idx value: <"+r+`>
`+("Idx value must be a none negative value smaller than "+($q+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var aJ=I(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.PerformanceTracer=void 0;var oJ=Kt(),Vye=Yn(),Xye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,oJ.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:1/0,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Vye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(i+"--> <"+e+">");var n=(0,oJ.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(i+"<-- <"+e+"> time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();xy.PerformanceTracer=Xye});var AJ=I(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.applyMixins=void 0;function Zye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}Py.applyMixins=Zye});var Yn=I(hr=>{"use strict";var uJ=hr&&hr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(hr,"__esModule",{value:!0});hr.EmbeddedActionsParser=hr.CstParser=hr.Parser=hr.EMPTY_ALT=hr.ParserDefinitionErrorType=hr.DEFAULT_RULE_CONFIG=hr.DEFAULT_PARSER_CONFIG=hr.END_OF_FILE=void 0;var en=Kt(),_ye=zY(),lJ=NA(),gJ=Pd(),cJ=Iq(),$ye=sx(),ewe=xq(),twe=Mq(),rwe=Uq(),iwe=jq(),nwe=Jq(),swe=zq(),owe=Zq(),awe=sJ(),Awe=aJ(),lwe=AJ();hr.END_OF_FILE=(0,lJ.createTokenInstance)(lJ.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(hr.END_OF_FILE);hr.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:gJ.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});hr.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var cwe;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(cwe=hr.ParserDefinitionErrorType||(hr.ParserDefinitionErrorType={}));function uwe(r){return r===void 0&&(r=void 0),function(){return r}}hr.EMPTY_ALT=uwe;var ky=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,en.has)(t,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
2024-10-01 04:19:50 +02:00
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
2024-10-01 04:49:34 +02:00
For further details.`);this.skipValidations=(0,en.has)(t,"skipValidations")?t.skipValidations:hr.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,en.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,en.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,cJ.resolveGrammar)({rules:(0,en.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,en.isEmpty)(n)&&e.skipValidations===!1){var s=(0,cJ.validateGrammar)({rules:(0,en.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,en.values)(e.tokensMap),errMsgProvider:gJ.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,en.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,_ye.computeAllProdsFollows)((0,en.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,en.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,en.isEmpty)(e.definitionErrors))throw t=(0,en.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected:
2024-10-01 04:19:50 +02:00
`+t.join(`
-------------------------------
2024-10-01 04:49:34 +02:00
`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();hr.Parser=ky;(0,lwe.applyMixins)(ky,[$ye.Recoverable,ewe.LooksAhead,twe.TreeBuilder,rwe.LexerAdapter,nwe.RecognizerEngine,iwe.RecognizerApi,swe.ErrorHandler,owe.ContentAssist,awe.GastRecorder,Awe.PerformanceTracer]);var gwe=function(r){uJ(e,r);function e(t,i){i===void 0&&(i=hr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,en.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(ky);hr.CstParser=gwe;var fwe=function(r){uJ(e,r);function e(t,i){i===void 0&&(i=hr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,en.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(ky);hr.EmbeddedActionsParser=fwe});var hJ=I(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.createSyntaxDiagramsCode=void 0;var fJ=kv();function hwe(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+fJ.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+fJ.VERSION+"/diagrams/diagrams.css":s,a=`
2024-10-01 04:19:50 +02:00
<!-- This is a generated file -->
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background-color: hsl(30, 20%, 95%)
}
</style>
`,l=`
<link rel='stylesheet' href='`+o+`'>
`,c=`
<script src='`+n+`vendor/railroad-diagrams.js'><\/script>
<script src='`+n+`src/diagrams_builder.js'><\/script>
<script src='`+n+`src/diagrams_behavior.js'><\/script>
<script src='`+n+`src/main.js'><\/script>
`,u=`
<div id="diagrams" align="center"></div>
`,g=`
<script>
window.serializedGrammar = `+JSON.stringify(r,null," ")+`;
<\/script>
`,h=`
<script>
var diagramsDiv = document.getElementById("diagrams");
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
<\/script>
2024-10-01 04:49:34 +02:00
`;return a+l+c+u+g+h}Dy.createSyntaxDiagramsCode=hwe});var CJ=I(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Parser=qe.createSyntaxDiagramsCode=qe.clearCache=qe.GAstVisitor=qe.serializeProduction=qe.serializeGrammar=qe.Terminal=qe.Rule=qe.RepetitionWithSeparator=qe.RepetitionMandatoryWithSeparator=qe.RepetitionMandatory=qe.Repetition=qe.Option=qe.NonTerminal=qe.Alternative=qe.Alternation=qe.defaultLexerErrorProvider=qe.NoViableAltException=qe.NotAllInputParsedException=qe.MismatchedTokenException=qe.isRecognitionException=qe.EarlyExitException=qe.defaultParserErrorProvider=qe.tokenName=qe.tokenMatcher=qe.tokenLabel=qe.EOF=qe.createTokenInstance=qe.createToken=qe.LexerDefinitionErrorType=qe.Lexer=qe.EMPTY_ALT=qe.ParserDefinitionErrorType=qe.EmbeddedActionsParser=qe.CstParser=qe.VERSION=void 0;var pwe=kv();Object.defineProperty(qe,"VERSION",{enumerable:!0,get:function(){return pwe.VERSION}});var Ry=Yn();Object.defineProperty(qe,"CstParser",{enumerable:!0,get:function(){return Ry.CstParser}});Object.defineProperty(qe,"EmbeddedActionsParser",{enumerable:!0,get:function(){return Ry.EmbeddedActionsParser}});Object.defineProperty(qe,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return Ry.ParserDefinitionErrorType}});Object.defineProperty(qe,"EMPTY_ALT",{enumerable:!0,get:function(){return Ry.EMPTY_ALT}});var pJ=Qd();Object.defineProperty(qe,"Lexer",{enumerable:!0,get:function(){return pJ.Lexer}});Object.defineProperty(qe,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return pJ.LexerDefinitionErrorType}});var af=NA();Object.defineProperty(qe,"createToken",{enumerable:!0,get:function(){return af.createToken}});Object.defineProperty(qe,"createTokenInstance",{enumerable:!0,get:function(){return af.createTokenInstance}});Object.defineProperty(qe,"EOF",{enumerable:!0,get:function(){return af.EOF}});Object.defineProperty(qe,"tokenLabel",{enumerable:!0,get:function(){return af.tokenLabel}});Object.defineProperty(qe,"tokenMatcher",{enumerable:!0,get:function(){return af.tokenMatcher}});Object.defineProperty(qe,"tokenName",{enumerable:!0,get:function(){return af.tokenName}});var dwe=Pd();Object.defineProperty(qe,"defaultParserErrorProvider",{enumerable:!0,get:function(){return dwe.defaultParserErrorProvider}});var Md=nf();Object.defineProperty(qe,"EarlyExitException",{enumerable:!0,get:function(){return Md.EarlyExitException}});Object.defineProperty(qe,"isRecognitionException",{enumerable:!0,get:function(){return Md.isRecognitionException}});Object.defineProperty(qe,"MismatchedTokenException",{enumerable:!0,get:function(){return Md.MismatchedTokenException}});Object.defineProperty(qe,"NotAllInputParsedException",{enumerable:!0,get:function(){return Md.NotAllInputParsedException}});Object.defineProperty(qe,"NoViableAltException",{enumerable:!0,get:function(){return Md.NoViableAltException}});var Cwe=Uv();Object.defineProperty(qe,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return Cwe.defaultLexerErrorProvider}});var Oo=En();Object.defineProperty(qe,"Alternation",{enumerable:!0,get:function(){return Oo.Alternation}});Object.defineProperty(qe,"Alternative",{enumerable:!0,get:function(){return Oo.Alternative}});Object.defineProperty(qe,"NonTerminal",{enumerable:!0,get:function(){return Oo.NonTerminal}});Object.defineProperty(qe,"Option",{enumerable:!0,get:function(){return Oo.Option}});Object.defineProperty(qe,"Repetition",{enumerable:!0,get:function(){return Oo.Repetition}});Object.defineProperty(qe,"RepetitionMandatory",{enumerable:!0,get:function(){return Oo.RepetitionMandatory}});Object.defineProperty(qe,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return Oo.RepetitionMandatoryWithSeparator}});Object.defineProperty(qe,"RepetitionWithSeparator",{enumerable:!0,get:function(){return Oo.RepetitionWithSeparator}});Object.defineProperty(qe,"Rule",{enumerable:!0,get:function(){return Oo.Rule}});Object.defineProperty(qe,"Terminal",{enumerable:!0,get:function(){return Oo.Terminal}});var dJ=En();Object.defineProperty(qe,"serializeGrammar",{enumerable:!0,get:function(
2024-10-01 04:19:50 +02:00
It performs no action other than printing this message.
Please avoid using it as it will be completely removed in the future`)}qe.clearCache=Ewe;var Iwe=hJ();Object.defineProperty(qe,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return Iwe.createSyntaxDiagramsCode}});var ywe=function(){function r(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
2024-10-01 04:49:34 +02:00
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return r}();qe.Parser=ywe});var IJ=I((rtt,EJ)=>{var Fy=CJ(),Na=Fy.createToken,mJ=Fy.tokenMatcher,ux=Fy.Lexer,wwe=Fy.EmbeddedActionsParser;EJ.exports=r=>{let e=Na({name:"LogicalOperator",pattern:ux.NA}),t=Na({name:"Or",pattern:/\|/,categories:e}),i=Na({name:"Xor",pattern:/\^/,categories:e}),n=Na({name:"And",pattern:/&/,categories:e}),s=Na({name:"Not",pattern:/!/}),o=Na({name:"LParen",pattern:/\(/}),a=Na({name:"RParen",pattern:/\)/}),l=Na({name:"Query",pattern:r}),u=[Na({name:"WhiteSpace",pattern:/\s+/,group:ux.SKIPPED}),t,i,n,o,a,s,e,l],g=new ux(u);class h extends wwe{constructor(d){super(u),this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let y=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let B=y,S=this.CONSUME(e),P=this.SUBRULE2(this.atomicExpression);mJ(S,t)?y=F=>B(F)||P(F):mJ(S,i)?y=F=>!!(B(F)^P(F)):y=F=>B(F)&&P(F)}),y}),this.RULE("atomicExpression",()=>this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>{let{image:m}=this.CONSUME(l);return y=>y(m)}},{ALT:()=>{this.CONSUME(s);let m=this.SUBRULE(this.atomicExpression);return y=>!m(y)}}])),this.RULE("parenthesisExpression",()=>{let m;return this.CONSUME(o),m=this.SUBRULE(this.expression),this.CONSUME(a),m}),this.performSelfAnalysis()}}return{TinylogicLexer:g,TinylogicParser:h}}});var yJ=I(Ny=>{var Bwe=IJ();Ny.makeParser=(r=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:t}=Bwe(r),i=new t;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};Ny.parse=Ny.makeParser()});var BJ=I((ntt,wJ)=>{"use strict";wJ.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedr
2024-10-01 04:19:50 +02:00
`:`
`)+t,n=i+1,i=r.indexOf(`
2024-10-01 04:49:34 +02:00
`,n)}while(i!==-1);return s+=r.substr(n),s};HJ.exports={stringReplaceAll:Lwe,stringEncaseCRLFWithFirstIndex:Owe}});var WJ=I((gtt,JJ)=>{"use strict";var Mwe=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,GJ=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Kwe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Uwe=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Hwe=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function qJ(r){let e=r[0]==="u",t=r[1]==="{";return e&&!t&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):e&&t?String.fromCodePoint(parseInt(r.slice(2,-1),16)):Hwe.get(r)||r}function jwe(r,e){let t=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))t.push(o);else if(n=s.match(Kwe))t.push(n[2].replace(Uwe,(a,l,c)=>l?qJ(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${r}')`)}return t}function Gwe(r){GJ.lastIndex=0;let e=[],t;for(;(t=GJ.exec(r))!==null;){let i=t[1];if(t[2]){let n=jwe(i,t[2]);e.push([i].concat(n))}else e.push([i])}return e}function YJ(r,e){let t={};for(let n of e)for(let s of n.styles)t[s[0]]=n.inverse?null:s.slice(1);let i=r;for(let[n,s]of Object.entries(t))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`Unknown Chalk style: ${n}`);i=s.length>0?i[n](...s):i[n]}return i}JJ.exports=(r,e)=>{let t=[],i=[],n=[];if(e.replace(Mwe,(s,o,a,l,c,u)=>{if(o)n.push(qJ(o));else if(l){let g=n.join("");n=[],i.push(t.length===0?g:YJ(r,t)(g)),t.push({inverse:a,styles:Gwe(l)})}else if(c){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(YJ(r,t)(n.join(""))),n=[],t.pop()}else n.push(u)}),i.push(n.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return i.join("")}});var wx=I((ftt,ZJ)=>{"use strict";var Ud=TJ(),{stdout:mx,stderr:Ex}=UJ(),{stringReplaceAll:Ywe,stringEncaseCRLFWithFirstIndex:qwe}=jJ(),zJ=["ansi","ansi","ansi256","ansi16m"],uf=Object.create(null),Jwe=(r,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let t=mx?mx.level:0;r.level=e.level===void 0?t:e.level},Ix=class{constructor(e){return VJ(e)}},VJ=r=>{let e={};return Jwe(e,r),e.template=(...t)=>Vwe(e.template,...t),Object.setPrototypeOf(e,Oy.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Ix,e.template};function Oy(r){return VJ(r)}for(let[r,e]of Object.entries(Ud))uf[r]={get(){let t=My(this,yx(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,r,{value:t}),t}};uf.visible={get(){let r=My(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:r}),r}};var XJ=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let r of XJ)uf[r]={get(){let{level:e}=this;return function(...t){let i=yx(Ud.color[zJ[e]][r](...t),Ud.color.close,this._styler);return My(this,i,this._isEmpty)}}};for(let r of XJ){let e="bg"+r[0].toUpperCase()+r.slice(1);uf[e]={get(){let{level:t}=this;return function(...i){let n=yx(Ud.bgColor[zJ[t]][r](...i),Ud.bgColor.close,this._styler);return My(this,n,this._isEmpty)}}}}var Wwe=Object.defineProperties(()=>{},{...uf,level:{enumerable:!0,get(){return this._generator.level},set(r){this._generator.level=r}}}),yx=(r,e,t)=>{let i,n;return t===void 0?(i=r,n=e):(i=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:i,closeAll:n,parent:t}},My=(r,e,t)=>{let i=(...n)=>zwe(i,n.length===1?""+n[0]:n.join(" "));return i.__proto__=Wwe,i._generator=r,i._styler=e,i._isEmpty=t,i},zwe=(r,e)=>{if(r.level<=0||!e)return r._isEmpty?"":e;let t=r._styler;if(t===void 0)return e;let{openAll:i,closeAll:n}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=Ywe(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
2024-10-01 04:19:50 +02:00
`);return s!==-1&&(e=qwe(e,n,i,s)),i+e+n},Cx,Vwe=(r,...e)=>{let[t]=e;if(!Array.isArray(t))return e.join(" ");let i=e.slice(1),n=[t.raw[0]];for(let s=1;s<t.length;s++)n.push(String(i[s-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[s]));return Cx===void 0&&(Cx=WJ()),Cx(r,n.join(""))};Object.defineProperties(Oy.prototype,uf);var Hd=Oy();Hd.supportsColor=mx;Hd.stderr=Oy({level:Ex?Ex.level:0});Hd.stderr.supportsColor=Ex;Hd.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};ZJ.exports=Hd});var Ky=I(ds=>{"use strict";ds.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;ds.find=(r,e)=>r.nodes.find(t=>t.type===e);ds.exceedsLimit=(r,e,t=1,i)=>i===!1||!ds.isInteger(r)||!ds.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=i;ds.escapeNode=(r,e=0,t)=>{let i=r.nodes[e];!i||(t&&i.type===t||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};ds.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;ds.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;ds.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;ds.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);ds.flatten=(...r)=>{let e=[],t=i=>{for(let n=0;n<i.length;n++){let s=i[n];Array.isArray(s)?t(s,e):s!==void 0&&e.push(s)}return e};return t(r),e}});var Uy=I((ptt,$J)=>{"use strict";var _J=Ky();$J.exports=(r,e={})=>{let t=(i,n={})=>{let s=e.escapeInvalid&&_J.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(s||o)&&_J.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=t(l);return a};return t(r)}});var t3=I((dtt,e3)=>{"use strict";e3.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var c3=I((Ctt,l3)=>{"use strict";var r3=t3(),wc=(r,e,t)=>{if(r3(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(r3(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...t};typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let n=String(i.relaxZeros),s=String(i.shorthand),o=String(i.capture),a=String(i.wrap),l=r+":"+e+"="+n+s+o+a;if(wc.cache.hasOwnProperty(l))return wc.cache[l].result;let c=Math.min(r,e),u=Math.max(r,e);if(Math.abs(c-u)===1){let m=r+"|"+e;return i.capture?`(${m})`:i.wrap===!1?m:`(?:${m})`}let g=A3(r)||A3(e),h={min:r,max:e,a:c,b:u},p=[],d=[];if(g&&(h.isPadded=g,h.maxLen=String(h.max).length),c<0){let m=u<0?Math.abs(u):1;d=i3(m,Math.abs(c),h,i),c=h.a=0}return u>=0&&(p=i3(c,u,h,i)),h.negatives=d,h.positives=p,h.result=Xwe(d,p,i),i.capture===!0?h.result=`(${h.result})`:i.wrap!==!1&&p.length+d.length>1&&(h.result=`(?:${h.result})`),wc.cache[l]=h,h.result};function Xwe(r,e,t){let i=Bx(r,e,"-",!1,t)||[],n=Bx(e,r,"",!1,t)||[],s=Bx(r,e,"-?",!0,t)||[];return i.concat(s).concat(n).join("|")}function Zwe(r,e){let t=1,i=1,n=s3(r,t),s=new Set([e]);for(;r<=n&&n<=e;)s.add(n),t+=1,n=s3(r,t);for(n=o3(e+1,i)-1;r<n&&n<=e;)s.add(n),i+=1,n=o3(e+1,i)-1;return s=[...s],s.sort(eBe),s}function _we(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let i=$we(r,e),n=i.length,s="",o=0;for(let a=0;a<n;a++){let[l,c]=i[a];l===c?s+=l:l!=="0"||c!=="9"?s+=tBe(l,c,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:n}}function i3(r,e,t,i){let n=Zwe(r,e),s=[],o=r,a;for(let l=0;l<n.length;l++){let c=n[l],u=_we(String(o),String(c),i),g="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+a3(a.count),o=c+1;continue}t.isPadded&&(g=rBe(c,t,i)),u.string=g+u.pattern+a3(u.count),s.push(u),o=c+1,a=u}return s}function Bx(r,e,t,i,n){let s=[];for(let o of r){let{string:a}=o;!i&&!n3(e,"strin
2024-10-01 04:49:34 +02:00
`,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var D3=I((wtt,k3)=>{"use strict";var pBe=Uy(),{MAX_LENGTH:v3,CHAR_BACKSLASH:vx,CHAR_BACKTICK:dBe,CHAR_COMMA:CBe,CHAR_DOT:mBe,CHAR_LEFT_PARENTHESES:EBe,CHAR_RIGHT_PARENTHESES:IBe,CHAR_LEFT_CURLY_BRACE:yBe,CHAR_RIGHT_CURLY_BRACE:wBe,CHAR_LEFT_SQUARE_BRACKET:x3,CHAR_RIGHT_SQUARE_BRACKET:P3,CHAR_DOUBLE_QUOTE:BBe,CHAR_SINGLE_QUOTE:QBe,CHAR_NO_BREAK_SPACE:bBe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:SBe}=S3(),vBe=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(v3,t.maxLength):v3;if(r.length>i)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${i})`);let n={type:"root",input:r,nodes:[]},s=[n],o=n,a=n,l=0,c=r.length,u=0,g=0,h,p={},d=()=>r[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});u<c;)if(o=s[s.length-1],h=d(),!(h===SBe||h===bBe)){if(h===vx){m({type:"text",value:(e.keepEscaping?h:"")+d()});continue}if(h===P3){m({type:"text",value:"\\"+h});continue}if(h===x3){l++;let y=!0,B;for(;u<c&&(B=d());){if(h+=B,B===x3){l++;continue}if(B===vx){h+=d();continue}if(B===P3&&(l--,l===0))break}m({type:"text",value:h});continue}if(h===EBe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:h});continue}if(h===IBe){if(o.type!=="paren"){m({type:"text",value:h});continue}o=s.pop(),m({type:"text",value:h}),o=s[s.length-1];continue}if(h===BBe||h===QBe||h===dBe){let y=h,B;for(e.keepQuotes!==!0&&(h="");u<c&&(B=d());){if(B===vx){h+=B+d();continue}if(B===y){e.keepQuotes===!0&&(h+=B);break}h+=B}m({type:"text",value:h});continue}if(h===yBe){g++;let B={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:g,commas:0,ranges:0,nodes:[]};o=m(B),s.push(o),m({type:"open",value:h});continue}if(h===wBe){if(o.type!=="brace"){m({type:"text",value:h});continue}let y="close";o=s.pop(),o.close=!0,m({type:y,value:h}),g--,o=s[s.length-1];continue}if(h===CBe&&g>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:pBe(o)}]}m({type:"comma",value:h}),o.commas++;continue}if(h===mBe&&g>0&&o.commas===0){let y=o.nodes;if(g===0||y.length===0){m({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let B=y[y.length-1];B.value+=a.value+h,a=B,o.ranges--;continue}m({type:"dot",value:h});continue}m({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let y=s[s.length-1],B=y.nodes.indexOf(o);y.nodes.splice(B,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};k3.exports=vBe});var N3=I((Btt,F3)=>{"use strict";var R3=Uy(),xBe=y3(),PBe=Q3(),kBe=D3(),Jn=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let n=Jn.create(i,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(Jn.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Jn.parse=(r,e={})=>kBe(r,e);Jn.stringify=(r,e={})=>R3(typeof r=="string"?Jn.parse(r,e):r,e);Jn.compile=(r,e={})=>(typeof r=="string"&&(r=Jn.parse(r,e)),xBe(r,e));Jn.expand=(r,e={})=>{typeof r=="string"&&(r=Jn.parse(r,e));let t=PBe(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Jn.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?Jn.compile(r,e):Jn.expand(r,e);F3.exports=Jn});var Gd=I((Qtt,K3)=>{"use strict";var DBe=J("path"),Mo="\\\\/",T3=`[^${Mo}]`,Ta="\\.",RBe="\\+",FBe="\\?",jy="\\/",NBe="(?=.)",L3="[^/]",xx=`(?:${jy}|$)`,O3=`(?:^|${jy
Please report this to https://github.com/szmarczak/http2-wrapper/`);d(m)}return}i[0].resolve(p);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...i),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let l=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let u=`${a}:${o}`,g=!1;try{let h=dPe.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u),...t});h[on]=0,h[Uf]=!1;let p=()=>h[on]<h.remoteSettings.maxConcurrentStreams,d=!0;h.socket.once("session",y=>{this.tlsSessionCache.set(u,y)}),h.once("error",y=>{for(let{reject:B}of i)B(y);this.tlsSessionCache.delete(u)}),h.setTimeout(this.timeout,()=>{h.destroy()}),h.once("close",()=>{if(g){d&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[o];y.splice(y.indexOf(h),1),y.length===0&&delete this.sessions[o]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:B}of i)B(y);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!p())){for(let y of h[ws])if(y in this.queue[o]){let{listeners:B}=this.queue[o][y];for(;B.length!==0&&p();)B.shift().resolve(h);let S=this.queue[o];if(S[y].listeners.length===0&&(delete S[y],Object.keys(S).length===0)){delete this.queue[o];break}if(!p())break}}};h.on("origin",()=>{h[ws]=h.originSet,p()&&(m(),UD(this.sessions[o],h))}),h.once("remoteSettings",()=>{if(h.ref(),h.unref(),this._sessionsCount++,c.destroyed){let y=new Error("Agent has been destroyed");for(let B of i)B.reject(y);h.destroy();return}h[ws]=h.originSet;{let y=this.sessions;if(o in y){let B=y[o];B.splice(EPe(B,h,IPe),0,h)}else y[o]=[h]}this._freeSessionsCount+=1,g=!0,this.emit("session",h),m(),l(),h[on]===0&&this._freeSessionsCount>this.maxFreeSessions&&h.close(),i.length!==0&&(this.getSession(a,t,i),i.length=0),h.on("remoteSettings",()=>{m(),UD(this.sessions[o],h)})}),h[y5]=h.request,h.request=(y,B)=>{if(h[Uf])throw new Error("The session is gracefully closing. No new streams are allowed.");let S=h[y5](y,B);return h.ref(),++h[on],h[on]===h.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,S.once("close",()=>{if(d=p(),--h[on],!h.destroyed&&!h.closed&&(yPe(this.sessions[o],h),p()&&!h.closed)){d||(this._freeSessionsCount++,d=!0);let P=h[on]===0;P&&h.unref(),P&&(this._freeSessionsCount>this.maxFreeSessions||h[Uf])?h.close():(UD(this.sessions[o],h),m())}}),S}}catch(h){for(let p of i)p.reject(h);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,t,i,n){return new Promise((s,o)=>{this.getSession(e,t,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,t){return Wo.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof t.servername>"u"&&(t.servername=n),pPe.connect(i,n,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[on]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let i of t)i.destroy(e);for(let t of Object.values(this.queue))for(let i of Object.values(t))i.destroyed=!0;this.queue={}}get freeSessions(){return w5({agent:this,isFree:!0})}get busySessions(){return w5({agent:this,isFree:!1})}};Wo.kCurrentStreamsCount=on;Wo.kGracefullyClosing=Uf;Q5.exports={Agent:Wo,globalAgent:new Wo}});var GD=I((Knt,b5)=>{"use strict";var{Readable:wPe}=J("stream"),jD=class extends wPe{constructor(e,t){super({highWaterMark:t,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.res
2024-10-01 04:19:50 +02:00
`).reverse(),a=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(`
`).reverse();for(;a.length!==0&&a[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,s)}${o.reverse().join(`
`)}${a.reverse().join(`
2024-10-01 04:49:34 +02:00
`)}`}}};Ut.RequestError=_r;var sB=class extends _r{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError"}};Ut.MaxRedirectsError=sB;var oB=class extends _r{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError"}};Ut.HTTPError=oB;var aB=class extends _r{constructor(e,t){super(e.message,e,t),this.name="CacheError"}};Ut.CacheError=aB;var AB=class extends _r{constructor(e,t){super(e.message,e,t),this.name="UploadError"}};Ut.UploadError=AB;var lB=class extends _r{constructor(e,t,i){super(e.message,e,i),this.name="TimeoutError",this.event=e.event,this.timings=t}};Ut.TimeoutError=lB;var bC=class extends _r{constructor(e,t){super(e.message,e,t),this.name="ReadError"}};Ut.ReadError=bC;var cB=class extends _r{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};Ut.UnsupportedProtocolError=cB;var Pke=["socket","connect","continue","information","upgrade","timeout"],uB=class extends h6.Duplex{constructor(e,t={},i){super({autoDestroy:!1,highWaterMark:0}),this[Gf]=0,this[qf]=0,this.requestInitialized=!1,this[rB]=new Set,this.redirects=[],this[Jf]=!1,this[iB]=!1,this[QC]=[],this.retryCount=0,this._progressCallbacks=[];let n=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",n),c.on("data",s),c.prependListener("end",n),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",n),c.off("data",s),c.off("end",n),c.off("end",s)}),this.on("pipe",c=>{c instanceof hR.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:l}=t;if((o||a||l)&&this._lockWrite(),Ut.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,i)}catch(c){Ce.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof Ake.ReadStream&&await Ske(this.options.body);let{url:u}=this.options;if(!u)throw new TypeError("Missing `url` property");if(this.requestUrl=u.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[Pi])===null||c===void 0||c.destroy();return}for(let g of this[QC])g();this[QC].length=0,this.requestInitialized=!0}catch(u){if(u instanceof _r){this._beforeError(u);return}this.destroyed||this.destroy(u)}})()}static normalizeArguments(e,t,i){var n,s,o,a,l;let c=t;if(Ce.default.object(e)&&!Ce.default.urlInstance(e))t={...i,...e,...t};else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t={...i,...t},e!==void 0&&(t.url=e),Ce.default.urlInstance(t.url)&&(t.url=new zA.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),Ce.assert.any([Ce.default.string,Ce.default.undefined],t.method),Ce.assert.any([Ce.default.object,Ce.default.undefined],t.headers),Ce.assert.any([Ce.default.string,Ce.default.urlInstance,Ce.default.undefined],t.prefixUrl),Ce.assert.any([Ce.default.object,Ce.default.undefined],t.cookieJar),Ce.assert.any([Ce.default.object,Ce.default.string,Ce.default.undefined],t.searchParams),Ce.assert.any([Ce.default.object,Ce.default.string,Ce.default.undefined],t.cache),Ce.assert.any([Ce.default.object,Ce.default.number,Ce.default.undefined],t.timeout),Ce.assert.any([Ce.default.object,Ce.default.undefined],t.context),Ce.assert.any([Ce.default.object,Ce.default.undefined],t.hooks),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.decompress),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.ignoreInvalidCookies),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.followRedirect),Ce.assert.any([Ce.default.number,Ce.default.undefined],t.maxRedirects),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.throwHttpErrors),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.http2),Ce.assert.any([Ce.default.boolean,Ce.default.undefined],t.allowGetBody),Ce.assert.any([Ce.default.string,Ce.default.undefined],t.localAddress),Ce.assert
`,g.message,g.stack);var h=new Error("tunneling socket could not be established, cause="+g.message);h.code="ECONNRESET",e.request.emit("error",h),i.removeSocket(n)}};Ja.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createSocket(i,function(n){i.request.onSocket(n)})}};function J6(r,e){var t=this;Ja.prototype.createSocket.call(t,r,function(i){var n=r.request.getHeader("host"),s=vR({},t.options,{socket:i,servername:n?n.replace(/:.*$/,""):r.host}),o=tDe.connect(0,s);t.sockets[t.sockets.indexOf(i)]=o,e(o)})}function W6(r,e,t){return typeof r=="string"?{host:r,port:e,localAddress:t}:r}function vR(r){for(var e=1,t=arguments.length;e<t;++e){var i=arguments[e];if(typeof i=="object")for(var n=Object.keys(i),s=0,o=n.length;s<o;++s){var a=n[s];i[a]!==void 0&&(r[a]=i[a])}}return r}var _A;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?_A=function(){var r=Array.prototype.slice.call(arguments);typeof r[0]=="string"?r[0]="TUNNEL: "+r[0]:r.unshift("TUNNEL:"),console.error.apply(console,r)}:_A=function(){};Wf.debug=_A});var X6=I((yst,V6)=>{V6.exports=z6()});var a9=I((EB,FR)=>{var o9=Object.assign({},J("fs")),RR=function(){var r=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(r=r||__filename),function(e){e=e||{};var t=typeof e<"u"?e:{},i,n;t.ready=new Promise(function(f,E){i=f,n=E});var s={},o;for(o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);var a=[],l="./this.program",c=function(f,E){throw E},u=!1,g=!0,h="";function p(f){return t.locateFile?t.locateFile(f,h):h+f}var d,m,y,B;g&&(u?h=J("path").dirname(h)+"/":h=__dirname+"/",d=function(E,w){var k=pa(E);return k?w?k:k.toString():(y||(y=o9),B||(B=J("path")),E=B.normalize(E),y.readFileSync(E,w?null:"utf8"))},m=function(E){var w=d(E,!0);return w.buffer||(w=new Uint8Array(w)),te(w.buffer),w},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),c=function(f){process.exit(f)},t.inspect=function(){return"[Emscripten Module object]"});var S=t.print||console.log.bind(console),P=t.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(t[o]=s[o]);s=null,t.arguments&&(a=t.arguments),t.thisProgram&&(l=t.thisProgram),t.quit&&(c=t.quit);var F=16;function H(f,E){return E||(E=F),Math.ceil(f/E)*E}var q=0,_=function(f){q=f},X;t.wasmBinary&&(X=t.wasmBinary);var W=t.noExitRuntime||!0;typeof WebAssembly!="object"&&yr("no native wasm support detected");function Z(f,E,w){switch(E=E||"i8",E.charAt(E.length-1)==="*"&&(E="i32"),E){case"i1":return ie[f>>0];case"i8":return ie[f>>0];case"i16":return fe[f>>1];case"i32":return de[f>>2];case"i64":return de[f>>2];case"float":return vt[f>>2];case"double":return mt[f>>3];default:yr("invalid type for getValue: "+E)}return null}var A,ne=!1,ue;function te(f,E){f||yr("Assertion failed: "+E)}function O(f){var E=t["_"+f];return te(E,"Cannot call unknown function "+f+", make sure it is exported"),E}function N(f,E,w,k,L){var T={string:function(nt){var wt=0;if(nt!=null&&nt!==0){var Ii=(nt.length<<2)+1;wt=GE(Ii),se(nt,wt,Ii)}return wt},array:function(nt){var wt=GE(nt.length);return ge(nt,wt),wt}};function ee(nt){return E==="string"?De(nt):E==="boolean"?Boolean(nt):nt}var Ie=O(f),Oe=[],it=0;if(k)for(var at=0;at<k.length;at++){var Ue=T[w[at]];Ue?(it===0&&(it=tS()),Oe[at]=Ue(k[at])):Oe[at]=k[at]}var Ve=Ie.apply(null,Oe);return Ve=ee(Ve),it!==0&&rS(it),Ve}function ce(f,E,w,k){w=w||[];var L=w.every(function(ee){return ee==="number"}),T=E!=="string";return T&&L&&!k?O(f):function(){return N(f,E,w,arguments,k)}}var he=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Pe(f,E,w){for(var k=E+w,L=E;f[L]&&!(L>=k);)++L;if(L-E>16&&f.subarray&&he)return he.decode(f.subarray(E,L));for(var T="";E<L;){var ee=f[E++];if(!(ee&128)){T+=String.fromCharCode(ee);continue}var Ie=f[E++]&63;if((ee&224)==192){T+=String.fromCharCode((ee&31)<<6|Ie);continue}var Oe=f[E++]&63;if((ee&240)==224?ee=(ee&15)<<12|Ie<<6|Oe:ee=(ee&7)<<18|Ie<<12|Oe<<6|f[E++]&63,ee<65536)T+=String.fromCharCode(ee);else{var i
2024-10-01 04:19:50 +02:00
`)):typeof readline=="function"&&(E=readline(),E!==null&&(E+=`
2024-10-01 04:49:34 +02:00
`));if(!E)return null;f.input=wA(E,!0)}return f.input.shift()},put_char:function(f,E){E===null||E===10?(S(Pe(f.output,0)),f.output=[]):E!=0&&f.output.push(E)},flush:function(f){f.output&&f.output.length>0&&(S(Pe(f.output,0)),f.output=[])}},default_tty1_ops:{put_char:function(f,E){E===null||E===10?(P(Pe(f.output,0)),f.output=[]):E!=0&&f.output.push(E)},flush:function(f){f.output&&f.output.length>0&&(P(Pe(f.output,0)),f.output=[])}}};function ss(f){for(var E=H(f,65536),w=pt(E);f<E;)ie[w+f++]=0;return w}var ut={ops_table:null,mount:function(f){return ut.createNode(null,"/",16895,0)},createNode:function(f,E,w,k){if(b.isBlkdev(w)||b.isFIFO(w))throw new b.ErrnoError(63);ut.ops_table||(ut.ops_table={dir:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,lookup:ut.node_ops.lookup,mknod:ut.node_ops.mknod,rename:ut.node_ops.rename,unlink:ut.node_ops.unlink,rmdir:ut.node_ops.rmdir,readdir:ut.node_ops.readdir,symlink:ut.node_ops.symlink},stream:{llseek:ut.stream_ops.llseek}},file:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:{llseek:ut.stream_ops.llseek,read:ut.stream_ops.read,write:ut.stream_ops.write,allocate:ut.stream_ops.allocate,mmap:ut.stream_ops.mmap,msync:ut.stream_ops.msync}},link:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,readlink:ut.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:b.chrdev_stream_ops}});var L=b.createNode(f,E,w,k);return b.isDir(L.mode)?(L.node_ops=ut.ops_table.dir.node,L.stream_ops=ut.ops_table.dir.stream,L.contents={}):b.isFile(L.mode)?(L.node_ops=ut.ops_table.file.node,L.stream_ops=ut.ops_table.file.stream,L.usedBytes=0,L.contents=null):b.isLink(L.mode)?(L.node_ops=ut.ops_table.link.node,L.stream_ops=ut.ops_table.link.stream):b.isChrdev(L.mode)&&(L.node_ops=ut.ops_table.chrdev.node,L.stream_ops=ut.ops_table.chrdev.stream),L.timestamp=Date.now(),f&&(f.contents[E]=L,f.timestamp=L.timestamp),L},getFileDataAsTypedArray:function(f){return f.contents?f.contents.subarray?f.contents.subarray(0,f.usedBytes):new Uint8Array(f.contents):new Uint8Array(0)},expandFileStorage:function(f,E){var w=f.contents?f.contents.length:0;if(!(w>=E)){var k=1024*1024;E=Math.max(E,w*(w<k?2:1.125)>>>0),w!=0&&(E=Math.max(E,256));var L=f.contents;f.contents=new Uint8Array(E),f.usedBytes>0&&f.contents.set(L.subarray(0,f.usedBytes),0)}},resizeFileStorage:function(f,E){if(f.usedBytes!=E)if(E==0)f.contents=null,f.usedBytes=0;else{var w=f.contents;f.contents=new Uint8Array(E),w&&f.contents.set(w.subarray(0,Math.min(E,f.usedBytes))),f.usedBytes=E}},node_ops:{getattr:function(f){var E={};return E.dev=b.isChrdev(f.mode)?f.id:1,E.ino=f.id,E.mode=f.mode,E.nlink=1,E.uid=0,E.gid=0,E.rdev=f.rdev,b.isDir(f.mode)?E.size=4096:b.isFile(f.mode)?E.size=f.usedBytes:b.isLink(f.mode)?E.size=f.link.length:E.size=0,E.atime=new Date(f.timestamp),E.mtime=new Date(f.timestamp),E.ctime=new Date(f.timestamp),E.blksize=4096,E.blocks=Math.ceil(E.size/E.blksize),E},setattr:function(f,E){E.mode!==void 0&&(f.mode=E.mode),E.timestamp!==void 0&&(f.timestamp=E.timestamp),E.size!==void 0&&ut.resizeFileStorage(f,E.size)},lookup:function(f,E){throw b.genericErrors[44]},mknod:function(f,E,w,k){return ut.createNode(f,E,w,k)},rename:function(f,E,w){if(b.isDir(f.mode)){var k;try{k=b.lookupNode(E,w)}catch{}if(k)for(var L in k.contents)throw new b.ErrnoError(55)}delete f.parent.contents[f.name],f.parent.timestamp=Date.now(),f.name=w,E.contents[w]=f,E.timestamp=f.parent.timestamp,f.parent=E},unlink:function(f,E){delete f.contents[E],f.timestamp=Date.now()},rmdir:function(f,E){var w=b.lookupNode(f,E);for(var k in w.contents)throw new b.ErrnoError(55);delete f.contents[E],f.timestamp=Date.now()},readdir:function(f){var E=[".",".."];for(var w in f.contents)!f.contents.hasOwnProperty(w)||E.push(w);return E},symlink:function(f,E,w){var k=ut.createNode(f,E,41471,0);return k.link=w,k},readlink:function(f){if(!b.isLink(f.mode))throw new b.ErrnoError(28);return f.link}},stream_ops:{read:function(f,E,w,k,L){var T=f.node.contents;if(L>=f.node.usedBytes)return 0;var ee=Math.min
2024-10-01 04:19:50 +02:00
`,n=Buffer.byteLength(i),s=Math.floor(Math.log(n)/Math.log(10))+1;return n+s>=Math.pow(10,s)&&(s+=1),s+n+i}};KC.parse=(r,e,t)=>new KC(AFe(lFe(r),e),t);var AFe=(r,e)=>e?Object.keys(r).reduce((t,i)=>(t[i]=r[i],t),e):r,lFe=r=>r.replace(/\n$/,"").split(`
2024-10-01 04:49:34 +02:00
`).reduce(cFe,Object.create(null)),cFe=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.substr((t+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return r;let s=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,r};zV.exports=KC});var nh=I((Vot,VV)=>{VV.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var WB=I((Xot,XV)=>{"use strict";XV.exports=r=>class extends r{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var SF=I((_ot,ZV)=>{"use strict";var zB=["|","<",">","?",":"],bF=zB.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),uFe=new Map(zB.map((r,e)=>[r,bF[e]])),gFe=new Map(bF.map((r,e)=>[r,zB[e]]));ZV.exports={encode:r=>zB.reduce((e,t)=>e.split(t).join(uFe.get(t)),r),decode:r=>bF.reduce((e,t)=>e.split(t).join(gFe.get(t)),r)}});var vF=I(($ot,$V)=>{var{isAbsolute:fFe,parse:_V}=J("path").win32;$V.exports=r=>{let e="",t=_V(r);for(;fFe(r)||t.root;){let i=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.substr(i.length),e+=i,t=_V(r)}return[e,r]}});var t7=I((eat,e7)=>{"use strict";e7.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var OF=I((iat,p7)=>{"use strict";var A7=_f(),l7=JB(),c7=ih(),Xo=J("fs"),r7=J("path"),Vo=th(),hFe=nh(),u7=(r,e)=>e?(r=Vo(r).replace(/^\.(\/|$)/,""),hFe(e)+"/"+r):Vo(r),pFe=16*1024*1024,i7=Symbol("process"),n7=Symbol("file"),s7=Symbol("directory"),PF=Symbol("symlink"),o7=Symbol("hardlink"),UC=Symbol("header"),VB=Symbol("read"),kF=Symbol("lstat"),XB=Symbol("onlstat"),DF=Symbol("onread"),RF=Symbol("onreadlink"),FF=Symbol("openfile"),NF=Symbol("onopenfile"),sl=Symbol("close"),ZB=Symbol("mode"),TF=Symbol("awaitDrain"),xF=Symbol("ondrain"),Zo=Symbol("prefix"),a7=Symbol("hadError"),g7=WB(),dFe=SF(),f7=vF(),h7=t7(),_B=g7(class extends A7{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Vo(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||pFe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Vo(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?Vo(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths){let[n,s]=f7(this.path);n&&(this.path=s,i=n)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=dFe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Vo(t.absolute||r7.resolve(this.cwd,e)),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[XB](this.statCache.get(this.absolute)):this[kF]()}emit(e,...t){return e==="error"&&(this[a7]=!0),super.emit(e,...t)}[kF](){Xo.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[XB](t)})}[XB](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=mFe(e),this.emit("stat",e),this[i7]()}[i7](){switch(this.type){case"File":return this[n7]();case"Directory":return this[s7]();case"SymbolicLink":return this[PF]();default:return this.end()}}[ZB](e){return h7(e,this.type==="Directory",this.portable)}[Zo](e){return u7(e,this.prefix)}[UC](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new c7({path:this[Zo](this.path),linkpath:this.type==="Lin
`}),a},i})});var M0=I((_at,vZ)=>{var wTe=Ss(),BTe=fC(),QTe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bTe=/^\w*$/;function STe(r,e){if(wTe(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||BTe(r)?!0:bTe.test(r)||!QTe.test(r)||e!=null&&r in Object(e)}vZ.exports=STe});var K0=I(($at,xZ)=>{var vTe=Tc(),xTe=xn(),PTe="[object AsyncFunction]",kTe="[object Function]",DTe="[object GeneratorFunction]",RTe="[object Proxy]";function FTe(r){if(!xTe(r))return!1;var e=vTe(r);return e==kTe||e==DTe||e==PTe||e==RTe}xZ.exports=FTe});var kZ=I((eAt,PZ)=>{var NTe=Is(),TTe=NTe["__core-js_shared__"];PZ.exports=TTe});var FZ=I((tAt,RZ)=>{var ON=kZ(),DZ=function(){var r=/[^.]+$/.exec(ON&&ON.keys&&ON.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function LTe(r){return!!DZ&&DZ in r}RZ.exports=LTe});var MN=I((rAt,NZ)=>{var OTe=Function.prototype,MTe=OTe.toString;function KTe(r){if(r!=null){try{return MTe.call(r)}catch{}try{return r+""}catch{}}return""}NZ.exports=KTe});var LZ=I((iAt,TZ)=>{var UTe=K0(),HTe=FZ(),jTe=xn(),GTe=MN(),YTe=/[\\^$.*+?()[\]{}|]/g,qTe=/^\[object .+?Constructor\]$/,JTe=Function.prototype,WTe=Object.prototype,zTe=JTe.toString,VTe=WTe.hasOwnProperty,XTe=RegExp("^"+zTe.call(VTe).replace(YTe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZTe(r){if(!jTe(r)||HTe(r))return!1;var e=UTe(r)?XTe:qTe;return e.test(GTe(r))}TZ.exports=ZTe});var MZ=I((nAt,OZ)=>{function _Te(r,e){return r==null?void 0:r[e]}OZ.exports=_Te});var hl=I((sAt,KZ)=>{var $Te=LZ(),eLe=MZ();function tLe(r,e){var t=eLe(r,e);return $Te(t)?t:void 0}KZ.exports=tLe});var $C=I((oAt,UZ)=>{var rLe=hl(),iLe=rLe(Object,"create");UZ.exports=iLe});var GZ=I((aAt,jZ)=>{var HZ=$C();function nLe(){this.__data__=HZ?HZ(null):{},this.size=0}jZ.exports=nLe});var qZ=I((AAt,YZ)=>{function sLe(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}YZ.exports=sLe});var WZ=I((lAt,JZ)=>{var oLe=$C(),aLe="__lodash_hash_undefined__",ALe=Object.prototype,lLe=ALe.hasOwnProperty;function cLe(r){var e=this.__data__;if(oLe){var t=e[r];return t===aLe?void 0:t}return lLe.call(e,r)?e[r]:void 0}JZ.exports=cLe});var VZ=I((cAt,zZ)=>{var uLe=$C(),gLe=Object.prototype,fLe=gLe.hasOwnProperty;function hLe(r){var e=this.__data__;return uLe?e[r]!==void 0:fLe.call(e,r)}zZ.exports=hLe});var ZZ=I((uAt,XZ)=>{var pLe=$C(),dLe="__lodash_hash_undefined__";function CLe(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=pLe&&e===void 0?dLe:e,this}XZ.exports=CLe});var $Z=I((gAt,_Z)=>{var mLe=GZ(),ELe=qZ(),ILe=WZ(),yLe=VZ(),wLe=ZZ();function Eh(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}Eh.prototype.clear=mLe;Eh.prototype.delete=ELe;Eh.prototype.get=ILe;Eh.prototype.has=yLe;Eh.prototype.set=wLe;_Z.exports=Eh});var t_=I((fAt,e_)=>{function BLe(){this.__data__=[],this.size=0}e_.exports=BLe});var Ih=I((hAt,r_)=>{function QLe(r,e){return r===e||r!==r&&e!==e}r_.exports=QLe});var em=I((pAt,i_)=>{var bLe=Ih();function SLe(r,e){for(var t=r.length;t--;)if(bLe(r[t][0],e))return t;return-1}i_.exports=SLe});var s_=I((dAt,n_)=>{var vLe=em(),xLe=Array.prototype,PLe=xLe.splice;function kLe(r){var e=this.__data__,t=vLe(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():PLe.call(e,t,1),--this.size,!0}n_.exports=kLe});var a_=I((CAt,o_)=>{var DLe=em();function RLe(r){var e=this.__data__,t=DLe(e,r);return t<0?void 0:e[t][1]}o_.exports=RLe});var l_=I((mAt,A_)=>{var FLe=em();function NLe(r){return FLe(this.__data__,r)>-1}A_.exports=NLe});var u_=I((EAt,c_)=>{var TLe=em();function LLe(r,e){var t=this.__data__,i=TLe(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}c_.exports=LLe});var tm=I((IAt,g_)=>{var OLe=t_(),MLe=s_(),KLe=a_(),ULe=l_(),HLe=u_();function yh(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}yh.prototype.clear=OLe;yh.prototype.delete=MLe;yh.prototype.get=KLe;yh.prototype.has=ULe;yh.prototype.set=HLe;g_.exports=yh});var U0=I((yAt,f_)=>{var jLe=hl(),GLe=Is(),YLe=jLe(GLe,"Map");f_.exports=YLe});var d_=I((wAt,
2024-10-01 04:19:50 +02:00
attempted value: ${s}
2024-10-01 04:49:34 +02:00
`+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,t){let i=e===void 0?e:this.transforms.reduce((n,s)=>s.call(this,n,e,this),e);return i===void 0&&(i=this.getDefault()),i}_validate(e,t={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=t,u=e;l||(u=this._cast(u,Rs({assert:!1},t)));let g={value:u,path:s,options:t,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},h=[];this._typeError&&h.push(this._typeError),this._whitelistError&&h.push(this._whitelistError),this._blacklistError&&h.push(this._blacklistError),(0,yre.default)({args:g,value:u,path:s,sync:n,tests:h,endEarly:c},p=>{if(p)return void i(p,u);(0,yre.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,t,i){let n=this.resolve(Rs({},t,{value:e}));return typeof i=="function"?n._validate(e,t,i):new Promise((s,o)=>n._validate(e,t,(a,l)=>{a?o(a):s(l)}))}validateSync(e,t){let i=this.resolve(Rs({},t,{value:e})),n;return i._validate(e,Rs({},t,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,i=>{if(Bre.default.isError(i))return!1;throw i})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(i){if(Bre.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,Ire.default)(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return e!=null}defined(e=Th.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(t){return t!==void 0}})}required(e=Th.mixed.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(i){return this.schema._isPresent(i)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e}nullable(e=!0){var t=this.clone({nullable:e!==!1});return t}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Th.mixed.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,pQ.default)(t),s=t.exclusive||t.name&&i.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(i.exclusiveTests[t.name]=!!t.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===t.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let i=this.clone(),n=(0,XHe.default)(e).map(s=>new zHe.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new WHe.default(n,t)),i}typeError(e){var t=this.clone();return t._typeError=(0,pQ.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),t}oneOf(e,t=Th.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,pQ.default)({message:t,name:"oneOf",test(n){if(n===void 0)return!0;let s=this.schema._whitelist;return s.has(n,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),i}notOneOf(e,t=Th.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,pQ.default)({message:t,name:"notOneOf",test(n){let s=this.schema._blacklist;return s.has(n,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),i}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:i}=e.spec;return{meta:i,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(s=>({name:s.OPTIONS.name,params
`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=t(r.styles[o[c]],a,l);return a},n=(s,o,a)=>{r.styles[s]=e({name:s,codes:o}),(r.keys[a]||(r.keys[a]=[])).push(s),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(c){r.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,r),c.stack=this.stack?this.stack.concat(s):[s],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),r.ansiRegex=fYe,r.hasColor=r.hasAnsi=s=>(r.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&r.ansiRegex.test(s)),r.alias=(s,o)=>{let a=typeof o=="string"?r[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:s}),r.styles[s]=a,a.stack=[s]),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(l){r.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,r),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},r.theme=s=>{if(!gYe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))r.alias(o,s[o]);return r},r.alias("unstyle",s=>typeof s=="string"&&s!==""?(r.ansiRegex.lastIndex=0,s.replace(r.ansiRegex,"")):""),r.alias("noop",s=>s),r.none=r.clear=r.noop,r.stripColor=r.unstyle,r.symbols=rne(),r.define=n,r};ZT.exports=ine();ZT.exports.create=ine});var Yi=I(Ft=>{"use strict";var hYe=Object.prototype.toString,Fs=uo(),nne=!1,_T=[],sne={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Ft.longest=(r,e)=>r.reduce((t,i)=>Math.max(t,e?i[e].length:i.length),0);Ft.hasColor=r=>!!r&&Fs.hasColor(r);var BQ=Ft.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Ft.nativeType=r=>hYe.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"");Ft.isAsyncFn=r=>Ft.nativeType(r)==="asyncfunction";Ft.isPrimitive=r=>r!=null&&typeof r!="object"&&typeof r!="function";Ft.resolve=(r,e,...t)=>typeof e=="function"?e.call(r,...t):e;Ft.scrollDown=(r=[])=>[...r.slice(1),r[0]];Ft.scrollUp=(r=[])=>[r.pop(),...r];Ft.reorder=(r=[])=>{let e=r.slice();return e.sort((t,i)=>t.index>i.index?1:t.index<i.index?-1:0),e};Ft.swap=(r,e,t)=>{let i=r.length,n=t===i?0:t<0?i-1:t,s=r[e];r[e]=r[n],r[n]=s};Ft.width=(r,e=80)=>{let t=r&&r.columns?r.columns:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[0]),process.platform==="win32"?t-1:t};Ft.height=(r,e=20)=>{let t=r&&r.rows?r.rows:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[1]),t};Ft.wordWrap=(r,e={})=>{if(!r)return r;typeof e=="number"&&(e={width:e});let{indent:t="",newline:i=`
`+t,width:n=80}=e,s=(i+t).match(/[^\S\n]/g)||[];n-=s.length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=r.trim(),l=new RegExp(o,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),t+c.join(i)};Ft.unmute=r=>{let e=r.stack.find(i=>Fs.keys.color.includes(i));return e?Fs[e]:r.stack.find(i=>i.slice(2)==="bg")?Fs[e.slice(2)]:i=>i};Ft.pascal=r=>r?r[0].toUpperCase()+r.slice(1):"";Ft.inverse=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Fs.keys.color.includes(i));if(e){let i=Fs["bg"+Ft.pascal(e)];return i?i.black:r}let t=r.stack.find(i=>i.slice(0,2)==="bg");return t?Fs[t.slice(2).toLowerCase()]||r:Fs.none};Ft.complement=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Fs.keys.color.includes(i)),t=r.stack.find(i=>i.slice(0,2)==="bg");if(e&&!t)return Fs[sne[e]||e];if(t){let i=t.slice(2).toLowerCase(),n=sne[i];return n&&Fs["bg"+Ft.pascal(n)]||r}return Fs.none};Ft.meridiem=r=>{let e=r.getHours(),t=r.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=t<10?"0"+t:t;return n+":"+s+" "+i};Ft.set=(r={},e="",t)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:t;return!Ft.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},r);Ft.get=(r={},e="",t)=>{let i=r[e]==null?e.split(".").reduce((n,s)=>n&&n[s],r):r[e];return i==null?t:i};Ft.mixin=(r,e)=>{if(!BQ(r))return e;if(!BQ(e))return r;for(let t of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,t);if(i.hasOwnProperty("value"))if(r.hasOwnProperty(t)&&BQ(i.value)){let n=Object.getOwnPropertyDescriptor(r,t);BQ(n.value)?r[t]=Ft.merge({},r[t],e[t]):Reflect.defineProperty(r,t,i)}else Reflect.defineProperty(r,t,i);else Reflect.defineProperty(r,t,i)}return r};Ft.merge=(...r)=>{let e={};for(let t of r)Ft.mixin(e,t);return e};Ft.mixinEmitter=(r,e)=>{let t=e.constructor.prototype;for(let i of Object.keys(t)){let n=t[i];typeof n=="function"?Ft.define(r,i,n.bind(e)):Ft.define(r,i,n)}};Ft.onExit=r=>{let e=(t,i)=>{nne||(nne=!0,_T.forEach(n=>n()),t===!0&&process.exit(128+i))};_T.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),_T.push(r)};Ft.define=(r,e,t)=>{Reflect.defineProperty(r,e,{value:t})};Ft.defineExport=(r,e,t)=>{let i;Reflect.defineProperty(r,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():t()}})}});var one=I(jh=>{"use strict";jh.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};jh.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};jh.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};jh.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};jh.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var lne=I((Ogt,Ane)=>{"use strict";var ane=J("readline"),pYe=one(),dYe=/^(?:\x1b)([a-zA-Z0-9])$/,CYe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,mYe={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"cl
`)i.name="enter";else if(r===" ")i.name="tab";else if(r==="\b"||r==="\x7F"||r==="\x1B\x7F"||r==="\x1B\b")i.name="backspace",i.meta=r.charAt(0)==="\x1B";else if(r==="\x1B"||r==="\x1B\x1B")i.name="escape",i.meta=r.length===2;else if(r===" "||r==="\x1B ")i.name="space",i.meta=r.length===2;else if(r<="")i.name=String.fromCharCode(r.charCodeAt(0)+"a".charCodeAt(0)-1),i.ctrl=!0;else if(r.length===1&&r>="0"&&r<="9")i.name="number";else if(r.length===1&&r>="a"&&r<="z")i.name=r;else if(r.length===1&&r>="A"&&r<="Z")i.name=r.toLowerCase(),i.shift=!0;else if(t=dYe.exec(r))i.meta=!0,i.shift=/^[A-Z]$/.test(t[1]);else if(t=CYe.exec(r)){let n=[...r];n[0]==="\x1B"&&n[1]==="\x1B"&&(i.option=!0);let s=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),o=(t[3]||t[5]||1)-1;i.ctrl=!!(o&4),i.meta=!!(o&10),i.shift=!!(o&1),i.code=s,i.name=mYe[s],i.shift=EYe(s)||i.shift,i.ctrl=IYe(s)||i.ctrl}return i};QQ.listen=(r={},e)=>{let{stdin:t}=r;if(!t||t!==process.stdin&&!t.isTTY)throw new Error("Invalid stream passed");let i=ane.createInterface({terminal:!0,input:t});ane.emitKeypressEvents(t,i);let n=(a,l)=>e(a,QQ(a,l),i),s=t.isRaw;return t.isTTY&&t.setRawMode(!0),t.on("keypress",n),i.resume(),()=>{t.isTTY&&t.setRawMode(s),t.removeListener("keypress",n),i.pause(),i.close()}};QQ.action=(r,e,t)=>{let i={...pYe,...t};return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};Ane.exports=QQ});var une=I((Mgt,cne)=>{"use strict";cne.exports=r=>{r.timers=r.timers||{};let e=r.options.timers;if(!!e)for(let t of Object.keys(e)){let i=e[t];typeof i=="number"&&(i={interval:i}),yYe(r,t,i)}};function yYe(r,e,t={}){let i=r.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=t.interval||120;i.frames=t.frames||[],i.loading=!0;let s=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,r.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(s)},Reflect.defineProperty(i,"interval",{value:s}),r.once("close",()=>i.stop()),i.stop}});var fne=I((Kgt,gne)=>{"use strict";var{define:wYe,width:BYe}=Yi(),$T=class{constructor(e){let t=e.options;wYe(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=BYe(t.stdout||process.stdout),Object.assign(this,t),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t=="function"?t:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};gne.exports=$T});var pne=I((Ugt,hne)=>{"use strict";var eL=Yi(),ki=uo(),tL={default:ki.noop,noop:ki.noop,set inverse(r){this._inverse=r},get inverse(){return this._inverse||eL.inverse(this.primary)},set complement(r){this._complement=r},get complement(){return this._complement||eL.complement(this.primary)},primary:ki.cyan,success:ki.green,danger:ki.magenta,strong:ki.bold,warning:ki.yellow,muted:ki.dim,disabled:ki.gray,dark:ki.dim.gray,underline:ki.underline,set info(r){this._info=r},get info(){return this._info||this.primary},set em(r){this._em=r},get em(){return this._em||this.primary.underline},set heading(r){this._heading=r},get heading(){return this._heading||this.muted.underline},set pending(r){this._pending=r},get pending(){return this._pending||this.primary},set submitted(r){this._submitted=r},get submitted(){return this._submitted||this.success},set cancelled(r){this._cancelled=r},get cancelled(){return this._cancelled||this.danger},set typing(r){this._typing=r},get typin
2024-10-01 04:19:50 +02:00
`),c=l[0],u=l[l.length-1],h=(i+(t?" "+t:"")).length,p=h<c.length?c.slice(h+1):"";return{header:o,prompt:c,after:p,rest:l.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let t=`
`+this.symbols.pointer+" ";typeof e=="string"?t+=e.trim():t+="Invalid input",this.state.error=`
`+this.styles.danger(t),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),t=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Au.cursor.down(e.rest.length)),this.write(`
2024-10-01 04:49:34 +02:00
`.repeat(t))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=aL.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:t,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof t.initial=="function"&&(this.initial=await t.initial.call(this,this)),typeof t.onRun=="function"&&await t.onRun.call(this,this),typeof t.onSubmit=="function"){let n=t.onSubmit.bind(this),s=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),s())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,t)=>{if(this.once("submit",e),this.once("cancel",t),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,t,i){let{options:n,state:s,symbols:o,timers:a}=this,l=a&&a[e];s.timer=l;let c=n[e]||s[e]||o[e],u=t&&t[e]!=null?t[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,t,i);return!g&&t&&t[e]?this.resolve(c,s,t,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,t=this.timers&&this.timers.prefix,i=this.state;return i.timer=t,Rn.isObject(e)&&(e=e[i.status]||e.pending),Rn.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Rn.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,t=this.timers&&this.timers.separator,i=this.state;i.timer=t;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return Rn.isObject(s)&&(s=s[i.status]||s.pending),Rn.hasColor(s)?s:this.styles.muted(s)}async pointer(e,t){let i=await this.element("pointer",e,t);if(typeof i=="string"&&Rn.hasColor(i))return i;if(i){let n=this.styles,s=this.index===t,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=Rn.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,t){let i=await this.element("indicator",e,t);if(typeof i=="string"&&Rn.hasColor(i))return i;if(i){let n=this.styles,s=e.enabled===!0,o=s?n.success:n.dark,a=i[s?"on":"off"]||i;return Rn.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Rn.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...t){return Rn.resolve(this,e,...t)}get base(){return Om.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Rn.height(this.stdout,25)}get width(){return this.options.columns||Rn.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:t}=this.state,i=[t,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function FYe(r){let e=n=>r[n]===void 0||typeof r[n]=="function",t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(r.options)){if(t.includes(n)||/^on[A-Z]/.test(n))continue;let s=r.options[n];typeof s=="function"&&e(n)?i.includes(n)||(r[n]=s.bind(r)):typeof r[n]!="function"&&(r[n]=s)}}function NYe(r){t
`:" ",i=[];for(let n=0;n<4;n++){let s=t(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}Sne.exports=Om});var Pne=I((Ygt,xne)=>{"use strict";var TYe=Yi(),vne={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return vne.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};xne.exports=(r,e={})=>{let t=TYe.merge({},vne,e.roles);return t[r]||t.default}});var Mm=I((qgt,Rne)=>{"use strict";var LYe=uo(),OYe=Gh(),MYe=Pne(),bQ=Yi(),{reorder:AL,scrollUp:KYe,scrollDown:UYe,isObject:kne,swap:HYe}=bQ,lL=class extends OYe{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");kne(t)&&(t=Object.keys(t)),Array.isArray(t)?(i!=null&&(this.index=this.findIndex(i)),t.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(t=i),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l<o.length;l++){let c=o[l]=await this.toChoice(o[l],n++,a);i.push(c),c.choices&&await s(c.choices,c)}return i};return s(e,t).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,t,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=MYe(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=t,e.cursor=0,bQ.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,LYe.unstyle(e.message).length));let o={...e};return e.reset=(a=o.input,l=o.value)=>{for(let c of Object.keys(o))e[c]=o[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,i){let n=await this.toChoice(e,t,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,t,i){let n={name:"New choice name?",editable:!0,newChoice:!0,...e},s=await this.addChoice(n,t,i);return s.updateChoice=()=>{delete s.newChoice,s.name=s.message=s.input,s.input="",s.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,t){if(thi
2024-10-01 04:19:50 +02:00
`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(`
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:t}=this.state,i="",n=await this.header(),s=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[s,a,o,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(t),this.write([n,i,u,g].filter(Boolean).join(`
2024-10-01 04:49:34 +02:00
`)),this.write(this.margin[2]),this.restore()}};Fne.exports=uL});var Tne=I((Wgt,Nne)=>{"use strict";var GYe=dl(),YYe=(r,e)=>{let t=r.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(t),o=e(i.slice(s,s+t.length));return s>=0?i.slice(0,s)+o+i.slice(s+t.length):i}},gL=class extends GYe{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:i}=this.state;return this.input=i.slice(0,t)+e+i.slice(t),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:t}=this.state;return t?(this.input=t.slice(0,e-1)+t.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:t}=this.state;return t[e]===void 0?this.alert():(this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,t);let i=e.toLowerCase();return t.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,t=YYe(this.input,e),i=this.choices;this.choices=i.map(n=>({...n,message:t(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};Nne.exports=gL});var hL=I((zgt,Lne)=>{"use strict";var fL=Yi();Lne.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||r.styles.placeholder,l=fL.inverse(r.styles.primary),c=m=>l(r.styles.black(m)),u=t,g=" ",h=c(g);if(r.blink&&r.blink.off===!0&&(c=m=>m,h=""),s&&n===0&&i===""&&t==="")return c(g);if(s&&n===0&&(t===i||t===""))return c(i[0])+a(i.slice(1));i=fL.isPrimitive(i)?`${i}`:"",t=fL.isPrimitive(t)?`${t}`:"";let p=i&&i.startsWith(t)&&i!==t,d=p?c(i[t.length]):h;if(n!==t.length&&s===!0&&(u=t.slice(0,n)+c(t[n])+t.slice(n+1),d=""),s===!1&&(d=""),p){let m=r.styles.unstyle(u+d);return u+d+a(i.slice(m.length))}return u+d}});var SQ=I((Vgt,One)=>{"use strict";var qYe=uo(),JYe=dl(),WYe=hL(),pL=class extends JYe{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(t=>t!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(t=>t.reset&&t.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:i,input:n}=t;return t.value=t.input=n.slice(0,i)+e+n.slice(i),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:i}=e;return e.value=e.input=i.slice(0,t-1)+i.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:i}=e;if(i[t]===void 0)return this.alert();let n=`${i}`.slice(0,t)+`${i}`.slice(t+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:i}=e;return t&&t.startsWith(i)&&i!
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Gne.exports=CL});var qne=I(($gt,Yne)=>{"use strict";var tqe=vQ(),mL=class extends tqe{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};Yne.exports=mL});var Wne=I((eft,Jne)=>{"use strict";var rqe=dl(),iqe=SQ(),Yh=iqe.prototype,EL=class extends rqe{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():Yh.dispatch.call(this,e,t)}append(e,t){return Yh.append.call(this,e,t)}delete(e,t){return Yh.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?Yh.next.call(this):super.next()}prev(){return this.focused.editable?Yh.prev.call(this):super.prev()}async indicator(e,t){let i=e.indicator||"",n=e.editable?i:super.indicator(e,t);return await this.resolve(n,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){return e.indent="",e.editable?Yh.renderChoice.call(this,e,t):super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let t of this.choices){if(typeof t.validate!="function"||t.role==="heading")continue;let i=t.parent?this.value[t.parent.name]:this.value;if(t.editable?i=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(i=t.enabled===!0),e=await t.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?t[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(t[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Jne.exports=EL});var lu=I((tft,zne)=>{"use strict";var nqe=Gh(),sqe=hL(),{isPrimitive:oqe}=Yi(),IL=class extends nqe{constructor(e){super(e),this.initial=oqe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,t={}){let i=this.state.prevKeypress;return this.state.prevKeypress=t,this.options.multiline===!0&&t.name==="return"&&(!i||i.name!=="return")?this.append(`
2024-10-01 04:19:50 +02:00
`,t):super.keypress(e,t)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,t){if(!e||t.ctrl||t.code)return this.alert();this.append(e)}append(e){let{cursor:t,input:i}=this.state;this.input=`${i}`.slice(0,t)+e+`${i}`.slice(t),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:t}=this.state;if(e<=0)return this.alert();this.input=`${t}`.slice(0,e-1)+`${t}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:t}=this.state;if(t[e]===void 0)return this.alert();this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let t=this.input.slice(0,e),i=this.input.slice(e),n=t.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let t=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||t):sqe(this,{input:e,initial:t,pos:this.cursor})}async render(){let e=this.state.size,t=await this.prefix(),i=await this.separator(),n=await this.message(),s=[t,n,i].filter(Boolean).join(" ");this.state.prompt=s;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),s+=" "+a,this.clear(e),this.write([o,s,c].filter(Boolean).join(`
2024-10-01 04:49:34 +02:00
`)),this.restore()}};zne.exports=IL});var Xne=I((rft,Vne)=>{"use strict";var aqe=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),xQ=r=>aqe(r).filter(Boolean);Vne.exports=(r,e={},t="")=>{let{past:i=[],present:n=""}=e,s,o;switch(r){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:xQ([t,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:xQ([...s,t]),present:o};case"save":return{past:xQ([...i,t]),present:""};case"remove":return o=xQ(i.filter(a=>a!==t)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${r}"`)}}});var wL=I((ift,_ne)=>{"use strict";var Aqe=lu(),Zne=Xne(),yL=class extends Aqe{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let i=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Zne(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){!this.store||(this.data=Zne("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};_ne.exports=yL});var ese=I((nft,$ne)=>{"use strict";var lqe=lu(),BL=class extends lqe{format(){return""}};$ne.exports=BL});var rse=I((sft,tse)=>{"use strict";var cqe=lu(),QL=class extends cqe{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:t=>t;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);return t!==!0?(this.state.error=t,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};tse.exports=QL});var nse=I((oft,ise)=>{"use strict";var uqe=dl(),bL=class extends uqe{constructor(e){super({...e,multiple:!0})}};ise.exports=bL});var vL=I((aft,sse)=>{"use strict";var gqe=lu(),SL=class extends gqe{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let t=e||this.minor,i=this.toNumber(this.input);return i>this.max+t?this.alert():(this.input=`${i+t}`,this.render())}down(e){let t=e||this.minor,i=this.toNumber(this.input);return i<this.min-t?this.alert():(this.input=`${i-t}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(t=>this.isValue(t));return this.value=this.toNumber(e||0),super.submit()}};sse.exports=SL});var ase=I((Aft,ose)=>{ose.exports=vL()});var lse=I((lft,Ase)=>{"use strict";var fqe=lu(),xL=class extends fqe{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};Ase.exports=xL});var gse=I((cft,use)=>{"use strict";v
2024-10-01 04:19:50 +02:00
`;let t=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+t})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let t of this.choices){e=Math.max(e,t.message.length),t.scaleIndex=t.initial||2,t.scale=[];for(let i=0;i<this.scale.length;i++)t.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}heading(e,t,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(i=>` ${i.name} - ${i.message}`)].map(i=>this.styles.muted(i)).join(`
`)}renderScaleHeading(e){let t=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(t=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-t.join("").length,n=Math.round(i/(t.length-1)),o=t.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,t,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,t,i);let n=e.scaleIndex===t.index;return t.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,t){let i=e.scale.map(s=>this.scaleIndicator(e,s,t)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=await this.pointer(e,t),s=await e.hint;s&&!cse.hasColor(s)&&(s=this.styles.muted(s));let o=d=>this.margin[3]+d.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,t),u=await this.renderScale(e,t),g=this.margin[1]+this.margin[3];this.scaleLength=hqe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let p=cse.wordWrap(c,{width:this.widths[0],newline:a}).split(`
`).map(d=>o(d)+this.margin[1]);return i&&(u=this.styles.info(u),p=p.map(d=>this.styles.info(d))),p[0]+=u,this.linebreak&&p.push(""),[l+n,p.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,s)=>await this.renderChoice(n,s)),t=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...t.map(n=>n.join(" "))].join(`
`)}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o="";this.options.promptLine!==!1&&(o=[i,s,n,""].join(" "),this.state.prompt=o);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),g=await this.renderChoices(),h=await this.footer(),p=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&p!=null&&(o+=this.styles.danger(p)),this.clear(t),this.write([a,o,c,g,h].filter(Boolean).join(`
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};use.exports=PL});var pse=I((uft,hse)=>{"use strict";var fse=uo(),dqe=(r="")=>typeof r=="string"?r.replace(/^['"]|['"]$/g,""):"",DL=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=dqe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Cqe=async(r={},e={},t=i=>i)=>{let i=new Set,n=r.fields||[],s=r.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],h=()=>s[u+1],p=d=>{d.line=c,o.push(d)};for(p({type:"bos",value:""});u<s.length-1;){let d=g();if(/^[^\S\n ]$/.test(d)){p({type:"text",value:d});continue}if(d===`
`){p({type:"newline",value:d}),c++;continue}if(d==="\\"){d+=g(),p({type:"text",value:d});continue}if((d==="$"||d==="#"||d==="{")&&h()==="{"){let y=g();d+=y;let B={type:"template",open:d,inner:"",close:"",value:d},S;for(;S=g();){if(S==="}"){h()==="}"&&(S+=g()),B.value+=S,B.close=S;break}S===":"?(B.initial="",B.key=B.inner):B.initial!==void 0&&(B.initial+=S),B.value+=S,B.inner+=S}B.template=B.open+(B.initial||B.inner)+B.close,B.key=B.key||B.inner,e.hasOwnProperty(B.key)&&(B.initial=e[B.key]),B=t(B),p(B),l.push(B.key),i.add(B.key);let P=a.find(F=>F.name===B.key);B.field=n.find(F=>F.name===B.key),P||(P=new DL(B),a.push(P)),P.lines.push(B.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=d:p({type:"text",value:d})}return p({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};hse.exports=async r=>{let e=r.options,t=new Set(e.required===!0?[]:e.required||[]),i={...e.values,...e.initial},{tabstops:n,items:s,keys:o}=await Cqe(e,i),a=kL("result",r,e),l=kL("format",r,e),c=kL("validate",r,e,!0),u=r.isValue.bind(r);return async(g={},h=!1)=>{let p=0;g.required=t,g.items=s,g.keys=o,g.output="";let d=async(S,P,F,H)=>{let q=await c(S,P,F,H);return q===!1?"Invalid field "+F.name:q};for(let S of n){let P=S.value,F=S.key;if(S.type!=="template"){P&&(g.output+=P);continue}if(S.type==="template"){let H=s.find(Z=>Z.name===F);e.required===!0&&g.required.add(H.name);let q=[H.input,g.values[H.value],H.value,P].find(u),X=(H.field||{}).message||S.inner;if(h){let Z=await d(g.values[F],g,H,p);if(Z&&typeof Z=="string"||Z===!1){g.invalid.set(F,Z);continue}g.invalid.delete(F);let A=await a(g.values[F],g,H,p);g.output+=fse.unstyle(A);continue}H.placeholder=!1;let W=P;P=await l(P,g,H,p),q!==P?(g.values[F]=q,P=r.styles.typing(q),g.missing.delete(X)):(g.values[F]=void 0,q=`<${X}>`,P=r.styles.primary(q),H.placeholder=!0,g.required.has(F)&&g.missing.add(X)),g.missing.has(X)&&g.validating&&(P=r.styles.warning(q)),g.invalid.has(F)&&g.validating&&(P=r.styles.danger(q)),p===g.index&&(W!==P?P=r.styles.underline(P):P=r.styles.heading(fse.unstyle(P))),p++}P&&(g.output+=P)}let m=g.output.split(`
`).map(S=>" "+S),y=s.length,B=0;for(let S of s)g.invalid.has(S.name)&&S.lines.forEach(P=>{m[P][0]===" "&&(m[P]=g.styles.danger(g.symbols.bullet)+m[P].slice(1))}),r.isValue(g.values[S.name])&&B++;return g.completed=(B/y*100).toFixed(0),g.output=m.join(`
2024-10-01 04:49:34 +02:00
`),g.output}};function kL(r,e,t,i){return(n,s,o,a)=>typeof o.field[r]=="function"?o.field[r].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var Cse=I((gft,dse)=>{"use strict";var mqe=uo(),Eqe=pse(),Iqe=Gh(),RL=class extends Iqe{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Eqe(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let t=this.getItem();this.cursor+=e,t.cursor+=e}dispatch(e,t){if(!t.code&&!t.ctrl&&e!=null&&this.getItem()){this.append(e,t);return}this.alert()}append(e,t){let i=this.getItem(),n=i.input.slice(0,this.cursor),s=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${s}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let t=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${t}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let t=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(t=this.styles.danger),t(`${this.state.completed}% completed`)}async render(){let{index:e,keys:t=[],submitted:i,size:n}=this.state,s=[this.options.newline,`
2024-10-01 04:19:50 +02:00
`].find(S=>S!=null),o=await this.prefix(),a=await this.separator(),l=await this.message(),c=[o,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),g=await this.error()||"",h=await this.hint()||"",p=i?"":await this.interpolate(this.state),d=this.state.key=t[e]||"",m=await this.format(d),y=await this.footer();m&&(c+=" "+m),h&&!m&&this.state.completed===0&&(c+=" "+h),this.clear(n);let B=[u,c,p,y,g.trim()];this.write(B.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:t,keys:i,index:n}=this.state,s=t.find(o=>o.name===i[n]);return s&&s.input!=null&&(this.input=s.input,this.cursor=s.cursor),s}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:t,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c}
`;return this.state.error=a,super.submit()}if(t.size)return this.state.error="Required: "+[...t.keys()].join(", "),super.submit();let o=mqe.unstyle(i).split(`
`).map(a=>a.slice(1)).join(`
2024-10-01 04:49:34 +02:00
`);return this.value={values:n,result:o},super.submit()}};dse.exports=RL});var Ese=I((fft,mse)=>{"use strict";var yqe="(Use <shift>+<up/down> to sort)",wqe=dl(),FL=class extends wqe{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,yqe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let i=await super.renderChoice(e,t),n=this.symbols.identicalTo+" ",s=this.index===t&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${t+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};mse.exports=FL});var yse=I((hft,Ise)=>{"use strict";var Bqe=Mm(),NL=class extends Bqe{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let t=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];t=t.map(i=>this.styles.muted(i)),this.state.header=t.join(`
2024-10-01 04:19:50 +02:00
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let t=await super.toChoices(...e);for(let i of t)i.scale=Qqe(5,this.options),i.scaleIdx=2;return t}dispatch(){this.alert()}space(){let e=this.focused,t=e.scale[e.scaleIdx],i=t.selected;return e.scale.forEach(n=>n.selected=!1),t.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=P=>(P?this.styles.success("\u25C9"):"\u25EF")+o,u=t+1+".",g=i?this.styles.heading:this.styles.noop,h=await this.resolve(e.message,this.state,e,t),p=this.indent(e),d=p+e.scale.map((P,F)=>c(F===e.scaleIdx)).join(a),m=P=>P===e.scaleIdx?g(P):P,y=p+e.scale.map((P,F)=>m(F)).join(l),B=()=>[u,h].filter(Boolean).join(" "),S=()=>[B(),d,y," "].filter(Boolean).join(`
`);return i&&(d=this.styles.cyan(d),y=this.styles.cyan(y)),S()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),t=await Promise.all(e);return t.length||t.push(this.styles.danger("No matching choices")),t.join(`
`)}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=[i,s,n].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();(l||!c)&&(o+=" "+l),c&&!o.includes(c)&&(o+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(t),this.write([o,a,u,g].filter(Boolean).join(`
2024-10-01 04:49:34 +02:00
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function Qqe(r,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>({...i}));let t=[];for(let i=1;i<r+1;i++)t.push({i,selected:!1});return t}Ise.exports=NL});var Bse=I((pft,wse)=>{wse.exports=wL()});var bse=I((dft,Qse)=>{"use strict";var bqe=vQ(),TL=class extends bqe{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",t){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,t=await this.header(),i=await this.prefix(),n=await this.separator(),s=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,s,n,o].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([t,c,l].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Qse.exports=TL});var vse=I((Cft,Sse)=>{"use strict";var Sqe=dl(),LL=class extends Sqe{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,t){let i=await super.toChoices(e,t);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Sse.exports=LL});var Pse=I(OL=>{"use strict";var xse=Yi(),ci=(r,e)=>{xse.defineExport(OL,r,e),xse.defineExport(OL,r.toLowerCase(),e)};ci("AutoComplete",()=>Tne());ci("BasicAuth",()=>jne());ci("Confirm",()=>qne());ci("Editable",()=>Wne());ci("Form",()=>SQ());ci("Input",()=>wL());ci("Invisible",()=>ese());ci("List",()=>rse());ci("MultiSelect",()=>nse());ci("Numeral",()=>ase());ci("Password",()=>lse());ci("Scale",()=>gse());ci("Select",()=>dl());ci("Snippet",()=>Cse());ci("Sort",()=>Ese());ci("Survey",()=>yse());ci("Text",()=>Bse());ci("Toggle",()=>bse());ci("Quiz",()=>vse())});var Dse=I((Eft,kse)=>{kse.exports={ArrayPrompt:Mm(),AuthPrompt:dL(),BooleanPrompt:vQ(),NumberPrompt:vL(),StringPrompt:lu()}});var Um=I((Ift,Fse)=>{"use strict";var Rse=J("assert"),KL=J("events"),Cl=Yi(),fo=class extends KL{constructor(e,t){super(),this.options=Cl.merge({},e),this.answers={...t}}register(e,t){if(Cl.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}Rse.equal(typeof t,"function","expected a function");let i=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[i]=t:this.prompts[i]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(Cl.merge({},this.options,t))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=Cl.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=Cl;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];Rse(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](t),l=o(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),s(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),t.autofill&&l!=null?(a.value=a.input=l,t.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||Gh()}static get prompts(){return Pse()}static get types(){return Dse()}static get prompt(){let e=(t,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(t)};return Cl.mixinEmitter(e,new KL),e}};Cl.mixinEmitter(fo,new KL);var ML=fo.prompts;for(let r of Object.keys(ML)){let e=r.toLowerCase(),t=i=>new ML[r](i).run();fo.prompt[e]=t,fo[e]=t,fo[r]||Reflect.defineProperty(fo,r,{get:()=>ML[r]})}var Km=r=>{Cl.defineExport(fo,r,()=>fo.types[r])};Km("ArrayPrompt");Km("AuthPrompt");Km("BooleanPrompt");Km("NumberPrompt");Km("StringPrompt");Fse.exports=fo});var Gse=I((aht,jse)=>{function Dqe(r,e){for(var t=-1,i=r==null?0:r.length;++t<i&&e(r[t],t,r)!==!1;);return r}jse.exports=Dqe});var Jh=I((Aht,Yse)=>{var Rqe=j0(),Fqe=Qh();function Nqe(r,e,t,i){var n=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(t[a],r[a],a,t,r):void 0;l===void 0&&(l=r[a]),n?Fqe(t,a,l):Rqe(t,a,l)}return t}Yse.exports=Nqe});var Jse=I((lht,qse)=>{var Tqe=Jh(),Lqe=Rh();function Oqe(r,e){return r&&Tqe(e,Lqe(e),r)}qse.exports=Oqe});var zs
2024-10-01 04:19:50 +02:00
`:"";return o?g+=`@IF EXIST ${o} (\r
${o} ${l} ${n} ${u}%*\r
) ELSE (\r
@SETLOCAL\r
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
${a} ${l} ${n} ${u}%*\r
)\r
`:g+=`@${a} ${l} ${n} ${u}%*\r
2024-10-01 04:49:34 +02:00
`,g}function Hze(r,e,t){let i=Ns.relative(Ns.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=Ns.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=t.args||"",l=lM(t.nodePath).posix;n?(s=`"$basedir/${t.prog}"`,i=o):(n=o,a="",i="");let c=t.progArgs?`${t.progArgs.join(" ")} `:"",u=`#!/bin/sh
2024-10-01 04:19:50 +02:00
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac
`,g=t.nodePath?`export NODE_PATH="${l}"
`:"";return s?u+=`${g}if [ -x ${s} ]; then
exec ${s} ${a} ${i} ${c}"$@"
else
exec ${n} ${a} ${i} ${c}"$@"
fi
`:u+=`${g}${n} ${a} ${i} ${c}"$@"
exit $?
2024-10-01 04:49:34 +02:00
`,u}function jze(r,e,t){let i=Ns.relative(Ns.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=Ns.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=t.args||"",c=lM(t.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${t.prog}$exe"`,i=a):(s=a,l="",i="");let h=t.progArgs?`${t.progArgs.join(" ")} `:"",p=`#!/usr/bin/env pwsh
2024-10-01 04:19:50 +02:00
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
${t.nodePath?`$env_node_path=$env:NODE_PATH
$env:NODE_PATH="${u}"
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}`;return t.nodePath&&(p+=` else {
$env:NODE_PATH="${g}"
}`),o?p+=`
$ret=0
if (Test-Path ${o}) {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${o} ${l} ${i} ${h}$args
} else {
& ${o} ${l} ${i} ${h}$args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${s} ${l} ${i} ${h}$args
} else {
& ${s} ${l} ${i} ${h}$args
}
$ret=$LASTEXITCODE
}
${t.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
`:p+=`
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${s} ${l} ${i} ${h}$args
} else {
& ${s} ${l} ${i} ${h}$args
}
${t.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
2024-10-01 04:49:34 +02:00
`,p}function Gze(r,e){return e.fs_.chmod(r,493)}function lM(r){if(!r)return{win32:"",posix:""};let e=typeof r=="string"?r.split(Ns.delimiter):Array.from(r),t={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=Fle()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];t.win32=t.win32?`${t.win32};${n}`:n,t.posix=t.posix?`${t.posix}:${s}`:s,t[i]={win32:n,posix:s}}return t}Tle.exports=AM});var yM=I((pbt,rce)=>{rce.exports=J("stream")});var oce=I((dbt,sce)=>{"use strict";function ice(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function l5e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ice(Object(t),!0).forEach(function(i){c5e(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ice(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function c5e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u5e(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nce(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function g5e(r,e,t){return e&&nce(r.prototype,e),t&&nce(r,t),r}var f5e=J("buffer"),pb=f5e.Buffer,h5e=J("util"),wM=h5e.inspect,p5e=wM&&wM.custom||"inspect";function d5e(r,e,t){pb.prototype.copy.call(r,e,t)}sce.exports=function(){function r(){u5e(this,r),this.head=null,this.tail=null,this.length=0}return g5e(r,[{key:"push",value:function(t){var i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return pb.alloc(0);for(var i=pb.allocUnsafe(t>>>0),n=this.head,s=0;n;)d5e(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=i?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var i=this.head,n=1,s=i.data;for(t-=s.length;i=i.next;){var o=i.data,a=t>o.length?o.length:t;if(a===o.length?s+=o:s+=o.slice(0,t),t-=a,t===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(t){var i=pb.allocUnsafe(t),n=this.head,s=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),t-=a,t===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:p5e,value:function(t,i){return wM(this,l5e({},i,{depth:0,customInspect:!1}))}}]),r}()});var QM=I((Cbt,Ace)=>{"use strict";function C5e(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(BM,this,r)):process.nextTick(BM,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s
2024-10-01 04:19:50 +02:00
`)),r.linkname&&(e+=_M(" linkpath="+r.linkname+`
`));var t=r.pax;if(t)for(var i in t)e+=_M(" "+i+"="+t[i]+`
2024-10-01 04:49:34 +02:00
`);return Buffer.from(e)};hp.decodePax=function(r){for(var e={};r.length;){for(var t=0;t<r.length&&r[t]!==32;)t++;var i=parseInt(r.slice(0,t).toString(),10);if(!i)return e;var n=r.slice(t+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),r=r.slice(i)}return e};hp.encode=function(r){var e=u9e(512),t=r.name,i="";if(r.typeflag===5&&t[t.length-1]!=="/"&&(t+="/"),Buffer.byteLength(t)!==t.length)return null;for(;Buffer.byteLength(t)>100;){var n=t.indexOf("/");if(n===-1)return null;i+=i?"/"+t.slice(0,n):t.slice(0,n),t=t.slice(n+1)}return Buffer.byteLength(t)>100||Buffer.byteLength(i)>155||r.linkname&&Buffer.byteLength(r.linkname)>100?null:(e.write(t),e.write(Dl(r.mode&C9e,6),100),e.write(Dl(r.uid,6),108),e.write(Dl(r.gid,6),116),e.write(Dl(r.size,11),124),e.write(Dl(r.mtime.getTime()/1e3|0,11),136),e[156]=Aue+I9e(r.type),r.linkname&&e.write(r.linkname,157),lue.copy(e,bE),h9e.copy(e,$M),r.uname&&e.write(r.uname,265),r.gname&&e.write(r.gname,297),e.write(Dl(r.devmajor||0,6),329),e.write(Dl(r.devminor||0,6),337),i&&e.write(i,345),e.write(Dl(uue(e),6),148),e)};hp.decode=function(r,e,t){var i=r[156]===0?0:r[156]-Aue,n=fp(r,0,100,e),s=Rl(r,100,8),o=Rl(r,108,8),a=Rl(r,116,8),l=Rl(r,124,12),c=Rl(r,136,12),u=E9e(i),g=r[157]===0?null:fp(r,157,100,e),h=fp(r,265,32),p=fp(r,297,32),d=Rl(r,329,8),m=Rl(r,337,8),y=uue(r);if(y===8*32)return null;if(y!==Rl(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(lue.compare(r,bE,bE+6)===0)r[345]&&(n=fp(r,345,155,e)+"/"+n);else if(!(p9e.compare(r,bE,bE+6)===0&&d9e.compare(r,$M,$M+2)===0)){if(!t)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:h,gname:p,devmajor:d,devminor:m}}});var mue=I((Obt,Cue)=>{var fue=J("util"),w9e=aue(),SE=e1(),hue=gp().Writable,pue=gp().PassThrough,due=function(){},gue=function(r){return r&=511,r&&512-r},B9e=function(r,e){var t=new Db(r,e);return t.end(),t},Q9e=function(r,e){return e.path&&(r.name=e.path),e.linkpath&&(r.linkname=e.linkpath),e.size&&(r.size=parseInt(e.size,10)),r.pax=e,r},Db=function(r,e){this._parent=r,this.offset=e,pue.call(this,{autoDestroy:!1})};fue.inherits(Db,pue);Db.prototype.destroy=function(r){this._parent.destroy(r)};var dA=function(r){if(!(this instanceof dA))return new dA(r);hue.call(this,r),r=r||{},this._offset=0,this._buffer=w9e(),this._missing=0,this._partial=!1,this._onparse=due,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,t=e._buffer,i=function(){e._continue()},n=function(h){if(e._locked=!1,h)return e.destroy(h);e._stream||i()},s=function(){e._stream=null;var h=gue(e._header.size);h?e._parse(h,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(gue(e._header.size)),e._parse(512,g),i()},a=function(){var h=e._header.size;e._paxGlobal=SE.decodePax(t.slice(0,h)),t.consume(h),s()},l=function(){var h=e._header.size;e._pax=SE.decodePax(t.slice(0,h)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),t.consume(h),s()},c=function(){var h=e._header.size;this._gnuLongPath=SE.decodeLongPath(t.slice(0,h),r.filenameEncoding),t.consume(h),s()},u=function(){var h=e._header.size;this._gnuLongLinkPath=SE.decodeLongPath(t.slice(0,h),r.filenameEncoding),t.consume(h),s()},g=function(){var h=e._offset,p;try{p=e._header=SE.decode(t.slice(0,512),r.filenameEncoding,r.allowUnknownFormat)}catch(d){e.emit("error",d)}if(t.consume(512),!p){e._parse(512,g),i();return}if(p.type==="gnu-long-path"){e._parse(p.size,c),i();return}if(p.type==="gnu-long-link-path"){e._parse(p.size,u),i();return}if(p.type==="pax-global-header"){e._parse(p.size,a),i();return}if(p.type==="pax-header"){e._parse(p.size,l),i();return}if(e._gnuLongPath&&(p.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(p.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=p=Q9e(p,e._pax),e._pax=
2024-10-01 04:19:50 +02:00
Wanted: ${t.size}
2024-10-01 04:49:34 +02:00
Found: ${r.length}`);throw a.code="EBADSIZE",a.found=r.length,a.expected=t.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${r.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}ca.exports.checkStream=tVe;function tVe(r,e,t){t=An(t);let i=t.Promise||Promise,n=u1(t.concat({integrity:e}));return new i((s,o)=>{r.pipe(n),r.on("error",o),n.on("error",o);let a;n.on("verified",l=>{a=l}),n.on("end",()=>s(a)),n.on("data",()=>{})})}ca.exports.integrityStream=u1;function u1(r){r=An(r);let e=r.integrity&&la(r.integrity,r),t=e&&Object.keys(e).length,i=t&&e.pickAlgorithm(r),n=t&&e[i],s=Array.from(new Set(r.algorithms.concat(i?[i]:[]))),o=s.map(PE.createHash),a=0,l=new J9e({transform(c,u,g){a+=c.length,o.forEach(h=>h.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=r.options&&r.options.length?`?${r.options.join("?")}`:"",u=la(o.map((h,p)=>`${s[p]}-${h.digest("base64")}${c}`).join(" "),r),g=t&&u.match(e,r);if(typeof r.size=="number"&&a!==r.size){let h=new Error(`stream size mismatch when checking ${e}.
2024-10-01 04:19:50 +02:00
Wanted: ${r.size}
2024-10-01 04:49:34 +02:00
Found: ${a}`);h.code="EBADSIZE",h.found=a,h.expected=r.size,h.sri=e,l.emit("error",h)}else if(r.integrity&&!g){let h=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);h.code="EINTEGRITY",h.found=u,h.expected=n,h.algorithm=i,h.sri=e,l.emit("error",h)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}ca.exports.create=rVe;function rVe(r){r=An(r);let e=r.algorithms,t=r.options.length?`?${r.options.join("?")}`:"",i=e.map(PE.createHash);return{update:function(n,s){return i.forEach(o=>o.update(n,s)),this},digest:function(n){return e.reduce((o,a)=>{let l=i.shift().digest("base64"),c=new Fl(`${a}-${l}${t}`,r);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new $u)}}}var iVe=new Set(PE.getHashes()),Uue=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(r=>iVe.has(r));function nVe(r,e){return Uue.indexOf(r.toLowerCase())>=Uue.indexOf(e.toLowerCase())?r:e}});var om={};ct(om,{BuildType:()=>L0,Cache:()=>Dt,Configuration:()=>Ee,DEFAULT_LOCK_FILENAME:()=>oD,DEFAULT_RC_FILENAME:()=>sD,FormatType:()=>Bz,InstallMode:()=>ts,LightReport:()=>ta,LinkType:()=>Ef,Manifest:()=>ot,MessageName:()=>dt,MultiFetcher:()=>kf,PackageExtensionStatus:()=>Xx,PackageExtensionType:()=>Vx,Project:()=>Ge,ProjectLookup:()=>cD,Report:()=>xi,ReportError:()=>rt,SettingsType:()=>aD,StreamReport:()=>He,TAG_REGEXP:()=>Rf,TelemetryManager:()=>Sh,ThrowReport:()=>$r,VirtualFetcher:()=>Ff,Workspace:()=>bh,WorkspaceFetcher:()=>Tf,WorkspaceResolver:()=>Hr,YarnVersion:()=>Nr,execUtils:()=>pr,folderUtils:()=>Nw,formatUtils:()=>$,hashUtils:()=>Ai,httpUtils:()=>Vt,miscUtils:()=>me,nodeUtils:()=>ys,parseMessageName:()=>TI,scriptUtils:()=>Yt,semverUtils:()=>bt,stringifyMessageName:()=>RA,structUtils:()=>x,tgzUtils:()=>Ci,treeUtils:()=>es});var pr={};ct(pr,{EndStrategy:()=>hD,ExecError:()=>jw,PipeError:()=>CC,execvp:()=>tD,pipevp:()=>so});var zp={};ct(zp,{AliasFS:()=>bo,CustomDir:()=>jp,CwdFS:()=>jt,DEFAULT_COMPRESSION_LEVEL:()=>_l,FakeFS:()=>wa,Filename:()=>St,JailFS:()=>So,LazyFS:()=>Sg,LinkStrategy:()=>CS,NoFS:()=>qp,NodeFS:()=>Zt,PortablePath:()=>Te,PosixFS:()=>vg,ProxiedFS:()=>hi,VirtualFS:()=>wr,ZipFS:()=>qr,ZipOpenFS:()=>Kn,constants:()=>xr,extendFs:()=>aI,normalizeLineEndings:()=>Zl,npath:()=>K,opendir:()=>eI,patchFs:()=>QS,ppath:()=>v,statUtils:()=>Mp,toFilename:()=>Yr,xfs:()=>M});var xr={};ct(xr,{SAFE_TIME:()=>oK,S_IFDIR:()=>zl,S_IFLNK:()=>Xl,S_IFMT:()=>Ys,S_IFREG:()=>Vl});var Ys=61440,zl=16384,Vl=32768,Xl=40960,oK=456789e3;var Mp={};ct(Mp,{BigIntStatsEntry:()=>Bg,DEFAULT_MODE:()=>Lp,DirEntry:()=>cS,StatEntry:()=>ya,areStatsEqual:()=>gS,clearStats:()=>JE,convertToBigIntStats:()=>WE,makeDefaultStats:()=>Op,makeEmptyStats:()=>Gge});var uS=ve(J("util"));var Lp=33188,cS=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},ya=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=Lp;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},Bg=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);
2024-10-01 04:19:50 +02:00
`)}writeJsonSync(e,t){return this.writeFileSync(e,`${JSON.stringify(t,null,2)}
`)}async preserveTimePromise(e,t){let i=await this.lstatPromise(e),n=await t();typeof n<"u"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,t){let i=this.lstatSync(e),n=t();typeof n<"u"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},vA=class extends wa{constructor(){super(v)}};function $ge(r){let e=r.match(/\r?\n/g);if(e===null)return fK.EOL;let t=e.filter(n=>n===`\r
`).length,i=e.length-t;return t>i?`\r
`:`
2024-10-01 04:49:34 +02:00
`}function Zl(r,e){return e.replace(/\r?\n/g,$ge(r))}var bg=J("fs"),IS=J("stream"),CK=J("util"),yS=ve(J("zlib"));var hK=ve(J("fs"));var Zt=class extends vA{constructor(t=hK.default){super();this.realFs=t,typeof this.realFs.lutimes<"u"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Te.root}resolve(t){return v.resolve(t)}async openPromise(t,i,n){return await new Promise((s,o)=>{this.realFs.open(K.fromPortablePath(t),i,n,this.makeCallback(s,o))})}openSync(t,i,n){return this.realFs.openSync(K.fromPortablePath(t),i,n)}async opendirPromise(t,i){return await new Promise((n,s)=>{typeof i<"u"?this.realFs.opendir(K.fromPortablePath(t),i,this.makeCallback(n,s)):this.realFs.opendir(K.fromPortablePath(t),this.makeCallback(n,s))}).then(n=>Object.defineProperty(n,"path",{value:t,configurable:!0,writable:!0}))}opendirSync(t,i){let n=typeof i<"u"?this.realFs.opendirSync(K.fromPortablePath(t),i):this.realFs.opendirSync(K.fromPortablePath(t));return Object.defineProperty(n,"path",{value:t,configurable:!0,writable:!0})}async readPromise(t,i,n=0,s=0,o=-1){return await new Promise((a,l)=>{this.realFs.read(t,i,n,s,o,(c,u)=>{c?l(c):a(u)})})}readSync(t,i,n,s,o){return this.realFs.readSync(t,i,n,s,o)}async writePromise(t,i,n,s,o){return await new Promise((a,l)=>typeof i=="string"?this.realFs.write(t,i,n,this.makeCallback(a,l)):this.realFs.write(t,i,n,s,o,this.makeCallback(a,l)))}writeSync(t,i,n,s,o){return typeof i=="string"?this.realFs.writeSync(t,i,n):this.realFs.writeSync(t,i,n,s,o)}async closePromise(t){await new Promise((i,n)=>{this.realFs.close(t,this.makeCallback(i,n))})}closeSync(t){this.realFs.closeSync(t)}createReadStream(t,i){let n=t!==null?K.fromPortablePath(t):t;return this.realFs.createReadStream(n,i)}createWriteStream(t,i){let n=t!==null?K.fromPortablePath(t):t;return this.realFs.createWriteStream(n,i)}async realpathPromise(t){return await new Promise((i,n)=>{this.realFs.realpath(K.fromPortablePath(t),{},this.makeCallback(i,n))}).then(i=>K.toPortablePath(i))}realpathSync(t){return K.toPortablePath(this.realFs.realpathSync(K.fromPortablePath(t),{}))}async existsPromise(t){return await new Promise(i=>{this.realFs.exists(K.fromPortablePath(t),i)})}accessSync(t,i){return this.realFs.accessSync(K.fromPortablePath(t),i)}async accessPromise(t,i){return await new Promise((n,s)=>{this.realFs.access(K.fromPortablePath(t),i,this.makeCallback(n,s))})}existsSync(t){return this.realFs.existsSync(K.fromPortablePath(t))}async statPromise(t,i){return await new Promise((n,s)=>{i?this.realFs.stat(K.fromPortablePath(t),i,this.makeCallback(n,s)):this.realFs.stat(K.fromPortablePath(t),this.makeCallback(n,s))})}statSync(t,i){return i?this.realFs.statSync(K.fromPortablePath(t),i):this.realFs.statSync(K.fromPortablePath(t))}async fstatPromise(t,i){return await new Promise((n,s)=>{i?this.realFs.fstat(t,i,this.makeCallback(n,s)):this.realFs.fstat(t,this.makeCallback(n,s))})}fstatSync(t,i){return i?this.realFs.fstatSync(t,i):this.realFs.fstatSync(t)}async lstatPromise(t,i){return await new Promise((n,s)=>{i?this.realFs.lstat(K.fromPortablePath(t),i,this.makeCallback(n,s)):this.realFs.lstat(K.fromPortablePath(t),this.makeCallback(n,s))})}lstatSync(t,i){return i?this.realFs.lstatSync(K.fromPortablePath(t),i):this.realFs.lstatSync(K.fromPortablePath(t))}async fchmodPromise(t,i){return await new Promise((n,s)=>{this.realFs.fchmod(t,i,this.makeCallback(n,s))})}fchmodSync(t,i){return this.realFs.fchmodSync(t,i)}async chmodPromise(t,i){return await new Promise((n,s)=>{this.realFs.chmod(K.fromPortablePath(t),i,this.makeCallback(n,s))})}chmodSync(t,i){return this.realFs.chmodSync(K.fromPortablePath(t),i)}async fchownPromise(t,i,n){return await new Promise((s,o)=>{this.realFs.fchown(t,i,n,this.makeCallback(s,o))})}fchownSync(t,i,n){return this.realFs.fchownSync(t,i,n)}async chownPromise(t,i,n){return await new Promise((s,o)=>{this.realFs.chown(K.fromPortablePath(t),i,n,this.makeCallback(s,o))})}chownSync(t,i,n){return this.realFs.chownSync(K.fromPortablePath(t),i,n)}async renamePromis
2024-10-01 04:19:50 +02:00
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),Lfe=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(dU,([r,e])=>[r,`"$'${e}'"`])]),CU=r=>{var e;return(e=dU.get(r))!=null?e:`\\x${r.charCodeAt(0).toString(16).padStart(2,"0")}`},Ofe=r=>{var e;return(e=Lfe.get(r))!=null?e:`"$'${CU(r)}'"`};function US(r){let e=(i,n)=>n?`"${i}"`:i,t=i=>i===""?"''":i.match(/[()}<>$|&;"'\n\t ]/)?i.match(/['\t\p{C}]/u)?i.match(/'/)?`"${i.replace(/["$\t\p{C}]/u,Ofe)}"`:`$'${i.replace(/[\t\p{C}]/u,CU)}'`:`'${i}'`:i;switch(r.type){case"text":return t(r.text);case"glob":return r.pattern;case"shell":return e(`\${${Rg(r.shell)}}`,r.quoted);case"variable":return e(typeof r.defaultValue>"u"?typeof r.alternativeValue>"u"?`\${${r.name}}`:r.alternativeValue.length===0?`\${${r.name}:+}`:`\${${r.name}:+${r.alternativeValue.map(i=>ec(i)).join(" ")}}`:r.defaultValue.length===0?`\${${r.name}:-}`:`\${${r.name}:-${r.defaultValue.map(i=>ec(i)).join(" ")}}`,r.quoted);case"arithmetic":return`$(( ${gI(r.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: "${r.type}"`)}}function gI(r){let e=n=>{switch(n){case"addition":return"+";case"subtraction":return"-";case"multiplication":return"*";case"division":return"/";default:throw new Error(`Can't extract operator from arithmetic expression of type "${n}"`)}},t=(n,s)=>s?`( ${n} )`:n,i=n=>t(gI(n),!["number","variable"].includes(n.type));switch(r.type){case"number":return String(r.value);case"variable":return r.name;default:return`${i(r.left)} ${e(r.type)} ${i(r.right)}`}}var IU=ve(EU());function fI(r){let e=r.match(/^\*{1,2}\/(.*)/);if(e)throw new Error(`The override for '${r}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${e[1]}' instead.`);try{return(0,IU.parse)(r)}catch(t){throw t.location&&(t.message=t.message.replace(/(\.)?$/,` (line ${t.location.start.line}, column ${t.location.start.column})$1`)),t}}function hI(r){let e="";return r.from&&(e+=r.from.fullName,r.from.description&&(e+=`@${r.from.description}`),e+="/"),e+=r.descriptor.fullName,r.descriptor.description&&(e+=`@${r.descriptor.description}`),e}var SI=ve(cH()),pH=ve(gH()),mde=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,fH=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],bI=class{constructor(e){this.data=e}};function hH(r){return r.match(mde)?r:JSON.stringify(r)}function dH(r){return typeof r>"u"?!0:typeof r=="object"&&r!==null?Object.keys(r).every(e=>dH(r[e])):!1}function $S(r,e,t){if(r===null)return`null
`;if(typeof r=="number"||typeof r=="boolean")return`${r.toString()}
`;if(typeof r=="string")return`${hH(r)}
`;if(Array.isArray(r)){if(r.length===0)return`[]
`;let i=" ".repeat(e);return`
${r.map(s=>`${i}- ${$S(s,e+1,!1)}`).join("")}`}if(typeof r=="object"&&r){let[i,n]=r instanceof bI?[r.data,!1]:[r,!0],s=" ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=fH.indexOf(l),g=fH.indexOf(c);return u===-1&&g===-1?l<c?-1:l>c?1:0:u!==-1&&g===-1?-1:u===-1&&g!==-1?1:u-g});let a=o.filter(l=>!dH(i[l])).map((l,c)=>{let u=i[l],g=hH(l),h=$S(u,e+1,!0),p=c>0||t?s:"",d=g.length>1024?`? ${g}
${p}:`:`${g}:`,m=h.startsWith(`
`)?h:` ${h}`;return`${p}${d}${m}`}).join(e===0?`
`:"")||`
`;return t?`
${a}`:`${a}`}throw new Error(`Unsupported value type (${r})`)}function ba(r){try{let e=$S(r,0,!1);return e!==`
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}ba.PreserveOrdering=bI;function Ede(r){return r.endsWith(`
`)||(r+=`
2024-10-01 04:49:34 +02:00
`),(0,pH.parse)(r)}var Ide=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function yde(r){if(Ide.test(r))return Ede(r);let e=(0,SI.safeLoad)(r,{schema:SI.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function wi(r){return yde(r)}var yz=ve(mH()),Mw=ve(cc());var gd={};ct(gd,{Builtins:()=>hv,Cli:()=>jn,Command:()=>be,Option:()=>z,UsageError:()=>we,formatMarkdownish:()=>Ti});var tv="",Bi="\0";var rv=/^(-h|--help)(?:=([0-9]+))?$/,vI=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,wH=/^-[a-zA-Z]{2,}$/,iv=/^([^=]+)=([\s\S]*)$/,nv=process.env.DEBUG_CLI==="1";var we=class extends Error{constructor(e){super(e),this.clipanion={type:"usage"},this.name="UsageError"}},Hg=class extends Error{constructor(e,t){if(super(),this.input=e,this.candidates=t,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(i=>i.reason!==null&&i.reason===t[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i}
2024-10-01 04:19:50 +02:00
${this.candidates.map(({usage:n})=>`$ ${n}`).join(`
`)}`}else if(this.candidates.length===1){let[{usage:i}]=this.candidates;this.message=`Command not found; did you mean:
$ ${i}
${sv(e)}`}else this.message=`Command not found; did you mean one of:
${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
`)}
${sv(e)}`}},xI=class extends Error{constructor(e,t){super(),this.input=e,this.usages=t,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
${this.usages.map((i,n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
`)}
2024-10-01 04:49:34 +02:00
${sv(e)}`}},sv=r=>`While running ${r.filter(e=>e!==Bi).map(e=>{let t=JSON.stringify(e);return e.match(/\s/)||e.length===0||t!==`"${e}"`?t:e}).join(" ")}`;var id=Symbol("clipanion/isOption");function Xi(r){return{...r,[id]:!0}}function Po(r,e){return typeof r>"u"?[r,e]:typeof r=="object"&&r!==null&&!Array.isArray(r)?[void 0,r]:[r,e]}function PI(r,e=!1){let t=r.replace(/^\.: /,"");return e&&(t=t[0].toLowerCase()+t.slice(1)),t}function nd(r,e){return e.length===1?new we(`${r}: ${PI(e[0],!0)}`):new we(`${r}:
2024-10-01 04:19:50 +02:00
${e.map(t=>`
2024-10-01 04:49:34 +02:00
- ${PI(t)}`).join("")}`)}function sd(r,e,t){if(typeof t>"u")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!t(e,{errors:i,coercions:n,coercion:s}))throw nd(`Invalid value for ${r}`,i);for(let[,a]of n)a();return e}var be=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let t=this.constructor.schema;if(Array.isArray(t)){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(()=>(As(),pn)),a=o(n(s()),t),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw nd("Invalid option schema",l);for(let[,g]of c)g()}else if(t!=null)throw new Error("Invalid command schema");let i=await this.execute();return typeof i<"u"?i:0}};be.isOption=id;be.Default=[];var Av=Array(80).fill("\u2501");for(let r=0;r<=24;++r)Av[Av.length-r]=`\x1B[38;5;${232+r}m\u2501`;var lv={header:r=>`\x1B[1m\u2501\u2501\u2501 ${r}${r.length<80-5?` ${Av.slice(r.length+5).join("")}`:":"}\x1B[0m`,bold:r=>`\x1B[1m${r}\x1B[22m`,error:r=>`\x1B[31m\x1B[1m${r}\x1B[22m\x1B[39m`,code:r=>`\x1B[36m${r}\x1B[39m`},RH={header:r=>r,bold:r=>r,error:r=>r,code:r=>r};function nCe(r){let e=r.split(`
2024-10-01 04:19:50 +02:00
`),t=e.filter(n=>n.match(/\S/)),i=t.length>0?t.reduce((n,s)=>Math.min(n,s.length-s.trimStart().length),Number.MAX_VALUE):0;return e.map(n=>n.slice(i).trimRight()).join(`
2024-10-01 04:49:34 +02:00
`)}function Ti(r,{format:e,paragraphs:t}){return r=r.replace(/\r\n?/g,`
2024-10-01 04:19:50 +02:00
`),r=nCe(r),r=r.replace(/^\n+|\n+$/g,""),r=r.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
`),r=r.replace(/\n(\n)?\n*/g,"$1"),t&&(r=r.split(/\n/).map(i=>{let n=i.match(/^\s*[*-][\t ]+(.*)/);if(!n)return i.match(/(.{1,80})(?: |$)/g).join(`
`);let s=i.length-i.trimStart().length;return n[1].match(new RegExp(`(.{1,${78-s}})(?: |$)`,"g")).map((o,a)=>" ".repeat(s)+(a===0?"- ":" ")+o).join(`
`)}).join(`
`)),r=r.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),r=r.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),r?`${r}
2024-10-01 04:49:34 +02:00
`:""}var fv=ve(J("tty"),1);function dn(r){nv&&console.log(r)}var FH={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:-1};function NH(){return{nodes:[_i(),_i(),_i()]}}function sCe(r){let e=NH(),t=[],i=e.nodes.length;for(let n of r){t.push(i);for(let s=0;s<n.nodes.length;++s)OH(s)||e.nodes.push(hCe(n.nodes[s],i));i+=n.nodes.length-2}for(let n of t)jg(e,0,n);return e}function Vs(r,e){return r.nodes.push(e),r.nodes.length-1}function oCe(r){let e=new Set,t=i=>{if(e.has(i))return;e.add(i);let n=r.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)t(a);for(let[,{to:o}]of n.dynamics)t(o);for(let{to:o}of n.shortcuts)t(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=r.nodes[o];for(let[l,c]of Object.entries(a.statics)){let u=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(let g of c)u.some(({to:h})=>g.to===h)||u.push(g)}for(let[l,c]of a.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(let l of a.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};t(0)}function aCe(r,{prefix:e=""}={}){if(nv){dn(`${e}Nodes are:`);for(let t=0;t<r.nodes.length;++t)dn(`${e} ${t}: ${JSON.stringify(r.nodes[t])}`)}}function TH(r,e,t=!1){dn(`Running a vm on ${JSON.stringify(e)}`);let i=[{node:0,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];aCe(r,{prefix:" "});let n=[tv,...e];for(let s=0;s<n.length;++s){let o=n[s];dn(` Processing ${JSON.stringify(o)}`);let a=[];for(let{node:l,state:c}of i){dn(` Current node is ${l}`);let u=r.nodes[l];if(l===2){a.push({node:l,state:c});continue}console.assert(u.shortcuts.length===0,"Shortcuts should have been eliminated by now");let g=Object.prototype.hasOwnProperty.call(u.statics,o);if(!t||s<n.length-1||g)if(g){let h=u.statics[o];for(let{to:p,reducer:d}of h)a.push({node:p,state:typeof d<"u"?DI(uv,d,c,o):c}),dn(` Static transition to ${p} found`)}else dn(" No static transition found");else{let h=!1;for(let p of Object.keys(u.statics))if(!!p.startsWith(o)){if(o===p)for(let{to:d,reducer:m}of u.statics[p])a.push({node:d,state:typeof m<"u"?DI(uv,m,c,o):c}),dn(` Static transition to ${d} found`);else for(let{to:d}of u.statics[p])a.push({node:d,state:{...c,remainder:p.slice(o.length)}}),dn(` Static transition to ${d} found (partial match)`);h=!0}h||dn(" No partial static transition found")}if(o!==Bi)for(let[h,{to:p,reducer:d}]of u.dynamics)DI(FI,h,c,o)&&(a.push({node:p,state:typeof d<"u"?DI(uv,d,c,o):c}),dn(` Dynamic transition to ${p} found (via ${h})`))}if(a.length===0&&o===Bi&&e.length===1)return[{node:0,state:FH}];if(a.length===0)throw new Hg(e,i.filter(({node:l})=>l!==2).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===2))throw new Hg(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=uCe(a)}if(i.length>0){dn(" Results:");for(let s of i)dn(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else dn(" No results");return i}function ACe(r,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(r.statics,Bi)){for(let{to:t}of r.statics[Bi])if(t===1)return!0}return!1}function lCe(r,e,t){let i=t&&e.length>0?[""]:[],n=TH(r,e,t),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let p=g;g=[];for(let d of p){let m=r.nodes[d],y=Object.keys(m.statics);for(let B of Object.keys(m.statics)){let S=y[0];for(let{to:P,reducer:F}of m.statics[S])F==="pushPath"&&(u||l.push(S),g.push(P))}}u=!1}let h=JSON.stringify(l);o.has(h)||(s.push(l),o.add(h))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=r.nodes[l],g=ACe(u,c);for(let[h,p]of Object.entries(u.statics))(g&&h!==Bi||!h.startsWith("-")&&p.some(({reducer:d})=>d==="pushPath"))&&a([...i,h],l);if(!!g)for(let[h,{to:p}]of u.dynamics){if(p===2)continue;let d=pCe(h,c);if(d!==null)for(let m of d)a([...i,m],l
2024-10-01 04:19:50 +02:00
`),this.context.stdout.write(`
`);let t=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${t++}. `.padStart(5)}));this.context.stdout.write(`
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
2024-10-01 04:49:34 +02:00
`)}}};var MH=Symbol("clipanion/errorCommand");function dCe(){return process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var jn=class{constructor({binaryLabel:e,binaryName:t="...",binaryVersion:i,enableCapture:n=!1,enableColors:s}={}){this.registrations=new Map,this.builder=new Yg({binaryName:t}),this.binaryLabel=e,this.binaryName=t,this.binaryVersion=i,this.enableCapture=n,this.enableColors=s}static from(e,t={}){let i=new jn(t);for(let n of e)i.register(n);return i}register(e){var t;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[be.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(t=e.paths)!==null&&t!==void 0?t:n.paths;if(typeof a<"u")for(let l of a)s.addPath(l);this.registrations.set(e,{specs:i,builder:s,index:o});for(let[l,{definition:c}]of i.entries())c(s,l);s.setContext({commandClass:e})}process(e){let{contexts:t,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case-1:return qg.from(n,t);default:{let{commandClass:s}=t[n.selectedIndex],o=this.registrations.get(s);if(typeof o>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let a=new s;a.path=n.path;try{for(let[l,{transformer:c}]of o.specs.entries())a[l]=c(o.builder,l,n);return a}catch(l){throw l[MH]=a,l}}break}}async run(e,t){var i;let n,s={...jn.defaultContext,...t},o=(i=this.enableColors)!==null&&i!==void 0?i:s.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e)}catch(c){return s.stdout.write(this.error(c,{colored:o})),1}if(n.help)return s.stdout.write(this.usage(n,{colored:o,detailed:!0})),0;n.context=s,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(c,u)=>this.error(c,u),format:c=>this.format(c),process:c=>this.process(c),run:(c,u)=>this.run(c,{...s,...u}),usage:(c,u)=>this.usage(c,u)};let a=this.enableCapture?CCe(s):UH,l;try{l=await a(()=>n.validateAndExecute().catch(c=>n.catch(c).then(()=>0)))}catch(c){return s.stdout.write(this.error(c,{colored:o,command:n})),1}return l}async runExit(e,t){process.exitCode=await this.run(e,t)}suggest(e,t){let{suggest:i}=this.builder.compile();return i(e,t)}definitions({colored:e=!1}={}){let t=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage>"u")continue;let{usage:s}=this.getUsageByIndex(n,{detailed:!1}),{usage:o,options:a}=this.getUsageByIndex(n,{detailed:!0,inlineOptions:!1}),l=typeof i.usage.category<"u"?Ti(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description<"u"?Ti(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details<"u"?Ti(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples<"u"?i.usage.examples.map(([h,p])=>[Ti(h,{format:this.format(e),paragraphs:!1}),p.replace(/\$0/g,this.binaryName)]):void 0;t.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return t}usage(e=null,{colored:t,detailed:i=!1,prefix:n="$ "}={}){var s;if(e===null){for(let l of this.registrations.keys()){let c=l.paths,u=typeof l.usage<"u";if(!c||c.length===0||c.length===1&&c[0].length===0||((s=c==null?void 0:c.some(p=>p.length===0))!==null&&s!==void 0?s:!1))if(e){e=null;break}else e=l;else if(u){e=null;continue}}e&&(i=!0)}let o=e!==null&&e instanceof be?e.constructor:e,a="";if(o)if(i){let{description:l="",details:c="",examples:u=[]}=o.usage||{};l!==""&&(a+=Ti(l,{format:this.format(t),paragraphs:!1}).replace(/^./,p=>p.toUpperCase()),a+=`
2024-10-01 04:19:50 +02:00
`),(c!==""||u.length>0)&&(a+=`${this.format(t).header("Usage")}
`,a+=`
`);let{usage:g,options:h}=this.getUsageByRegistration(o,{inlineOptions:!1});if(a+=`${this.format(t).bold(n)}${g}
`,h.length>0){a+=`
`,a+=`${lv.header("Options")}
`;let p=h.reduce((d,m)=>Math.max(d,m.definition.length),0);a+=`
2024-10-01 04:49:34 +02:00
`;for(let{definition:d,description:m}of h)a+=` ${this.format(t).bold(d.padEnd(p))} ${Ti(m,{format:this.format(t),paragraphs:!1})}`}if(c!==""&&(a+=`
2024-10-01 04:19:50 +02:00
`,a+=`${this.format(t).header("Details")}
`,a+=`
2024-10-01 04:49:34 +02:00
`,a+=Ti(c,{format:this.format(t),paragraphs:!0})),u.length>0){a+=`
2024-10-01 04:19:50 +02:00
`,a+=`${this.format(t).header("Examples")}
`;for(let[p,d]of u)a+=`
2024-10-01 04:49:34 +02:00
`,a+=Ti(p,{format:this.format(t),paragraphs:!1}),a+=`${d.replace(/^/m,` ${this.format(t).bold(n)}`).replace(/\$0/g,this.binaryName)}
2024-10-01 04:19:50 +02:00
`}}else{let{usage:l}=this.getUsageByRegistration(o);a+=`${this.format(t).bold(n)}${l}
2024-10-01 04:49:34 +02:00
`}else{let l=new Map;for(let[h,{index:p}]of this.registrations.entries()){if(typeof h.usage>"u")continue;let d=typeof h.usage.category<"u"?Ti(h.usage.category,{format:this.format(t),paragraphs:!1}):null,m=l.get(d);typeof m>"u"&&l.set(d,m=[]);let{usage:y}=this.getUsageByIndex(p);m.push({commandClass:h,usage:y})}let c=Array.from(l.keys()).sort((h,p)=>h===null?-1:p===null?1:h.localeCompare(p,"en",{usage:"sort",caseFirst:"upper"})),u=typeof this.binaryLabel<"u",g=typeof this.binaryVersion<"u";u||g?(u&&g?a+=`${this.format(t).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
2024-10-01 04:19:50 +02:00
`:u?a+=`${this.format(t).header(`${this.binaryLabel}`)}
`:a+=`${this.format(t).header(`${this.binaryVersion}`)}
`,a+=` ${this.format(t).bold(n)}${this.binaryName} <command>
`):a+=`${this.format(t).bold(n)}${this.binaryName} <command>
`;for(let h of c){let p=l.get(h).slice().sort((m,y)=>m.usage.localeCompare(y.usage,"en",{usage:"sort",caseFirst:"upper"})),d=h!==null?h.trim():"General commands";a+=`
`,a+=`${this.format(t).header(`${d}`)}
`;for(let{commandClass:m,usage:y}of p){let B=m.usage.description||"undocumented";a+=`
`,a+=` ${this.format(t).bold(y)}
2024-10-01 04:49:34 +02:00
`,a+=` ${Ti(B,{format:this.format(t),paragraphs:!1})}`}}a+=`
`,a+=Ti("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(t),paragraphs:!0})}return a}error(e,t){var i,{colored:n,command:s=(i=e[MH])!==null&&i!==void 0?i:null}=t===void 0?{}:t;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let o="",a=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");a==="Error"&&(a="Internal Error"),o+=`${this.format(n).error(a)}: ${e.message}
2024-10-01 04:19:50 +02:00
`;let l=e.clipanion;return typeof l<"u"?l.type==="usage"&&(o+=`
`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")}
`),o}format(e){var t;return((t=e!=null?e:this.enableColors)!==null&&t!==void 0?t:jn.defaultContext.colorDepth>1)?lv:RH}getUsageByRegistration(e,t){let i=this.registrations.get(e);if(typeof i>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,t)}getUsageByIndex(e,t){return this.builder.getBuilderByIndex(e).usage(t)}};jn.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:"getColorDepth"in fv.default.WriteStream.prototype?fv.default.WriteStream.prototype.getColorDepth():dCe()};var KH;function CCe(r){let e=KH;if(typeof e>"u"){if(r.stdout===process.stdout&&r.stderr===process.stderr)return UH;let{AsyncLocalStorage:t}=J("async_hooks");e=KH=new t;let i=process.stdout._write;process.stdout._write=function(s,o,a){let l=e.getStore();return typeof l>"u"?i.call(this,s,o,a):l.stdout.write(s,o,a)};let n=process.stderr._write;process.stderr._write=function(s,o,a){let l=e.getStore();return typeof l>"u"?n.call(this,s,o,a):l.stderr.write(s,o,a)}}return t=>e.run(r,t)}function UH(r){return r()}var hv={};ct(hv,{DefinitionsCommand:()=>ld,HelpCommand:()=>cd,VersionCommand:()=>ud});var ld=class extends be{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};ld.paths=[["--clipanion=definitions"]];var cd=class extends be{async execute(){this.context.stdout.write(this.cli.usage())}};cd.paths=[["-h"],["--help"]];var ud=class extends be{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
2024-10-01 04:49:34 +02:00
`)}};ud.paths=[["-v"],["--version"]];var z={};ct(z,{Array:()=>HH,Boolean:()=>jH,Counter:()=>GH,Proxy:()=>YH,Rest:()=>qH,String:()=>JH,applyValidator:()=>sd,cleanValidationError:()=>PI,formatError:()=>nd,isOptionSymbol:()=>id,makeCommandOption:()=>Xi,rerouteArguments:()=>Po});function HH(r,e,t){let[i,n]=Po(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return Xi({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i<"u"?[...i]:void 0;for(let{name:h,value:p}of u.options)!a.has(h)||(g=g!=null?g:[],g.push(p));return g}})}function jH(r,e,t){let[i,n]=Po(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return Xi({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u=h);return u}})}function GH(r,e,t){let[i,n]=Po(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return Xi({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u!=null||(u=0),h?u+=1:u=0);return u}})}function YH(r={}){return Xi({definition(e,t){var i;e.addProxy({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){return i.positionals.map(({value:n})=>n)}})}function qH(r={}){return Xi({definition(e,t){var i;e.addRest({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){let n=o=>{let a=i.positionals[o];return a.extra===Hn||a.extra===!1&&o<e.arity.leading.length},s=0;for(;s<i.positionals.length&&n(s);)s+=1;return i.positionals.splice(0,s).map(({value:o})=>o)}})}function mCe(r,e,t){let[i,n]=Po(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return Xi({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,h=i;for(let{name:p,value:d}of u.options)!a.has(p)||(g=p,h=d);return typeof h=="string"?sd(g!=null?g:c,h,n.validator):h}})}function ECe(r={}){let{required:e=!0}=r;return Xi({definition(t,i){var n;t.addPositional({name:(n=r.name)!==null&&n!==void 0?n:i,required:r.required})},transformer(t,i,n){var s;for(let o=0;o<n.positionals.length;++o){if(n.positionals[o].extra===Hn||e&&n.positionals[o].extra===!0||!e&&n.positionals[o].extra===!1)continue;let[a]=n.positionals.splice(o,1);return sd((s=r.name)!==null&&s!==void 0?s:i,a.value,r.validator)}}})}function JH(r,...e){return typeof r=="string"?mCe(r,...e):ECe(r)}var wz=ve(Jg()),nD=J("stream");var dt=(ae=>(ae[ae.UNNAMED=0]="UNNAMED",ae[ae.EXCEPTION=1]="EXCEPTION",ae[ae.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",ae[ae.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",ae[ae.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",ae[ae.BUILD_DISABLED=5]="BUILD_DISABLED",ae[ae.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",ae[ae.MUST_BUILD=7]="MUST_BUILD",ae[ae.MUST_REBUILD=8]="MUST_REBUILD",ae[ae.BUILD_FAILED=9]="BUILD_FAILED",ae[ae.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",ae[ae.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",ae[ae.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",ae[ae.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",ae[ae.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",ae[ae.REMOTE_INVALID=15]="REMOTE_INVALID",ae[ae.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",ae[ae.RESOLUTION_PACK=17]="RESOLUTION_PACK",ae[ae.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",ae[ae.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",ae[ae.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",ae[ae.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",ae[ae.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",ae[ae.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",ae[ae.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",ae[ae.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",ae[ae.CONSTRAINTS_INVALID_DEPENDENCY=26]="CONSTRAINTS_INVALID_DEPEN
`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",e!==null?this.reportInfo(null,`${e} ${l}`):this.reportInfo(null,l)}while(a!==-1);n+=o}),t.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),t}};var kf=class{constructor(e){this.fetchers=e}supports(e,t){return!!this.tryFetcher(e,t)}getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}async fetch(e,t){return await this.getFetcher(e,t).fetch(e,t)}tryFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));return i||null}getFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));if(!i)throw new rt(11,`${Ct(t.project.configuration,e)} isn't supported by any available fetcher`);return i}};var Df=class{constructor(e){this.resolvers=e.filter(t=>t)}supportsDescriptor(e,t){return!!this.tryResolverByDescriptor(e,t)}supportsLocator(e,t){return!!this.tryResolverByLocator(e,t)}shouldPersistResolution(e,t){return this.getResolverByLocator(e,t).shouldPersistResolution(e,t)}bindDescriptor(e,t,i){return this.getResolverByDescriptor(e,i).bindDescriptor(e,t,i)}getResolutionDependencies(e,t){return this.getResolverByDescriptor(e,t).getResolutionDependencies(e,t)}async getCandidates(e,t,i){return await this.getResolverByDescriptor(e,i).getCandidates(e,t,i)}async getSatisfying(e,t,i){return this.getResolverByDescriptor(e,i).getSatisfying(e,t,i)}async resolve(e,t){return await this.getResolverByLocator(e,t).resolve(e,t)}tryResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));return i||null}getResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));if(!i)throw new Error(`${$t(t.project.configuration,e)} isn't supported by any available resolver`);return i}tryResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));return i||null}getResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));if(!i)throw new Error(`${Ct(t.project.configuration,e)} isn't supported by any available resolver`);return i}};var mz=ve(zr());var Rf=/^(?!v)[a-z0-9._-]+$/i,Fw=class{supportsDescriptor(e,t){return!!(no(e.range)||Rf.test(e.range))}supportsLocator(e,t){return!!(mz.default.valid(e.reference)||Rf.test(e.reference))}shouldPersistResolution(e,t){return t.resolver.shouldPersistResolution(this.forwardLocator(e,t),t)}bindDescriptor(e,t,i){return i.resolver.bindDescriptor(this.forwardDescriptor(e,i),t,i)}getResolutionDependencies(e,t){return t.resolver.getResolutionDependencies(this.forwardDescriptor(e,t),t)}async getCandidates(e,t,i){return await i.resolver.getCandidates(this.forwardDescriptor(e,i),t,i)}async getSatisfying(e,t,i){return await i.resolver.getSatisfying(this.forwardDescriptor(e,i),t,i)}async resolve(e,t){let i=await t.resolver.resolve(this.forwardLocator(e,t),t);return rC(i,e)}forwardDescriptor(e,t){return zt(e,`${t.project.configuration.get("defaultProtocol")}${e.range}`)}forwardLocator(e,t){return nn(e,`${t.project.configuration.get("defaultProtocol")}${e.reference}`)}};var Ff=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=nn(e,n);return t.fetcher.getLocalPath(s,t)}async fetch(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=nn(e,n),o=await t.fetcher.fetch(s,t);return await this.ensureVirtualLink(e,o,t)}getLocatorFilename(e){return xf(e)}async ensureVirtualLink(e,t,i){let n=t.packageFs.getRealPath(),s=i.project.configuration.get("virtualFolder"),o=this.getLocatorFilename(e),a=wr.makeVirtualPath(s,o,n),l=new bo(a,{baseFs:t.packageFs,pathUtils:v});return{...t,packageFs:l}}};var Nf=class{static isVirtualDescriptor(e){return!!e.range.startsWith(Nf.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(Nf.protocol)}supportsDescriptor(e,t){return Nf.isVirtualDescriptor(e)}supportsLocator(e,t){return Nf.isVirtualLocator(e)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){throw new Err
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let t of this.plugins.values())for(let i of t.resolvers||[])e.push(new i);return new Df([new hC,new Hr,new Fw,...e])}makeFetcher(){let e=[];for(let t of this.plugins.values())for(let i of t.fetchers||[])e.push(new i);return new kf([new Ff,new Tf,...e])}getLinkers(){let e=[];for(let t of this.plugins.values())for(let i of t.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=dC(),t=this.get("supportedArchitectures"),i=t.get("os");i!==null&&(i=i.map(o=>o==="current"?e.os:o));let n=t.get("cpu");n!==null&&(n=n.map(o=>o==="current"?e.cpu:o));let s=t.get("libc");return s!==null&&(s=Uo(s,o=>{var a;return o==="current"?(a=e.libc)!=null?a:Uo.skip:o})),{os:i,cpu:n,libc:s}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,t=(i,n,{userProvided:s=!1}={})=>{if(!no(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new ot;o.load(n,{yamlCompatibilityMode:!0});let a=hf(e,i.identHash),l=[];a.push([i.range,l]);let c={status:"inactive",userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push({...c,type:"Dependency",descriptor:u});for(let u of o.peerDependencies.values())l.push({...c,type:"PeerDependency",descriptor:u});for(let[u,g]of o.peerDependenciesMeta)for(let[h,p]of Object.entries(g))l.push({...c,type:"PeerDependencyMeta",selector:u,key:h,value:p})};await this.triggerHook(i=>i.registerPackageExtensions,this,t);for(let[i,n]of this.get("packageExtensions"))t(JA(i,!0),qy(n),{userProvided:!0})}normalizePackage(e){let t=iC(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let i=this.packageExtensions.get(e.identHash);if(typeof i<"u"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!Fc(s,o))for(let l of a)switch(l.status==="inactive"&&(l.status="redundant"),l.type){case"Dependency":typeof t.dependencies.get(l.descriptor.identHash)>"u"&&(l.status="active",t.dependencies.set(l.descriptor.identHash,l.descriptor));break;case"PeerDependency":typeof t.peerDependencies.get(l.descriptor.identHash)>"u"&&(l.status="active",t.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case"PeerDependencyMeta":{let c=t.peerDependenciesMeta.get(l.selector);(typeof c>"u"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status="active",La(t.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:qx(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of t.peerDependenciesMeta.keys()){let o=tn(s);t.peerDependencies.has(o.identHash)||t.peerDependencies.set(o.identHash,zt(o,"*"))}for(let s of t.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=qo("types",o),l=Tt(a);t.peerDependencies.has(a.identHash)||t.peerDependenciesMeta.has(l)||(t.peerDependencies.set(a.identHash,zt(a,"*")),t.peerDependenciesMeta.set(l,{optional:!0}))}return t.dependencies=new Map(bn(t.dependencies,([,s])=>vn(s))),t.peerDependencies=new Map(bn(t.peerDependencies,([,s])=>vn(s))),t}getLimit(e){return La(this.limits,e,()=>(0,wz.default)(this.get(e)))}async triggerHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...t)}}async triggerMultipleHooks(e,t){for(let i of t)await this.triggerHook(e,...i)}async reduceHook(e,t,...i){let n=t;for(let s of this.plugins.values()){let o=s.hooks;if(!o)continue;let a=e(o);!a||(n=await a(n,...i))}return n}async firstHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);if(!s)continue;let o=await s(...t);if(typeof o<"u")return o}return null}},Ee=ja;Ee.telemetry=null;var hD=(i=>(i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always",i))(hD||{}),CC=class extends rt{constructor({fileName:t,code:i,signal:n}){let s=Ee.create(v.cwd()),o=_e(s,t,Ke.PATH);super(1,`Child ${o} reported an error`,a=>{exe(i,n,{configuration:s,report:a})});this.code=pD(i,n)}},jw=class extends CC{constructor({fileName:t,code:i,signal:n,std
2024-10-01 04:19:50 +02:00
`),c(127);break;case"EACCES":n[2].write(`permission denied: ${r}
`),c(128);break;default:n[2].write(`uncaught error: ${u.message}
`),c(1);break}}),l.on("close",u=>{Uc.delete(l),Uc.size===0&&(process.off("SIGINT",LR),process.off("SIGTERM",OR)),c(u!==null?u:129)})})}}}function E9(r){return e=>{let t=e[0]==="pipe"?new zo.PassThrough:e[0];return{stdin:t,promise:Promise.resolve().then(()=>r({stdin:t,stdout:e[1],stderr:e[2]}))}}}var bs=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},MR=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},zf=class{constructor(e,t){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=t}static start(e,{stdin:t,stdout:i,stderr:n}){let s=new zf(null,e);return s.stdin=t,s.stdout=i,s.stderr=n,s}pipeTo(e,t=1){let i=new zf(this,e),n=new MR;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(t&1)===1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(t&2)===2?this.stderr=n:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),i}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let t;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");t=this.stdout,e[1]=t.get();let i;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");i=this.stderr,e[2]=i.get();let n=this.implementation(e);return this.pipe&&this.pipe.attach(n.stdin),await n.promise.then(s=>(t.close(),i.close(),s))}async run(){let e=[];for(let i=this;i;i=i.ancestor)e.push(i.exec());return(await Promise.all(e))[0]}};function BB(r,e){return zf.start(r,e)}function p9(r,e=null){let t=new zo.PassThrough,i=new C9.StringDecoder,n="";return t.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(`
`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",r(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),t.on("end",()=>{let s=i.end();s!==""&&r(e!==null?`${e} ${s}`:s)}),t}function I9(r,{prefix:e}){return{stdout:p9(t=>r.stdout.write(`${t}
`),r.stdout.isTTY?e:null),stderr:p9(t=>r.stderr.write(`${t}
`),r.stderr.isTTY?e:null)}}var CDe=(0,v9.promisify)(setTimeout);function y9(r,e,t){let i=new Vn.PassThrough({autoDestroy:!0});switch(r){case 0:(e&1)===1&&t.stdin.pipe(i,{end:!1}),(e&2)===2&&t.stdin instanceof Vn.Writable&&i.pipe(t.stdin,{end:!1});break;case 1:(e&1)===1&&t.stdout.pipe(i,{end:!1}),(e&2)===2&&i.pipe(t.stdout,{end:!1});break;case 2:(e&1)===1&&t.stderr.pipe(i,{end:!1}),(e&2)===2&&i.pipe(t.stderr,{end:!1});break;default:throw new zn(`Bad file descriptor: "${r}"`)}return i}function bB(r,e={}){let t={...r,...e};return t.environment={...r.environment,...e.environment},t.variables={...r.variables,...e.variables},t}var mDe=new Map([["cd",async([r=(0,S9.homedir)(),...e],t,i)=>{let n=v.resolve(i.cwd,K.toPortablePath(r));if(!(await t.baseFs.statPromise(n).catch(o=>{throw o.code==="ENOENT"?new zn(`cd: no such file or directory: ${r}`):o})).isDirectory())throw new zn(`cd: not a directory: ${r}`);return i.cwd=n,0}],["pwd",async(r,e,t)=>(t.stdout.write(`${K.fromPortablePath(t.cwd)}
`),0)],[":",async(r,e,t)=>0],["true",async(r,e,t)=>0],["false",async(r,e,t)=>1],["exit",async([r,...e],t,i)=>i.exitCode=parseInt(r!=null?r:i.variables["?"],10)],["echo",async(r,e,t)=>(t.stdout.write(`${r.join(" ")}
`),0)],["sleep",async([r],e,t)=>{if(typeof r>"u")throw new zn("sleep: missing operand");let i=Number(r);if(Number.isNaN(i))throw new zn(`sleep: invalid time interval '${r}'`);return await CDe(1e3*i,0)}],["__ysh_run_procedure",async(r,e,t)=>{let i=t.procedures[r[0]];return await BB(i,{stdin:new bs(t.stdin),stdout:new bs(t.stdout),stderr:new bs(t.stderr)}).run()}],["__ysh_set_redirects",async(r,e,t)=>{let i=t.stdin,n=t.stdout,s=t.stderr,o=[],a=[],l=[],c=0;for(;r[c]!=="--";){let g=r[c++],{type:h,fd:p}=JSON.parse(g),d=S=>{switch(p){case null:case 0:o.push(S);break;default:throw new Error(`Unsupported file descriptor: "${p}"`)}},m=S=>{switch(p){case null:case 1:a.push(S);break;case 2:l.push(S);break;default:throw new Error(`Unsupported file descriptor: "${p}"`)}},y=Number(r[c++]),B=c+y;for(let S=c;S<B;++c,++S)switch(h){case"<":d(()=>e.baseFs.createReadStream(v.resolve(t.cwd,K.toPortablePath(r[S]))));break;case"<<<":d(()=>{let P=new Vn.PassThrough;return process.nextTick(()=>{P.write(`${r[S]}
2024-10-01 04:49:34 +02:00
`),P.end()}),P});break;case"<&":d(()=>y9(Number(r[S]),1,t));break;case">":case">>":{let P=v.resolve(t.cwd,K.toPortablePath(r[S]));m(P==="/dev/null"?new Vn.Writable({autoDestroy:!0,emitClose:!0,write(F,H,q){setImmediate(q)}}):e.baseFs.createWriteStream(P,h===">>"?{flags:"a"}:void 0))}break;case">&":m(y9(Number(r[S]),2,t));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${h}"`)}}if(o.length>0){let g=new Vn.PassThrough;i=g;let h=p=>{if(p===o.length)g.end();else{let d=o[p]();d.pipe(g,{end:!1}),d.on("end",()=>{h(p+1)})}};h(0)}if(a.length>0){let g=new Vn.PassThrough;n=g;for(let h of a)g.pipe(h)}if(l.length>0){let g=new Vn.PassThrough;s=g;for(let h of l)g.pipe(h)}let u=await BB(DC(r.slice(c+1),e,t),{stdin:new bs(i),stdout:new bs(n),stderr:new bs(s)}).run();return await Promise.all(a.map(g=>new Promise((h,p)=>{g.on("error",d=>{p(d)}),g.on("close",()=>{h()}),g.end()}))),await Promise.all(l.map(g=>new Promise((h,p)=>{g.on("error",d=>{p(d)}),g.on("close",()=>{h()}),g.end()}))),u}]]);async function EDe(r,e,t){let i=[],n=new Vn.PassThrough;return n.on("data",s=>i.push(s)),await SB(r,e,bB(t,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function w9(r,e,t){let i=r.map(async s=>{let o=await Hc(s.args,e,t);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function QB(r){return r.match(/[^ \r\n\t]+/g)||[]}async function x9(r,e,t,i,n=i){switch(r.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(r.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=QB(s);for(let a=0;a<o.length-1;++a)n(o[a]);i(o[o.length-1])}break;case"*":{let s=e.args.join(" ");if(r.quoted)i(s);else for(let o of QB(s))n(o)}break;case"PPID":i(String(process.ppid));break;case"RANDOM":i(String(Math.floor(Math.random()*32768)));break;default:{let s=parseInt(r.name,10),o,a=Number.isFinite(s);if(a?s>=0&&s<e.args.length&&(o=e.args[s]):Object.prototype.hasOwnProperty.call(t.variables,r.name)?o=t.variables[r.name]:Object.prototype.hasOwnProperty.call(t.environment,r.name)&&(o=t.environment[r.name]),typeof o<"u"&&r.alternativeValue?o=(await Hc(r.alternativeValue,e,t)).join(" "):typeof o>"u"&&(r.defaultValue?o=(await Hc(r.defaultValue,e,t)).join(" "):r.alternativeValue&&(o="")),typeof o>"u")throw a?new zn(`Unbound argument #${s}`):new zn(`Unbound variable "${r.name}"`);if(r.quoted)i(o);else{let l=QB(o);for(let u=0;u<l.length-1;++u)n(l[u]);let c=l[l.length-1];typeof c<"u"&&i(c)}}break}}var IDe={addition:(r,e)=>r+e,subtraction:(r,e)=>r-e,multiplication:(r,e)=>r*e,division:(r,e)=>Math.trunc(r/e)};async function kC(r,e,t){if(r.type==="number"){if(Number.isInteger(r.value))return r.value;throw new Error(`Invalid number: "${r.value}", only integers are allowed`)}else if(r.type==="variable"){let i=[];await x9({...r,quoted:!0},e,t,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?kC({type:"variable",name:i.join(" ")},e,t):kC({type:"number",value:n},e,t)}else return IDe[r.type](await kC(r.left,e,t),await kC(r.right,e,t))}async function Hc(r,e,t){let i=new Map,n=[],s=[],o=u=>{s.push(u)},a=()=>{s.length>0&&n.push(s.join("")),s=[]},l=u=>{o(u),a()},c=(u,g,h)=>{let p=JSON.stringify({type:u,fd:g}),d=i.get(p);typeof d>"u"&&i.set(p,d=[]),d.push(h)};for(let u of r){let g=!1;switch(u.type){case"redirection":{let h=await Hc(u.args,e,t);for(let p of h)c(u.subtype,u.fd,p)}break;case"argument":for(let h of u.segments)switch(h.type){case"text":o(h.text);break;case"glob":o(h.pattern),g=!0;break;case"shell":{let p=await EDe(h.shell,e,t);if(h.quoted)o(p);else{let d=QB(p);for(let m=0;m<d.length-1;++m)l(d[m]);o(d[d.length-1])}}break;case"variable":await x9(h,e,t,o,l);break;case"arithmetic":o(String(await kC(h.arithmetic,e,t)));break}break}if(a(),g){let h=n.pop();if(typeof h>"u")throw new Error("Assertion failed: Expected a glob pattern to have been set");let p=await e.glob.match(h,{cwd:t.cwd,baseFs:e.baseFs});if(p.length===0){let d=TR(h)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please
2024-10-01 04:19:50 +02:00
`)).finally(()=>{t.stdout.isTTY&&t.stdout.write(`Job ${l}, '${o(Fg(r))}' has ended
`)})),0}return await Q9(r,e,t)}async function QDe(r,e,t,{background:i=!1}={}){let n,s=a=>{n=a,t.variables["?"]=String(a)},o=async a=>{try{return await BDe(a.chain,e,t,{background:i&&typeof a.then>"u"})}catch(l){if(!(l instanceof zn))throw l;return t.stderr.write(`${l.message}
`),1}};for(s(await o(r));r.then;){if(t.exitCode!==null)return t.exitCode;switch(r.then.type){case"&&":n===0&&s(await o(r.then.line));break;case"||":n!==0&&s(await o(r.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${r.then.type}"`)}r=r.then.line}return n}async function SB(r,e,t){let i=t.backgroundJobs;t.backgroundJobs=[];let n=0;for(let{command:s,type:o}of r){if(n=await QDe(s,e,t,{background:o==="&"}),t.exitCode!==null)return t.exitCode;t.variables["?"]=String(n)}return await Promise.all(t.backgroundJobs),t.backgroundJobs=i,n}function P9(r){switch(r.type){case"variable":return r.name==="@"||r.name==="#"||r.name==="*"||Number.isFinite(parseInt(r.name,10))||"defaultValue"in r&&!!r.defaultValue&&r.defaultValue.some(e=>RC(e))||"alternativeValue"in r&&!!r.alternativeValue&&r.alternativeValue.some(e=>RC(e));case"arithmetic":return KR(r.arithmetic);case"shell":return UR(r.shell);default:return!1}}function RC(r){switch(r.type){case"redirection":return r.args.some(e=>RC(e));case"argument":return r.segments.some(e=>P9(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${r.type}"`)}}function KR(r){switch(r.type){case"variable":return P9(r);case"number":return!1;default:return KR(r.left)||KR(r.right)}}function UR(r){return r.some(({command:e})=>{for(;e;){let t=e.chain;for(;t;){let i;switch(t.type){case"subshell":i=UR(t.subshell);break;case"command":i=t.envs.some(n=>n.args.some(s=>RC(s)))||t.args.some(n=>RC(n));break}if(i)return!0;if(!t.then)break;t=t.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function vB(r,e=[],{baseFs:t=new Zt,builtins:i={},cwd:n=K.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=wB}={}){let g={};for(let[d,m]of Object.entries(s))typeof m<"u"&&(g[d]=m);let h=new Map(mDe);for(let[d,m]of Object.entries(i))h.set(d,m);o===null&&(o=new Vn.PassThrough,o.end());let p=cI(r,u);if(!UR(p)&&p.length>0&&e.length>0){let{command:d}=p[p.length-1];for(;d.then;)d=d.then.line;let m=d.chain;for(;m.then;)m=m.then.chain;m.type==="command"&&(m.args=m.args.concat(e.map(y=>({type:"argument",segments:[{type:"text",text:y}]}))))}return await SB(p,{args:e,baseFs:t,builtins:h,initialStdin:o,initialStdout:a,initialStderr:l,glob:u},{cwd:n,environment:g,exitCode:null,procedures:{},stdin:o,stdout:a,stderr:l,variables:Object.assign({},c,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var pV=ve(xB()),dV=ve(Jg()),el=J("stream");var fV=ve(lV()),RB=ve(cc());var cV=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],uV=80,wRe=new Set([13,19]),BRe=5,DB=RB.default.GITHUB_ACTIONS?{start:r=>`::group::${r}
`,end:r=>`::endgroup::
`}:RB.default.TRAVIS?{start:r=>`travis_fold:start:${r}
`,end:r=>`travis_fold:end:${r}
`}:RB.default.GITLAB?{start:r=>`section_start:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${r}
`,end:r=>`section_end:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,gV=new Date,QRe=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,bRe=r=>r,FB=bRe({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),SRe=QRe&&Object.keys(FB).find(r=>{let e=FB[r];return!(e.date&&(e.date[0]!==gV.getDate()||e.date[1]!==gV.getMonth()+1))})||"default";function hV(r,{configuration:e,json:t}){if(!e.get("enableMessageNames"))return"";let n=RA(r===null?0:r);return!t&&r===null?_e(e,n,"grey"):n}function qR(r,{configuration:e,json:t}){let i=hV(r,{configuration:e,json:t});if(!i||r===null||r===0)return i;let n=dt[r],s=`https://yarnpkg.com/advanced/error-codes#${i}---${n}`.toLowerCase();return If(e,i,s)}var He=class extends xi{constructor({configuration:t,stdout:i,json:n=!1,includePrefix:s=!0,includeFooter:o=!0,includeLogs:a=!n,includeInfos:l=a,includeWarnings:c=a,forgettableBufferSize:u=BRe,forgettableNames:g=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errors=[];this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;this.forgettableLines=[];if(Zd(this,{configuration:t}),this.configuration=t,this.forgettableBufferSize=u,this.forgettableNames=new Set([...g,...wRe]),this.includePrefix=s,this.includeFooter=o,this.includeInfos=l,this.includeWarnings=c,this.json=n,this.stdout=i,t.get("enableProgressBars")&&!n&&i.isTTY&&i.columns>22){let h=t.get("progressBarStyle")||SRe;if(!Object.prototype.hasOwnProperty.call(FB,h))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=FB[h];let p=12,d=Math.max(0,Math.min(i.columns-p,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*d/80)}}static async start(t,i){let n=new this(t),s=process.emitWarning;process.emitWarning=(o,a)=>{if(typeof o!="string"){let c=o;o=c.message,a=a!=null?a:c.name}let l=typeof a<"u"?`${a}: ${o}`:o;n.reportWarning(0,l)};try{await i(n)}catch(o){n.reportExceptionOnce(o)}finally{await n.finalize(),process.emitWarning=s}return n}hasErrors(){return this.errors.length>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(t){this.cacheHitCount+=1}reportCacheMiss(t,i){this.lastCacheMiss=t,this.cacheMissCount+=1,typeof i<"u"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(13,i)}startSectionSync({reportHeader:t,reportFooter:i,skipIfEmpty:n},s){let o={committed:!1,action:()=>{t==null||t()}};n?this.uncommitted.add(o):(o.action(),o.committed=!0);let a=Date.now();try{return s()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(o),o.committed&&(i==null||i(l-a))}}async startSectionPromise({reportHeader:t,reportFooter:i,skipIfEmpty:n},s){let o={committed:!1,action:()=>{t==null||t()}};n?this.uncommitted.add(o):(o.action(),o.committed=!0);let a=Date.now();try{return await s()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(o),o.committed&&(i==null||i(l-a))}}startTimerImpl(t,i,n){return{cb:typeof i=="function"?i:n,reportHeader:()=>{this.reportInfo(null,`\u250C ${t}`),this.indent+=1,DB!==null&&!this.json&&this.includeInfos&&this.stdout.write(DB.start(t))},reportFooter:a=>{if(this.indent-=1,DB!==null&&!this.json&&this.includeInfos){this.stdout.write(DB.end(t));for(let[l,c]of this.errors)this.reportErrorImpl(l,c)}this.configuration.get("enableTimers")&&a>200?this.reportInfo(null,`\u2514 Completed in ${_e(this.configuration,a,Ke.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:(typeof i=="function"?{}:i).skipIfEmpty}}startTimerSync(t,i,n){let{cb:s,...o}=this.startTimerImpl(t,i,n);return this.start
`),this.writeProgress()}writeLineWithForgettableReset(t,{truncate:i}={}){this.forgettableLines=[],this.writeLine(t,{truncate:i})}writeLines(t,{truncate:i}={}){this.clearProgress({delta:t.length});for(let n of t)this.stdout.write(`${this.truncate(n,{truncate:i})}
`);this.writeProgress()}reportCacheChanges({cacheHitCount:t,cacheMissCount:i}){let n=this.cacheHitCount-t,s=this.cacheMissCount-i;if(n===0&&s===0)return;let o="";this.cacheHitCount>1?o+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?o+=" - one package was already cached":o+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?o+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(o+=`, one had to be fetched (${Ct(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?o+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(o+=` - one package had to be fetched (${Ct(this.configuration,this.lastCacheMiss)})`),this.reportInfo(13,o)}commit(){let t=this.uncommitted;this.uncommitted=new Set;for(let i of t)i.committed=!0,i.action()}clearProgress({delta:t=0,clear:i=!1}){this.progressStyle!==null&&this.progress.size+t>0&&(this.stdout.write(`\x1B[${this.progress.size+t}A`),(t>0||i)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let t=Date.now();t-this.progressTime>uV&&(this.progressFrame=(this.progressFrame+1)%cV.length,this.progressTime=t);let i=cV[this.progressFrame];for(let n of this.progress.values()){let s="";if(typeof n.lastScaledSize<"u"){let c=this.progressStyle.chars[0].repeat(n.lastScaledSize),u=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-n.lastScaledSize);s=` ${c}${u}`}let o=this.formatName(null),a=o?`${o}: `:"",l=n.definition.title?` ${n.definition.title}`:"";this.stdout.write(`${_e(this.configuration,"\u27A4","blueBright")} ${a}${i}${s}${l}
2024-10-01 04:49:34 +02:00
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},uV)}refreshProgress({delta:t=0,force:i=!1}={}){let n=!1,s=!1;if(i||this.progress.size===0)n=!0;else for(let o of this.progress.values()){let a=typeof o.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*o.definition.progress):void 0,l=o.lastScaledSize;o.lastScaledSize=a;let c=o.lastTitle;if(o.lastTitle=o.definition.title,a!==l||(s=c!==o.definition.title)){n=!0;break}}n&&(this.clearProgress({delta:t,clear:s}),this.writeProgress())}truncate(t,{truncate:i}={}){return this.progressStyle===null&&(i=!1),typeof i>"u"&&(i=this.configuration.get("preferTruncatedLines")),i&&(t=(0,fV.default)(t,0,this.stdout.columns-1)),t}formatName(t){return hV(t,{configuration:this.configuration,json:this.json})}formatPrefix(t,i){return this.includePrefix?`${_e(this.configuration,"\u27A4",i)} ${t}${this.formatIndent()}`:""}formatNameWithHyperlink(t){return qR(t,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Nr="3.8.3";var CV=(n=>(n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm",n))(CV||{});async function $A(r,e,t,i=[]){if(process.platform==="win32"){let n=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${t}" ${i.map(s=>`"${s.replace('"','""')}"`).join(" ")} %*`;await M.writeFilePromise(v.format({dir:r,name:e,ext:".cmd"}),n)}await M.writeFilePromise(v.join(r,e),`#!/bin/sh
2024-10-01 04:19:50 +02:00
exec "${t}" ${i.map(n=>`'${n.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
2024-10-01 04:49:34 +02:00
`,{mode:493})}async function mV(r){let e=await ot.tryFind(r);if(e!=null&&e.packageManager){let i=Sw(e.packageManager);if(i!=null&&i.name){let n=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManagerField:!0,packageManager:Number(s)===1?"Yarn Classic":"Yarn",reason:n};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:n};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:n}}}}let t;try{t=await M.readFilePromise(v.join(r,St.lockfile),"utf8")}catch{}return t!==void 0?t.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:M.existsSync(v.join(r,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:M.existsSync(v.join(r,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function NC({project:r,locator:e,binFolder:t,ignoreCorepack:i,lifecycleScript:n}){var c,u;let s={};for(let[g,h]of Object.entries(process.env))typeof h<"u"&&(s[g.toLowerCase()!=="path"?g:"PATH"]=h);let o=K.fromPortablePath(t);s.BERRY_BIN_FOLDER=K.fromPortablePath(o);let a=process.env.COREPACK_ROOT&&!i?K.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([$A(t,"node",process.execPath),...Nr!==null?[$A(t,"run",process.execPath,[a,"run"]),$A(t,"yarn",process.execPath,[a]),$A(t,"yarnpkg",process.execPath,[a]),$A(t,"node-gyp",process.execPath,[a,"run","--top-level","node-gyp"])]:[]]),r&&(s.INIT_CWD=K.fromPortablePath(r.configuration.startingCwd),s.PROJECT_CWD=K.fromPortablePath(r.cwd)),s.PATH=s.PATH?`${o}${K.delimiter}${s.PATH}`:`${o}`,s.npm_execpath=`${o}${K.sep}yarn`,s.npm_node_execpath=`${o}${K.sep}node`,e){if(!r)throw new Error("Assertion failed: Missing project");let g=r.tryWorkspaceByLocator(e),h=g?(c=g.manifest.version)!=null?c:"":(u=r.storedPackages.get(e.locatorHash).version)!=null?u:"";s.npm_package_name=Tt(e),s.npm_package_version=h;let p;if(g)p=g.cwd;else{let d=r.storedPackages.get(e.locatorHash);if(!d)throw new Error(`Package for ${Ct(r.configuration,e)} not found in the project`);let m=r.configuration.getLinkers(),y={project:r,report:new He({stdout:new el.PassThrough,configuration:r.configuration})},B=m.find(S=>S.supportsPackage(d,y));if(!B)throw new Error(`The package ${Ct(r.configuration,d)} isn't supported by any of the available linkers`);p=await B.findPackageLocation(d,y)}s.npm_package_json=K.fromPortablePath(v.join(p,St.manifest))}let l=Nr!==null?`yarn/${Nr}`:`yarn/${mf("@yarnpkg/core").version}-core`;return s.npm_config_user_agent=`${l} npm/? node/${process.version} ${process.platform} ${process.arch}`,n&&(s.npm_lifecycle_event=n),r&&await r.configuration.triggerHook(g=>g.setupScriptEnvironment,r,s,async(g,h,p)=>await $A(t,Yr(g),h,p)),s}var vRe=2,xRe=(0,dV.default)(vRe);async function PRe(r,e,{configuration:t,report:i,workspace:n=null,locator:s=null}){await xRe(async()=>{await M.mktempPromise(async o=>{let a=v.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=t.getSubprocessStreams(a,{prefix:K.fromPortablePath(r),report:i}),g=s&&Yo(s)?sC(s):s,h=g?ms(g):"an external project";c.write(`Packing ${h} from sources
2024-10-01 04:19:50 +02:00
`);let p=await mV(r),d;p!==null?(c.write(`Using ${p.packageManager} for bootstrap. Reason: ${p.reason}
`),d=p.packageManager):(c.write(`No package manager configuration detected; defaulting to Yarn
2024-10-01 04:49:34 +02:00
`),d="Yarn");let m=d==="Yarn"&&!(p!=null&&p.packageManagerField);await M.mktempPromise(async y=>{let B=await NC({binFolder:y,ignoreCorepack:m}),P=new Map([["Yarn Classic",async()=>{let H=n!==null?["workspace",n]:[],q=v.join(r,St.manifest),_=await M.readFilePromise(q),X=await so(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed"],{cwd:r,env:B,stdin:l,stdout:c,stderr:u,end:1});if(X.code!==0)return X.code;await M.writeFilePromise(q,_),await M.appendFilePromise(v.join(r,".npmignore"),`/.yarn
2024-10-01 04:19:50 +02:00
`),c.write(`
`),delete B.NODE_ENV;let W=await so("yarn",["install"],{cwd:r,env:B,stdin:l,stdout:c,stderr:u,end:1});if(W.code!==0)return W.code;c.write(`
2024-10-01 04:49:34 +02:00
`);let Z=await so("yarn",[...H,"pack","--filename",K.fromPortablePath(e)],{cwd:r,env:B,stdin:l,stdout:c,stderr:u});return Z.code!==0?Z.code:0}],["Yarn",async()=>{let H=n!==null?["workspace",n]:[];B.YARN_ENABLE_INLINE_BUILDS="1";let q=v.join(r,St.lockfile);await M.existsPromise(q)||await M.writeFilePromise(q,"");let _=await so("yarn",[...H,"pack","--install-if-needed","--filename",K.fromPortablePath(e)],{cwd:r,env:B,stdin:l,stdout:c,stderr:u});return _.code!==0?_.code:0}],["npm",async()=>{if(n!==null){let ne=new el.PassThrough,ue=Cf(ne);ne.pipe(c,{end:!1});let te=await so("npm",["--version"],{cwd:r,env:B,stdin:l,stdout:ne,stderr:u,end:0});if(ne.end(),te.code!==0)return c.end(),u.end(),te.code;let O=(await ue).toString().trim();if(!Fc(O,">=7.x")){let N=qo(null,"npm"),ce=zt(N,O),he=zt(N,">=7.x");throw new Error(`Workspaces aren't supported by ${$t(t,ce)}; please upgrade to ${$t(t,he)} (npm has been detected as the primary package manager for ${_e(t,r,Ke.PATH)})`)}}let H=n!==null?["--workspace",n]:[];delete B.npm_config_user_agent,delete B.npm_config_production,delete B.NPM_CONFIG_PRODUCTION,delete B.NODE_ENV;let q=await so("npm",["install"],{cwd:r,env:B,stdin:l,stdout:c,stderr:u,end:1});if(q.code!==0)return q.code;let _=new el.PassThrough,X=Cf(_);_.pipe(c);let W=await so("npm",["pack","--silent",...H],{cwd:r,env:B,stdin:l,stdout:_,stderr:u});if(W.code!==0)return W.code;let Z=(await X).toString().trim().replace(/^.*\n/s,""),A=v.resolve(r,K.toPortablePath(Z));return await M.renamePromise(A,e),0}]]).get(d);if(typeof P>"u")throw new Error("Assertion failed: Unsupported workflow");let F=await P();if(!(F===0||typeof F>"u"))throw M.detachTemp(o),new rt(58,`Packing the package failed (exit code ${F}, logs can be found here: ${_e(t,a,Ke.PATH)})`)})})})}async function kRe(r,e,{project:t}){let i=t.tryWorkspaceByLocator(r);if(i!==null)return WR(i,e);let n=t.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${Ct(t.configuration,r)} not found in the project`);return await Kn.openPromise(async s=>{let o=t.configuration,a=t.configuration.getLinkers(),l={project:t,report:new He({stdout:new el.PassThrough,configuration:o})},c=a.find(p=>p.supportsPackage(n,l));if(!c)throw new Error(`The package ${Ct(t.configuration,n)} isn't supported by any of the available linkers`);let u=await c.findPackageLocation(n,l),g=new jt(u,{baseFs:s});return(await ot.find(Te.dot,{baseFs:g})).scripts.has(e)},{libzip:await an()})}async function NB(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await M.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await EV(r,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),h=c.scripts.get(e);if(typeof h>"u")return 1;let p=async()=>await vB(h,t,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,p,n,r,e,{script:h,args:t,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function JR(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await M.mktempPromise(async l=>{let{env:c,cwd:u}=await EV(r,{project:n,binFolder:l,cwd:i});return await vB(e,t,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function DRe(r,{binFolder:e,cwd:t,lifecycleScript:i}){let n=await NC({project:r.project,locator:r.anchoredLocator,binFolder:e,lifecycleScript:i});return await VR(e,await wV(r)),typeof t>"u"&&(t=v.dirname(await M.realpathPromise(v.join(r.cwd,"package.json")))),{manifest:r.manifest,binFolder:e,env:n,cwd:t}}async function EV(r,{project:e,binFolder:t,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(r);if(s!==null)return DRe(s,{binFolder:t,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(r.locatorHash);if(!o)throw new Error(`Package for ${Ct(e.configuration,r)} not found in the project`);return await Kn.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new He({stdout:new el.PassThrough,configuration:l})},g=c.find(y=>y.supportsPackage(o,u));if(!g)throw new Error(`The package ${Ct(e.configuration,o)} isn't supported by any of the available linkers`);let h=await NC({project:e,locator:r,binFolder:t,life
`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:Ct(n,r.anchoredLocator),header:l});i.reportInfo(36,`Calling the "${e}" lifecycle script`);let g=await IV(r,e,[],{cwd:t,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw M.detachTemp(o),new rt(36,`${(0,pV.default)(e)} script failed (exit code ${_e(n,g,Ke.NUMBER)}, logs can be found here: ${_e(n,a,Ke.PATH)}); run ${_e(n,`yarn ${e}`,Ke.CODE)} to investigate`)})}async function RRe(r,e,t){WR(r,e)&&await yV(r,e,t)}function zR(r){let e=v.extname(r);if(e.match(/\.[cm]?[jt]sx?$/))return!0;if(e===".exe"||e===".bin")return!1;let t=Buffer.alloc(4),i;try{i=M.openSync(r,"r")}catch{return!0}try{M.readSync(i,t,0,t.length,0)}finally{M.closeSync(i)}let n=t.readUint32BE();return!(n===3405691582||n===3489328638||n===2135247942||(n&4294901760)===1297743872)}async function TB(r,{project:e}){let t=e.configuration,i=new Map,n=e.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${Ct(t,r)} not found in the project`);let s=new el.Writable,o=t.getLinkers(),a={project:e,report:new He({configuration:t,stdout:s})},l=new Set([r.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertion failed: The resolution (${$t(t,u)}) should have been registered`);l.add(g)}let c=await Promise.all(Array.from(l,async u=>{let g=e.storedPackages.get(u);if(!g)throw new Error(`Assertion failed: The package (${u}) should have been registered`);if(g.bin.size===0)return Uo.skip;let h=o.find(d=>d.supportsPackage(g,a));if(!h)return Uo.skip;let p=null;try{p=await h.findPackageLocation(g,a)}catch(d){if(d.code==="LOCATOR_NOT_INSTALLED")return Uo.skip;throw d}return{dependency:g,packageLocation:p}}));for(let u of c){if(u===Uo.skip)continue;let{dependency:g,packageLocation:h}=u;for(let[p,d]of g.bin){let m=v.resolve(h,d);i.set(p,[g,K.fromPortablePath(m),zR(m)])}}return i}async function wV(r){return await TB(r.anchoredLocator,{project:r.project})}async function VR(r,e){await Promise.all(Array.from(e,([t,[,i,n]])=>n?$A(r,Yr(t),process.execPath,[i]):$A(r,Yr(t),i,[])))}async function BV(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await TB(r,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binary not found (${e}) for ${Ct(n.configuration,r)}`);return await M.mktempPromise(async g=>{let[,h]=u,p=await NC({project:n,locator:r,binFolder:g});await VR(p.BERRY_BIN_FOLDER,c);let d=zR(K.toPortablePath(h))?so(process.execPath,[...l,h,...t],{cwd:i,env:p,stdin:s,stdout:o,stderr:a}):so(h,t,{cwd:i,env:p,stdin:s,stdout:o,stderr:a}),m;try{m=await d}finally{await M.removePromise(p.BERRY_BIN_FOLDER)}return m.code})}async function FRe(r,e,t,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await BV(r.anchoredLocator,e,t,{project:r.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var Ci={};ct(Ci,{convertToZip:()=>oTe,extractArchiveTo:()=>ATe,makeArchiveFromDirectory:()=>sTe});var fZ=J("stream"),hZ=ve(aZ());var AZ=ve(Jg()),lZ=J("worker_threads");var fl=Symbol("kTaskInfo"),T0=class{constructor(e){this.source=e;this.workers=[];this.limit=(0,AZ.default)(eD());this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let t=this.workers.pop();t?t.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new lZ.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return e.on("message",t=>{if(!e[fl])throw new Error("Assertion failed: Worker sent a result without having a task assigned");e[fl].resolve(t),e[fl]=null,e.unref(),this.workers.push(e)}),e.on("error",t=>{var i;(i=e[fl])==null||i.reject(t),e[fl]=null}),e.on("exit",t=>{var i;t!==0&&((i=e[fl])==null||i.reject(new Error(`Worker exited with code ${t}`))),e[fl]=null}),e}run(e){return this.limit(()=>{var i;let t=(i=this.workers.pop())!=null?i:this.createWorker();return t.ref(),new Promise((n,s)=>{t[fl]={resolve:n,reject:s},t.postMessage(e)})})}};var pZ=ve(uZ());
2024-10-01 04:19:50 +02:00
`);return}let s=(0,mZ.asTree)(EZ(r,{configuration:e}),!1,!1);if(n>=1&&(s=s.replace(/^([├└]─)/gm,`\u2502
$1`).replace(/^│\n/,"")),n>=2)for(let a=0;a<2;++a)s=s.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
2024-10-01 04:49:34 +02:00
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");t.write(s)}var wZ=J("crypto"),DN=ve(J("fs"));var cTe=8,Dt=class{constructor(e,{configuration:t,immutable:i=t.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,wZ.randomBytes)(8).toString("hex")}.tmp`;this.configuration=t,this.cwd=e,this.immutable=i,this.check=n;let s=t.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=t.get("compressionLevel"),a=o!==_l?`c${o}`:"";this.cacheKey=[cTe,a].join("")}}static async find(e,{immutable:t,check:i}={}){let n=new Dt(e.get("cacheFolder"),{configuration:e,immutable:t,check:i});return await n.setup(),n}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${xf(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,t){let n=uTe(t).slice(0,10);return`${xf(e)}-${n}.zip`}getLocatorPath(e,t,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?v.resolve(this.cwd,this.getVersionFilename(e)):t===null||kN(t)!==this.cacheKey?null:v.resolve(this.cwd,this.getChecksumFilename(e,t))}getLocatorMirrorPath(e){let t=this.mirrorCwd;return t!==null?v.resolve(t,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await M.existsPromise(this.cwd))throw new rt(56,"Cache path does not exist.")}else{await M.mkdirPromise(this.cwd,{recursive:!0});let e=v.resolve(this.cwd,".gitignore");await M.changeFilePromise(e,`/.gitignore
2024-10-01 04:19:50 +02:00
*.flock
*.tmp
2024-10-01 04:49:34 +02:00
`)}(this.mirrorCwd||!this.immutable)&&await M.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,t,{onHit:i,onMiss:n,loader:s,...o}){var W;let a=this.getLocatorMirrorPath(e),l=new Zt,c=()=>{let Z=new qr(null,{libzip:P}),A=v.join(Te.root,qk(e));return Z.mkdirSync(A,{recursive:!0}),Z.writeJsonSync(v.join(A,St.manifest),{name:Tt(e),mocked:!0}),Z},u=async(Z,A=null)=>{var ue;if(A===null&&((ue=o.unstablePackages)==null?void 0:ue.has(e.locatorHash)))return{isValid:!0,hash:null};let ne=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await Bw(Z)}`:t;if(A!==null){let te=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await Bw(A)}`:t;if(ne!==te)throw new rt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(t!==null&&ne!==t){let te;switch(this.check?te="throw":kN(t)!==kN(ne)?te="update":te=this.configuration.get("checksumBehavior"),te){case"ignore":return{isValid:!0,hash:t};case"update":return{isValid:!0,hash:ne};case"reset":return{isValid:!1,hash:t};default:case"throw":throw new rt(18,"The remote archive doesn't match the expected checksum")}}return{isValid:!0,hash:ne}},g=async Z=>{if(!s)throw new Error(`Cache check required but no loader configured for ${Ct(this.configuration,e)}`);let A=await s(),ne=A.getRealPath();A.saveAndClose(),await M.chmodPromise(ne,420);let ue=await u(Z,ne);if(!ue.isValid)throw new Error("Assertion failed: Expected a valid checksum");return ue.hash},h=async()=>{if(a===null||!await M.existsPromise(a)){let Z=await s(),A=Z.getRealPath();return Z.saveAndClose(),{source:"loader",path:A}}return{source:"mirror",path:a}},p=async()=>{if(!s)throw new Error(`Cache entry required but missing for ${Ct(this.configuration,e)}`);if(this.immutable)throw new rt(56,`Cache entry required but missing for ${Ct(this.configuration,e)}`);let{path:Z,source:A}=await h(),ne=(await u(Z)).hash,ue=this.getLocatorPath(e,ne,o);if(!ue)throw new Error("Assertion failed: Expected the cache path to be available");let te=[];A!=="mirror"&&a!==null&&te.push(async()=>{let N=`${a}${this.cacheId}`;await M.copyFilePromise(Z,N,DN.default.constants.COPYFILE_FICLONE),await M.chmodPromise(N,420),await M.renamePromise(N,a)}),(!o.mirrorWriteOnly||a===null)&&te.push(async()=>{let N=`${ue}${this.cacheId}`;await M.copyFilePromise(Z,N,DN.default.constants.COPYFILE_FICLONE),await M.chmodPromise(N,420),await M.renamePromise(N,ue)});let O=o.mirrorWriteOnly&&a!=null?a:ue;return await Promise.all(te.map(N=>N())),[!1,O,ne]},d=async()=>{let A=(async()=>{var ce;let ne=this.getLocatorPath(e,t,o),ue=ne!==null?this.markedFiles.has(ne)||await l.existsPromise(ne):!1,te=!!((ce=o.mockedPackages)!=null&&ce.has(e.locatorHash))&&(!this.check||!ue),O=te||ue,N=O?i:n;if(N&&N(),O){let he=null,Pe=ne;if(!te)if(this.check)he=await g(Pe);else{let De=await u(Pe);if(De.isValid)he=De.hash;else return p()}return[te,Pe,he]}else return p()})();this.mutexes.set(e.locatorHash,A);try{return await A}finally{this.mutexes.delete(e.locatorHash)}};for(let Z;Z=this.mutexes.get(e.locatorHash);)await Z;let[m,y,B]=await d();m||this.markedFiles.add(y);let S,P=await an(),F=m?()=>c():()=>new qr(y,{baseFs:l,libzip:P,readOnly:!0}),H=new Sg(()=>Jx(()=>S=F(),Z=>`Failed to open the cache entry for ${Ct(this.configuration,e)}: ${Z}`),v),q=new bo(y,{baseFs:H,pathUtils:v}),_=()=>{S==null||S.discardAndClose()},X=(W=o.unstablePackages)!=null&&W.has(e.locatorHash)?null:B;return[q,_,X]}};function kN(r){let e=r.indexOf("/");return e!==-1?r.slice(0,e):null}function uTe(r){let e=r.indexOf("/");return e!==-1?r.slice(e+1):r}var L0=(t=>(t[t.SCRIPT=0]="SCRIPT",t[t.SHELLCODE=1]="SHELLCODE",t))(L0||{});var ta=class extends xi{constructor({configuration:t,stdout:i,suggestInstall:n=!0}){super();this.errorCount=0;Zd(this,{configuration:t}),this.configuration=t,this.stdout=i,this.suggestInstall=n}static async start(t,i){let n=new this(t);try{await i(n)}catch(s){n.reportExceptionOnce(s)}finally{await n.finalize()}return n}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(t){}reportCacheMiss(t){}startSectionSync(t
2024-10-01 04:19:50 +02:00
`)}reportProgress(t){return{...Promise.resolve().then(async()=>{for await(let{}of t);}),stop:()=>{}}}reportJson(t){}async finalize(){this.errorCount>0&&(this.stdout.write(`
`),this.stdout.write(`${_e(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
`),this.suggestInstall&&this.stdout.write(`${_e(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
2024-10-01 04:49:34 +02:00
`))}formatNameWithHyperlink(t){return qR(t,{configuration:this.configuration,json:!1})}};var V0=J("crypto");function iA(){}iA.prototype={diff:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.callback;typeof i=="function"&&(n=i,i={}),this.options=i;var s=this;function o(m){return n?(setTimeout(function(){n(void 0,m)},0),!0):m}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var a=t.length,l=e.length,c=1,u=a+l;i.maxEditLength&&(u=Math.min(u,i.maxEditLength));var g=[{newPos:-1,components:[]}],h=this.extractCommon(g[0],t,e,0);if(g[0].newPos+1>=a&&h+1>=l)return o([{value:this.join(t),count:t.length}]);function p(){for(var m=-1*c;m<=c;m+=2){var y=void 0,B=g[m-1],S=g[m+1],P=(S?S.newPos:0)-m;B&&(g[m-1]=void 0);var F=B&&B.newPos+1<a,H=S&&0<=P&&P<l;if(!F&&!H){g[m]=void 0;continue}if(!F||H&&B.newPos<S.newPos?(y=fTe(S),s.pushComponent(y.components,void 0,!0)):(y=B,y.newPos++,s.pushComponent(y.components,!0,void 0)),P=s.extractCommon(y,t,e,m),y.newPos+1>=a&&P+1>=l)return o(gTe(s,y.components,t,e,s.useLongestToken));g[m]=y}c++}if(n)(function m(){setTimeout(function(){if(c>u)return n();p()||m()},0)})();else for(;c<=u;){var d=p();if(d)return d}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var s=t.length,o=i.length,a=e.newPos,l=a-n,c=0;a+1<s&&l+1<o&&this.equals(t[a+1],i[l+1]);)a++,l++,c++;return c&&e.components.push({count:c}),e.newPos=a,l},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function gTe(r,e,t,i,n){for(var s=0,o=e.length,a=0,l=0;s<o;s++){var c=e[s];if(c.removed){if(c.value=r.join(i.slice(l,l+c.count)),l+=c.count,s&&e[s-1].added){var g=e[s-1];e[s-1]=e[s],e[s]=g}}else{if(!c.added&&n){var u=t.slice(a,a+c.count);u=u.map(function(p,d){var m=i[l+d];return m.length>p.length?m:p}),c.value=r.join(u)}else c.value=r.join(t.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var h=e[o-1];return o>1&&typeof h.value=="string"&&(h.added||h.removed)&&r.equals("",h.value)&&(e[o-2].value+=h.value,e.pop()),e}function fTe(r){return{newPos:r.newPos,components:r.components.slice(0)}}var Xat=new iA;var BZ=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,QZ=/\S/,bZ=new iA;bZ.equals=function(r,e){return this.options.ignoreCase&&(r=r.toLowerCase(),e=e.toLowerCase()),r===e||this.options.ignoreWhitespace&&!QZ.test(r)&&!QZ.test(e)};bZ.tokenize=function(r){for(var e=r.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<e.length-1;t++)!e[t+1]&&e[t+2]&&BZ.test(e[t])&&BZ.test(e[t+2])&&(e[t]+=e[t+2],e.splice(t+1,2),t--);return e};var LN=new iA;LN.tokenize=function(r){var e=[],t=r.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var i=0;i<t.length;i++){var n=t[i];i%2&&!this.options.newlineIsToken?e[e.length-1]+=n:(this.options.ignoreWhitespace&&(n=n.trim()),e.push(n))}return e};function hTe(r,e,t){return LN.diff(r,e,t)}var pTe=new iA;pTe.tokenize=function(r){return r.split(/(\S.+?[.!?])(?=\s+|$)/)};var dTe=new iA;dTe.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)};function O0(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O0=function(e){return typeof e}:O0=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O0(r)}function RN(r){return CTe(r)||mTe(r)||ETe(r)||ITe()}function CTe(r){if(Array.isArray(r))return FN(r)}function mTe(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function ETe(r,e){if(!!r){if(typeof r=="string")return FN(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Argum
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var yTe=Object.prototype.toString,_C=new iA;_C.useLongestToken=!0;_C.tokenize=LN.tokenize;_C.castInput=function(r){var e=this.options,t=e.undefinedReplacement,i=e.stringifyReplacer,n=i===void 0?function(s,o){return typeof o>"u"?t:o}:i;return typeof r=="string"?r:JSON.stringify(NN(r,null,null,n),n," ")};_C.equals=function(r,e){return iA.prototype.equals.call(_C,r.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function NN(r,e,t,i,n){e=e||[],t=t||[],i&&(r=i(n,r));var s;for(s=0;s<e.length;s+=1)if(e[s]===r)return t[s];var o;if(yTe.call(r)==="[object Array]"){for(e.push(r),o=new Array(r.length),t.push(o),s=0;s<r.length;s+=1)o[s]=NN(r[s],e,t,i,n);return e.pop(),t.pop(),o}if(r&&r.toJSON&&(r=r.toJSON()),O0(r)==="object"&&r!==null){e.push(r),o={},t.push(o);var a=[],l;for(l in r)r.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=NN(r[l],e,t,i,l);e.pop(),t.pop()}else o=r;return o}var TN=new iA;TN.tokenize=function(r){return r.slice()};TN.join=TN.removeEmpty=function(r){return r};function SZ(r,e,t,i,n,s,o){o||(o={}),typeof o.context>"u"&&(o.context=4);var a=hTe(t,i,o);if(!a)return;a.push({value:"",lines:[]});function l(B){return B.map(function(S){return" "+S})}for(var c=[],u=0,g=0,h=[],p=1,d=1,m=function(S){var P=a[S],F=P.lines||P.value.replace(/\n$/,"").split(`
`);if(P.lines=F,P.added||P.removed){var H;if(!u){var q=a[S-1];u=p,g=d,q&&(h=o.context>0?l(q.lines.slice(-o.context)):[],u-=h.length,g-=h.length)}(H=h).push.apply(H,RN(F.map(function(te){return(P.added?"+":"-")+te}))),P.added?d+=F.length:p+=F.length}else{if(u)if(F.length<=o.context*2&&S<a.length-2){var _;(_=h).push.apply(_,RN(l(F)))}else{var X,W=Math.min(F.length,o.context);(X=h).push.apply(X,RN(l(F.slice(0,W))));var Z={oldStart:u,oldLines:p-u+W,newStart:g,newLines:d-g+W,lines:h};if(S>=a.length-2&&F.length<=o.context){var A=/\n$/.test(t),ne=/\n$/.test(i),ue=F.length==0&&h.length>Z.oldLines;!A&&ue&&t.length>0&&h.splice(Z.oldLines,0,"\\ No newline at end of file"),(!A&&!ue||!ne)&&h.push("\\ No newline at end of file")}c.push(Z),u=0,g=0,h=[]}p+=F.length,d+=F.length}},y=0;y<a.length;y++)m(y);return{oldFileName:r,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}var X0=ve(R$()),Z0=ve(Jg()),O$=ve(zr()),zN=J("util"),WN=ve(J("v8")),VN=ve(J("zlib"));var VMe=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(r,e,t,i)=>`${t}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,r=>`npm:${r}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(r,e)=>vw({protocol:"npm:",source:null,selector:r,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,r=>`npm:${r}`]],J0=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:t}){let i=v.join(e.cwd,e.configuration.get("lockfileFilename"));if(!M.existsSync(i))return;let n=await M.readFilePromise(i,"utf8"),s=wi(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=AC(a);if(!l){t.reportWarning(14,`Failed to parse the string "${a}" into a proper descriptor`);continue}let c=no(l.range)?zt(l,`npm:${l.range}`):l,{version:u,resolved:g}=s[a];if(!g)continue;let h;for(let[d,m]of VMe){let y=g.match(d);if(y){h=m(u,...y);break}}if(!h){t.reportWarning(14,`${$t(e.configuration,c)}: Only some patterns can be imported from legacy lockfiles (not "${g}")`);continue}let p=c;try{let d=vf(c.range),m=AC(d.selector,!0);m&&(p=m)}catch{}o.set(c.descriptorHash,nn(p,h))}}supportsDescriptor(e,t){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){if(!this.resolutions)throw new Error("Assertion failed: The resolution store should have been setup");let n=this.resolutions.get(e.descriptorHash);if(!n)throw new Error("Assertion failed: The resolution should have been registered");return await this.resolver.getCandidates(Hk(n),t,i)}async getSatisfying(e,t,i){return null}async resolve(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var W0=class{constructor(e){this.resolver=e}supportsDescriptor(e,t){return!!(t.project.storedResolutions.get(e.descriptorHash)||t.project.originalPackages.has(bw(e).locatorHash))}supportsLocator(e,t){return!!(t.project.originalPackages.has(e.locatorHash)&&!t.project.lockfileNeedsRefresh)}shouldPersistResolution(e,t){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return this.resolver.getResolutionDependencies(e,t)}async getCandidates(e,t,i){l
`;await M.changeFilePromise(t,i,{automaticNewlines:!0}),this.manifest.raw=e}};var N$=6,XMe=1,ZMe=/ *, */g,T$=/\/$/,_Me=32,$Me=(0,zN.promisify)(VN.default.gzip),e1e=(0,zN.promisify)(VN.default.gunzip),ts=(t=>(t.UpdateLockfile="update-lockfile",t.SkipBuild="skip-build",t))(ts||{}),JN={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},L$=r=>rn(`${XMe}`,r),Ge=class{constructor(e,{configuration:t}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.installersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=t,this.cwd=e}static async find(e,t){var d,m,y;if(!e.projectCwd)throw new we(`No project found in ${t}`);let i=e.projectCwd,n=t,s=null;for(;s!==e.projectCwd;){if(s=n,M.existsSync(v.join(s,St.manifest))){i=s;break}n=v.dirname(s)}let o=new Ge(e.projectCwd,{configuration:e});(d=Ee.telemetry)==null||d.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(m=Ee.telemetry)==null||m.reportWorkspaceCount(o.workspaces.length),(y=Ee.telemetry)==null||y.reportDependencyCount(o.workspaces.reduce((B,S)=>B+S.manifest.dependencies.size+S.manifest.devDependencies.size,0));let a=o.tryWorkspaceByCwd(i);if(a)return{project:o,workspace:a,locator:a.anchoredLocator};let l=await o.findLocatorForLocation(`${i}/`,{strict:!0});if(l)return{project:o,locator:l,workspace:null};let c=_e(e,o.cwd,Ke.PATH),u=_e(e,v.relative(o.cwd,i),Ke.PATH),g=`- If ${c} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,h=`- If ${c} is intended to be a project, it might be that you forgot to list ${u} in its workspace configuration.`,p=`- Finally, if ${c} is fine and you intend ${u} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new we(`The nearest package directory (${_e(e,i,Ke.PATH)}) doesn't seem to be part of the project declared in ${_e(e,o.cwd,Ke.PATH)}.
2024-10-01 04:19:50 +02:00
${[g,h,p].join(`
2024-10-01 04:49:34 +02:00
`)}`)}async setupResolutions(){var i;this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=v.join(this.cwd,this.configuration.get("lockfileFilename")),t=this.configuration.get("defaultLanguageName");if(M.existsSync(e)){let n=await M.readFilePromise(e,"utf8");this.lockFileChecksum=L$(n);let s=wi(n);if(s.__metadata){let o=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o<N$;for(let l of Object.keys(s)){if(l==="__metadata")continue;let c=s[l];if(typeof c.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${l})`);let u=Rc(c.resolution,!0),g=new ot;g.load(c,{yamlCompatibilityMode:!0});let h=g.version,p=g.languageName||t,d=c.linkType.toUpperCase(),m=(i=c.conditions)!=null?i:null,y=g.dependencies,B=g.peerDependencies,S=g.dependenciesMeta,P=g.peerDependenciesMeta,F=g.bin;if(c.checksum!=null){let q=typeof a<"u"&&!c.checksum.includes("/")?`${a}/${c.checksum}`:c.checksum;this.storedChecksums.set(u.locatorHash,q)}let H={...u,version:h,languageName:p,linkType:d,conditions:m,dependencies:y,peerDependencies:B,dependenciesMeta:S,peerDependenciesMeta:P,bin:F};this.originalPackages.set(H.locatorHash,H);for(let q of l.split(ZMe)){let _=JA(q);this.storedDescriptors.set(_.descriptorHash,_),this.storedResolutions.set(_.descriptorHash,u.locatorHash)}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,t=(0,Z0.default)(4),i=async(n,s)=>{if(e.has(s))return n;e.add(s);let o=new bh(s,{project:this});await t(()=>o.setup());let a=n.then(()=>{this.addWorkspace(o);let l=this.storedPackages.get(o.anchoredLocator.locatorHash);l&&(o.dependencies=l.dependencies)});return Array.from(o.workspacesCwds).reduce(i,a)};await i(Promise.resolve(),this.cwd)}addWorkspace(e){let t=this.workspacesByIdent.get(e.locator.identHash);if(typeof t<"u")throw new Error(`Duplicate workspace name ${ai(this.configuration,e.locator)}: ${K.fromPortablePath(e.cwd)} conflicts with ${K.fromPortablePath(t.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.locator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){v.isAbsolute(e)||(e=v.resolve(this.cwd,e)),e=v.normalize(e).replace(/\/+$/,"");let t=this.workspacesByCwd.get(e);return t||null}getWorkspaceByCwd(e){let t=this.tryWorkspaceByCwd(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByFilePath(e){let t=null;for(let i of this.workspaces)v.relative(i.cwd,e).startsWith("../")||t&&t.cwd.length>=i.cwd.length||(t=i);return t||null}getWorkspaceByFilePath(e){let t=this.tryWorkspaceByFilePath(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByIdent(e){let t=this.workspacesByIdent.get(e.identHash);return typeof t>"u"?null:t}getWorkspaceByIdent(e){let t=this.tryWorkspaceByIdent(e);if(!t)throw new Error(`Workspace not found (${ai(this.configuration,e)})`);return t}tryWorkspaceByDescriptor(e){let t=this.tryWorkspaceByIdent(e);return t===null||(qA(e)&&(e=nC(e)),!t.accepts(e.range))?null:t}getWorkspaceByDescriptor(e){let t=this.tryWorkspaceByDescriptor(e);if(t===null)throw new Error(`Workspace not found (${$t(this.configuration,e)})`);return t}tryWorkspaceByLocator(e){let t=this.tryWorkspaceByIdent(e);return t===null||(Yo(e)&&(e=sC(e)),t.locator.locatorHash!==e.locatorHash&&t.anchoredLocator.locatorHash!==e.locatorHash)?null:t}getWorkspaceByLocator(e){let t=this.tryWorkspaceByLocator(e);if(!t)throw new Error(`Workspace not found (${Ct(this.configuration,e)})`);return t}refreshWorkspaceDependencies(){for(let e of this.workspaces){let t=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!t)throw new Error(`Assertion failed: Expected workspace ${cC(this.configuration,e)} (${_e(this.configuration,v.join(e.cwd,St.manifest),Ke.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);e.dependencies=new Map(t.dependencies)}}deleteDescriptor(e){this.storedResolutions.delete(e),
2024-10-01 04:19:50 +02:00
`;switch(Ae){case 0:ge+=`# Script name: ${ye}
`;break;case 1:ge+=`# Script code: ${ye}
2024-10-01 04:49:34 +02:00
`;break}let oe=null;if(!await M.mktempPromise(async ie=>{let G=v.join(ie,"build.log"),{stdout:fe,stderr:re}=this.configuration.getSubprocessStreams(G,{header:ge,prefix:Ct(this.configuration,he),report:t}),de;try{switch(Ae){case 0:de=await NB(he,ye,[],{cwd:se,project:this,stdin:oe,stdout:fe,stderr:re});break;case 1:de=await JR(he,ye,[],{cwd:se,project:this,stdin:oe,stdout:fe,stderr:re});break}}catch(vt){re.write(vt.stack),de=1}if(fe.end(),re.end(),de===0)return!0;M.detachTemp(ie);let Ze=`${Ct(this.configuration,he)} couldn't be built successfully (exit code ${_e(this.configuration,de,Ke.NUMBER)}, logs can be found here: ${_e(this.configuration,G,Ke.PATH)})`;return this.optionalBuilds.has(he.locatorHash)?(t.reportInfo(9,Ze),!0):(t.reportError(9,Ze),!1)}))return!1}return!0});N.push(...Re,Promise.allSettled(Re).then(se=>{P.delete(ce),se.every(Ae=>Ae.status==="fulfilled"&&Ae.value===!0)&&W.set(he.locatorHash,De)}))}if(await ro(N),O===P.size){let ce=Array.from(P).map(he=>{let Pe=this.storedPackages.get(he);if(!Pe)throw new Error("Assertion failed: The package should have been registered");return Ct(this.configuration,Pe)}).join(", ");t.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ce})`);break}}this.storedBuildState=W}async install(e){var a,l;let t=this.configuration.get("nodeLinker");(a=Ee.telemetry)==null||a.reportInstall(t),await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(c=>c.validateProject,this,{reportWarning:e.report.reportWarning.bind(e.report),reportError:e.report.reportError.bind(e.report)})});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.status="inactive";let i=v.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await M.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new rt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):c}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{for(let[,c]of this.configuration.packageExtensions)for(let[,u]of c)for(let g of u)if(g.userProvided){let h=_e(this.configuration,g,Ke.PACKAGE_EXTENSION);switch(g.status){case"inactive":e.report.reportWarning(68,`${h}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":e.report.reportWarning(69,`${h}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(n!==null){let c=Zl(n,this.generateLockfile());if(c!==n){let u=SZ(i,i,n,c,void 0,void 0,{maxEditLength:100});if(u){e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@ -${g.oldStart},${g.oldLines} +${g.newStart},${g.newLines} @@`);for(let h of g.lines)h.startsWith("+")?e.report.reportError(28,_e(this.configuration,h,Ke.ADDED)):h.startsWith("-")?e.report.reportError(28,_e(this.configuration,h,Ke.REMOVED)):e.report.reportInfo(null,_e(this.configuration,h,"grey"))}e.report.reportSeparator()}throw new rt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.userProvided&&g.status==="active"&&((l=Ee.telemetry)==null||l.reportPackageExtension(bc(g,Ke.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject>"u"||e.persistProject)&&e.mode!=="update-lockfile"&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>Qw(c,{cwd:this.cwd})));(typeof e.persistProject>"u"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise("Link step",async()=>{if(e.mode==="update-lockfile"){e.report.reportWarning(73,`Skipped
2024-10-01 04:19:50 +02:00
`,`# Manual changes might be lost - proceed with caution!
`].join("")}
2024-10-01 04:49:34 +02:00
`+ba(t)}async persistLockfile(){let e=v.join(this.cwd,this.configuration.get("lockfileFilename")),t="";try{t=await M.readFilePromise(e,"utf8")}catch{}let i=this.generateLockfile(),n=Zl(t,i);n!==t&&(await M.writeFilePromise(e,n),this.lockFileChecksum=L$(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(JN))e.push(...o);let t=(0,X0.default)(this,e),i=WN.default.serialize(t),n=rn(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await M.mkdirPromise(v.dirname(s),{recursive:!0}),await M.writeFilePromise(s,await $Me(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:t=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath"),s;try{let o=await e1e(await M.readFilePromise(n));s=WN.default.deserialize(o),this.installStateChecksum=rn(o)}catch{t&&await this.applyLightResolution();return}e&&typeof s.installersCustomData<"u"&&(this.installersCustomData=s.installersCustomData),i&&Object.assign(this,(0,X0.default)(s,JN.restoreBuildState)),t&&(s.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,X0.default)(s,JN.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new $r}),await this.persistInstallStateFile()}async persist(){let e=(0,Z0.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(t=>e(()=>t.persistManifest()))])}async cacheCleanup({cache:e,report:t}){if(this.configuration.get("enableGlobalCache"))return;let i=new Set([".gitignore"]);if(!Zk(e.cwd,this.cwd)||!await M.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await M.readdirPromise(e.cwd)){if(i.has(a))continue;let l=v.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?t.reportError(56,`${_e(this.configuration,v.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:t.reportInfo(19,`${_e(this.configuration,v.basename(l),"magenta")} appears to be unused - removing`),await M.removePromise(l)))}n&&s!==0&&t.reportInfo(19,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`)}};function t1e({project:r,allDescriptors:e,allResolutions:t,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,peerRequirements:o=new Map,volatileDescriptors:a=new Set,report:l}){var X;let c=new Map,u=[],g=new Map,h=new Map,p=new Map,d=new Map,m=new Map,y=new Map(r.workspaces.map(W=>{let Z=W.anchoredLocator.locatorHash,A=i.get(Z);if(typeof A>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[Z,iC(A)]})),B=()=>{let W=M.mktempSync(),Z=v.join(W,"stacktrace.log"),A=String(u.length+1).length,ne=u.map((ue,te)=>`${`${te+1}.`.padStart(A," ")} ${ms(ue)}
`).join("");throw M.writeFileSync(Z,ne),M.detachTemp(W),new rt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${K.fromPortablePath(Z)}`)},S=W=>{let Z=t.get(W.descriptorHash);if(typeof Z>"u")throw new Error("Assertion failed: The resolution should have been registered");let A=i.get(Z);if(!A)throw new Error("Assertion failed: The package could not be found");return A},P=(W,Z,A,{top:ne,optional:ue})=>{u.length>1e3&&B(),u.push(Z);let te=F(W,Z,A,{top:ne,optional:ue});return u.pop(),te},F=(W,Z,A,{top:ne,optional:ue})=>{if(ue||s.delete(Z.locatorHash),n.has(Z.locatorHash))return;n.add(Z.locatorHash);let te=i.get(Z.locatorHash);if(!te)throw new Error(`Assertion failed: The package (${Ct(r.configuration,Z)}) should have been registered`);let O=[],N=[],ce=[],he=[],Pe=[];for(let Re of Array.from(te.dependencies.values())){if(te.peerDependencies.has(Re.identHash)&&te.locatorHash!==ne)continue;if(qA(Re))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");a.delete(Re.descriptorHash);let se=ue;if(!se){let G=te.dependenciesMeta.get(Tt(Re));if(typeof G<"u"){let fe=G.get(null);typeof fe<"u"&&fe.optional&&(se=!0)}}let Ae=t.get(Re.descriptorHash);if(!Ae)throw new Error(`Assertion failed: The resolution (${$t(r.configuration,Re)}) should have been registered`);let ye=y.get(Ae)||i.get(Ae);if(!ye)throw new Error(`Assertion failed: The package (${Ae}, resolved from ${$t(r.configuration,Re)}) should have been registered`);if(ye.peerDependencies.size===0){P(Re,ye,new Map,{top:ne,optional:se});continue}let ge,oe,Ye=new Set,ie;N.push(()=>{ge=jk(Re,Z.locatorHash),oe=Gk(ye,Z.locatorHash),te.dependencies.delete(Re.identHash),te.dependencies.set(ge.identHash,ge),t.set(ge.descriptorHash,oe.locatorHash),e.set(ge.descriptorHash,ge),i.set(oe.locatorHash,oe),O.push([ye,ge,oe])}),ce.push(()=>{var G;ie=new Map;for(let fe of oe.peerDependencies.values()){let re=te.dependencies.get(fe.identHash);if(!re&&oC(Z,fe)&&(W.identHash===Z.identHash?re=W:(re=zt(Z,W.range),e.set(re.descriptorHash,re),t.set(re.descriptorHash,Z.locatorHash),a.delete(re.descriptorHash))),(!re||re.range==="missing:")&&oe.dependencies.has(fe.identHash)){oe.peerDependencies.delete(fe.identHash);continue}re||(re=zt(fe,"missing:")),oe.dependencies.set(re.identHash,re),qA(re)&&Qc(p,re.descriptorHash).add(oe.locatorHash),g.set(re.identHash,re),re.range==="missing:"&&Ye.add(re.identHash),ie.set(fe.identHash,(G=A.get(fe.identHash))!=null?G:oe.locatorHash)}oe.dependencies=new Map(bn(oe.dependencies,([fe,re])=>Tt(re)))}),he.push(()=>{if(!i.has(oe.locatorHash))return;let G=c.get(ye.locatorHash);typeof G=="number"&&G>=2&&B();let fe=c.get(ye.locatorHash),re=typeof fe<"u"?fe+1:1;c.set(ye.locatorHash,re),P(ge,oe,ie,{top:ne,optional:se}),c.set(ye.locatorHash,re-1)}),Pe.push(()=>{let G=te.dependencies.get(Re.identHash);if(typeof G>"u")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let fe=t.get(G.descriptorHash);if(typeof fe>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");if(Qc(m,fe).add(Z.locatorHash),!!i.has(oe.locatorHash)){for(let re of oe.peerDependencies.values()){let de=ie.get(re.identHash);if(typeof de>"u")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");hf(pf(d,de),Tt(re)).push(oe.locatorHash)}for(let re of Ye)oe.dependencies.delete(re)}})}for(let Re of[...N,...ce])Re();let De;do{De=!0;for(let[Re,se,Ae]of O){let ye=pf(h,Re.locatorHash),ge=rn(...[...Ae.dependencies.values()].map(G=>{let fe=G.range!=="missing:"?t.get(G.descriptorHash):"missing:";if(typeof fe>"u")throw new Error(`Assertion failed: Expected the resolution for ${$t(r.configuration,G)} to have been registered`);return fe===ne?`${fe} (top)`:fe}),se.identHash),oe=ye.get(ge);if(typeof oe>"u"){ye.set(ge,se);continue}if(oe===se)continue;i.delete(Ae.locatorHash),e.delete(se.descriptorHash),t.delete(se.descriptorHash),n.delete(Ae.locatorHash);let Ye=p.get(se.descriptorHash)||[],ie=[te.locatorHash,...Ye];p.delete(se.descriptorHash);for(let G of
Try running the command again with the package name prefixed: ${$.pretty(t,"yarn add",$.Type.CODE)} ${$.pretty(t,x.makeDescriptor(x.makeIdent(null,"my-package"),`${F[0]}...`),$.Type.DESCRIPTOR)}`);if(!P)throw new we(`The ${$.pretty(t,S,$.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let H=kqe(n,P,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(H.map(async _=>{let X=await Gm(P,{project:i,workspace:n,cache:s,target:_,modifier:l,strategies:c,maxResults:u});return{request:P,suggestedDescriptors:X,target:_}}))})).then(S=>S.flat()),h=await ta.start({configuration:t,stdout:this.context.stdout,suggestInstall:!1},async S=>{for(let{request:P,suggestedDescriptors:{suggestions:F,rejections:H}}of g)if(F.filter(_=>_.descriptor!==null).length===0){let[_]=H;if(typeof _>"u")throw new Error("Assertion failed: Expected an error to have been set");i.configuration.get("enableNetwork")?S.reportError(27,`${x.prettyDescriptor(t,P)} can't be resolved to a satisfying range`):S.reportError(27,`${x.prettyDescriptor(t,P)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),S.reportSeparator(),S.reportExceptionOnce(_)}});if(h.hasErrors())return h.exitCode();let p=!1,d=[],m=[];for(let{suggestedDescriptors:{suggestions:S},target:P}of g){let F,H=S.filter(W=>W.descriptor!==null),q=H[0].descriptor,_=H.every(W=>x.areDescriptorsEqual(W.descriptor,q));H.length===1||_?F=q:(p=!0,{answer:F}=await(0,Use.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:S.map(({descriptor:W,name:Z,reason:A})=>W?{name:Z,hint:A,descriptor:W}:{name:Z,hint:A,disabled:!0}),onCancel:()=>process.exit(130),result(W){return this.find(W,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let X=n.manifest[P].get(F.identHash);(typeof X>"u"||X.descriptorHash!==F.descriptorHash)&&(n.manifest[P].set(F.identHash,F),this.optional&&(P==="dependencies"?n.manifest.ensureDependencyMeta({...F,range:"unknown"}).optional=!0:P==="peerDependencies"&&(n.manifest.ensurePeerDependencyMeta({...F,range:"unknown"}).optional=!0)),typeof X>"u"?d.push([n,P,F,c]):m.push([n,P,X,F]))}return await t.triggerMultipleHooks(S=>S.afterWorkspaceDependencyAddition,d),await t.triggerMultipleHooks(S=>S.afterWorkspaceDependencyReplacement,m),p&&this.context.stdout.write(`
`),(await He.start({configuration:t,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async S=>{await i.install({cache:s,report:S,mode:this.mode})})).exitCode()}};cu.paths=[["add"]],cu.usage=be.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"<package>\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add l
`),0}return(await He.start({configuration:t,json:this.json,stdout:this.context.stdout},async o=>{let a=await Yt.getPackageAccessibleBinaries(n,{project:i}),c=Array.from(a.keys()).reduce((u,g)=>Math.max(u,g.length),0);for(let[u,[g,h]]of a)o.reportJson({name:u,source:x.stringifyIdent(g),path:h});if(this.verbose)for(let[u,[g]]of a)o.reportInfo(null,`${u.padEnd(c," ")} ${x.prettyLocator(t,g)}`);else for(let u of a.keys())o.reportInfo(null,u)})).exitCode()}};uu.paths=[["bin"]],uu.usage=be.Usage({description:"get the path to a binary script",details:`
2024-10-01 04:19:50 +02:00
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var gu=class extends xe{constructor(){super(...arguments);this.mirror=z.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=z.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=await Dt.find(t);return(await He.start({configuration:t,stdout:this.context.stdout},async()=>{let s=(this.all||this.mirror)&&i.mirrorCwd!==null,o=!this.mirror;s&&(await M.removePromise(i.mirrorCwd),await t.triggerHook(a=>a.cleanGlobalArtifacts,t)),o&&await M.removePromise(i.cwd)})).exitCode()}};gu.paths=[["cache","clean"],["cache","clear"]],gu.usage=be.Usage({description:"remove the shared cache files",details:`
This command will remove all the files from the cache.
2024-10-01 04:49:34 +02:00
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var Hse=ve(cQ()),YL=J("util"),fu=class extends xe{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=z.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*/,"");if(typeof t.settings.get(i)>"u")throw new we(`Couldn't find a configuration settings named "${i}"`);let o=t.getSpecial(i,{hideSecrets:!this.unsafe,getNativePaths:!0}),a=me.convertMapsToIndexableObjects(o),l=n?(0,Hse.default)(a,n):a,c=await He.start({configuration:t,includeFooter:!1,json:this.json,stdout:this.context.stdout},async u=>{u.reportJson(l)});if(!this.json){if(typeof l=="string")return this.context.stdout.write(`${l}
`),c.exitCode();YL.inspect.styles.name="cyan",this.context.stdout.write(`${(0,YL.inspect)(l,{depth:1/0,colors:t.get("enableColors"),compact:!1})}
2024-10-01 04:19:50 +02:00
`)}return c.exitCode()}};fu.paths=[["config","get"]],fu.usage=be.Usage({description:"read a configuration settings",details:`
This command will print a configuration setting.
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]});var $oe=ve(XL()),eae=ve(cQ()),tae=ve(_oe()),ZL=J("util"),hu=class extends xe{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=z.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=z.String();this.value=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=()=>{if(!t.projectCwd)throw new we("This command must be run from within a project folder");return t.projectCwd},n=this.name.replace(/[.[].*$/,""),s=this.name.replace(/^[^.[]*\.?/,"");if(typeof t.settings.get(n)>"u")throw new we(`Couldn't find a configuration settings named "${n}"`);if(n==="enableStrictSettings")throw new we("This setting only affects the file it's in, and thus cannot be set from the CLI");let a=this.json?JSON.parse(this.value):this.value;await(this.home?d=>Ee.updateHomeConfiguration(d):d=>Ee.updateConfiguration(i(),d))(d=>{if(s){let m=(0,$oe.default)(d);return(0,tae.default)(m,this.name,a),m}else return{...d,[n]:a}});let u=(await Ee.find(this.context.cwd,this.context.plugins)).getSpecial(n,{hideSecrets:!0,getNativePaths:!0}),g=me.convertMapsToIndexableObjects(u),h=s?(0,eae.default)(g,s):g;return(await He.start({configuration:t,includeFooter:!1,stdout:this.context.stdout},async d=>{ZL.inspect.styles.name="cyan",d.reportInfo(0,`Successfully set ${this.name} to ${(0,ZL.inspect)(h,{depth:1/0,colors:t.get("enableColors"),compact:!1})}`)})).exitCode()}};hu.paths=[["config","set"]],hu.usage=be.Usage({description:"change a configuration settings",details:`
This command will set a configuration setting.
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var cae=ve(XL()),uae=ve(Am()),gae=ve(lae()),pu=class extends xe{constructor(){super(...arguments);this.home=z.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=()=>{if(!t.projectCwd)throw new we("This command must be run from within a project folder");return t.projectCwd},n=this.name.replace(/[.[].*$/,""),s=this.name.replace(/^[^.[]*\.?/,"");if(typeof t.settings.get(n)>"u")throw new we(`Couldn't find a configuration settings named "${n}"`);let a=this.home?c=>Ee.updateHomeConfiguration(c):c=>Ee.updateConfiguration(i(),c);return(await He.start({configuration:t,includeFooter:!1,stdout:this.context.stdout},async c=>{let u=!1;await a(g=>{if(!(0,uae.default)(g,this.name))return c.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),u=!0,g;let h=s?(0,cae.default)(g):{...g};return(0,gae.default)(h,this.name),h}),u||c.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};pu.paths=[["config","unset"]],pu.usage=be.Usage({description:"unset a configuration setting",details:`
This command will unset a configuration setting.
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]});var _L=J("util"),du=class extends xe{constructor(){super(...arguments);this.verbose=z.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=z.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins,{strict:!1});return(await He.start({configuration:t,json:this.json,stdout:this.context.stdout},async n=>{if(t.invalid.size>0&&!this.json){for(let[s,o]of t.invalid)n.reportError(34,`Invalid configuration key "${s}" in ${o}`);n.reportSeparator()}if(this.json){let s=me.sortMap(t.settings.keys(),o=>o);for(let o of s){let a=t.settings.get(o),l=t.getSpecial(o,{hideSecrets:!0,getNativePaths:!0}),c=t.sources.get(o);this.verbose?n.reportJson({key:o,effective:l,source:c}):n.reportJson({key:o,effective:l,source:c,...a})}}else{let s=me.sortMap(t.settings.keys(),l=>l),o=s.reduce((l,c)=>Math.max(l,c.length),0),a={breakLength:1/0,colors:t.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let l=s.map(u=>{let g=t.settings.get(u);if(!g)throw new Error(`Assertion failed: This settings ("${u}") should have been registered`);let h=this.why?t.sources.get(u)||"<default>":g.description;return[u,h]}),c=l.reduce((u,[,g])=>Math.max(u,g.length),0);for(let[u,g]of l)n.reportInfo(null,`${u.padEnd(o," ")} ${g.padEnd(c," ")} ${(0,_L.inspect)(t.getSpecial(u,{hideSecrets:!0,getNativePaths:!0}),a)}`)}else for(let l of s)n.reportInfo(null,`${l.padEnd(o," ")} ${(0,_L.inspect)(t.getSpecial(l,{hideSecrets:!0,getNativePaths:!0}),a)}`)}})).exitCode()}};du.paths=[["config"]],du.usage=be.Usage({description:"display the current configuration",details:`
This command prints the current active configuration settings.
2024-10-01 04:49:34 +02:00
`,examples:[["Print the active configuration settings","$0 config"]]});As();var FQ={};ct(FQ,{Strategy:()=>qm,acceptedStrategies:()=>FWe,dedupe:()=>$L});var fae=ve(Qn()),qm=(e=>(e.HIGHEST="highest",e))(qm||{}),FWe=new Set(Object.values(qm)),NWe={highest:async(r,e,{resolver:t,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of r.storedResolutions){let c=r.storedDescriptors.get(a);if(typeof c>"u")throw new Error(`Assertion failed: The descriptor (${a}) should have been registered`);me.getSetWithDefault(o,c.identHash).add(l)}return Array.from(r.storedDescriptors.values(),async a=>{if(e.length&&!fae.default.isMatch(x.stringifyIdent(a),e))return null;let l=r.storedResolutions.get(a.descriptorHash);if(typeof l>"u")throw new Error(`Assertion failed: The resolution (${a.descriptorHash}) should have been registered`);let c=r.originalPackages.get(l);if(typeof c>"u"||!t.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u>"u")throw new Error(`Assertion failed: The resolutions (${a.identHash}) should have been registered`);if(u.size===1)return null;let g=[...u].map(y=>{let B=r.originalPackages.get(y);if(typeof B>"u")throw new Error(`Assertion failed: The package (${y}) should have been registered`);return B.reference}),h=await t.getSatisfying(a,g,n),p=h==null?void 0:h[0];if(typeof p>"u")return null;let d=p.locatorHash,m=r.originalPackages.get(d);if(typeof m>"u")throw new Error(`Assertion failed: The package (${d}) should have been registered`);return d===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function $L(r,{strategy:e,patterns:t,cache:i,report:n}){let{configuration:s}=r,o=new $r,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:r.storedChecksums,fetcher:l,project:r,report:o,skipIntegrityCheck:!0,cacheOptions:{skipIntegrityCheck:!0}},u={project:r,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let g=NWe[e],h=await g(r,t,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),p=xi.progressViaCounter(h.length);await n.reportProgress(p);let d=0;await Promise.all(h.map(B=>B.then(S=>{if(S===null)return;d++;let{descriptor:P,currentPackage:F,updatedPackage:H}=S;n.reportInfo(0,`${x.prettyDescriptor(s,P)} can be deduped from ${x.prettyLocator(s,F)} to ${x.prettyLocator(s,H)}`),n.reportJson({descriptor:x.stringifyDescriptor(P),currentResolution:x.stringifyLocator(F),updatedResolution:x.stringifyLocator(H)}),r.storedResolutions.set(P.descriptorHash,H.locatorHash)}).finally(()=>p.tick())));let m;switch(d){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${d} packages`}let y=$.pretty(s,e,$.Type.CODE);return n.reportInfo(0,`${m} can be deduped using the ${y} strategy`),d})}var Cu=class extends xe{constructor(){super(...arguments);this.strategy=z.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Zi(qm)});this.check=z.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:Zi(ts)});this.patterns=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i}=await Ge.find(t,this.context.cwd),n=await Dt.find(t);await i.restoreInstallState({restoreResolutions:!1});let s=0,o=await He.start({configuration:t,includeFooter:!1,stdout:this.context.stdout,json:this.json},async a=>{s=await $L(i,{strategy:this.strategy,patterns:this.patterns,cache:n,report:a})});return o.hasErrors()?o.exitCode():this.check?s?1:0:(await He.start({configuration:t,stdout:this.context.stdout,json:this.json},async l=>{await i.install({cache:n,report:l,mode:this.mode})})).exitCode()}};Cu.paths=[["dedupe"]],Cu.usage=be.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to
`)}};Vh.paths=[["--clipanion=definitions"]];var Xh=class extends xe{async execute(){this.context.stdout.write(this.cli.usage(null))}};Xh.paths=[["help"],["--help"],["-h"]];var Jm=class extends xe{constructor(){super(...arguments);this.leadingArgument=z.String();this.args=z.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!x.tryParseIdent(this.leadingArgument)){let t=v.resolve(this.context.cwd,K.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:t})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};var Zh=class extends xe{async execute(){this.context.stdout.write(`${Nr||"<unknown>"}
`)}};Zh.paths=[["-v"],["--version"]];var mu=class extends xe{constructor(){super(...arguments);this.commandName=z.String();this.args=z.Proxy()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,locator:n}=await Ge.find(t,this.context.cwd);return await i.restoreInstallState(),await Yt.executePackageShellcode(n,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:i})}};mu.paths=[["exec"]],mu.usage=be.Usage({description:"execute a shell script",details:`
2024-10-01 04:19:50 +02:00
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
2024-10-01 04:49:34 +02:00
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});As();var Eu=class extends xe{constructor(){super(...arguments);this.hash=z.String({required:!1,validator:ad(od(),[Ad(/^p[0-9a-f]{5}$/)])})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i}=await Ge.find(t,this.context.cwd);return await i.restoreInstallState({restoreResolutions:!1}),await i.applyLightResolution(),typeof this.hash<"u"?await LWe(this.hash,i,{stdout:this.context.stdout}):(await He.start({configuration:t,stdout:this.context.stdout,includeFooter:!1},async s=>{var a;let o=[([,l])=>x.stringifyLocator(i.storedPackages.get(l.subject)),([,l])=>x.stringifyIdent(l.requested)];for(let[l,c]of me.sortMap(i.peerRequirements,o)){let u=i.storedPackages.get(c.subject);if(typeof u>"u")throw new Error("Assertion failed: Expected the subject package to have been registered");let g=i.storedPackages.get(c.rootRequester);if(typeof g>"u")throw new Error("Assertion failed: Expected the root package to have been registered");let h=(a=u.dependencies.get(c.requested.identHash))!=null?a:null,p=$.pretty(t,l,$.Type.CODE),d=x.prettyLocator(t,u),m=x.prettyIdent(t,c.requested),y=x.prettyIdent(t,g),B=c.allRequesters.length-1,S=`descendant${B===1?"":"s"}`,P=B>0?` and ${B} ${S}`:"",F=h!==null?"provides":"doesn't provide";s.reportInfo(null,`${p} \u2192 ${d} ${F} ${m} to ${y}${P}`)}})).exitCode()}};Eu.paths=[["explain","peer-requirements"]],Eu.usage=be.Usage({description:"explain a set of peer requirements",details:`
2024-10-01 04:19:50 +02:00
A set of peer requirements represents all peer requirements that a dependent must satisfy when providing a given peer request to a requester and its descendants.
When the hash argument is specified, this command prints a detailed explanation of all requirements of the set corresponding to the hash and whether they're satisfied or not.
When used without arguments, this command lists all sets of peer requirements and the corresponding hash that can be used to get detailed information about a given set.
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
2024-10-01 04:49:34 +02:00
`,examples:[["Explain the corresponding set of peer requirements for a hash","$0 explain peer-requirements p1a4ed"],["List all sets of peer requirements","$0 explain peer-requirements"]]});async function LWe(r,e,t){let{configuration:i}=e,n=e.peerRequirements.get(r);if(typeof n>"u")throw new Error(`No peerDependency requirements found for hash: "${r}"`);return(await He.start({configuration:i,stdout:t.stdout,includeFooter:!1},async o=>{var B,S;let a=e.storedPackages.get(n.subject);if(typeof a>"u")throw new Error("Assertion failed: Expected the subject package to have been registered");let l=e.storedPackages.get(n.rootRequester);if(typeof l>"u")throw new Error("Assertion failed: Expected the root package to have been registered");let c=(B=a.dependencies.get(n.requested.identHash))!=null?B:null,u=c!==null?e.storedResolutions.get(c.descriptorHash):null;if(typeof u>"u")throw new Error("Assertion failed: Expected the resolution to have been registered");let g=u!==null?e.storedPackages.get(u):null;if(typeof g>"u")throw new Error("Assertion failed: Expected the provided package to have been registered");let h=[...n.allRequesters.values()].map(P=>{let F=e.storedPackages.get(P);if(typeof F>"u")throw new Error("Assertion failed: Expected the package to be registered");let H=x.devirtualizeLocator(F),q=e.storedPackages.get(H.locatorHash);if(typeof q>"u")throw new Error("Assertion failed: Expected the package to be registered");let _=q.peerDependencies.get(n.requested.identHash);if(typeof _>"u")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:F,peerDependency:_}});if(g!==null){let P=h.every(({peerDependency:F})=>bt.satisfiesWithPrereleases(g.version,F.range));o.reportInfo(0,`${x.prettyLocator(i,a)} provides ${x.prettyLocator(i,g)} with version ${x.prettyReference(i,(S=g.version)!=null?S:"<missing>")}, which ${P?"satisfies":"doesn't satisfy"} the following requirements:`)}else o.reportInfo(0,`${x.prettyLocator(i,a)} doesn't provide ${x.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let p=$.mark(i),d=[];for(let{pkg:P,peerDependency:F}of me.sortMap(h,H=>x.stringifyLocator(H.pkg))){let q=(g!==null?bt.satisfiesWithPrereleases(g.version,F.range):!1)?p.Check:p.Cross;d.push({stringifiedLocator:x.stringifyLocator(P),prettyLocator:x.prettyLocator(i,P),prettyRange:x.prettyRange(i,F.range),mark:q})}let m=Math.max(...d.map(({stringifiedLocator:P})=>P.length)),y=Math.max(...d.map(({prettyRange:P})=>P.length));for(let{stringifiedLocator:P,prettyLocator:F,prettyRange:H,mark:q}of me.sortMap(d,({stringifiedLocator:_})=>_))o.reportInfo(null,`${F.padEnd(m+(F.length-P.length)," ")} \u2192 ${H.padEnd(y," ")} ${q}`);d.length>1&&(o.reportSeparator(),o.reportInfo(0,`Note: these requirements start with ${x.prettyLocator(e.configuration,l)}`))})).exitCode()}As();var pae=ve(zr()),Iu=class extends xe{constructor(){super(...arguments);this.onlyIfNeeded=z.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=z.String()}async execute(){var o;let t=await Ee.find(this.context.cwd,this.context.plugins);if(this.onlyIfNeeded&&t.get("yarnPath")){let a=t.sources.get("yarnPath");if(!a)throw new Error("Assertion failed: Expected 'yarnPath' to have a source");let l=(o=t.projectCwd)!=null?o:t.startingCwd;if(v.contains(l,a))return 0}let i=()=>{if(typeof Nr>"u")throw new we("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},n;if(this.version==="self")n=i();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")n=`https://repo.yarnpkg.com/${await Wm(t,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")n=`https://repo.yarnpkg.com/${await Wm(t,"canary")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="classic")n="https://classic.yarnpkg.com/latest.js";else if(this.version.match(/^https?:/))n=this.version;else if(this.version.match(/^\.{0,2}[\\/]/)||K.isAbsolute(this.version))n=`file://${K.resolve(th
2024-10-01 04:19:50 +02:00
${e}`)});let n=(p=r.projectCwd)!=null?p:r.startingCwd,s=v.resolve(n,".yarn/releases"),o=v.resolve(s,`yarn-${e}.cjs`),a=v.relative(r.startingCwd,o),l=v.relative(n,o);i.reportInfo(0,`Saving the new release in ${$.pretty(r,a,"magenta")}`),await M.removePromise(v.dirname(o)),await M.mkdirPromise(v.dirname(o),{recursive:!0}),await M.writeFilePromise(o,t,{mode:493}),await Ee.updateConfiguration(n,{yarnPath:l});let c=await ot.tryFind(n)||new ot;c.packageManager=`yarn@${e&&me.isTaggedYarnVersion(e)?e:await Wm(r,"stable")}`;let u={};c.exportTo(u);let g=v.join(n,ot.fileName),h=`${JSON.stringify(u,null,c.indent)}
2024-10-01 04:49:34 +02:00
`;await M.changeFilePromise(g,h,{automaticNewlines:!0})}function dae(r){return dt[TI(r)]}var MWe=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function KWe(r){let t=`https://repo.yarnpkg.com/${me.isTaggedYarnVersion(Nr)?Nr:await Wm(r,"canary")}/packages/gatsby/content/advanced/error-codes.md`,i=await Vt.get(t,{configuration:r});return new Map(Array.from(i.toString().matchAll(MWe),({groups:n})=>{if(!n)throw new Error("Assertion failed: Expected the match to have been successful");let s=dae(n.code);if(n.name!==s)throw new Error(`Assertion failed: Invalid error code data: Expected "${n.name}" to be named "${s}"`);return[n.code,n.details]}))}var yu=class extends xe{constructor(){super(...arguments);this.code=z.String({required:!1,validator:ad(od(),[Ad(/^YN[0-9]{4}$/)])});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let i=dae(this.code),n=$.pretty(t,i,$.Type.CODE),s=this.cli.format().header(`${this.code} - ${n}`),a=(await KWe(t)).get(this.code),l=typeof a<"u"?$.jsonOrPretty(this.json,t,$.tuple($.Type.MARKDOWN,{text:a,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
2024-10-01 04:19:50 +02:00
You can help us by editing this page on GitHub \u{1F642}:
${$.jsonOrPretty(this.json,t,$.tuple($.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/gatsby/content/advanced/error-codes.md"))}
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:i,details:l})}
`):this.context.stdout.write(`${s}
${l}
`)}else{let i={children:me.mapAndFilter(Object.entries(dt),([n,s])=>Number.isNaN(Number(n))?me.mapAndFilter.skip:{label:RA(Number(n)),value:$.tuple($.Type.CODE,s)})};es.emitTree(i,{configuration:t,stdout:this.context.stdout,json:this.json})}}};yu.paths=[["explain"]],yu.usage=be.Usage({description:"explain an error code",details:`
When the code argument is specified, this command prints its name and its details.
When used without arguments, this command lists all error codes and their names.
2024-10-01 04:49:34 +02:00
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});var Cae=ve(Qn()),wu=class extends xe{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=z.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=z.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=z.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=z.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=z.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=z.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=z.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n&&!this.all)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState();let o=new Set(this.extra);this.cache&&o.add("cache"),this.dependents&&o.add("dependents"),this.manifest&&o.add("manifest");let a=(F,{recursive:H})=>{let q=F.anchoredLocator.locatorHash,_=new Map,X=[q];for(;X.length>0;){let W=X.shift();if(_.has(W))continue;let Z=i.storedPackages.get(W);if(typeof Z>"u")throw new Error("Assertion failed: Expected the package to be registered");if(_.set(W,Z),x.isVirtualLocator(Z)&&X.push(x.devirtualizeLocator(Z).locatorHash),!(!H&&W!==q))for(let A of Z.dependencies.values()){let ne=i.storedResolutions.get(A.descriptorHash);if(typeof ne>"u")throw new Error("Assertion failed: Expected the resolution to be registered");X.push(ne)}}return _.values()},l=({recursive:F})=>{let H=new Map;for(let q of i.workspaces)for(let _ of a(q,{recursive:F}))H.set(_.locatorHash,_);return H.values()},c=({all:F,recursive:H})=>F&&H?i.storedPackages.values():F?l({recursive:H}):a(n,{recursive:H}),u=({all:F,recursive:H})=>{let q=c({all:F,recursive:H}),_=this.patterns.map(Z=>{let A=x.parseLocator(Z),ne=Cae.default.makeRe(x.stringifyIdent(A)),ue=x.isVirtualLocator(A),te=ue?x.devirtualizeLocator(A):A;return O=>{let N=x.stringifyIdent(O);if(!ne.test(N))return!1;if(A.reference==="unknown")return!0;let ce=x.isVirtualLocator(O),he=ce?x.devirtualizeLocator(O):O;return!(ue&&ce&&A.reference!==O.reference||te.reference!==he.reference)}}),X=me.sortMap([...q],Z=>x.stringifyLocator(Z));return{selection:X.filter(Z=>_.length===0||_.some(A=>A(Z))),sortedLookup:X}},{selection:g,sortedLookup:h}=u({all:this.all,recursive:this.recursive});if(g.length===0)throw new we("No package matched your request");let p=new Map;if(this.dependents)for(let F of h)for(let H of F.dependencies.values()){let q=i.storedResolutions.get(H.descriptorHash);if(typeof q>"u")throw new Error("Assertion failed: Expected the resolution to be registered");me.getArrayWithDefault(p,q).push(F)}let d=new Map;for(let F of h){if(!x.isVirtualLocator(F))continue;let H=x.devirtualizeLocator(F);me.getArrayWithDefault(d,H.locatorHash).push(F)}let m={},y={children:m},B=t.makeFetcher(),S={project:i,fetcher:B,cache:s,checksums:i.storedChecksums,report:new $r,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},P=[async(F,H,q)=>{var W,Z;if(!H.has("manifest"))return;let _=await B.fetch(F,S),X;try{X=await ot.find(_.prefixPath,{baseFs:_.packageFs})}finally{(W=_.releaseFs)==null||W.call(_)}q("Manifest",{License:$.tuple($.Type.NO_HINT,X.license),Homepage:$.tuple($.Type.URL,(Z=X.raw.homepage)!=null?Z:null)})},async(F,H,q)=>{var ne;if(!H.has("cache"))return;let _={mockedPackages:i.disabledLocators,unstablePackages:i.conditionalLocators},X=(ne=i.storedChecksums.get(F.locatorHa
2024-10-01 04:19:50 +02:00
This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:
- **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).
- **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where the cache files are stored).
- **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the .pnp.cjs file you might know).
- **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.
Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your .pnp.cjs file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.
If the \`--immutable\` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the \`immutablePatterns\` configuration setting). For backward compatibility we offer an alias under the name of \`--frozen-lockfile\`, but it will be removed in a later release.
If the \`--immutable-cache\` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).
If the \`--check-cache\` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.
If the \`--inline-builds\` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
2024-10-01 04:49:34 +02:00
`,examples:[["Install the project","$0 install"],["Validate a project when using Zero-Installs","$0 install --immutable --immutable-cache"],["Validate a project when using Zero-Installs (slightly safer if you accept external PRs)","$0 install --immutable --immutable-cache --check-cache"]]});var UWe="|||||||",HWe=">>>>>>>",jWe="=======",mae="<<<<<<<";async function GWe(r,e){if(!r.projectCwd)return!1;let t=v.join(r.projectCwd,r.get("lockfileFilename"));if(!await M.existsPromise(t))return!1;let i=await M.readFilePromise(t,"utf8");if(!i.includes(mae))return!1;if(e)throw new rt(47,"Cannot autofix a lockfile when running an immutable install");let[n,s]=YWe(i),o,a;try{o=wi(n),a=wi(s)}catch{throw new rt(46,"The individual variants of the lockfile failed to parse")}let l={...o,...a};for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await M.changeFilePromise(t,ba(l),{automaticNewlines:!0}),!0}function YWe(r){let e=[[],[]],t=r.split(/\r?\n/g),i=!1;for(;t.length>0;){let n=t.shift();if(typeof n>"u")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(mae)){for(;t.length>0;){let s=t.shift();if(typeof s>"u")throw new Error("Assertion failed: Some lines should remain");if(s===jWe){i=!1;break}else if(i||s.startsWith(UWe)){i=!0;continue}else e[0].push(s)}for(;t.length>0;){let s=t.shift();if(typeof s>"u")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(HWe))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
2024-10-01 04:19:50 +02:00
`),e[1].join(`
2024-10-01 04:49:34 +02:00
`)]}var Qu=class extends xe{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target projects to the current one"});this.private=z.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target projects to the current one"});this.relative=z.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destinations=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState({restoreResolutions:!1});let o=i.topLevelWorkspace,a=[];for(let c of this.destinations){let u=v.resolve(this.context.cwd,K.toPortablePath(c)),g=await Ee.find(u,this.context.plugins,{useRc:!1,strict:!1}),{project:h,workspace:p}=await Ge.find(g,u);if(i.cwd===h.cwd)throw new we(`Invalid destination '${c}'; Can't link the project to itself`);if(!p)throw new lt(h.cwd,u);if(this.all){let d=!1;for(let m of h.workspaces)m.manifest.name&&(!m.manifest.private||this.private)&&(a.push(m),d=!0);if(!d)throw new we(`No workspace found to be linked in the target project: ${c}`)}else{if(!p.manifest.name)throw new we(`The target workspace at '${c}' doesn't have a name and thus cannot be linked`);if(p.manifest.private&&!this.private)throw new we(`The target workspace at '${c}' is marked private - use the --private flag to link it anyway`);a.push(p)}}for(let c of a){let u=x.stringifyIdent(c.locator),g=this.relative?v.relative(i.cwd,c.cwd):c.cwd;o.manifest.resolutions.push({pattern:{descriptor:{fullName:u}},reference:`portal:${g}`})}return(await He.start({configuration:t,stdout:this.context.stdout},async c=>{await i.install({cache:s,report:c})})).exitCode()}};Qu.paths=[["link"]],Qu.usage=be.Usage({description:"connect the local project to another one",details:"\n This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\n ",examples:[["Register one or more remote workspaces for use in the current project","$0 link ~/ts-loader ~/jest"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var bu=class extends xe{constructor(){super(...arguments);this.args=z.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};bu.paths=[["node"]],bu.usage=be.Usage({description:"run node with the hook already setup",details:`
2024-10-01 04:19:50 +02:00
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
2024-10-01 04:49:34 +02:00
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Qae=J("os");var Eae=J("os");var qWe="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function vu(r){let e=await Vt.get(qWe,{configuration:r});return wi(e.toString())}var Su=class extends xe{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins);return(await He.start({configuration:t,json:this.json,stdout:this.context.stdout},async n=>{let s=await vu(t);for(let[o,{experimental:a,...l}]of Object.entries(s)){let c=o;a&&(c+=" [experimental]"),n.reportJson({name:o,experimental:a,...l}),n.reportInfo(null,c)}})).exitCode()}};Su.paths=[["plugin","list"]],Su.usage=be.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var JWe=/^[0-9]+$/;function Iae(r){return JWe.test(r)?`pull/${r}/head`:r}var WWe=({repository:r,branch:e},t)=>[["git","init",K.fromPortablePath(t)],["git","remote","add","origin",r],["git","fetch","origin","--depth=1",Iae(e)],["git","reset","--hard","FETCH_HEAD"]],zWe=({branch:r})=>[["git","fetch","origin","--depth=1",Iae(r),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],VWe=({plugins:r,noMinify:e},t)=>[["yarn","build:cli",...new Array().concat(...r.map(i=>["--plugin",v.resolve(t,i)])),...e?["--no-minify"]:[],"|"]],xu=class extends xe{constructor(){super(...arguments);this.installPath=z.String("--path",{description:"The path where the repository should be cloned to"});this.repository=z.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=z.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=z.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=z.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=z.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=z.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i}=await Ge.find(t,this.context.cwd),n=typeof this.installPath<"u"?v.resolve(this.context.cwd,K.toPortablePath(this.installPath)):v.resolve(K.toPortablePath((0,Eae.tmpdir)()),"yarnpkg-sources",Ai.makeHash(this.repository).slice(0,6));return(await He.start({configuration:t,stdout:this.context.stdout},async o=>{await tO(this,{configuration:t,report:o,target:n}),o.reportSeparator(),o.reportInfo(0,"Building a fresh bundle"),o.reportSeparator(),await zm(VWe(this,n),{configuration:t,context:this.context,target:n}),o.reportSeparator();let a=v.resolve(n,"packages/yarnpkg-cli/bundles/yarn.js"),l=await M.readFilePromise(a);await eO(t,"sources",l,{report:o}),this.skipPlugins||await XWe(this,{project:i,report:o,target:n})})).exitCode()}};xu.paths=[["set","version","from","sources"]],xu.usage=be.Usage({description:"build Yarn from master",details:`
2024-10-01 04:19:50 +02:00
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
`,examples:[["Build Yarn from master","$0 set version from sources"]]});async function zm(r,{configuration:e,context:t,target:i}){for(let[n,...s]of r){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await pr.pipevp(n,s,{cwd:i,stdin:t.stdin,stdout:t.stdout,stderr:t.stderr,strict:!0});else{t.stdout.write(`${$.pretty(e,` $ ${[n,...s].join(" ")}`,"grey")}
2024-10-01 04:49:34 +02:00
`);try{await pr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw t.stdout.write(a.stdout||a.stack),a}}}}async function tO(r,{configuration:e,report:t,target:i}){let n=!1;if(!r.force&&M.existsSync(v.join(i,".git"))){t.reportInfo(0,"Fetching the latest commits"),t.reportSeparator();try{await zm(zWe(r),{configuration:e,context:r.context,target:i}),n=!0}catch{t.reportSeparator(),t.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}n||(t.reportInfo(0,"Cloning the remote repository"),t.reportSeparator(),await M.removePromise(i),await M.mkdirPromise(i,{recursive:!0}),await zm(WWe(r,i),{configuration:e,context:r.context,target:i}))}async function XWe(r,{project:e,report:t,target:i}){let n=await vu(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await rO(o,r,{project:e,report:t,target:i})}var yae=ve(zr()),wae=J("url"),Bae=J("vm");var Pu=class extends xe{constructor(){super(...arguments);this.name=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins);return(await He.start({configuration:t,stdout:this.context.stdout},async n=>{let{project:s}=await Ge.find(t,this.context.cwd),o,a;if(this.name.match(/^\.{0,2}[\\/]/)||K.isAbsolute(this.name)){let l=v.resolve(this.context.cwd,K.toPortablePath(this.name));n.reportInfo(0,`Reading ${$.pretty(t,l,$.Type.PATH)}`),o=v.relative(s.cwd,l),a=await M.readFilePromise(l)}else{let l;if(this.name.match(/^https?:/)){try{new wae.URL(this.name)}catch{throw new rt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}o=this.name,l=this.name}else{let c=x.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(c.reference!=="unknown"&&!yae.default.valid(c.reference))throw new rt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let u=x.stringifyIdent(c),g=await vu(t);if(!Object.prototype.hasOwnProperty.call(g,u))throw new rt(51,`Couldn't find a plugin named "${u}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be referenced by their name; any other plugin will have to be referenced through its public url (for example https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js).`);o=u,l=g[u].url,c.reference!=="unknown"?l=l.replace(/\/master\//,`/${u}/${c.reference}/`):Nr!==null&&(l=l.replace(/\/master\//,`/@yarnpkg/cli/${Nr}/`))}n.reportInfo(0,`Downloading ${$.pretty(t,l,"green")}`),a=await Vt.get(l,{configuration:t})}await iO(o,a,{project:s,report:n})})).exitCode()}};Pu.paths=[["plugin","import"]],Pu.usage=be.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
2024-10-01 04:19:50 +02:00
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
Three types of plugin references are accepted:
- If the plugin is stored within the Yarn repository, it can be referenced by name.
- Third-party plugins can be referenced directly through their public urls.
- Local plugins can be referenced by their path on the disk.
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
2024-10-01 04:49:34 +02:00
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]});async function iO(r,e,{project:t,report:i}){let{configuration:n}=t,s={},o={exports:s};(0,Bae.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=v.resolve(t.cwd,l);i.reportInfo(0,`Saving the new plugin in ${$.pretty(n,l,"magenta")}`),await M.mkdirPromise(v.dirname(c),{recursive:!0}),await M.writeFilePromise(c,e);let u={path:l,spec:r};await Ee.updateConfiguration(t.cwd,g=>{let h=[],p=!1;for(let d of g.plugins||[]){let m=typeof d!="string"?d.path:d,y=v.resolve(t.cwd,K.toPortablePath(m)),{name:B}=me.dynamicRequire(y);B!==a?h.push(d):(h.push(u),p=!0)}return p||h.push(u),{...g,plugins:h}})}var ZWe=({pluginName:r,noMinify:e},t)=>[["yarn",`build:${r}`,...e?["--no-minify"]:[],"|"]],ku=class extends xe{constructor(){super(...arguments);this.installPath=z.String("--path",{description:"The path where the repository should be cloned to"});this.repository=z.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=z.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=z.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=z.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=typeof this.installPath<"u"?v.resolve(this.context.cwd,K.toPortablePath(this.installPath)):v.resolve(K.toPortablePath((0,Qae.tmpdir)()),"yarnpkg-sources",Ai.makeHash(this.repository).slice(0,6));return(await He.start({configuration:t,stdout:this.context.stdout},async s=>{let{project:o}=await Ge.find(t,this.context.cwd),a=x.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),l=x.stringifyIdent(a),c=await vu(t);if(!Object.prototype.hasOwnProperty.call(c,l))throw new rt(51,`Couldn't find a plugin named "${l}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let u=l;await tO(this,{configuration:t,report:s,target:i}),await rO(u,this,{project:o,report:s,target:i})})).exitCode()}};ku.paths=[["plugin","import","from","sources"]],ku.usage=be.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
2024-10-01 04:19:50 +02:00
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
The plugins can be referenced by their short name if sourced from the official Yarn repository.
2024-10-01 04:49:34 +02:00
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]});async function rO(r,{context:e,noMinify:t},{project:i,report:n,target:s}){let o=r.replace(/@yarnpkg\//,""),{configuration:a}=i;n.reportSeparator(),n.reportInfo(0,`Building a fresh ${o}`),n.reportSeparator(),await zm(ZWe({pluginName:o,noMinify:t},s),{configuration:a,context:e,target:s}),n.reportSeparator();let l=v.resolve(s,`packages/${o}/bundles/${r}.js`),c=await M.readFilePromise(l);await iO(r,c,{project:i,report:n})}var Du=class extends xe{constructor(){super(...arguments);this.name=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i}=await Ge.find(t,this.context.cwd);return(await He.start({configuration:t,stdout:this.context.stdout},async s=>{let o=this.name,a=x.parseIdent(o);if(!t.plugins.has(o))throw new we(`${x.prettyIdent(t,a)} isn't referenced by the current configuration`);let l=`.yarn/plugins/${o}.cjs`,c=v.resolve(i.cwd,l);M.existsSync(c)&&(s.reportInfo(0,`Removing ${$.pretty(t,l,$.Type.PATH)}...`),await M.removePromise(c)),s.reportInfo(0,"Updating the configuration..."),await Ee.updateConfiguration(i.cwd,u=>{if(!Array.isArray(u.plugins))return u;let g=u.plugins.filter(h=>h.path!==l);return u.plugins.length===g.length?u:{...u,plugins:g}})})).exitCode()}};Du.paths=[["plugin","remove"]],Du.usage=be.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
2024-10-01 04:19:50 +02:00
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]});var Ru=class extends xe{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins);return(await He.start({configuration:t,json:this.json,stdout:this.context.stdout},async n=>{for(let s of t.plugins.keys()){let o=this.context.plugins.plugins.has(s),a=s;o&&(a+=" [builtin]"),n.reportJson({name:s,builtin:o}),n.reportInfo(null,`${a}`)}})).exitCode()}};Ru.paths=[["plugin","runtime"]],Ru.usage=be.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
2024-10-01 04:49:34 +02:00
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var Fu=class extends xe{constructor(){super(...arguments);this.idents=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);let o=new Set;for(let l of this.idents)o.add(x.parseIdent(l).identHash);if(await i.restoreInstallState({restoreResolutions:!1}),await i.resolveEverything({cache:s,report:new $r}),o.size>0)for(let l of i.storedPackages.values())o.has(l.identHash)&&i.storedBuildState.delete(l.locatorHash);else i.storedBuildState.clear();return(await He.start({configuration:t,stdout:this.context.stdout,includeLogs:!this.context.quiet},async l=>{await i.install({cache:s,report:l})})).exitCode()}};Fu.paths=[["rebuild"]],Fu.usage=be.Usage({description:"rebuild the project's native packages",details:`
2024-10-01 04:19:50 +02:00
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
2024-10-01 04:49:34 +02:00
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var nO=ve(Qn());As();var Nu=class extends xe{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:Zi(ts)});this.patterns=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState({restoreResolutions:!1});let o=this.all?i.workspaces:[n],a=["dependencies","devDependencies","peerDependencies"],l=[],c=!1,u=[];for(let d of this.patterns){let m=!1,y=x.parseIdent(d);for(let B of o){let S=[...B.manifest.peerDependenciesMeta.keys()];for(let P of(0,nO.default)(S,d))B.manifest.peerDependenciesMeta.delete(P),c=!0,m=!0;for(let P of a){let F=B.manifest.getForScope(P),H=[...F.values()].map(q=>x.stringifyIdent(q));for(let q of(0,nO.default)(H,x.stringifyIdent(y))){let{identHash:_}=x.parseIdent(q),X=F.get(_);if(typeof X>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");B.manifest[P].delete(_),u.push([B,P,X]),c=!0,m=!0}}}m||l.push(d)}let g=l.length>1?"Patterns":"Pattern",h=l.length>1?"don't":"doesn't",p=this.all?"any":"this";if(l.length>0)throw new we(`${g} ${$.prettyList(t,l,$.Type.CODE)} ${h} match any packages referenced by ${p} workspace`);return c?(await t.triggerMultipleHooks(m=>m.afterWorkspaceDependencyRemoval,u),(await He.start({configuration:t,stdout:this.context.stdout},async m=>{await i.install({cache:s,report:m,mode:this.mode})})).exitCode()):0}};Nu.paths=[["remove"]],Nu.usage=be.Usage({description:"remove dependencies from the project",details:`
2024-10-01 04:19:50 +02:00
This command will remove the packages matching the specified patterns from the current workspace.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
2024-10-01 04:49:34 +02:00
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]});var bae=J("util"),_h=class extends xe{async execute(){let e=await Ee.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await Ge.find(e,this.context.cwd);if(!i)throw new lt(t.cwd,this.context.cwd);return(await He.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=me.sortMap(o.keys(),u=>u),l={breakLength:1/0,colors:e.get("enableColors"),maxArrayLength:2},c=a.reduce((u,g)=>Math.max(u,g.length),0);for(let[u,g]of o.entries())s.reportInfo(null,`${u.padEnd(c," ")} ${(0,bae.inspect)(g,l)}`)})).exitCode()}};_h.paths=[["run"]];var Tu=class extends xe{constructor(){super(...arguments);this.inspect=z.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=z.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=z.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=z.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=z.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=z.Boolean("--silent",{hidden:!0});this.scriptName=z.String();this.args=z.Proxy()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n,locator:s}=await Ge.find(t,this.context.cwd);await i.restoreInstallState();let o=this.topLevel?i.topLevelWorkspace.anchoredLocator:s;if(!this.binariesOnly&&await Yt.hasPackageScript(o,this.scriptName,{project:i}))return await Yt.executePackageScript(o,this.scriptName,this.args,{project:i,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let a=await Yt.getPackageAccessibleBinaries(o,{project:i});if(a.get(this.scriptName)){let c=[];return this.inspect&&(typeof this.inspect=="string"?c.push(`--inspect=${this.inspect}`):c.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?c.push(`--inspect-brk=${this.inspectBrk}`):c.push("--inspect-brk")),this.require&&c.push(`--require=${this.require}`),await Yt.executePackageAccessibleBinary(o,this.scriptName,this.args,{cwd:this.context.cwd,project:i,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:c,packageAccessibleBinaries:a})}if(!this.topLevel&&!this.binariesOnly&&n&&this.scriptName.includes(":")){let u=(await Promise.all(i.workspaces.map(async g=>g.manifest.scripts.has(this.scriptName)?g:null))).filter(g=>g!==null);if(u.length===1)return await Yt.executeWorkspaceScript(u[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new we(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${x.prettyLocator(t,s)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new we(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${x.prettyLocator(t,s)}).`);{if(this.scriptName==="global")throw new we("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let c=[this.scriptName].concat(this.args);for(let[u,g]of vh)for(let h of g)if(c.length>=h.length&&JSON.
2024-10-01 04:19:50 +02:00
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
2024-10-01 04:49:34 +02:00
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]});var Lu=class extends xe{constructor(){super(...arguments);this.save=z.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=z.String();this.resolution=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(await i.restoreInstallState({restoreResolutions:!1}),!n)throw new lt(i.cwd,this.context.cwd);let o=x.parseDescriptor(this.descriptor,!0),a=x.makeDescriptor(o,this.resolution);return i.storedDescriptors.set(o.descriptorHash,o),i.storedDescriptors.set(a.descriptorHash,a),i.resolutionAliases.set(o.descriptorHash,a.descriptorHash),(await He.start({configuration:t,stdout:this.context.stdout},async c=>{await i.install({cache:s,report:c})})).exitCode()}};Lu.paths=[["set","resolution"]],Lu.usage=be.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, add the `-s,--save` flag which will also edit the `resolutions` field from your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]});var Sae=ve(Qn()),Ou=class extends xe{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);let o=i.topLevelWorkspace,a=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:c,reference:u}of o.manifest.resolutions)u.startsWith("portal:")&&a.add(c.descriptor.fullName);if(this.leadingArguments.length>0)for(let c of this.leadingArguments){let u=v.resolve(this.context.cwd,K.toPortablePath(c));if(me.isPathLike(c)){let g=await Ee.find(u,this.context.plugins,{useRc:!1,strict:!1}),{project:h,workspace:p}=await Ge.find(g,u);if(!p)throw new lt(h.cwd,u);if(this.all){for(let d of h.workspaces)d.manifest.name&&a.add(x.stringifyIdent(d.locator));if(a.size===0)throw new we("No workspace found to be unlinked in the target project")}else{if(!p.manifest.name)throw new we("The target workspace doesn't have a name and thus cannot be unlinked");a.add(x.stringifyIdent(p.locator))}}else{let g=[...o.manifest.resolutions.map(({pattern:h})=>h.descriptor.fullName)];for(let h of(0,Sae.default)(g,c))a.add(h)}}return o.manifest.resolutions=o.manifest.resolutions.filter(({pattern:c})=>!a.has(c.descriptor.fullName)),(await He.start({configuration:t,stdout:this.context.stdout},async c=>{await i.install({cache:s,report:c})})).exitCode()}};Ou.paths=[["unlink"]],Ou.usage=be.Usage({description:"disconnect the local project from another one",details:`
2024-10-01 04:19:50 +02:00
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
2024-10-01 04:49:34 +02:00
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]});var vae=ve(Um()),sO=ve(Qn());As();var ml=class extends xe{constructor(){super(...arguments);this.interactive=z.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=z.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=z.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=z.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=z.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=z.String("--mode",{description:"Change what artifacts installs generate",validator:Zi(ts)});this.patterns=z.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState({restoreResolutions:!1});let o=[...i.storedDescriptors.values()],a=o.map(g=>x.stringifyIdent(g)),l=new Set;for(let g of this.patterns){if(x.parseDescriptor(g).range!=="unknown")throw new we("Ranges aren't allowed when using --recursive");for(let h of(0,sO.default)(a,g)){let p=x.parseIdent(h);l.add(p.identHash)}}let c=o.filter(g=>l.has(g.identHash));for(let g of c)i.storedDescriptors.delete(g.descriptorHash),i.storedResolutions.delete(g.descriptorHash);return(await He.start({configuration:t,stdout:this.context.stdout},async g=>{await i.install({cache:s,report:g})})).exitCode()}async executeUpClassic(){var y;let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd),s=await Dt.find(t);if(!n)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState({restoreResolutions:!1});let o=(y=this.interactive)!=null?y:t.get("preferInteractive"),a=jm(this,i),l=o?["keep","reuse","project","latest"]:["project","latest"],c=[],u=[];for(let B of this.patterns){let S=!1,P=x.parseDescriptor(B);for(let F of i.workspaces)for(let H of["dependencies","devDependencies"]){let _=[...F.manifest.getForScope(H).values()].map(X=>x.stringifyIdent(X));for(let X of(0,sO.default)(_,x.stringifyIdent(P))){let W=x.parseIdent(X),Z=F.manifest[H].get(W.identHash);if(typeof Z>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let A=x.makeDescriptor(W,P.range);c.push(Promise.resolve().then(async()=>[F,H,Z,await Gm(A,{project:i,workspace:F,cache:s,target:H,modifier:a,strategies:l})])),S=!0}}S||u.push(B)}if(u.length>1)throw new we(`Patterns ${$.prettyList(t,u,$.Type.CODE)} don't match any packages referenced by any workspace`);if(u.length>0)throw new we(`Pattern ${$.prettyList(t,u,$.Type.CODE)} doesn't match any packages referenced by any workspace`);let g=await Promise.all(c),h=await ta.start({configuration:t,stdout:this.context.stdout,suggestInstall:!1},async B=>{for(let[,,S,{suggestions:P,rejections:F}]of g){let H=P.filter(q=>q.descriptor!==null);if(H.length===0){let[q]=F;if(typeof q>"u")throw new Error("Assertion failed: Expected an error to have been set");let _=this.cli.error(q);i.configuration.get("enableNetwork")?B.reportError(27,`${x.prettyDescriptor(t,S)} can't be resolved to a satisfying range
2024-10-01 04:19:50 +02:00
${_}`):B.reportError(27,`${x.prettyDescriptor(t,S)} can't be resolved to a satisfying range (note: network resolution has been disabled)
${_}`)}else H.length>1&&!o&&B.reportError(27,`${x.prettyDescriptor(t,S)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(h.hasErrors())return h.exitCode();let p=!1,d=[];for(let[B,S,,{suggestions:P}]of g){let F,H=P.filter(W=>W.descriptor!==null),q=H[0].descriptor,_=H.every(W=>x.areDescriptorsEqual(W.descriptor,q));H.length===1||_?F=q:(p=!0,{answer:F}=await(0,vae.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${x.prettyWorkspace(t,B)} \u276F ${S}?`,choices:P.map(({descriptor:W,name:Z,reason:A})=>W?{name:Z,hint:A,descriptor:W}:{name:Z,hint:A,disabled:!0}),onCancel:()=>process.exit(130),result(W){return this.find(W,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let X=B.manifest[S].get(F.identHash);if(typeof X>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(X.descriptorHash!==F.descriptorHash)B.manifest[S].set(F.identHash,F),d.push([B,S,X,F]);else{let W=t.makeResolver(),Z={project:i,resolver:W},A=W.bindDescriptor(X,B.anchoredLocator,Z);i.forgetResolution(A)}}return await t.triggerMultipleHooks(B=>B.afterWorkspaceDependencyReplacement,d),p&&this.context.stdout.write(`
2024-10-01 04:49:34 +02:00
`),(await He.start({configuration:t,stdout:this.context.stdout},async B=>{await i.install({cache:s,report:B,mode:this.mode})})).exitCode()}};ml.paths=[["up"]],ml.usage=be.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]}),ml.schema=[av("recursive",uc.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var Mu=class extends xe{constructor(){super(...arguments);this.recursive=z.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=z.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plu
2024-10-01 04:19:50 +02:00
This command prints the exact reasons why a package appears in the dependency tree.
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
2024-10-01 04:49:34 +02:00
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});function _We(r,e,{configuration:t,peers:i}){let n=me.sortMap(r.storedPackages.values(),a=>x.stringifyLocator(a)),s={},o={children:s};for(let a of n){let l={};for(let u of a.dependencies.values()){if(!i&&a.peerDependencies.has(u.identHash))continue;let g=r.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let h=r.storedPackages.get(g);if(!h)throw new Error("Assertion failed: The package should have been registered");if(h.identHash!==e)continue;{let d=x.stringifyLocator(a);s[d]={value:[a,$.Type.LOCATOR],children:l}}let p=x.stringifyLocator(h);l[p]={value:[{descriptor:u,locator:h},$.Type.DEPENDENT]}}}return o}function $We(r,e,{configuration:t,peers:i}){let n=me.sortMap(r.workspaces,h=>x.stringifyLocator(h.anchoredLocator)),s=new Set,o=new Set,a=h=>{if(s.has(h.locatorHash))return o.has(h.locatorHash);if(s.add(h.locatorHash),h.identHash===e)return o.add(h.locatorHash),!0;let p=!1;h.identHash===e&&(p=!0);for(let d of h.dependencies.values()){if(!i&&h.peerDependencies.has(d.identHash))continue;let m=r.storedResolutions.get(d.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let y=r.storedPackages.get(m);if(!y)throw new Error("Assertion failed: The package should have been registered");a(y)&&(p=!0)}return p&&o.add(h.locatorHash),p};for(let h of n){let p=r.storedPackages.get(h.anchoredLocator.locatorHash);if(!p)throw new Error("Assertion failed: The package should have been registered");a(p)}let l=new Set,c={},u={children:c},g=(h,p,d)=>{if(!o.has(h.locatorHash))return;let m=d!==null?$.tuple($.Type.DEPENDENT,{locator:h,descriptor:d}):$.tuple($.Type.LOCATOR,h),y={},B={value:m,children:y},S=x.stringifyLocator(h);if(p[S]=B,!l.has(h.locatorHash)&&(l.add(h.locatorHash),!(d!==null&&r.tryWorkspaceByLocator(h))))for(let P of h.dependencies.values()){if(!i&&h.peerDependencies.has(P.identHash))continue;let F=r.storedResolutions.get(P.descriptorHash);if(!F)throw new Error("Assertion failed: The resolution should have been registered");let H=r.storedPackages.get(F);if(!H)throw new Error("Assertion failed: The package should have been registered");g(H,y,P)}};for(let h of n){let p=r.storedPackages.get(h.anchoredLocator.locatorHash);if(!p)throw new Error("Assertion failed: The package should have been registered");g(p,c,null)}return u}var dO={};ct(dO,{default:()=>E8e,gitUtils:()=>lA});var lA={};ct(lA,{TreeishProtocols:()=>TQ,clone:()=>pO,fetchBase:()=>Xae,fetchChangedFiles:()=>Zae,fetchChangedWorkspaces:()=>C8e,fetchRoot:()=>Vae,isGitUrl:()=>ep,lsRemote:()=>zae,normalizeLocator:()=>gO,normalizeRepoUrl:()=>LQ,resolveUrl:()=>hO,splitRepoUrl:()=>Vm,validateRepoUrl:()=>fO});var qae=ve(Hae()),Jae=ve(xB()),$h=ve(J("querystring")),cO=ve(zr());var Gae=J("url");function lO(r,e,t){let i=r.indexOf(t);return r.lastIndexOf(e,i>-1?i:1/0)}function jae(r){try{return new Gae.URL(r)}catch{return}}function p8e(r){let e=lO(r,"@","#"),t=lO(r,":","#");return t>e&&(r=`${r.slice(0,t)}/${r.slice(t+1)}`),lO(r,":","#")===-1&&r.indexOf("//")===-1&&(r=`ssh://${r}`),r}function Yae(r){return jae(r)||jae(p8e(r))}function Wae(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var d8e=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],TQ=(n=>(n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver",n))(TQ||{});function ep(r){return r?d8e.some(e=>!!r.match(e)):!1}function Vm(r){r=LQ(r);let e=r.indexOf("#");if(e===-1)return{repo:r,treeish:{protocol:"head",request:"HEAD"},extra:{}};let t=r.slice(0,e),i=r.slice(e+1);if(i.match(/^[a-z]+=/)){let n=$h.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof
2024-10-01 04:19:50 +02:00
- ${l.join(`
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:a.cwd})}};Uu.paths=[["workspace"]],Uu.usage=be.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
This command will run a given sub-command on a single workspace.
2024-10-01 04:49:34 +02:00
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]});var I8e={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:_ae.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[gu,fu,hu,pu,Lu,xu,Iu,Ku,Vh,Xh,Jm,Zh,cu,uu,du,Cu,mu,Eu,yu,wu,Bu,Qu,Ou,bu,ku,Pu,Du,Su,Ru,Fu,Nu,_h,Tu,ml,Mu,Uu]},y8e=I8e;var wO={};ct(wO,{default:()=>B8e});var Fe={optional:!0},mO=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Fe,zenObservable:Fe}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Fe,zenObservable:Fe}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Fe}}],["got@<11",{dependencies:{["@types/responselike"]:"^1.0.0",["@types/keyv"]:"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{["@types/keyv"]:"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{["vscode-jsonrpc"]:"^5.0.1",["vscode-languageserver-protocol"]:"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{["postcss-html"]:Fe,["postcss-jsx"]:Fe,["postcss-less"]:Fe,["postcss-markdown"]:Fe,["postcss-scss"]:Fe}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{["tiny-warning"]:"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Fe}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Fe}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Fe,"vue-template-compiler":Fe}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:Fe,"utf-8-validate":Fe}}],["react-portal@<4.2.2",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{["babel-polyfill"]:"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{["
2024-10-01 04:19:50 +02:00
`),await M.writeFilePromise(v.join(i,"yarn.lock"),"");let n=v.join(i,".yarnrc.yml"),s=await Ee.findProjectCwd(this.context.cwd,St.lockfile),o=!(await Ee.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),a=s!==null?v.join(s,".yarnrc.yml"):null;a!==null&&M.existsSync(a)?(await M.copyFilePromise(a,n),await Ee.updateConfiguration(i,y=>{let B={...y,enableGlobalCache:o,enableTelemetry:!1};return Array.isArray(y.plugins)&&(B.plugins=y.plugins.map(S=>{let P=typeof S=="string"?S:S.path,F=K.isAbsolute(P)?P:K.resolve(K.fromPortablePath(s),P);return typeof S=="string"?F:{path:F,spec:S.spec}})),B})):await M.writeFilePromise(n,`enableGlobalCache: ${o}
enableTelemetry: false
`);let l=(m=this.packages)!=null?m:[this.command],c=x.parseDescriptor(this.command).name,u=await this.cli.run(["add","--",...l],{cwd:i,quiet:this.quiet});if(u!==0)return u;this.quiet||this.context.stdout.write(`
2024-10-01 04:49:34 +02:00
`);let g=await Ee.find(i,this.context.plugins),{project:h,workspace:p}=await Ge.find(g,i);if(p===null)throw new lt(h.cwd,i);await h.restoreInstallState();let d=await Yt.getWorkspaceAccessibleBinaries(p);return d.has(c)===!1&&d.size===1&&typeof this.packages>"u"&&(c=Array.from(d)[0][0]),await Yt.executeWorkspaceAccessibleBinary(p,c,this.args,{packageAccessibleBinaries:d,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};Hu.paths=[["dlx"]],Hu.usage=be.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]});var Q8e={commands:[tp,Hu]},b8e=Q8e;var vO={};ct(vO,{default:()=>x8e,fileUtils:()=>Zm});var rp=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Xm=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,jr="file:";var Zm={};ct(Zm,{makeArchiveFromLocator:()=>KQ,makeBufferFromLocator:()=>SO,makeLocator:()=>bO,makeSpec:()=>iAe,parseSpec:()=>QO});function QO(r){let{params:e,selector:t}=x.parseRange(r),i=K.toPortablePath(t);return{parentLocator:e&&typeof e.locator=="string"?x.parseLocator(e.locator):null,path:i}}function iAe({parentLocator:r,path:e,folderHash:t,protocol:i}){let n=r!==null?{locator:x.stringifyLocator(r)}:{},s=typeof t<"u"?{hash:t}:{};return x.makeRange({protocol:i,source:e,selector:e,params:{...s,...n}})}function bO(r,{parentLocator:e,path:t,folderHash:i,protocol:n}){return x.makeLocator(r,iAe({parentLocator:e,path:t,folderHash:i,protocol:n}))}async function KQ(r,{protocol:e,fetchOptions:t,inMemory:i=!1}){let{parentLocator:n,path:s}=x.parseFileStyleRange(r.reference,{protocol:e}),o=v.isAbsolute(s)?{packageFs:new jt(Te.root),prefixPath:Te.dot,localPath:Te.root}:await t.fetcher.fetch(n,t),a=o.localPath?{packageFs:new jt(Te.root),prefixPath:v.relative(Te.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=v.join(a.prefixPath,s);return await me.releaseAfterUseAsync(async()=>await Ci.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:x.getIdentVendorPath(r),compressionLevel:t.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function SO(r,{protocol:e,fetchOptions:t}){return(await KQ(r,{protocol:e,fetchOptions:t,inMemory:!0})).getBufferAndClose()}var UQ=class{supports(e,t){return!!e.reference.startsWith(jr)}getLocalPath(e,t){let{parentLocator:i,path:n}=x.parseFileStyleRange(e.reference,{protocol:jr});if(v.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:v.resolve(s,n)}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,{onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${x.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,t),skipIntegrityCheck:t.skipIntegrityCheck,...t.cacheOptions});return{packageFs:n,releaseFs:s,prefixPath:x.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async fetchFromDisk(e,t){return KQ(e,{protocol:jr,fetchOptions:t})}};var S8e=2,HQ=class{supportsDescriptor(e,t){return e.range.match(rp)?!0:!!e.range.startsWith(jr)}supportsLocator(e,t){return!!e.reference.startsWith(jr)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return rp.test(e.range)&&(e=x.m
2024-10-01 04:19:50 +02:00
`);let a=v.join(this.context.cwd,ot.fileName);await M.changeFilePromise(a,`${JSON.stringify(o,null,2)}
`,{automaticNewlines:!0});let l=v.join(this.context.cwd,"README.md");if(M.existsSync(l)||await M.writeFilePromise(l,`# ${x.stringifyIdent(n.name)}
`),!i||i.cwd===this.context.cwd){let u=v.join(this.context.cwd,St.lockfile);M.existsSync(u)||await M.writeFilePromise(u,"");let h=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you don't wish to use zero-installs","# Documentation here: https://yarnpkg.com/features/zero-installs","!.yarn/cache","#.pnp.*"].map(F=>`${F}
`).join(""),p=v.join(this.context.cwd,".gitignore");M.existsSync(p)||await M.writeFilePromise(p,h);let m=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(F=>`${F}
2024-10-01 04:49:34 +02:00
`).join(""),y=v.join(this.context.cwd,".gitattributes");M.existsSync(y)||await M.writeFilePromise(y,m);let B={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};(0,NAe.default)(B,t.get("initEditorConfig"));let S=`root = true
2024-10-01 04:19:50 +02:00
`;for(let[F,H]of Object.entries(B)){S+=`
[${F}]
`;for(let[q,_]of Object.entries(H)){let X=q.replace(/[A-Z]/g,W=>`_${W.toLowerCase()}`);S+=`${X} = ${_}
2024-10-01 04:49:34 +02:00
`}}let P=v.join(this.context.cwd,".editorconfig");M.existsSync(P)||await M.writeFilePromise(P,S),M.existsSync(v.join(this.context.cwd,".git"))||await pr.execvp("git",["init"],{cwd:this.context.cwd})}}};ju.paths=[["init"]],ju.usage=be.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]});var N4e={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[ju]},T4e=N4e;var NO={};ct(NO,{default:()=>O4e});var cA="portal:",uA="link:";var WQ=class{supports(e,t){return!!e.reference.startsWith(cA)}getLocalPath(e,t){let{parentLocator:i,path:n}=x.parseFileStyleRange(e.reference,{protocol:cA});if(v.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:v.resolve(s,n)}async fetch(e,t){var c;let{parentLocator:i,path:n}=x.parseFileStyleRange(e.reference,{protocol:cA}),s=v.isAbsolute(n)?{packageFs:new jt(Te.root),prefixPath:Te.dot,localPath:Te.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new jt(Te.root),prefixPath:v.relative(Te.root,s.localPath),localPath:Te.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=v.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new jt(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Te.dot,localPath:l}:{packageFs:new So(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Te.dot}}};var zQ=class{supportsDescriptor(e,t){return!!e.range.startsWith(cA)}supportsLocator(e,t){return!!e.reference.startsWith(cA)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return x.bindDescriptor(e,{locator:x.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(cA.length);return[x.makeLocator(e,`${cA}${K.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await me.releaseAfterUseAsync(async()=>await ot.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return{...e,version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:"SOFT",conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin}}};var VQ=class{supports(e,t){return!!e.reference.startsWith(uA)}getLocalPath(e,t){let{parentLocator:i,path:n}=x.parseFileStyleRange(e.reference,{protocol:uA});if(v.isAbsolute(n))return n;let s=t.
2024-10-01 04:19:50 +02:00
${u}, next tree:
${eE(a)}`);let h=KAe(a);if(h)throw new Error(`${h}, after hoisting finished:
2024-10-01 04:49:34 +02:00
${eE(a)}`)}return s.debugLevel>=2&&console.log(eE(a)),q4e(a)},M4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())t.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),t},K4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=new Set,s=(o,a)=>{if(i.has(o))return;i.add(o);for(let c of o.hoistedDependencies.values())if(!a.has(c.name)){let u;for(let g of r)u=g.dependencies.get(c.name),u&&t.set(u.name,u)}let l=new Set;for(let c of o.dependencies.values())l.add(c.name);for(let c of o.dependencies.values())o.peerNames.has(c.name)||s(c,l)};return s(e,n),t},LAe=(r,e)=>{if(e.decoupled)return e;let{name:t,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g,hoistPriority:h,dependencyKind:p,hoistedFrom:d,hoistedTo:m}=e,y={name:t,references:new Set(i),ident:n,locator:s,dependencies:new Map(o),originalDependencies:new Map(a),hoistedDependencies:new Map(l),peerNames:new Set(c),reasons:new Map(u),decoupled:!0,isHoistBorder:g,hoistPriority:h,dependencyKind:p,hoistedFrom:new Map(d),hoistedTo:new Map(m)},B=y.dependencies.get(t);return B&&B.ident==y.ident&&y.dependencies.set(t,y),r.dependencies.set(y.name,y),y},U4e=(r,e)=>{let t=new Map([[r.name,[r.ident]]]);for(let n of r.dependencies.values())r.peerNames.has(n.name)||t.set(n.name,[n.ident]);let i=Array.from(e.keys());i.sort((n,s)=>{let o=e.get(n),a=e.get(s);return a.hoistPriority!==o.hoistPriority?a.hoistPriority-o.hoistPriority:a.peerDependents.size!==o.peerDependents.size?a.peerDependents.size-o.peerDependents.size:a.dependents.size-o.dependents.size});for(let n of i){let s=n.substring(0,n.indexOf("@",1)),o=n.substring(s.length+1);if(!r.peerNames.has(s)){let a=t.get(s);a||(a=[],t.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return t},TO=r=>{let e=new Set,t=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!r.peerNames.has(s)){let o=r.dependencies.get(s);o&&!e.has(o)&&t(o,n)}e.add(i)}};for(let i of r.dependencies.values())r.peerNames.has(i.name)||t(i);return e},OO=(r,e,t,i,n,s=new Set)=>{let o=e[e.length-1];if(s.has(o))return{anotherRoundNeeded:!1,isGraphChanged:!1};s.add(o);let a=J4e(o),l=U4e(o,a),c=r==o?new Map:n.fastLookupPossible?M4e(e):K4e(e),u,g=!1,h=!1,p=new Map(Array.from(l.entries()).map(([m,y])=>[m,y[0]])),d=new Map;do{let m=G4e(r,e,t,c,p,l,i,d,n);m.isGraphChanged&&(h=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[y,B]of l)B.length>1&&!o.dependencies.has(y)&&(p.delete(y),B.shift(),p.set(y,B[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!t.has(m.locator)){t.add(m.locator);let y=OO(r,[...e,m],t,d,n);y.isGraphChanged&&(h=!0),y.anotherRoundNeeded&&(g=!0),t.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:h}},H4e=r=>{for(let[e,t]of r.dependencies)if(!r.peerNames.has(e)&&t.ident!==r.ident)return!0;return!1},j4e=(r,e,t,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,h=new Set;l&&(u=`${Array.from(e).map(y=>Di(y)).join("\u2192")}`);let p=t[t.length-1],m=!(i.ident===p.ident);if(l&&!m&&(g="- self-reference"),m&&(m=i.dependencyKind!==1,l&&!m&&(g="- workspace")),m&&i.dependencyKind===2&&(m=!H4e(i),l&&!m&&(g="- external soft link with unhoisted dependencies")),m&&(m=p.dependencyKind!==1||p.hoistedFrom.has(i.name)||e.size===1,l&&!m&&(g=p.reasons.get(i.name))),m&&(m=!r.peerNames.has(i.name),l&&!m&&(g=`- cannot shadow peer: ${Di(r.originalDependencies.get(i.name).locator)} at ${u}`)),m){let y=!1,B=n.get(i.name);if(y=!B||B.ident===i.ident,l&&!y&&(g=`- filled by: ${Di(B.locator)} at ${u}`),y)for(let S=t.length-1;S>=1;S--){let F=t[S].dependencies.get(i.name);if(F&&F.ident!==i.ident){y=!1;let H=a.get(p);H||(H=new Set,a.set(p,H)),H.add(i.name),l&&(g=`- filled by ${Di(F.locator)} at ${t.slice(0,S).map(q=>Di(q.locator)).join("\u2192")}`);break}}m=y}if(m&&(m=s.get(i.name)===i.ident,l&&!m&&(g=`- filled by: ${Di(o.get(i.name)[0])} at ${u}`)),m){let y=!0,B=new Set(i.peerNames);for(let S=t.length-1;S>=1;S--){let P=t[S];for(let F of B){if(P.peerNames.h
${eE(r)}`)}let ue=TO(F);for(let te of ue)if(Z.has(te)){let O=W.get(te);if((n.get(te.name)===te.ident||!F.reasons.has(te.name))&&O.isHoistable!==0&&F.reasons.set(te.name,O.reason),!te.isHoistBorder&&_.indexOf(ZQ(te))<0){u.add(F);let ce=LAe(F,te);p([...B,F],q,_,ce,m),u.delete(F)}}},d,m=new Set(TO(c)),y=Array.from(e).map(B=>ZQ(B));do{d=m,m=new Set;for(let B of d){if(B.locator===c.locator||B.isHoistBorder)continue;let S=LAe(c,B);p([],Array.from(t),y,S,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:h}},KAe=r=>{let e=[],t=new Set,i=new Set,n=(s,o,a)=>{if(t.has(s)||(t.add(s),i.has(s)))return;let l=new Map(o);for(let c of s.dependencies.values())s.peerNames.has(c.name)||l.set(c.name,c);for(let c of s.originalDependencies.values()){let u=l.get(c.name),g=()=>`${Array.from(i).concat([s]).map(h=>Di(h.locator)).join("\u2192")}`;if(s.peerNames.has(c.name)){let h=o.get(c.name);(h!==u||!h||h.ident!==c.ident)&&e.push(`${g()} - broken peer promise: expected ${c.ident} but found ${h&&h.ident}`)}else{let h=a.hoistedFrom.get(s.name),p=s.hoistedTo.get(c.name),d=`${h?` hoisted from ${h.join(", ")}`:""}`,m=`${p?` hoisted to ${p}`:""}`,y=`${g()}${d}`;u?u.ident!==c.ident&&e.push(`${y} - broken require promise for ${c.name}${m}: expected ${c.ident}, but found: ${u.ident}`):e.push(`${y} - broken require promise: no required dependency ${c.name}${m} found`)}}i.add(s);for(let c of s.dependencies.values())s.peerNames.has(c.name)||n(c,l,s);i.delete(s)};return n(r,r.dependencies,r),e.join(`
`)},Y4e=(r,e)=>{let{identName:t,name:i,reference:n,peerNames:s}=r,o={name:i,references:new Set([n]),locator:LO(t,n),ident:TAe(t,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},a=new Map([[r,o]]),l=(c,u)=>{let g=a.get(c),h=!!g;if(!g){let{name:p,identName:d,reference:m,peerNames:y,hoistPriority:B,dependencyKind:S}=c,P=e.hoistingLimits.get(u.locator);g={name:p,references:new Set([m]),locator:LO(d,m),ident:TAe(d,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(y),reasons:new Map,decoupled:!0,isHoistBorder:P?P.has(p):!1,hoistPriority:B||0,dependencyKind:S||0,hoistedFrom:new Map,hoistedTo:new Map},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),h){let p=new Set,d=m=>{if(!p.has(m)){p.add(m),m.decoupled=!1;for(let y of m.dependencies.values())m.peerNames.has(y.name)||d(y)}};d(g)}else for(let p of c.dependencies)l(p,g)};for(let c of r.dependencies)l(c,o);return o},MO=r=>r.substring(0,r.indexOf("@",1)),q4e=r=>{let e={name:r.name,identName:MO(r.locator),references:new Set(r.references),dependencies:new Set},t=new Set([r]),i=(n,s,o)=>{let a=t.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:MO(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){t.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);t.delete(n)}};for(let n of r.dependencies.values())i(n,r,e);return e},J4e=r=>{let e=new Map,t=new Set([r]),i=o=>`${o.name}@${o.ident}`,n=o=>{let a=i(o),l=e.get(a);return l||(l={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(a,l)),l},s=(o,a)=>{let l=!!t.has(a);if(n(a).dependents.add(o.ident),!l){t.add(a);for(let u of a.dependencies.values()){let g=n(u);g.hoistPriority=Math.max(g.hoistPriority,u.hoistPriority),a.peerNames.has(u.name)?g.peerDependents.add(a.ident):s(a,u)}}};for(let o of r.dependencies.values())r.peerNames.has(o.name)||s(r,o);return e},Di=r=>{if(!r)return"none";let e=r.indexOf("@",1),t=r.substring(0,e);t.endsWith("$wsroot$")&&(t=`wh:${t.replace("$wsroot$","")}`);let i=r.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(t=`v:${t}`),n.startsWith("workspace")&&(t=`w:${t}`,n=""),`${t}${n?`@${n}`:""}`}else return`${t}`},OAe=5e4,eE=r=>{let e=0,t=(n,s,o="")=>{if(e>OAe||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name===u.name?0:c.name>u.name?1:-1),l="";s.add(n);for(let c=0;c<a.length;c++){let u=a[c];if(!n.peerNames.has(u.name)&&u!==n){let g=n.reasons.get(u.name),h=MO(u.locator);l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(h!==u.name?`a:${u.name}:`:"")+Di(u.locator)+(g?` ${g}`:"")}
2024-10-01 04:19:50 +02:00
`,l+=t(u,s,`${o}${c<a.length-1?"\u2502 ":" "}`)}}return s.delete(n),l};return t(r,new Set)+(e>OAe?`
Tree is too large, part of the tree has been dunped
2024-10-01 04:49:34 +02:00
`:"")};var tE=(i=>(i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none",i))(tE||{}),UAe="node_modules",Gu="$wsroot$";var rE=(r,e)=>{let{packageTree:t,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=z4e(r,e),o=null;if(n.length===0){let a=MAe(t,{hoistingLimits:i});o=X4e(r,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},na=r=>`${r.name}@${r.reference}`,UO=r=>{let e=new Map;for(let[t,i]of r.entries())if(!i.dirList){let n=e.get(i.locator);n||(n={target:i.target,linkType:i.linkType,locations:[],aliases:i.aliases},e.set(i.locator,n)),n.locations.push(t)}for(let t of e.values())t.locations=t.locations.sort((i,n)=>{let s=i.split(v.delimiter).length,o=n.split(v.delimiter).length;return n===i?0:s!==o?o-s:n>i?1:-1});return e},HAe=(r,e)=>{let t=x.isVirtualLocator(r)?x.devirtualizeLocator(r):r,i=x.isVirtualLocator(e)?x.devirtualizeLocator(e):e;return x.areLocatorsEqual(t,i)},KO=(r,e,t,i)=>{if(r.linkType!=="SOFT")return!1;let n=K.toPortablePath(t.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?t.resolveVirtual(r.packageLocation):r.packageLocation);return v.contains(i,n)===null},W4e=r=>{let e=r.getPackageInformation(r.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(r.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=K.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=r.getDependencyTreeRoots(),a=new Map,l=new Set,c=(h,p)=>{let d=na(h);if(l.has(d))return;l.add(d);let m=r.getPackageInformation(h);if(m){let y=p?na(p):"";if(na(h)!==y&&m.linkType==="SOFT"&&!KO(m,h,r,i)){let B=jAe(m,h,r);(!a.get(B)||h.reference.startsWith("workspace:"))&&a.set(B,h)}for(let[B,S]of m.packageDependencies)S!==null&&(m.packagePeers.has(B)||c(r.getLocator(B,S),h))}};for(let h of o)c(h,null);let u=i.split(v.sep);for(let h of a.values()){let p=r.getPackageInformation(h),m=K.toPortablePath(p.packageLocation.slice(0,-1)).split(v.sep).slice(u.length),y=s;for(let B of m){let S=y.children.get(B);S||(S={children:new Map},y.children.set(B,S)),y=S}y.workspaceLocator=h}let g=(h,p)=>{if(h.workspaceLocator){let d=na(p),m=n.get(d);m||(m=new Set,n.set(d,m)),m.add(h.workspaceLocator)}for(let d of h.children.values())g(d,h.workspaceLocator||p)};for(let h of s.children.values())g(h,s.workspaceLocator);return n},z4e=(r,e)=>{let t=[],i=!1,n=new Map,s=W4e(r),o=r.getPackageInformation(r.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=r.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=K.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,dependencyKind:1},u=new Map,g=(p,d)=>`${na(d)}:${p}`,h=(p,d,m,y,B,S,P,F)=>{var te,O;let H=g(p,m),q=u.get(H),_=!!q;!_&&m.name===a.name&&m.reference===a.reference&&(q=c,u.set(H,c));let X=KO(d,m,r,l);if(!q){let N=0;X?N=2:d.linkType==="SOFT"&&m.name.endsWith(Gu)&&(N=1),q={name:p,identName:m.name,reference:m.reference,dependencies:new Set,peerNames:N===1?new Set:d.packagePeers,dependencyKind:N},u.set(H,q)}let W;if(X?W=2:B.linkType==="SOFT"?W=1:W=0,q.hoistPriority=Math.max(q.hoistPriority||0,W),F&&!X){let N=na({name:y.identName,reference:y.reference}),ce=n.get(N)||new Set;n.set(N,ce),ce.add(q.name)}let Z=new Map(d.packageDependencies);if(e.project){let N=e.project.workspacesByCwd.get(K.toPortablePath(d.packageLocation.slice(0,-1)));if(N){let ce=new Set([...Array.from(N.manifest.peerDependencies.values(),he=>x.stringifyIdent(he)),...Array.from(N.manifest.peerDependenciesMeta.keys())]);for(let he of ce)Z.has(he)||(Z.set(he,S.get(he)||null),q.peerNames.add(he))}}let A=na({name:m.name.replace(Gu,""),reference:m.reference}),ne=s.get(A);if(ne)for(let N of ne)Z.set(`${N.name}${Gu}`,N.reference);(d!==B||d.linkType!=="SOFT"||!X&&(!e.selfReferencesByCwd||e.selfReferenc
2024-10-01 04:19:50 +02:00
`;for(let s=0,o=r.length;s<o;++s)n+=i+_Q(String(s),r[s],e,i).replace(/^ +/,""),s+1<o&&(n+=","),n+=`
2024-10-01 04:49:34 +02:00
`;return n+=t,n+="]",n}function $4e(r,e,t){let i=Object.keys(r),n="";n+="{";for(let s=0,o=i.length,a=0;s<o;++s){let l=i[s],c=r[l];typeof c>"u"||(a!==0&&(n+=", "),n+=JSON.stringify(l),n+=": ",n+=_Q(l,c,e,t).replace(/^ +/g,""),a+=1)}return n+="}",n}function eze(r,e,t){let i=Object.keys(r),n=`${t} `,s="";s+=t,s+=`{
2024-10-01 04:19:50 +02:00
`;let o=0;for(let a=0,l=i.length;a<l;++a){let c=i[a],u=r[c];typeof u>"u"||(o!==0&&(s+=",",s+=`
`),s+=n,s+=JSON.stringify(c),s+=": ",s+=_Q(c,u,e,n).replace(/^ +/g,""),o+=1)}return o!==0&&(s+=`
2024-10-01 04:49:34 +02:00
`),s+=t,s+="}",s}function _Q(r,e,t,i){let{next:n}=GAe[t],s=n[r]||n["*"];return YAe(e,s,i)}function YAe(r,e,t){let{collapsed:i}=GAe[e];return Array.isArray(r)?i?Z4e(r,e,t):_4e(r,e,t):typeof r=="object"&&r!==null?i?$4e(r,e,t):eze(r,e,t):JSON.stringify(r)}function qAe(r){return YAe(r,"TOP_LEVEL","")}function iE(r,e){let t=Array.from(r);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(t.map(o=>s(o)));let n=t.map((s,o)=>o);return n.sort((s,o)=>{for(let a of i){let l=a[s]<a[o]?-1:a[s]>a[o]?1:0;if(l!==0)return l}return 0}),n.map(s=>t[s])}function tze(r){let e=new Map,t=iE(r.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of t){let s=e.get(i);typeof s>"u"&&e.set(i,s=new Set),s.add(n)}return Array.from(e).map(([i,n])=>[i,Array.from(n)])}function rze(r){return iE(r.fallbackPool||[],([e])=>e)}function ize(r){let e=[];for(let[t,i]of iE(r.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([t,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of iE(i,([g])=>g===null?"0":`1${g}`)){let g=[];t!==null&&s!==null&&!a.has(t)&&g.push([t,s]);for(let[d,m]of iE(a.entries(),([y])=>y))g.push([d,m]);let h=l&&l.size>0?Array.from(l):void 0,p=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:h,linkType:c,discardFromLookup:p}])}}return e}function nE(r){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost. We also recommend you not to read","it either without using the @yarnpkg/pnp package, as the data layout","is entirely unspecified and WILL change from a version to another."],dependencyTreeRoots:r.dependencyTreeRoots,enableTopLevelFallback:r.enableTopLevelFallback||!1,ignorePatternData:r.ignorePattern||null,fallbackExclusionList:tze(r),fallbackPool:rze(r),packageRegistryData:ize(r)}}var zAe=ve(WAe());function VAe(r,e){return[r?`${r}
2024-10-01 04:19:50 +02:00
`:"",`/* eslint-disable */
`,`"use strict";
`,`
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,e.replace(/^/gm," "),`}
`,`
`,(0,zAe.default)()].join("")}function nze(r){return JSON.stringify(r,null,2)}function sze(r){return`'${r.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
`)}'`}function oze(r){return[`return hydrateRuntimeState(JSON.parse(${sze(qAe(r))}), {basePath: basePath || __dirname});
`].join("")}function aze(r){return[`var path = require('path');
`,`var dataLocation = path.resolve(__dirname, ${JSON.stringify(r)});
`,`return hydrateRuntimeState(require(dataLocation), {basePath: basePath || path.dirname(dataLocation)});
2024-10-01 04:49:34 +02:00
`].join("")}function XAe(r){let e=nE(r),t=oze(e);return VAe(r.shebang,t)}function ZAe(r){let e=nE(r),t=aze(r.dataLocation),i=VAe(r.shebang,t);return{dataFile:nze(e),loaderFile:i}}var yle=J("fs");var wle=J("util");function jO(r,{basePath:e}){let t=K.toPortablePath(e),i=v.resolve(t),n=r.ignorePatternData!==null?new RegExp(r.ignorePatternData):null,s=new Map,o=new Map(r.packageRegistryData.map(([g,h])=>[g,new Map(h.map(([p,d])=>{var P;if(g===null!=(p===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(P=d.discardFromLookup)!=null?P:!1,y={name:g,reference:p},B=s.get(d.packageLocation);B?(B.discardFromLookup=B.discardFromLookup&&m,m||(B.locator=y)):s.set(d.packageLocation,{locator:y,discardFromLookup:m});let S=null;return[p,{packageDependencies:new Map(d.packageDependencies),packagePeers:new Set(d.packagePeers),linkType:d.linkType,discardFromLookup:m,get packageLocation(){return S||(S=v.join(i,d.packageLocation))}}]}))])),a=new Map(r.fallbackExclusionList.map(([g,h])=>[g,new Set(h)])),l=new Map(r.fallbackPool),c=r.dependencyTreeRoots,u=r.enableTopLevelFallback;return{basePath:t,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var gE=J("module"),gA=J("url"),_O=J("util");var qi=J("url");var tle=ve(J("assert"));var GO=Array.isArray,sE=JSON.stringify,oE=Object.getOwnPropertyNames,Yu=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),YO=(r,e)=>RegExp.prototype.exec.call(r,e),qO=(r,...e)=>RegExp.prototype[Symbol.replace].apply(r,e),El=(r,...e)=>String.prototype.endsWith.apply(r,e),JO=(r,...e)=>String.prototype.includes.apply(r,e),WO=(r,...e)=>String.prototype.lastIndexOf.apply(r,e),aE=(r,...e)=>String.prototype.indexOf.apply(r,e),_Ae=(r,...e)=>String.prototype.replace.apply(r,e),Il=(r,...e)=>String.prototype.slice.apply(r,e),sa=(r,...e)=>String.prototype.startsWith.apply(r,e),$Ae=Map,ele=JSON.parse;function AE(r,e,t){return class extends t{constructor(...i){super(e(...i)),this.code=r,this.name=`${t.name} [${r}]`}}}var rle=AE("ERR_PACKAGE_IMPORT_NOT_DEFINED",(r,e,t)=>`Package import specifier "${r}" is not defined${e?` in package ${e}package.json`:""} imported from ${t}`,TypeError),zO=AE("ERR_INVALID_MODULE_SPECIFIER",(r,e,t=void 0)=>`Invalid module "${r}" ${e}${t?` imported from ${t}`:""}`,TypeError),ile=AE("ERR_INVALID_PACKAGE_TARGET",(r,e,t,i=!1,n=void 0)=>{let s=typeof t=="string"&&!i&&t.length&&!sa(t,"./");return e==="."?((0,tle.default)(i===!1),`Invalid "exports" main target ${sE(t)} defined in the package config ${r}package.json${n?` imported from ${n}`:""}${s?'; targets must start with "./"':""}`):`Invalid "${i?"imports":"exports"}" target ${sE(t)} defined for '${e}' in the package config ${r}package.json${n?` imported from ${n}`:""}${s?'; targets must start with "./"':""}`},Error),lE=AE("ERR_INVALID_PACKAGE_CONFIG",(r,e,t)=>`Invalid package config ${r}${e?` while importing ${e}`:""}${t?`. ${t}`:""}`,Error),nle=AE("ERR_PACKAGE_PATH_NOT_EXPORTED",(r,e,t=void 0)=>e==="."?`No "exports" main defined in ${r}package.json${t?` imported from ${t}`:""}`:`Package subpath '${e}' is not defined by "exports" in ${r}package.json${t?` imported from ${t}`:""}`,Error);var eb=J("url");function sle(r,e){let t=Object.create(null);for(let i=0;i<e.length;i++){let n=e[i];Yu(r,n)&&(t[n]=r[n])}return t}var $Q=new $Ae;function Aze(r,e,t,i){let n=$Q.get(r);if(n!==void 0)return n;let s=i(r);if(s===void 0){let p={pjsonPath:r,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return $Q.set(r,p),p}let o;try{o=ele(s)}catch(p){throw new lE(r,(t?`"${e}" from `:"")+(0,eb.fileURLToPath)(t||e),p.message)}let{imports:a,main:l,name:c,type:u}=sle(o,["imports","main","name","type"]),g=Yu(o,"exports")?o.exports:void 0;(typeof a!="object"||a===null)&&(a=void 0),typeof l!="string"&&(l=void 0),typeof c!="string"&&(c=void 0),u!=="module"&&u!=="commonjs"&&(u="none");let h={pjsonPath:r,exists:!0,main:l,name:c,type:u,exports:g,imports:a};return $Q.set(r,h),h}function ole(r,e){let t=new URL("./
2024-10-01 04:19:50 +02:00
`),t;o=r[++s]}else if(o===" "&&!i){n=!0;continue}else if(o==='"'){i=!i;continue}n?(t.push(o),n=!1):t[t.length-1]+=o}return i&&e.push(`invalid value for NODE_OPTIONS (unterminated string)
2024-10-01 04:49:34 +02:00
`),t}var Ele=J("module");var[Ir,Ji]=process.versions.node.split(".").map(r=>parseInt(r,10)),EBt=Ir>16||Ir===16&&Ji>=12,IBt=Ir>17||Ir===17&&Ji>=5||Ir===16&&Ji>=15,yBt=Ir>17||Ir===17&&Ji>=1||Ir===16&&Ji>14,mle=Ir>19||Ir===19&&Ji>=2||Ir===18&&Ji>=13,wBt=Ir===20&&Ji<6||Ir===19&&Ji>=3,BBt=Ir>19||Ir===19&&Ji>=6,QBt=Ir>18||Ir===18&&Ji>=1||Ir===16&&Ji>=17,bBt=Ir>=21||Ir===20&&Ji>=10||Ir===18&&Ji>=19,SBt=Ir>=21||Ir===20&&Ji>=10||Ir===18&&Ji>=20,vBt=Ir>=22;var Eze=new Set(Ele.Module.builtinModules||Object.keys(process.binding("natives"))),tb=r=>r.startsWith("node:")||Eze.has(r);function Ile(r){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(r=r.map(e=>K.fromPortablePath(wr.resolveVirtual(K.toPortablePath(e)))),mle)process.send({"watch:require":r});else for(let e of r)process.send({"watch:require":e})}function $O(r,e){let t=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,i=Number(process.env.PNP_DEBUG_LEVEL),n=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,s=/^(\/|\.{1,2}(\/|$))/,o=/\/$/,a=/^\.{0,2}\//,l={name:null,reference:null},c=[],u=new Set;if(r.enableTopLevelFallback===!0&&c.push(l),e.compatibilityMode!==!1)for(let se of["react-scripts","gatsby"]){let Ae=r.packageRegistry.get(se);if(Ae)for(let ye of Ae.keys()){if(ye===null)throw new Error("Assertion failed: This reference shouldn't be null");c.push({name:se,reference:ye})}}let{ignorePattern:g,packageRegistry:h,packageLocatorsByLocations:p}=r;function d(se,Ae){return{fn:se,args:Ae,error:null,result:null}}function m(se){var Ye,ie,G,fe,re,de;let Ae=(G=(ie=(Ye=process.stderr)==null?void 0:Ye.hasColors)==null?void 0:ie.call(Ye))!=null?G:process.stdout.isTTY,ye=(Ze,vt)=>`\x1B[${Ze}m${vt}\x1B[0m`,ge=se.error;console.error(ge?ye("31;1",`\u2716 ${(fe=se.error)==null?void 0:fe.message.replace(/\n.*/s,"")}`):ye("33;1","\u203C Resolution")),se.args.length>0&&console.error();for(let Ze of se.args)console.error(` ${ye("37;1","In \u2190")} ${(0,_O.inspect)(Ze,{colors:Ae,compact:!0})}`);se.result&&(console.error(),console.error(` ${ye("37;1","Out \u2192")} ${(0,_O.inspect)(se.result,{colors:Ae,compact:!0})}`));let oe=(de=(re=new Error().stack.match(/(?<=^ +)at.*/gm))==null?void 0:re.slice(2))!=null?de:[];if(oe.length>0){console.error();for(let Ze of oe)console.error(` ${ye("38;5;244",Ze)}`)}console.error()}function y(se,Ae){if(e.allowDebug===!1)return Ae;if(Number.isFinite(i)){if(i>=2)return(...ye)=>{let ge=d(se,ye);try{return ge.result=Ae(...ye)}catch(oe){throw ge.error=oe}finally{m(ge)}};if(i>=1)return(...ye)=>{try{return Ae(...ye)}catch(ge){let oe=d(se,ye);throw oe.error=ge,m(oe),ge}}}return Ae}function B(se){let Ae=A(se);if(!Ae)throw ei("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Ae}function S(se){if(se.name===null)return!0;for(let Ae of r.dependencyTreeRoots)if(Ae.name===se.name&&Ae.reference===se.reference)return!0;return!1}let P=new Set(["node","require",...Cle("--conditions")]);function F(se,Ae=P,ye){let ge=te(v.join(se,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(ge===null)throw ei("INTERNAL",`The locator that owns the "${se}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:oe}=B(ge),Ye=v.join(oe,St.manifest);if(!e.fakeFs.existsSync(Ye))return null;let ie=JSON.parse(e.fakeFs.readFileSync(Ye,"utf8"));if(ie.exports==null)return null;let G=v.contains(oe,se);if(G===null)throw ei("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");G!=="."&&!a.test(G)&&(G=`./${G}`);try{let fe=ule({packageJSONUrl:(0,gA.pathToFileURL)(K.fromPortablePath(Ye)),packageSubpath:G,exports:ie.exports,base:ye?(0,gA.pathToFileURL)(K.fromPortablePath(ye)):null,conditions:Ae});return K.toPortablePath((0,gA.fileURLToPath)(fe))}catch(fe){throw ei("EXPORTS_RESOLUTION_FAILED",fe.message,{unqualifiedPath:ho(se),locator:ge,pkgJson:ie,subpath:ho(G),conditions:Ae},fe.code)}}function H(se,Ae,{extensions:ye}){let ge;try{Ae.push(se),ge=e.fakeFs.statSync(se)}c
2024-10-01 04:19:50 +02:00
Require request: "${ge}"
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe});return K.toPortablePath(G)}let Ye,ie=se.match(n);if(ie){if(!Ae)throw ei("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:ge,issuer:oe});let[,G,fe]=ie,re=te(Ae);if(!re){let gr=_(se,Ae);if(gr===!1)throw ei("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
2024-10-01 04:19:50 +02:00
Require path: "${ge}"
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe});return K.toPortablePath(gr)}let Ze=B(re).packageDependencies.get(G),vt=null;if(Ze==null&&re.name!==null){let gr=r.fallbackExclusionList.get(re.name);if(!gr||!gr.has(re.reference)){for(let ri=0,Ms=c.length;ri<Ms;++ri){let Ei=B(c[ri]).packageDependencies.get(G);if(Ei!=null){t?vt=Ei:Ze=Ei;break}}if(r.enableTopLevelFallback&&Ze==null&&vt===null){let ri=r.fallbackPool.get(G);ri!=null&&(vt=ri)}}}let mt=null;if(Ze===null)if(S(re))mt=ei("MISSING_PEER_DEPENDENCY",`Your application tried to access ${G} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,dependencyName:G});else{let gr=ue(G,re);gr.every(gi=>S(gi))?mt=ei("MISSING_PEER_DEPENDENCY",`${re.name} tried to access ${G} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${re.name}@${re.reference} (via ${oe})
${gr.map(gi=>`Ancestor breaking the chain: ${gi.name}@${gi.reference}
`).join("")}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,issuerLocator:Object.assign({},re),dependencyName:G,brokenAncestors:gr}):mt=ei("MISSING_PEER_DEPENDENCY",`${re.name} tried to access ${G} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${re.name}@${re.reference} (via ${oe})
${gr.map(gi=>`Ancestor breaking the chain: ${gi.name}@${gi.reference}
`).join("")}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,issuerLocator:Object.assign({},re),dependencyName:G,brokenAncestors:gr})}else Ze===void 0&&(!ye&&tb(se)?S(re)?mt=ei("UNDECLARED_DEPENDENCY",`Your application tried to access ${G}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${G} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,dependencyName:G}):mt=ei("UNDECLARED_DEPENDENCY",`${re.name} tried to access ${G}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${G} isn't otherwise declared in ${re.name}'s dependencies, this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,issuerLocator:Object.assign({},re),dependencyName:G}):S(re)?mt=ei("UNDECLARED_DEPENDENCY",`Your application tried to access ${G}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${oe}
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,dependencyName:G}):mt=ei("UNDECLARED_DEPENDENCY",`${re.name} tried to access ${G}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${G}${G!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${re.name}@${re.reference} (via ${oe})
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,issuerLocator:Object.assign({},re),dependencyName:G}));if(Ze==null){if(vt===null||mt===null)throw mt||new Error("Assertion failed: Expected an error to have been set");Ze=vt;let gr=mt.message.replace(/\n.*/g,"");mt.message=gr,!u.has(gr)&&i!==0&&(u.add(gr),process.emitWarning(mt))}let Lr=Array.isArray(Ze)?{name:Ze[0],reference:Ze[1]}:{name:G,reference:Ze},ti=B(Lr);if(!ti.packageLocation)throw ei("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Required package: ${Lr.name}@${Lr.reference}${Lr.name!==ge?` (via "${ge}")`:""}
2024-10-01 04:19:50 +02:00
Required by: ${re.name}@${re.reference} (via ${oe})
2024-10-01 04:49:34 +02:00
`,{request:ge,issuer:oe,dependencyLocator:Object.assign({},Lr)});let ui=ti.packageLocation;fe?Ye=v.join(ui,fe):Ye=ui}else if(v.isAbsolute(se))Ye=v.normalize(se);else{if(!Ae)throw ei("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:ge,issuer:oe});let G=v.resolve(Ae);Ae.match(o)?Ye=v.normalize(v.join(G,se)):Ye=v.normalize(v.join(v.dirname(G),se))}return v.normalize(Ye)}function ce(se,Ae,ye=P,ge){if(s.test(se))return Ae;let oe=F(Ae,ye,ge);return oe?v.normalize(oe):Ae}function he(se,{extensions:Ae=Object.keys(gE.Module._extensions)}={}){var oe,Ye;let ye=[],ge=H(se,ye,{extensions:Ae});if(ge)return v.normalize(ge);{Ile(ye.map(fe=>K.fromPortablePath(fe)));let ie=ho(se),G=te(se);if(G){let{packageLocation:fe}=B(G),re=!0;try{e.fakeFs.accessSync(fe)}catch(de){if((de==null?void 0:de.code)==="ENOENT")re=!1;else{let Ze=((Ye=(oe=de==null?void 0:de.message)!=null?oe:de)!=null?Ye:"empty exception thrown").replace(/^[A-Z]/,vt=>vt.toLowerCase());throw ei("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${Ze}).
2024-10-01 04:19:50 +02:00
2024-10-01 04:49:34 +02:00
Missing package: ${G.name}@${G.reference}
2024-10-01 04:19:50 +02:00
Expected package location: ${ho(fe)}
`,{unqualifiedPath:ie,extensions:Ae})}}if(!re){let de=fe.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ei("QUALIFIED_PATH_RESOLUTION_FAILED",`${de}
2024-10-01 04:49:34 +02:00
Missing package: ${G.name}@${G.reference}
2024-10-01 04:19:50 +02:00
Expected package location: ${ho(fe)}
`,{unqualifiedPath:ie,extensions:Ae})}}throw ei("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
Source path: ${ie}
${ye.map(fe=>`Not found: ${ho(fe)}
2024-10-01 04:49:34 +02:00
`).join("")}`,{unqualifiedPath:ie,extensions:Ae})}}function Pe(se,Ae,ye){var oe;if(!Ae)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let ge=gle({name:se,base:(0,gA.pathToFileURL)(K.fromPortablePath(Ae)),conditions:(oe=ye.conditions)!=null?oe:P,readFileSyncFn:O});if(ge instanceof gA.URL)return he(K.toPortablePath((0,gA.fileURLToPath)(ge)),{extensions:ye.extensions});if(ge.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return De(ge,Ae,ye)}function De(se,Ae,ye={}){try{if(se.startsWith("#"))return Pe(se,Ae,ye);let{considerBuiltins:ge,extensions:oe,conditions:Ye}=ye,ie=N(se,Ae,{considerBuiltins:ge});if(se==="pnpapi")return ie;if(ie===null)return null;let G=()=>Ae!==null?X(Ae):!1,fe=(!ge||!tb(se))&&!G()?ce(se,ie,Ye,Ae):ie;return he(fe,{extensions:oe})}catch(ge){throw Object.prototype.hasOwnProperty.call(ge,"pnpCode")&&Object.assign(ge.data,{request:ho(se),issuer:Ae&&ho(Ae)}),ge}}function Re(se){let Ae=v.normalize(se),ye=wr.resolveVirtual(Ae);return ye!==Ae?ye:null}return{VERSIONS:W,topLevel:Z,getLocator:(se,Ae)=>Array.isArray(Ae)?{name:Ae[0],reference:Ae[1]}:{name:se,reference:Ae},getDependencyTreeRoots:()=>[...r.dependencyTreeRoots],getAllLocators(){let se=[];for(let[Ae,ye]of h)for(let ge of ye.keys())Ae!==null&&ge!==null&&se.push({name:Ae,reference:ge});return se},getPackageInformation:se=>{let Ae=A(se);if(Ae===null)return null;let ye=K.fromPortablePath(Ae.packageLocation);return{...Ae,packageLocation:ye}},findPackageLocator:se=>te(K.toPortablePath(se)),resolveToUnqualified:y("resolveToUnqualified",(se,Ae,ye)=>{let ge=Ae!==null?K.toPortablePath(Ae):null,oe=N(K.toPortablePath(se),ge,ye);return oe===null?null:K.fromPortablePath(oe)}),resolveUnqualified:y("resolveUnqualified",(se,Ae)=>K.fromPortablePath(he(K.toPortablePath(se),Ae))),resolveRequest:y("resolveRequest",(se,Ae,ye)=>{let ge=Ae!==null?K.toPortablePath(Ae):null,oe=De(K.toPortablePath(se),ge,ye);return oe===null?null:K.fromPortablePath(oe)}),resolveVirtual:y("resolveVirtual",se=>{let Ae=Re(K.toPortablePath(se));return Ae!==null?K.fromPortablePath(Ae):null})}}var YBt=(0,wle.promisify)(yle.readFile);var Ble=(r,e,t)=>{let i=nE(r),n=jO(i,{basePath:e}),s=K.join(e,St.pnpCjs);return $O(n,{fakeFs:t,pnpapiResolution:s})};var tM=ve(ble());var po={};ct(po,{checkAndReportManifestCompatibility:()=>vle,checkManifestCompatibility:()=>Sle,extractBuildScripts:()=>rb,getExtractHint:()=>rM,hasBindingGyp:()=>iM});function Sle(r){return x.isPackageCompatible(r,ys.getArchitectureSet())}function vle(r,e,{configuration:t,report:i}){return Sle(r)?!0:(i==null||i.reportWarningOnce(76,`${x.prettyLocator(t,r)} The ${ys.getArchitectureName()} architecture is incompatible with this package, ${e} skipped.`),!1)}function rb(r,e,t,{configuration:i,report:n}){let s=[];for(let a of["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([0,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([1,"node-gyp rebuild"]),s.length===0?[]:r.linkType!=="HARD"?(n==null||n.reportWarningOnce(6,`${x.prettyLocator(i,r)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):t&&t.built===!1?(n==null||n.reportInfoOnce(5,`${x.prettyLocator(i,r)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!t.built?(n==null||n.reportWarningOnce(4,`${x.prettyLocator(i,r)} lists build scripts, but all build scripts have been disabled.`),[]):vle(r,"build",{configuration:i,report:n})?s:[]}var yze=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function rM(r){return r.packageFs.getExtractHint({relevantExtensions:yze})}function iM(r){let e=v.join(r.prefixPath,"binding.gyp");return r.packageFs.existsSync(e)}var hE={};ct(hE,{getUnpluggedPath:()=>fE});function fE(r,{configuration:e}){return v.resolve(e.get("pnpUnpluggedFolder"),x.slugifyLocator(r))}var wze=new Set([x.makeIdent(null,"open").identHash,x.makeIdent(null,"opn").identHash]),yl
2024-10-01 04:19:50 +02:00
`,s+=`# cause your node_modules installation to become invalidated.
`,s+=`
`,s+=`__metadata:
`,s+=` version: ${Hle}
`,s+=` nmMode: ${i.value}
`;let o=Array.from(e.keys()).sort(),a=x.stringifyLocator(r.topLevelWorkspace.anchoredLocator);for(let u of o){let g=e.get(u);s+=`
`,s+=`${JSON.stringify(u)}:
`,s+=` locations:
`;for(let h of g.locations){let p=v.contains(r.cwd,h);if(p===null)throw new Error(`Assertion failed: Expected the path to be within the project (${h})`);s+=` - ${JSON.stringify(p)}
`}if(g.aliases.length>0){s+=` aliases:
`;for(let h of g.aliases)s+=` - ${JSON.stringify(h)}
`}if(u===a&&t.size>0){s+=` bin:
`;for(let[h,p]of t){let d=v.contains(r.cwd,h);if(d===null)throw new Error(`Assertion failed: Expected the path to be within the project (${h})`);s+=` ${JSON.stringify(d)}:
2024-10-01 04:49:34 +02:00
`;for(let[m,y]of p){let B=v.relative(v.join(h,Dr),y);s+=` ${JSON.stringify(m)}: ${JSON.stringify(B)}
`}}}}let l=r.cwd,c=v.join(l,Dr,jle);n&&await M.removePromise(c),await M.changeFilePromise(c,s,{automaticNewlines:!0})}async function uM(r,{unrollAliases:e=!1}={}){let t=r.cwd,i=v.join(t,Dr,jle),n;try{n=await M.statPromise(i)}catch{}if(!n)return null;let s=wi(await M.readFilePromise(i,"utf8"));if(s.__metadata.version>Hle)return null;let o=s.__metadata.nmMode||"classic",a=new Map,l=new Map;delete s.__metadata;for(let[c,u]of Object.entries(s)){let g=u.locations.map(p=>v.join(t,p)),h=u.bin;if(h)for(let[p,d]of Object.entries(h)){let m=v.join(t,K.toPortablePath(p)),y=me.getMapWithDefault(l,m);for(let[B,S]of Object.entries(d))y.set(Yr(B),K.toPortablePath([m,Dr,S].join(v.sep)))}if(a.set(c,{target:Te.dot,linkType:"HARD",locations:g,aliases:u.aliases||[]}),e&&u.aliases)for(let p of u.aliases){let{scope:d,name:m}=x.parseLocator(c),y=x.makeLocator(x.makeIdent(d,m),p),B=x.stringifyLocator(y);a.set(B,{target:Te.dot,linkType:"HARD",locations:g,aliases:[]})}}return{locatorMap:a,binSymlinks:l,locationTree:Gle(a,{skipPrefix:r.cwd}),nmMode:o,mtimeMs:n.mtimeMs}}var sp=async(r,e)=>{if(r.split(v.sep).indexOf(Dr)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${r}`);try{if(!e.innerLoop){let i=e.allowSymlink?await M.statPromise(r):await M.lstatPromise(r);if(e.allowSymlink&&!i.isDirectory()||!e.allowSymlink&&i.isSymbolicLink()){await M.unlinkPromise(r);return}}let t=await M.readdirPromise(r,{withFileTypes:!0});for(let i of t){let n=v.join(r,Yr(i.name));i.isDirectory()?(i.name!==Dr||e&&e.innerLoop)&&await sp(n,{innerLoop:!0,contentsOnly:!1}):await M.unlinkPromise(n)}e.contentsOnly||await M.rmdirPromise(r)}catch(t){if(t.code!=="ENOENT"&&t.code!=="ENOTEMPTY")throw t}},Ole=4,sb=(r,{skipPrefix:e})=>{let t=v.contains(e,r);if(t===null)throw new Error(`Assertion failed: Writing attempt prevented to ${r} which is outside project root: ${e}`);let i=t.split(v.sep).filter(l=>l!==""),n=i.indexOf(Dr),s=i.slice(0,n).join(v.sep),o=v.join(e,s),a=i.slice(n);return{locationRoot:o,segments:a}},Gle=(r,{skipPrefix:e})=>{let t=new Map;if(r===null)return t;let i=()=>({children:new Map,linkType:"HARD"});for(let[n,s]of r.entries()){if(s.linkType==="SOFT"&&v.contains(e,s.target)!==null){let a=me.getFactoryWithDefault(t,s.target,i);a.locator=n,a.linkType=s.linkType}for(let o of s.locations){let{locationRoot:a,segments:l}=sb(o,{skipPrefix:e}),c=me.getFactoryWithDefault(t,a,i);for(let u=0;u<l.length;++u){let g=l[u];if(g!=="."){let h=me.getFactoryWithDefault(c.children,g,i);c.children.set(g,h),c=h}u===l.length-1&&(c.locator=n,c.linkType=s.linkType)}}}return t},fM=async(r,e)=>{let t;try{process.platform==="win32"&&(t=await M.lstatPromise(r))}catch{}process.platform=="win32"&&(!t||t.isDirectory())?await M.symlinkPromise(r,e,"junction"):await M.symlinkPromise(v.relative(v.dirname(e),r),e)};async function Yle(r,e,t){let i=v.join(r,Yr(`${gM.default.randomBytes(16).toString("hex")}.tmp`));try{await M.writeFilePromise(i,t);try{await M.linkPromise(i,e)}catch{}}finally{await M.unlinkPromise(i)}}async function Wze({srcPath:r,dstPath:e,entry:t,globalHardlinksStore:i,baseFs:n,nmMode:s}){if(t.kind===qle.FILE){if(s.value==="hardlinks-global"&&i&&t.digest){let a=v.join(i,t.digest.substring(0,2),`${t.digest.substring(2)}.dat`),l;try{let c=await M.statPromise(a);if(c&&(!t.mtimeMs||c.mtimeMs>t.mtimeMs||c.mtimeMs<t.mtimeMs-Yze))if(await Ai.checksumFile(a,{baseFs:M,algorithm:"sha1"})!==t.digest){let g=v.join(i,Yr(`${gM.default.randomBytes(16).toString("hex")}.tmp`));await M.renamePromise(a,g);let h=await n.readFilePromise(r);await M.writeFilePromise(g,h);try{await M.linkPromise(g,a),t.mtimeMs=new Date().getTime(),await M.unlinkPromise(g)}catch{}}else t.mtimeMs||(t.mtimeMs=Math.ceil(c.mtimeMs));await M.linkPromise(a,e),l=!0}catch{l=!1}if(!l){let c=await n.readFilePromise(r);await Yle(i,a,c),t.mtimeMs=new Date().getTime();try{await M.linkPromise(a,e)}catch(u){u&&u.code&&u.code=="EXDEV"&&(s.value="hardlinks-local",await n.copyFilePromise(r,e))}}}else await n.copyFilePromise(r,e);let o=t.mode&511;o!==420&&await M.chmodPromise(e,o)}}var qle=(i=>(i.FILE="
2024-10-01 04:19:50 +02:00
`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:i}=await(0,EM.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
2024-10-01 04:49:34 +02:00
`),i}function lb(r){var e,t;if(((e=r.originalError)==null?void 0:e.name)!=="HTTPError")return!1;try{return((t=r.originalError)==null?void 0:t.response.headers["www-authenticate"].split(/,\s*/).map(n=>n.toLowerCase())).includes("otp")}catch{return!1}}function op(r){return{["npm-otp"]:r}}var cb=class{supports(e,t){if(!e.reference.startsWith(cr))return!1;let{selector:i,params:n}=x.parseRange(e.reference);return!(!_le.default.valid(i)||n===null||typeof n.__archiveUrl!="string")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,{onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${x.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck,...t.cacheOptions});return{packageFs:n,releaseFs:s,prefixPath:x.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let{params:i}=x.parseRange(e.reference);if(i===null||typeof i.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let n=await mo(i.__archiveUrl,{configuration:t.project.configuration,ident:e});return await Ci.convertToZip(n,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:x.getIdentVendorPath(e),stripComponents:1})}};var ub=class{supportsDescriptor(e,t){return!(!e.range.startsWith(cr)||!x.tryParseDescriptor(e.range.slice(cr.length),!0))}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Unreachable")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){let i=x.parseDescriptor(e.range.slice(cr.length),!0);return t.resolver.getResolutionDependencies(i,t)}async getCandidates(e,t,i){let n=x.parseDescriptor(e.range.slice(cr.length),!0);return await i.resolver.getCandidates(n,t,i)}async getSatisfying(e,t,i){let n=x.parseDescriptor(e.range.slice(cr.length),!0);return i.resolver.getSatisfying(n,t,i)}resolve(e,t){throw new Error("Unreachable")}};var $le=ve(zr()),ece=J("url");var Ts=class{supports(e,t){if(!e.reference.startsWith(cr))return!1;let i=new ece.URL(e.reference);return!(!$le.default.valid(i.pathname)||i.searchParams.has("__archiveUrl"))}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,{onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${x.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck,...t.cacheOptions});return{packageFs:n,releaseFs:s,prefixPath:x.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let i;try{i=await mo(Ts.getLocatorUrl(e),{configuration:t.project.configuration,ident:e})}catch{i=await mo(Ts.getLocatorUrl(e).replace(/%2f/g,"/"),{configuration:t.project.configuration,ident:e})}return await Ci.convertToZip(i,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:x.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,t,{configuration:i}){let n=fA(e.scope,{configuration:i}),s=Ts.getLocatorUrl(e);return t=t.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),n=n.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),t=t.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),t===n+s||t===n+s.replace(/%2f/g,"/")}static getLocatorUrl(e){let t=bt.clean(e.reference.slice(cr.length));if(t===null)throw new rt(10,"The npm semver resolver got selected, but the version isn't semver");return`${Ql(e)}/-/${e.name}-${t}.tgz`}};var tce=ve(zr());var gb=x.makeIdent(null,"node-gyp"),A5e=/\b(node-gyp|prebuild-install)\b/,fb=class{supportsDescriptor(e,t){return e.range.startsWith(cr)?!!bt.validRange(e.range.slice(cr.length)):!1}supportsLocator(e,t){if(!e.reference.startsWith(cr))return!1;let{selector:i}=x.parseRange(e.refe
`;try{n=await M.readFilePromise(e,"utf8")}catch(s){if(s.code==="ENOENT")return n;throw s}return n}var g1={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},Wue={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},aVe={configuration:{...g1,...Wue,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...g1,...Wue}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:Co,valueDefinition:{description:"",type:"SHAPE",properties:{...g1}}}},fetchers:[cb,Ts],resolvers:[ub,fb,hb]},AVe=aVe;var C1={};ct(C1,{default:()=>EVe});var DE=ve(Qn());As();var Mb=(i=>(i.All="all",i.Production="production",i.Development="development",i))(Mb||{}),Kb=(s=>(s.Info="info",s.Low="low",s.Moderate="moderate",s.High="high",s.Critical="critical",s))(Kb||{});var kE=["info","low","moderate","high","critical"];function Vue(r,e){let t=[],i=new Set,n=o=>{i.has(o)||(i.add(o),t.push(o))};for(let o of e)n(o);let s=new Set;for(;t.length>0;){let o=t.shift(),a=r.storedResolutions.get(o);if(typeof a>"u")throw new Error("Assertion failed: Expected the resolution to have been registered");let l=r.storedPackages.get(a);if(!!l){s.add(o);for(let c of l.dependencies.values())n(c.descriptorHash)}}return s}function lVe(r,e){return new Set([...r].filter(t=>!e.has(t)))}function cVe(r,e,{all:t}){let i=t?r.workspaces:[e],n=i.map(h=>h.manifest),s=new Set(n.map(h=>[...h.dependencies].map(([p,d])=>p)).flat()),o=new Set(n.map(h=>[...h.devDependencies].map(([p,d])=>p)).flat()),a=i.map(h=>[...h.dependencies.values()]).flat(),l=a.filter(h=>s.has(h.identHash)).map(h=>h.descriptorHash),c=a.filter(h=>o.has(h.identHash)).map(h=>h.descriptorHash),u=Vue(r,l),g=Vue(r,c);return lVe(g,u)}function Xue(r){let e={};for(let t of r)e[x.stringifyIdent(t)]=x.parseRange(t.range).selector;return e}function Zue(r){if(typeof r>"u")return new Set(kE);let e=kE.indexOf(r),t=kE.slice(e);return new Set(t)}function uVe(r,e){let t=Zue(e),i={};for(let n of t)i[n]=r[n];return i}function _ue(r,e){var i;let t=uVe(r,e);for(let n of Object.keys(t))if((i=t[n])!=null?i:0>0)return!0;return!1}function $ue(r,e){var s;let t={},i={children:t},n=Object.values(r.advisories);if(e!=null){let o=Zue(e);n=n.filter(a=>o.has(a.severity))}for(let o of me.sortMap(n,a=>a.module_name))t[o.module_name]={label:o.module_name,value:$.tuple($.Type.RANGE,o.findings.map(a=>a.version).join(", ")),children:{ID:{label:"ID",value:$.tuple($.Type.NUMBER,o.id)},Issue:{label:"Issue",value:$.tuple($.Type.NO_HINT,o.title)},URL:{label:"URL",value:$.tuple($.Type.URL,o.url)},Severity:{label:"Severity",value:$.tuple($.Type.NO_HINT,o.severity)},["Vulnerable Versions"]:{label:"Vulnerable Versions",value:$.tuple($.Type.RANGE,o.vulnerable_versions)},["Patched Versions"]:{label:"Patched Versions",value:$.tuple($.Type.RANGE,o.patched_versions)},Via:{label:"Via",value:$.tuple($.Type.NO_HINT,Array.from(new Set(o.findings.map(a=>a.paths).flat().map(a=>a.split(">")[0]))).join(", "))},Recommendation:{label:"Recommendation",value:$.tuple($.Type.NO_HINT,(s=o.recommendation)==null?void 0:s.replace(/\n/g," "))}}};return i}function ege(r,e,{all:t,environment:i}){let n=t?r.workspaces:[e],s=["all","production"].includes(i),o=[];if(s)for(let c of n)for(let u of c.manifest.dependencies.values())o.push(u);let a=["all","development"].includes(i),l=[];if(a)for(let c of n)for(let u of c.manifest.devDependencies.values())l.push(u);return Xue([...o,...l].filter(c=>x.parseR
2024-10-01 04:19:50 +02:00
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${kE.map(t=>`\`${t}\``).join(", ")}.
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why <package>\` to get more information as to who depends on them.
2024-10-01 04:49:34 +02:00
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]});var h1=ve(zr()),p1=J("util"),tg=class extends xe{constructor(){super(...arguments);this.fields=z.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=z.Rest()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i}=await Ge.find(t,this.context.cwd),n=typeof this.fields<"u"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,s=[],o=!1,a=await He.start({configuration:t,includeFooter:!1,json:this.json,stdout:this.context.stdout},async l=>{for(let c of this.packages){let u;if(c==="."){let F=i.topLevelWorkspace;if(!F.manifest.name)throw new we(`Missing ${$.pretty(t,"name",$.Type.CODE)} field in ${K.fromPortablePath(v.join(F.cwd,St.manifest))}`);u=x.makeDescriptor(F.manifest.name,"unknown")}else u=x.parseDescriptor(c);let g=xt.getIdentUrl(u),h=d1(await xt.get(g,{configuration:t,ident:u,jsonResponse:!0,customErrorMessage:xt.customPackageError})),p=Object.keys(h.versions).sort(h1.default.compareLoose),m=h["dist-tags"].latest||p[p.length-1],y=bt.validRange(u.range);if(y){let F=h1.default.maxSatisfying(p,y);F!==null?m=F:(l.reportWarning(0,`Unmet range ${x.prettyRange(t,u.range)}; falling back to the latest version`),o=!0)}else Object.prototype.hasOwnProperty.call(h["dist-tags"],u.range)?m=h["dist-tags"][u.range]:u.range!=="unknown"&&(l.reportWarning(0,`Unknown tag ${x.prettyRange(t,u.range)}; falling back to the latest version`),o=!0);let B=h.versions[m],S={...h,...B,version:m,versions:p},P;if(n!==null){P={};for(let F of n){let H=S[F];if(typeof H<"u")P[F]=H;else{l.reportWarning(1,`The ${$.pretty(t,F,$.Type.CODE)} field doesn't exist inside ${x.prettyIdent(t,u)}'s information`),o=!0;continue}}}else this.json||(delete S.dist,delete S.readme,delete S.users),P=S;l.reportJson(P),this.json||s.push(P)}});p1.inspect.styles.name="cyan";for(let l of s)(l!==s[0]||o)&&this.context.stdout.write(`
2024-10-01 04:19:50 +02:00
`),this.context.stdout.write(`${(0,p1.inspect)(l,{depth:1/0,colors:!0,compact:!1})}
2024-10-01 04:49:34 +02:00
`);return a.exitCode()}};tg.paths=[["npm","info"]],tg.usage=be.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});function d1(r){if(Array.isArray(r)){let e=[];for(let t of r)t=d1(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=d1(r[t]);i&&(e[t]=i)}return e}else return r||null}var rge=ve(Um()),rg=class extends xe{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=z.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i=await Ub({configuration:t,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await He.start({configuration:t,stdout:this.context.stdout,includeFooter:!1},async s=>{let o=await pVe({configuration:t,registry:i,report:s,stdin:this.context.stdin,stdout:this.context.stdout}),a=await fVe(i,o,t);return await hVe(i,a,{alwaysAuth:this.alwaysAuth,scope:this.scope}),s.reportInfo(0,"Successfully logged in")})).exitCode()}};rg.paths=[["npm","login"]],rg.usage=be.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});async function Ub({scope:r,publish:e,configuration:t,cwd:i}){return r&&e?nr.getScopeRegis
2024-10-01 04:19:50 +02:00
This command will list all tags of a package from the npm registry.
If the package is not specified, Yarn will default to the current workspace.
2024-10-01 04:49:34 +02:00
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});async function RE(r,e){let t=`/-/package${xt.getIdentUrl(r)}/dist-tags`;return xt.get(t,{configuration:e,ident:r,jsonResponse:!0,customErrorMessage:xt.customPackageError})}var og=class extends xe{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd);if(!n)throw new lt(i.cwd,this.context.cwd);let s=x.parseDescriptor(this.package,!0),o=s.range;if(!nge.default.valid(o))throw new we(`The range ${$.pretty(t,s.range,$.Type.RANGE)} must be a valid semver version`);let a=nr.getPublishRegistry(n.manifest,{configuration:t}),l=$.pretty(t,s,$.Type.IDENT),c=$.pretty(t,o,$.Type.RANGE),u=$.pretty(t,this.tag,$.Type.CODE);return(await He.start({configuration:t,stdout:this.context.stdout},async h=>{let p=await RE(s,t);Object.prototype.hasOwnProperty.call(p,this.tag)&&p[this.tag]===o&&h.reportWarning(0,`Tag ${u} is already set to version ${c}`);let d=`/-/package${xt.getIdentUrl(s)}/dist-tags/${encodeURIComponent(this.tag)}`;await xt.put(d,o,{configuration:t,registry:a,ident:s,jsonRequest:!0,jsonResponse:!0}),h.reportInfo(0,`Tag ${u} added to version ${c} of package ${l}`)})).exitCode()}};og.paths=[["npm","tag","add"]],og.usage=be.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
2024-10-01 04:19:50 +02:00
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
2024-10-01 04:49:34 +02:00
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});var ag=class extends xe{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){if(this.tag==="latest")throw new we("The 'latest' tag cannot be removed.");let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd);if(!n)throw new lt(i.cwd,this.context.cwd);let s=x.parseIdent(this.package),o=nr.getPublishRegistry(n.manifest,{configuration:t}),a=$.pretty(t,this.tag,$.Type.CODE),l=$.pretty(t,s,$.Type.IDENT),c=await RE(s,t);if(!Object.prototype.hasOwnProperty.call(c,this.tag))throw new we(`${a} is not a tag of package ${l}`);return(await He.start({configuration:t,stdout:this.context.stdout},async g=>{let h=`/-/package${xt.getIdentUrl(s)}/dist-tags/${encodeURIComponent(this.tag)}`;await xt.del(h,{configuration:t,registry:o,ident:s,jsonResponse:!0}),g.reportInfo(0,`Tag ${a} removed from package ${l}`)})).exitCode()}};ag.paths=[["npm","tag","remove"]],ag.usage=be.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
2024-10-01 04:19:50 +02:00
This command will remove a tag from a package from the npm registry.
2024-10-01 04:49:34 +02:00
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Ag=class extends xe{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),i;return this.scope&&this.publish?i=nr.getScopeRegistry(this.scope,{configuration:t,type:nr.RegistryType.PUBLISH_REGISTRY}):this.scope?i=nr.getScopeRegistry(this.scope,{configuration:t}):this.publish?i=nr.getPublishRegistry((await Hh(t,this.context.cwd)).manifest,{configuration:t}):i=nr.getDefaultRegistry({configuration:t}),(await He.start({configuration:t,stdout:this.context.stdout},async s=>{var a,l;let o;try{o=await xt.get("/-/whoami",{configuration:t,registry:i,authType:xt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?x.makeIdent(this.scope,""):void 0})}catch(c){if(((a=c.response)==null?void 0:a.statusCode)===401||((l=c.response)==null?void 0:l.statusCode)===403){s.reportError(41,"Authentication failed - your credentials may have expired");return}else throw c}s.reportInfo(0,o.username)})).exitCode()}};Ag.paths=[["npm","whoami"]],Ag.usage=be.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var mVe={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[eg,tg,rg,ig,ng,og,sg,ag,Ag]},EVe=mVe;var S1={};ct(S1,{default:()=>TVe,patchUtils:()=>lg});var lg={};ct(lg,{applyPatchFile:()=>jb,diffFolders:()=>Q1,ensureUnpatchedDescriptor:()=>E1,extractPackageToDisk:()=>B1,extractPatchFlags:()=>uge,isParentRequired:()=>w1,loadPatchFiles:()=>LE,makeDescriptor:()=>I1,makeLocator:()=>y1,makePatchHash:()=>b1,parseDescriptor:()=>NE,parseLocator:()=>TE,parsePatchFile:()=>FE});var IVe=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Ep(r){return v.relative(Te.root,v.resolve(Te.root,K.toPortablePath(r)))}function yVe(r){let e=r.trim().match(IVe);if(!e)throw new Error(`Bad header line: '${r}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var wVe=420,BVe=493;var sge=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),QVe=r=>({header:yVe(r),parts:[]}),bVe={["@"]:"header",["-"]:"deletion",["+"]:"insertion",[" "]:"context",["\\"]:"pragma",undefined:"context"};function SVe(r){let e=[],t=sge(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=sge()}for(let l=0;l<r.length;l++){let c=r[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",
2024-10-01 04:19:50 +02:00
`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":`
2024-10-01 04:49:34 +02:00
`):"";await e.mkdirpPromise(v.dirname(n.path),{chmod:493,utimes:[xr.SAFE_TIME,xr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,xr.SAFE_TIME,xr.SAFE_TIME)}break;case"patch":await yp(e,n.path,async()=>{await DVe(n,{baseFs:e,dryRun:t})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(oge(n.newMode)!==oge(o))continue;await yp(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:me.assertNever(n);break}}function oge(r){return(r&64)>0}function age(r){return r.replace(/\s+$/,"")}function kVe(r,e){return age(r)===age(e)}async function DVe({hunks:r,path:e},{baseFs:t,dryRun:i=!1}){let n=await t.statSync(e).mode,o=(await t.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of r){let h=Math.max(c,g.header.patched.start+l),p=Math.max(0,h-c),d=Math.max(0,o.length-h-g.header.original.length),m=Math.max(p,d),y=0,B=0,S=null;for(;y<=m;){if(y<=p&&(B=h-y,S=Age(g,o,B),S!==null)){y=-y;break}if(y<=d&&(B=h+y,S=Age(g,o,B),S!==null))break;y+=1}if(S===null)throw new Ip(r.indexOf(g),g);a.push(S),l+=y,c=B+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let h of g)switch(h.type){case"splice":{let p=h.index+u;o.splice(p,h.numToDelete,...h.linesToInsert),u+=h.linesToInsert.length-h.numToDelete}break;case"pop":o.pop();break;case"push":o.push(h.line);break;default:me.assertNever(h);break}await t.writeFilePromise(e,o.join(`
`),{mode:n})}function Age(r,e,t){let i=[];for(let n of r.parts)switch(n.type){case"context":case"deletion":{for(let s of n.lines){let o=e[t];if(o==null||!kVe(o,s))return null;t+=1}n.type==="deletion"&&(i.push({type:"splice",index:t-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case"insertion":i.push({type:"splice",index:t,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:me.assertNever(n.type);break}return i}var FVe=/^builtin<([^>]+)>$/;function m1(r,e){let{source:t,selector:i,params:n}=x.parseRange(r);if(t===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>K.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?x.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(t);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function NE(r){let{sourceItem:e,...t}=m1(r.range,x.parseDescriptor);return{...t,sourceDescriptor:e}}function TE(r){let{sourceItem:e,...t}=m1(r.reference,x.parseLocator);return{...t,sourceLocator:e}}function E1(r){if(!r.range.startsWith("patch:"))return r;let{sourceItem:e}=m1(r.range,x.parseDescriptor);return e}function lge({parentLocator:r,sourceItem:e,patchPaths:t,sourceVersion:i,patchHash:n},s){let o=r!==null?{locator:x.stringifyLocator(r)}:{},a=typeof i<"u"?{version:i}:{},l=typeof n<"u"?{hash:n}:{};return x.makeRange({protocol:"patch:",source:s(e),selector:t.join("&"),params:{...a,...l,...o}})}function I1(r,{parentLocator:e,sourceDescriptor:t,patchPaths:i}){return x.makeDescriptor(r,lge({parentLocator:e,sourceItem:t,patchPaths:i},x.stringifyDescriptor))}function y1(r,{parentLocator:e,sourcePackage:t,patchPaths:i,patchHash:n}){return x.makeLocator(r,lge({parentLocator:e,sourceItem:t,sourceVersion:t.version,patchPaths:i,patchHash:n},x.stringifyLocator))}function cge({onAbsolute:r,onRelative:e,onBuiltin:t},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(FVe);return s!==null?t(s[1]):v.isAbsolute(i)?r(i):e(i)}function uge(r){let e=r.startsWith("~");return e&&(r=r.slice(1)),{optional:e}}function w1(r){return cge({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},r)}async function LE(r,e,t){let i=r!==null?await t.fetcher.fetch(r,t):null,n=i&&i.localPath?{packageFs:new jt(Te.root),prefixPath:v.relative(Te.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await me.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=uge(o),l=await cge({onAbsolute:async()=>await M.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(v.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await t.project.configuration.firstHook(u=>u.getBuiltinPatch,t.project,c)},o);return{...a,source:l}})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
2024-10-01 04:19:50 +02:00
`));return s}async function B1(r,{cache:e,project:t}){let i=t.storedPackages.get(r.locatorHash);if(typeof i>"u")throw new Error("Assertion failed: Expected the package to be registered");let n=t.storedChecksums,s=new $r,o=t.configuration.makeFetcher(),a=await o.fetch(r,{cache:e,project:t,fetcher:o,checksums:n,report:s}),l=await M.mktempPromise(),c=v.join(l,"source"),u=v.join(l,"user"),g=v.join(l,".yarn-patch.json");return await Promise.all([M.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),M.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),M.writeJsonPromise(g,{locator:x.stringifyLocator(r),version:i.version})]),M.detachTemp(l),u}async function Q1(r,e){let t=K.fromPortablePath(r).replace(/\\/g,"/"),i=K.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await pr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",t,i],{cwd:K.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(s.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
The following error was reported by 'git':
2024-10-01 04:49:34 +02:00
${s}`);let o=t.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${me.escapeRegExp(`/${o(t)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${me.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(me.escapeRegExp(`${t}/`),"g"),"").replace(new RegExp(me.escapeRegExp(`${i}/`),"g"),"")}function b1(r,e){let t=[];for(let{source:i}of r){if(i===null)continue;let n=FE(i);for(let s of n){let{semverExclusivity:o,...a}=s;o!==null&&e!==null&&!bt.satisfiesWithPrereleases(e,o)||t.push(JSON.stringify(a))}}return Ai.makeHash(`${3}`,...t).slice(0,6)}function gge(r,{configuration:e,report:t}){for(let i of r.parts)for(let n of i.lines)switch(i.type){case"context":t.reportInfo(null,` ${$.pretty(e,n,"grey")}`);break;case"deletion":t.reportError(28,`- ${$.pretty(e,n,$.Type.REMOVED)}`);break;case"insertion":t.reportError(28,`+ ${$.pretty(e,n,$.Type.ADDED)}`);break;default:me.assertNever(i.type)}}var Gb=class{supports(e,t){return!!e.reference.startsWith("patch:")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,{onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${x.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,t),skipIntegrityCheck:t.skipIntegrityCheck,...t.cacheOptions});return{packageFs:n,releaseFs:s,prefixPath:x.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async patchPackage(e,t){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=TE(e),a=await LE(i,o,t),l=await M.mktempPromise(),c=v.join(l,"current.zip"),u=await t.fetcher.fetch(n,t),g=x.getIdentVendorPath(e),h=await an(),p=new qr(c,{libzip:h,create:!0,level:t.project.configuration.get("compressionLevel")});await me.releaseAfterUseAsync(async()=>{await p.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),p.saveAndClose();for(let{source:d,optional:m}of a){if(d===null)continue;let y=new qr(c,{libzip:h,level:t.project.configuration.get("compressionLevel")}),B=new jt(v.resolve(Te.root,g),{baseFs:y});try{await jb(FE(d),{baseFs:B,version:s})}catch(S){if(!(S instanceof Ip))throw S;let P=t.project.configuration.get("enableInlineHunks"),F=!P&&!m?" (set enableInlineHunks for details)":"",H=`${x.prettyLocator(t.project.configuration,e)}: ${S.message}${F}`,q=_=>{!P||gge(S.hunk,{configuration:t.project.configuration,report:_})};if(y.discardAndClose(),m){t.report.reportWarningOnce(66,H,{reportExtra:q});continue}else throw new rt(66,H,q)}y.saveAndClose()}return new qr(c,{libzip:h,level:t.project.configuration.get("compressionLevel")})}};var Yb=class{supportsDescriptor(e,t){return!!e.range.startsWith("patch:")}supportsLocator(e,t){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){let{patchPaths:n}=NE(e);return n.every(s=>!w1(s))?e:x.bindDescriptor(e,{locator:x.stringifyLocator(t)})}getResolutionDependencies(e,t){let{sourceDescriptor:i}=NE(e);return[i]}async getCandidates(e,t,i){if(!i.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:n,sourceDescriptor:s,patchPaths:o}=NE(e),a=await LE(n,o,i.fetchOptions),l=t.get(s.descriptorHash);if(typeof l>"u")throw new Error("Assertion failed: The dependency should have been resolved");let c=b1(a,l.version);return[y1(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,t,i){return null}async resolve(e,t){let{sourceLocator:i}=TE(e);return{...await t.resolver.resolve(i,t),...e}}};var cg=class extends xe{constructor(){super(...arguments);this.save=z.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=z.String()}async execute(){let t=await Ee.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await Ge.find(t,this.context.cwd);if(!n)throw new lt(i.cwd,this.context.cwd);await i.restoreInstallState();let s=v.resolve(this.context.cwd,K.toPortablePath(this.patchFolder)),o=v
2024-10-01 04:19:50 +02:00
${a.map(l=>`
2024-10-01 04:49:34 +02:00
- ${x.prettyLocator(t,l)}`).join("")}`);o=a[0]}if(!i.storedPackages.has(o.locatorHash))throw new we("No package found in the project for the given locator");await He.start({configuration:t,json:this.json,stdout:this.context.stdout},async a=>{let l=await B1(o,{cache:s,project:i});a.reportJson({locator:x.stringifyLocator(o),path:K.fromPortablePath(l)}),a.reportInfo(0,`Package ${x.prettyLocator(t,o)} got extracted with success!`),a.reportInfo(0,`You can now edit the following folder: ${$.pretty(t,K.fromPortablePath(l),"magenta")}`),a.reportInfo(0,`Once you are done run ${$.pretty(t,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${K.fromPortablePath(l)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};ug.paths=[["patch"]],ug.usage=be.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n \n Once you're done with your changes, run `yarn patch-commit -s <path>` (with `<path>` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n "});var NVe={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[cg,ug],fetchers:[Gb],resolvers:[Yb]},TVe=NVe;var k1={};ct(k1,{default:()=>MVe});var qb=class{supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let i=x1(),n=t.project.installersCustomData.get(i);if(!n)throw new we(`The project in ${$.pretty(t.project.configuration,`${t.project.cwd}/package.json`,$.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=n.pathByLocator.get(e.locatorHash);if(typeof s>"u")throw new we(`Couldn't find ${x.prettyLocator(t.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return s}async findPackageLocator(e,t){if(!this.isEnabled(t))return null;let i=x1(),n=t.project.installersCustomData.get(i);if(!n)throw new we(`The project in ${$.pretty(t.project.configuration,`${t.project.cwd}/package.json`,$.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(s){let l=n.locatorByPath.get(s[1]);if(l)return l}let o=e,a=e;do{a=o,o=v.dirname(a);let l=n.locatorByPath.get(a);if(l)return l}while(o!==a);return null}makeInstaller(e){return new v1(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},v1=class{constructor(e){this.opts=e;this.asyncActions=new me.AsyncActions(10);this.customData={pathByLocator:new Map,locatorByPath:new Map}}getCustomDataKey(){return x1()}attachCustomData(e){}async installPackage(e,t,i){switch(e.linkType){case"SOFT":return this.installPackageSoft(e,t,i);case"HARD":return this.installPackageHard(e,t,i)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,t,i){let n=v.resolve(t.packageFs.getRealPath(),t.prefixPath);return this.customData.pathByLocator.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}async installPackageHard(e,t,i){var u;let n=LVe(e,{project:this.opts.project});this.customData.locatorByPath.set(n,x.stringifyLocator(e)),this.customData.pathByLocator.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await M.mkdirPromise(n,{recursive:!0}),await M.copyPromise(n,t.prefixPath,{baseFs:t.packageFs,overwrite:!1})}));let o=x.isVirtualLocator(e)?x.devirtualizeLocator(e):e,a={manifest:(u=await ot.tryFind(t.prefixPath,{baseFs:t.packageFs}))!=null?u:new ot,misc:{hasBindingGyp:po.hasBindingGyp(t)}},l=this.opts.project.getDependencyMeta(o,e.version),c=po.ext
2024-10-01 04:19:50 +02:00
/*!
* buildToken
* Builds OAuth token prefix (helper function)
*
* @name buildToken
* @function
* @param {GitUrl} obj The parsed Git url object.
* @return {String} token prefix
*/
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
/**
@license
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
/**
@license
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
@license
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
/**
@license
The MIT License (MIT)
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/