mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
786 lines
2.1 MiB
JavaScript
786 lines
2.1 MiB
JavaScript
|
#!/usr/bin/env node
|
|||
|
/* eslint-disable */
|
|||
|
//prettier-ignore
|
|||
|
(()=>{var afe=Object.create,Oh=Object.defineProperty,Afe=Object.defineProperties,lfe=Object.getOwnPropertyDescriptor,cfe=Object.getOwnPropertyDescriptors,ufe=Object.getOwnPropertyNames,OE=Object.getOwnPropertySymbols,gfe=Object.getPrototypeOf,lQ=Object.prototype.hasOwnProperty,iM=Object.prototype.propertyIsEnumerable;var nM=(t,e,r)=>e in t?Oh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N=(t,e)=>{for(var r in e||(e={}))lQ.call(e,r)&&nM(t,r,e[r]);if(OE)for(var r of OE(e))iM.call(e,r)&&nM(t,r,e[r]);return t},te=(t,e)=>Afe(t,cfe(e)),ffe=t=>Oh(t,"__esModule",{value:!0});var Tr=(t,e)=>{var r={};for(var i in t)lQ.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&OE)for(var i of OE(t))e.indexOf(i)<0&&iM.call(t,i)&&(r[i]=t[i]);return r},hfe=(t,e)=>()=>(t&&(e=t(t=0)),e),w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ft=(t,e)=>{for(var r in e)Oh(t,r,{get:e[r],enumerable:!0})},pfe=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ufe(e))!lQ.call(t,i)&&i!=="default"&&Oh(t,i,{get:()=>e[i],enumerable:!(r=lfe(e,i))||r.enumerable});return t},ge=t=>pfe(ffe(Oh(t!=null?afe(gfe(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var PM=w(($Xe,vM)=>{vM.exports=SM;SM.sync=Rfe;var kM=require("fs");function Ffe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}function xM(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Ffe(e,r)}function SM(t,e,r){kM.stat(t,function(i,n){r(i,i?!1:xM(n,t,e))})}function Rfe(t,e){return xM(kM.statSync(t),t,e)}});var LM=w((eZe,DM)=>{DM.exports=RM;RM.sync=Nfe;var FM=require("fs");function RM(t,e,r){FM.stat(t,function(i,n){r(i,i?!1:NM(n,e))})}function Nfe(t,e){return NM(FM.statSync(t),e)}function NM(t,e){return t.isFile()&&Lfe(t,e)}function Lfe(t,e){var r=t.mode,i=t.uid,n=t.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=r&c||r&l&&n===o||r&a&&i===s||r&u&&s===0;return g}});var OM=w((rZe,TM)=>{var tZe=require("fs"),XE;process.platform==="win32"||global.TESTING_WINDOWS?XE=PM():XE=LM();TM.exports=vQ;vQ.sync=Tfe;function vQ(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){vQ(t,e||{},function(s,o){s?n(s):i(o)})})}XE(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function Tfe(t,e){try{return XE.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var YM=w((iZe,MM)=>{var Ju=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",UM=require("path"),Ofe=Ju?";":":",KM=OM(),HM=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),jM=(t,e)=>{let r=e.colon||Ofe,i=t.match(/\//)||Ju&&t.match(/\\/)?[""]:[...Ju?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ju?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ju?n.split(r):[""];return Ju&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},GM=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=jM(t,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(HM(t));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=UM.join(h,t),m=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];KM(c+p,{pathExt:s},(m,y)=>{if(!m&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Mfe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=jM(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=UM.join(l,t),u=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let g=0;g<i.length;g++){let f=u+i[g];try{if(KM.
|
|||
|
`,Gn=Ce(`\\
|
|||
|
`,!1),fs=function(){return""},hs="\\",pt=Ce("\\",!1),xo=/^[\\$"`]/,lt=_e(["\\","$",'"',"`"],!1,!1),mn=function(C){return C},v="\\a",Tt=Ce("\\a",!1),Tu=function(){return"a"},Yl="\\b",Sh=Ce("\\b",!1),kh=function(){return"\b"},xh=/^[Ee]/,Ph=_e(["E","e"],!1,!1),Dh=function(){return""},G="\\f",yt=Ce("\\f",!1),DA=function(){return"\f"},$i="\\n",ql=Ce("\\n",!1),$e=function(){return`
|
|||
|
`},wa="\\r",Ou=Ce("\\r",!1),SE=function(){return"\r"},Rh="\\t",kE=Ce("\\t",!1),gr=function(){return" "},Yn="\\v",Jl=Ce("\\v",!1),Fh=function(){return"\v"},Vs=/^[\\'"?]/,Ba=_e(["\\","'",'"',"?"],!1,!1),En=function(C){return String.fromCharCode(parseInt(C,16))},Oe="\\x",Mu=Ce("\\x",!1),Wl="\\u",Xs=Ce("\\u",!1),zl="\\U",RA=Ce("\\U",!1),Uu=function(C){return String.fromCodePoint(parseInt(C,16))},Ku=/^[0-7]/,ba=_e([["0","7"]],!1,!1),Qa=/^[0-9a-fA-f]/,it=_e([["0","9"],["a","f"],["A","f"]],!1,!1),Po=ot(),FA="-",_l=Ce("-",!1),Zs="+",Vl=Ce("+",!1),xE=".",Nh=Ce(".",!1),Hu=function(C,b,F){return{type:"number",value:(C==="-"?-1:1)*parseFloat(b.join("")+"."+F.join(""))}},Lh=function(C,b){return{type:"number",value:(C==="-"?-1:1)*parseInt(b.join(""))}},PE=function(C){return N({type:"variable"},C)},Xl=function(C){return{type:"variable",name:C}},DE=function(C){return C},ju="*",NA=Ce("*",!1),Lr="/",RE=Ce("/",!1),$s=function(C,b,F){return{type:b==="*"?"multiplication":"division",right:F}},eo=function(C,b){return b.reduce((F,H)=>N({left:F},H),C)},Gu=function(C,b,F){return{type:b==="+"?"addition":"subtraction",right:F}},LA="$((",R=Ce("$((",!1),q="))",de=Ce("))",!1),He=function(C){return C},Te="$(",Xe=Ce("$(",!1),Et=function(C){return C},Rt="${",qn=Ce("${",!1),Jb=":-",xO=Ce(":-",!1),PO=function(C,b){return{name:C,defaultValue:b}},Wb=":-}",DO=Ce(":-}",!1),RO=function(C){return{name:C,defaultValue:[]}},zb=":+",FO=Ce(":+",!1),NO=function(C,b){return{name:C,alternativeValue:b}},_b=":+}",LO=Ce(":+}",!1),TO=function(C){return{name:C,alternativeValue:[]}},Vb=function(C){return{name:C}},OO="$",MO=Ce("$",!1),UO=function(C){return e.isGlobPattern(C)},KO=function(C){return C},Xb=/^[a-zA-Z0-9_]/,Zb=_e([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),$b=function(){return O()},eQ=/^[$@*?#a-zA-Z0-9_\-]/,tQ=_e(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),HO=/^[(){}<>$|&; \t"']/,Yu=_e(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),rQ=/^[<>&; \t"']/,iQ=_e(["<",">","&",";"," "," ",'"',"'"],!1,!1),FE=/^[ \t]/,NE=_e([" "," "],!1,!1),B=0,Ke=0,TA=[{line:1,column:1}],d=0,E=[],I=0,D;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 O(){return t.substring(Ke,B)}function V(){return It(Ke,B)}function ie(C,b){throw b=b!==void 0?b:It(Ke,B),Mi([ut(C)],t.substring(Ke,B),b)}function Be(C,b){throw b=b!==void 0?b:It(Ke,B),Jn(C,b)}function Ce(C,b){return{type:"literal",text:C,ignoreCase:b}}function _e(C,b,F){return{type:"class",parts:C,inverted:b,ignoreCase:F}}function ot(){return{type:"any"}}function wt(){return{type:"end"}}function ut(C){return{type:"other",description:C}}function nt(C){var b=TA[C],F;if(b)return b;for(F=C-1;!TA[F];)F--;for(b=TA[F],b={line:b.line,column:b.column};F<C;)t.charCodeAt(F)===10?(b.line++,b.column=1):b.column++,F++;return TA[C]=b,b}function It(C,b){var F=nt(C),H=nt(b);return{start:{offset:C,line:F.line,column:F.column},end:{offset:b,line:H.line,column:H.column}}}function ke(C){B<d||(B>d&&(d=B,E=[]),E.push(C))}function Jn(C,b){return new nc(C,null,null,b)}function Mi(C,b,F){return new nc(nc.buildMessage(C,b),C,b,F)}function OA(){var C,b;return C=B,b=Gr(),b===r&&(b=null),b!==r&&(Ke=C,b=s(b)),C=b,C}function Gr(){var C,b,F,H,ue;if(C=B,b=Yr(),b!==r){for(F=[],H=je();H!==r;)F.push(H),H=je();F!==r?(H=va(),H!==r?(ue=ps(),ue===r&&(ue=null),ue!==r?(Ke=C,b=o(b,H,ue),C=b):(B=C,C=r)):(B=C,C=r)):(B=C,C=r)}else B=C,C=r;if(C===r)if(C=B,b=Yr(),b!==r){for(F=[],H=je();H!==r;)F.push(H),H=je();F!==r?(H=va(),H===r&&(H=null),H!==r?(Ke=C,b=a(b,H),C=b):(B=C,C=r)):(B=C,C=r)}else B=C,C=r;return C}function ps(){var C,b,F,H,ue;for(C=B,b=[],F=je();F!==r;)b.push(F),F=je();if(b!==r)if(F=Gr(),F!==r){for(H=[],ue=je();ue!==r;)H.push(ue),ue=je();H!==r?(Ke=C,b=l(F),C=b):(B=C,C=r)}else B=C,C=r;else B=C,C=r;return C}function va(){var C;return t.charCodeAt(B)===59?(C=c,B++):(C=r,I===0&&ke(u)),C===r&&(t.charCodeAt(B)===38?(C=g,B++):(C=r,I===0&&ke(f))),C}function Yr(){var C,b,F;return C=B,b=jO(),b!==r?(F=Yge(),F===r&&(F=null),F!==r?(Ke=C,b=h(b,F),C=b):(B=C,C=r)):(B=C,C=r)
|
|||
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>r/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>r/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),w1.repeat(" ",e)+i+a+s+`
|
|||
|
`+w1.repeat(" ",e+this.position-n+i.length)+"^"};HQ.prototype.toString=function(e){var r,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(i+=`:
|
|||
|
`+r)),i};y1.exports=HQ});var li=w((RZe,b1)=>{"use strict";var Q1=Vu(),fhe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],hhe=["scalar","sequence","mapping"];function phe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}function dhe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(fhe.indexOf(r)===-1)throw new Q1('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=phe(e.styleAliases||null),hhe.indexOf(this.kind)===-1)throw new Q1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}b1.exports=dhe});var lc=w((FZe,v1)=>{"use strict";var S1=Ac(),nI=Vu(),Che=li();function jQ(t,e,r){var i=[];return t.include.forEach(function(n){r=jQ(n,e,r)}),t[e].forEach(function(n){r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),r.push(n)}),r.filter(function(n,s){return i.indexOf(s)===-1})}function mhe(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function i(n){t[n.kind][n.tag]=t.fallback[n.tag]=n}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(i);return t}function Xu(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new nI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=jQ(this,"implicit",[]),this.compiledExplicit=jQ(this,"explicit",[]),this.compiledTypeMap=mhe(this.compiledImplicit,this.compiledExplicit)}Xu.DEFAULT=null;Xu.create=function(){var e,r;switch(arguments.length){case 1:e=Xu.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new nI("Wrong number of arguments for Schema.create function")}if(e=S1.toArray(e),r=S1.toArray(r),!e.every(function(i){return i instanceof Xu}))throw new nI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(i){return i instanceof Che}))throw new nI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Xu({include:e,explicit:r})};v1.exports=Xu});var x1=w((NZe,k1)=>{"use strict";var Ehe=li();k1.exports=new Ehe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var D1=w((LZe,P1)=>{"use strict";var Ihe=li();P1.exports=new Ihe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var F1=w((TZe,R1)=>{"use strict";var yhe=li();R1.exports=new yhe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var sI=w((OZe,N1)=>{"use strict";var whe=lc();N1.exports=new whe({explicit:[x1(),D1(),F1()]})});var T1=w((MZe,L1)=>{"use strict";var Bhe=li();function bhe(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Qhe(){return null}function vhe(t){return t===null}L1.exports=new Bhe("tag:yaml.org,2002:null",{kind:"scalar",resolve:bhe,construct:Qhe,predicate:vhe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var M1=w((UZe,O1)=>{"use strict";var She=li();function khe(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function xhe(t){return t==="true"||t==="True"||t==="TRUE"}function Phe(t){return Object.prototype.toString.call(t)==="[object Boolean]"}O1.exports=new She("tag:yaml.org,2002:bool",{kind:"scalar",resolve:khe,construct:xhe,predicate:Phe,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE"
|
|||
|
\r`;function tpe(t){if(t===null)return!1;var e,r,i=0,n=t.length,s=qQ;for(r=0;r<n;r++)if(e=s.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;i+=6}return i%8==0}function rpe(t){var e,r,i=t.replace(/[\r\n=]/g,""),n=i.length,s=qQ,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 r=n%4*6,r===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):r===18?(a.push(o>>10&255),a.push(o>>2&255)):r===12&&a.push(o>>4&255),cc?cc.from?cc.from(a):new cc(a):a}function ipe(t){var e="",r=0,i,n,s=t.length,o=qQ;for(i=0;i<s;i++)i%3==0&&i&&(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[i];return n=s%3,n===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):n===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):n===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}function npe(t){return cc&&cc.isBuffer(t)}Z1.exports=new epe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:tpe,construct:rpe,predicate:npe,represent:ipe})});var rU=w((WZe,tU)=>{"use strict";var spe=li(),ope=Object.prototype.hasOwnProperty,ape=Object.prototype.toString;function Ape(t){if(t===null)return!0;var e=[],r,i,n,s,o,a=t;for(r=0,i=a.length;r<i;r+=1){if(n=a[r],o=!1,ape.call(n)!=="[object Object]")return!1;for(s in n)if(ope.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 lpe(t){return t!==null?t:[]}tU.exports=new spe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ape,construct:lpe})});var nU=w((zZe,iU)=>{"use strict";var cpe=li(),upe=Object.prototype.toString;function gpe(t){if(t===null)return!0;var e,r,i,n,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(i=o[e],upe.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[e]=[n[0],i[n[0]]]}return!0}function fpe(t){if(t===null)return[];var e,r,i,n,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1)i=o[e],n=Object.keys(i),s[e]=[n[0],i[n[0]]];return s}iU.exports=new cpe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gpe,construct:fpe})});var oU=w((_Ze,sU)=>{"use strict";var hpe=li(),ppe=Object.prototype.hasOwnProperty;function dpe(t){if(t===null)return!0;var e,r=t;for(e in r)if(ppe.call(r,e)&&r[e]!==null)return!1;return!0}function Cpe(t){return t!==null?t:{}}sU.exports=new hpe("tag:yaml.org,2002:set",{kind:"mapping",resolve:dpe,construct:Cpe})});var Zu=w((VZe,aU)=>{"use strict";var mpe=lc();aU.exports=new mpe({include:[YQ()],implicit:[_1(),X1()],explicit:[eU(),rU(),nU(),oU()]})});var lU=w((XZe,AU)=>{"use strict";var Epe=li();function Ipe(){return!0}function ype(){}function wpe(){return""}function Bpe(t){return typeof t=="undefined"}AU.exports=new Epe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Ipe,construct:ype,predicate:Bpe,represent:wpe})});var uU=w((ZZe,cU)=>{"use strict";var bpe=li();function Qpe(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),i="";return!(e[0]==="/"&&(r&&(i=r[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function vpe(t){var e=t,r=/\/([gim]*)$/.exec(t),i="";return e[0]==="/"&&(r&&(i=r[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Spe(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function kpe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}cU.exports=new bpe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Qpe,construct:vpe,predicate:kpe,represent:Spe})});var hU=w(($Ze,gU)=>{"use strict";var oI;try{fU=require,oI=fU("esprima")}catch(t){typeof window!="undefined"&&(oI=window.esprima)}var fU,xpe=li();function Ppe(t){if(t===null)return!1;try{var e="("+t+")",r=oI.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch(i){return!1}}function Dpe(t){var e="("+t+")",r=oI.parse(e,{range:!0}),i=[],n;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&
|
|||
|
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function Gpe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var vU=new Array(256),SU=new Array(256);for(var eg=0;eg<256;eg++)vU[eg]=QU(eg)?1:0,SU[eg]=QU(eg);function Ype(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Lpe,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=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function kU(t,e){return new CU(e,new Npe(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function dt(t,e){throw kU(t,e)}function lI(t,e){t.onWarning&&t.onWarning.call(null,kU(t,e))}var xU={YAML:function(e,r,i){var n,s,o;e.version!==null&&dt(e,"duplication of %YAML directive"),i.length!==1&&dt(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&dt(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&dt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&lI(e,"unsupported YAML version of the document")},TAG:function(e,r,i){var n,s;i.length!==2&&dt(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],wU.test(n)||dt(e,"ill-formed tag handle (first argument) of the TAG directive"),HA.call(e.tagMap,n)&&dt(e,'there is a previously declared suffix for "'+n+'" tag handle'),BU.test(s)||dt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function jA(t,e,r,i){var n,s,o,a;if(e<r){if(a=t.input.slice(e,r),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||dt(t,"expected valid JSON character");else Ope.test(a)&&dt(t,"the stream contains non-printable characters");t.result+=a}}function PU(t,e,r,i){var n,s,o,a;for(Fa.isObject(r)||dt(t,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),o=0,a=n.length;o<a;o+=1)s=n[o],HA.call(e,s)||(e[s]=r[s],i[s]=!0)}function tg(t,e,r,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])&&dt(t,"nested arrays are not supported inside keys"),typeof n=="object"&&bU(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&bU(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)PU(t,e,s[l],r);else PU(t,e,s,r);else!t.json&&!HA.call(r,n)&&HA.call(e,n)&&(t.line=o||t.line,t.position=a||t.position,dt(t,"duplicated mapping key")),e[n]=s,delete r[n];return e}function WQ(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):dt(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function $r(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);n!==0;){for(;uc(n);)n=t.input.charCodeAt(++t.position);if(e&&n===35)do n=t.input.charCodeAt(++t.position);while(n!==10&&n!==13&&n!==0);if(Ro(n))for(WQ(t),n=t.input.charCodeAt(t.position),i++,t.lineIndent=0;n===32;)t.lineIndent++,n=t.input.charCodeAt(++t.position);else break}return r!==-1&&i!==0&&t.lineIndent<r&&lI(t,"deficient indentation"),i}function cI(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||yn(r)))}function zQ(t,e){e===1?t.result+=" ":e>1&&(t.result+=Fa.repeat(`
|
|||
|
`,e-1))}function qpe(t,e,r){var i,n,s,o,a,l,c,u,g=t.kind,f=t.result,h;if(h=t.input.charCodeAt(t.position),yn(h)||$u(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=t.input.charCodeAt(t.position+1),yn(n)||r&&$u(n)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;h!==0;){if(h===58){if(n=t.input.charCodeAt(t.position+1),yn(n)||r&&$u(n))break}else if(h===35){if(i=t.input.charCodeAt(t.position-1),yn(i))break}else{if(t.position===t.lineStart&&cI(t)||r&&$u(h))break;if(Ro(h))if(l=t.line,c=t.lineStart,u=t.lineIndent,$r(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=u;break}}a&&(jA(t,s,o,!1),zQ(t,t.line-l),s=o=t.position,a=!1),uc(h)||(o=t.position+1),h=t.input.charCodeAt(++t.position)}return jA(t,s,o,!1),t.result?!0:(t.kind=g,t.result=f,!1)}function Jpe(t,e){var r,i,n;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=n=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(jA(t,i,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)i=t.position,t.position++,n=t.position;else return!0;else Ro(r)?(jA(t,i,n,!0),zQ(t,$r(t,!1,e)),i=n=t.position):t.position===t.lineStart&&cI(t)?dt(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);dt(t,"unexpected end of the stream within a single quoted scalar")}function Wpe(t,e){var r,i,n,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return jA(t,r,t.position,!0),t.position++,!0;if(a===92){if(jA(t,r,t.position,!0),a=t.input.charCodeAt(++t.position),Ro(a))$r(t,!1,e);else if(a<256&&vU[a])t.result+=SU[a],t.position++;else if((o=Hpe(a))>0){for(n=o,s=0;n>0;n--)a=t.input.charCodeAt(++t.position),(o=Kpe(a))>=0?s=(s<<4)+o:dt(t,"expected hexadecimal character");t.result+=Gpe(s),t.position++}else dt(t,"unknown escape sequence");r=i=t.position}else Ro(a)?(jA(t,r,i,!0),zQ(t,$r(t,!1,e)),r=i=t.position):t.position===t.lineStart&&cI(t)?dt(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}dt(t,"unexpected end of the stream within a double quoted scalar")}function zpe(t,e){var r=!0,i,n=t.tag,s,o=t.anchor,a,l,c,u,g,f={},h,p,m,y;if(y=t.input.charCodeAt(t.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),y=t.input.charCodeAt(++t.position);y!==0;){if($r(t,!0,e),y=t.input.charCodeAt(t.position),y===l)return t.position++,t.tag=n,t.anchor=o,t.kind=g?"mapping":"sequence",t.result=s,!0;r||dt(t,"missed comma between flow collection entries"),p=h=m=null,c=u=!1,y===63&&(a=t.input.charCodeAt(t.position+1),yn(a)&&(c=u=!0,t.position++,$r(t,!0,e))),i=t.line,rg(t,e,aI,!1,!0),p=t.tag,h=t.result,$r(t,!0,e),y=t.input.charCodeAt(t.position),(u||t.line===i)&&y===58&&(c=!0,y=t.input.charCodeAt(++t.position),$r(t,!0,e),rg(t,e,aI,!1,!0),m=t.result),g?tg(t,s,f,p,h,m):c?s.push(tg(t,null,f,p,h,m)):s.push(h),$r(t,!0,e),y=t.input.charCodeAt(t.position),y===44?(r=!0,y=t.input.charCodeAt(++t.position)):r=!1}dt(t,"unexpected end of the stream within a flow collection")}function _pe(t,e){var r,i,n=JQ,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=t.input.charCodeAt(t.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(t.kind="scalar",t.result="";g!==0;)if(g=t.input.charCodeAt(++t.position),g===43||g===45)JQ===n?n=g===43?yU:Tpe:dt(t,"repeat of a chomping mode identifier");else if((u=jpe(g))>=0)u===0?dt(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?dt(t,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(uc(g)){do g=t.input.charCodeAt(++t.position);while(uc(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!Ro(g)&&g!==0)}for(;g!==0;){for(WQ(t),t.lineIndent=0,g=t.input.charCodeAt(t.position);(!o||t.lineIndent<a)&&g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t
|
|||
|
`,s?1+l:l):n===JQ&&s&&(t.result+=`
|
|||
|
`);break}for(i?uc(g)?(c=!0,t.result+=Fa.repeat(`
|
|||
|
`,s?1+l:l)):c?(c=!1,t.result+=Fa.repeat(`
|
|||
|
`,l+1)):l===0?s&&(t.result+=" "):t.result+=Fa.repeat(`
|
|||
|
`,l):t.result+=Fa.repeat(`
|
|||
|
`,s?1+l:l),s=!0,o=!0,l=0,r=t.position;!Ro(g)&&g!==0;)g=t.input.charCodeAt(++t.position);jA(t,r,t.position,!1)}return!0}function DU(t,e){var r,i=t.tag,n=t.anchor,s=[],o,a=!1,l;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),l=t.input.charCodeAt(t.position);l!==0&&!(l!==45||(o=t.input.charCodeAt(t.position+1),!yn(o)));){if(a=!0,t.position++,$r(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,rg(t,e,IU,!1,!0),s.push(t.result),$r(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)dt(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=i,t.anchor=n,t.kind="sequence",t.result=s,!0):!1}function Vpe(t,e,r){var i,n,s,o,a=t.tag,l=t.anchor,c={},u={},g=null,f=null,h=null,p=!1,m=!1,y;for(t.anchor!==null&&(t.anchorMap[t.anchor]=c),y=t.input.charCodeAt(t.position);y!==0;){if(i=t.input.charCodeAt(t.position+1),s=t.line,o=t.position,(y===63||y===58)&&yn(i))y===63?(p&&(tg(t,c,u,g,f,null),g=f=h=null),m=!0,p=!0,n=!0):p?(p=!1,n=!0):dt(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,y=i;else if(rg(t,r,EU,!1,!0))if(t.line===s){for(y=t.input.charCodeAt(t.position);uc(y);)y=t.input.charCodeAt(++t.position);if(y===58)y=t.input.charCodeAt(++t.position),yn(y)||dt(t,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(tg(t,c,u,g,f,null),g=f=h=null),m=!0,p=!1,n=!1,g=t.tag,f=t.result;else if(m)dt(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=a,t.anchor=l,!0}else if(m)dt(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=a,t.anchor=l,!0;else break;if((t.line===s||t.lineIndent>e)&&(rg(t,e,AI,!0,n)&&(p?f=t.result:h=t.result),p||(tg(t,c,u,g,f,h,s,o),g=f=h=null),$r(t,!0,-1),y=t.input.charCodeAt(t.position)),t.lineIndent>e&&y!==0)dt(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return p&&tg(t,c,u,g,f,null),m&&(t.tag=a,t.anchor=l,t.kind="mapping",t.result=c),m}function Xpe(t){var e,r=!1,i=!1,n,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&dt(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,n="!!",o=t.input.charCodeAt(++t.position)):n="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):dt(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!yn(o);)o===33&&(i?dt(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),wU.test(n)||dt(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),Upe.test(s)&&dt(t,"tag suffix cannot contain flow indicator characters")}return s&&!BU.test(s)&&dt(t,"tag name cannot contain such characters: "+s),r?t.tag=s:HA.call(t.tagMap,n)?t.tag=t.tagMap[n]+s:n==="!"?t.tag="!"+s:n==="!!"?t.tag="tag:yaml.org,2002:"+s:dt(t,'undeclared tag handle "'+n+'"'),!0}function Zpe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&dt(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!yn(r)&&!$u(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&dt(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function $pe(t){var e,r,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!yn(i)&&!$u(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&dt(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),HA.call(t.anchorMap,r)||dt(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],$r(t,!0,-1),!0}function rg(t,e,r,i,n){var s,o,a,l=1,c=!1,u=!1,g,f,h,p,m;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s
|
|||
|
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new Ype(t,e),i=t.indexOf("\0");for(i!==-1&&(r.position=i,dt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)ede(r);return r.documents}function FU(t,e,r){e!==null&&typeof e=="object"&&typeof r=="undefined"&&(r=e,e=null);var i=RU(t,r);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function NU(t,e){var r=RU(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new CU("expected a single document in the stream, but found more")}}function tde(t,e,r){return typeof e=="object"&&e!==null&&typeof r=="undefined"&&(r=e,e=null),FU(t,e,Fa.extend({schema:mU},r))}function rde(t,e){return NU(t,Fa.extend({schema:mU},e))}rp.exports.loadAll=FU;rp.exports.load=NU;rp.exports.safeLoadAll=tde;rp.exports.safeLoad=rde});var nK=w((r$e,_Q)=>{"use strict";var ip=Ac(),np=Vu(),ide=tp(),nde=Zu(),TU=Object.prototype.toString,OU=Object.prototype.hasOwnProperty,sde=9,sp=10,ode=13,ade=32,Ade=33,lde=34,MU=35,cde=37,ude=38,gde=39,fde=42,UU=44,hde=45,KU=58,pde=61,dde=62,Cde=63,mde=64,HU=91,jU=93,Ede=96,GU=123,Ide=124,YU=125,Ui={};Ui[0]="\\0";Ui[7]="\\a";Ui[8]="\\b";Ui[9]="\\t";Ui[10]="\\n";Ui[11]="\\v";Ui[12]="\\f";Ui[13]="\\r";Ui[27]="\\e";Ui[34]='\\"';Ui[92]="\\\\";Ui[133]="\\N";Ui[160]="\\_";Ui[8232]="\\L";Ui[8233]="\\P";var yde=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function wde(t,e){var r,i,n,s,o,a,l;if(e===null)return{};for(r={},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=t.compiledTypeMap.fallback[o],l&&OU.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[o]=a;return r}function qU(t){var e,r,i;if(e=t.toString(16).toUpperCase(),t<=255)r="x",i=2;else if(t<=65535)r="u",i=4;else if(t<=4294967295)r="U",i=8;else throw new np("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ip.repeat("0",i-e.length)+e}function Bde(t){this.schema=t.schema||ide,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=ip.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=wde(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function JU(t,e){for(var r=ip.repeat(" ",e),i=0,n=-1,s="",o,a=t.length;i<a;)n=t.indexOf(`
|
|||
|
`,i),n===-1?(o=t.slice(i),i=a):(o=t.slice(i,n+1),i=n+1),o.length&&o!==`
|
|||
|
`&&(s+=r),s+=o;return s}function VQ(t,e){return`
|
|||
|
`+ip.repeat(" ",t.indent*e)}function bde(t,e){var r,i,n;for(r=0,i=t.implicitTypes.length;r<i;r+=1)if(n=t.implicitTypes[r],n.resolve(e))return!0;return!1}function XQ(t){return t===ade||t===sde}function ig(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function Qde(t){return ig(t)&&!XQ(t)&&t!==65279&&t!==ode&&t!==sp}function WU(t,e){return ig(t)&&t!==65279&&t!==UU&&t!==HU&&t!==jU&&t!==GU&&t!==YU&&t!==KU&&(t!==MU||e&&Qde(e))}function vde(t){return ig(t)&&t!==65279&&!XQ(t)&&t!==hde&&t!==Cde&&t!==KU&&t!==UU&&t!==HU&&t!==jU&&t!==GU&&t!==YU&&t!==MU&&t!==ude&&t!==fde&&t!==Ade&&t!==Ide&&t!==pde&&t!==dde&&t!==gde&&t!==lde&&t!==cde&&t!==mde&&t!==Ede}function zU(t){var e=/^\n* /;return e.test(t)}var _U=1,VU=2,XU=3,ZU=4,uI=5;function Sde(t,e,r,i,n){var s,o,a,l=!1,c=!1,u=i!==-1,g=-1,f=vde(t.charCodeAt(0))&&!XQ(t.charCodeAt(t.length-1));if(e)for(s=0;s<t.length;s++){if(o=t.charCodeAt(s),!ig(o))return uI;a=s>0?t.charCodeAt(s-1):null,f=f&&WU(o,a)}else{for(s=0;s<t.length;s++){if(o=t.charCodeAt(s),o===sp)l=!0,u&&(c=c||s-g-1>i&&t[g+1]!==" ",g=s);else if(!ig(o))return uI;a=s>0?t.charCodeAt(s-1):null,f=f&&WU(o,a)}c=c||u&&s-g-1>i&&t[g+1]!==" "}return!l&&!c?f&&!n(t)?_U:VU:r>9&&zU(t)?uI:c?ZU:XU}function Pde(t,e,r,i){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&yde.indexOf(e)!==-1)return"'"+e+"'";var n=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-n),o=i||t.flowLevel>-1&&r>=t.flowLevel;function a(l){return bde(t,l)}switch(Sde(e,o,t.indent,s,a)){case _U:return e;case VU:return"'"+e.replace(/'/g,"''")+"'";case XU:return"|"+$U(e,t.indent)+eK(JU(e,n));case ZU:return">"+$U(e,t.indent)+eK(JU(kde(e,s),n));case uI:return'"'+xde(e,s)+'"';default:throw new np("impossible error: invalid scalar style")}}()}function $U(t,e){var r=zU(t)?String(e):"",i=t[t.length-1]===`
|
|||
|
`,n=i&&(t[t.length-2]===`
|
|||
|
`||t===`
|
|||
|
`),s=n?"+":i?"":"-";return r+s+`
|
|||
|
`}function eK(t){return t[t.length-1]===`
|
|||
|
`?t.slice(0,-1):t}function kde(t,e){for(var r=/(\n+)([^\n]*)/g,i=function(){var c=t.indexOf(`
|
|||
|
`);return c=c!==-1?c:t.length,r.lastIndex=c,tK(t.slice(0,c),e)}(),n=t[0]===`
|
|||
|
`||t[0]===" ",s,o;o=r.exec(t);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?`
|
|||
|
`:"")+tK(l,e),n=s}return i}function tK(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=r.exec(t);)a=i.index,a-n>e&&(s=o>n?o:a,l+=`
|
|||
|
`+t.slice(n,s),n=s+1),o=a;return l+=`
|
|||
|
`,t.length-n>e&&o>n?l+=t.slice(n,o)+`
|
|||
|
`+t.slice(o+1):l+=t.slice(n),l.slice(1)}function xde(t){for(var e="",r,i,n,s=0;s<t.length;s++){if(r=t.charCodeAt(s),r>=55296&&r<=56319&&(i=t.charCodeAt(s+1),i>=56320&&i<=57343)){e+=qU((r-55296)*1024+i-56320+65536),s++;continue}n=Ui[r],e+=!n&&ig(r)?t[s]:n||qU(r)}return e}function Dde(t,e,r){var i="",n=t.tag,s,o;for(s=0,o=r.length;s<o;s+=1)gc(t,e,r[s],!1,!1)&&(s!==0&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}function Rde(t,e,r,i){var n="",s=t.tag,o,a;for(o=0,a=r.length;o<a;o+=1)gc(t,e+1,r[o],!0,!0)&&((!i||o!==0)&&(n+=VQ(t,e)),t.dump&&sp===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function Fde(t,e,r){var i="",n=t.tag,s=Object.keys(r),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",o!==0&&(u+=", "),t.condenseFlow&&(u+='"'),l=s[o],c=r[l],!!gc(t,e,l,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!gc(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=n,t.dump="{"+i+"}"}function Nde(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),a,l,c,u,g,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new np("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)f="",(!i||a!==0)&&(f+=VQ(t,e)),c=o[a],u=r[c],!!gc(t,e+1,c,!0,!0,!0)&&(g=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,g&&(t.dump&&sp===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,g&&(f+=VQ(t,e)),!!gc(t,e+1,u,!0,g)&&(t.dump&&sp===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,n+=f));t.tag=s,t.dump=n||"{}"}function rK(t,e,r){var i,n,s,o,a,l;for(n=r?t.explicitTypes:t.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(t.tag=r?a.tag:"?",a.represent){if(l=t.styleMap[a.tag]||a.defaultStyle,TU.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(OU.call(a.represent,l))i=a.represent[l](e,l);else throw new np("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=i}return!0}return!1}function gc(t,e,r,i,n,s){t.tag=null,t.dump=r,rK(t,r,!1)||rK(t,r,!0);var o=TU.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=t.duplicates.indexOf(r),c=l!==-1),(t.tag!==null&&t.tag!=="?"||c||t.indent!==2&&e>0)&&(n=!1),c&&t.usedDuplicates[l])t.dump="*ref_"+l;else{if(a&&c&&!t.usedDuplicates[l]&&(t.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(t.dump).length!==0?(Nde(t,e,t.dump,n),c&&(t.dump="&ref_"+l+t.dump)):(Fde(t,e,t.dump),c&&(t.dump="&ref_"+l+" "+t.dump));else if(o==="[object Array]"){var u=t.noArrayIndent&&e>0?e-1:e;i&&t.dump.length!==0?(Rde(t,u,t.dump,n),c&&(t.dump="&ref_"+l+t.dump)):(Dde(t,u,t.dump),c&&(t.dump="&ref_"+l+" "+t.dump))}else if(o==="[object String]")t.tag!=="?"&&Pde(t,t.dump,e,s);else{if(t.skipInvalid)return!1;throw new np("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function Lde(t,e){var r=[],i=[],n,s;for(ZQ(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function ZQ(t,e,r){var i,n,s;if(t!==null&&typeof t=="object")if(n=e.indexOf(t),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,s=t.length;n<s;n+=1)ZQ(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)ZQ(t[i[n]],e,r)}function iK(t,e){e=e||{};var r=new Bde(e);return r.noRefs||Lde(t,r),gc(r,0,t,!0,!0)?r.dump+`
|
|||
|
`:""}function Tde(t,e){return iK(t,ip.extend({schema:nde},e))}_Q.exports.dump=iK;_Q.exports.safeDump=Tde});var oK=w((i$e,Or)=>{"use strict";var gI=LU(),sK=nK();function fI(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}Or.exports.Type=li();Or.exports.Schema=lc();Or.exports.FAILSAFE_SCHEMA=sI();Or.exports.JSON_SCHEMA=GQ();Or.exports.CORE_SCHEMA=YQ();Or.exports.DEFAULT_SAFE_SCHEMA=Zu();Or.exports.DEFAULT_FULL_SCHEMA=tp();Or.exports.load=gI.load;Or.exports.loadAll=gI.loadAll;Or.exports.safeLoad=gI.safeLoad;Or.exports.safeLoadAll=gI.safeLoadAll;Or.exports.dump=sK.dump;Or.exports.safeDump=sK.safeDump;Or.exports.YAMLException=Vu();Or.exports.MINIMAL_SCHEMA=sI();Or.exports.SAFE_SCHEMA=Zu();Or.exports.DEFAULT_SCHEMA=tp();Or.exports.scan=fI("scan");Or.exports.parse=fI("parse");Or.exports.compose=fI("compose");Or.exports.addConstructor=fI("addConstructor")});var AK=w((n$e,aK)=>{"use strict";var Ode=oK();aK.exports=Ode});var cK=w((s$e,lK)=>{"use strict";function Mde(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function fc(t,e,r,i){this.message=t,this.expected=e,this.found=r,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,fc)}Mde(fc,Error);fc.buildMessage=function(t,e){var r={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 r[c.type](c)}function a(c){var u=new Array(c.length),g,f;for(g=0;g<c.length;g++)u[g]=o(c[g]);if(u.sort(),u.length>0){for(g=1,f=1;g<u.length;g++)u[g-1]!==u[g]&&(u[f]=u[g],f++);u.length=f}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(t)+" but "+l(e)+" found."};function Ude(t,e){e=e!==void 0?e:{};var r={},i={Start:Xs},n=Xs,s=function(R){return[].concat(...R)},o="-",a=gr("-",!1),l=function(R){return R},c=function(R){return Object.assign({},...R)},u="#",g=gr("#",!1),f=Jl(),h=function(){return{}},p=":",m=gr(":",!1),y=function(R,q){return{[R]:q}},Q=",",S=gr(",",!1),x=function(R,q){return q},M=function(R,q,de){return Object.assign({},...[R].concat(q).map(He=>({[He]:de})))},Y=function(R){return R},U=function(R){return R},J=Vs("correct indentation"),W=" ",ee=gr(" ",!1),Z=function(R){return R.length===LA*Gu},A=function(R){return R.length===(LA+1)*Gu},ne=function(){return LA++,!0},le=function(){return LA--,!0},Ae=function(){return Ou()},T=Vs("pseudostring"),L=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,Ee=Yn(["\r",`
|
|||
|
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),we=/^[^\r\n\t ,\][{}:#"']/,qe=Yn(["\r",`
|
|||
|
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),re=function(){return Ou().replace(/^ *| *$/g,"")},se="--",Qe=gr("--",!1),he=/^[a-zA-Z\/0-9]/,Fe=Yn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ue=/^[^\r\n\t :,]/,xe=Yn(["\r",`
|
|||
|
`," "," ",":",","],!0,!1),ve="null",pe=gr("null",!1),X=function(){return null},be="true",ce=gr("true",!1),fe=function(){return!0},gt="false",Ht=gr("false",!1),Mt=function(){return!1},mi=Vs("string"),jt='"',Qr=gr('"',!1),Ti=function(){return""},_s=function(R){return R},Un=function(R){return R.join("")},Kn=/^[^"\\\0-\x1F\x7F]/,vr=Yn(['"',"\\",["\0",""],"\x7F"],!0,!1),Hn='\\"',us=gr('\\"',!1),Ia=function(){return'"'},SA="\\\\",Du=gr("\\\\",!1),gs=function(){return"\\"},kA="\\/",ya=gr("\\/",!1),Ru=function(){return"/"},xA="\\b",PA=gr("\\b",!1),Sr=function(){return"\b"},jl="\\f",Fu=gr("\\f",!1),So=function(){return"\f"},Nu="\\n",Qh=gr("\\n",!1),vh=function(){return`
|
|||
|
`},oe="\\r",Oi=gr("\\r",!1),ko=function(){return"\r"},jn="\\t",Lu=gr("\\t",!1),vt=function(){return" "},Gl="\\u",Gn=gr("\\u",!1),fs=function(R,q,de,He){return String.fromCharCode(parseInt(`0x${R}${q}${de}${He}`))},hs=/^[0-9a-fA-F]/,pt=Yn([["0","9"],["a","f"],["A","F"]],!1,!1),xo=Vs("blank space"),lt=/^[ \t]/,mn=Yn([" "," "],!1,!1),v=Vs("white space"),Tt=/^[ \t\n\r]/,Tu=Yn([" "," ",`
|
|||
|
`,"\r"],!1,!1),Yl=`\r
|
|||
|
`,Sh=gr(`\r
|
|||
|
`,!1),kh=`
|
|||
|
`,xh=gr(`
|
|||
|
`,!1),Ph="\r",Dh=gr("\r",!1),G=0,yt=0,DA=[{line:1,column:1}],$i=0,ql=[],$e=0,wa;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 Ou(){return t.substring(yt,G)}function SE(){return En(yt,G)}function Rh(R,q){throw q=q!==void 0?q:En(yt,G),Wl([Vs(R)],t.substring(yt,G),q)}function kE(R,q){throw q=q!==void 0?q:En(yt,G),Mu(R,q)}function gr(R,q){return{type:"literal",text:R,ignoreCase:q}}function Yn(R,q,de){return{type:"class",parts:R,inverted:q,ignoreCase:de}}function Jl(){return{type:"any"}}function Fh(){return{type:"end"}}function Vs(R){return{type:"other",description:R}}function Ba(R){var q=DA[R],de;if(q)return q;for(de=R-1;!DA[de];)de--;for(q=DA[de],q={line:q.line,column:q.column};de<R;)t.charCodeAt(de)===10?(q.line++,q.column=1):q.column++,de++;return DA[R]=q,q}function En(R,q){var de=Ba(R),He=Ba(q);return{start:{offset:R,line:de.line,column:de.column},end:{offset:q,line:He.line,column:He.column}}}function Oe(R){G<$i||(G>$i&&($i=G,ql=[]),ql.push(R))}function Mu(R,q){return new fc(R,null,null,q)}function Wl(R,q,de){return new fc(fc.buildMessage(R,q),R,q,de)}function Xs(){var R;return R=Uu(),R}function zl(){var R,q,de;for(R=G,q=[],de=RA();de!==r;)q.push(de),de=RA();return q!==r&&(yt=R,q=s(q)),R=q,R}function RA(){var R,q,de,He,Te;return R=G,q=Qa(),q!==r?(t.charCodeAt(G)===45?(de=o,G++):(de=r,$e===0&&Oe(a)),de!==r?(He=Lr(),He!==r?(Te=ba(),Te!==r?(yt=R,q=l(Te),R=q):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r),R}function Uu(){var R,q,de;for(R=G,q=[],de=Ku();de!==r;)q.push(de),de=Ku();return q!==r&&(yt=R,q=c(q)),R=q,R}function Ku(){var R,q,de,He,Te,Xe,Et,Rt,qn;if(R=G,q=Lr(),q===r&&(q=null),q!==r){if(de=G,t.charCodeAt(G)===35?(He=u,G++):(He=r,$e===0&&Oe(g)),He!==r){if(Te=[],Xe=G,Et=G,$e++,Rt=eo(),$e--,Rt===r?Et=void 0:(G=Et,Et=r),Et!==r?(t.length>G?(Rt=t.charAt(G),G++):(Rt=r,$e===0&&Oe(f)),Rt!==r?(Et=[Et,Rt],Xe=Et):(G=Xe,Xe=r)):(G=Xe,Xe=r),Xe!==r)for(;Xe!==r;)Te.push(Xe),Xe=G,Et=G,$e++,Rt=eo(),$e--,Rt===r?Et=void 0:(G=Et,Et=r),Et!==r?(t.length>G?(Rt=t.charAt(G),G++):(Rt=r,$e===0&&Oe(f)),Rt!==r?(Et=[Et,Rt],Xe=Et):(G=Xe,Xe=r)):(G=Xe,Xe=r);else Te=r;Te!==r?(He=[He,Te],de=He):(G=de,de=r)}else G=de,de=r;if(de===r&&(de=null),de!==r){if(He=[],Te=$s(),Te!==r)for(;Te!==r;)He.push(Te),Te=$s();else He=r;He!==r?(yt=R,q=h(),R=q):(G=R,R=r)}else G=R,R=r}else G=R,R=r;if(R===r&&(R=G,q=Qa(),q!==r?(de=_l(),de!==r?(He=Lr(),He===r&&(He=null),He!==r?(t.charCodeAt(G)===58?(Te=p,G++):(Te=r,$e===0&&Oe(m)),Te!==r?(Xe=Lr(),Xe===r&&(Xe=null),Xe!==r?(Et=ba(),Et!==r?(yt=R,q=y(de,Et),R=q):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r),R===r&&(R=G,q=Qa(),q!==r?(de=Zs(),de!==r?(He=Lr(),He===r&&(He=null),He!==r?(t.charCodeAt(G)===58?(Te=p,G++):(Te=r,$e===0&&Oe(m)),Te!==r?(Xe=Lr(),Xe===r&&(Xe=null),Xe!==r?(Et=ba(),Et!==r?(yt=R,q=y(de,Et),R=q):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r),R===r))){if(R=G,q=Qa(),q!==r)if(de=Zs(),de!==r)if(He=Lr(),He!==r)if(Te=xE(),Te!==r){if(Xe=[],Et=$s(),Et!==r)for(;Et!==r;)Xe.push(Et),Et=$s();else Xe=r;Xe!==r?(yt=R,q=y(de,Te),R=q):(G=R,R=r)}else G=R,R=r;else G=R,R=r;else G=R,R=r;else G=R,R=r;if(R===r)if(R=G,q=Qa(),q!==r)if(de=Zs(),de!==r){if(He=[],Te=G,Xe=Lr(),Xe===r&&(Xe=null),Xe!==r?(t.charCodeAt(G)===44?(Et=Q,G++):(Et=r,$e===0&&Oe(S)),Et!==r?(Rt=Lr(),Rt===r&&(Rt=null),Rt!==r?(qn=Zs(),qn!==r?(yt=Te,Xe=x(de,qn),Te=Xe):(G=Te,Te=r)):(G=Te,Te=r)):(G=Te,Te=r)):(G=Te,Te=r),Te!==r)for(;Te!==r;)He.push(Te),Te=G,Xe=Lr(),Xe===r&&(Xe=null),Xe!==r?(t.charCodeAt(G)===44?(Et=Q,G++):(Et=r,$e===0&&Oe(S)),Et!==r?(Rt=Lr(),Rt===r&&(Rt=null),Rt!==r?(qn=Zs(),qn!==r?(yt=Te,Xe=x(de,qn),Te=Xe):(G=Te,Te=r)):(G=Te,Te=r)):(G=Te,Te=r)):(G=Te,Te=r);else He=r;He!==r?(Te=Lr(),Te===r&&(Te=null),Te!==r?(t.charCodeAt(G)===58?(Xe=p,G++):(Xe=r,$e===0&&Oe(m)),Xe!==r?(Et=Lr(),Et===r&&(Et=null),Et!==r?(Rt=ba(),Rt!==r?(yt=R,q=M(de,He,Rt),R=q):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)):(G=R,R=r)}else G=R,R=r;else G=R,R=r}return R}function ba(){var R,q,de,He,Te,Xe,Et;if(R=G,q=G,$e++,de=G,He=eo(),He!==r?(Te=it(),Te!==r?(t.charCodeAt(G)===45?(Xe=o,G+
|
|||
|
`),n("\r"),n("\u2028"),n("\u2029")]}},t.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()}},t.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},t.prototype.characterClassEscape=function(){var p,m=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,m=!0;break;case"s":p=f;break;case"S":p=f,m=!0;break;case"w":p=g;break;case"W":p=g,m=!0;break}return a(p),{type:"Set",value:p,complement:m}},t.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(`
|
|||
|
`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var m=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:m}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|||
|
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},t.prototype.characterClass=function(){var p=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var y=this.classAtom(),Q=y.type==="Character";if(Q&&this.isRangeDash()){this.consumeChar("-");var S=this.classAtom(),x=S.type==="Character";if(x){if(S.value<y.value)throw Error("Range out of order in character class");p.push({from:y.value,to:S.value})}else s(y.value,p),p.push(n("-")),s(S.value,p)}else s(y.value,p)}return this.consumeChar("]"),{type:"Set",complement:m,value:p}},t.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()}},t.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()}},t.prototype.group=function(){var p=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),p=!1;break;default:this.groupIdx++;break}var m=this.disjunction();this.consumeChar(")");var y={type:"Group",capturing:p,value:m};return p&&(y.idx=this.groupIdx),y},t.prototype.positiveInteger=function(){var p=this.popChar();if(i.test(p)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},t.prototype.integerIncludingZero=function(){var p=this.popChar();if(r.test(p)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},t.prototype.patternCharacter=function(){var p=this.popChar();switch(p){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(p)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(p){switch(p===void 0&&(p=0),this.peekChar(p)){case"]":case`
|
|||
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.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}},t.prototype.isQuantifier=function(){var p=this.saveState();try{return this.quantifier(!0)!==void 0}catch(m){return!1}finally{this.restoreState(p)}},t.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}},t.prototype.parseHexDigits=function(p){for(var m="",y=0;y<p;y++){var Q=this.popChar();if(e.test(Q)===!1)throw Error("Expecting a HexDecimal digits");m+=Q}var S=parseInt(m,16);return{type:"Character",value:S}},t.prototype.peekChar=function(p){return p===void 0&&(p=0),this.input[this.idx+p]},t.prototype.popChar=function(){var p=this.peekChar(0);return this.consumeChar(),p},t.prototype.consumeChar=function(p){if(p!==void 0&&this.input[this.idx]!==p)throw Error("Expected: '"+p+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,m){p.length!==void 0?p.forEach(function(y){m.push(y)}):m.push(p)}function o(p,m){if(p[m]===!0)throw"duplicate flag "+m;p[m]=!0}function a(p){if(p===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 f=[n(" "),n("\f"),n(`
|
|||
|
`),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 h(){}return h.prototype.visitChildren=function(p){for(var m in p){var y=p[m];p.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(Q){this.visit(Q)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var HI=w(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.clearRegExpParserCache=ug.getRegExpAst=void 0;var VEe=UI(),KI={},XEe=new VEe.RegExpParser;function ZEe(t){var e=t.toString();if(KI.hasOwnProperty(e))return KI[e];var r=XEe.pattern(e);return KI[e]=r,r}ug.getRegExpAst=ZEe;function $Ee(){KI={}}ug.clearRegExpParserCache=$Ee});var XH=w(Bn=>{"use strict";var eIe=Bn&&Bn.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.canMatchCharCode=Bn.firstCharOptimizedIndices=Bn.getOptimizedStartCodesIndices=Bn.failedOptimizationPrefixMsg=void 0;var WH=UI(),bs=Yt(),zH=HI(),Ma=Pv(),_H="Complement Sets are not supported for first char optimization";Bn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|||
|
`;function tIe(t,e){e===void 0&&(e=!1);try{var r=(0,zH.getRegExpAst)(t),i=jI(r.value,{},r.flags.ignoreCase);return i}catch(s){if(s.message===_H)e&&(0,bs.PRINT_WARNING)(""+Bn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+t.toString()+` >
|
|||
|
`)+` 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.
|
|||
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,bs.PRINT_ERROR)(Bn.failedOptimizationPrefixMsg+`
|
|||
|
`+(" Failed parsing: < "+t.toString()+` >
|
|||
|
`)+(" Using the regexp-to-ast library version: "+WH.VERSION+`
|
|||
|
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}Bn.getOptimizedStartCodesIndices=tIe;function jI(t,e,r){switch(t.type){case"Disjunction":for(var i=0;i<t.value.length;i++)jI(t.value[i],e,r);break;case"Alternative":for(var n=t.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":GI(o.value,e,r);break;case"Set":if(o.complement===!0)throw Error(_H);(0,bs.forEach)(o.value,function(c){if(typeof c=="number")GI(c,e,r);else{var u=c;if(r===!0)for(var g=u.from;g<=u.to;g++)GI(g,e,r);else{for(var g=u.from;g<=u.to&&g<Ma.minOptimizationVal;g++)GI(g,e,r);if(u.to>=Ma.minOptimizationVal)for(var f=u.from>=Ma.minOptimizationVal?u.from:Ma.minOptimizationVal,h=u.to,p=(0,Ma.charCodeToOptimizedIndex)(f),m=(0,Ma.charCodeToOptimizedIndex)(h),y=p;y<=m;y++)e[y]=y}}});break;case"Group":jI(o.value,e,r);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,bs.values)(e)}Bn.firstCharOptimizedIndices=jI;function GI(t,e,r){var i=(0,Ma.charCodeToOptimizedIndex)(t);e[i]=i,r===!0&&rIe(t,e)}function rIe(t,e){var r=String.fromCharCode(t),i=r.toUpperCase();if(i!==r){var n=(0,Ma.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=r.toLowerCase();if(s!==r){var n=(0,Ma.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function VH(t,e){return(0,bs.find)(t.value,function(r){if(typeof r=="number")return(0,bs.contains)(e,r);var i=r;return(0,bs.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function Dv(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?(0,bs.isArray)(t.value)?(0,bs.every)(t.value,Dv):Dv(t.value):!1}var iIe=function(t){eIe(e,t);function e(r){var i=t.call(this)||this;return i.targetCharCodes=r,i.found=!1,i}return e.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}t.prototype.visitChildren.call(this,r)}},e.prototype.visitCharacter=function(r){(0,bs.contains)(this.targetCharCodes,r.value)&&(this.found=!0)},e.prototype.visitSet=function(r){r.complement?VH(r,this.targetCharCodes)===void 0&&(this.found=!0):VH(r,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(WH.BaseRegExpVisitor);function nIe(t,e){if(e instanceof RegExp){var r=(0,zH.getRegExpAst)(e),i=new iIe(t);return i.visit(r),i.found}else return(0,bs.find)(e,function(n){return(0,bs.contains)(t,n.charCodeAt(0))})!==void 0}Bn.canMatchCharCode=nIe});var Pv=w(Ze=>{"use strict";var ZH=Ze&&Ze.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.charCodeToOptimizedIndex=Ze.minOptimizationVal=Ze.buildLineBreakIssueMessage=Ze.LineTerminatorOptimizedTester=Ze.isShortPattern=Ze.isCustomPattern=Ze.cloneEmptyGroups=Ze.performWarningRuntimeChecks=Ze.performRuntimeChecks=Ze.addStickyFlag=Ze.addStartOfInput=Ze.findUnreachablePatterns=Ze.findModesThatDoNotExist=Ze.findInvalidGroupType=Ze.findDuplicatePatterns=Ze.findUnsupportedFlags=Ze.findStartOfInputAnchor=Ze.findEmptyMatchRegExps=Ze.findEndOfInputAnchor=Ze.findInvalidPatterns=Ze.findMissingPatterns=Ze.validatePatterns=Ze.analyzeTokenTypes=Ze.enableSticky=Ze.disableSticky=Ze.SUPPORT_STICKY=Ze.MODES=Ze.DEFAULT_MODE=void 0;var $H=UI(),Ar=Dp(),Ne=Yt(),gg=XH(),ej=HI(),Lo="PATTERN";Ze.DEFAULT_MODE="defaultMode";Ze.MODES="modes";Ze.SUPPORT_STI
|
|||
|
`],tracer:function(S,x){return x()}});var r=e.tracer;r("initCharCodeToOptimizedIndexMap",function(){aIe()});var i;r("Reject Lexer.NA",function(){i=(0,Ne.reject)(t,function(S){return S[Lo]===Ar.Lexer.NA})});var n=!1,s;r("Transform Patterns",function(){n=!1,s=(0,Ne.map)(i,function(S){var x=S[Lo];if((0,Ne.isRegExp)(x)){var M=x.source;return M.length===1&&M!=="^"&&M!=="$"&&M!=="."&&!x.ignoreCase?M:M.length===2&&M[0]==="\\"&&!(0,Ne.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],M[1])?M[1]:e.useSticky?Fv(x):Rv(x)}else{if((0,Ne.isFunction)(x))return n=!0,{exec:x};if((0,Ne.has)(x,"exec"))return n=!0,x;if(typeof x=="string"){if(x.length===1)return x;var Y=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),U=new RegExp(Y);return e.useSticky?Fv(U):Rv(U)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;r("misc mapping",function(){o=(0,Ne.map)(i,function(S){return S.tokenTypeIdx}),a=(0,Ne.map)(i,function(S){var x=S.GROUP;if(x!==Ar.Lexer.SKIPPED){if((0,Ne.isString)(x))return x;if((0,Ne.isUndefined)(x))return!1;throw Error("non exhaustive match")}}),l=(0,Ne.map)(i,function(S){var x=S.LONGER_ALT;if(x){var M=(0,Ne.isArray)(x)?(0,Ne.map)(x,function(Y){return(0,Ne.indexOf)(i,Y)}):[(0,Ne.indexOf)(i,x)];return M}}),c=(0,Ne.map)(i,function(S){return S.PUSH_MODE}),u=(0,Ne.map)(i,function(S){return(0,Ne.has)(S,"POP_MODE")})});var g;r("Line Terminator Handling",function(){var S=ij(e.lineTerminatorCharacters);g=(0,Ne.map)(i,function(x){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Ne.map)(i,function(x){if((0,Ne.has)(x,"LINE_BREAKS"))return x.LINE_BREAKS;if(rj(x,S)===!1)return(0,gg.canMatchCharCode)(S,x.PATTERN)}))});var f,h,p,m;r("Misc Mapping #2",function(){f=(0,Ne.map)(i,Nv),h=(0,Ne.map)(s,tj),p=(0,Ne.reduce)(i,function(S,x){var M=x.GROUP;return(0,Ne.isString)(M)&&M!==Ar.Lexer.SKIPPED&&(S[M]=[]),S},{}),m=(0,Ne.map)(s,function(S,x){return{pattern:s[x],longerAlt:l[x],canLineTerminator:g[x],isCustom:f[x],short:h[x],group:a[x],push:c[x],pop:u[x],tokenTypeIdx:o[x],tokenType:i[x]}})});var y=!0,Q=[];return e.safeMode||r("First Char Optimization",function(){Q=(0,Ne.reduce)(i,function(S,x,M){if(typeof x.PATTERN=="string"){var Y=x.PATTERN.charCodeAt(0),U=Tv(Y);Lv(S,U,m[M])}else if((0,Ne.isArray)(x.START_CHARS_HINT)){var J;(0,Ne.forEach)(x.START_CHARS_HINT,function(ee){var Z=typeof ee=="string"?ee.charCodeAt(0):ee,A=Tv(Z);J!==A&&(J=A,Lv(S,A,m[M]))})}else if((0,Ne.isRegExp)(x.PATTERN))if(x.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+gg.failedOptimizationPrefixMsg+(" Unable to analyze < "+x.PATTERN.toString()+` > pattern.
|
|||
|
`)+` 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 W=(0,gg.getOptimizedStartCodesIndices)(x.PATTERN,e.ensureOptimizations);(0,Ne.isEmpty)(W)&&(y=!1),(0,Ne.forEach)(W,function(ee){Lv(S,ee,m[M])})}else e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+gg.failedOptimizationPrefixMsg+(" TokenType: <"+x.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|||
|
`)+` This will disable the lexer's first char optimizations.
|
|||
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return S},[])}),r("ArrayPacking",function(){Q=(0,Ne.packArray)(Q)}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:Q,hasCustom:n,canBeOptimized:y}}Ze.analyzeTokenTypes=AIe;function cIe(t,e){var r=[],i=nj(t);r=r.concat(i.errors);var n=sj(i.valid),s=n.valid;return r=r.concat(n.errors),r=r.concat(lIe(s)),r=r.concat(oj(s)),r=r.concat(aj(s,e)),r=r.concat(Aj(s)),r}Ze.validatePatterns=cIe;function lIe(t){var e=[],r=(0,Ne.filter)(t,function(i){return(0,Ne.isRegExp)(i[Lo])});return e=e.concat(lj(r)),e=e.concat(uj(r)),e=e.concat(gj(r)),e=e.concat(fj(r)),e=e.concat(cj(r)),e}function nj(t){var e=(0,Ne.filter)(t,function(n){return!(0,Ne.has)(n,Lo)}),r=(0,Ne.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:Ar.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(t,e);return{errors:r,valid:i}}Ze.findMissingPatterns=nj;function sj(t){var e=(0,Ne.filter)(t,function(n){var s=n[Lo];return!(0,Ne.isRegExp)(s)&&!(0,Ne.isFunction)(s)&&!(0,Ne.has)(s,"exec")&&!(0,Ne.isString)(s)}),r=(0,Ne.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:Ar.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(t,e);return{errors:r,valid:i}}Ze.findInvalidPatterns=sj;var uIe=/[^\\][\$]/;function lj(t){var e=function(n){ZH(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}($H.BaseRegExpVisitor),r=(0,Ne.filter)(t,function(n){var s=n[Lo];try{var o=(0,ej.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return uIe.test(s.source)}}),i=(0,Ne.map)(r,function(n){return{message:`Unexpected RegExp Anchor Error:
|
|||
|
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|||
|
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findEndOfInputAnchor=lj;function cj(t){var e=(0,Ne.filter)(t,function(i){var n=i[Lo];return n.test("")}),r=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:Ar.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return r}Ze.findEmptyMatchRegExps=cj;var gIe=/[^\\[][\^]|^\^/;function uj(t){var e=function(n){ZH(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}($H.BaseRegExpVisitor),r=(0,Ne.filter)(t,function(n){var s=n[Lo];try{var o=(0,ej.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return gIe.test(s.source)}}),i=(0,Ne.map)(r,function(n){return{message:`Unexpected RegExp Anchor Error:
|
|||
|
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|||
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findStartOfInputAnchor=uj;function gj(t){var e=(0,Ne.filter)(t,function(i){var n=i[Lo];return n instanceof RegExp&&(n.multiline||n.global)}),r=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ar.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return r}Ze.findUnsupportedFlags=gj;function fj(t){var e=[],r=(0,Ne.map)(t,function(s){return(0,Ne.reduce)(t,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Ne.contains)(e,a)&&a.PATTERN!==Ar.Lexer.NA&&(e.push(a),o.push(a)),o},[])});r=(0,Ne.compact)(r);var i=(0,Ne.filter)(r,function(s){return s.length>1}),n=(0,Ne.map)(i,function(s){var o=(0,Ne.map)(s,function(l){return l.name}),a=(0,Ne.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:Ar.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ze.findDuplicatePatterns=fj;function oj(t){var e=(0,Ne.filter)(t,function(i){if(!(0,Ne.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==Ar.Lexer.SKIPPED&&n!==Ar.Lexer.NA&&!(0,Ne.isString)(n)}),r=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ar.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return r}Ze.findInvalidGroupType=oj;function aj(t,e){var r=(0,Ne.filter)(t,function(n){return n.PUSH_MODE!==void 0&&!(0,Ne.contains)(e,n.PUSH_MODE)}),i=(0,Ne.map)(r,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:Ar.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ze.findModesThatDoNotExist=aj;function Aj(t){var e=[],r=(0,Ne.reduce)(t,function(i,n,s){var o=n.PATTERN;return o===Ar.Lexer.NA||((0,Ne.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Ne.isRegExp)(o)&&hIe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Ne.forEach)(t,function(i,n){(0,Ne.forEach)(r,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n<a&&fIe(o,i.PATTERN)){var c="Token: ->"+l.name+`<- can never be matched.
|
|||
|
`+("Because it appears AFTER the Token Type ->"+i.name+"<-")+`in the lexer's definition.
|
|||
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ar.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ze.findUnreachablePatterns=Aj;function fIe(t,e){if((0,Ne.isRegExp)(e)){var r=e.exec(t);return r!==null&&r.index===0}else{if((0,Ne.isFunction)(e))return e(t,0,[],{});if((0,Ne.has)(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function hIe(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Ne.find)(e,function(r){return t.source.indexOf(r)!==-1})===void 0}function Rv(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}Ze.addStartOfInput=Rv;function Fv(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}Ze.addStickyFlag=Fv;function pIe(t,e,r){var i=[];return(0,Ne.has)(t,Ze.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.DEFAULT_MODE+`> property in its definition
|
|||
|
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Ne.has)(t,Ze.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.MODES+`> property in its definition
|
|||
|
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Ne.has)(t,Ze.MODES)&&(0,Ne.has)(t,Ze.DEFAULT_MODE)&&!(0,Ne.has)(t.modes,t.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ze.DEFAULT_MODE+": <"+t.defaultMode+`>which does not exist
|
|||
|
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Ne.has)(t,Ze.MODES)&&(0,Ne.forEach)(t.modes,function(n,s){(0,Ne.forEach)(n,function(o,a){(0,Ne.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`>
|
|||
|
`),type:Ar.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ze.performRuntimeChecks=pIe;function dIe(t,e,r){var i=[],n=!1,s=(0,Ne.compact)((0,Ne.flatten)((0,Ne.mapValues)(t.modes,function(l){return l}))),o=(0,Ne.reject)(s,function(l){return l[Lo]===Ar.Lexer.NA}),a=ij(r);return e&&(0,Ne.forEach)(o,function(l){var c=rj(l,a);if(c!==!1){var u=hj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Ne.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,gg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found.
|
|||
|
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
|
|||
|
for details.`,type:Ar.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ze.performWarningRuntimeChecks=dIe;function CIe(t){var e={},r=(0,Ne.keys)(t);return(0,Ne.forEach)(r,function(i){var n=t[i];if((0,Ne.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ze.cloneEmptyGroups=CIe;function Nv(t){var e=t.PATTERN;if((0,Ne.isRegExp)(e))return!1;if((0,Ne.isFunction)(e))return!0;if((0,Ne.has)(e,"exec"))return!0;if((0,Ne.isString)(e))return!1;throw Error("non exhaustive match")}Ze.isCustomPattern=Nv;function tj(t){return(0,Ne.isString)(t)&&t.length===1?t.charCodeAt(0):!1}Ze.isShortPattern=tj;Ze.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,r=this.lastIndex;r<e;r++){var i=t.charCodeAt(r);if(i===10)return this.lastIndex=r+1,!0;if(i===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function rj(t,e){if((0,Ne.has)(t,"LINE_BREAKS"))return!1;if((0,Ne.isRegExp)(t.PATTERN)){try{(0,gg.canMatchCharCode)(e,t.PATTERN)}catch(r){return{issue:Ar.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if((0,Ne.isString)(t.PATTERN))return!1;if(Nv(t))return{issue:Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function hj(t,e){if(e.issue===Ar.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|||
|
`+(" The problem is in the <"+t.name+`> Token Type
|
|||
|
`)+(" Root cause: "+e.errMsg+`.
|
|||
|
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|||
|
`+(" The problem is in the <"+t.name+`> Token Type
|
|||
|
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ze.buildLineBreakIssueMessage=hj;function ij(t){var e=(0,Ne.map)(t,function(r){return(0,Ne.isString)(r)&&r.length>0?r.charCodeAt(0):r});return e}function Lv(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}Ze.minOptimizationVal=256;var YI=[];function Tv(t){return t<Ze.minOptimizationVal?t:YI[t]}Ze.charCodeToOptimizedIndex=Tv;function aIe(){if((0,Ne.isEmpty)(YI)){YI=new Array(65536);for(var t=0;t<65536;t++)YI[t]=t>255?255+~~(t/255):t}}});var fg=w(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.isTokenType=Ft.hasExtendingTokensTypesMapProperty=Ft.hasExtendingTokensTypesProperty=Ft.hasCategoriesProperty=Ft.hasShortKeyProperty=Ft.singleAssignCategoriesToksMap=Ft.assignCategoriesMapProp=Ft.assignCategoriesTokensProp=Ft.assignTokenDefaultProps=Ft.expandCategories=Ft.augmentTokenTypes=Ft.tokenIdxToClass=Ft.tokenShortNameIdx=Ft.tokenStructuredMatcherNoCategories=Ft.tokenStructuredMatcher=void 0;var ri=Yt();function mIe(t,e){var r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}Ft.tokenStructuredMatcher=mIe;function EIe(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}Ft.tokenStructuredMatcherNoCategories=EIe;Ft.tokenShortNameIdx=1;Ft.tokenIdxToClass={};function IIe(t){var e=pj(t);dj(e),mj(e),Cj(e),(0,ri.forEach)(e,function(r){r.isParent=r.categoryMatches.length>0})}Ft.augmentTokenTypes=IIe;function pj(t){for(var e=(0,ri.cloneArr)(t),r=t,i=!0;i;){r=(0,ri.compact)((0,ri.flatten)((0,ri.map)(r,function(s){return s.CATEGORIES})));var n=(0,ri.difference)(r,e);e=e.concat(n),(0,ri.isEmpty)(n)?i=!1:r=n}return e}Ft.expandCategories=pj;function dj(t){(0,ri.forEach)(t,function(e){Ej(e)||(Ft.tokenIdxToClass[Ft.tokenShortNameIdx]=e,e.tokenTypeIdx=Ft.tokenShortNameIdx++),Ov(e)&&!(0,ri.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Ov(e)||(e.CATEGORIES=[]),Ij(e)||(e.categoryMatches=[]),yj(e)||(e.categoryMatchesMap={})})}Ft.assignTokenDefaultProps=dj;function Cj(t){(0,ri.forEach)(t,function(e){e.categoryMatches=[],(0,ri.forEach)(e.categoryMatchesMap,function(r,i){e.categoryMatches.push(Ft.tokenIdxToClass[i].tokenTypeIdx)})})}Ft.assignCategoriesTokensProp=Cj;function mj(t){(0,ri.forEach)(t,function(e){Mv([],e)})}Ft.assignCategoriesMapProp=mj;function Mv(t,e){(0,ri.forEach)(t,function(r){e.categoryMatchesMap[r.tokenTypeIdx]=!0}),(0,ri.forEach)(e.CATEGORIES,function(r){var i=t.concat(e);(0,ri.contains)(i,r)||Mv(i,r)})}Ft.singleAssignCategoriesToksMap=Mv;function Ej(t){return(0,ri.has)(t,"tokenTypeIdx")}Ft.hasShortKeyProperty=Ej;function Ov(t){return(0,ri.has)(t,"CATEGORIES")}Ft.hasCategoriesProperty=Ov;function Ij(t){return(0,ri.has)(t,"categoryMatches")}Ft.hasExtendingTokensTypesProperty=Ij;function yj(t){return(0,ri.has)(t,"categoryMatchesMap")}Ft.hasExtendingTokensTypesMapProperty=yj;function yIe(t){return(0,ri.has)(t,"tokenTypeIdx")}Ft.isTokenType=yIe});var Uv=w(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.defaultLexerErrorProvider=void 0;qI.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,r,i,n){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+","+(" skipped "+r+" characters.")}}});var Dp=w(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Lexer=Bc.LexerDefinitionErrorType=void 0;var so=Pv(),lr=Yt(),wIe=fg(),BIe=Uv(),bIe=HI(),QIe;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=
|
|||
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:BIe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Rp);var vIe=function(){function t(e,r){var i=this;if(r===void 0&&(r=Rp),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 r=="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,lr.merge)(Rp,r);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=Infinity,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===Rp.lineTerminatorsPattern)i.config.lineTerminatorsPattern=so.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Rp.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(r.safeMode&&r.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,lr.isArray)(e)?(s={modes:{}},s.modes[so.DEFAULT_MODE]=(0,lr.cloneArr)(e),s[so.DEFAULT_MODE]=so.DEFAULT_MODE):(o=!1,s=(0,lr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,so.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,so.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,lr.forEach)(s.modes,function(u,g){s.modes[g]=(0,lr.reject)(u,function(f){return(0,lr.isUndefined)(f)})});var a=(0,lr.keys)(s.modes);if((0,lr.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,so.validatePatterns)(u,a))}),(0,lr.isEmpty)(i.lexerDefinitionErrors)){(0,wIe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,so.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,lr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,lr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,lr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`-----------------------
|
|||
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|||
|
`+c)}(0,lr.forEach)(i.lexerDefinitionWarning,function(u){(0,lr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(so.SUPPORT_STICKY?(i.chopInput=lr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=lr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=lr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=lr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=lr.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,lr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(r.ensureOptimizations&&!(0,lr.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,bIe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,lr.toFastProperties)(i)})})}return t.prototype.tokenize=function(e,r){if(r===void 0&&(r=this.defaultMode),!(0,lr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,lr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`-----------------------
|
|||
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|||
|
`+n)}var s=this.tokenizeInternal(e,r);return s},t.prototype.tokenizeInternal=function(e,r){var i=this,n,s,o,a,l,c,u,g,f,h,p,m,y,Q,S,x,M=e,Y=M.length,U=0,J=0,W=this.hasCustom?0:Math.floor(e.length/10),ee=new Array(W),Z=[],A=this.trackStartLines?1:void 0,ne=this.trackStartLines?1:void 0,le=(0,so.cloneEmptyGroups)(this.emptyGroups),Ae=this.trackStartLines,T=this.config.lineTerminatorsPattern,L=0,Ee=[],we=[],qe=[],re=[];Object.freeze(re);var se=void 0;function Qe(){return Ee}function he(vr){var Hn=(0,so.charCodeToOptimizedIndex)(vr),us=we[Hn];return us===void 0?re:us}var Fe=function(vr){if(qe.length===1&&vr.tokenType.PUSH_MODE===void 0){var Hn=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(vr);Z.push({offset:vr.startOffset,line:vr.startLine!==void 0?vr.startLine:void 0,column:vr.startColumn!==void 0?vr.startColumn:void 0,length:vr.image.length,message:Hn})}else{qe.pop();var us=(0,lr.last)(qe);Ee=i.patternIdxToConfig[us],we=i.charCodeToPatternIdxToConfig[us],L=Ee.length;var Ia=i.canModeBeOptimized[us]&&i.config.safeMode===!1;we&&Ia?se=he:se=Qe}};function Ue(vr){qe.push(vr),we=this.charCodeToPatternIdxToConfig[vr],Ee=this.patternIdxToConfig[vr],L=Ee.length,L=Ee.length;var Hn=this.canModeBeOptimized[vr]&&this.config.safeMode===!1;we&&Hn?se=he:se=Qe}Ue.call(this,r);for(var xe;U<Y;){c=null;var ve=M.charCodeAt(U),pe=se(ve),X=pe.length;for(n=0;n<X;n++){xe=pe[n];var be=xe.pattern;u=null;var ce=xe.short;if(ce!==!1?ve===ce&&(c=be):xe.isCustom===!0?(x=be.exec(M,U,ee,le),x!==null?(c=x[0],x.payload!==void 0&&(u=x.payload)):c=null):(this.updateLastIndex(be,U),c=this.match(be,e,U)),c!==null){if(l=xe.longerAlt,l!==void 0){var fe=l.length;for(o=0;o<fe;o++){var gt=Ee[l[o]],Ht=gt.pattern;if(g=null,gt.isCustom===!0?(x=Ht.exec(M,U,ee,le),x!==null?(a=x[0],x.payload!==void 0&&(g=x.payload)):a=null):(this.updateLastIndex(Ht,U),a=this.match(Ht,e,U)),a&&a.length>c.length){c=a,u=g,xe=gt;break}}}break}}if(c!==null){if(f=c.length,h=xe.group,h!==void 0&&(p=xe.tokenTypeIdx,m=this.createTokenInstance(c,U,p,xe.tokenType,A,ne,f),this.handlePayload(m,u),h===!1?J=this.addToken(ee,J,m):le[h].push(m)),e=this.chopInput(e,f),U=U+f,ne=this.computeNewColumn(ne,f),Ae===!0&&xe.canLineTerminator===!0){var Mt=0,mi=void 0,jt=void 0;T.lastIndex=0;do mi=T.test(c),mi===!0&&(jt=T.lastIndex-1,Mt++);while(mi===!0);Mt!==0&&(A=A+Mt,ne=f-jt,this.updateTokenEndLineColumnLocation(m,h,jt,Mt,A,ne,f))}this.handleModes(xe,Fe,Ue,m)}else{for(var Qr=U,Ti=A,_s=ne,Un=!1;!Un&&U<Y;)for(Q=M.charCodeAt(U),e=this.chopInput(e,1),U++,s=0;s<L;s++){var Kn=Ee[s],be=Kn.pattern,ce=Kn.short;if(ce!==!1?M.charCodeAt(U)===ce&&(Un=!0):Kn.isCustom===!0?Un=be.exec(M,U,ee,le)!==null:(this.updateLastIndex(be,U),Un=be.exec(e)!==null),Un===!0)break}y=U-Qr,S=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Qr,y,Ti,_s),Z.push({offset:Qr,line:Ti,column:_s,length:y,message:S})}}return this.hasCustom||(ee.length=J),{tokens:ee,groups:le,errors:Z}},t.prototype.handleModes=function(e,r,i,n){if(e.pop===!0){var s=e.push;r(n),s!==void 0&&i.call(this,s)}else e.push!==void 0&&i.call(this,e.push)},t.prototype.chopInput=function(e,r){return e.substring(r)},t.prototype.updateLastIndex=function(e,r){e.lastIndex=r},t.prototype.updateTokenEndLineColumnLocation=function(e,r,i,n,s,o,a){var l,c;r!==void 0&&(l=i===a-1,c=l?-1:0,n===1&&l===!0||(e.endLine=s+c,e.endColumn=o-1+-c))},t.prototype.computeNewColumn=function(e,r){return e+r},t.prototype.createTokenInstance=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return null},t.prototype.createOffsetOnlyToken=function(e,r,i,n){return{image:e,startOffset:r,tokenTypeIdx:i,tokenType:n}},t.prototype.createStartOnlyToken=function(e,r,i,n,s,o){return{image:e,startOffset:r,startLine:s,startColumn:o,tokenTypeIdx:i,tokenType:n}},t.prototype.createFullToken=function(e,r,i,n,s,o,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:i,tokenType:n}},t.prototype.addToken=function(e,r,i){return 666},t.prototype.addTokenUsingPush=function(e,r,i){return e.push(i),r},t.prototype.addTokenUsing
|
|||
|
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,oo.has)(t,Bj)&&(r.CATEGORIES=t[Bj]),(0,Kv.augmentTokenTypes)([r]),(0,oo.has)(t,bj)&&(r.LABEL=t[bj]),(0,oo.has)(t,Qj)&&(r.GROUP=t[Qj]),(0,oo.has)(t,Sj)&&(r.POP_MODE=t[Sj]),(0,oo.has)(t,vj)&&(r.PUSH_MODE=t[vj]),(0,oo.has)(t,kj)&&(r.LONGER_ALT=t[kj]),(0,oo.has)(t,xj)&&(r.LINE_BREAKS=t[xj]),(0,oo.has)(t,Pj)&&(r.START_CHARS_HINT=t[Pj]),r}xi.EOF=Dj({name:"EOF",pattern:SIe.Lexer.NA});(0,Kv.augmentTokenTypes)([xi.EOF]);function RIe(t,e,r,i,n,s,o,a){return{image:e,startOffset:r,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}xi.createTokenInstance=RIe;function FIe(t,e){return(0,Kv.tokenStructuredMatcher)(t,e)}xi.tokenMatcher=FIe});var bn=w(Vt=>{"use strict";var Ua=Vt&&Vt.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.serializeProduction=Vt.serializeGrammar=Vt.Terminal=Vt.Alternation=Vt.RepetitionWithSeparator=Vt.Repetition=Vt.RepetitionMandatoryWithSeparator=Vt.RepetitionMandatory=Vt.Option=Vt.Alternative=Vt.Rule=Vt.NonTerminal=Vt.AbstractProduction=void 0;var fr=Yt(),NIe=JA(),To=function(){function t(e){this._definition=e}return Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this),(0,fr.forEach)(this.definition,function(r){r.accept(e)})},t}();Vt.AbstractProduction=To;var Rj=function(t){Ua(e,t);function e(r){var i=t.call(this,[])||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,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(r){},enumerable:!1,configurable:!0}),e.prototype.accept=function(r){r.visit(this)},e}(To);Vt.NonTerminal=Rj;var Fj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.orgText="",(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.Rule=Fj;var Nj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.ignoreAmbiguities=!1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.Alternative=Nj;var Lj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.Option=Lj;var Tj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.RepetitionMandatory=Tj;var Oj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.RepetitionMandatoryWithSeparator=Oj;var Mj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.Repetition=Mj;var Uj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return e}(To);Vt.RepetitionWithSeparator=Uj;var Kj=function(t){Ua(e,t);function e(r){var i=t.call(this,r.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,fr.assign)(i,(0,fr.pick)(r,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(r){this._definition
|
|||
|
but found: '`+a+"'";if(n)return o+n+l;var c=(0,ao.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,ao.map)(c,function(h){return"["+(0,ao.map)(h,function(p){return(0,pg.tokenLabel)(p)}).join(", ")+"]"}),g=(0,ao.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences:
|
|||
|
`+g.join(`
|
|||
|
`);return o+f+l},buildEarlyExitMessage:function(t){var e=t.expectedIterationPaths,r=t.actual,i=t.customUserDescription,n=t.ruleName,s="Expecting: ",o=(0,ao.first)(r).image,a=`
|
|||
|
but found: '`+o+"'";if(i)return s+i+a;var l=(0,ao.map)(e,function(u){return"["+(0,ao.map)(u,function(g){return(0,pg.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(Ka.defaultParserErrorProvider);Ka.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){var r="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|||
|
inside top level rule: ->`+t.name+"<-";return r}};Ka.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(t,e){function r(u){return u instanceof Jv.Terminal?u.terminalType.name:u instanceof Jv.NonTerminal?u.nonTerminalName:""}var i=t.name,n=(0,ao.first)(e),s=n.idx,o=(0,Zj.getProductionDslName)(n),a=r(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+`
|
|||
|
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(t){var e=`Namespace conflict found in grammar.
|
|||
|
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.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(t){var e=(0,ao.map)(t.prefixPath,function(n){return(0,pg.tokenLabel)(n)}).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,i="Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
|
|||
|
`+("in <OR"+r+"> inside <"+t.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(t){var e=(0,ao.map)(t.prefixPath,function(n){return(0,pg.tokenLabel)(n)}).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,i="Ambiguous Alternatives Detected: <"+t.ambiguityIndices.join(" ,")+"> in <OR"+r+">"+(" inside <"+t.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
|
|||
|
For Further details.`,i},buildEmptyRepetitionError:function(t){var e=(0,Zj.getProductionDslName)(t.repetition);t.repetition.idx!==0&&(e+=t.repetition.idx);var r="The repetition <"+e+"> within Rule <"+t.topLevelRule.name+`> can never consume any tokens.
|
|||
|
This could lead to an infinite loop.`;return r},buildTokenNameError:function(t){return"deprecated"},buildEmptyAlternationError:function(t){var e="Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+">"+(" in <OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
|
|||
|
`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(t){var e=`An Alternation cannot have more than 256 alternatives:
|
|||
|
`+("<OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
|
|||
|
has `+(t.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(t){var e=t.topLevelRule.name,r=VIe.map(t.leftRecursionPath,function(s){return s.name}),i=e+" --> "+r.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.
|
|||
|
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var e;t.topLevelRule instanceof Jv.Rule?e=t.topLevelRule.name:e=t.topLevelRule;var r="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return r}}});var tG=w(WA=>{"use strict";var XIe=WA&&WA.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(WA,"__esModule",{value:!0});WA.GastRefResolverVisitor=WA.resolveGrammar=void 0;var ZIe=Xn(),$j=Yt(),$Ie=hg();function eye(t,e){var r=new eG(t,e);return r.resolveRefs(),r.errors}WA.resolveGrammar=eye;var eG=function(t){XIe(e,t);function e(r,i){var n=t.call(this)||this;return n.nameToTopRule=r,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var r=this;(0,$j.forEach)((0,$j.values)(this.nameToTopRule),function(i){r.currTopLevel=i,i.accept(r)})},e.prototype.visitNonTerminal=function(r){var i=this.nameToTopRule[r.nonTerminalName];if(i)r.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:n,type:ZIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},e}($Ie.GAstVisitor);WA.GastRefResolverVisitor=eG});var Mp=w(Mr=>{"use strict";var bc=Mr&&Mr.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Mr,"__esModule",{value:!0});Mr.nextPossibleTokensAfter=Mr.possiblePathsFrom=Mr.NextTerminalAfterAtLeastOneSepWalker=Mr.NextTerminalAfterAtLeastOneWalker=Mr.NextTerminalAfterManySepWalker=Mr.NextTerminalAfterManyWalker=Mr.AbstractNextTerminalAfterProductionWalker=Mr.NextAfterTokenWalker=Mr.AbstractNextPossibleTokensWalker=void 0;var rG=zI(),Ut=Yt(),tye=Yv(),Dt=bn(),iG=function(t){bc(e,t);function e(r,i){var n=t.call(this)||this;return n.topProd=r,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,Ut.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ut.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(r,i){i===void 0&&(i=[]),this.found||t.prototype.walk.call(this,r,i)},e.prototype.walkProdRef=function(r,i,n){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(r.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Ut.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(rG.RestWalker);Mr.AbstractNextPossibleTokensWalker=iG;var rye=function(t){bc(e,t);function e(r,i){var n=t.call(this,r,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminal
|
|||
|
`+(""+s.join(`
|
|||
|
|
|||
|
`).replace(/\n/g,`
|
|||
|
`)))}}};return r.prototype=i,r.prototype.constructor=r,r._RULE_NAMES=e,r}Pi.createBaseSemanticVisitorConstructor=zye;function _ye(t,e,r){var i=function(){};(0,jp.defineNameProp)(i,t+"BaseSemanticsWithDefaults");var n=Object.create(r.prototype);return(0,Ss.forEach)(e,function(s){n[s]=LG}),i.prototype=n,i.prototype.constructor=i,i}Pi.createBaseVisitorConstructorWithDefaults=_ye;var oS;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(oS=Pi.CstVisitorDefinitionError||(Pi.CstVisitorDefinitionError={}));function TG(t,e){var r=OG(t,e),i=MG(t,e);return r.concat(i)}Pi.validateVisitor=TG;function OG(t,e){var r=(0,Ss.map)(e,function(i){if(!(0,Ss.isFunction)(t[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,jp.functionName)(t.constructor)+" CST Visitor.",type:oS.MISSING_METHOD,methodName:i}});return(0,Ss.compact)(r)}Pi.validateMissingCstMethods=OG;var Vye=["constructor","visit","validateVisitor"];function MG(t,e){var r=[];for(var i in t)(0,Ss.isFunction)(t[i])&&!(0,Ss.contains)(Vye,i)&&!(0,Ss.contains)(e,i)&&r.push({msg:"Redundant visitor method: <"+i+"> on "+(0,jp.functionName)(t.constructor)+` CST Visitor
|
|||
|
There is no Grammar Rule corresponding to this method's name.
|
|||
|
`,type:oS.REDUNDANT_METHOD,methodName:i});return r}Pi.validateRedundantMethods=MG});var HG=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.TreeBuilder=void 0;var Eg=RG(),ii=Yt(),KG=UG(),Xye=Xn(),Zye=function(){function t(){}return t.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,ii.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:Xye.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ii.NOOP,this.cstFinallyStateUpdate=ii.NOOP,this.cstPostTerminal=ii.NOOP,this.cstPostNonTerminal=ii.NOOP,this.cstPostRule=ii.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eg.setNodeLocationFull,this.setNodeLocationFromNode=Eg.setNodeLocationFull,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Eg.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=Eg.setNodeLocationOnlyOffset,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ii.NOOP,this.setNodeLocationFromNode=ii.NOOP,this.cstPostRule=ii.NOOP,this.setInitialNodeLocation=ii.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(e){var r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstInvocationStateUpdate=function(e,r){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},t.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},t.prototype.cstPostRuleFull=function(e){var r=this.LA(0),i=e.location;i.startOffset<=r.startOffset?(i.endOffset=r.endOffset,i.endLine=r.endLine,i.endColumn=r.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(e){var r=this.LA(0),i=e.location;i.startOffset<=r.startOffset?i.endOffset=r.endOffset:i.startOffset=NaN},t.prototype.cstPostTerminal=function(e,r){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Eg.addTerminalToCst)(i,r,e),this.setNodeLocationFromToken(i.location,r)},t.prototype.cstPostNonTerminal=function(e,r){var i=this.CST_STACK[this.CST_STACK.length-1];(0,Eg.addNoneTerminalToCst)(i,r,e),this.setNodeLocationFromNode(i.location,e.location)},t.prototype.getBaseCstVisitorConstructor=function(){if((0,ii.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,KG.createBaseSemanticVisitorConstructor)(this.className,(0,ii.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,ii.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,KG.createBaseVisitorConstructorWithDefaults)(this.className,(0,ii.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.getLastExplicitRuleShortNa
|
|||
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|||
|
For Further details.`);if((0,Rr.isArray)(e)){if((0,Rr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty.
|
|||
|
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
|
|||
|
For Further details.`)}if((0,Rr.isArray)(e))this.tokensMap=(0,Rr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Rr.has)(e,"modes")&&(0,Rr.every)((0,Rr.flatten)((0,Rr.values)(e.modes)),Gp.isTokenType)){var i=(0,Rr.flatten)((0,Rr.values)(e.modes)),n=(0,Rr.uniq)(i);this.tokensMap=(0,Rr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Rr.isObject)(e))this.tokensMap=(0,Rr.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=zG.EOF;var s=(0,Rr.every)((0,Rr.values)(e),function(o){return(0,Rr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Gp.tokenStructuredMatcherNoCategories:Gp.tokenStructuredMatcher,(0,Gp.augmentTokenTypes)((0,Rr.values)(this.tokensMap))},t.prototype.defineRule=function(e,r,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,Rr.has)(i,"resyncEnabled")?i.resyncEnabled:WG.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Rr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:WG.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<<Zn.BITS_FOR_METHOD_TYPE+Zn.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;function a(u){try{if(this.outputCst===!0){r.apply(this,u);var g=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(g),g}else return r.apply(this,u)}catch(f){return this.invokeRuleCatch(f,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=r,l},t.prototype.invokeRuleCatch=function(e,r,i){var n=this.RULE_STACK.length===1,s=r&&!this.isBackTracking()&&this.recoveryEnabled;if((0,ly.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},t.prototype.optionInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(Zn.OPTION_IDX,r);return this.optionInternalLogic(e,r,i)},t.prototype.optionInternalLogic=function(e,r,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)},t.prototype.atLeastOneInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(Zn.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,r,i)},t.prototype.atLeastOneInternalLogic=function(e,r,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(r.DEF!==void 0){if(o=r.DEF,a=r.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=r;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,JG.PROD_TYPE.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],s,Zn.AT_LEAST_ONE_IDX,e,Ig.NextTerminalAfterAtLeastOneWalker)},t.prototype.atLeastOneSepFirstInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(Zn.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,r,i)},t.prototype.atLeastOneSepFirstInternalLogic=function(e,r,i){var n=this,s=r.DEF,o=r.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,Ig.NextTerminalAfterAtLeastOneSepWalker],l,Zn.AT_LEAST_ONE_SEP_IDX,e,Ig.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,JG.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)},t.prototype.manyInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(Zn.MANY_IDX,e);return this.manyInternalLogic(e,r,i)},t.prototype.manyInternalLogic=function(e,r,i){var n=this,s=this.getLaFuncFromCache(i),o,a;if(r.DEF!==void 0){if(o=r.DEF,a=r.GATE,a!==void 0){var l=s;s=function(){return a.call(n)&&l.call(n)}}}else o=r;for(var c=!0;s.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],s,Zn.MANY_IDX,e,Ig.NextTerminalAfterManyWalker,c)},t.prototype.manySepFirstInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(Zn.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,r,i)},t.prototype.manySepFirstInternalLogic=function(e,r,i){var n=this,s=r.DEF,o=r.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)
|
|||
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(oY);var hwe={name:`This CSTNode indicates the Parser is in Recording Phase
|
|||
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},dwe=function(){function t(){}return t.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var r=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++)r(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})},t.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var r=0;r<10;r++){var i=r>0?r:"";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})},t.prototype.ACTION_RECORD=function(e){},t.prototype.BACKTRACK_RECORD=function(e,r){return function(){return!0}},t.prototype.LA_RECORD=function(e){return gwe.END_OF_FILE},t.prototype.topLevelRuleRecord=function(e,r){try{var i=new Ho.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),r.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|||
|
This error was thrown during the "grammar recording phase" For more info see:
|
|||
|
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(s){throw n}throw n}},t.prototype.optionInternalRecord=function(e,r){return Yp.call(this,Ho.Option,e,r)},t.prototype.atLeastOneInternalRecord=function(e,r){Yp.call(this,Ho.RepetitionMandatory,r,e)},t.prototype.atLeastOneSepFirstInternalRecord=function(e,r){Yp.call(this,Ho.RepetitionMandatoryWithSeparator,r,e,iY)},t.prototype.manyInternalRecord=function(e,r){Yp.call(this,Ho.Repetition,r,e)},t.prototype.manySepFirstInternalRecord=function(e,r){Yp.call(this,Ho.RepetitionWithSeparator,r,e,iY)},t.prototype.orInternalRecord=function(e,r){return pwe.call(this,e,r)},t.prototype.subruleInternalRecord=function(e,r,i){if(hy(r),!e||(0,Sn.has)(e,"ruleName")===!1){var n=new Error("<SUBRULE"+aY(r)+"> 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,Sn.peek)(this.recordingProdStack),o=e.ruleName,a=new Ho.NonTerminal({idx:r,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?hwe:fy},t.prototype.consumeInternalRecord=function(e,r,i){if(hy(r),!(0,tY.hasShortKeyProperty)(e)){var n=new Error("<CONSUME"+aY(r)+"> 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,Sn.peek)(this.recordingProdStack),o=new Ho.Terminal({idx:r,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),oY},t}();gy.GastRecorder=dwe;function Yp(t,e,r,i){i===void 0&&(i=!1),hy(r);var n=(0,Sn.peek)(this.recordingProdStack),s=(0,Sn.isFunction)(e)?e:e.DEF,o=new t({definition:[],idx:r});return i&&(o.separator=e.SEP),(0,Sn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),fy}function pwe(t,e){var r=this;hy(e);var i=(0,Sn.peek)(this.recordingProdStack),n=(0,Sn.isArray)(t)===!1,s=n===!1?t:t.DEF,o=new Ho.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});(0,Sn.has)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);var a=(0,Sn.some)(s,function(l){return(0,Sn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,Sn.forEach)(s,function(l){var c=new Ho.Alternative({definition:[]});o.definition.push(c),(0,Sn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,Sn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),r.recordingProdStack.push(c),l.ALT.call(r),r.recordingProdStack.pop()}),fy}function aY(t){return t===0?"":""+t}function hy(t){if(t<0||t>nY){var e=new Error("Invalid DSL Method idx value: <"+t+`>
|
|||
|
`+("Idx value must be a none negative value smaller than "+(nY+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var cY=w(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.PerformanceTracer=void 0;var lY=Yt(),Cwe=Xn(),mwe=function(){function t(){}return t.prototype.initPerformanceTracer=function(e){if((0,lY.has)(e,"traceInitPerf")){var r=e.traceInitPerf,i=typeof r=="number";this.traceInitMaxIdent=i?r:Infinity,this.traceInitPerf=i?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Cwe.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(e,r){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,lY.timer)(r),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 r()},t}();py.PerformanceTracer=mwe});var uY=w(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.applyMixins=void 0;function Ewe(t,e){e.forEach(function(r){var i=r.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(t.prototype,n,s):t.prototype[n]=r.prototype[n]}})})}dy.applyMixins=Ewe});var Xn=w(Er=>{"use strict";var gY=Er&&Er.__extends||function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Er,"__esModule",{value:!0});Er.EmbeddedActionsParser=Er.CstParser=Er.Parser=Er.EMPTY_ALT=Er.ParserDefinitionErrorType=Er.DEFAULT_RULE_CONFIG=Er.DEFAULT_PARSER_CONFIG=Er.END_OF_FILE=void 0;var an=Yt(),Iwe=Xj(),fY=JA(),hY=Tp(),pY=BG(),ywe=nS(),wwe=DG(),Bwe=HG(),bwe=GG(),Qwe=qG(),vwe=_G(),Swe=XG(),kwe=eY(),xwe=AY(),Pwe=cY(),Dwe=uY();Er.END_OF_FILE=(0,fY.createTokenInstance)(fY.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Er.END_OF_FILE);Er.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:hY.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Er.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var Rwe;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(Rwe=Er.ParserDefinitionErrorType||(Er.ParserDefinitionErrorType={}));function Fwe(t){return t===void 0&&(t=void 0),function(){return t}}Er.EMPTY_ALT=Fwe;var Cy=function(){function t(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(r),i.initLexerAdapter(),i.initLooksAhead(r),i.initRecognizerEngine(e,r),i.initRecoverable(r),i.initTreeBuilder(r),i.initContentAssist(),i.initGastRecorder(r),i.initPerformanceTracer(r),(0,an.has)(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|||
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|||
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|||
|
For further details.`);this.skipValidations=(0,an.has)(r,"skipValidations")?r.skipValidations:Er.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,an.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,an.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,pY.resolveGrammar)({rules:(0,an.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,an.isEmpty)(n)&&e.skipValidations===!1){var s=(0,pY.validateGrammar)({rules:(0,an.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,an.values)(e.tokensMap),errMsgProvider:hY.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,an.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Iwe.computeAllProdsFollows)((0,an.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,an.values)(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,an.isEmpty)(e.definitionErrors))throw r=(0,an.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected:
|
|||
|
`+r.join(`
|
|||
|
-------------------------------
|
|||
|
`))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();Er.Parser=Cy;(0,Dwe.applyMixins)(Cy,[ywe.Recoverable,wwe.LooksAhead,Bwe.TreeBuilder,bwe.LexerAdapter,vwe.RecognizerEngine,Qwe.RecognizerApi,Swe.ErrorHandler,kwe.ContentAssist,xwe.GastRecorder,Pwe.PerformanceTracer]);var Nwe=function(t){gY(e,t);function e(r,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!0,n=t.call(this,r,s)||this,n}return e}(Cy);Er.CstParser=Nwe;var Lwe=function(t){gY(e,t);function e(r,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!1,n=t.call(this,r,s)||this,n}return e}(Cy);Er.EmbeddedActionsParser=Lwe});var CY=w(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.createSyntaxDiagramsCode=void 0;var dY=xv();function Twe(t,e){var r=e===void 0?{}:e,i=r.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+dY.VERSION+"/diagrams/":i,s=r.css,o=s===void 0?"https://unpkg.com/chevrotain@"+dY.VERSION+"/diagrams/diagrams.css":s,a=`
|
|||
|
<!-- 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(t,null," ")+`;
|
|||
|
</script>
|
|||
|
`,f=`
|
|||
|
<script>
|
|||
|
var diagramsDiv = document.getElementById("diagrams");
|
|||
|
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|||
|
</script>
|
|||
|
`;return a+l+c+u+g+f}my.createSyntaxDiagramsCode=Twe});var IY=w(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Parser=Ve.createSyntaxDiagramsCode=Ve.clearCache=Ve.GAstVisitor=Ve.serializeProduction=Ve.serializeGrammar=Ve.Terminal=Ve.Rule=Ve.RepetitionWithSeparator=Ve.RepetitionMandatoryWithSeparator=Ve.RepetitionMandatory=Ve.Repetition=Ve.Option=Ve.NonTerminal=Ve.Alternative=Ve.Alternation=Ve.defaultLexerErrorProvider=Ve.NoViableAltException=Ve.NotAllInputParsedException=Ve.MismatchedTokenException=Ve.isRecognitionException=Ve.EarlyExitException=Ve.defaultParserErrorProvider=Ve.tokenName=Ve.tokenMatcher=Ve.tokenLabel=Ve.EOF=Ve.createTokenInstance=Ve.createToken=Ve.LexerDefinitionErrorType=Ve.Lexer=Ve.EMPTY_ALT=Ve.ParserDefinitionErrorType=Ve.EmbeddedActionsParser=Ve.CstParser=Ve.VERSION=void 0;var Owe=xv();Object.defineProperty(Ve,"VERSION",{enumerable:!0,get:function(){return Owe.VERSION}});var Ey=Xn();Object.defineProperty(Ve,"CstParser",{enumerable:!0,get:function(){return Ey.CstParser}});Object.defineProperty(Ve,"EmbeddedActionsParser",{enumerable:!0,get:function(){return Ey.EmbeddedActionsParser}});Object.defineProperty(Ve,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return Ey.ParserDefinitionErrorType}});Object.defineProperty(Ve,"EMPTY_ALT",{enumerable:!0,get:function(){return Ey.EMPTY_ALT}});var mY=Dp();Object.defineProperty(Ve,"Lexer",{enumerable:!0,get:function(){return mY.Lexer}});Object.defineProperty(Ve,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return mY.LexerDefinitionErrorType}});var yg=JA();Object.defineProperty(Ve,"createToken",{enumerable:!0,get:function(){return yg.createToken}});Object.defineProperty(Ve,"createTokenInstance",{enumerable:!0,get:function(){return yg.createTokenInstance}});Object.defineProperty(Ve,"EOF",{enumerable:!0,get:function(){return yg.EOF}});Object.defineProperty(Ve,"tokenLabel",{enumerable:!0,get:function(){return yg.tokenLabel}});Object.defineProperty(Ve,"tokenMatcher",{enumerable:!0,get:function(){return yg.tokenMatcher}});Object.defineProperty(Ve,"tokenName",{enumerable:!0,get:function(){return yg.tokenName}});var Mwe=Tp();Object.defineProperty(Ve,"defaultParserErrorProvider",{enumerable:!0,get:function(){return Mwe.defaultParserErrorProvider}});var qp=mg();Object.defineProperty(Ve,"EarlyExitException",{enumerable:!0,get:function(){return qp.EarlyExitException}});Object.defineProperty(Ve,"isRecognitionException",{enumerable:!0,get:function(){return qp.isRecognitionException}});Object.defineProperty(Ve,"MismatchedTokenException",{enumerable:!0,get:function(){return qp.MismatchedTokenException}});Object.defineProperty(Ve,"NotAllInputParsedException",{enumerable:!0,get:function(){return qp.NotAllInputParsedException}});Object.defineProperty(Ve,"NoViableAltException",{enumerable:!0,get:function(){return qp.NoViableAltException}});var Uwe=Uv();Object.defineProperty(Ve,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return Uwe.defaultLexerErrorProvider}});var jo=bn();Object.defineProperty(Ve,"Alternation",{enumerable:!0,get:function(){return jo.Alternation}});Object.defineProperty(Ve,"Alternative",{enumerable:!0,get:function(){return jo.Alternative}});Object.defineProperty(Ve,"NonTerminal",{enumerable:!0,get:function(){return jo.NonTerminal}});Object.defineProperty(Ve,"Option",{enumerable:!0,get:function(){return jo.Option}});Object.defineProperty(Ve,"Repetition",{enumerable:!0,get:function(){return jo.Repetition}});Object.defineProperty(Ve,"RepetitionMandatory",{enumerable:!0,get:function(){return jo.RepetitionMandatory}});Object.defineProperty(Ve,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return jo.RepetitionMandatoryWithSeparator}});Object.defineProperty(Ve,"RepetitionWithSeparator",{enumerable:!0,get:function(){return jo.RepetitionWithSeparator}});Object.defineProperty(Ve,"Rule",{enumerable:!0,get:function(){return jo.Rule}});Object.defineProperty(Ve,"Terminal",{enumerable:!0,get:function(){return jo.Terminal}});var EY=bn();Object.defineProperty(Ve,"serializeGrammar",{enumerable:!0,get:function(
|
|||
|
It performs no action other than printing this message.
|
|||
|
Please avoid using it as it will be completely removed in the future`)}Ve.clearCache=Hwe;var jwe=CY();Object.defineProperty(Ve,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return jwe.createSyntaxDiagramsCode}});var Gwe=function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|||
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t}();Ve.Parser=Gwe});var BY=w((Vtt,yY)=>{var Iy=IY(),Ga=Iy.createToken,wY=Iy.tokenMatcher,cS=Iy.Lexer,Ywe=Iy.EmbeddedActionsParser;yY.exports=t=>{let e=Ga({name:"LogicalOperator",pattern:cS.NA}),r=Ga({name:"Or",pattern:/\|/,categories:e}),i=Ga({name:"Xor",pattern:/\^/,categories:e}),n=Ga({name:"And",pattern:/&/,categories:e}),s=Ga({name:"Not",pattern:/!/}),o=Ga({name:"LParen",pattern:/\(/}),a=Ga({name:"RParen",pattern:/\)/}),l=Ga({name:"Query",pattern:t}),u=[Ga({name:"WhiteSpace",pattern:/\s+/,group:cS.SKIPPED}),r,i,n,o,a,s,e,l],g=new cS(u);class f extends Ywe{constructor(p){super(u);this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let y=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let Q=y,S=this.CONSUME(e),x=this.SUBRULE2(this.atomicExpression);wY(S,r)?y=M=>Q(M)||x(M):wY(S,i)?y=M=>!!(Q(M)^x(M)):y=M=>Q(M)&&x(M)}),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:f}}});var bY=w(yy=>{var qwe=BY();yy.makeParser=(t=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:r}=qwe(t),i=new r;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};yy.parse=yy.makeParser()});var vY=w((Ztt,QY)=>{"use strict";QY.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
|
|||
|
`:`
|
|||
|
`)+r,n=i+1,i=t.indexOf(`
|
|||
|
`,n)}while(i!==-1);return s+=t.substr(n),s};YY.exports={stringReplaceAll:nBe,stringEncaseCRLFWithFirstIndex:sBe}});var VY=w((ort,JY)=>{"use strict";var oBe=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,WY=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,aBe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ABe=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,lBe=new Map([["n",`
|
|||
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function zY(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):lBe.get(t)||t}function cBe(t,e){let r=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))r.push(o);else if(n=s.match(aBe))r.push(n[2].replace(ABe,(a,l,c)=>l?zY(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${t}')`)}return r}function uBe(t){WY.lastIndex=0;let e=[],r;for(;(r=WY.exec(t))!==null;){let i=r[1];if(r[2]){let n=cBe(i,r[2]);e.push([i].concat(n))}else e.push([i])}return e}function _Y(t,e){let r={};for(let n of e)for(let s of n.styles)r[s[0]]=n.inverse?null:s.slice(1);let i=t;for(let[n,s]of Object.entries(r))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}JY.exports=(t,e)=>{let r=[],i=[],n=[];if(e.replace(oBe,(s,o,a,l,c,u)=>{if(o)n.push(zY(o));else if(l){let g=n.join("");n=[],i.push(r.length===0?g:_Y(t,r)(g)),r.push({inverse:a,styles:uBe(l)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(_Y(t,r)(n.join(""))),n=[],r.pop()}else n.push(u)}),i.push(n.join("")),r.length>0){let s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return i.join("")}});var IS=w((art,XY)=>{"use strict";var Wp=MY(),{stdout:dS,stderr:CS}=GY(),{stringReplaceAll:gBe,stringEncaseCRLFWithFirstIndex:fBe}=qY(),ZY=["ansi","ansi","ansi256","ansi16m"],Qg=Object.create(null),hBe=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=dS?dS.level:0;t.level=e.level===void 0?r:e.level},$Y=class{constructor(e){return eq(e)}},eq=t=>{let e={};return hBe(e,t),e.template=(...r)=>pBe(e.template,...r),Object.setPrototypeOf(e,by.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=$Y,e.template};function by(t){return eq(t)}for(let[t,e]of Object.entries(Wp))Qg[t]={get(){let r=Qy(this,mS(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Qg.visible={get(){let t=Qy(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var tq=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of tq)Qg[t]={get(){let{level:e}=this;return function(...r){let i=mS(Wp.color[ZY[e]][t](...r),Wp.color.close,this._styler);return Qy(this,i,this._isEmpty)}}};for(let t of tq){let e="bg"+t[0].toUpperCase()+t.slice(1);Qg[e]={get(){let{level:r}=this;return function(...i){let n=mS(Wp.bgColor[ZY[r]][t](...i),Wp.bgColor.close,this._styler);return Qy(this,n,this._isEmpty)}}}}var dBe=Object.defineProperties(()=>{},te(N({},Qg),{level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}})),mS=(t,e,r)=>{let i,n;return r===void 0?(i=t,n=e):(i=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:r}},Qy=(t,e,r)=>{let i=(...n)=>CBe(i,n.length===1?""+n[0]:n.join(" "));return i.__proto__=dBe,i._generator=t,i._styler=e,i._isEmpty=r,i},CBe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:i,closeAll:n}=r;if(e.indexOf("")!==-1)for(;r!==void 0;)e=gBe(e,r.close,r.open),r=r.parent;let s=e.indexOf(`
|
|||
|
`);return s!==-1&&(e=fBe(e,n,i,s)),i+e+n},ES,pBe=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let i=e.slice(1),n=[r.raw[0]];for(let s=1;s<r.length;s++)n.push(String(i[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return ES===void 0&&(ES=VY()),ES(t,n.join(""))};Object.defineProperties(by.prototype,Qg);var zp=by();zp.supportsColor=dS;zp.stderr=by({level:CS?CS.level:0});zp.stderr.supportsColor=CS;zp.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};XY.exports=zp});var vy=w(xs=>{"use strict";xs.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;xs.find=(t,e)=>t.nodes.find(r=>r.type===e);xs.exceedsLimit=(t,e,r=1,i)=>i===!1||!xs.isInteger(t)||!xs.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=i;xs.escapeNode=(t,e=0,r)=>{let i=t.nodes[e];!i||(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};xs.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0==0?(t.invalid=!0,!0):!1;xs.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0==0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;xs.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;xs.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);xs.flatten=(...t)=>{let e=[],r=i=>{for(let n=0;n<i.length;n++){let s=i[n];Array.isArray(s)?r(s,e):s!==void 0&&e.push(s)}return e};return r(t),e}});var Sy=w((lrt,rq)=>{"use strict";var iq=vy();rq.exports=(t,e={})=>{let r=(i,n={})=>{let s=e.escapeInvalid&&iq.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(s||o)&&iq.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=r(l);return a};return r(t)}});var sq=w((crt,nq)=>{"use strict";nq.exports=function(t){return typeof t=="number"?t-t==0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var hq=w((urt,oq)=>{"use strict";var aq=sq(),vc=(t,e,r)=>{if(aq(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(aq(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i=N({relaxZeros:!0},r);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=t+":"+e+"="+n+s+o+a;if(vc.cache.hasOwnProperty(l))return vc.cache[l].result;let c=Math.min(t,e),u=Math.max(t,e);if(Math.abs(c-u)===1){let m=t+"|"+e;return i.capture?`(${m})`:i.wrap===!1?m:`(?:${m})`}let g=lq(t)||lq(e),f={min:t,max:e,a:c,b:u},h=[],p=[];if(g&&(f.isPadded=g,f.maxLen=String(f.max).length),c<0){let m=u<0?Math.abs(u):1;p=Aq(m,Math.abs(c),f,i),c=f.a=0}return u>=0&&(h=Aq(c,u,f,i)),f.negatives=p,f.positives=h,f.result=mBe(p,h,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&h.length+p.length>1&&(f.result=`(?:${f.result})`),vc.cache[l]=f,f.result};function mBe(t,e,r){let i=yS(t,e,"-",!1,r)||[],n=yS(e,t,"",!1,r)||[],s=yS(t,e,"-?",!0,r)||[];return i.concat(s).concat(n).join("|")}function IBe(t,e){let r=1,i=1,n=cq(t,r),s=new Set([e]);for(;t<=n&&n<=e;)s.add(n),r+=1,n=cq(t,r);for(n=uq(e+1,i)-1;t<n&&n<=e;)s.add(n),i+=1,n=uq(e+1,i)-1;return s=[...s],s.sort(EBe),s}function BBe(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let i=yBe(t,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+=wBe(l,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:n}}function Aq(t,e,r,i){let n=IBe(t,e),s=[],o=t,a;for(let l=0;l<n.length;l++){let c=n[l],u=BBe(String(o),String(c),i),g="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+gq(a.count),o=c+1;continue}r.isPadded&&(g=bBe(c,r,i)),u.string=g+u.pattern+gq(u.count),s.push(u),o=c+1,a=u}return s}function yS(t,e,r,i,n){let s=[];for(let o of t){let{string:a}=o;!i&&!fq(e,"string",
|
|||
|
`,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 Lq=w((drt,Dq)=>{"use strict";var OBe=Sy(),{MAX_LENGTH:Rq,CHAR_BACKSLASH:QS,CHAR_BACKTICK:MBe,CHAR_COMMA:UBe,CHAR_DOT:KBe,CHAR_LEFT_PARENTHESES:HBe,CHAR_RIGHT_PARENTHESES:jBe,CHAR_LEFT_CURLY_BRACE:GBe,CHAR_RIGHT_CURLY_BRACE:YBe,CHAR_LEFT_SQUARE_BRACKET:Fq,CHAR_RIGHT_SQUARE_BRACKET:Nq,CHAR_DOUBLE_QUOTE:qBe,CHAR_SINGLE_QUOTE:JBe,CHAR_NO_BREAK_SPACE:WBe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:zBe}=Pq(),_Be=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(Rq,r.maxLength):Rq;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let n={type:"root",input:t,nodes:[]},s=[n],o=n,a=n,l=0,c=t.length,u=0,g=0,f,h={},p=()=>t[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],f=p(),!(f===zBe||f===WBe)){if(f===QS){m({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Nq){m({type:"text",value:"\\"+f});continue}if(f===Fq){l++;let y=!0,Q;for(;u<c&&(Q=p());){if(f+=Q,Q===Fq){l++;continue}if(Q===QS){f+=p();continue}if(Q===Nq&&(l--,l===0))break}m({type:"text",value:f});continue}if(f===HBe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:f});continue}if(f===jBe){if(o.type!=="paren"){m({type:"text",value:f});continue}o=s.pop(),m({type:"text",value:f}),o=s[s.length-1];continue}if(f===qBe||f===JBe||f===MBe){let y=f,Q;for(e.keepQuotes!==!0&&(f="");u<c&&(Q=p());){if(Q===QS){f+=Q+p();continue}if(Q===y){e.keepQuotes===!0&&(f+=Q);break}f+=Q}m({type:"text",value:f});continue}if(f===GBe){g++;let y=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=m({type:"brace",open:!0,close:!1,dollar:y,depth:g,commas:0,ranges:0,nodes:[]}),s.push(o),m({type:"open",value:f});continue}if(f===YBe){if(o.type!=="brace"){m({type:"text",value:f});continue}let y="close";o=s.pop(),o.close=!0,m({type:y,value:f}),g--,o=s[s.length-1];continue}if(f===UBe&&g>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:OBe(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===KBe&&g>0&&o.commas===0){let y=o.nodes;if(g===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,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 Q=y[y.length-1];Q.value+=a.value+f,a=Q,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}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],Q=y.nodes.indexOf(o);y.nodes.splice(Q,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};Dq.exports=_Be});var Mq=w((Crt,Tq)=>{"use strict";var Oq=Sy(),VBe=Qq(),XBe=kq(),ZBe=Lq(),$n=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let n=$n.create(i,e);Array.isArray(n)?r.push(...n):r.push(n)}else r=[].concat($n.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};$n.parse=(t,e={})=>ZBe(t,e);$n.stringify=(t,e={})=>typeof t=="string"?Oq($n.parse(t,e),e):Oq(t,e);$n.compile=(t,e={})=>(typeof t=="string"&&(t=$n.parse(t,e)),VBe(t,e));$n.expand=(t,e={})=>{typeof t=="string"&&(t=$n.parse(t,e));let r=XBe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};$n.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?$n.compile(t,e):$n.expand(t,e);Tq.exports=$n});var Vp=w((mrt,Uq)=>{"use strict";var $Be=require("path"),Go="\\\\/",Kq=`[^${Go}]`,Ya="\\.",e0e="\\+",t0e="\\?",xy="\\/",r0e="(?=.)",Hq="[^/]",vS=`(?:${xy}|$)`,j
|
|||
|
Please report this to https://github.com/szmarczak/http2-wrapper/`);p(m)}return}i[0].resolve(h);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 f=Nxe.connect(e,N({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},r));f[gn]=0,f[_g]=!1;let h=()=>f[gn]<f.remoteSettings.maxConcurrentStreams,p=!0;f.socket.once("session",y=>{this.tlsSessionCache.set(u,y)}),f.once("error",y=>{for(let{reject:Q}of i)Q(y);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[o];y.splice(y.indexOf(f),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:Q}of i)Q(y);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!h())){for(let y of f[Fs])if(y in this.queue[o]){let{listeners:Q}=this.queue[o][y];for(;Q.length!==0&&h();)Q.shift().resolve(f);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(!h())break}}};f.on("origin",()=>{f[Fs]=f.originSet,!!h()&&(m(),rP(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let y=new Error("Agent has been destroyed");for(let Q of i)Q.reject(y);f.destroy();return}f[Fs]=f.originSet;{let y=this.sessions;if(o in y){let Q=y[o];Q.splice(Oxe(Q,f,Mxe),0,f)}else y[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),m(),l(),f[gn]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,r,i),i.length=0),f.on("remoteSettings",()=>{m(),rP(this.sessions[o],f)})}),f[s4]=f.request,f.request=(y,Q)=>{if(f[_g])throw new Error("The session is gracefully closing. No new streams are allowed.");let S=f[s4](y,Q);return f.ref(),++f[gn],f[gn]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,S.once("close",()=>{if(p=h(),--f[gn],!f.destroyed&&!f.closed&&(Uxe(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let x=f[gn]===0;x&&f.unref(),x&&(this._freeSessionsCount>this.maxFreeSessions||f[_g])?f.close():(rP(this.sessions[o],f),m())}}),S}}catch(f){for(let h of i)h.reject(f);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,r,i,n){return new Promise((s,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,r){return eA.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof r.servername=="undefined"&&(r.servername=n),Fxe.connect(i,n,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[gn]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let i of r)i.destroy(e);for(let r of Object.values(this.queue))for(let i of Object.values(r))i.destroyed=!0;this.queue={}}get freeSessions(){return a4({agent:this,isFree:!0})}get busySessions(){return a4({agent:this,isFree:!1})}};eA.kCurrentStreamsCount=gn;eA.kGracefullyClosing=_g;n4.exports={Agent:eA,globalAgent:new eA}});var nP=w((uot,A4)=>{"use strict";var{Readable:Kxe}=require("stream"),l4=class extends Kxe{constructor(e,r){super({highWaterMark:r,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,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners
|
|||
|
`).reverse(),a=r.stack.slice(r.stack.indexOf(r.message)+r.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(`
|
|||
|
`)}`}}};qt.RequestError=fi;var FP=class extends fi{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e);this.name="MaxRedirectsError"}};qt.MaxRedirectsError=FP;var NP=class extends fi{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request);this.name="HTTPError"}};qt.HTTPError=NP;var LP=class extends fi{constructor(e,r){super(e.message,e,r);this.name="CacheError"}};qt.CacheError=LP;var TP=class extends fi{constructor(e,r){super(e.message,e,r);this.name="UploadError"}};qt.UploadError=TP;var OP=class extends fi{constructor(e,r,i){super(e.message,e,i);this.name="TimeoutError",this.event=e.event,this.timings=r}};qt.TimeoutError=OP;var Mw=class extends fi{constructor(e,r){super(e.message,e,r);this.name="ReadError"}};qt.ReadError=Mw;var MP=class extends fi{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}};qt.UnsupportedProtocolError=MP;var WPe=["socket","connect","continue","information","upgrade","timeout"],RP=class extends e_.Duplex{constructor(e,r={},i){super({autoDestroy:!1,highWaterMark:0});this[Zg]=0,this[ef]=0,this.requestInitialized=!1,this[Tw]=new Set,this.redirects=[],this[tf]=!1,this[Ow]=!1,this[Nd]=[],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 kP.IncomingMessage&&(this.options.headers=N(N({},c.headers),this.options.headers))});let{json:o,body:a,form:l}=r;if((o||a||l)&&this._lockWrite(),qt.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,i)}catch(c){me.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof vPe.ReadStream&&await YPe(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[Ri])===null||c===void 0||c.destroy();return}for(let g of this[Nd])g();this[Nd].length=0,this.requestInitialized=!0}catch(u){if(u instanceof fi){this._beforeError(u);return}this.destroyed||this.destroy(u)}})()}static normalizeArguments(e,r,i){var n,s,o,a,l;let c=r;if(me.default.object(e)&&!me.default.urlInstance(e))r=N(N(N({},i),e),r);else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r=N(N({},i),r),e!==void 0&&(r.url=e),me.default.urlInstance(r.url)&&(r.url=new al.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),me.assert.any([me.default.string,me.default.undefined],r.method),me.assert.any([me.default.object,me.default.undefined],r.headers),me.assert.any([me.default.string,me.default.urlInstance,me.default.undefined],r.prefixUrl),me.assert.any([me.default.object,me.default.undefined],r.cookieJar),me.assert.any([me.default.object,me.default.string,me.default.undefined],r.searchParams),me.assert.any([me.default.object,me.default.string,me.default.undefined],r.cache),me.assert.any([me.default.object,me.default.number,me.default.undefined],r.timeout),me.assert.any([me.default.object,me.default.undefined],r.context),me.assert.any([me.default.object,me.default.undefined],r.hooks),me.assert.any([me.default.boolean,me.default.undefined],r.decompress),me.assert.any([me.default.boolean,me.default.undefined],r.ignoreInvalidCookies),me.assert.any([me.default.boolean,me.default.undefined],r.followRedirect),me.assert.any([me.default.number,me.default.undefined],r.maxRedirects),me.assert.any([me.default.boolean,me.default.undefined],r.throwHttpErrors),me.assert.any([me.default.boolean,me.default.undefined],r.http2),me.assert.any([me.default.boolean,me.default.undefined],r.allowGetBody),me.assert.any([me.default.string,me.default.undefined],r.localAddress),me.ass
|
|||
|
`,g.message,g.stack);var f=new Error("tunneling socket could not be established, cause="+g.message);f.code="ECONNRESET",e.request.emit("error",f),i.removeSocket(n)}};rA.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var i=this.requests.shift();i&&this.createSocket(i,function(n){i.request.onSocket(n)})}};function N_(t,e){var r=this;rA.prototype.createSocket.call(r,t,function(i){var n=t.request.getHeader("host"),s=JP({},r.options,{socket:i,servername:n?n.replace(/:.*$/,""):t.host}),o=EDe.connect(0,s);r.sockets[r.sockets.indexOf(i)]=o,e(o)})}function L_(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function JP(t){for(var e=1,r=arguments.length;e<r;++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&&(t[a]=i[a])}}return t}var ul;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?ul=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:ul=function(){};rf.debug=ul});var M_=w((Wot,O_)=>{O_.exports=T_()});var z_=w((Jw,XP)=>{var W_=Object.assign({},require("fs")),ZP=function(){var t=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(t=t||__filename),function(e){e=e||{};var r=typeof e!="undefined"?e:{},i,n;r.ready=new Promise(function(d,E){i=d,n=E});var s={},o;for(o in r)r.hasOwnProperty(o)&&(s[o]=r[o]);var a=[],l="./this.program",c=function(d,E){throw E},u=!1,g=!0,f="";function h(d){return r.locateFile?r.locateFile(d,f):f+d}var p,m,y,Q;g&&(u?f=require("path").dirname(f)+"/":f=__dirname+"/",p=function(E,I){var D=ba(E);return D?I?D:D.toString():(y||(y=W_),Q||(Q=require("path")),E=Q.normalize(E),y.readFileSync(E,I?null:"utf8"))},m=function(E){var I=p(E,!0);return I.buffer||(I=new Uint8Array(I)),Ae(I.buffer),I},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),c=function(d){process.exit(d)},r.inspect=function(){return"[Emscripten Module object]"});var S=r.print||console.log.bind(console),x=r.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);s=null,r.arguments&&(a=r.arguments),r.thisProgram&&(l=r.thisProgram),r.quit&&(c=r.quit);var M=16;function Y(d,E){return E||(E=M),Math.ceil(d/E)*E}var U=0,J=function(d){U=d},W;r.wasmBinary&&(W=r.wasmBinary);var ee=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Sr("no native wasm support detected");function Z(d,E,I){switch(E=E||"i8",E.charAt(E.length-1)==="*"&&(E="i32"),E){case"i1":return pe[d>>0];case"i8":return pe[d>>0];case"i16":return be[d>>1];case"i32":return fe[d>>2];case"i64":return fe[d>>2];case"float":return Ht[d>>2];case"double":return Mt[d>>3];default:Sr("invalid type for getValue: "+E)}return null}var A,ne=!1,le;function Ae(d,E){d||Sr("Assertion failed: "+E)}function T(d){var E=r["_"+d];return Ae(E,"Cannot call unknown function "+d+", make sure it is exported"),E}function L(d,E,I,D,O){var V={string:function(nt){var It=0;if(nt!=null&&nt!==0){var ke=(nt.length<<2)+1;It=B(ke),Qe(nt,It,ke)}return It},array:function(nt){var It=B(nt.length);return Ue(nt,It),It}};function ie(nt){return E==="string"?re(nt):E==="boolean"?Boolean(nt):nt}var Be=T(d),Ce=[],_e=0;if(D)for(var ot=0;ot<D.length;ot++){var wt=V[I[ot]];wt?(_e===0&&(_e=FE()),Ce[ot]=wt(D[ot])):Ce[ot]=D[ot]}var ut=Be.apply(null,Ce);return ut=ie(ut),_e!==0&&NE(_e),ut}function Ee(d,E,I,D){I=I||[];var O=I.every(function(ie){return ie==="number"}),V=E!=="string";return V&&O&&!D?T(d):function(){return L(d,E,I,arguments,D)}}var we=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function qe(d,E,I){for(var D=E+I,O=E;d[O]&&!(O>=D);)++O;if(O-E>16&&d.subarray&&we)return we.decode(d.subarray(E,O));for(var V="";E<O;){var ie=d[E++];if(!(ie&128)){V+=String.fromCharCode(ie);continue}var Be=d[E++]&63;if((ie&224)==192){V+=String.fromCharCode((ie&31)<<6|Be);continue}var Ce=d[E++]&63;if((ie&240)==224?ie=(ie&15)<<12|Be<<6|Ce:ie=(ie&7)<<18|Be<<12|Ce<<6|d[E
|
|||
|
`)):typeof readline=="function"&&(E=readline(),E!==null&&(E+=`
|
|||
|
`));if(!E)return null;d.input=RA(E,!0)}return d.input.shift()},put_char:function(d,E){E===null||E===10?(S(qe(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(S(qe(d.output,0)),d.output=[])}},default_tty1_ops:{put_char:function(d,E){E===null||E===10?(x(qe(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(x(qe(d.output,0)),d.output=[])}}};function hs(d){for(var E=Y(d,65536),I=Et(E);d<E;)pe[I+d++]=0;return I}var pt={ops_table:null,mount:function(d){return pt.createNode(null,"/",16384|511,0)},createNode:function(d,E,I,D){if(v.isBlkdev(I)||v.isFIFO(I))throw new v.ErrnoError(63);pt.ops_table||(pt.ops_table={dir:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr,lookup:pt.node_ops.lookup,mknod:pt.node_ops.mknod,rename:pt.node_ops.rename,unlink:pt.node_ops.unlink,rmdir:pt.node_ops.rmdir,readdir:pt.node_ops.readdir,symlink:pt.node_ops.symlink},stream:{llseek:pt.stream_ops.llseek}},file:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr},stream:{llseek:pt.stream_ops.llseek,read:pt.stream_ops.read,write:pt.stream_ops.write,allocate:pt.stream_ops.allocate,mmap:pt.stream_ops.mmap,msync:pt.stream_ops.msync}},link:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr,readlink:pt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr},stream:v.chrdev_stream_ops}});var O=v.createNode(d,E,I,D);return v.isDir(O.mode)?(O.node_ops=pt.ops_table.dir.node,O.stream_ops=pt.ops_table.dir.stream,O.contents={}):v.isFile(O.mode)?(O.node_ops=pt.ops_table.file.node,O.stream_ops=pt.ops_table.file.stream,O.usedBytes=0,O.contents=null):v.isLink(O.mode)?(O.node_ops=pt.ops_table.link.node,O.stream_ops=pt.ops_table.link.stream):v.isChrdev(O.mode)&&(O.node_ops=pt.ops_table.chrdev.node,O.stream_ops=pt.ops_table.chrdev.stream),O.timestamp=Date.now(),d&&(d.contents[E]=O,d.timestamp=O.timestamp),O},getFileDataAsTypedArray:function(d){return d.contents?d.contents.subarray?d.contents.subarray(0,d.usedBytes):new Uint8Array(d.contents):new Uint8Array(0)},expandFileStorage:function(d,E){var I=d.contents?d.contents.length:0;if(!(I>=E)){var D=1024*1024;E=Math.max(E,I*(I<D?2:1.125)>>>0),I!=0&&(E=Math.max(E,256));var O=d.contents;d.contents=new Uint8Array(E),d.usedBytes>0&&d.contents.set(O.subarray(0,d.usedBytes),0)}},resizeFileStorage:function(d,E){if(d.usedBytes!=E)if(E==0)d.contents=null,d.usedBytes=0;else{var I=d.contents;d.contents=new Uint8Array(E),I&&d.contents.set(I.subarray(0,Math.min(E,d.usedBytes))),d.usedBytes=E}},node_ops:{getattr:function(d){var E={};return E.dev=v.isChrdev(d.mode)?d.id:1,E.ino=d.id,E.mode=d.mode,E.nlink=1,E.uid=0,E.gid=0,E.rdev=d.rdev,v.isDir(d.mode)?E.size=4096:v.isFile(d.mode)?E.size=d.usedBytes:v.isLink(d.mode)?E.size=d.link.length:E.size=0,E.atime=new Date(d.timestamp),E.mtime=new Date(d.timestamp),E.ctime=new Date(d.timestamp),E.blksize=4096,E.blocks=Math.ceil(E.size/E.blksize),E},setattr:function(d,E){E.mode!==void 0&&(d.mode=E.mode),E.timestamp!==void 0&&(d.timestamp=E.timestamp),E.size!==void 0&&pt.resizeFileStorage(d,E.size)},lookup:function(d,E){throw v.genericErrors[44]},mknod:function(d,E,I,D){return pt.createNode(d,E,I,D)},rename:function(d,E,I){if(v.isDir(d.mode)){var D;try{D=v.lookupNode(E,I)}catch(V){}if(D)for(var O in D.contents)throw new v.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=I,E.contents[I]=d,E.timestamp=d.parent.timestamp,d.parent=E},unlink:function(d,E){delete d.contents[E],d.timestamp=Date.now()},rmdir:function(d,E){var I=v.lookupNode(d,E);for(var D in I.contents)throw new v.ErrnoError(55);delete d.contents[E],d.timestamp=Date.now()},readdir:function(d){var E=[".",".."];for(var I in d.contents)!d.contents.hasOwnProperty(I)||E.push(I);return E},symlink:function(d,E,I){var D=pt.createNode(d,E,511|40960,0);return D.link=I,D},readlink:function(d){if(!v.isLink(d.mode))throw new v.ErrnoError(28);return d.link}},stream_ops:{read:function(d,E,I,D,O){var V=d.node.contents;if(O>=d.node.usedBytes)return 0;var
|
|||
|
`,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}};hB.parse=(t,e,r)=>new hB(wFe(BFe(t),e),r);var wFe=(t,e)=>e?Object.keys(t).reduce((r,i)=>(r[i]=t[i],r),e):t,BFe=t=>t.replace(/\n$/,"").split(`
|
|||
|
`).reduce(bFe,Object.create(null)),bFe=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return t;let s=i.join("=");return t[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,t};G6.exports=hB});var dB=w((FAt,Y6)=>{"use strict";Y6.exports=t=>class extends t{warn(e,r,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=r instanceof Error&&r.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(r instanceof Error&&(i=Object.assign(r,i),r=r.message),this.emit("warn",i.tarCode,r,i)):r instanceof Error?this.emit("error",Object.assign(r,i)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),i))}}});var PD=w((NAt,q6)=>{"use strict";var CB=["|","<",">","?",":"],xD=CB.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),QFe=new Map(CB.map((t,e)=>[t,xD[e]])),vFe=new Map(xD.map((t,e)=>[t,CB[e]]));q6.exports={encode:t=>CB.reduce((e,r)=>e.split(r).join(QFe.get(r)),t),decode:t=>xD.reduce((e,r)=>e.split(r).join(vFe.get(r)),t)}});var W6=w((LAt,J6)=>{"use strict";J6.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&~18),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var OD=w((KAt,z6)=>{"use strict";var _6=of(),V6=pB(),X6=lf(),TAt=Zd(),ra=require("fs"),cf=require("path"),OAt=Xd(),SFe=16*1024*1024,Z6=Symbol("process"),$6=Symbol("file"),eV=Symbol("directory"),DD=Symbol("symlink"),tV=Symbol("hardlink"),$d=Symbol("header"),mB=Symbol("read"),RD=Symbol("lstat"),EB=Symbol("onlstat"),FD=Symbol("onread"),ND=Symbol("onreadlink"),LD=Symbol("openfile"),TD=Symbol("onopenfile"),Xc=Symbol("close"),IB=Symbol("mode"),rV=dB(),kFe=PD(),iV=W6(),yB=rV(class extends _6{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||SFe,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=r.cwd||process.cwd(),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let i=!1;if(!this.preservePaths&&cf.win32.isAbsolute(e)){let n=cf.win32.parse(e);this.path=e.substr(n.root.length),i=n.root}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=kFe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=r.absolute||cf.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[EB](this.statCache.get(this.absolute)):this[RD]()}[RD](){ra.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[EB](r)})}[EB](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=xFe(e),this.emit("stat",e),this[Z6]()}[Z6](){switch(this.type){case"File":return this[$6]();case"Directory":return this[eV]();case"SymbolicLink":return this[DD]();default:return this.end()}}[IB](e){return iV(e,this.type==="Directory",this.portable)}[$d](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new X6({path:this.path,linkpath:this.linkpath,mode:this[IB](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new V6({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.d
|
|||
|
`}),a},i})});var gA=w(xR=>{"use strict";Object.defineProperty(xR,"__esModule",{value:!0});xR.default=f7;function f7(){}f7.prototype={diff:function(e,r){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),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var a=r.length,l=e.length,c=1,u=a+l,g=[{newPos:-1,components:[]}],f=this.extractCommon(g[0],r,e,0);if(g[0].newPos+1>=a&&f+1>=l)return o([{value:this.join(r),count:r.length}]);function h(){for(var m=-1*c;m<=c;m+=2){var y=void 0,Q=g[m-1],S=g[m+1],x=(S?S.newPos:0)-m;Q&&(g[m-1]=void 0);var M=Q&&Q.newPos+1<a,Y=S&&0<=x&&x<l;if(!M&&!Y){g[m]=void 0;continue}if(!M||Y&&Q.newPos<S.newPos?(y=hLe(S),s.pushComponent(y.components,void 0,!0)):(y=Q,y.newPos++,s.pushComponent(y.components,!0,void 0)),x=s.extractCommon(y,r,e,m),y.newPos+1>=a&&x+1>=l)return o(fLe(s,y.components,r,e,s.useLongestToken));g[m]=y}c++}if(n)(function m(){setTimeout(function(){if(c>u)return n();h()||m()},0)})();else for(;c<=u;){var p=h();if(p)return p}},pushComponent:function(e,r,i){var n=e[e.length-1];n&&n.added===r&&n.removed===i?e[e.length-1]={count:n.count+1,added:r,removed:i}:e.push({count:1,added:r,removed:i})},extractCommon:function(e,r,i,n){for(var s=r.length,o=i.length,a=e.newPos,l=a-n,c=0;a+1<s&&l+1<o&&this.equals(r[a+1],i[l+1]);)a++,l++,c++;return c&&e.components.push({count:c}),e.newPos=a,l},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],i=0;i<e.length;i++)e[i]&&r.push(e[i]);return r},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function fLe(t,e,r,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=t.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=r.slice(a,a+c.count);u=u.map(function(h,p){var m=i[l+p];return m.length>h.length?m:h}),c.value=t.join(u)}else c.value=t.join(r.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var f=e[o-1];return o>1&&typeof f.value=="string"&&(f.added||f.removed)&&t.equals("",f.value)&&(e[o-2].value+=f.value,e.pop()),e}function hLe(t){return{newPos:t.newPos,components:t.components.slice(0)}}});var p7=w(lC=>{"use strict";Object.defineProperty(lC,"__esModule",{value:!0});lC.diffChars=pLe;lC.characterDiff=void 0;var CLe=dLe(gA());function dLe(t){return t&&t.__esModule?t:{default:t}}var h7=new CLe.default;lC.characterDiff=h7;function pLe(t,e,r){return h7.diff(t,e,r)}});var DR=w(PR=>{"use strict";Object.defineProperty(PR,"__esModule",{value:!0});PR.generateOptions=mLe;function mLe(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}});var m7=w(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.diffWords=ELe;bf.diffWordsWithSpace=ILe;bf.wordDiff=void 0;var wLe=yLe(gA()),BLe=DR();function yLe(t){return t&&t.__esModule?t:{default:t}}var d7=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,C7=/\S/,cC=new wLe.default;bf.wordDiff=cC;cC.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!C7.test(t)&&!C7.test(e)};cC.tokenize=function(t){for(var e=t.split(/(\s+|[()[\]{}'"]|\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&d7.test(e[r])&&d7.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};function ELe(t,e,r){return r=(0,BLe.generateOptions)(r,{ignoreWhitespace:!0}),cC.diff(t,e,r)}function ILe(t,e,r){return cC.diff(t,e,r)}});var ZB=w(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.diffLines=bLe;Qf.diffTrimmedLines=QLe;Qf.lineDiff=void 0;var SLe=vLe(gA()),kLe=DR();function vLe(t){return t&&t.__esModule?t:{default:t}}var XB=new SLe.default;Qf.lineDiff=XB;XB.tokenize=function(t){var e=[],r=t.
|
|||
|
`),m==="+"?h++:m==="-"?p++:m===" "&&(h++,p++);else break}if(!h&&f.newLines===1&&(f.newLines=0),!p&&f.oldLines===1&&(f.oldLines=0),e.strict){if(h!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(p!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1))}return f}for(;s<r.length;)o();return n}});var b7=w(LR=>{"use strict";Object.defineProperty(LR,"__esModule",{value:!0});LR.default=GLe;function GLe(t,e,r){var i=!0,n=!1,s=!1,o=1;return function a(){if(i&&!s){if(n?o++:i=!1,t+o<=r)return o;s=!0}if(!n)return s||(i=!0),e<=t-o?-o++:(n=!0,a())}}});var S7=w(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.applyPatch=Q7;r0.applyPatches=YLe;var v7=t0(),JLe=qLe(b7());function qLe(t){return t&&t.__esModule?t:{default:t}}function Q7(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=(0,v7.parsePatch)(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var i=t.split(/\r\n|[\n\v\f\r\x85]/),n=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=e.hunks,o=r.compareLine||function(T,L,Ee,we){return L===we},a=0,l=r.fuzzFactor||0,c=0,u=0,g,f;function h(T,L){for(var Ee=0;Ee<T.lines.length;Ee++){var we=T.lines[Ee],qe=we.length>0?we[0]:" ",re=we.length>0?we.substr(1):we;if(qe===" "||qe==="-"){if(!o(L+1,i[L],qe,re)&&(a++,a>l))return!1;L++}}return!0}for(var p=0;p<s.length;p++){for(var m=s[p],y=i.length-m.oldLines,Q=0,S=u+m.oldStart-1,x=(0,JLe.default)(S,c,y);Q!==void 0;Q=x())if(h(m,S+Q)){m.offset=u+=Q;break}if(Q===void 0)return!1;c=m.offset+m.oldStart+m.oldLines}for(var M=0,Y=0;Y<s.length;Y++){var U=s[Y],J=U.oldStart+U.offset+M-1;M+=U.newLines-U.oldLines,J<0&&(J=0);for(var W=0;W<U.lines.length;W++){var ee=U.lines[W],Z=ee.length>0?ee[0]:" ",A=ee.length>0?ee.substr(1):ee,ne=U.linedelimiters[W];if(Z===" ")J++;else if(Z==="-")i.splice(J,1),n.splice(J,1);else if(Z==="+")i.splice(J,0,A),n.splice(J,0,ne),J++;else if(Z==="\\"){var le=U.lines[W-1]?U.lines[W-1][0]:null;le==="+"?g=!0:le==="-"&&(f=!0)}}}if(g)for(;!i[i.length-1];)i.pop(),n.pop();else f&&(i.push(""),n.push(`
|
|||
|
`));for(var Ae=0;Ae<i.length-1;Ae++)i[Ae]=i[Ae]+n[Ae];return i.join("")}function YLe(t,e){typeof t=="string"&&(t=(0,v7.parsePatch)(t));var r=0;function i(){var n=t[r++];if(!n)return e.complete();e.loadFile(n,function(s,o){if(s)return e.complete(s);var a=Q7(o,n,e);e.patched(n,a,function(l){if(l)return e.complete(l);i()})})}i()}});var OR=w(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});pC.structuredPatch=k7;pC.createTwoFilesPatch=x7;pC.createPatch=WLe;var zLe=ZB();function TR(t){return XLe(t)||VLe(t)||_Le()}function _Le(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function VLe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function XLe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function k7(t,e,r,i,n,s,o){o||(o={}),typeof o.context=="undefined"&&(o.context=4);var a=(0,zLe.diffLines)(r,i,o);a.push({value:"",lines:[]});function l(Q){return Q.map(function(S){return" "+S})}for(var c=[],u=0,g=0,f=[],h=1,p=1,m=function(S){var x=a[S],M=x.lines||x.value.replace(/\n$/,"").split(`
|
|||
|
`);if(x.lines=M,x.added||x.removed){var Y;if(!u){var U=a[S-1];u=h,g=p,U&&(f=o.context>0?l(U.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(Y=f).push.apply(Y,TR(M.map(function(Ae){return(x.added?"+":"-")+Ae}))),x.added?p+=M.length:h+=M.length}else{if(u)if(M.length<=o.context*2&&S<a.length-2){var J;(J=f).push.apply(J,TR(l(M)))}else{var W,ee=Math.min(M.length,o.context);(W=f).push.apply(W,TR(l(M.slice(0,ee))));var Z={oldStart:u,oldLines:h-u+ee,newStart:g,newLines:p-g+ee,lines:f};if(S>=a.length-2&&M.length<=o.context){var A=/\n$/.test(r),ne=/\n$/.test(i),le=M.length==0&&f.length>Z.oldLines;!A&&le&&f.splice(Z.oldLines,0,"\\ No newline at end of file"),(!A&&!le||!ne)&&f.push("\\ No newline at end of file")}c.push(Z),u=0,g=0,f=[]}h+=M.length,p+=M.length}},y=0;y<a.length;y++)m(y);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}function x7(t,e,r,i,n,s,o){var a=k7(t,e,r,i,n,s,o),l=[];t==e&&l.push("Index: "+t),l.push("==================================================================="),l.push("--- "+a.oldFileName+(typeof a.oldHeader=="undefined"?"":" "+a.oldHeader)),l.push("+++ "+a.newFileName+(typeof a.newHeader=="undefined"?"":" "+a.newHeader));for(var c=0;c<a.hunks.length;c++){var u=a.hunks[c];l.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),l.push.apply(l,u.lines)}return l.join(`
|
|||
|
`)+`
|
|||
|
`}function WLe(t,e,r,i,n,s){return x7(t,t,e,r,i,n,s)}});var D7=w(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.arrayEqual=ZLe;i0.arrayStartsWith=P7;function ZLe(t,e){return t.length!==e.length?!1:P7(t,e)}function P7(t,e){if(e.length>t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}});var j7=w(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.calcLineCount=R7;n0.merge=$Le;var eTe=OR(),tTe=t0(),MR=D7();function Sf(t){return nTe(t)||iTe(t)||rTe()}function rTe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function iTe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function nTe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function R7(t){var e=UR(t.lines),r=e.oldLines,i=e.newLines;r!==void 0?t.oldLines=r:delete t.oldLines,i!==void 0?t.newLines=i:delete t.newLines}function $Le(t,e,r){t=F7(t,r),e=F7(e,r);var i={};(t.index||e.index)&&(i.index=t.index||e.index),(t.newFileName||e.newFileName)&&(N7(t)?N7(e)?(i.oldFileName=s0(i,t.oldFileName,e.oldFileName),i.newFileName=s0(i,t.newFileName,e.newFileName),i.oldHeader=s0(i,t.oldHeader,e.oldHeader),i.newHeader=s0(i,t.newHeader,e.newHeader)):(i.oldFileName=t.oldFileName,i.newFileName=t.newFileName,i.oldHeader=t.oldHeader,i.newHeader=t.newHeader):(i.oldFileName=e.oldFileName||t.oldFileName,i.newFileName=e.newFileName||t.newFileName,i.oldHeader=e.oldHeader||t.oldHeader,i.newHeader=e.newHeader||t.newHeader)),i.hunks=[];for(var n=0,s=0,o=0,a=0;n<t.hunks.length||s<e.hunks.length;){var l=t.hunks[n]||{oldStart:Infinity},c=e.hunks[s]||{oldStart:Infinity};if(L7(l,c))i.hunks.push(T7(l,o)),n++,a+=l.newLines-l.oldLines;else if(L7(c,l))i.hunks.push(T7(c,a)),s++,o+=c.newLines-c.oldLines;else{var u={oldStart:Math.min(l.oldStart,c.oldStart),oldLines:0,newStart:Math.min(l.newStart+o,c.oldStart+a),newLines:0,lines:[]};sTe(u,l.oldStart,l.lines,c.oldStart,c.lines),s++,n++,i.hunks.push(u)}}return i}function F7(t,e){if(typeof t=="string"){if(/^@@/m.test(t)||/^Index:/m.test(t))return(0,tTe.parsePatch)(t)[0];if(!e)throw new Error("Must provide a base reference or pass in a patch");return(0,eTe.structuredPatch)(void 0,void 0,e,t)}return t}function N7(t){return t.newFileName&&t.newFileName!==t.oldFileName}function s0(t,e,r){return e===r?e:(t.conflict=!0,{mine:e,theirs:r})}function L7(t,e){return t.oldStart<e.oldStart&&t.oldStart+t.oldLines<e.oldStart}function T7(t,e){return{oldStart:t.oldStart,oldLines:t.oldLines,newStart:t.newStart+e,newLines:t.newLines,lines:t.lines}}function sTe(t,e,r,i,n){var s={offset:e,lines:r,index:0},o={offset:i,lines:n,index:0};for(M7(t,s,o),M7(t,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],l=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(l[0]==="-"||l[0]==="+"))oTe(t,s,o);else if(a[0]==="+"&&l[0]===" "){var c;(c=t.lines).push.apply(c,Sf(Au(s)))}else if(l[0]==="+"&&a[0]===" "){var u;(u=t.lines).push.apply(u,Sf(Au(o)))}else a[0]==="-"&&l[0]===" "?O7(t,s,o):l[0]==="-"&&a[0]===" "?O7(t,o,s,!0):a===l?(t.lines.push(a),s.index++,o.index++):KR(t,Au(s),Au(o))}U7(t,s),U7(t,o),R7(t)}function oTe(t,e,r){var i=Au(e),n=Au(r);if(K7(i)&&K7(n)){if((0,MR.arrayStartsWith)(i,n)&&H7(r,i,i.length-n.length)){var s;(s=t.lines).push.apply(s,Sf(i));return}else if((0,MR.arrayStartsWith)(n,i)&&H7(e,n,n.length-i.length)){var o;(o=t.lines).push.apply(o,Sf(n));return}}else if((0,MR.arrayEqual)(i,n)){var a;(a=t.lines).push.apply(a,Sf(i));return}KR(t,i,n)}function O7(t,e,r,i){var n=Au(e),s=aTe(r,n);if(s.merged){var o;(o=t.lines).push.apply(o,Sf(s.merged))}else KR(t,i?s:n,i?n:s)}function KR(t,e,r){t.conflict=!0,t.lines.push({conflict:!0,mine:e,theirs:r})}function M7(t,e,r){for(;e.offset<r.offset&&e.index<e.lines.length;){var i=e.lines[e.index++];t.lines.push(i),e.offset++}}function U7(t,e){for(;e.index<e.lines.length;){var r=e.lines[e.index++];t.lines.push(r)}}function Au(t){for(var e=[],r=t.lines[t.index][0];t.index<t.lines.length;){var i=t.lines[t.index];if(r==="-"&&i[0]===
|
|||
|
|
|||
|
attempted value: ${s}
|
|||
|
`+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,r){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,r={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=r,u=e;l||(u=this._cast(u,Ys({assert:!1},r)));let g={value:u,path:s,options:r,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),(0,Wte.default)({args:g,value:u,path:s,sync:n,tests:f,endEarly:c},h=>{if(h)return void i(h,u);(0,Wte.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,r,i){let n=this.resolve(Ys({},r,{value:e}));return typeof i=="function"?n._validate(e,r,i):new Promise((s,o)=>n._validate(e,r,(a,l)=>{a?o(a):s(l)}))}validateSync(e,r){let i=this.resolve(Ys({},r,{value:e})),n;return i._validate(e,Ys({},r,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,r){return this.validate(e,r).then(()=>!0,i=>{if(_te.default.isError(i))return!1;throw i})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(i){if(_te.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,Jte.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 r=this.clone();return r.spec.strict=e,r}_isPresent(e){return e!=null}defined(e=Hf.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(r){return r!==void 0}})}required(e=Hf.mixed.required){return this.clone({presence:"required"}).withMutation(r=>r.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(r=>r.OPTIONS.name!=="required"),e}nullable(e=!0){var r=this.clone({nullable:e!==!1});return r}transform(e){var r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Hf.mixed.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,T0.default)(r),s=r.exclusive||r.name&&i.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(i.exclusiveTests[r.name]=!!r.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===r.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let i=this.clone(),n=(0,_je.default)(e).map(s=>new Wje.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new Jje.default(n,r)),i}typeError(e){var r=this.clone();return r._typeError=(0,T0.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),r}oneOf(e,r=Hf.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,T0.default)({message:r,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,r=Hf.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,T0.default)({message:r,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 r=this.clone();return r.spec.strip=e,r}describe(){let e=this.clone(),{label:r,meta:i}=e.spec;return{meta:i,label:r,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=r(t.styles[o[c]],a,l);return a},n=(s,o,a)=>{t.styles[s]=e({name:s,codes:o}),(t.keys[a]||(t.keys[a]=[])).push(s),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(c){t.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,t),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"),t.ansiRegex=gqe,t.hasColor=t.hasAnsi=s=>(t.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&t.ansiRegex.test(s)),t.alias=(s,o)=>{let a=typeof o=="string"?t[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}),t.styles[s]=a,a.stack=[s]),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(l){t.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},t.theme=s=>{if(!uqe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))t.alias(o,s[o]);return t},t.alias("unstyle",s=>typeof s=="string"&&s!==""?(t.ansiRegex.lastIndex=0,s.replace(t.ansiRegex,"")):""),t.alias("noop",s=>s),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=kie(),t.define=n,t};aN.exports=xie();aN.exports.create=xie});var Xi=w(Lt=>{"use strict";var fqe=Object.prototype.toString,qs=Co(),Pie=!1,AN=[],Die={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Lt.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);Lt.hasColor=t=>!!t&&qs.hasColor(t);var W0=Lt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Lt.nativeType=t=>fqe.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");Lt.isAsyncFn=t=>Lt.nativeType(t)==="asyncfunction";Lt.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";Lt.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;Lt.scrollDown=(t=[])=>[...t.slice(1),t[0]];Lt.scrollUp=(t=[])=>[t.pop(),...t];Lt.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};Lt.swap=(t,e,r)=>{let i=t.length,n=r===i?0:r<0?i-1:r,s=t[e];t[e]=t[n],t[n]=s};Lt.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};Lt.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};Lt.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=`
|
|||
|
`+r,width:n=80}=e;n-=((i+r).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=t.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," "))),r+c.join(i)};Lt.unmute=t=>{let e=t.stack.find(i=>qs.keys.color.includes(i));return e?qs[e]:t.stack.find(i=>i.slice(2)==="bg")?qs[e.slice(2)]:i=>i};Lt.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";Lt.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>qs.keys.color.includes(i));if(e){let i=qs["bg"+Lt.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?qs[r.slice(2).toLowerCase()]||t:qs.none};Lt.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>qs.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return qs[Die[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=Die[i];return n&&qs["bg"+Lt.pascal(n)]||t}return qs.none};Lt.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=r<10?"0"+r:r;return n+":"+s+" "+i};Lt.set=(t={},e="",r)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:r;return!Lt.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},t);Lt.get=(t={},e="",r)=>{let i=t[e]==null?e.split(".").reduce((n,s)=>n&&n[s],t):t[e];return i==null?r:i};Lt.mixin=(t,e)=>{if(!W0(t))return e;if(!W0(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&W0(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);W0(n.value)?t[r]=Lt.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};Lt.merge=(...t)=>{let e={};for(let r of t)Lt.mixin(e,r);return e};Lt.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?Lt.define(t,i,n.bind(e)):Lt.define(t,i,n)}};Lt.onExit=t=>{let e=(r,i)=>{Pie||(Pie=!0,AN.forEach(n=>n()),r===!0&&process.exit(128+i))};AN.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),AN.push(t)};Lt.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};Lt.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var Rie=w(Wf=>{"use strict";Wf.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"};Wf.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};Wf.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};Wf.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};Wf.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 Lie=w((xpt,Fie)=>{"use strict";var Nie=require("readline"),hqe=Rie(),pqe=/^(?:\x1b)([a-zA-Z0-9])$/,dqe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Cqe={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
|
|||
|
`)i.name="enter";else if(t===" ")i.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x7F"||t==="\b")i.name="backspace",i.meta=t.charAt(0)==="";else if(t===""||t==="")i.name="escape",i.meta=t.length===2;else if(t===" "||t===" ")i.name="space",i.meta=t.length===2;else if(t<="")i.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),i.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")i.name="number";else if(t.length===1&&t>="a"&&t<="z")i.name=t;else if(t.length===1&&t>="A"&&t<="Z")i.name=t.toLowerCase(),i.shift=!0;else if(r=pqe.exec(t))i.meta=!0,i.shift=/^[A-Z]$/.test(r[1]);else if(r=dqe.exec(t)){let n=[...t];n[0]===""&&n[1]===""&&(i.option=!0);let s=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),o=(r[3]||r[5]||1)-1;i.ctrl=!!(o&4),i.meta=!!(o&10),i.shift=!!(o&1),i.code=s,i.name=Cqe[s],i.shift=mqe(s)||i.shift,i.ctrl=Eqe(s)||i.ctrl}return i};z0.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let i=Nie.createInterface({terminal:!0,input:r});Nie.emitKeypressEvents(r,i);let n=(a,l)=>e(a,z0(a,l),i),s=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",n),i.resume(),()=>{r.isTTY&&r.setRawMode(s),r.removeListener("keypress",n),i.pause(),i.close()}};z0.action=(t,e,r)=>{let i=N(N({},hqe),r);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)};Fie.exports=z0});var Oie=w((Ppt,Tie)=>{"use strict";Tie.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(!!e)for(let r of Object.keys(e)){let i=e[r];typeof i=="number"&&(i={interval:i}),Iqe(t,r,i)}};function Iqe(t,e,r={}){let i=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=r.interval||120;i.frames=r.frames||[],i.loading=!0;let s=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,t.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(s)},Reflect.defineProperty(i,"interval",{value:s}),t.once("close",()=>i.stop()),i.stop}});var Kie=w((Dpt,Mie)=>{"use strict";var{define:yqe,width:wqe}=Xi(),Uie=class{constructor(e){let r=e.options;yqe(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=wqe(r.stdout||process.stdout),Object.assign(this,r),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=N({},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 r=this._color||e[this.status];return typeof r=="function"?r: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"}};Mie.exports=Uie});var jie=w((Rpt,Hie)=>{"use strict";var lN=Xi(),Fi=Co(),cN={default:Fi.noop,noop:Fi.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||lN.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||lN.complement(this.primary)},primary:Fi.cyan,success:Fi.green,danger:Fi.magenta,strong:Fi.bold,warning:Fi.yellow,muted:Fi.dim,disabled:Fi.gray,dark:Fi.dim.gray,underline:Fi.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing
|
|||
|
`),c=l[0],u=l[l.length-1],f=(i+(r?" "+r:"")).length,h=f<c.length?c.slice(f+1):"";return{header:o,prompt:c,after:h,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 r=`
|
|||
|
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
|
|||
|
`+this.styles.danger(r),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(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(mu.cursor.down(e.rest.length)),this.write(`
|
|||
|
`.repeat(r))}catch(e){}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=dN.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:r,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let n=r.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,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,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=r&&r[e]!=null?r[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,r,i);return!g&&r&&r[e]?this.resolve(c,s,r,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,i=this.state;return i.timer=r,Tn.isObject(e)&&(e=e[i.status]||e.pending),Tn.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Tn.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,i=this.state;i.timer=r;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return Tn.isObject(s)&&(s=s[i.status]||s.pending),Tn.hasColor(s)?s:this.styles.muted(s)}async pointer(e,r){let i=await this.element("pointer",e,r);if(typeof i=="string"&&Tn.hasColor(i))return i;if(i){let n=this.styles,s=this.index===r,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=Tn.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,r){let i=await this.element("indicator",e,r);if(typeof i=="string"&&Tn.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 Tn.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 Tn.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,...r){return Tn.resolve(this,e,...r)}get base(){return _0.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Tn.height(this.stdout,25)}get width(){return this.options.columns||Tn.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:r}=this.state,i=[r,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function Rqe(t){let e=n=>t[n]===void 0||typeof t[n]=="function",r=["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(t.options)){if(r.includes(n)||/^on[A-Z]/.test(n))continue;let s=t.options[n];typeof s=="function"&&e(n)?i.includes(n)||(t[n]=s.bind(t)):typeof t[n]!="function"&&(t[n]=s)}}function Fqe(t
|
|||
|
`:" ",i=[];for(let n=0;n<4;n++){let s=r(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}Zie.exports=_0});var rne=w((Tpt,ene)=>{"use strict";var Nqe=Xi(),tne={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return tne.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};ene.exports=(t,e={})=>{let r=Nqe.merge({},tne,e.roles);return r[t]||r.default}});var XC=w((Opt,ine)=>{"use strict";var Lqe=Co(),Tqe=zf(),Oqe=rne(),V0=Xi(),{reorder:CN,scrollUp:Mqe,scrollDown:Uqe,isObject:nne,swap:Kqe}=V0,sne=class extends Tqe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,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:r,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");nne(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){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,r).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,r,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=Oqe(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=r,e.cursor=0,V0.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,Lqe.unstyle(e.message).length));let o=N({},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,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let n=await this.toChoice(e,r,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,r,i){let n=N({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,r,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,r)
|
|||
|
`),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:r}=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(r),this.write([n,i,u,g].filter(Boolean).join(`
|
|||
|
`)),this.write(this.margin[2]),this.restore()}};ane.exports=Ane});var une=w((Upt,lne)=>{"use strict";var jqe=kl(),Gqe=(t,e)=>{let r=t.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(r),o=e(i.slice(s,s+r.length));return s>=0?i.slice(0,s)+o+i.slice(s+r.length):i}},cne=class extends jqe{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:r,input:i}=this.state;return this.input=i.slice(0,r)+e+i.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.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,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let i=e.toLowerCase();return r.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,r=Gqe(this.input,e),i=this.choices;this.choices=i.map(n=>te(N({},n),{message:r(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};lne.exports=cne});var IN=w((Kpt,gne)=>{"use strict";var EN=Xi();gne.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||t.styles.placeholder,l=EN.inverse(t.styles.primary),c=m=>l(t.styles.black(m)),u=r,g=" ",f=c(g);if(t.blink&&t.blink.off===!0&&(c=m=>m,f=""),s&&n===0&&i===""&&r==="")return c(g);if(s&&n===0&&(r===i||r===""))return c(i[0])+a(i.slice(1));i=EN.isPrimitive(i)?`${i}`:"",r=EN.isPrimitive(r)?`${r}`:"";let h=i&&i.startsWith(r)&&i!==r,p=h?c(i[r.length]):f;if(n!==r.length&&s===!0&&(u=r.slice(0,n)+c(r[n])+r.slice(n+1),p=""),s===!1&&(p=""),h){let m=t.styles.unstyle(u+p);return u+p+a(i.slice(m.length))}return u+p}});var X0=w((Hpt,fne)=>{"use strict";var Yqe=Co(),qqe=kl(),Jqe=IN(),hne=class extends qqe{constructor(e){super(te(N({},e),{multiple:!0}));this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=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(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:i,input:n}=r;return r.value=r.input=n.slice(0,i)+e+n.slice(i),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:i}=e;return e.value=e.input=i.slice(0,r-1)+i.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:i}=e;if(i[r]===void 0)return this.alert();let n=`${i}`.slice(0,r)+`${i}`.slice(r+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,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:i}=e;return r&&r.s
|
|||
|
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Ine.exports=yne});var bne=w((qpt,wne)=>{"use strict";var eJe=Z0(),Bne=class extends eJe{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};wne.exports=Bne});var Sne=w((Jpt,Qne)=>{"use strict";var tJe=kl(),rJe=X0(),_f=rJe.prototype,vne=class extends tJe{constructor(e){super(te(N({},e),{multiple:!0}));this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():_f.dispatch.call(this,e,r)}append(e,r){return _f.append.call(this,e,r)}delete(e,r){return _f.delete.call(this,e,r)}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?_f.next.call(this):super.next()}prev(){return this.focused.editable?_f.prev.call(this):super.prev()}async indicator(e,r){let i=e.indicator||"",n=e.editable?i:super.indicator(e,r);return await this.resolve(n,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?_f.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let i=r.parent?this.value[r.parent.name]:this.value;if(r.editable?i=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(i=r.enabled===!0),e=await r.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 r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Qne.exports=vne});var Eu=w((Wpt,kne)=>{"use strict";var iJe=zf(),nJe=IN(),{isPrimitive:sJe}=Xi(),xne=class extends iJe{constructor(e){super(e);this.initial=sJe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let i=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!i||i.name!=="return")?this.append(`
|
|||
|
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:i}=this.state;this.input=`${i}`.slice(0,r)+e+`${i}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.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 r=this.input.slice(0,e),i=this.input.slice(e),n=r.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 r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):nJe(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),i=await this.separator(),n=await this.message(),s=[r,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(`
|
|||
|
`)),this.restore()}};kne.exports=xne});var Dne=w((zpt,Pne)=>{"use strict";var oJe=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),$0=t=>oJe(t).filter(Boolean);Pne.exports=(t,e={},r="")=>{let{past:i=[],present:n=""}=e,s,o;switch(t){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:$0([r,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:$0([...s,r]),present:o};case"save":return{past:$0([...i,r]),present:""};case"remove":return o=$0(i.filter(a=>a!==r)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${t}"`)}}});var wN=w((_pt,Rne)=>{"use strict";var aJe=Eu(),Fne=Dne(),Nne=class extends aJe{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let i=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.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=Fne(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=Fne("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Rne.exports=Nne});var One=w((Vpt,Lne)=>{"use strict";var AJe=Eu(),Tne=class extends AJe{format(){return""}};Lne.exports=Tne});var Kne=w((Xpt,Mne)=>{"use strict";var lJe=Eu(),Une=class extends lJe{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:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Mne.exports=Une});var Gne=w((Zpt,Hne)=>{"use strict";var cJe=kl(),jne=class extends cJe{constructor(e){super(te(N({},e),{multiple:!0}))}};Hne.exports=jne});var BN=w(($pt,Yne)=>{"use strict";var uJe=Eu(),qne=class extends uJe{constructor(e={}){super(N({style:"number"},e));this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity,this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity,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 r=e||this.minor,i=this.toNumber(this.input);return i>this.max+r?this.alert():(this.input=`${i+r}`,this.render())}down(e){let r=e||this.minor,i=this.toNumber(this.input);return i<this.min-r?this.alert():(this.input=`${i-r}`,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(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};Yne.exports=qne});var Wne=w((edt,Jne)=>{Jne.exports=BN()});var Vne=w((tdt,zne)=>{"use strict";var gJe=Eu(),_ne=class extends gJe{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)):""}};zne.exports=_ne});var es
|
|||
|
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+r})))}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 r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let i=0;i<this.scale.length;i++)r.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,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(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1||this.state.submitted)return"";let e=this.scale.map(i=>` ${i.name} - ${i.message}`);return["",...e].map(i=>this.styles.muted(i)).join(`
|
|||
|
`)}renderScaleHeading(e){let r=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-r.join("").length,n=Math.round(i/(r.length-1)),o=r.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,r,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,i);let n=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let i=e.scale.map(s=>this.scaleIndicator(e,s,r)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),s=await e.hint;s&&!Zne.hasColor(s)&&(s=this.styles.muted(s));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,r),u=await this.renderScale(e,r),g=this.margin[1]+this.margin[3];this.scaleLength=fJe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let h=Zne.wordWrap(c,{width:this.widths[0],newline:a}).split(`
|
|||
|
`).map(p=>o(p)+this.margin[1]);return i&&(u=this.styles.info(u),h=h.map(p=>this.styles.info(p))),h[0]+=u,this.linebreak&&h.push(""),[l+n,h.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)),r=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...r.map(n=>n.join(" "))].join(`
|
|||
|
`)}async render(){let{submitted:e,size:r}=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(),f=await this.footer(),h=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&h!=null&&(o+=this.styles.danger(h)),this.clear(r),this.write([a,o,c,g,f].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)}};Xne.exports=$ne});var nse=w((idt,tse)=>{"use strict";var rse=Co(),pJe=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",ise=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=pJe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},dJe=async(t={},e={},r=i=>i)=>{let i=new Set,n=t.fields||[],s=t.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],f=()=>s[u+1],h=p=>{p.line=c,o.push(p)};for(h({type:"bos",value:""});u<s.length-1;){let p=g();if(/^[^\S\n ]$/.test(p)){h({type:"text",value:p});continue}if(p===`
|
|||
|
`){h({type:"newline",value:p}),c++;continue}if(p==="\\"){p+=g(),h({type:"text",value:p});continue}if((p==="$"||p==="#"||p==="{")&&f()==="{"){p+=g();let Q={type:"template",open:p,inner:"",close:"",value:p},S;for(;S=g();){if(S==="}"){f()==="}"&&(S+=g()),Q.value+=S,Q.close=S;break}S===":"?(Q.initial="",Q.key=Q.inner):Q.initial!==void 0&&(Q.initial+=S),Q.value+=S,Q.inner+=S}Q.template=Q.open+(Q.initial||Q.inner)+Q.close,Q.key=Q.key||Q.inner,e.hasOwnProperty(Q.key)&&(Q.initial=e[Q.key]),Q=r(Q),h(Q),l.push(Q.key),i.add(Q.key);let x=a.find(M=>M.name===Q.key);Q.field=n.find(M=>M.name===Q.key),x||(x=new ise(Q),a.push(x)),x.lines.push(Q.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=p:h({type:"text",value:p})}return h({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};tse.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),i=N(N({},e.values),e.initial),{tabstops:n,items:s,keys:o}=await dJe(e,i),a=bN("result",t,e),l=bN("format",t,e),c=bN("validate",t,e,!0),u=t.isValue.bind(t);return async(g={},f=!1)=>{let h=0;g.required=r,g.items=s,g.keys=o,g.output="";let p=async(S,x,M,Y)=>{let U=await c(S,x,M,Y);return U===!1?"Invalid field "+M.name:U};for(let S of n){let x=S.value,M=S.key;if(S.type!=="template"){x&&(g.output+=x);continue}if(S.type==="template"){let Y=s.find(Z=>Z.name===M);e.required===!0&&g.required.add(Y.name);let U=[Y.input,g.values[Y.value],Y.value,x].find(u),W=(Y.field||{}).message||S.inner;if(f){let Z=await p(g.values[M],g,Y,h);if(Z&&typeof Z=="string"||Z===!1){g.invalid.set(M,Z);continue}g.invalid.delete(M);let A=await a(g.values[M],g,Y,h);g.output+=rse.unstyle(A);continue}Y.placeholder=!1;let ee=x;x=await l(x,g,Y,h),U!==x?(g.values[M]=U,x=t.styles.typing(U),g.missing.delete(W)):(g.values[M]=void 0,U=`<${W}>`,x=t.styles.primary(U),Y.placeholder=!0,g.required.has(M)&&g.missing.add(W)),g.missing.has(W)&&g.validating&&(x=t.styles.warning(U)),g.invalid.has(M)&&g.validating&&(x=t.styles.danger(U)),h===g.index&&(ee!==x?x=t.styles.underline(x):x=t.styles.heading(rse.unstyle(x))),h++}x&&(g.output+=x)}let m=g.output.split(`
|
|||
|
`).map(S=>" "+S),y=s.length,Q=0;for(let S of s)g.invalid.has(S.name)&&S.lines.forEach(x=>{m[x][0]===" "&&(m[x]=g.styles.danger(g.symbols.bullet)+m[x].slice(1))}),t.isValue(g.values[S.name])&&Q++;return g.completed=(Q/y*100).toFixed(0),g.output=m.join(`
|
|||
|
`),g.output}};function bN(t,e,r,i){return(n,s,o,a)=>typeof o.field[t]=="function"?o.field[t].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var ase=w((ndt,sse)=>{"use strict";var CJe=Co(),mJe=nse(),EJe=zf(),ose=class extends EJe{constructor(e){super(e);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await mJe(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 r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){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 r=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${r}`,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 r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:i,size:n}=this.state,s=[this.options.newline,`
|
|||
|
`].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()||"",f=await this.hint()||"",h=i?"":await this.interpolate(this.state),p=this.state.key=r[e]||"",m=await this.format(p),y=await this.footer();m&&(c+=" "+m),f&&!m&&this.state.completed===0&&(c+=" "+f),this.clear(n);let Q=[u,c,h,y,g.trim()];this.write(Q.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:r,keys:i,index:n}=this.state,s=r.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:r,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(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let o=CJe.unstyle(i).split(`
|
|||
|
`).map(a=>a.slice(1)).join(`
|
|||
|
`);return this.value={values:n,result:o},super.submit()}};sse.exports=ose});var cse=w((sdt,Ase)=>{"use strict";var IJe="(Use <shift>+<up/down> to sort)",yJe=kl(),lse=class extends yJe{constructor(e){super(te(N({},e),{reorder:!1,sort:!0,multiple:!0}));this.state.hint=[this.options.hint,IJe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let i=await super.renderChoice(e,r),n=this.symbols.identicalTo+" ",s=this.index===r&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${r+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Ase.exports=lse});var fse=w((odt,use)=>{"use strict";var wJe=XC(),gse=class extends wJe{constructor(e={}){super(e);if(this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(i=>this.styles.muted(i)),this.state.header=r.join(`
|
|||
|
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let i of r)i.scale=BJe(5,this.options),i.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],i=r.selected;return e.scale.forEach(n=>n.selected=!1),r.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,r){await this.onChoice(e,r);let i=this.index===r,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=x=>(x?this.styles.success("\u25C9"):"\u25EF")+o,u=r+1+".",g=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,r),h=this.indent(e),p=h+e.scale.map((x,M)=>c(M===e.scaleIdx)).join(a),m=x=>x===e.scaleIdx?g(x):x,y=h+e.scale.map((x,M)=>m(M)).join(l),Q=()=>[u,f].filter(Boolean).join(" "),S=()=>[Q(),p,y," "].filter(Boolean).join(`
|
|||
|
`);return i&&(p=this.styles.cyan(p),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)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
|||
|
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=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(r),this.write([o,a,u,g].filter(Boolean).join(`
|
|||
|
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function BJe(t,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>N({},i));let r=[];for(let i=1;i<t+1;i++)r.push({i,selected:!1});return r}use.exports=gse});var pse=w((adt,hse)=>{hse.exports=wN()});var mse=w((Adt,dse)=>{"use strict";var bJe=Z0(),Cse=class extends bJe{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="",r){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,r=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([r,c,l].filter(Boolean).join(`
|
|||
|
`)),this.write(this.margin[2]),this.restore()}};dse.exports=Cse});var yse=w((ldt,Ese)=>{"use strict";var QJe=kl(),Ise=class extends QJe{constructor(e){super(e);if(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,r){let i=await super.toChoices(e,r);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)}}};Ese.exports=Ise});var Bse=w(QN=>{"use strict";var wse=Xi(),Ci=(t,e)=>{wse.defineExport(QN,t,e),wse.defineExport(QN,t.toLowerCase(),e)};Ci("AutoComplete",()=>une());Ci("BasicAuth",()=>Ene());Ci("Confirm",()=>bne());Ci("Editable",()=>Sne());Ci("Form",()=>X0());Ci("Input",()=>wN());Ci("Invisible",()=>One());Ci("List",()=>Kne());Ci("MultiSelect",()=>Gne());Ci("Numeral",()=>Wne());Ci("Password",()=>Vne());Ci("Scale",()=>ese());Ci("Select",()=>kl());Ci("Snippet",()=>ase());Ci("Sort",()=>cse());Ci("Survey",()=>fse());Ci("Text",()=>pse());Ci("Toggle",()=>mse());Ci("Quiz",()=>yse())});var Qse=w((udt,bse)=>{bse.exports={ArrayPrompt:XC(),AuthPrompt:yN(),BooleanPrompt:Z0(),NumberPrompt:BN(),StringPrompt:Eu()}});var $C=w((gdt,vse)=>{"use strict";var Sse=require("assert"),vN=require("events"),xl=Xi(),ua=class extends vN{constructor(e,r){super();this.options=xl.merge({},e),this.answers=N({},r)}register(e,r){if(xl.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}Sse.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(xl.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=xl.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=xl;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];Sse(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](r),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),r.autofill&&l!=null?(a.value=a.input=l,r.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||zf()}static get prompts(){return Bse()}static get types(){return Qse()}static get prompt(){let e=(r,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(r)};return xl.mixinEmitter(e,new vN),e}};xl.mixinEmitter(ua,new vN);var SN=ua.prompts;for(let t of Object.keys(SN)){let e=t.toLowerCase(),r=i=>new SN[t](i).run();ua.prompt[e]=r,ua[e]=r,ua[t]||Reflect.defineProperty(ua,t,{get:()=>SN[t]})}var ZC=t=>{xl.defineExport(ua,t,()=>ua.types[t])};ZC("ArrayPrompt");ZC("AuthPrompt");ZC("BooleanPrompt");ZC("NumberPrompt");ZC("StringPrompt");vse.exports=ua});var Kse=w((tCt,Use)=>{function PJe(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}Use.exports=PJe});var Xf=w((rCt,Hse)=>{var DJe=c0(),RJe=Ff();function FJe(t,e,r,i){var n=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(r[a],t[a],a,r,t):void 0;l===void 0&&(l=t[a]),n?RJe(r,a,l):DJe(r,a,l)}return r}Hse.exports=FJe});var Gse=w((iCt,jse)=>{var NJe=Xf(),LJe=Mf();function TJe(t,e){return t&&NJe(e,LJe(e),t)}jse.expo
|
|||
|
`:"";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
|
|||
|
`,g}function P_e(t,e,r){let i=Js.relative(Js.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=Js.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=r.args||"",l=nT(r.nodePath).posix;n?(s=`"$basedir/${r.prog}"`,i=o):(n=o,a="",i="");let c=r.progArgs?`${r.progArgs.join(" ")} `:"",u=`#!/bin/sh
|
|||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
|||
|
|
|||
|
case \`uname\` in
|
|||
|
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
|
|||
|
esac
|
|||
|
|
|||
|
`,g=r.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 $?
|
|||
|
`,u}function D_e(t,e,r){let i=Js.relative(Js.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=Js.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=r.args||"",c=nT(r.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${r.prog}$exe"`,i=a):(s=a,l="",i="");let f=r.progArgs?`${r.progArgs.join(" ")} `:"",h=`#!/usr/bin/env pwsh
|
|||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|||
|
|
|||
|
$exe=""
|
|||
|
${r.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 r.nodePath&&(h+=` else {
|
|||
|
$env:NODE_PATH="${g}"
|
|||
|
}`),o?h+=`
|
|||
|
$ret=0
|
|||
|
if (Test-Path ${o}) {
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${o} ${l} ${i} ${f}$args
|
|||
|
} else {
|
|||
|
& ${o} ${l} ${i} ${f}$args
|
|||
|
}
|
|||
|
$ret=$LASTEXITCODE
|
|||
|
} else {
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${s} ${l} ${i} ${f}$args
|
|||
|
} else {
|
|||
|
& ${s} ${l} ${i} ${f}$args
|
|||
|
}
|
|||
|
$ret=$LASTEXITCODE
|
|||
|
}
|
|||
|
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
|||
|
`:""}exit $ret
|
|||
|
`:h+=`
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${s} ${l} ${i} ${f}$args
|
|||
|
} else {
|
|||
|
& ${s} ${l} ${i} ${f}$args
|
|||
|
}
|
|||
|
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
|||
|
`:""}exit $LASTEXITCODE
|
|||
|
`,h}function F_e(t,e){return e.fs_.chmod(t,493)}function nT(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(Js.delimiter):Array.from(t),r={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=_le()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];r.win32=r.win32?`${r.win32};${n}`:n,r.posix=r.posix?`${r.posix}:${s}`:s,r[i]={win32:n,posix:s}}return r}zle.exports=iT});var IT=w((Ukt,Cce)=>{Cce.exports=require("stream")});var yce=w((Kkt,mce)=>{"use strict";function Ece(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function e5e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ece(Object(r),!0).forEach(function(i){$_e(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ece(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function $_e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function t5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ice(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function r5e(t,e,r){return e&&Ice(t.prototype,e),r&&Ice(t,r),t}var i5e=require("buffer"),mb=i5e.Buffer,n5e=require("util"),yT=n5e.inspect,s5e=yT&&yT.custom||"inspect";function o5e(t,e,r){mb.prototype.copy.call(t,e,r)}mce.exports=function(){function t(){t5e(this,t),this.head=null,this.tail=null,this.length=0}return r5e(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return mb.alloc(0);for(var i=mb.allocUnsafe(r>>>0),n=this.head,s=0;n;)o5e(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===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(r){var i=mb.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===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:s5e,value:function(r,i){return yT(this,e5e({},i,{depth:0,customInspect:!1}))}}]),t}()});var BT=w((Hkt,wce)=>{"use strict";function a5e(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(wT,this,t)):process.nextTick(wT,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(
|
|||
|
`)),t.linkname&&(e+=ZT(" linkpath="+t.linkname+`
|
|||
|
`));var r=t.pax;if(r)for(var i in r)e+=ZT(" "+i+"="+r[i]+`
|
|||
|
`);return Buffer.from(e)};ph.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var i=parseInt(t.slice(0,r).toString(),10);if(!i)return e;var n=t.slice(r+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),t=t.slice(i)}return e};ph.encode=function(t){var e=tVe(512),r=t.name,i="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(Kl(t.mode&aVe,6),100),e.write(Kl(t.uid,6),108),e.write(Kl(t.gid,6),116),e.write(Kl(t.size,11),124),e.write(Kl(t.mtime.getTime()/1e3|0,11),136),e[156]=Bue+cVe(t.type),t.linkname&&e.write(t.linkname,157),bue.copy(e,sE),nVe.copy(e,XT),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Kl(t.devmajor||0,6),329),e.write(Kl(t.devminor||0,6),337),i&&e.write(i,345),e.write(Kl(vue(e),6),148),e)};ph.decode=function(t,e,r){var i=t[156]===0?0:t[156]-Bue,n=dh(t,0,100,e),s=Hl(t,100,8),o=Hl(t,108,8),a=Hl(t,116,8),l=Hl(t,124,12),c=Hl(t,136,12),u=lVe(i),g=t[157]===0?null:dh(t,157,100,e),f=dh(t,265,32),h=dh(t,297,32),p=Hl(t,329,8),m=Hl(t,337,8),y=vue(t);if(y===8*32)return null;if(y!==Hl(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(bue.compare(t,sE,sE+6)===0)t[345]&&(n=dh(t,345,155,e)+"/"+n);else if(!(sVe.compare(t,sE,sE+6)===0&&oVe.compare(t,XT,XT+2)===0)){if(!r)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:f,gname:h,devmajor:p,devminor:m}}});var Fue=w((axt,Sue)=>{var kue=require("util"),gVe=wue(),oE=$T(),xue=hh().Writable,Pue=hh().PassThrough,Due=function(){},Rue=function(t){return t&=511,t&&512-t},fVe=function(t,e){var r=new Nb(t,e);return r.end(),r},hVe=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},Nb=function(t,e){this._parent=t,this.offset=e,Pue.call(this,{autoDestroy:!1})};kue.inherits(Nb,Pue);Nb.prototype.destroy=function(t){this._parent.destroy(t)};var QA=function(t){if(!(this instanceof QA))return new QA(t);xue.call(this,t),t=t||{},this._offset=0,this._buffer=gVe(),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,r=e._buffer,i=function(){e._continue()},n=function(f){if(e._locked=!1,f)return e.destroy(f);e._stream||i()},s=function(){e._stream=null;var f=Rue(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(Rue(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=oE.decodePax(r.slice(0,f)),r.consume(f),s()},l=function(){var f=e._header.size;e._pax=oE.decodePax(r.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=oE.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=oE.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=oE.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(p){e.emit("error",p)}if(r.consume(512),!h){e._parse(512,g),i();return}if(h.type==="gnu-long-path"){e._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){e._parse(h.size,u),i();return}if(h.type==="pax-global-header"){e._parse(h.size,a),i();return}if(h.type==="pax-header"){e._parse(h.size,l),i();return}if(e._gnuLongPath&&(h.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(h.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=h=hVe(h,e._pax),e
|
|||
|
Wanted: ${r.size}
|
|||
|
Found: ${t.length}`);throw a.code="EBADSIZE",a.found=t.length,a.expected=r.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${t.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}Ca.exports.checkStream=JVe;function JVe(t,e,r){r=Cn(r);let i=r.Promise||Promise,n=cO(r.concat({integrity:e}));return new i((s,o)=>{t.pipe(n),t.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=cO;function cO(t){t=Cn(t);let e=t.integrity&&ma(t.integrity,t),r=e&&Object.keys(e).length,i=r&&e.pickAlgorithm(t),n=r&&e[i],s=Array.from(new Set(t.algorithms.concat(i?[i]:[]))),o=s.map(lE.createHash),a=0,l=new TVe({transform(c,u,g){a+=c.length,o.forEach(f=>f.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=t.options&&t.options.length?`?${t.options.join("?")}`:"",u=ma(o.map((f,h)=>`${s[h]}-${f.digest("base64")}${c}`).join(" "),t),g=r&&u.match(e,t);if(typeof t.size=="number"&&a!==t.size){let f=new Error(`stream size mismatch when checking ${e}.
|
|||
|
Wanted: ${t.size}
|
|||
|
Found: ${a}`);f.code="EBADSIZE",f.found=a,f.expected=t.size,f.sri=e,l.emit("error",f)}else if(t.integrity&&!g){let f=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);f.code="EINTEGRITY",f.found=u,f.expected=n,f.algorithm=i,f.sri=e,l.emit("error",f)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}Ca.exports.create=WVe;function WVe(t){t=Cn(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",i=e.map(lE.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 Pu(`${a}-${l}${r}`,t);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new Ih)}}}var zVe=new Set(lE.getHashes()),rge=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>zVe.has(t));function HVe(t,e){return rge.indexOf(t.toLowerCase())>=rge.indexOf(e.toLowerCase())?t:e}});var QC={};ft(QC,{BuildType:()=>As,Cache:()=>Nt,Configuration:()=>ye,DEFAULT_LOCK_FILENAME:()=>wx,DEFAULT_RC_FILENAME:()=>yx,FormatType:()=>Di,InstallMode:()=>di,LightReport:()=>uA,LinkType:()=>Qt,Manifest:()=>At,MessageName:()=>$,MultiFetcher:()=>yd,PackageExtensionStatus:()=>qi,PackageExtensionType:()=>yi,Project:()=>ze,ProjectLookup:()=>ol,Report:()=>Ji,ReportError:()=>ct,SettingsType:()=>Ie,StreamReport:()=>Je,TAG_REGEXP:()=>Gg,TelemetryManager:()=>bC,ThrowReport:()=>pi,VirtualFetcher:()=>Bd,Workspace:()=>BC,WorkspaceFetcher:()=>bd,WorkspaceResolver:()=>si,YarnVersion:()=>Ur,execUtils:()=>Fr,folderUtils:()=>hx,formatUtils:()=>ae,hashUtils:()=>Dn,httpUtils:()=>ir,miscUtils:()=>Se,nodeUtils:()=>qg,parseMessageName:()=>BI,scriptUtils:()=>Zt,semverUtils:()=>Wt,stringifyMessageName:()=>YA,structUtils:()=>P,tgzUtils:()=>wi,treeUtils:()=>as});var Fr={};ft(Fr,{EndStrategy:()=>is,ExecError:()=>xx,PipeError:()=>Qw,execvp:()=>Eke,pipevp:()=>$o});var Zh={};ft(Zh,{AliasFS:()=>Pa,CwdFS:()=>_t,DEFAULT_COMPRESSION_LEVEL:()=>ic,FakeFS:()=>KA,Filename:()=>Pt,JailFS:()=>Da,LazyFS:()=>zh,LinkStrategy:()=>jh,NoFS:()=>zE,NodeFS:()=>ar,PortablePath:()=>Me,PosixFS:()=>_h,ProxiedFS:()=>bi,VirtualFS:()=>Jr,ZipFS:()=>Ai,ZipOpenFS:()=>ms,constants:()=>Dr,extendFs:()=>VE,normalizeLineEndings:()=>$l,npath:()=>j,opendir:()=>qE,patchFs:()=>bQ,ppath:()=>k,statUtils:()=>uQ,toFilename:()=>qr,xfs:()=>K});var Dr={};ft(Dr,{SAFE_TIME:()=>cQ,S_IFDIR:()=>Sa,S_IFLNK:()=>xa,S_IFMT:()=>zn,S_IFREG:()=>ka});var zn=61440,Sa=16384,ka=32768,xa=40960,cQ=456789e3;var uQ={};ft(uQ,{BigIntStatsEntry:()=>Uh,DEFAULT_MODE:()=>Mh,DirEntry:()=>sM,StatEntry:()=>MA,areStatsEqual:()=>fQ,clearStats:()=>ME,convertToBigIntStats:()=>UE,makeDefaultStats:()=>Kh,makeEmptyStats:()=>dfe});var gQ=ge(require("util"));var Mh=ka|420,sM=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&zn)===Sa}isFIFO(){return!1}isFile(){return(this.mode&zn)===ka}isSocket(){return!1}isSymbolicLink(){return(this.mode&zn)===xa}},MA=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=Mh;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&zn)===Sa}isFIFO(){return!1}isFile(){return(this.mode&zn)===ka}isSocket(){return!1}isSymbolicLink(){return(this.mode&zn)===xa}},Uh=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);this.ino=BigInt(0);this.mode=BigInt(Mh);this.
|
|||
|
`)}writeJsonSync(e,r){return this.writeFileSync(e,`${JSON.stringify(r,null,2)}
|
|||
|
`)}async preserveTimePromise(e,r){let i=await this.lstatPromise(e),n=await r();typeof n!="undefined"&&(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,r){let i=this.lstatSync(e),n=r();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},ec=class extends KA{constructor(){super(k)}};function vfe(t){let e=t.match(/\r?\n/g);if(e===null)return hM.EOL;let r=e.filter(n=>n===`\r
|
|||
|
`).length,i=e.length-r;return r>i?`\r
|
|||
|
`:`
|
|||
|
`}function $l(t,e){return e.replace(/\r?\n/g,vfe(t))}var qu=ge(require("fs")),EQ=ge(require("stream")),mM=ge(require("util")),IQ=ge(require("zlib"));var pM=ge(require("fs"));var ar=class extends ec{constructor(e=pM.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Me.root}resolve(e){return k.resolve(e)}async openPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.open(j.fromPortablePath(e),r,i,this.makeCallback(n,s))})}openSync(e,r,i){return this.realFs.openSync(j.fromPortablePath(e),r,i)}async opendirPromise(e,r){return await new Promise((i,n)=>{typeof r!="undefined"?this.realFs.opendir(j.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.opendir(j.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,r){let i=typeof r!="undefined"?this.realFs.opendirSync(j.fromPortablePath(e),r):this.realFs.opendirSync(j.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,r,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,r,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,r,i,n,s){return this.realFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return await new Promise((o,a)=>typeof r=="string"?this.realFs.write(e,r,i,this.makeCallback(o,a)):this.realFs.write(e,r,i,n,s,this.makeCallback(o,a)))}writeSync(e,r,i,n,s){return typeof r=="string"?this.realFs.writeSync(e,r,i):this.realFs.writeSync(e,r,i,n,s)}async closePromise(e){await new Promise((r,i)=>{this.realFs.close(e,this.makeCallback(r,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let i=e!==null?j.fromPortablePath(e):e;return this.realFs.createReadStream(i,r)}createWriteStream(e,r){let i=e!==null?j.fromPortablePath(e):e;return this.realFs.createWriteStream(i,r)}async realpathPromise(e){return await new Promise((r,i)=>{this.realFs.realpath(j.fromPortablePath(e),{},this.makeCallback(r,i))}).then(r=>j.toPortablePath(r))}realpathSync(e){return j.toPortablePath(this.realFs.realpathSync(j.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(j.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(j.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((i,n)=>{this.realFs.access(j.fromPortablePath(e),r,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(j.fromPortablePath(e))}async statPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.stat(j.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.stat(j.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,r){return r?this.realFs.statSync(j.fromPortablePath(e),r):this.realFs.statSync(j.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.fstat(e,r,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.lstat(j.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.lstat(j.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,r){return r?this.realFs.lstatSync(j.fromPortablePath(e),r):this.realFs.lstatSync(j.fromPortablePath(e))}async chmodPromise(e,r){return await new Promise((i,n)=>{this.realFs.chmod(j.fromPortablePath(e),r,this.makeCallback(i,n))})}chmodSync(e,r){return this.realFs.chmodSync(j.fromPortablePath(e),r)}async chownPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.chown(j.fromPortablePath(e),r,i,this.makeCallback(n,s))})}chownSync(e,r,i){return this.realFs.chownSync(j.fromPortablePath(e),r,i)}async renamePromise(e,r){return await new Promise((i,n)=>{this.realFs.rename(j.fromPortablePath(e),j.fromPortablePath(r),this.makeCallback(i,n))})}renameSync(e,r){return this.realFs.renameSync(j.fromPortablePath(e),j.fromPortablePath(r))}async copyFilePromise(e,r,i=0){retu
|
|||
|
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
|
|||
|
`;if(typeof t=="string")return`${fK(t)}
|
|||
|
`;if(Array.isArray(t)){if(t.length===0)return`[]
|
|||
|
`;let i=" ".repeat(e);return`
|
|||
|
${t.map(s=>`${i}- ${ev(s,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let i,n;t instanceof $Q?(i=t.data,n=!1):(i=t,n=!0);let s=" ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=gK.indexOf(l),g=gK.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=>!hK(i[l])).map((l,c)=>{let u=i[l],g=fK(l),f=ev(u,e+1,!0),h=c>0||r?s:"";return f.startsWith(`
|
|||
|
`)?`${h}${g}:${f}`:`${h}${g}: ${f}`}).join(e===0?`
|
|||
|
`:"")||`
|
|||
|
`;return r?`
|
|||
|
${a}`:`${a}`}throw new Error(`Unsupported value type (${t})`)}function Na(t){try{let e=ev(t,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}}Na.PreserveOrdering=$Q;function Hde(t){return t.endsWith(`
|
|||
|
`)||(t+=`
|
|||
|
`),(0,uK.parse)(t)}var jde=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Gde(t){if(jde.test(t))return Hde(t);let e=(0,hI.safeLoad)(t,{schema:hI.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 Qi(t){return Gde(t)}var rz=ge(dK()),yw=ge(hc());var Cp={};ft(Cp,{Builtins:()=>pv,Cli:()=>Is,Command:()=>Re,Option:()=>z,UsageError:()=>Pe,formatMarkdownish:()=>Ki});var pc=0,ap=1,tn=2,rv="",vi="\0",ng=-1,iv=/^(-h|--help)(?:=([0-9]+))?$/,pI=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,yK=/^-[a-zA-Z]{2,}$/,nv=/^([^=]+)=([\s\S]*)$/,sv=process.env.DEBUG_CLI==="1";var Pe=class extends Error{constructor(e){super(e);this.clipanion={type:"usage"},this.name="UsageError"}},Ap=class extends Error{constructor(e,r){super();if(this.input=e,this.candidates=r,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===r[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i}
|
|||
|
|
|||
|
${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}
|
|||
|
${ov(e)}`}else this.message=`Command not found; did you mean one of:
|
|||
|
|
|||
|
${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
|
|||
|
`)}
|
|||
|
|
|||
|
${ov(e)}`}},av=class extends Error{constructor(e,r){super();this.input=e,this.usages=r,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(`
|
|||
|
`)}
|
|||
|
|
|||
|
${ov(e)}`}},ov=t=>`While running ${t.filter(e=>e!==vi).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`;var lp=Symbol("clipanion/isOption");function rn(t){return te(N({},t),{[lp]:!0})}function No(t,e){return typeof t=="undefined"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function dI(t,e=!1){let r=t.replace(/^\.: /,"");return e&&(r=r[0].toLowerCase()+r.slice(1)),r}function cp(t,e){return e.length===1?new Pe(`${t}: ${dI(e[0],!0)}`):new Pe(`${t}:
|
|||
|
${e.map(r=>`
|
|||
|
- ${dI(r)}`).join("")}`)}function up(t,e,r){if(typeof r=="undefined")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!r(e,{errors:i,coercions:n,coercion:s}))throw cp(`Invalid value for ${t}`,i);for(let[,a]of n)a();return e}var Re=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(()=>(Es(),sg)),a=o(n(s()),r),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw cp("Invalid option schema",l);for(let[,g]of c)g()}else if(r!=null)throw new Error("Invalid command schema");let i=await this.execute();return typeof i!="undefined"?i:0}};Re.isOption=lp;Re.Default=[];var DK=80,cv=Array(DK).fill("\u2501");for(let t=0;t<=24;++t)cv[cv.length-t]=`[38;5;${232+t}m\u2501`;var uv={header:t=>`[1m\u2501\u2501\u2501 ${t}${t.length<DK-5?` ${cv.slice(t.length+5).join("")}`:":"}[0m`,bold:t=>`[1m${t}[22m`,error:t=>`[31m[1m${t}[22m[39m`,code:t=>`[36m${t}[39m`},RK={header:t=>t,bold:t=>t,error:t=>t,code:t=>t};function QCe(t){let e=t.split(`
|
|||
|
`),r=e.filter(n=>n.match(/\S/)),i=r.length>0?r.reduce((n,s)=>Math.min(n,s.length-s.trimStart().length),Number.MAX_VALUE):0;return e.map(n=>n.slice(i).trimRight()).join(`
|
|||
|
`)}function Ki(t,{format:e,paragraphs:r}){return t=t.replace(/\r\n?/g,`
|
|||
|
`),t=QCe(t),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
|
|||
|
|
|||
|
`),t=t.replace(/\n(\n)?\n*/g,"$1"),r&&(t=t.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(`
|
|||
|
|
|||
|
`)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),t?`${t}
|
|||
|
`:""}var hv=ge(require("tty"));function wn(t){sv&&console.log(t)}var FK={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:ng};function NK(){return{nodes:[sn(),sn(),sn()]}}function SCe(t){let e=NK(),r=[],i=e.nodes.length;for(let n of t){r.push(i);for(let s=0;s<n.nodes.length;++s)LK(s)||e.nodes.push(vCe(n.nodes[s],i));i+=n.nodes.length-2}for(let n of r)og(e,pc,n);return e}function io(t,e){return t.nodes.push(e),t.nodes.length-1}function kCe(t){let e=new Set,r=i=>{if(e.has(i))return;e.add(i);let n=t.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)r(a);for(let[,{to:o}]of n.dynamics)r(o);for(let{to:o}of n.shortcuts)r(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=t.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:f})=>g.to===f)||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))}};r(pc)}function xCe(t,{prefix:e=""}={}){if(sv){wn(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)wn(`${e} ${r}: ${JSON.stringify(t.nodes[r])}`)}}function TK(t,e,r=!1){wn(`Running a vm on ${JSON.stringify(e)}`);let i=[{node:pc,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];xCe(t,{prefix:" "});let n=[rv,...e];for(let s=0;s<n.length;++s){let o=n[s];wn(` Processing ${JSON.stringify(o)}`);let a=[];for(let{node:l,state:c}of i){wn(` Current node is ${l}`);let u=t.nodes[l];if(l===tn){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(!r||s<n.length-1||g)if(g){let f=u.statics[o];for(let{to:h,reducer:p}of f)a.push({node:h,state:typeof p!="undefined"?mI(gv,p,c,o):c}),wn(` Static transition to ${h} found`)}else wn(" No static transition found");else{let f=!1;for(let h of Object.keys(u.statics))if(!!h.startsWith(o)){if(o===h)for(let{to:p,reducer:m}of u.statics[h])a.push({node:p,state:typeof m!="undefined"?mI(gv,m,c,o):c}),wn(` Static transition to ${p} found`);else for(let{to:p}of u.statics[h])a.push({node:p,state:te(N({},c),{remainder:h.slice(o.length)})}),wn(` Static transition to ${p} found (partial match)`);f=!0}f||wn(" No partial static transition found")}if(o!==vi)for(let[f,{to:h,reducer:p}]of u.dynamics)mI(EI,f,c,o)&&(a.push({node:h,state:typeof p!="undefined"?mI(gv,p,c,o):c}),wn(` Dynamic transition to ${h} found (via ${f})`))}if(a.length===0&&o===vi&&e.length===1)return[{node:pc,state:FK}];if(a.length===0)throw new Ap(e,i.filter(({node:l})=>l!==tn).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===tn))throw new Ap(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=PCe(a)}if(i.length>0){wn(" Results:");for(let s of i)wn(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else wn(" No results");return i}function DCe(t,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(t.statics,vi)){for(let{to:r}of t.statics[vi])if(r===ap)return!0}return!1}function FCe(t,e,r){let i=r&&e.length>0?[""]:[],n=TK(t,e,r),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let h=g;g=[];for(let p of h){let m=t.nodes[p],y=Object.keys(m.statics);for(let Q of Object.keys(m.statics)){let S=y[0];for(let{to:x,reducer:M}of m.statics[S])M==="pushPath"&&(u||l.push(S),g.push(x))}}u=!1}let f=JSON.stringify(l);o.has(f)||(s.push(l),o.add(f))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=t.nodes[l],g=DCe(u,c);for(let[f,h]of Object.entries(u.statics))(g&&f!==vi||!f.startsWith("-")&&h.some(({reducer:p})=>p==="pushPath"))&&a([...i,f],l);if(!!g)for(let[f,{to:h}]of u.dynamics){if(h===tn)continue;let p=R
|
|||
|
`),this.context.stdout.write(`
|
|||
|
`);let r=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${r++}. `.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.
|
|||
|
`)}}};var UK=Symbol("clipanion/errorCommand");function OCe(){return process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout!="undefined"&&process.stdout.isTTY?8:1}var Is=class{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:i,enableCapture:n=!1,enableColors:s}={}){this.registrations=new Map,this.builder=new pp({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=i,this.enableCapture=n,this.enableColors=s}static from(e,r={}){let i=new Is(r);for(let n of e)i.register(n);return i}register(e){var r;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[Re.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(r=e.paths)!==null&&r!==void 0?r:n.paths;if(typeof a!="undefined")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:r,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case ng:return dp.from(n,r);default:{let{commandClass:s}=r[n.selectedIndex],o=this.registrations.get(s);if(typeof o=="undefined")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[UK]=a,l}}break}}async run(e,r){var i;let n,s=N(N({},Is.defaultContext),r),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,N(N({},s),u)),usage:(c,u)=>this.usage(c,u)};let a=this.enableCapture?MCe(s):KK,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,r){process.exitCode=await this.run(e,r)}suggest(e,r){let{suggest:i}=this.builder.compile();return i(e,r)}definitions({colored:e=!1}={}){let r=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage=="undefined")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!="undefined"?Ki(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description!="undefined"?Ki(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details!="undefined"?Ki(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples!="undefined"?i.usage.examples.map(([f,h])=>[Ki(f,{format:this.format(e),paragraphs:!1}),h.replace(/\$0/g,this.binaryName)]):void 0;r.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return r}usage(e=null,{colored:r,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!="undefined";if(!c||c.length===0||c.length===1&&c[0].length===0||((s=c==null?void 0:c.some(h=>h.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 Re?e.constructor:e,a="";if(o)if(i){let{description:l="",details:c="",examples:u=[]}=o.usage||{};l!==""&&(a+=Ki(l,{format:this.format(r),paragraphs:!1}).replace(/^./,h=>h.toUpperCase()),a+=`
|
|||
|
`),(c!==""||u.length>0)&&(a+=`${this.format(r).header("Usage")}
|
|||
|
`,a+=`
|
|||
|
`);let{usage:g,options:f}=this.getUsageByRegistration(o,{inlineOptions:!1});if(a+=`${this.format(r).bold(n)}${g}
|
|||
|
`,f.length>0){a+=`
|
|||
|
`,a+=`${uv.header("Options")}
|
|||
|
`;let h=f.reduce((p,m)=>Math.max(p,m.definition.length),0);a+=`
|
|||
|
`;for(let{definition:p,description:m}of f)a+=` ${this.format(r).bold(p.padEnd(h))} ${Ki(m,{format:this.format(r),paragraphs:!1})}`}if(c!==""&&(a+=`
|
|||
|
`,a+=`${this.format(r).header("Details")}
|
|||
|
`,a+=`
|
|||
|
`,a+=Ki(c,{format:this.format(r),paragraphs:!0})),u.length>0){a+=`
|
|||
|
`,a+=`${this.format(r).header("Examples")}
|
|||
|
`;for(let[h,p]of u)a+=`
|
|||
|
`,a+=Ki(h,{format:this.format(r),paragraphs:!1}),a+=`${p.replace(/^/m,` ${this.format(r).bold(n)}`).replace(/\$0/g,this.binaryName)}
|
|||
|
`}}else{let{usage:l}=this.getUsageByRegistration(o);a+=`${this.format(r).bold(n)}${l}
|
|||
|
`}else{let l=new Map;for(let[f,{index:h}]of this.registrations.entries()){if(typeof f.usage=="undefined")continue;let p=typeof f.usage.category!="undefined"?Ki(f.usage.category,{format:this.format(r),paragraphs:!1}):null,m=l.get(p);typeof m=="undefined"&&l.set(p,m=[]);let{usage:y}=this.getUsageByIndex(h);m.push({commandClass:f,usage:y})}let c=Array.from(l.keys()).sort((f,h)=>f===null?-1:h===null?1:f.localeCompare(h,"en",{usage:"sort",caseFirst:"upper"})),u=typeof this.binaryLabel!="undefined",g=typeof this.binaryVersion!="undefined";u||g?(u&&g?a+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
|
|||
|
|
|||
|
`:u?a+=`${this.format(r).header(`${this.binaryLabel}`)}
|
|||
|
`:a+=`${this.format(r).header(`${this.binaryVersion}`)}
|
|||
|
`,a+=` ${this.format(r).bold(n)}${this.binaryName} <command>
|
|||
|
`):a+=`${this.format(r).bold(n)}${this.binaryName} <command>
|
|||
|
`;for(let f of c){let h=l.get(f).slice().sort((m,y)=>m.usage.localeCompare(y.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=`
|
|||
|
`,a+=`${this.format(r).header(`${p}`)}
|
|||
|
`;for(let{commandClass:m,usage:y}of h){let Q=m.usage.description||"undocumented";a+=`
|
|||
|
`,a+=` ${this.format(r).bold(y)}
|
|||
|
`,a+=` ${Ki(Q,{format:this.format(r),paragraphs:!1})}`}}a+=`
|
|||
|
`,a+=Ki("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(r),paragraphs:!0})}return a}error(e,r){var i,{colored:n,command:s=(i=e[UK])!==null&&i!==void 0?i:null}=r===void 0?{}:r;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}
|
|||
|
`;let l=e.clipanion;return typeof l!="undefined"?l.type==="usage"&&(o+=`
|
|||
|
`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")}
|
|||
|
`),o}format(e){var r;return((r=e!=null?e:this.enableColors)!==null&&r!==void 0?r:Is.defaultContext.colorDepth>1)?uv:RK}getUsageByRegistration(e,r){let i=this.registrations.get(e);if(typeof i=="undefined")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};Is.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:"getColorDepth"in hv.default.WriteStream.prototype?hv.default.WriteStream.prototype.getColorDepth():OCe()};var HK;function MCe(t){let e=HK;if(typeof e=="undefined"){if(t.stdout===process.stdout&&t.stderr===process.stderr)return KK;let{AsyncLocalStorage:r}=require("async_hooks");e=HK=new r;let i=process.stdout._write;process.stdout._write=function(s,o,a){let l=e.getStore();return typeof l=="undefined"?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=="undefined"?n.call(this,s,o,a):l.stderr.write(s,o,a)}}return r=>e.run(t,r)}function KK(t){return t()}var pv={};ft(pv,{DefinitionsCommand:()=>II,HelpCommand:()=>yI,VersionCommand:()=>wI});var II=class extends Re{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
|||
|
`)}};II.paths=[["--clipanion=definitions"]];var yI=class extends Re{async execute(){this.context.stdout.write(this.cli.usage())}};yI.paths=[["-h"],["--help"]];var wI=class extends Re{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
|
|||
|
`)}};wI.paths=[["-v"],["--version"]];var z={};ft(z,{Array:()=>jK,Boolean:()=>GK,Counter:()=>YK,Proxy:()=>qK,Rest:()=>JK,String:()=>WK,applyValidator:()=>up,cleanValidationError:()=>dI,formatError:()=>cp,isOptionSymbol:()=>lp,makeCommandOption:()=>rn,rerouteArguments:()=>No});function jK(t,e,r){let[i,n]=No(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return rn({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!="undefined"?[...i]:void 0;for(let{name:f,value:h}of u.options)!a.has(f)||(g=g!=null?g:[],g.push(h));return g}})}function GK(t,e,r){let[i,n]=No(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return rn({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:f}of c.options)!o.has(g)||(u=f);return u}})}function YK(t,e,r){let[i,n]=No(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return rn({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:f}of c.options)!o.has(g)||(u!=null||(u=0),f?u+=1:u=0);return u}})}function qK(t={}){return rn({definition(e,r){var i;e.addProxy({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){return i.positionals.map(({value:n})=>n)}})}function JK(t={}){return rn({definition(e,r){var i;e.addRest({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){let n=o=>{let a=i.positionals[o];return a.extra===Vn||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 UCe(t,e,r){let[i,n]=No(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return rn({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,f=i;for(let{name:h,value:p}of u.options)!a.has(h)||(g=h,f=p);return typeof f=="string"?up(g!=null?g:c,f,n.validator):f}})}function KCe(t={}){let{required:e=!0}=t;return rn({definition(r,i){var n;r.addPositional({name:(n=t.name)!==null&&n!==void 0?n:i,required:t.required})},transformer(r,i,n){var s;for(let o=0;o<n.positionals.length;++o){if(n.positionals[o].extra===Vn||e&&n.positionals[o].extra===!0||!e&&n.positionals[o].extra===!1)continue;let[a]=n.positionals.splice(o,1);return up((s=t.name)!==null&&s!==void 0?s:i,a.value,t.validator)}}})}function WK(t,...e){return typeof t=="string"?UCe(t,...e):KCe(t)}var iz=ge(ag()),Ix=ge(require("stream"));var $;(function(oe){oe[oe.UNNAMED=0]="UNNAMED",oe[oe.EXCEPTION=1]="EXCEPTION",oe[oe.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",oe[oe.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",oe[oe.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",oe[oe.BUILD_DISABLED=5]="BUILD_DISABLED",oe[oe.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",oe[oe.MUST_BUILD=7]="MUST_BUILD",oe[oe.MUST_REBUILD=8]="MUST_REBUILD",oe[oe.BUILD_FAILED=9]="BUILD_FAILED",oe[oe.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",oe[oe.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",oe[oe.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",oe[oe.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",oe[oe.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",oe[oe.REMOTE_INVALID=15]="REMOTE_INVALID",oe[oe.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",oe[oe.RESOLUTION_PACK=17]="RESOLUTION_PACK",oe[oe.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",oe[oe.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",oe[oe.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",oe[oe.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",oe[oe.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",oe[oe.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",oe[oe.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",oe[oe.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",oe[oe.CONSTRAINTS_INVALID_DEPENDENCY=26]=
|
|||
|
`),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}),r.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),r}};var yd=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let i=this.fetchers.find(n=>n.supports(e,r));return i||null}getFetcher(e,r){let i=this.fetchers.find(n=>n.supports(e,r));if(!i)throw new ct($.FETCHER_NOT_FOUND,`${Bt(r.project.configuration,e)} isn't supported by any available fetcher`);return i}};var wd=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,i){return this.getResolverByDescriptor(e,i).bindDescriptor(e,r,i)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,i){return await this.getResolverByDescriptor(e,i).getCandidates(e,r,i)}async getSatisfying(e,r,i){return this.getResolverByDescriptor(e,i).getSatisfying(e,r,i)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let i=this.resolvers.find(n=>n.supportsDescriptor(e,r));return i||null}getResolverByDescriptor(e,r){let i=this.resolvers.find(n=>n.supportsDescriptor(e,r));if(!i)throw new Error(`${sr(r.project.configuration,e)} isn't supported by any available resolver`);return i}tryResolverByLocator(e,r){let i=this.resolvers.find(n=>n.supportsLocator(e,r));return i||null}getResolverByLocator(e,r){let i=this.resolvers.find(n=>n.supportsLocator(e,r));if(!i)throw new Error(`${Bt(r.project.configuration,e)} isn't supported by any available resolver`);return i}};var ez=ge(ti());var Gg=/^(?!v)[a-z0-9._-]+$/i,fx=class{supportsDescriptor(e,r){return!!(fo(e.range)||Gg.test(e.range))}supportsLocator(e,r){return!!(ez.default.valid(e.reference)||Gg.test(e.reference))}shouldPersistResolution(e,r){return r.resolver.shouldPersistResolution(this.forwardLocator(e,r),r)}bindDescriptor(e,r,i){return i.resolver.bindDescriptor(this.forwardDescriptor(e,i),r,i)}getResolutionDependencies(e,r){return r.resolver.getResolutionDependencies(this.forwardDescriptor(e,r),r)}async getCandidates(e,r,i){return await i.resolver.getCandidates(this.forwardDescriptor(e,i),r,i)}async getSatisfying(e,r,i){return await i.resolver.getSatisfying(this.forwardDescriptor(e,i),r,i)}async resolve(e,r){let i=await r.resolver.resolve(this.forwardLocator(e,r),r);return ld(i,e)}forwardDescriptor(e,r){return rr(e,`${r.project.configuration.get("defaultProtocol")}${e.range}`)}forwardLocator(e,r){return cn(e,`${r.project.configuration.get("defaultProtocol")}${e.reference}`)}};var Bd=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n);return r.fetcher.getLocalPath(s,r)}async fetch(e,r){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n),o=await r.fetcher.fetch(s,r);return await this.ensureVirtualLink(e,o,r)}getLocatorFilename(e){return Hg(e)}async ensureVirtualLink(e,r,i){let n=r.packageFs.getRealPath(),s=i.project.configuration.get("virtualFolder"),o=this.getLocatorFilename(e),a=Jr.makeVirtualPath(s,o,n),l=new Pa(a,{baseFs:r.packageFs,pathUtils:k});return te(N({},r),{packageFs:l})}};var Yg=class{static isVirtualDescriptor(e){return!!e.range.startsWith(Yg.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(Yg.protocol)}supportsDescriptor(e,r){return Yg.isVirtualDescriptor(e)}supportsLocator(e,r){return Yg.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescri
|
|||
|
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let i of r.resolvers||[])e.push(new i);return new wd([new mw,new si,new fx,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let i of r.fetchers||[])e.push(new i);return new yd([new Bd,new bd,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let i of r.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=vd(),r=this.get("supportedArchitectures"),i=r.get("os");i!==null&&(i=i.map(o=>o==="current"?e.os:o));let n=r.get("cpu");n!==null&&(n=n.map(o=>o==="current"?e.cpu:o));let s=r.get("libc");return s!==null&&(s=qo(s,o=>{var a;return o==="current"?(a=e.libc)!=null?a:qo.skip:o})),{os:i,cpu:n,libc:s}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(i,n,{userProvided:s=!1}={})=>{if(!fo(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new At;o.load(n,{yamlCompatibilityMode:!0});let a=kg(e,i.identHash),l=[];a.push([i.range,l]);let c={status:qi.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(te(N({},c),{type:yi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(te(N({},c),{type:yi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(te(N({},c),{type:yi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,r);for(let[i,n]of this.get("packageExtensions"))r(nl(i,!0),Ry(n),{userProvided:!0})}normalizePackage(e){let r=cd(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!="undefined"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!Uc(s,o))for(let l of a)switch(l.status===qi.Inactive&&(l.status=qi.Redundant),l.type){case yi.Dependency:typeof r.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,r.dependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependency:typeof r.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,r.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependencyMeta:{let c=r.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=qi.Active,qa(r.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:US(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of r.peerDependenciesMeta.keys()){let o=An(s);r.peerDependencies.has(o.identHash)||r.peerDependencies.set(o.identHash,rr(o,"*"))}for(let s of r.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Vo("types",o),l=Ot(a);r.peerDependencies.has(a.identHash)||r.peerDependenciesMeta.has(l)||(r.peerDependencies.set(a.identHash,rr(a,"*")),r.peerDependenciesMeta.set(l,{optional:!0}))}return r.dependencies=new Map(xn(r.dependencies,([,s])=>Pn(s))),r.peerDependencies=new Map(xn(r.peerDependencies,([,s])=>Pn(s))),r}getLimit(e){return qa(this.limits,e,()=>(0,iz.default)(this.get(e)))}async triggerHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...r)}}async triggerMultipleHooks(e,r){for(let i of r)await this.triggerHook(e,...i)}async reduceHook(e,r,...i){let n=r;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,...r){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(...r);if(typeof o!="undefined")return o}return null}},ye=Xa;ye.telemetry=null;var is;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(is||(is={}));var Qw=class extends ct{constructor({fileName:e,code:r,signal:i}){let n=ye.create(k.cwd()),s=et(n,e,Ge.PATH);super($.EXCEPTION,`Child ${s} reported an error`,o=>{mke(r,i,{config
|
|||
|
`),c(127);break;case"EACCES":n[2].write(`permission denied: ${t}
|
|||
|
`),c(128);break;default:n[2].write(`uncaught error: ${u.message}
|
|||
|
`),c(1);break}}),l.on("exit",u=>{qc.delete(l),qc.size===0&&(process.off("SIGINT",tD),process.off("SIGTERM",rD)),c(u!==null?u:129)})})}}}function s5(t){return e=>{let r=e[0]==="pipe"?new ta.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}var po=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},o5=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}},Ud=class{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:i,stderr:n}){let s=new Ud(null,e);return s.stdin=r,s.stdout=i,s.stderr=n,s}pipeTo(e,r=1){let i=new Ud(this,e),n=new o5;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(r&1)==1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&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 r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.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=>(r.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 Vw(t,e){return Ud.start(t,e)}function a5(t,e=null){let r=new ta.PassThrough,i=new i5.StringDecoder,n="";return r.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="",t(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&t(e!==null?`${e} ${s}`:s)}),r}function A5(t,{prefix:e}){return{stdout:a5(r=>t.stdout.write(`${r}
|
|||
|
`),t.stdout.isTTY?e:null),stderr:a5(r=>t.stderr.write(`${r}
|
|||
|
`),t.stderr.isTTY?e:null)}}var LDe=(0,u5.promisify)(setTimeout);var zi;(function(r){r[r.Readable=1]="Readable",r[r.Writable=2]="Writable"})(zi||(zi={}));function g5(t,e,r){let i=new ns.PassThrough({autoDestroy:!0});switch(t){case Fn.STDIN:(e&1)==1&&r.stdin.pipe(i,{end:!1}),(e&2)==2&&r.stdin instanceof ns.Writable&&i.pipe(r.stdin,{end:!1});break;case Fn.STDOUT:(e&1)==1&&r.stdout.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stdout,{end:!1});break;case Fn.STDERR:(e&1)==1&&r.stderr.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stderr,{end:!1});break;default:throw new Ts(`Bad file descriptor: "${t}"`)}return i}function Xw(t,e={}){let r=N(N({},t),e);return r.environment=N(N({},t.environment),e.environment),r.variables=N(N({},t.variables),e.variables),r}var TDe=new Map([["cd",async([t=(0,c5.homedir)(),...e],r,i)=>{let n=k.resolve(i.cwd,j.toPortablePath(t));if(!(await r.baseFs.statPromise(n).catch(o=>{throw o.code==="ENOENT"?new Ts(`cd: no such file or directory: ${t}`):o})).isDirectory())throw new Ts(`cd: not a directory: ${t}`);return i.cwd=n,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${j.fromPortablePath(r.cwd)}
|
|||
|
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,i)=>i.exitCode=parseInt(t!=null?t:i.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
|
|||
|
`),0)],["sleep",async([t],e,r)=>{if(typeof t=="undefined")throw new Ts("sleep: missing operand");let i=Number(t);if(Number.isNaN(i))throw new Ts(`sleep: invalid time interval '${t}'`);return await LDe(1e3*i,0)}],["__ysh_run_procedure",async(t,e,r)=>{let i=r.procedures[t[0]];return await Vw(i,{stdin:new po(r.stdin),stdout:new po(r.stdout),stderr:new po(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let i=r.stdin,n=r.stdout,s=r.stderr,o=[],a=[],l=[],c=0;for(;t[c]!=="--";){let g=t[c++],{type:f,fd:h}=JSON.parse(g),p=S=>{switch(h){case null:case 0:o.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},m=S=>{switch(h){case null:case 1:a.push(S);break;case 2:l.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},y=Number(t[c++]),Q=c+y;for(let S=c;S<Q;++c,++S)switch(f){case"<":p(()=>e.baseFs.createReadStream(k.resolve(r.cwd,j.toPortablePath(t[S]))));break;case"<<<":p(()=>{let x=new ns.PassThrough;return process.nextTick(()=>{x.write(`${t[S]}
|
|||
|
`),x.end()}),x});break;case"<&":p(()=>g5(Number(t[S]),1,r));break;case">":case">>":{let x=k.resolve(r.cwd,j.toPortablePath(t[S]));m(x==="/dev/null"?new ns.Writable({autoDestroy:!0,emitClose:!0,write(M,Y,U){setImmediate(U)}}):e.baseFs.createWriteStream(x,f===">>"?{flags:"a"}:void 0))}break;case">&":m(g5(Number(t[S]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${f}"`)}}if(o.length>0){let g=new ns.PassThrough;i=g;let f=h=>{if(h===o.length)g.end();else{let p=o[h]();p.pipe(g,{end:!1}),p.on("end",()=>{f(h+1)})}};f(0)}if(a.length>0){let g=new ns.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new ns.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await Vw(Hd(t.slice(c+1),e,r),{stdin:new po(i),stdout:new po(n),stderr:new po(s)}).run();return await Promise.all(a.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),await Promise.all(l.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),u}]]);async function ODe(t,e,r){let i=[],n=new ns.PassThrough;return n.on("data",s=>i.push(s)),await Zw(t,e,Xw(r,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function f5(t,e,r){let i=t.map(async s=>{let o=await iA(s.args,e,r);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function $w(t){return t.match(/[^ \r\n\t]+/g)||[]}async function h5(t,e,r,i,n=i){switch(t.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(t.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=$w(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(t.quoted)i(s);else for(let o of $w(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(t.name,10),o;if(Number.isFinite(s))if(s>=0&&s<e.args.length)o=e.args[s];else if(t.defaultValue)o=(await iA(t.defaultValue,e,r)).join(" ");else if(t.alternativeValue)o=(await iA(t.alternativeValue,e,r)).join(" ");else throw new Ts(`Unbound argument #${s}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))o=r.variables[t.name];else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))o=r.environment[t.name];else if(t.defaultValue)o=(await iA(t.defaultValue,e,r)).join(" ");else throw new Ts(`Unbound variable "${t.name}"`);if(typeof o!="undefined"&&t.alternativeValue&&(o=(await iA(t.alternativeValue,e,r)).join(" ")),t.quoted)i(o);else{let a=$w(o);for(let c=0;c<a.length-1;++c)n(a[c]);let l=a[a.length-1];typeof l!="undefined"&&i(l)}}break}}var MDe={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)};async function jd(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let i=[];await h5(te(N({},t),{quoted:!0}),e,r,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?jd({type:"variable",name:i.join(" ")},e,r):jd({type:"number",value:n},e,r)}else return MDe[t.type](await jd(t.left,e,r),await jd(t.right,e,r))}async function iA(t,e,r){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,f)=>{let h=JSON.stringify({type:u,fd:g}),p=i.get(h);typeof p=="undefined"&&i.set(h,p=[]),p.push(f)};for(let u of t){let g=!1;switch(u.type){case"redirection":{let f=await iA(u.args,e,r);for(let h of f)c(u.subtype,u.fd,h)}break;case"argument":for(let f of u.segments)switch(f.type){case"text":o(f.text);break;case"glob":o(f.pattern),g=!0;break;case"shell":{let h=await ODe(f.shell,e,r);if(f.quoted)o(h);else{let p=$w(h);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await h5(f,e,r,o,l);break;case"arithmetic":o(String(await jd(f.arithmetic,e,r)));break}break}if(a(),g){let f=n.pop();if(typeof f=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let h=await e.glob.ma
|
|||
|
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${l}, '${o(_u(t))}' has ended
|
|||
|
`)})),0}return await d5(t,e,r)}async function jDe(t,e,r,{background:i=!1}={}){let n,s=a=>{n=a,r.variables["?"]=String(a)},o=async a=>{try{return await HDe(a.chain,e,r,{background:i&&typeof a.then=="undefined"})}catch(l){if(!(l instanceof Ts))throw l;return r.stderr.write(`${l.message}
|
|||
|
`),1}};for(s(await o(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":n===0&&s(await o(t.then.line));break;case"||":n!==0&&s(await o(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return n}async function Zw(t,e,r){let i=r.backgroundJobs;r.backgroundJobs=[];let n=0;for(let{command:s,type:o}of t){if(n=await jDe(s,e,r,{background:o==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(n)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=i,n}function C5(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>Gd(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>Gd(e));case"arithmetic":return iD(t.arithmetic);case"shell":return nD(t.shell);default:return!1}}function Gd(t){switch(t.type){case"redirection":return t.args.some(e=>Gd(e));case"argument":return t.segments.some(e=>C5(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function iD(t){switch(t.type){case"variable":return C5(t);case"number":return!1;default:return iD(t.left)||iD(t.right)}}function nD(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let i;switch(r.type){case"subshell":i=nD(r.subshell);break;case"command":i=r.envs.some(n=>n.args.some(s=>Gd(s)))||r.args.some(n=>Gd(n));break}if(i)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function eB(t,e=[],{baseFs:r=new ar,builtins:i={},cwd:n=j.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=Ww}={}){let g={};for(let[p,m]of Object.entries(s))typeof m!="undefined"&&(g[p]=m);let f=new Map(TDe);for(let[p,m]of Object.entries(i))f.set(p,m);o===null&&(o=new ns.PassThrough,o.end());let h=ZE(t,u);if(!nD(h)&&h.length>0&&e.length>0){let{command:p}=h[h.length-1];for(;p.then;)p=p.then.line;let m=p.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 Zw(h,{args:e,baseFs:r,builtins:f,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 i6=ge(tB()),n6=ge(ag()),Jc=ge(require("stream"));var Z5=ge(X5()),nB=ge(hc());var $5=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],e6=80,KRe=new Set([$.FETCH_NOT_CACHED,$.UNUSED_CACHE_ENTRY]),HRe=5,sB=nB.default.GITHUB_ACTIONS?{start:t=>`::group::${t}
|
|||
|
`,end:t=>`::endgroup::
|
|||
|
`}:nB.default.TRAVIS?{start:t=>`travis_fold:start:${t}
|
|||
|
`,end:t=>`travis_fold:end:${t}
|
|||
|
`}:nB.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r[0K${t}
|
|||
|
`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r[0K`}:null,t6=new Date,jRe=["iTerm.app","Apple_Terminal"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,GRe=t=>t,oB=GRe({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}}),YRe=jRe&&Object.keys(oB).find(t=>{let e=oB[t];return!(e.date&&(e.date[0]!==t6.getDate()||e.date[1]!==t6.getMonth()+1))})||"default";function r6(t,{configuration:e,json:r}){if(!e.get("enableMessageNames"))return"";let n=YA(t===null?0:t);return!r&&t===null?et(e,n,"grey"):n}function lD(t,{configuration:e,json:r}){let i=r6(t,{configuration:e,json:r});if(!i||t===null||t===$.UNNAMED)return i;let n=$[t],s=`https://yarnpkg.com/advanced/error-codes#${i}---${n}`.toLowerCase();return Fg(e,i,s)}var Je=class extends Ji{constructor({configuration:e,stdout:r,json:i=!1,includeFooter:n=!0,includeLogs:s=!i,includeInfos:o=s,includeWarnings:a=s,forgettableBufferSize:l=HRe,forgettableNames:c=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errorCount=0;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(nd(this,{configuration:e}),this.configuration=e,this.forgettableBufferSize=l,this.forgettableNames=new Set([...c,...KRe]),this.includeFooter=n,this.includeInfos=o,this.includeWarnings=a,this.json=i,this.stdout=r,e.get("enableProgressBars")&&!i&&r.isTTY&&r.columns>22){let u=e.get("progressBarStyle")||YRe;if(!Object.prototype.hasOwnProperty.call(oB,u))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=oB[u];let g="\u27A4 YN0000: \u250C ".length,f=Math.max(0,Math.min(r.columns-g,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*f/80)}}static async start(e,r){let i=new this(e),n=process.emitWarning;process.emitWarning=(s,o)=>{if(typeof s!="string"){let l=s;s=l.message,o=o!=null?o:l.name}let a=typeof o!="undefined"?`${o}: ${s}`:s;i.reportWarning($.UNNAMED,a)};try{await r(i)}catch(s){i.reportExceptionOnce(s)}finally{await i.finalize(),process.emitWarning=n}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){this.cacheHitCount+=1}reportCacheMiss(e,r){this.lastCacheMiss=e,this.cacheMissCount+=1,typeof r!="undefined"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo($.FETCH_NOT_CACHED,r)}startSectionSync({reportHeader:e,reportFooter:r,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(r==null||r(a-o))}}async startSectionPromise({reportHeader:e,reportFooter:r,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return await n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(r==null||r(a-o))}}startTimerImpl(e,r,i){let n=typeof r=="function"?{}:r;return{cb:typeof r=="function"?r:i,reportHeader:()=>{this.reportInfo(null,`\u250C ${e}`),this.indent+=1,sB!==null&&!this.json&&this.includeInfos&&this.stdout.write(sB.start(e))},reportFooter:o=>{this.indent-=1,sB!==null&&!this.json&&this.includeInfos&&this.stdout.write(sB.end(e)),this.configuration.get("enableTimers")&&o>200?this.reportInfo(null,`\u2514 Completed in ${et(this.configuration,o,Ge.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:n.skipIfEmpty}}startTimerSync(e,r,i){let o=this.startTimerImpl(e,r,i),{cb:n}=o,s=Tr(o,["cb"]);return this.startSectionSync(s,n)}async s
|
|||
|
`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:r}={}){this.forgettableLines=[],this.writeLine(e,{truncate:r})}writeLines(e,{truncate:r}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:r})}
|
|||
|
`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:r}){let i=this.cacheHitCount-e,n=this.cacheMissCount-r;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(s+=`, one had to be fetched (${Bt(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(s+=` - one package had to be fetched (${Bt(this.configuration,this.lastCacheMiss)})`),this.reportInfo($.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let r of e)r.committed=!0,r.action()}clearProgress({delta:e=0,clear:r=!1}){this.progressStyle!==null&&this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||r)&&this.stdout.write("[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let e=Date.now();e-this.progressTime>e6&&(this.progressFrame=(this.progressFrame+1)%$5.length,this.progressTime=e);let r=$5[this.progressFrame];for(let i of this.progress.values()){let n="";if(typeof i.lastScaledSize!="undefined"){let l=this.progressStyle.chars[0].repeat(i.lastScaledSize),c=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize);n=` ${l}${c}`}let s=this.formatName(null),o=s?`${s}: `:"",a=i.definition.title?` ${i.definition.title}`:"";this.stdout.write(`${et(this.configuration,"\u27A4","blueBright")} ${o}${r}${n}${a}
|
|||
|
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},e6)}refreshProgress({delta:e=0,force:r=!1}={}){let i=!1,n=!1;if(r||this.progress.size===0)i=!0;else for(let s of this.progress.values()){let o=typeof s.definition.progress!="undefined"?Math.trunc(this.progressMaxScaledSize*s.definition.progress):void 0,a=s.lastScaledSize;s.lastScaledSize=o;let l=s.lastTitle;if(s.lastTitle=s.definition.title,o!==a||(n=l!==s.definition.title)){i=!0;break}}i&&(this.clearProgress({delta:e,clear:n}),this.writeProgress())}truncate(e,{truncate:r}={}){return this.progressStyle===null&&(r=!1),typeof r=="undefined"&&(r=this.configuration.get("preferTruncatedLines")),r&&(e=(0,Z5.default)(e,0,this.stdout.columns-1)),e}formatName(e){return r6(e,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(e){return lD(e,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Ur="3.2.0";var hn;(function(n){n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm"})(hn||(hn={}));async function nA(t,e,r,i=[]){if(process.platform==="win32"){let n=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${i.map(s=>`"${s.replace('"','""')}"`).join(" ")} %*`;await K.writeFilePromise(k.format({dir:t,name:e,ext:".cmd"}),n)}await K.writeFilePromise(k.join(t,e),`#!/bin/sh
|
|||
|
exec "${r}" ${i.map(n=>`'${n.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
|
|||
|
`,{mode:493})}async function s6(t){let e=await At.tryFind(t);if(e==null?void 0:e.packageManager){let i=gw(e.packageManager);if(i==null?void 0:i.name){let n=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManager:Number(s)===1?hn.Yarn1:hn.Yarn2,reason:n};case"npm":return{packageManager:hn.Npm,reason:n};case"pnpm":return{packageManager:hn.Pnpm,reason:n}}}}let r;try{r=await K.readFilePromise(k.join(t,Pt.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:hn.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:hn.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:K.existsSync(k.join(t,"package-lock.json"))?{packageManager:hn.Npm,reason:`found npm's "package-lock.json" lockfile`}:K.existsSync(k.join(t,"pnpm-lock.yaml"))?{packageManager:hn.Pnpm,reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function Yd({project:t,locator:e,binFolder:r,lifecycleScript:i}){var l,c;let n={};for(let[u,g]of Object.entries(process.env))typeof g!="undefined"&&(n[u.toLowerCase()!=="path"?u:"PATH"]=g);let s=j.fromPortablePath(r);n.BERRY_BIN_FOLDER=j.fromPortablePath(s);let o=process.env.COREPACK_ROOT?j.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([nA(r,"node",process.execPath),...Ur!==null?[nA(r,"run",process.execPath,[o,"run"]),nA(r,"yarn",process.execPath,[o]),nA(r,"yarnpkg",process.execPath,[o]),nA(r,"node-gyp",process.execPath,[o,"run","--top-level","node-gyp"])]:[]]),t&&(n.INIT_CWD=j.fromPortablePath(t.configuration.startingCwd),n.PROJECT_CWD=j.fromPortablePath(t.cwd)),n.PATH=n.PATH?`${s}${j.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${j.sep}yarn`,n.npm_node_execpath=`${s}${j.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let u=t.tryWorkspaceByLocator(e),g=u?(l=u.manifest.version)!=null?l:"":(c=t.storedPackages.get(e.locatorHash).version)!=null?c:"";n.npm_package_name=Ot(e),n.npm_package_version=g}let a=Ur!==null?`yarn/${Ur}`:`yarn/${Rg("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${a} npm/? node/${process.version} ${process.platform} ${process.arch}`,i&&(n.npm_lifecycle_event=i),t&&await t.configuration.triggerHook(u=>u.setupScriptEnvironment,t,n,async(u,g,f)=>await nA(r,qr(u),g,f)),n}var qRe=2,JRe=(0,n6.default)(qRe);async function WRe(t,e,{configuration:r,report:i,workspace:n=null,locator:s=null}){await JRe(async()=>{await K.mktempPromise(async o=>{let a=k.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=r.getSubprocessStreams(a,{prefix:j.fromPortablePath(t),report:i}),g=s&&Xo(s)?gd(s):s,f=g?Ps(g):"an external project";c.write(`Packing ${f} from sources
|
|||
|
`);let h=await s6(t),p;h!==null?(c.write(`Using ${h.packageManager} for bootstrap. Reason: ${h.reason}
|
|||
|
|
|||
|
`),p=h.packageManager):(c.write(`No package manager configuration detected; defaulting to Yarn
|
|||
|
|
|||
|
`),p=hn.Yarn2),await K.mktempPromise(async m=>{let y=await Yd({binFolder:m}),S=new Map([[hn.Yarn1,async()=>{let M=n!==null?["workspace",n]:[],Y=await $o("yarn",["set","version","classic","--only-if-needed"],{cwd:t,env:y,stdin:l,stdout:c,stderr:u,end:is.ErrorCode});if(Y.code!==0)return Y.code;await K.appendFilePromise(k.join(t,".npmignore"),`/.yarn
|
|||
|
`),c.write(`
|
|||
|
`);let U=await $o("yarn",["install"],{cwd:t,env:y,stdin:l,stdout:c,stderr:u,end:is.ErrorCode});if(U.code!==0)return U.code;c.write(`
|
|||
|
`);let J=await $o("yarn",[...M,"pack","--filename",j.fromPortablePath(e)],{cwd:t,env:y,stdin:l,stdout:c,stderr:u});return J.code!==0?J.code:0}],[hn.Yarn2,async()=>{let M=n!==null?["workspace",n]:[];y.YARN_ENABLE_INLINE_BUILDS="1";let Y=k.join(t,Pt.lockfile);await K.existsPromise(Y)||await K.writeFilePromise(Y,"");let U=await $o("yarn",[...M,"pack","--install-if-needed","--filename",j.fromPortablePath(e)],{cwd:t,env:y,stdin:l,stdout:c,stderr:u});return U.code!==0?U.code:0}],[hn.Npm,async()=>{if(n!==null){let A=new Jc.PassThrough,ne=Dg(A);A.pipe(c,{end:!1});let le=await $o("npm",["--version"],{cwd:t,env:y,stdin:l,stdout:A,stderr:u,end:is.Never});if(A.end(),le.code!==0)return c.end(),u.end(),le.code;let Ae=(await ne).toString().trim();if(!Uc(Ae,">=7.x")){let T=Vo(null,"npm"),L=rr(T,Ae),Ee=rr(T,">=7.x");throw new Error(`Workspaces aren't supported by ${sr(r,L)}; please upgrade to ${sr(r,Ee)} (npm has been detected as the primary package manager for ${et(r,t,Ge.PATH)})`)}}let M=n!==null?["--workspace",n]:[];delete y.npm_config_user_agent;let Y=await $o("npm",["install"],{cwd:t,env:y,stdin:l,stdout:c,stderr:u,end:is.ErrorCode});if(Y.code!==0)return Y.code;let U=new Jc.PassThrough,J=Dg(U);U.pipe(c);let W=await $o("npm",["pack","--silent",...M],{cwd:t,env:y,stdin:l,stdout:U,stderr:u});if(W.code!==0)return W.code;let ee=(await J).toString().trim().replace(/^.*\n/s,""),Z=k.resolve(t,j.toPortablePath(ee));return await K.renamePromise(Z,e),0}]]).get(p);if(typeof S=="undefined")throw new Error("Assertion failed: Unsupported workflow");let x=await S();if(!(x===0||typeof x=="undefined"))throw K.detachTemp(o),new ct($.PACKAGE_PREPARATION_FAILED,`Packing the package failed (exit code ${x}, logs can be found here: ${et(r,a,Ge.PATH)})`)})})})}async function zRe(t,e,{project:r}){let i=r.tryWorkspaceByLocator(t);if(i!==null)return cD(i,e);let n=r.storedPackages.get(t.locatorHash);if(!n)throw new Error(`Package for ${Bt(r.configuration,t)} not found in the project`);return await ms.openPromise(async s=>{let o=r.configuration,a=r.configuration.getLinkers(),l={project:r,report:new Je({stdout:new Jc.PassThrough,configuration:o})},c=a.find(h=>h.supportsPackage(n,l));if(!c)throw new Error(`The package ${Bt(r.configuration,n)} isn't supported by any of the available linkers`);let u=await c.findPackageLocation(n,l),g=new _t(u,{baseFs:s});return(await At.find(Me.dot,{baseFs:g})).scripts.has(e)},{libzip:await fn()})}async function aB(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await o6(t,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),f=c.scripts.get(e);if(typeof f=="undefined")return 1;let h=async()=>await eB(f,r,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,h,n,t,e,{script:f,args:r,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function uD(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{env:c,cwd:u}=await o6(t,{project:n,binFolder:l,cwd:i});return await eB(e,r,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function _Re(t,{binFolder:e,cwd:r,lifecycleScript:i}){let n=await Yd({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:i});return await Promise.all(Array.from(await a6(t),([s,[,o]])=>nA(e,qr(s),process.execPath,[o]))),typeof r=="undefined"&&(r=k.dirname(await K.realpathPromise(k.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:n,cwd:r}}async function o6(t,{project:e,binFolder:r,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(t);if(s!==null)return _Re(s,{binFolder:r,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(t.locatorHash);if(!o)throw new Error(`Package for ${Bt(e.configuration,t)} not found in the project`);return await ms.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new Je({stdout:new Jc.PassThrough,configuration:l})},g=c.find(y=>y.supportsPackage(o,u));if(!g)throw new Error(`The package ${Bt(e.configuration,o)} isn't supported by any of the availab
|
|||
|
`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:Bt(n,t.anchoredLocator),header:l});i.reportInfo($.LIFECYCLE_SCRIPT,`Calling the "${e}" lifecycle script`);let g=await A6(t,e,[],{cwd:r,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw K.detachTemp(o),new ct($.LIFECYCLE_SCRIPT,`${(0,i6.default)(e)} script failed (exit code ${et(n,g,Ge.NUMBER)}, logs can be found here: ${et(n,a,Ge.PATH)}); run ${et(n,`yarn ${e}`,Ge.CODE)} to investigate`)})}async function VRe(t,e,r){cD(t,e)&&await l6(t,e,r)}async function AB(t,{project:e}){let r=e.configuration,i=new Map,n=e.storedPackages.get(t.locatorHash);if(!n)throw new Error(`Package for ${Bt(r,t)} not found in the project`);let s=new Jc.Writable,o=r.getLinkers(),a={project:e,report:new Je({configuration:r,stdout:s})},l=new Set([t.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertion failed: The resolution (${sr(r,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 qo.skip;let f=o.find(p=>p.supportsPackage(g,a));if(!f)return qo.skip;let h=null;try{h=await f.findPackageLocation(g,a)}catch(p){if(p.code==="LOCATOR_NOT_INSTALLED")return qo.skip;throw p}return{dependency:g,packageLocation:h}}));for(let u of c){if(u===qo.skip)continue;let{dependency:g,packageLocation:f}=u;for(let[h,p]of g.bin)i.set(h,[g,j.fromPortablePath(k.resolve(f,p))])}return i}async function a6(t){return await AB(t.anchoredLocator,{project:t.project})}async function c6(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await AB(t,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binary not found (${e}) for ${Bt(n.configuration,t)}`);return await K.mktempPromise(async g=>{let[,f]=u,h=await Yd({project:n,locator:t,binFolder:g});await Promise.all(Array.from(c,([m,[,y]])=>nA(h.BERRY_BIN_FOLDER,qr(m),process.execPath,[y])));let p;try{p=await $o(process.execPath,[...l,f,...r],{cwd:i,env:h,stdin:s,stdout:o,stderr:a})}finally{await K.removePromise(h.BERRY_BIN_FOLDER)}return p.code})}async function XRe(t,e,r,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await c6(t.anchoredLocator,e,r,{project:t.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var wi={};ft(wi,{convertToZip:()=>aLe,extractArchiveTo:()=>lLe,makeArchiveFromDirectory:()=>oLe});var r7=ge(require("stream")),i7=ge(V9());var X9=ge(require("os")),Z9=ge(ag()),$9=ge(require("worker_threads")),Ql=Symbol("kTaskInfo"),bR=class{constructor(e){this.source=e;this.workers=[];this.limit=(0,Z9.default)(Math.max(1,(0,X9.cpus)().length));this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let r=this.workers.pop();r?r.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new $9.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return e.on("message",r=>{if(!e[Ql])throw new Error("Assertion failed: Worker sent a result without having a task assigned");e[Ql].resolve(r),e[Ql]=null,e.unref(),this.workers.push(e)}),e.on("error",r=>{var i;(i=e[Ql])==null||i.reject(r),e[Ql]=null}),e.on("exit",r=>{var i;r!==0&&((i=e[Ql])==null||i.reject(new Error(`Worker exited with code ${r}`))),e[Ql]=null}),e}run(e){return this.limit(()=>{var i;let r=(i=this.workers.pop())!=null?i:this.createWorker();return r.ref(),new Promise((n,s)=>{r[Ql]={resolve:n,reject:s},r.postMessage(e)})})}};var n7=ge(t7());async function oLe(t,{baseFs:e=new ar,prefixPath:r=Me.root,compressionLevel:i,inMemory:n=!1}={}){let s=await fn(),o;if(n)o=new Ai(null,{libzip:s,level:i});else{let l=await K.mktempPromise(),c=k.join(l,"archive.zip");o=new Ai(c,{create:!0,libzip:s,level:i})}let a=k.resolve(Me.root,r);return await o.copyPromise(a,t,{baseFs:e,stableTime:!0,stableSort:!0}),o}var s7;async function aLe(t,e){
|
|||
|
`);return}let s=(0,A7.asTree)(l7(t,{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
|
|||
|
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(s)}var g7=ge(require("crypto")),SR=ge(require("fs"));var uLe=8,Nt=class{constructor(e,{configuration:r,immutable:i=r.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,g7.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=i,this.check=n;let s=r.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=r.get("compressionLevel"),a=o!==ic?`c${o}`:"";this.cacheKey=[uLe,a].join("")}}static async find(e,{immutable:r,check:i}={}){let n=new Nt(e.get("cacheFolder"),{configuration:e,immutable:r,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`${Hg(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let n=gLe(r).slice(0,10);return`${Hg(e)}-${n}.zip`}getLocatorPath(e,r,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?k.resolve(this.cwd,this.getVersionFilename(e)):r===null||kR(r)!==this.cacheKey?null:k.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?k.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await K.existsPromise(this.cwd))throw new ct($.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await K.mkdirPromise(this.cwd,{recursive:!0});let e=k.resolve(this.cwd,".gitignore");await K.changeFilePromise(e,`/.gitignore
|
|||
|
*.flock
|
|||
|
*.tmp
|
|||
|
`)}(this.mirrorCwd||!this.immutable)&&await K.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,a){var l=a,{onHit:i,onMiss:n,loader:s}=l,o=Tr(l,["onHit","onMiss","loader"]);var A;let c=this.getLocatorMirrorPath(e),u=new ar,g=()=>{let ne=new Ai(null,{libzip:Y}),le=k.join(Me.root,lx(e));return ne.mkdirSync(le,{recursive:!0}),ne.writeJsonSync(k.join(le,Pt.manifest),{name:Ot(e),mocked:!0}),ne},f=async(ne,le=null)=>{var T;if(le===null&&((T=o.unstablePackages)==null?void 0:T.has(e.locatorHash)))return null;let Ae=!o.skipIntegrityCheck||!r?`${this.cacheKey}/${await Aw(ne)}`:r;if(le!==null){let L=!o.skipIntegrityCheck||!r?`${this.cacheKey}/${await Aw(le)}`:r;if(Ae!==L)throw new ct($.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(r!==null&&Ae!==r){let L;switch(this.check?L="throw":kR(r)!==kR(Ae)?L="update":L=this.configuration.get("checksumBehavior"),L){case"ignore":return r;case"update":return Ae;default:case"throw":throw new ct($.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return Ae},h=async ne=>{if(!s)throw new Error(`Cache check required but no loader configured for ${Bt(this.configuration,e)}`);let le=await s(),Ae=le.getRealPath();return le.saveAndClose(),await K.chmodPromise(Ae,420),await f(ne,Ae)},p=async()=>{if(c===null||!await K.existsPromise(c)){let ne=await s(),le=ne.getRealPath();return ne.saveAndClose(),{source:"loader",path:le}}return{source:"mirror",path:c}},m=async()=>{if(!s)throw new Error(`Cache entry required but missing for ${Bt(this.configuration,e)}`);if(this.immutable)throw new ct($.IMMUTABLE_CACHE,`Cache entry required but missing for ${Bt(this.configuration,e)}`);let{path:ne,source:le}=await p(),Ae=await f(ne),T=this.getLocatorPath(e,Ae,o);if(!T)throw new Error("Assertion failed: Expected the cache path to be available");let L=[];le!=="mirror"&&c!==null&&L.push(async()=>{let we=`${c}${this.cacheId}`;await K.copyFilePromise(ne,we,SR.default.constants.COPYFILE_FICLONE),await K.chmodPromise(we,420),await K.renamePromise(we,c)}),(!o.mirrorWriteOnly||c===null)&&L.push(async()=>{let we=`${T}${this.cacheId}`;await K.copyFilePromise(ne,we,SR.default.constants.COPYFILE_FICLONE),await K.chmodPromise(we,420),await K.renamePromise(we,T)});let Ee=o.mirrorWriteOnly&&c!=null?c:T;return await Promise.all(L.map(we=>we())),[!1,Ee,Ae]},y=async()=>{let le=(async()=>{var qe;let Ae=this.getLocatorPath(e,r,o),T=Ae!==null?await u.existsPromise(Ae):!1,L=!!((qe=o.mockedPackages)==null?void 0:qe.has(e.locatorHash))&&(!this.check||!T),Ee=L||T,we=Ee?i:n;if(we&&we(),Ee){let re=null,se=Ae;return L||(re=this.check?await h(se):await f(se)),[L,se,re]}else return m()})();this.mutexes.set(e.locatorHash,le);try{return await le}finally{this.mutexes.delete(e.locatorHash)}};for(let ne;ne=this.mutexes.get(e.locatorHash);)await ne;let[Q,S,x]=await y();this.markedFiles.add(S);let M,Y=await fn(),U=Q?()=>g():()=>new Ai(S,{baseFs:u,libzip:Y,readOnly:!0}),J=new zh(()=>HS(()=>M=U(),ne=>`Failed to open the cache entry for ${Bt(this.configuration,e)}: ${ne}`),k),W=new Pa(S,{baseFs:J,pathUtils:k}),ee=()=>{M==null||M.discardAndClose()},Z=((A=o.unstablePackages)==null?void 0:A.has(e.locatorHash))?null:x;return[W,ee,Z]}};function kR(t){let e=t.indexOf("/");return e!==-1?t.slice(0,e):null}function gLe(t){let e=t.indexOf("/");return e!==-1?t.slice(e+1):t}var As;(function(r){r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE"})(As||(As={}));var uA=class extends Ji{constructor({configuration:e,stdout:r,suggestInstall:i=!0}){super();this.errorCount=0;nd(this,{configuration:e}),this.configuration=e,this.stdout=r,this.suggestInstall=i}static async start(e,r){let i=new this(e);try{await r(i)}catch(n){i.reportExceptionOnce(n)}finally{await i.finalize()}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,r){return r()}async startSectionPromise(e,r){return await r()}startTimerSync(e,r,i){return(typeof r=="function"?r:i)()}async start
|
|||
|
`)}reportProgress(e){let r=Promise.resolve().then(async()=>{for await(let{}of e);}),i=()=>{};return te(N({},r),{stop:i})}reportJson(e){}async finalize(){this.errorCount>0&&(this.stdout.write(`
|
|||
|
`),this.stdout.write(`${et(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
|
|||
|
`),this.suggestInstall&&this.stdout.write(`${et(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
|
|||
|
`))}formatNameWithHyperlink(e){return lD(e,{configuration:this.configuration,json:!1})}};var h0=ge(require("crypto")),i$=ge(_7()),p0=ge(t$()),n$=ge(ag()),s$=ge(ti()),rF=ge(require("util")),iF=ge(require("v8")),nF=ge(require("zlib"));var z1e=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,i)=>`${r}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\/\/(?:[^\\.]+)\.jfrog\.io\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(t,e)=>fw({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],$R=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:r}){let i=k.join(e.cwd,e.configuration.get("lockfileFilename"));if(!K.existsSync(i))return;let n=await K.readFilePromise(i,"utf8"),s=Qi(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=pd(a);if(!l){r.reportWarning($.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}fo(l.range)&&(l=rr(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[h,p]of z1e){let m=u.match(h);if(m){g=p(c,...m);break}}if(!g){r.reportWarning($.YARN_IMPORT_FAILED,`${sr(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let f=l;try{let h=Kg(l.range),p=pd(h.selector,!0);p&&(f=p)}catch{}o.set(l.descriptorHash,cn(f,g))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,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(nx(n),r,i)}async getSatisfying(e,r,i){return null}async resolve(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var eF=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(uw(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,i){let n=i.project.originalPackages.get(uw(e).locatorHash);if(n)return[n];let s=i.project.storedResolutions.get(e.descriptorHash);if(!s)throw new Error("Expected the resolution to have been successful - resolution not found");if(n=i.project.originalPackages.get(s),!n)throw new Error("Expected the resolution to have been successful - package not found");return[n]}async getSatisfying(e,r,i){return null}async resolve(e,r){let i=r.project.originalPackages.get(e.locatorHash);if(!i)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return i}};var tF=class{constructor(e){this.resolver=e}supports
|
|||
|
`;await K.changeFilePromise(r,i,{automaticNewlines:!0}),this.manifest.raw=e}};var o$=6,_1e=1,V1e=/ *, */g,a$=/\/$/,X1e=32,Z1e=(0,rF.promisify)(nF.default.gzip),$1e=(0,rF.promisify)(nF.default.gunzip),di;(function(r){r.UpdateLockfile="update-lockfile",r.SkipBuild="skip-build"})(di||(di={}));var sF={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},A$=t=>ln(`${_1e}`,t),ze=class{constructor(e,{configuration:r}){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=r,this.cwd=e}static async find(e,r){var p,m,y;if(!e.projectCwd)throw new Pe(`No project found in ${r}`);let i=e.projectCwd,n=r,s=null;for(;s!==e.projectCwd;){if(s=n,K.existsSync(k.join(s,Pt.manifest))){i=s;break}n=k.dirname(s)}let o=new ze(e.projectCwd,{configuration:e});(p=ye.telemetry)==null||p.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(m=ye.telemetry)==null||m.reportWorkspaceCount(o.workspaces.length),(y=ye.telemetry)==null||y.reportDependencyCount(o.workspaces.reduce((Q,S)=>Q+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=et(e,o.cwd,Ge.PATH),u=et(e,k.relative(o.cwd,i),Ge.PATH),g=`- If ${c} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,f=`- If ${c} is intended to be a project, it might be that you forgot to list ${u} in its workspace configuration.`,h=`- 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 Pe(`The nearest package directory (${et(e,i,Ge.PATH)}) doesn't seem to be part of the project declared in ${et(e,o.cwd,Ge.PATH)}.
|
|||
|
|
|||
|
${[g,f,h].join(`
|
|||
|
`)}`)}async setupResolutions(){var i;this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.configuration.get("defaultLanguageName");if(K.existsSync(e)){let n=await K.readFilePromise(e,"utf8");this.lockFileChecksum=A$(n);let s=Qi(n);if(s.__metadata){let o=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o<o$;for(let l of Object.keys(s)){if(l==="__metadata")continue;let c=s[l];if(typeof c.resolution=="undefined")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${l})`);let u=Mc(c.resolution,!0),g=new At;g.load(c,{yamlCompatibilityMode:!0});let f=g.version,h=g.languageName||r,p=c.linkType.toUpperCase(),m=(i=c.conditions)!=null?i:null,y=g.dependencies,Q=g.peerDependencies,S=g.dependenciesMeta,x=g.peerDependenciesMeta,M=g.bin;if(c.checksum!=null){let U=typeof a!="undefined"&&!c.checksum.includes("/")?`${a}/${c.checksum}`:c.checksum;this.storedChecksums.set(u.locatorHash,U)}let Y=te(N({},u),{version:f,languageName:h,linkType:p,conditions:m,dependencies:y,peerDependencies:Q,dependenciesMeta:S,peerDependenciesMeta:x,bin:M});this.originalPackages.set(Y.locatorHash,Y);for(let U of l.split(V1e)){let J=nl(U);this.storedDescriptors.set(J.descriptorHash,J),this.storedResolutions.set(J.descriptorHash,u.locatorHash)}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=[this.cwd];for(;e.length>0;){let r=e;e=[];for(let i of r){if(this.workspacesByCwd.has(i))continue;let n=await this.addWorkspace(i),s=this.storedPackages.get(n.anchoredLocator.locatorHash);s&&(n.dependencies=s.dependencies);for(let o of n.workspacesCwds)e.push(o)}}}async addWorkspace(e){let r=new BC(e,{project:this});await r.setup();let i=this.workspacesByIdent.get(r.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicate workspace name ${gi(this.configuration,r.locator)}: ${j.fromPortablePath(e)} conflicts with ${j.fromPortablePath(i.cwd)}`);return this.workspaces.push(r),this.workspacesByCwd.set(e,r),this.workspacesByIdent.set(r.locator.identHash,r),r}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){k.isAbsolute(e)||(e=k.resolve(this.cwd,e)),e=k.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let i of this.workspaces)k.relative(i.cwd,e).startsWith("../")||r&&r.cwd.length>=i.cwd.length||(r=i);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r=="undefined"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${gi(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){let r=this.tryWorkspaceByIdent(e);return r===null||(il(e)&&(e=ud(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${sr(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Xo(e)&&(e=gd(e)),r.locator.locatorHash!==e.locatorHash&&r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${Bt(this.configuration,e)})`);return r}refreshWorkspaceDependencies(){for(let e of this.workspaces){let r=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!r)throw new Error(`Assertion failed: Expected workspace ${Cd(this.configuration,e)} (${et(this.configuration,k.join(e.cwd,Pt.manifest),Ge.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);e.dependencies=new Map(r.dependencies)}}forgetResolution(e){let r=n=>{this.store
|
|||
|
`;switch(Qe){case As.SCRIPT:Fe+=`# Script name: ${he}
|
|||
|
`;break;case As.SHELLCODE:Fe+=`# Script code: ${he}
|
|||
|
`;break}let Ue=null;if(!await K.mktempPromise(async ve=>{let pe=k.join(ve,"build.log"),{stdout:X,stderr:be}=this.configuration.getSubprocessStreams(pe,{header:Fe,prefix:Bt(this.configuration,Ee),report:r}),ce;try{switch(Qe){case As.SCRIPT:ce=await aB(Ee,he,[],{cwd:se,project:this,stdin:Ue,stdout:X,stderr:be});break;case As.SHELLCODE:ce=await uD(Ee,he,[],{cwd:se,project:this,stdin:Ue,stdout:X,stderr:be});break}}catch(gt){be.write(gt.stack),ce=1}if(X.end(),be.end(),ce===0)return ee.set(Ee.locatorHash,re),!0;K.detachTemp(ve);let fe=`${Bt(this.configuration,Ee)} couldn't be built successfully (exit code ${et(this.configuration,ce,Ge.NUMBER)}, logs can be found here: ${et(this.configuration,pe,Ge.PATH)})`;return this.optionalBuilds.has(Ee.locatorHash)?(r.reportInfo($.BUILD_FAILED,fe),ee.set(Ee.locatorHash,re),!0):(r.reportError($.BUILD_FAILED,fe),!1)}))return}})())}}if(await co(T),Ae===x.size){let L=Array.from(x).map(Ee=>{let we=this.storedPackages.get(Ee);if(!we)throw new Error("Assertion failed: The package should have been registered");return Bt(this.configuration,we)}).join(", ");r.reportError($.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${L})`);break}}this.storedBuildState=ee}async install(e){var a,l;let r=this.configuration.get("nodeLinker");(a=ye.telemetry)==null||a.reportInstall(r),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=qi.Inactive;let i=k.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await K.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new ct($.FROZEN_LOCKFILE_EXCEPTION,"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 f=et(this.configuration,g,Ge.PACKAGE_EXTENSION);switch(g.status){case qi.Inactive:e.report.reportWarning($.UNUSED_PACKAGE_EXTENSION,`${f}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case qi.Redundant:e.report.reportWarning($.REDUNDANT_PACKAGE_EXTENSION,`${f}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(n!==null){let c=$l(n,this.generateLockfile());if(c!==n){let u=(0,i$.structuredPatch)(i,i,n,c);e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@ -${g.oldStart},${g.oldLines} +${g.newStart},${g.newLines} @@`);for(let f of g.lines)f.startsWith("+")?e.report.reportError($.FROZEN_LOCKFILE_EXCEPTION,et(this.configuration,f,Ge.ADDED)):f.startsWith("-")?e.report.reportError($.FROZEN_LOCKFILE_EXCEPTION,et(this.configuration,f,Ge.REMOVED)):e.report.reportInfo(null,et(this.configuration,f,"grey"))}throw e.report.reportSeparator(),new ct($.FROZEN_LOCKFILE_EXCEPTION,"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===qi.Active&&((l=ye.telemetry)==null||l.reportPackageExtension(Dc(g,Ge.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&e.mode!==di.UpdateLockfile&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>lw(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.persis
|
|||
|
`,`# Manual changes might be lost - proceed with caution!
|
|||
|
`].join("")}
|
|||
|
`+Na(r)}async persistLockfile(){let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),r="";try{r=await K.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=$l(r,i);n!==r&&(await K.writeFilePromise(e,n),this.lockFileChecksum=A$(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(sF))e.push(...o);let r=(0,p0.default)(this,e),i=iF.default.serialize(r),n=ln(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await K.mkdirPromise(k.dirname(s),{recursive:!0}),await K.writeFilePromise(s,await Z1e(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath"),s;try{let o=await $1e(await K.readFilePromise(n));s=iF.default.deserialize(o),this.installStateChecksum=ln(o)}catch{r&&await this.applyLightResolution();return}e&&typeof s.installersCustomData!="undefined"&&(this.installersCustomData=s.installersCustomData),i&&Object.assign(this,(0,p0.default)(s,sF.restoreBuildState)),r&&(s.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,p0.default)(s,sF.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new pi}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:r}){let i=new Set([".gitignore"]);if(!Cx(e.cwd,this.cwd)||!await K.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await K.readdirPromise(e.cwd)){if(i.has(a))continue;let l=k.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?r.reportError($.IMMUTABLE_CACHE,`${et(this.configuration,k.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:r.reportInfo($.UNUSED_CACHE_ENTRY,`${et(this.configuration,k.basename(l),"magenta")} appears to be unused - removing`),await K.removePromise(l)))}n&&s!==0&&r.reportInfo($.UNUSED_CACHE_ENTRY,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`),e.markedFiles.clear()}};function eUe({project:t,allDescriptors:e,allResolutions:r,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,peerRequirements:o=new Map,volatileDescriptors:a=new Set,report:l,tolerateMissingPackages:c=!1}){var ee;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,m=new Map,y=new Map,Q=new Map(t.workspaces.map(Z=>{let A=Z.anchoredLocator.locatorHash,ne=i.get(A);if(typeof ne=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,cd(ne)]})),S=()=>{let Z=K.mktempSync(),A=k.join(Z,"stacktrace.log"),ne=String(g.length+1).length,le=g.map((Ae,T)=>`${`${T+1}.`.padStart(ne," ")} ${Ps(Ae)}
|
|||
|
`).join("");throw K.writeFileSync(A,le),K.detachTemp(Z),new ct($.STACK_OVERFLOW_RESOLUTION,`Encountered a stack overflow when resolving peer dependencies; cf ${j.fromPortablePath(A)}`)},x=Z=>{let A=r.get(Z.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let ne=i.get(A);if(!ne)throw new Error("Assertion failed: The package could not be found");return ne},M=(Z,A,ne,{top:le,optional:Ae})=>{g.length>1e3&&S(),g.push(A);let T=Y(Z,A,ne,{top:le,optional:Ae});return g.pop(),T},Y=(Z,A,ne,{top:le,optional:Ae})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),Ae||s.delete(A.locatorHash);let T=i.get(A.locatorHash);if(!T){if(c)return;throw new Error(`Assertion failed: The package (${Bt(t.configuration,A)}) should have been registered`)}let L=[],Ee=[],we=[],qe=[],re=[];for(let Qe of Array.from(T.dependencies.values())){if(T.peerDependencies.has(Qe.identHash)&&T.locatorHash!==le)continue;if(il(Qe))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");a.delete(Qe.descriptorHash);let he=Ae;if(!he){let be=T.dependenciesMeta.get(Ot(Qe));if(typeof be!="undefined"){let ce=be.get(null);typeof ce!="undefined"&&ce.optional&&(he=!0)}}let Fe=r.get(Qe.descriptorHash);if(!Fe){if(c)continue;throw new Error(`Assertion failed: The resolution (${sr(t.configuration,Qe)}) should have been registered`)}let Ue=Q.get(Fe)||i.get(Fe);if(!Ue)throw new Error(`Assertion failed: The package (${Fe}, resolved from ${sr(t.configuration,Qe)}) should have been registered`);if(Ue.peerDependencies.size===0){M(Qe,Ue,new Map,{top:le,optional:he});continue}let xe,ve,pe=new Set,X;Ee.push(()=>{xe=sx(Qe,A.locatorHash),ve=ox(Ue,A.locatorHash),T.dependencies.delete(Qe.identHash),T.dependencies.set(xe.identHash,xe),r.set(xe.descriptorHash,ve.locatorHash),e.set(xe.descriptorHash,xe),i.set(ve.locatorHash,ve),L.push([Ue,xe,ve])}),we.push(()=>{var be;X=new Map;for(let ce of ve.peerDependencies.values()){let fe=T.dependencies.get(ce.identHash);if(!fe&&fd(A,ce)&&(Z.identHash===A.identHash?fe=Z:(fe=rr(A,Z.range),e.set(fe.descriptorHash,fe),r.set(fe.descriptorHash,A.locatorHash),a.delete(fe.descriptorHash))),(!fe||fe.range==="missing:")&&ve.dependencies.has(ce.identHash)){ve.peerDependencies.delete(ce.identHash);continue}fe||(fe=rr(ce,"missing:")),ve.dependencies.set(fe.identHash,fe),il(fe)&&kc(p,fe.descriptorHash).add(ve.locatorHash),f.set(fe.identHash,fe),fe.range==="missing:"&&pe.add(fe.identHash),X.set(ce.identHash,(be=ne.get(ce.identHash))!=null?be:ve.locatorHash)}ve.dependencies=new Map(xn(ve.dependencies,([ce,fe])=>Ot(fe)))}),qe.push(()=>{if(!i.has(ve.locatorHash))return;let be=u.get(Ue.locatorHash);typeof be=="number"&&be>=2&&S();let ce=u.get(Ue.locatorHash),fe=typeof ce!="undefined"?ce+1:1;u.set(Ue.locatorHash,fe),M(xe,ve,X,{top:le,optional:he}),u.set(Ue.locatorHash,fe-1)}),re.push(()=>{let be=T.dependencies.get(Qe.identHash);if(typeof be=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let ce=r.get(be.descriptorHash);if(typeof ce=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(kc(y,ce).add(A.locatorHash),!!i.has(ve.locatorHash)){for(let fe of ve.peerDependencies.values()){let gt=X.get(fe.identHash);if(typeof gt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");kg(xg(m,gt),Ot(fe)).push(ve.locatorHash)}for(let fe of pe)ve.dependencies.delete(fe)}})}for(let Qe of[...Ee,...we])Qe();let se;do{se=!0;for(let[Qe,he,Fe]of L){let Ue=xg(h,Qe.locatorHash),xe=ln(...[...Fe.dependencies.values()].map(be=>{let ce=be.range!=="missing:"?r.get(be.descriptorHash):"missing:";if(typeof ce=="undefined")throw new Error(`Assertion failed: Expected the resolution for ${sr(t.configuration,be)} to have been registered`);return ce===le?`${ce} (top)`:ce}),he.identHash),ve=Ue.get(xe);if(typeof ve=="undefined"){Ue.set(xe,he);continue}if(ve===he)continue;i.delete(Fe.locatorHash),e.delete(he.descriptorHash),r.delete(he.
|
|||
|
Try running the command again with the package name prefixed: ${ae.pretty(e,"yarn add",Di.CODE)} ${ae.pretty(e,P.makeDescriptor(P.makeIdent(null,"my-package"),`${S[0]}...`),Di.DESCRIPTOR)}`);if(!Q)throw new Pe(`The ${ae.pretty(e,y,Di.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let x=xJe(i,Q,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional}),M=await tm(Q,{project:r,workspace:i,cache:n,target:x,modifier:o,strategies:a,maxResults:l});return[Q,M,x]})),u=await uA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[Q,{suggestions:S,rejections:x}]of c)if(S.filter(Y=>Y.descriptor!==null).length===0){let[Y]=x;if(typeof Y=="undefined")throw new Error("Assertion failed: Expected an error to have been set");r.configuration.get("enableNetwork")?y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range`):y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),y.reportSeparator(),y.reportExceptionOnce(Y)}});if(u.hasErrors())return u.exitCode();let g=!1,f=[],h=[];for(let[,{suggestions:y},Q]of c){let S,x=y.filter(J=>J.descriptor!==null),M=x[0].descriptor,Y=x.every(J=>P.areDescriptorsEqual(J.descriptor,M));x.length===1||Y?S=M:(g=!0,{answer:S}=await(0,Fse.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:y.map(({descriptor:J,name:W,reason:ee})=>J?{name:W,hint:ee,descriptor:J}:{name:W,hint:ee,disabled:!0}),onCancel:()=>process.exit(130),result(J){return this.find(J,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let U=i.manifest[Q].get(S.identHash);(typeof U=="undefined"||U.descriptorHash!==S.descriptorHash)&&(i.manifest[Q].set(S.identHash,S),this.optional&&(Q==="dependencies"?i.manifest.ensureDependencyMeta(te(N({},S),{range:"unknown"})).optional=!0:Q==="peerDependencies"&&(i.manifest.ensurePeerDependencyMeta(te(N({},S),{range:"unknown"})).optional=!0)),typeof U=="undefined"?f.push([i,Q,S,a]):h.push([i,Q,U,S]))}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyAddition,f),await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),g&&this.context.stdout.write(`
|
|||
|
`),(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async y=>{await r.install({cache:n,report:y,mode:this.mode})})).exitCode()}};rm.paths=[["add"]],rm.usage=Re.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 later 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 lo
|
|||
|
`),0}return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Zt.getPackageAccessibleBinaries(i,{project:r}),l=Array.from(o.keys()).reduce((c,u)=>Math.max(c,u.length),0);for(let[c,[u,g]]of o)s.reportJson({name:c,source:P.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")} ${P.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};im.paths=[["bin"]],im.usage=Re.Usage({description:"get the path to a binary script",details:`
|
|||
|
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 Lse=im;var nm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r=await Nt.find(e);return(await Je.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&r.mirrorCwd!==null,s=!this.mirror;n&&(await K.removePromise(r.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await K.removePromise(r.cwd)})).exitCode()}};nm.paths=[["cache","clean"],["cache","clear"]],nm.usage=Re.Usage({description:"remove the shared cache files",details:`
|
|||
|
This command will remove all the files from the cache.
|
|||
|
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var Tse=nm;var Ose=ge(k0()),RN=ge(require("util")),sm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(r)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${r}"`);let s=e.getSpecial(r,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=Se.convertMapsToIndexableObjects(s),a=i?(0,Ose.default)(o,i):o,l=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async c=>{c.reportJson(a)});if(!this.json){if(typeof a=="string")return this.context.stdout.write(`${a}
|
|||
|
`),l.exitCode();RN.inspect.styles.name="cyan",this.context.stdout.write(`${(0,RN.inspect)(a,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}
|
|||
|
`)}return l.exitCode()}};sm.paths=[["config","get"]],sm.usage=Re.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 Mse=sm;var Voe=ge(MN()),Xoe=ge(k0()),Zoe=ge(_oe()),UN=ge(require("util")),am=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);if(i==="enableStrictSettings")throw new Pe("This setting only affects the file it's in, and thus cannot be set from the CLI");let o=this.json?JSON.parse(this.value):this.value;await(this.home?h=>ye.updateHomeConfiguration(h):h=>ye.updateConfiguration(r(),h))(h=>{if(n){let p=(0,Voe.default)(h);return(0,Zoe.default)(p,this.name,o),p}else return te(N({},h),{[i]:o})});let c=(await ye.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=Se.convertMapsToIndexableObjects(c),g=n?(0,Xoe.default)(u,n):u;return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async h=>{UN.inspect.styles.name="cyan",h.reportInfo($.UNNAMED,`Successfully set ${this.name} to ${(0,UN.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};am.paths=[["config","set"]],am.usage=Re.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 $oe=am;var Aae=ge(MN()),lae=ge(SC()),cae=ge(aae()),Am=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);let o=this.home?l=>ye.updateHomeConfiguration(l):l=>ye.updateConfiguration(r(),l);return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{let c=!1;await o(u=>{if(!(0,lae.default)(u,this.name))return l.reportWarning($.UNNAMED,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),c=!0,u;let g=n?(0,Aae.default)(u):N({},u);return(0,cae.default)(g,this.name),g}),c||l.reportInfo($.UNNAMED,`Successfully unset ${this.name}`)})).exitCode()}};Am.paths=[["config","unset"]],Am.usage=Re.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 uae=Am;var KN=ge(require("util")),lm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{if(e.invalid.size>0&&!this.json){for(let[n,s]of e.invalid)i.reportError($.INVALID_CONFIGURATION_KEY,`Invalid configuration key "${n}" in ${s}`);i.reportSeparator()}if(this.json){let n=Se.sortMap(e.settings.keys(),s=>s);for(let s of n){let o=e.settings.get(s),a=e.getSpecial(s,{hideSecrets:!0,getNativePaths:!0}),l=e.sources.get(s);this.verbose?i.reportJson({key:s,effective:a,source:l}):i.reportJson(N({key:s,effective:a,source:l},o))}}else{let n=Se.sortMap(e.settings.keys(),a=>a),s=n.reduce((a,l)=>Math.max(a,l.length),0),o={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let a=n.map(c=>{let u=e.settings.get(c);if(!u)throw new Error(`Assertion failed: This settings ("${c}") should have been registered`);let g=this.why?e.sources.get(c)||"<default>":u.description;return[c,g]}),l=a.reduce((c,[,u])=>Math.max(c,u.length),0);for(let[c,u]of a)i.reportInfo(null,`${c.padEnd(s," ")} ${u.padEnd(l," ")} ${(0,KN.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")} ${(0,KN.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};lm.paths=[["config"]],lm.usage=Re.Usage({description:"display the current configuration",details:`
|
|||
|
This command prints the current active configuration settings.
|
|||
|
`,examples:[["Print the active configuration settings","$0 config"]]});var gae=lm;Es();var HN={};ft(HN,{Strategy:()=>Iu,acceptedStrategies:()=>R8e,dedupe:()=>jN});var fae=ge(ts()),Iu;(function(e){e.HIGHEST="highest"})(Iu||(Iu={}));var R8e=new Set(Object.values(Iu)),F8e={highest:async(t,e,{resolver:r,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of t.storedResolutions){let c=t.storedDescriptors.get(a);if(typeof c=="undefined")throw new Error(`Assertion failed: The descriptor (${a}) should have been registered`);Se.getSetWithDefault(o,c.identHash).add(l)}return Array.from(t.storedDescriptors.values(),async a=>{if(e.length&&!fae.default.isMatch(P.stringifyIdent(a),e))return null;let l=t.storedResolutions.get(a.descriptorHash);if(typeof l=="undefined")throw new Error(`Assertion failed: The resolution (${a.descriptorHash}) should have been registered`);let c=t.originalPackages.get(l);if(typeof c=="undefined"||!r.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u=="undefined")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 Q=t.originalPackages.get(y);if(typeof Q=="undefined")throw new Error(`Assertion failed: The package (${y}) should have been registered`);return Q.reference}),f=await r.getSatisfying(a,g,n),h=f==null?void 0:f[0];if(typeof h=="undefined")return null;let p=h.locatorHash,m=t.originalPackages.get(p);if(typeof m=="undefined")throw new Error(`Assertion failed: The package (${p}) should have been registered`);return p===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function jN(t,{strategy:e,patterns:r,cache:i,report:n}){let{configuration:s}=t,o=new pi,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:t.storedChecksums,fetcher:l,project:t,report:o,skipIntegrityCheck:!0,cacheOptions:{skipIntegrityCheck:!0}},u={project:t,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let f=await F8e[e](t,r,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),h=Ji.progressViaCounter(f.length);n.reportProgress(h);let p=0;await Promise.all(f.map(Q=>Q.then(S=>{if(S===null)return;p++;let{descriptor:x,currentPackage:M,updatedPackage:Y}=S;n.reportInfo($.UNNAMED,`${P.prettyDescriptor(s,x)} can be deduped from ${P.prettyLocator(s,M)} to ${P.prettyLocator(s,Y)}`),n.reportJson({descriptor:P.stringifyDescriptor(x),currentResolution:P.stringifyLocator(M),updatedResolution:P.stringifyLocator(Y)}),t.storedResolutions.set(x.descriptorHash,Y.locatorHash)}).finally(()=>h.tick())));let m;switch(p){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${p} packages`}let y=ae.pretty(s,e,ae.Type.CODE);return n.reportInfo($.UNNAMED,`${m} can be deduped using the ${y} strategy`),p})}var cm=class extends Le{constructor(){super(...arguments);this.strategy=z.String("-s,--strategy",Iu.HIGHEST,{description:"The strategy to use when deduping dependencies",validator:nn(Iu)});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:nn(di)});this.patterns=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r}=await ze.find(e,this.context.cwd),i=await Nt.find(e);await r.restoreInstallState({restoreResolutions:!1});let n=0,s=await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout,json:this.json},async o=>{n=await jN(r,{strategy:this.strategy,patterns:this.patterns,cache:i,report:o})});return s.hasErrors()?s.exitCode():this.check?n?1:0:(await Je.start({configuration:e,stdout:this.context.stdout,json:this.json},async a=>{await r.install({cache:i,report:a,mode:this.mode})})).exitCode()}};cm.paths=[["dedupe"]],cm.usage=Re.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\
|
|||
|
`)}};ib.paths=[["--clipanion=definitions"]];var Cae=ib;var nb=class extends Le{async execute(){this.context.stdout.write(this.cli.usage(null))}};nb.paths=[["help"],["--help"],["-h"]];var mae=nb;var GN=class extends Le{constructor(){super(...arguments);this.leadingArgument=z.String();this.args=z.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!P.tryParseIdent(this.leadingArgument)){let e=k.resolve(this.context.cwd,j.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:e})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}},Eae=GN;var sb=class extends Le{async execute(){this.context.stdout.write(`${Ur||"<unknown>"}
|
|||
|
`)}};sb.paths=[["-v"],["--version"]];var Iae=sb;var um=class extends Le{constructor(){super(...arguments);this.commandName=z.String();this.args=z.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,locator:i}=await ze.find(e,this.context.cwd);return await r.restoreInstallState(),await Zt.executePackageShellcode(i,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:r})}};um.paths=[["exec"]],um.usage=Re.Usage({description:"execute a shell script",details:`
|
|||
|
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).
|
|||
|
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});var yae=um;Es();var gm=class extends Le{constructor(){super(...arguments);this.hash=z.String({required:!1,validator:fp(gp(),[hp(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r}=await ze.find(e,this.context.cwd);return await r.restoreInstallState({restoreResolutions:!1}),await r.applyLightResolution(),typeof this.hash!="undefined"?await N8e(this.hash,r,{stdout:this.context.stdout}):(await Je.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>P.stringifyLocator(r.storedPackages.get(a.subject)),([,a])=>P.stringifyIdent(a.requested)];for(let[a,l]of Se.sortMap(r.peerRequirements,s)){let c=r.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=r.storedPackages.get(l.rootRequester);if(typeof u=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let g=(o=c.dependencies.get(l.requested.identHash))!=null?o:null,f=ae.pretty(e,a,ae.Type.CODE),h=P.prettyLocator(e,c),p=P.prettyIdent(e,l.requested),m=P.prettyIdent(e,u),y=l.allRequesters.length-1,Q=`descendant${y===1?"":"s"}`,S=y>0?` and ${y} ${Q}`:"",x=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${f} \u2192 ${h} ${x} ${p} to ${m}${S}`)}})).exitCode()}};gm.paths=[["explain","peer-requirements"]],gm.usage=Re.Usage({description:"explain a set of peer requirements",details:`
|
|||
|
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\`).
|
|||
|
`,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"]]});var wae=gm;async function N8e(t,e,r){let{configuration:i}=e,n=e.peerRequirements.get(t);if(typeof n=="undefined")throw new Error(`No peerDependency requirements found for hash: "${t}"`);return(await Je.start({configuration:i,stdout:r.stdout,includeFooter:!1},async o=>{var Q,S;let a=e.storedPackages.get(n.subject);if(typeof a=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let l=e.storedPackages.get(n.rootRequester);if(typeof l=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let c=(Q=a.dependencies.get(n.requested.identHash))!=null?Q:null,u=c!==null?e.storedResolutions.get(c.descriptorHash):null;if(typeof u=="undefined")throw new Error("Assertion failed: Expected the resolution to have been registered");let g=u!==null?e.storedPackages.get(u):null;if(typeof g=="undefined")throw new Error("Assertion failed: Expected the provided package to have been registered");let f=[...n.allRequesters.values()].map(x=>{let M=e.storedPackages.get(x);if(typeof M=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let Y=P.devirtualizeLocator(M),U=e.storedPackages.get(Y.locatorHash);if(typeof U=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let J=U.peerDependencies.get(n.requested.identHash);if(typeof J=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:M,peerDependency:J}});if(g!==null){let x=f.every(({peerDependency:M})=>Wt.satisfiesWithPrereleases(g.version,M.range));o.reportInfo($.UNNAMED,`${P.prettyLocator(i,a)} provides ${P.prettyLocator(i,g)} with version ${P.prettyReference(i,(S=g.version)!=null?S:"<missing>")}, which ${x?"satisfies":"doesn't satisfy"} the following requirements:`)}else o.reportInfo($.UNNAMED,`${P.prettyLocator(i,a)} doesn't provide ${P.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let h=ae.mark(i),p=[];for(let{pkg:x,peerDependency:M}of Se.sortMap(f,Y=>P.stringifyLocator(Y.pkg))){let U=(g!==null?Wt.satisfiesWithPrereleases(g.version,M.range):!1)?h.Check:h.Cross;p.push({stringifiedLocator:P.stringifyLocator(x),prettyLocator:P.prettyLocator(i,x),prettyRange:P.prettyRange(i,M.range),mark:U})}let m=Math.max(...p.map(({stringifiedLocator:x})=>x.length)),y=Math.max(...p.map(({prettyRange:x})=>x.length));for(let{stringifiedLocator:x,prettyLocator:M,prettyRange:Y,mark:U}of Se.sortMap(p,({stringifiedLocator:J})=>J))o.reportInfo(null,`${M.padEnd(m+(M.length-x.length)," ")} \u2192 ${Y.padEnd(y," ")} ${U}`);p.length>1&&(o.reportSeparator(),o.reportInfo($.UNNAMED,`Note: these requirements start with ${P.prettyLocator(e.configuration,l)}`))})).exitCode()}Es();var Bae=ge(ti()),fm=class extends Le{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(){let e=await ye.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let r=()=>{if(typeof Ur=="undefined")throw new Pe("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},i;if(this.version==="self")i=r();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")i=`https://repo.yarnpkg.com/${await hm(e,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")i=`https://repo.yarnpkg.com/${await hm(e,"canary")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="classic")i="https://nightly.yarnpkg.com/latest.js";else if(this.version.match(/^https?:/))i=this.version;else if(this.version.match(/^\.{0,2}[\\/]/)||j.isAbsolute(this.version))i=`file://${j.resolve(this.version)}`;else if(Wt.satisfiesWithPrereleases(this.version,">=
|
|||
|
${e}`)});let n=(g=t.projectCwd)!=null?g:t.startingCwd,s=k.resolve(n,".yarn/releases"),o=k.resolve(s,`yarn-${e}.cjs`),a=k.relative(t.startingCwd,o),l=k.relative(n,o),c=t.get("yarnPath"),u=c===null||c.startsWith(`${s}/`);if(i.reportInfo($.UNNAMED,`Saving the new release in ${ae.pretty(t,a,"magenta")}`),await K.removePromise(k.dirname(o)),await K.mkdirPromise(k.dirname(o),{recursive:!0}),await K.writeFilePromise(o,r,{mode:493}),u){await ye.updateConfiguration(n,{yarnPath:l});let f=await At.tryFind(n)||new At;f.packageManager=`yarn@${e&&Se.isTaggedYarnVersion(e)?e:await hm(t,"stable")}`;let h={};f.exportTo(h);let p=k.join(n,At.fileName),m=`${JSON.stringify(h,null,f.indent)}
|
|||
|
`;await K.changeFilePromise(p,m,{automaticNewlines:!0})}}function Qae(t){return $[BI(t)]}var T8e=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function O8e(t){let r=`https://repo.yarnpkg.com/${Se.isTaggedYarnVersion(Ur)?Ur:await hm(t,"canary")}/packages/gatsby/content/advanced/error-codes.md`,i=await ir.get(r,{configuration:t});return new Map(Array.from(i.toString().matchAll(T8e),({groups:n})=>{if(!n)throw new Error("Assertion failed: Expected the match to have been successful");let s=Qae(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 pm=class extends Le{constructor(){super(...arguments);this.code=z.String({required:!1,validator:fp(gp(),[hp(/^YN[0-9]{4}$/)])});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(typeof this.code!="undefined"){let r=Qae(this.code),i=ae.pretty(e,r,ae.Type.CODE),n=this.cli.format().header(`${this.code} - ${i}`),o=(await O8e(e)).get(this.code),a=typeof o!="undefined"?ae.jsonOrPretty(this.json,e,ae.tuple(ae.Type.MARKDOWN,{text:o,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
|
|||
|
|
|||
|
You can help us by editing this page on GitHub \u{1F642}:
|
|||
|
${ae.jsonOrPretty(this.json,e,ae.tuple(ae.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:r,details:a})}
|
|||
|
`):this.context.stdout.write(`${n}
|
|||
|
|
|||
|
${a}
|
|||
|
`)}else{let r={children:Se.mapAndFilter(Object.entries($),([i,n])=>Number.isNaN(Number(i))?Se.mapAndFilter.skip:{label:YA(Number(i)),value:ae.tuple(ae.Type.CODE,n)})};as.emitTree(r,{configuration:e,stdout:this.context.stdout,json:this.json})}}};pm.paths=[["explain"]],pm.usage=Re.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.
|
|||
|
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});var vae=pm;var Sae=ge(ts()),dm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i&&!this.all)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState();let s=new Set(this.extra);this.cache&&s.add("cache"),this.dependents&&s.add("dependents"),this.manifest&&s.add("manifest");let o=(x,{recursive:M})=>{let Y=x.anchoredLocator.locatorHash,U=new Map,J=[Y];for(;J.length>0;){let W=J.shift();if(U.has(W))continue;let ee=r.storedPackages.get(W);if(typeof ee=="undefined")throw new Error("Assertion failed: Expected the package to be registered");if(U.set(W,ee),P.isVirtualLocator(ee)&&J.push(P.devirtualizeLocator(ee).locatorHash),!(!M&&W!==Y))for(let Z of ee.dependencies.values()){let A=r.storedResolutions.get(Z.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");J.push(A)}}return U.values()},a=({recursive:x})=>{let M=new Map;for(let Y of r.workspaces)for(let U of o(Y,{recursive:x}))M.set(U.locatorHash,U);return M.values()},l=({all:x,recursive:M})=>x&&M?r.storedPackages.values():x?a({recursive:M}):o(i,{recursive:M}),c=({all:x,recursive:M})=>{let Y=l({all:x,recursive:M}),U=this.patterns.map(ee=>{let Z=P.parseLocator(ee),A=Sae.default.makeRe(P.stringifyIdent(Z)),ne=P.isVirtualLocator(Z),le=ne?P.devirtualizeLocator(Z):Z;return Ae=>{let T=P.stringifyIdent(Ae);if(!A.test(T))return!1;if(Z.reference==="unknown")return!0;let L=P.isVirtualLocator(Ae),Ee=L?P.devirtualizeLocator(Ae):Ae;return!(ne&&L&&Z.reference!==Ae.reference||le.reference!==Ee.reference)}}),J=Se.sortMap([...Y],ee=>P.stringifyLocator(ee));return{selection:J.filter(ee=>U.length===0||U.some(Z=>Z(ee))),sortedLookup:J}},{selection:u,sortedLookup:g}=c({all:this.all,recursive:this.recursive});if(u.length===0)throw new Pe("No package matched your request");let f=new Map;if(this.dependents)for(let x of g)for(let M of x.dependencies.values()){let Y=r.storedResolutions.get(M.descriptorHash);if(typeof Y=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");Se.getArrayWithDefault(f,Y).push(x)}let h=new Map;for(let x of g){if(!P.isVirtualLocator(x))continue;let M=P.devirtualizeLocator(x);Se.getArrayWithDefault(h,M.locatorHash).push(x)}let p={},m={children:p},y=e.makeFetcher(),Q={project:r,fetcher:y,cache:n,checksums:r.storedChecksums,report:new pi,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},S=[async(x,M,Y)=>{var W,ee;if(!M.has("manifest"))return;let U=await y.fetch(x,Q),J;try{J=await At.find(U.prefixPath,{baseFs:U.packageFs})}finally{(W=U.releaseFs)==null||W.call(U)}Y("Manifest",{License:ae.tuple(ae.Type.NO_HINT,J.license),Homepage:ae.tuple(ae.Type.URL,(ee=J.raw.homepage)!=null?ee:null)})},async(x,M,Y)=>{var A;if(!M.has("cache"))return;let U={mockedPackages:r.disabledLocators,unstablePackages:r.condit
|
|||
|
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 later 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.
|
|||
|
`,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 xae=Cm,U8e="|||||||",K8e=">>>>>>>",H8e="=======",Pae="<<<<<<<";async function M8e(t,e){if(!t.projectCwd)return!1;let r=k.join(t.projectCwd,t.get("lockfileFilename"));if(!await K.existsPromise(r))return!1;let i=await K.readFilePromise(r,"utf8");if(!i.includes(Pae))return!1;if(e)throw new ct($.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=j8e(i),o,a;try{o=Qi(n),a=Qi(s)}catch(c){throw new ct($.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=N(N({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await K.changeFilePromise(r,Na(l),{automaticNewlines:!0}),!0}function j8e(t){let e=[[],[]],r=t.split(/\r?\n/g),i=!1;for(;r.length>0;){let n=r.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(Pae)){for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===H8e){i=!1;break}else if(i||s.startsWith(U8e)){i=!0;continue}else e[0].push(s)}for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(K8e))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
|
|||
|
`),e[1].join(`
|
|||
|
`)]}var mm=class extends Le{constructor(){super(...arguments);this.all=z.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=z.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=z.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=k.resolve(this.context.cwd,j.toPortablePath(this.destination)),o=await ye.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await ze.find(o,s);if(r.cwd===a.cwd)throw new Pe("Invalid destination; Can't link the project to itself");if(!l)throw new ht(a.cwd,s);let c=r.topLevelWorkspace,u=[];if(this.all){for(let f of a.workspaces)f.manifest.name&&(!f.manifest.private||this.private)&&u.push(f);if(u.length===0)throw new Pe("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new Pe("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let f of u){let h=P.stringifyIdent(f.locator),p=this.relative?k.relative(r.cwd,f.cwd):f.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${p}`})}return(await Je.start({configuration:e,stdout:this.context.stdout},async f=>{await r.install({cache:n,report:f})})).exitCode()}};mm.paths=[["link"]],mm.usage=Re.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 a remote workspace for use in the current project","$0 link ~/ts-loader"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var Dae=mm;var Em=class extends Le{constructor(){super(...arguments);this.args=z.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};Em.paths=[["node"]],Em.usage=Re.Usage({description:"run node with the hook already setup",details:`
|
|||
|
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.
|
|||
|
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Rae=Em;var Hae=ge(require("os"));var Nae=ge(require("os"));var G8e="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function yu(t){let e=await ir.get(G8e,{configuration:t});return Qi(e.toString())}var Im=class extends Le{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await yu(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=Tr(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(N({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};Im.paths=[["plugin","list"]],Im.usage=Re.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 Fae=Im;var Y8e=/^[0-9]+$/;function Lae(t){return Y8e.test(t)?`pull/${t}/head`:t}var q8e=({repository:t,branch:e},r)=>[["git","init",j.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin","--depth=1",Lae(e)],["git","reset","--hard","FETCH_HEAD"]],J8e=({branch:t})=>[["git","fetch","origin","--depth=1",Lae(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],W8e=({plugins:t,noMinify:e},r)=>[["yarn","build:cli",...new Array().concat(...t.map(i=>["--plugin",k.resolve(r,i)])),...e?["--no-minify"]:[],"|"]],ym=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r}=await ze.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,j.toPortablePath(this.installPath)):k.resolve(j.toPortablePath((0,Nae.tmpdir)()),"yarnpkg-sources",Dn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{await JN(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo($.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await wm(W8e(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=k.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await K.readFilePromise(o);await YN(e,"sources",a,{report:s}),this.skipPlugins||await z8e(this,{project:r,report:s,target:i})})).exitCode()}};ym.paths=[["set","version","from","sources"]],ym.usage=Re.Usage({description:"build Yarn from master",details:`
|
|||
|
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"]]});var Tae=ym;async function wm(t,{configuration:e,context:r,target:i}){for(let[n,...s]of t){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await Fr.pipevp(n,s,{cwd:i,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ae.pretty(e,` $ ${[n,...s].join(" ")}`,"grey")}
|
|||
|
`);try{await Fr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw r.stdout.write(a.stdout||a.stack),a}}}}async function JN(t,{configuration:e,report:r,target:i}){let n=!1;if(!t.force&&K.existsSync(k.join(i,".git"))){r.reportInfo($.UNNAMED,"Fetching the latest commits"),r.reportSeparator();try{await wm(J8e(t),{configuration:e,context:t.context,target:i}),n=!0}catch(s){r.reportSeparator(),r.reportWarning($.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(r.reportInfo($.UNNAMED,"Cloning the remote repository"),r.reportSeparator(),await K.removePromise(i),await K.mkdirPromise(i,{recursive:!0}),await wm(q8e(t,i),{configuration:e,context:t.context,target:i}))}async function z8e(t,{project:e,report:r,target:i}){let n=await yu(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await qN(o,t,{project:e,report:r,target:i})}var Oae=ge(ti()),Mae=ge(require("url")),Uae=ge(require("vm"));var Bm=class extends Le{constructor(){super(...arguments);this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await ze.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||j.isAbsolute(this.name)){let a=k.resolve(this.context.cwd,j.toPortablePath(this.name));i.reportInfo($.UNNAMED,`Reading ${ae.pretty(e,a,ae.Type.PATH)}`),s=k.relative(n.cwd,a),o=await K.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new Mae.URL(this.name)}catch{throw new ct($.INVALID_PLUGIN_REFERENCE,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}s=this.name,a=this.name}else{let l=P.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!Oae.default.valid(l.reference))throw new ct($.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=P.stringifyIdent(l),u=await yu(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new ct($.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${c}" 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).`);s=c,a=u[c].url,l.reference!=="unknown"?a=a.replace(/\/master\//,`/${c}/${l.reference}/`):Ur!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Ur}/`))}i.reportInfo($.UNNAMED,`Downloading ${ae.pretty(e,a,"green")}`),o=await ir.get(a,{configuration:e})}await WN(s,o,{project:n,report:i})})).exitCode()}};Bm.paths=[["plugin","import"]],Bm.usage=Re.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
|
|||
|
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).
|
|||
|
`,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"]]});var Kae=Bm;async function WN(t,e,{project:r,report:i}){let{configuration:n}=r,s={},o={exports:s};(0,Uae.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=k.resolve(r.cwd,l);i.reportInfo($.UNNAMED,`Saving the new plugin in ${ae.pretty(n,l,"magenta")}`),await K.mkdirPromise(k.dirname(c),{recursive:!0}),await K.writeFilePromise(c,e);let u={path:l,spec:t};await ye.updateConfiguration(r.cwd,g=>{let f=[],h=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,y=k.resolve(r.cwd,j.toPortablePath(m)),{name:Q}=Se.dynamicRequire(y);Q!==a?f.push(p):(f.push(u),h=!0)}return h||f.push(u),te(N({},g),{plugins:f})})}var _8e=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],bm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,j.toPortablePath(this.installPath)):k.resolve(j.toPortablePath((0,Hae.tmpdir)()),"yarnpkg-sources",Dn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await ze.find(e,this.context.cwd),o=P.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=P.stringifyIdent(o),l=await yu(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new ct($.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${a}" 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 c=a;await JN(this,{configuration:e,report:n,target:r}),await qN(c,this,{project:s,report:n,target:r})})).exitCode()}};bm.paths=[["plugin","import","from","sources"]],bm.usage=Re.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
|
|||
|
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.
|
|||
|
`,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"]]});var jae=bm;async function qN(t,{context:e,noMinify:r},{project:i,report:n,target:s}){let o=t.replace(/@yarnpkg\//,""),{configuration:a}=i;n.reportSeparator(),n.reportInfo($.UNNAMED,`Building a fresh ${o}`),n.reportSeparator(),await wm(_8e({pluginName:o,noMinify:r},s),{configuration:a,context:e,target:s}),n.reportSeparator();let l=k.resolve(s,`packages/${o}/bundles/${t}.js`),c=await K.readFilePromise(l);await WN(t,c,{project:i,report:n})}var Qm=class extends Le{constructor(){super(...arguments);this.name=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r}=await ze.find(e,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=this.name,o=P.parseIdent(s);if(!e.plugins.has(s))throw new Pe(`${P.prettyIdent(e,o)} isn't referenced by the current configuration`);let a=`.yarn/plugins/${s}.cjs`,l=k.resolve(r.cwd,a);K.existsSync(l)&&(n.reportInfo($.UNNAMED,`Removing ${ae.pretty(e,a,ae.Type.PATH)}...`),await K.removePromise(l)),n.reportInfo($.UNNAMED,"Updating the configuration..."),await ye.updateConfiguration(r.cwd,c=>{if(!Array.isArray(c.plugins))return c;let u=c.plugins.filter(g=>g.path!==a);return c.plugins.length===u.length?c:te(N({},c),{plugins:u})})})).exitCode()}};Qm.paths=[["plugin","remove"]],Qm.usage=Re.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
|
|||
|
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 Gae=Qm;var vm=class extends Le{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{for(let n of e.plugins.keys()){let s=this.context.plugins.plugins.has(n),o=n;s&&(o+=" [builtin]"),i.reportJson({name:n,builtin:s}),i.reportInfo(null,`${o}`)}})).exitCode()}};vm.paths=[["plugin","runtime"]],vm.usage=Re.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.
|
|||
|
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var Yae=vm;var Sm=class extends Le{constructor(){super(...arguments);this.idents=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(P.parseIdent(a).identHash);if(await r.restoreInstallState({restoreResolutions:!1}),await r.resolveEverything({cache:n,report:new pi}),s.size>0)for(let a of r.storedPackages.values())s.has(a.identHash)&&r.storedBuildState.delete(a.locatorHash);else r.storedBuildState.clear();return(await Je.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await r.install({cache:n,report:a})})).exitCode()}};Sm.paths=[["rebuild"]],Sm.usage=Re.Usage({description:"rebuild the project's native packages",details:`
|
|||
|
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.
|
|||
|
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var qae=Sm;var zN=ge(ts());Es();var km=class extends Le{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:nn(di)});this.patterns=z.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=this.all?r.workspaces:[i],o=[Hr.REGULAR,Hr.DEVELOPMENT,Hr.PEER],a=[],l=!1,c=[];for(let h of this.patterns){let p=!1,m=P.parseIdent(h);for(let y of s){let Q=[...y.manifest.peerDependenciesMeta.keys()];for(let S of(0,zN.default)(Q,h))y.manifest.peerDependenciesMeta.delete(S),l=!0,p=!0;for(let S of o){let x=y.manifest.getForScope(S),M=[...x.values()].map(Y=>P.stringifyIdent(Y));for(let Y of(0,zN.default)(M,P.stringifyIdent(m))){let{identHash:U}=P.parseIdent(Y),J=x.get(U);if(typeof J=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");y.manifest[S].delete(U),c.push([y,S,J]),l=!0,p=!0}}}p||a.push(h)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",f=this.all?"any":"this";if(a.length>0)throw new Pe(`${u} ${ae.prettyList(e,a,Di.CODE)} ${g} match any packages referenced by ${f} workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Je.start({configuration:e,stdout:this.context.stdout},async p=>{await r.install({cache:n,report:p,mode:this.mode})})).exitCode()):0}};km.paths=[["remove"]],km.usage=Re.Usage({description:"remove dependencies from the project",details:`
|
|||
|
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 later 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.
|
|||
|
`,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 Jae=km;var Wae=ge(require("util")),ab=class extends Le{async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(r.cwd,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=Se.sortMap(o.keys(),u=>u),l={breakLength:Infinity,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,Wae.inspect)(g,l)}`)})).exitCode()}};ab.paths=[["run"]];var zae=ab;var xm=class extends Le{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.silent=z.Boolean("--silent",{hidden:!0});this.scriptName=z.String();this.args=z.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i,locator:n}=await ze.find(e,this.context.cwd);await r.restoreInstallState();let s=this.topLevel?r.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await Zt.hasPackageScript(s,this.scriptName,{project:r}))return await Zt.executePackageScript(s,this.scriptName,this.args,{project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await Zt.getPackageAccessibleBinaries(s,{project:r});if(o.get(this.scriptName)){let l=[];return this.inspect&&(typeof this.inspect=="string"?l.push(`--inspect=${this.inspect}`):l.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?l.push(`--inspect-brk=${this.inspectBrk}`):l.push("--inspect-brk")),await Zt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:l,packageAccessibleBinaries:o})}if(!this.topLevel&&!this.binariesOnly&&i&&this.scriptName.includes(":")){let c=(await Promise.all(r.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await Zt.executeWorkspaceScript(c[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 Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}). 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 Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new Pe("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of Nf)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new Pe(`Couldn't find a script named "${this.scriptName}", but a matchin
|
|||
|
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).
|
|||
|
`,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 _ae=xm;var Pm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(await r.restoreInstallState({restoreResolutions:!1}),!i)throw new ht(r.cwd,this.context.cwd);let s=P.parseDescriptor(this.descriptor,!0),o=P.makeDescriptor(s,this.resolution);return r.storedDescriptors.set(s.descriptorHash,s),r.storedDescriptors.set(o.descriptorHash,o),r.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Pm.paths=[["set","resolution"]],Pm.usage=Re.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 Vae=Pm;var Xae=ge(ts()),Dm=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);let s=r.topLevelWorkspace,o=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:l,reference:c}of s.manifest.resolutions)c.startsWith("portal:")&&o.add(l.descriptor.fullName);if(this.leadingArguments.length>0)for(let l of this.leadingArguments){let c=k.resolve(this.context.cwd,j.toPortablePath(l));if(Se.isPathLike(l)){let u=await ye.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:f}=await ze.find(u,c);if(!f)throw new ht(g.cwd,c);if(this.all){for(let h of g.workspaces)h.manifest.name&&o.add(P.stringifyIdent(h.locator));if(o.size===0)throw new Pe("No workspace found to be unlinked in the target project")}else{if(!f.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be unlinked");o.add(P.stringifyIdent(f.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,Xae.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Dm.paths=[["unlink"]],Dm.usage=Re.Usage({description:"disconnect the local project from another one",details:`
|
|||
|
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
|
|||
|
`,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 Zae=Dm;var $ae=ge($C()),_N=ge(ts());Es();var eh=class extends Le{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:nn(di)});this.patterns=z.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=[...r.storedDescriptors.values()],o=s.map(u=>P.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(P.parseDescriptor(u).range!=="unknown")throw new Pe("Ranges aren't allowed when using --recursive");for(let g of(0,_N.default)(o,u)){let f=P.parseIdent(g);a.add(f.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)r.storedDescriptors.delete(u.descriptorHash),r.storedResolutions.delete(u.descriptorHash);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{await r.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=em(this,r),a=s?[_r.KEEP,_r.REUSE,_r.PROJECT,_r.LATEST]:[_r.PROJECT,_r.LATEST],l=[],c=[];for(let y of this.patterns){let Q=!1,S=P.parseDescriptor(y);for(let x of r.workspaces)for(let M of[Hr.REGULAR,Hr.DEVELOPMENT]){let U=[...x.manifest.getForScope(M).values()].map(J=>P.stringifyIdent(J));for(let J of(0,_N.default)(U,P.stringifyIdent(S))){let W=P.parseIdent(J),ee=x.manifest[M].get(W.identHash);if(typeof ee=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let Z=P.makeDescriptor(W,S.range);l.push(Promise.resolve().then(async()=>[x,M,ee,await tm(Z,{project:r,workspace:x,cache:n,target:M,modifier:o,strategies:a})])),Q=!0}}Q||c.push(y)}if(c.length>1)throw new Pe(`Patterns ${ae.prettyList(e,c,Di.CODE)} don't match any packages referenced by any workspace`);if(c.length>0)throw new Pe(`Pattern ${ae.prettyList(e,c,Di.CODE)} doesn't match any packages referenced by any workspace`);let u=await Promise.all(l),g=await uA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[,,Q,{suggestions:S,rejections:x}]of u){let M=S.filter(Y=>Y.descriptor!==null);if(M.length===0){let[Y]=x;if(typeof Y=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let U=this.cli.error(Y);r.configuration.get("enableNetwork")?y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range
|
|||
|
|
|||
|
${U}`):y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} can't be resolved to a satisfying range (note: network resolution has been disabled)
|
|||
|
|
|||
|
${U}`)}else M.length>1&&!s&&y.reportError($.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,Q)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(g.hasErrors())return g.exitCode();let f=!1,h=[];for(let[y,Q,,{suggestions:S}]of u){let x,M=S.filter(W=>W.descriptor!==null),Y=M[0].descriptor,U=M.every(W=>P.areDescriptorsEqual(W.descriptor,Y));M.length===1||U?x=Y:(f=!0,{answer:x}=await(0,$ae.prompt)({type:"select",name:"answer",message:`Which range to you want to use in ${P.prettyWorkspace(e,y)} \u276F ${Q}?`,choices:S.map(({descriptor:W,name:ee,reason:Z})=>W?{name:ee,hint:Z,descriptor:W}:{name:ee,hint:Z,disabled:!0}),onCancel:()=>process.exit(130),result(W){return this.find(W,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let J=y.manifest[Q].get(x.identHash);if(typeof J=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if(J.descriptorHash!==x.descriptorHash)y.manifest[Q].set(x.identHash,x),h.push([y,Q,J,x]);else{let W=e.makeResolver(),ee={project:r,resolver:W},Z=W.bindDescriptor(J,y.anchoredLocator,ee);r.forgetResolution(Z)}}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),f&&this.context.stdout.write(`
|
|||
|
`),(await Je.start({configuration:e,stdout:this.context.stdout},async y=>{await r.install({cache:n,report:y,mode:this.mode})})).exitCode()}};eh.paths=[["up"]],eh.usage=Re.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 later 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'"]]}),eh.schema=[lv("recursive",Cc.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var eAe=eh;var Rm=class extends Le{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 e=await ye.find(this.context.cwd,this.c
|
|||
|
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.
|
|||
|
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});var tAe=Rm;function V8e(t,e,{configuration:r,peers:i}){let n=Se.sortMap(t.storedPackages.values(),a=>P.stringifyLocator(a)),s={},o={children:s};for(let a of n){let l={},c=null;for(let u of a.dependencies.values()){if(!i&&a.peerDependencies.has(u.identHash))continue;let g=t.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let f=t.storedPackages.get(g);if(!f)throw new Error("Assertion failed: The package should have been registered");if(f.identHash!==e)continue;if(c===null){let p=P.stringifyLocator(a);s[p]={value:[a,ae.Type.LOCATOR],children:l}}let h=P.stringifyLocator(f);l[h]={value:[{descriptor:u,locator:f},ae.Type.DEPENDENT]}}}return o}function X8e(t,e,{configuration:r,peers:i}){let n=Se.sortMap(t.workspaces,f=>P.stringifyLocator(f.anchoredLocator)),s=new Set,o=new Set,a=f=>{if(s.has(f.locatorHash))return o.has(f.locatorHash);if(s.add(f.locatorHash),f.identHash===e)return o.add(f.locatorHash),!0;let h=!1;f.identHash===e&&(h=!0);for(let p of f.dependencies.values()){if(!i&&f.peerDependencies.has(p.identHash))continue;let m=t.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let y=t.storedPackages.get(m);if(!y)throw new Error("Assertion failed: The package should have been registered");a(y)&&(h=!0)}return h&&o.add(f.locatorHash),h};for(let f of n){let h=t.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");a(h)}let l=new Set,c={},u={children:c},g=(f,h,p)=>{if(!o.has(f.locatorHash))return;let m=p!==null?ae.tuple(ae.Type.DEPENDENT,{locator:f,descriptor:p}):ae.tuple(ae.Type.LOCATOR,f),y={},Q={value:m,children:y},S=P.stringifyLocator(f);if(h[S]=Q,!l.has(f.locatorHash)&&(l.add(f.locatorHash),!(p!==null&&t.tryWorkspaceByLocator(f))))for(let x of f.dependencies.values()){if(!i&&f.peerDependencies.has(x.identHash))continue;let M=t.storedResolutions.get(x.descriptorHash);if(!M)throw new Error("Assertion failed: The resolution should have been registered");let Y=t.storedPackages.get(M);if(!Y)throw new Error("Assertion failed: The package should have been registered");g(Y,y,x)}};for(let f of n){let h=t.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");g(h,c,null)}return u}var aL={};ft(aL,{default:()=>mze,gitUtils:()=>wu});var wu={};ft(wu,{TreeishProtocols:()=>On,clone:()=>nL,fetchBase:()=>wAe,fetchChangedFiles:()=>BAe,fetchChangedWorkspaces:()=>dze,fetchRoot:()=>yAe,isGitUrl:()=>rh,lsRemote:()=>IAe,normalizeLocator:()=>tL,normalizeRepoUrl:()=>Fm,resolveUrl:()=>iL,splitRepoUrl:()=>Nm});var $N=ge(dAe()),CAe=ge(tB()),th=ge(require("querystring")),eL=ge(ti()),mAe=ge(require("url"));function EAe(){return te(N({},process.env),{GIT_SSH_COMMAND:"ssh -o BatchMode=yes"})}var pze=[/^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\/(.+)?$/],On;(function(n){n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver"})(On||(On={}));function rh(t){return t?pze.some(e=>!!t.match(e)):!1}function Nm(t){t=Fm(t);let e=t.indexOf("#");if(e===-1)return{repo:t,treeish:{protocol:On.Head,request:"HEAD"},extra:{}};let r=t.slice(0,e),i=t.slice(e+1);if(i.match(/^[a-z]+=/)){let n=th.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof c!="string")throw new Error(`Assertion failed: The ${l} parameter must be a literal string`);let s=Object.values(On).find(l=>Object.prototype.hasOwnProperty.call(n,l)),o,a;typeof s!="undefined"?(o=s,a=n[s]):(o=On.Head,a="HEAD");for(let l of Object.values(On))delete n[l];return{repo:r,treeish:{protocol:o,request:a},extra:n}}else{let n=i.indexOf
|
|||
|
- ${a.join(`
|
|||
|
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};Tm.paths=[["workspace"]],Tm.usage=Re.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.
|
|||
|
`,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 QAe=Tm;var Eze={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:Ie.BOOLEAN,default:vAe.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:Ie.STRING,values:["^","~",""],default:ga.CARET}},commands:[Tse,Mse,$oe,uae,Vae,Tae,bae,bAe,Cae,mae,Eae,Iae,Nse,Lse,gae,hae,yae,wae,vae,kae,xae,Dae,Zae,Rae,jae,Kae,Gae,Fae,Yae,qae,Jae,zae,_ae,eAe,tAe,QAe]},Ize=Eze;var gL={};ft(gL,{default:()=>wze});var Ye={optional:!0},SAe=[["@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:Ye,zenObservable:Ye}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Ye,zenObservable:Ye}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Ye}}],["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"]:Ye,["postcss-jsx"]:Ye,["postcss-less"]:Ye,["postcss-markdown"]:Ye,["postcss-scss"]:Ye}}],["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:Ye}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Ye}}],["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@*",{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:Ye,"vue-template-compiler":Ye}}],["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:Ye,"utf-8-validate":Ye}}],["react-portal@*",{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:{["cross-spawn"]:"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-f
|
|||
|
`),await K.writeFilePromise(k.join(r,"yarn.lock"),"");let i=k.join(r,".yarnrc.yml"),n=await ye.findProjectCwd(this.context.cwd,Pt.lockfile),s=!(await ye.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),o=n!==null?k.join(n,".yarnrc.yml"):null;o!==null&&K.existsSync(o)?(await K.copyFilePromise(o,i),await ye.updateConfiguration(r,m=>{let y=te(N({},m),{enableGlobalCache:s,enableTelemetry:!1});return Array.isArray(m.plugins)&&(y.plugins=m.plugins.map(Q=>{let S=typeof Q=="string"?Q:Q.path,x=j.isAbsolute(S)?S:j.resolve(j.fromPortablePath(n),S);return typeof Q=="string"?x:{path:x,spec:Q.spec}})),y})):await K.writeFilePromise(i,`enableGlobalCache: ${s}
|
|||
|
enableTelemetry: false
|
|||
|
`);let a=(p=this.packages)!=null?p:[this.command],l=P.parseDescriptor(this.command).name,c=await this.cli.run(["add","--",...a],{cwd:r,quiet:this.quiet});if(c!==0)return c;this.quiet||this.context.stdout.write(`
|
|||
|
`);let u=await ye.find(r,this.context.plugins),{project:g,workspace:f}=await ze.find(u,r);if(f===null)throw new ht(g.cwd,r);await g.restoreInstallState();let h=await Zt.getWorkspaceAccessibleBinaries(f);return h.has(l)===!1&&h.size===1&&typeof this.packages=="undefined"&&(l=Array.from(h)[0][0]),await Zt.executeWorkspaceAccessibleBinary(f,l,this.args,{packageAccessibleBinaries:h,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};Om.paths=[["dlx"]],Om.usage=Re.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 FAe=Om;var Bze={commands:[RAe,FAe]},bze=Bze;var wL={};ft(wL,{default:()=>Sze,fileUtils:()=>hL});var ih=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Mm=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Vr="file:";var hL={};ft(hL,{makeArchiveFromLocator:()=>lb,makeBufferFromLocator:()=>CL,makeLocator:()=>dL,makeSpec:()=>NAe,parseSpec:()=>pL});function pL(t){let{params:e,selector:r}=P.parseRange(t),i=j.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?P.parseLocator(e.locator):null,path:i}}function NAe({parentLocator:t,path:e,folderHash:r,protocol:i}){let n=t!==null?{locator:P.stringifyLocator(t)}:{},s=typeof r!="undefined"?{hash:r}:{};return P.makeRange({protocol:i,source:e,selector:e,params:N(N({},s),n)})}function dL(t,{parentLocator:e,path:r,folderHash:i,protocol:n}){return P.makeLocator(t,NAe({parentLocator:e,path:r,folderHash:i,protocol:n}))}async function lb(t,{protocol:e,fetchOptions:r,inMemory:i=!1}){let{parentLocator:n,path:s}=P.parseFileStyleRange(t.reference,{protocol:e}),o=k.isAbsolute(s)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await r.fetcher.fetch(n,r),a=o.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=k.join(a.prefixPath,s);return await Se.releaseAfterUseAsync(async()=>await wi.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:P.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function CL(t,{protocol:e,fetchOptions:r}){return(await lb(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var mL=class{supports(e,r){return!!e.reference.startsWith(Vr)}getLocalPath(e,r){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:Vr});if(k.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:k.resolve(s,n)}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,N({onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${P.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),skipIntegrityCheck:r.skipIntegrityCheck},r.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async fetchFromDisk(e,r){return lb(e,{protocol:Vr,fetchOptions:r})}};var Qze=2,EL=class{supportsDescriptor(e,r){return e.range.match(ih)?!0:!!e.range.startsWith(Vr)}supportsLocator(e,r){return!!e.reference.startsWith(Vr)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i)
|
|||
|
`);let o=k.join(this.context.cwd,At.fileName);await K.changeFilePromise(o,`${JSON.stringify(s,null,2)}
|
|||
|
`,{automaticNewlines:!0});let a=k.join(this.context.cwd,"README.md");if(K.existsSync(a)||await K.writeFilePromise(a,`# ${P.stringifyIdent(i.name)}
|
|||
|
`),!r||r.cwd===this.context.cwd){let c=k.join(this.context.cwd,Pt.lockfile);K.existsSync(c)||await K.writeFilePromise(c,"");let g=[".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(y=>`${y}
|
|||
|
`).join(""),f=k.join(this.context.cwd,".gitignore");K.existsSync(f)||await K.writeFilePromise(f,g);let h={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};(0,ule.default)(h,e.get("initEditorConfig"));let p=`root = true
|
|||
|
`;for(let[y,Q]of Object.entries(h)){p+=`
|
|||
|
[${y}]
|
|||
|
`;for(let[S,x]of Object.entries(Q))p+=`${S.replace(/[A-Z]/g,Y=>`_${Y.toLowerCase()}`)} = ${x}
|
|||
|
`}let m=k.join(this.context.cwd,".editorconfig");K.existsSync(m)||await K.writeFilePromise(m,p),K.existsSync(k.join(this.context.cwd,".git"))||await Fr.execvp("git",["init"],{cwd:this.context.cwd})}}};Hm.paths=[["init"]],Hm.usage=Re.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 gle=Hm;var R4e={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:Ie.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}}},commands:[gle]},F4e=R4e;var TL={};ft(TL,{default:()=>L4e});var mA="portal:",EA="link:";var RL=class{supports(e,r){return!!e.reference.startsWith(mA)}getLocalPath(e,r){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:mA});if(k.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:k.resolve(s,n)}async fetch(e,r){var c;let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:mA}),s=k.isAbsolute(n)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await r.fetcher.fetch(i,r),o=s.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,s.localPath),localPath:Me.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=k.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new _t(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot,localPath:l}:{packageFs:new Da(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot}}};var FL=class{supportsDescriptor(e,r){return!!e.range.startsWith(mA)}supportsLocator(e,r){return!!e.reference.startsWith(mA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return P.bindDescriptor(e,{locator:P.stringifyLocator(r)})}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=e.range.slice(mA.length);return[P.makeLocator(e,`${mA}${j.toPortablePath(n)}`)]}async getSatisfying(e,r,i){return null}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||r.project.configuration.get("defaultLanguageName"),linkType:Qt.SOFT,conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var NL=class{supports(e,r){return!!e.reference.startsWith(EA)}getLocalPath(e,r){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:EA});if(k.isAbso
|
|||
|
${u}, next tree:
|
|||
|
${jm(a)}`);let f=hle(a);if(f)throw new Error(`${f}, after hoisting finished:
|
|||
|
${jm(a)}`)}return s.debugLevel>=2&&console.log(jm(a)),O4e(a)},M4e=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())r.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),r},U4e=t=>{let e=t[t.length-1],r=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 t)u=g.dependencies.get(c.name),u&&r.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),r},dle=(t,e)=>{if(e.decoupled)return e;let{name:r,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:p,hoistedTo:m}=e,y={name:r,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:f,dependencyKind:h,hoistedFrom:new Map(p),hoistedTo:new Map(m)},Q=y.dependencies.get(r);return Q&&Q.ident==y.ident&&y.dependencies.set(r,y),t.dependencies.set(y.name,y),y},K4e=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let n of t.dependencies.values())t.peerNames.has(n.name)||r.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(!t.peerNames.has(s)){let a=r.get(s);a||(a=[],r.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return r},UL=t=>{let e=new Set,r=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!t.peerNames.has(s)){let o=t.dependencies.get(s);o&&!e.has(o)&&r(o,n)}e.add(i)}};for(let i of t.dependencies.values())t.peerNames.has(i.name)||r(i);return e},ML=(t,e,r,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=K4e(o,a),c=t==o?new Map:n.fastLookupPossible?M4e(e):U4e(e),u,g=!1,f=!1,h=new Map(Array.from(l.entries()).map(([m,y])=>[m,y[0]])),p=new Map;do{let m=H4e(t,e,r,c,h,l,i,p,n);m.isGraphChanged&&(f=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[y,Q]of l)Q.length>1&&!o.dependencies.has(y)&&(h.delete(y),Q.shift(),h.set(y,Q[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!r.has(m.locator)){r.add(m.locator);let y=ML(t,[...e,m],r,p,n);y.isGraphChanged&&(f=!0),y.anotherRoundNeeded&&(g=!0),r.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:f}},G4e=(t,e,r,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,f=new Set;l&&(u=`${Array.from(e).map(y=>Ni(y)).join("\u2192")}`);let h=r[r.length-1],m=!(i.ident===h.ident);if(l&&!m&&(g="- self-reference"),m&&(m=i.dependencyKind!==1,l&&!m&&(g="- workspace")),m&&(m=i.dependencyKind!==2||i.dependencies.size===0,l&&!m&&(g="- external soft link with unhoisted dependencies")),m&&(m=h.dependencyKind!==1||h.hoistedFrom.has(i.name)||e.size===1,l&&!m&&(g=h.reasons.get(i.name))),m&&(m=!t.peerNames.has(i.name),l&&!m&&(g=`- cannot shadow peer: ${Ni(t.originalDependencies.get(i.name).locator)} at ${u}`)),m){let y=!1,Q=n.get(i.name);if(y=!Q||Q.ident===i.ident,l&&!y&&(g=`- filled by: ${Ni(Q.locator)} at ${u}`),y)for(let S=r.length-1;S>=1;S--){let M=r[S].dependencies.get(i.name);if(M&&M.ident!==i.ident){y=!1;let Y=a.get(h);Y||(Y=new Set,a.set(h,Y)),Y.add(i.name),l&&(g=`- filled by ${Ni(M.locator)} at ${r.slice(0,S).map(U=>Ni(U.locator)).join("\u2192")}`);break}}m=y}if(m&&(m=s.get(i.name)===i.ident,l&&!m&&(g=`- filled by: ${Ni(o.get(i.name)[0])} at ${u}`)),m){let y=!0,Q=new Set(i.peerNames);for(let S=r.length-1;S>=1;S--){let x=r[S];for(let M of Q){if(x.peerNames.has(M)&&x.originalDependencies.has(M))continue;let Y=x.dependencies.get(M);Y&&t.depe
|
|||
|
${jm(t)}`)}let ee=UL(S);for(let Z of ee)if(J.has(Z)){let A=U.get(Z);if((n.get(Z.name)===Z.ident||!S.reasons.has(Z.name))&&A.isHoistable!==0&&S.reasons.set(Z.name,A.reason),!Z.isHoistBorder&&M.indexOf(Z.locator)<0){u.add(S);let le=dle(S,Z);h([...y,S],[...Q,S.locator],le,m),u.delete(S)}}},p,m=new Set(UL(c));do{p=m,m=new Set;for(let y of p){if(y.locator===c.locator||y.isHoistBorder)continue;let Q=dle(c,y);h([],Array.from(r),Q,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:f}},hle=t=>{let e=[],r=new Set,i=new Set,n=(s,o,a)=>{if(r.has(s)||(r.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(f=>Ni(f.locator)).join("\u2192")}`;if(s.peerNames.has(c.name)){let f=o.get(c.name);(f!==u||!f||f.ident!==c.ident)&&e.push(`${g()} - broken peer promise: expected ${c.ident} but found ${f&&f.ident}`)}else{let f=a.hoistedFrom.get(s.name),h=s.hoistedTo.get(c.name),p=`${f?` hoisted from ${f.join(", ")}`:""}`,m=`${h?` hoisted to ${h}`:""}`,y=`${g()}${p}`;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(t,t.dependencies,t),e.join(`
|
|||
|
`)},T4e=(t,e)=>{let{identName:r,name:i,reference:n,peerNames:s}=t,o={name:i,references:new Set([n]),locator:OL(r,n),ident:fle(r,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([[t,o]]),l=(c,u)=>{let g=a.get(c),f=!!g;if(!g){let{name:h,identName:p,reference:m,peerNames:y,hoistPriority:Q,dependencyKind:S}=c,x=e.hoistingLimits.get(u.locator);g={name:h,references:new Set([m]),locator:OL(p,m),ident:fle(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(y),reasons:new Map,decoupled:!0,isHoistBorder:x?x.has(h):!1,hoistPriority:Q||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),f){let h=new Set,p=m=>{if(!h.has(m)){h.add(m),m.decoupled=!1;for(let y of m.dependencies.values())m.peerNames.has(y.name)||p(y)}};p(g)}else for(let h of c.dependencies)l(h,g)};for(let c of t.dependencies)l(c,o);return o},KL=t=>t.substring(0,t.indexOf("@",1)),O4e=t=>{let e={name:t.name,identName:KL(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),i=(n,s,o)=>{let a=r.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:KL(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){r.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);r.delete(n)}};for(let n of t.dependencies.values())i(n,t,e);return e},j4e=t=>{let e=new Map,r=new Set([t]),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=!!r.has(a);if(n(a).dependents.add(o.ident),!l){r.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 t.dependencies.values())t.peerNames.has(o.name)||s(t,o);return e},Ni=t=>{if(!t)return"none";let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let i=t.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(r=`v:${r}`),n.startsWith("workspace")&&(r=`w:${r}`,n=""),`${r}${n?`@${n}`:""}`}else return`${r}`},Cle=5e4,jm=t=>{let e=0,r=(n,s,o="")=>{if(e>Cle||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),f=KL(u.locator),h=n.hoistedFrom.get(u.name)||[];l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(f!==u.name?`a:${u.name}:`:"")+Ni(u.locator)+(g?` ${g}`:"")+(u!==n&&h.length>0?`, hoisted from: ${h.join(", ")}`:"")}
|
|||
|
`,l+=r(u,s,`${o}${c<a.length-1?"\u2502 ":" "}`)}}return s.delete(n),l};return r(t,new Set)+(e>Cle?`
|
|||
|
Tree is too large, part of the tree has been dunped
|
|||
|
`:"")};var Io;(function(r){r.HARD="HARD",r.SOFT="SOFT"})(Io||(Io={}));var Mn;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Mn||(Mn={}));var mle="node_modules",Bu="$wsroot$";var Gm=(t,e)=>{let{packageTree:r,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=Y4e(t,e),o=null;if(n.length===0){let a=ple(r,{hoistingLimits:i});o=q4e(t,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},fa=t=>`${t.name}@${t.reference}`,HL=t=>{let e=new Map;for(let[r,i]of t.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(r)}for(let r of e.values())r.locations=r.locations.sort((i,n)=>{let s=i.split(k.delimiter).length,o=n.split(k.delimiter).length;return n===i?0:s!==o?o-s:n>i?1:-1});return e},Ele=(t,e)=>{let r=P.isVirtualLocator(t)?P.devirtualizeLocator(t):t,i=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e;return P.areLocatorsEqual(r,i)},jL=(t,e,r,i)=>{if(t.linkType!==Io.SOFT)return!1;let n=j.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return k.contains(i,n)===null},J4e=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=j.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=t.getDependencyTreeRoots(),a=new Map,l=new Set,c=(f,h)=>{let p=fa(f);if(l.has(p))return;l.add(p);let m=t.getPackageInformation(f);if(m){let y=h?fa(h):"";if(fa(f)!==y&&m.linkType===Io.SOFT&&!jL(m,f,t,i)){let Q=Ile(m,f,t);(!a.get(Q)||f.reference.startsWith("workspace:"))&&a.set(Q,f)}for(let[Q,S]of m.packageDependencies)S!==null&&(m.packagePeers.has(Q)||c(t.getLocator(Q,S),f))}};for(let f of o)c(f,null);let u=i.split(k.sep);for(let f of a.values()){let h=t.getPackageInformation(f),m=j.toPortablePath(h.packageLocation.slice(0,-1)).split(k.sep).slice(u.length),y=s;for(let Q of m){let S=y.children.get(Q);S||(S={children:new Map},y.children.set(Q,S)),y=S}y.workspaceLocator=f}let g=(f,h)=>{if(f.workspaceLocator){let p=fa(h),m=n.get(p);m||(m=new Set,n.set(p,m)),m.add(f.workspaceLocator)}for(let p of f.children.values())g(p,f.workspaceLocator||h)};for(let f of s.children.values())g(f,s.workspaceLocator);return n},Y4e=(t,e)=>{let r=[],i=!1,n=new Map,s=J4e(t),o=t.getPackageInformation(t.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=t.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=j.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,dependencyKind:ls.WORKSPACE},u=new Map,g=(h,p)=>`${fa(p)}:${h}`,f=(h,p,m,y,Q,S,x,M)=>{var Ae,T;let Y=g(h,m),U=u.get(Y),J=!!U;!J&&m.name===a.name&&m.reference===a.reference&&(U=c,u.set(Y,c));let W=jL(p,m,t,l);if(!U){let L=ls.REGULAR;W?L=ls.EXTERNAL_SOFT_LINK:p.linkType===Io.SOFT&&m.name.endsWith(Bu)&&(L=ls.WORKSPACE),U={name:h,identName:m.name,reference:m.reference,dependencies:new Set,peerNames:L===ls.WORKSPACE?new Set:p.packagePeers,dependencyKind:L},u.set(Y,U)}let ee;if(W?ee=2:Q.linkType===Io.SOFT?ee=1:ee=0,U.hoistPriority=Math.max(U.hoistPriority||0,ee),M&&!W){let L=fa({name:y.identName,reference:y.reference}),Ee=n.get(L)||new Set;n.set(L,Ee),Ee.add(U.name)}let Z=new Map(p.packageDependencies);if(e.project){let L=e.project.workspacesByCwd.get(j.toPortablePath(p.packageLocation.slice(0,-1)));if(L){let Ee=new Set([...Array.from(L.manifest.peerDependencies.values(),we=>P.stringifyIdent(we)),...Array.from(L.manifest.peerDependenciesMeta.keys())]);for(let we of Ee)Z.has(we)||(Z.set(we,S.get(we)||null),U.peerNames.add(we))}}let A=fa({name:m.name.replace(Bu,""),reference:m.refer
|
|||
|
`;for(let s=0,o=t.length;s<o;++s)n+=i+cb(String(s),t[s],e,i).replace(/^ +/,""),s+1<o&&(n+=","),n+=`
|
|||
|
`;return n+=r,n+="]",n}function V4e(t,e,r){let i=Object.keys(t),n="";n+="{";for(let s=0,o=i.length,a=0;s<o;++s){let l=i[s],c=t[l];typeof c!="undefined"&&(a!==0&&(n+=", "),n+=JSON.stringify(l),n+=": ",n+=cb(l,c,e,r).replace(/^ +/g,""),a+=1)}return n+="}",n}function X4e(t,e,r){let i=Object.keys(t),n=`${r} `,s="";s+=r,s+=`{
|
|||
|
`;let o=0;for(let a=0,l=i.length;a<l;++a){let c=i[a],u=t[c];typeof u!="undefined"&&(o!==0&&(s+=",",s+=`
|
|||
|
`),s+=n,s+=JSON.stringify(c),s+=": ",s+=cb(c,u,e,n).replace(/^ +/g,""),o+=1)}return o!==0&&(s+=`
|
|||
|
`),s+=r,s+="}",s}function cb(t,e,r,i){let{next:n}=wle[r],s=n[t]||n["*"];return Ble(e,s,i)}function Ble(t,e,r){let{collapsed:i}=wle[e];return Array.isArray(t)?i?z4e(t,e,r):_4e(t,e,r):typeof t=="object"&&t!==null?i?V4e(t,e,r):X4e(t,e,r):JSON.stringify(t)}function ble(t){return Ble(t,er.TOP_LEVEL,"")}function Ym(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(r.map(o=>s(o)));let n=r.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=>r[s])}function Z4e(t){let e=new Map,r=Ym(t.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of r){let s=e.get(i);typeof s=="undefined"&&e.set(i,s=new Set),s.add(n)}return Array.from(e).map(([i,n])=>[i,Array.from(n)])}function $4e(t){return Ym(t.fallbackPool||[],([e])=>e)}function e_e(t){let e=[];for(let[r,i]of Ym(t.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([r,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of Ym(i,([g])=>g===null?"0":`1${g}`)){let g=[];r!==null&&s!==null&&!a.has(r)&&g.push([r,s]);for(let[p,m]of Ym(a.entries(),([y])=>y))g.push([p,m]);let f=l&&l.size>0?Array.from(l):void 0,h=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:f,linkType:c,discardFromLookup:h}])}}return e}function qm(t){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:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:Z4e(t),fallbackPool:$4e(t),packageRegistryData:e_e(t)}}var Sle=ge(vle());function kle(t,e){return[t?`${t}
|
|||
|
`:"",`/* eslint-disable */
|
|||
|
|
|||
|
`,`try {
|
|||
|
`,` Object.freeze({}).detectStrictMode = true;
|
|||
|
`,`} catch (error) {
|
|||
|
`," throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`);\n",`}
|
|||
|
`,`
|
|||
|
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||
|
`,e.replace(/^/gm," "),`}
|
|||
|
`,`
|
|||
|
`,(0,Sle.default)()].join("")}function t_e(t){return JSON.stringify(t,null,2)}function r_e(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
|
|||
|
`)}'`}function i_e(t){return[`return hydrateRuntimeState(JSON.parse(${r_e(ble(t))}), {basePath: basePath || __dirname});
|
|||
|
`].join("")}function n_e(t){return[`var path = require('path');
|
|||
|
`,`var dataLocation = path.resolve(__dirname, ${JSON.stringify(t)});
|
|||
|
`,`return hydrateRuntimeState(require(dataLocation), {basePath: basePath || path.dirname(dataLocation)});
|
|||
|
`].join("")}function xle(t){let e=qm(t),r=i_e(e);return kle(t.shebang,r)}function Ple(t){let e=qm(t),r=n_e(t.dataLocation),i=kle(t.shebang,r);return{dataFile:t_e(e),loaderFile:i}}var Lle=ge(require("fs")),u_e=ge(require("path")),Tle=ge(require("util"));function YL(t,{basePath:e}){let r=j.toPortablePath(e),i=k.resolve(r),n=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,s=new Map,o=new Map(t.packageRegistryData.map(([g,f])=>[g,new Map(f.map(([h,p])=>{var x;if(g===null!=(h===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(x=p.discardFromLookup)!=null?x:!1,y={name:g,reference:h},Q=s.get(p.packageLocation);Q?(Q.discardFromLookup=Q.discardFromLookup&&m,m||(Q.locator=y)):s.set(p.packageLocation,{locator:y,discardFromLookup:m});let S=null;return[h,{packageDependencies:new Map(p.packageDependencies),packagePeers:new Set(p.packagePeers),linkType:p.linkType,discardFromLookup:m,get packageLocation(){return S||(S=k.join(i,p.packageLocation))}}]}))])),a=new Map(t.fallbackExclusionList.map(([g,f])=>[g,new Set(f)])),l=new Map(t.fallbackPool),c=t.dependencyTreeRoots,u=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var Jm=ge(require("module")),Nle=ge(Rle()),JL=ge(require("util"));var ur;(function(c){c.API_ERROR="API_ERROR",c.BUILTIN_NODE_RESOLUTION_FAILED="BUILTIN_NODE_RESOLUTION_FAILED",c.EXPORTS_RESOLUTION_FAILED="EXPORTS_RESOLUTION_FAILED",c.MISSING_DEPENDENCY="MISSING_DEPENDENCY",c.MISSING_PEER_DEPENDENCY="MISSING_PEER_DEPENDENCY",c.QUALIFIED_PATH_RESOLUTION_FAILED="QUALIFIED_PATH_RESOLUTION_FAILED",c.INTERNAL="INTERNAL",c.UNDECLARED_DEPENDENCY="UNDECLARED_DEPENDENCY",c.UNSUPPORTED="UNSUPPORTED"})(ur||(ur={}));var a_e=new Set([ur.BUILTIN_NODE_RESOLUTION_FAILED,ur.MISSING_DEPENDENCY,ur.MISSING_PEER_DEPENDENCY,ur.QUALIFIED_PATH_RESOLUTION_FAILED,ur.UNDECLARED_DEPENDENCY]);function oi(t,e,r={},i){i!=null||(i=a_e.has(t)?"MODULE_NOT_FOUND":t);let n={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:te(N({},n),{value:i}),pnpCode:te(N({},n),{value:t}),data:te(N({},n),{value:r})})}function yo(t){return j.normalize(j.fromPortablePath(t))}var A_e=ge(require("fs")),Fle=ge(require("module")),l_e=ge(require("path")),c_e=new Set(Fle.Module.builtinModules||Object.keys(process.binding("natives"))),ub=t=>t.startsWith("node:")||c_e.has(t);function WL(t,e){let r=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(t.enableTopLevelFallback===!0&&c.push(l),e.compatibilityMode!==!1)for(let re of["react-scripts","gatsby"]){let se=t.packageRegistry.get(re);if(se)for(let Qe of se.keys()){if(Qe===null)throw new Error("Assertion failed: This reference shouldn't be null");c.push({name:re,reference:Qe})}}let{ignorePattern:g,packageRegistry:f,packageLocatorsByLocations:h}=t;function p(re,se){return{fn:re,args:se,error:null,result:null}}function m(re){var Ue,xe,ve,pe,X,be;let se=(ve=(xe=(Ue=process.stderr)==null?void 0:Ue.hasColors)==null?void 0:xe.call(Ue))!=null?ve:process.stdout.isTTY,Qe=(ce,fe)=>`[${ce}m${fe}[0m`,he=re.error;console.error(he?Qe("31;1",`\u2716 ${(pe=re.error)==null?void 0:pe.message.replace(/\n.*/s,"")}`):Qe("33;1","\u203C Resolution")),re.args.length>0&&console.error();for(let ce of re.args)console.error(` ${Qe("37;1","In \u2190")} ${(0,JL.inspect)(ce,{colors:se,compact:!0})}`);re.result&&(console.error(),console.error(` ${Qe("37;1","Out \u2192")} ${(0,JL.inspect)(re.result,{colors:se,compact:!0})}`));let Fe=(be=(X=new Error().stack.match(/(?<=^ +)at.*/gm))==null?void 0:X.slice(2))!=null?be:[];if(Fe.length>0){console.error();for(let ce of Fe)console.error(` ${Qe("38;5;244",ce)}`)}console.error()}function y(re,se){if(e.allowDebug===!1)return se;if(Number.isFinite(i)){if(
|
|||
|
|
|||
|
Require request: "${he}"
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe});return j.toPortablePath(ve)}let Ue,xe=re.match(n);if(xe){if(!se)throw oi(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let[,ve,pe]=xe,X=Ae(se);if(!X){let jt=J(re,se);if(jt===!1)throw oi(ur.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).
|
|||
|
|
|||
|
Require path: "${he}"
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe});return j.toPortablePath(jt)}let ce=Q(X).packageDependencies.get(ve),fe=null;if(ce==null&&X.name!==null){let jt=t.fallbackExclusionList.get(X.name);if(!jt||!jt.has(X.reference)){for(let Ti=0,_s=c.length;Ti<_s;++Ti){let Kn=Q(c[Ti]).packageDependencies.get(ve);if(Kn!=null){r?fe=Kn:ce=Kn;break}}if(t.enableTopLevelFallback&&ce==null&&fe===null){let Ti=t.fallbackPool.get(ve);Ti!=null&&(fe=Ti)}}}let gt=null;if(ce===null)if(S(X))gt=oi(ur.MISSING_PEER_DEPENDENCY,`Your application tried to access ${ve} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe,dependencyName:ve});else{let jt=le(ve,X);jt.every(Qr=>S(Qr))?gt=oi(ur.MISSING_PEER_DEPENDENCY,`${X.name} tried to access ${ve} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${X.name}@${X.reference} (via ${Fe})
|
|||
|
${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference}
|
|||
|
`).join("")}
|
|||
|
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:ve,brokenAncestors:jt}):gt=oi(ur.MISSING_PEER_DEPENDENCY,`${X.name} tried to access ${ve} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${X.name}@${X.reference} (via ${Fe})
|
|||
|
|
|||
|
${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference}
|
|||
|
`).join("")}
|
|||
|
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:ve,brokenAncestors:jt})}else ce===void 0&&(!Qe&&ub(re)?S(X)?gt=oi(ur.UNDECLARED_DEPENDENCY,`Your application tried to access ${ve}. 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 ${ve} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe,dependencyName:ve}):gt=oi(ur.UNDECLARED_DEPENDENCY,`${X.name} tried to access ${ve}. 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 ${ve} isn't otherwise declared in ${X.name}'s dependencies, this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:ve}):S(X)?gt=oi(ur.UNDECLARED_DEPENDENCY,`Your application tried to access ${ve}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Fe}
|
|||
|
`,{request:he,issuer:Fe,dependencyName:ve}):gt=oi(ur.UNDECLARED_DEPENDENCY,`${X.name} tried to access ${ve}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${ve}${ve!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${X.name}@${X.reference} (via ${Fe})
|
|||
|
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},X),dependencyName:ve}));if(ce==null){if(fe===null||gt===null)throw gt||new Error("Assertion failed: Expected an error to have been set");ce=fe;let jt=gt.message.replace(/\n.*/g,"");gt.message=jt,!u.has(jt)&&i!==0&&(u.add(jt),process.emitWarning(gt))}let Ht=Array.isArray(ce)?{name:ce[0],reference:ce[1]}:{name:ve,reference:ce},Mt=Q(Ht);if(!Mt.packageLocation)throw oi(ur.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.
|
|||
|
|
|||
|
Required package: ${Ht.name}@${Ht.reference}${Ht.name!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${X.name}@${X.reference} (via ${Fe})
|
|||
|
`,{request:he,issuer:Fe,dependencyLocator:Object.assign({},Ht)});let mi=Mt.packageLocation;pe?Ue=k.join(mi,pe):Ue=mi}else if(k.isAbsolute(re))Ue=k.normalize(re);else{if(!se)throw oi(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let ve=k.resolve(se);se.match(o)?Ue=k.normalize(k.join(ve,re)):Ue=k.normalize(k.join(k.dirname(ve),re))}return k.normalize(Ue)}function L(re,se,Qe=x){if(s.test(re))return se;let he=M(se,Qe);return he?k.normalize(he):se}function Ee(re,{extensions:se=Object.keys(Jm.Module._extensions)}={}){var Fe,Ue;let Qe=[],he=Y(re,Qe,{extensions:se});if(he)return k.normalize(he);{let xe=yo(re),ve=Ae(re);if(ve){let{packageLocation:pe}=Q(ve),X=!0;try{e.fakeFs.accessSync(pe)}catch(be){if((be==null?void 0:be.code)==="ENOENT")X=!1;else{let ce=((Ue=(Fe=be==null?void 0:be.message)!=null?Fe:be)!=null?Ue:"empty exception thrown").replace(/^[A-Z]/,fe=>fe.toLowerCase());throw oi(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`Required package exists but could not be accessed (${ce}).
|
|||
|
|
|||
|
Missing package: ${ve.name}@${ve.reference}
|
|||
|
Expected package location: ${yo(pe)}
|
|||
|
`,{unqualifiedPath:xe,extensions:se})}}if(!X){let be=pe.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 oi(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`${be}
|
|||
|
|
|||
|
Missing package: ${ve.name}@${ve.reference}
|
|||
|
Expected package location: ${yo(pe)}
|
|||
|
`,{unqualifiedPath:xe,extensions:se})}}throw oi(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
|
|||
|
|
|||
|
Source path: ${xe}
|
|||
|
${Qe.map(pe=>`Not found: ${yo(pe)}
|
|||
|
`).join("")}`,{unqualifiedPath:xe,extensions:se})}}function we(re,se,{considerBuiltins:Qe,extensions:he,conditions:Fe}={}){try{let Ue=T(re,se,{considerBuiltins:Qe});if(re==="pnpapi")return Ue;if(Ue===null)return null;let xe=()=>se!==null?W(se):!1,ve=(!Qe||!ub(re))&&!xe()?L(re,Ue,Fe):Ue;return Ee(ve,{extensions:he})}catch(Ue){throw Object.prototype.hasOwnProperty.call(Ue,"pnpCode")&&Object.assign(Ue.data,{request:yo(re),issuer:se&&yo(se)}),Ue}}function qe(re){let se=k.normalize(re),Qe=Jr.resolveVirtual(se);return Qe!==se?Qe:null}return{VERSIONS:ee,topLevel:Z,getLocator:(re,se)=>Array.isArray(se)?{name:se[0],reference:se[1]}:{name:re,reference:se},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let re=[];for(let[se,Qe]of f)for(let he of Qe.keys())se!==null&&he!==null&&re.push({name:se,reference:he});return re},getPackageInformation:re=>{let se=A(re);if(se===null)return null;let Qe=j.fromPortablePath(se.packageLocation);return te(N({},se),{packageLocation:Qe})},findPackageLocator:re=>Ae(j.toPortablePath(re)),resolveToUnqualified:y("resolveToUnqualified",(re,se,Qe)=>{let he=se!==null?j.toPortablePath(se):null,Fe=T(j.toPortablePath(re),he,Qe);return Fe===null?null:j.fromPortablePath(Fe)}),resolveUnqualified:y("resolveUnqualified",(re,se)=>j.fromPortablePath(Ee(j.toPortablePath(re),se))),resolveRequest:y("resolveRequest",(re,se,Qe)=>{let he=se!==null?j.toPortablePath(se):null,Fe=we(j.toPortablePath(re),he,Qe);return Fe===null?null:j.fromPortablePath(Fe)}),resolveVirtual:y("resolveVirtual",re=>{let se=qe(j.toPortablePath(re));return se!==null?j.fromPortablePath(se):null})}}var YQt=(0,Tle.promisify)(Lle.readFile);var Ole=(t,e,r)=>{let i=qm(t),n=YL(i,{basePath:e}),s=j.join(e,Pt.pnpCjs);return WL(n,{fakeFs:r,pnpapiResolution:s})};var _L=ge(Ule());var wo={};ft(wo,{checkAndReportManifestCompatibility:()=>Hle,checkManifestCompatibility:()=>Kle,extractBuildScripts:()=>gb,getExtractHint:()=>VL,hasBindingGyp:()=>XL});function Kle(t){return P.isPackageCompatible(t,qg.getArchitectureSet())}function Hle(t,e,{configuration:r,report:i}){return Kle(t)?!0:(i==null||i.reportWarningOnce($.INCOMPATIBLE_ARCHITECTURE,`${P.prettyLocator(r,t)} The ${qg.getArchitectureName()} architecture is incompatible with this package, ${e} skipped.`),!1)}function gb(t,e,r,{configuration:i,report:n}){let s=[];for(let a of["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([As.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([As.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:t.linkType!==Qt.HARD?(n==null||n.reportWarningOnce($.SOFT_LINK_BUILD,`${P.prettyLocator(i,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):r&&r.built===!1?(n==null||n.reportInfoOnce($.BUILD_DISABLED,`${P.prettyLocator(i,t)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!r.built?(n==null||n.reportWarningOnce($.DISABLED_BUILD_SCRIPTS,`${P.prettyLocator(i,t)} lists build scripts, but all build scripts have been disabled.`),[]):Hle(t,"build",{configuration:i,report:n})?s:[]}var g_e=new Set([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function VL(t){return t.packageFs.getExtractHint({relevantExtensions:g_e})}function XL(t){let e=k.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var ZL={};ft(ZL,{getUnpluggedPath:()=>Wm});function Wm(t,{configuration:e}){return k.resolve(e.get("pnpUnpluggedFolder"),P.slugifyLocator(t))}var f_e=new Set([P.makeIdent(null,"nan").identHash,P.makeIdent(null,"node-gyp").identHash,P.makeIdent(null,"node-pre-gyp").identHash,P.makeIdent(null,"node-addon-api").identHash,P.makeIdent(null,"fsevents").identHash]),Qu=class{constructor(){this.mode="strict";this.pnpCache=new Map}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let i=Pl(r.project).cjs;if(!K.existsSync(i))throw new Pe(`The pr
|
|||
|
`,n+=`# cause your node_modules installation to become invalidated.
|
|||
|
`,n+=`
|
|||
|
`,n+=`__metadata:
|
|||
|
`,n+=` version: ${ece}
|
|||
|
`,n+=` nmMode: ${i.value}
|
|||
|
`;let s=Array.from(e.keys()).sort(),o=P.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let c of s){let u=e.get(c);n+=`
|
|||
|
`,n+=`${JSON.stringify(c)}:
|
|||
|
`,n+=` locations:
|
|||
|
`;for(let g of u.locations){let f=k.contains(t.cwd,g);if(f===null)throw new Error(`Assertion failed: Expected the path to be within the project (${g})`);n+=` - ${JSON.stringify(f)}
|
|||
|
`}if(u.aliases.length>0){n+=` aliases:
|
|||
|
`;for(let g of u.aliases)n+=` - ${JSON.stringify(g)}
|
|||
|
`}if(c===o&&r.size>0){n+=` bin:
|
|||
|
`;for(let[g,f]of r){let h=k.contains(t.cwd,g);if(h===null)throw new Error(`Assertion failed: Expected the path to be within the project (${g})`);n+=` ${JSON.stringify(h)}:
|
|||
|
`;for(let[p,m]of f){let y=k.relative(k.join(g,ai),m);n+=` ${JSON.stringify(p)}: ${JSON.stringify(y)}
|
|||
|
`}}}}let a=t.cwd,l=k.join(a,ai,tce);await K.changeFilePromise(l,n,{automaticNewlines:!0})}async function AT(t,{unrollAliases:e=!1}={}){let r=t.cwd,i=k.join(r,ai,tce);if(!K.existsSync(i))return null;let n=Qi(await K.readFilePromise(i,"utf8"));if(n.__metadata.version>ece)return null;let s=n.__metadata.nmMode||Li.CLASSIC,o=new Map,a=new Map;delete n.__metadata;for(let[l,c]of Object.entries(n)){let u=c.locations.map(f=>k.join(r,f)),g=c.bin;if(g)for(let[f,h]of Object.entries(g)){let p=k.join(r,j.toPortablePath(f)),m=Se.getMapWithDefault(a,p);for(let[y,Q]of Object.entries(h))m.set(qr(y),j.toPortablePath([p,ai,Q].join(k.delimiter)))}if(o.set(l,{target:Me.dot,linkType:Qt.HARD,locations:u,aliases:c.aliases||[]}),e&&c.aliases)for(let f of c.aliases){let{scope:h,name:p}=P.parseLocator(l),m=P.makeLocator(P.makeIdent(h,p),f),y=P.stringifyLocator(m);o.set(y,{target:Me.dot,linkType:Qt.HARD,locations:u,aliases:[]})}}return{locatorMap:o,binSymlinks:a,locationTree:nce(o,{skipPrefix:t.cwd}),nmMode:s}}var ah=async(t,e)=>{if(t.split(k.sep).indexOf(ai)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{if(!e.innerLoop){let i=e.allowSymlink?await K.statPromise(t):await K.lstatPromise(t);if(e.allowSymlink&&!i.isDirectory()||!e.allowSymlink&&i.isSymbolicLink()){await K.unlinkPromise(t);return}}let r=await K.readdirPromise(t,{withFileTypes:!0});for(let i of r){let n=k.join(t,qr(i.name));i.isDirectory()?(i.name!==ai||e&&e.innerLoop)&&await ah(n,{innerLoop:!0,contentsOnly:!1}):await K.unlinkPromise(n)}e.contentsOnly||await K.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},sce=4,fb=(t,{skipPrefix:e})=>{let r=k.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let i=r.split(k.sep).filter(l=>l!==""),n=i.indexOf(ai),s=i.slice(0,n).join(k.sep),o=k.join(e,s),a=i.slice(n);return{locationRoot:o,segments:a}},nce=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let i=()=>({children:new Map,linkType:Qt.HARD});for(let[n,s]of t.entries()){if(s.linkType===Qt.SOFT&&k.contains(e,s.target)!==null){let a=Se.getFactoryWithDefault(r,s.target,i);a.locator=n,a.linkType=s.linkType}for(let o of s.locations){let{locationRoot:a,segments:l}=fb(o,{skipPrefix:e}),c=Se.getFactoryWithDefault(r,a,i);for(let u=0;u<l.length;++u){let g=l[u];if(g!=="."){let f=Se.getFactoryWithDefault(c.children,g,i);c.children.set(g,f),c=f}u===l.length-1&&(c.locator=n,c.linkType=s.linkType)}}}return r},lT=async(t,e)=>{let r;try{process.platform==="win32"&&(r=await K.lstatPromise(t))}catch(i){}process.platform=="win32"&&(!r||r.isDirectory())?await K.symlinkPromise(t,e,"junction"):await K.symlinkPromise(k.relative(k.dirname(e),t),e)};async function oce(t,e,r){let i=k.join(t,qr(`${sT.default.randomBytes(16).toString("hex")}.tmp`));try{await K.writeFilePromise(i,r);try{await K.linkPromise(i,e)}catch(n){}}finally{await K.unlinkPromise(i)}}async function M_e({srcPath:t,dstPath:e,srcMode:r,globalHardlinksStore:i,baseFs:n,nmMode:s,digest:o}){if(s.value===Li.HARDLINKS_GLOBAL&&i&&o){let l=k.join(i,o.substring(0,2),`${o.substring(2)}.dat`),c;try{if(await Dn.checksumFile(l,{baseFs:K,algorithm:"sha1"})!==o){let g=k.join(i,qr(`${sT.default.randomBytes(16).toString("hex")}.tmp`));await K.renamePromise(l,g);let f=await n.readFilePromise(t);await K.writeFilePromise(g,f);try{await K.linkPromise(g,l),await K.unlinkPromise(g)}catch(h){}}await K.linkPromise(l,e),c=!0}catch(u){c=!1}if(!c){let u=await n.readFilePromise(t);await oce(i,l,u);try{await K.linkPromise(l,e)}catch(g){g&&g.code&&g.code=="EXDEV"&&(s.value=Li.HARDLINKS_LOCAL,await n.copyFilePromise(t,e))}}}else await n.copyFilePromise(t,e);let a=r&511;a!==420&&await K.chmodPromise(e,a)}var Dl;(function(i){i.FILE="file",i.DIRECTORY="directory",i.SYMLINK="symlink"})(Dl||(Dl={}));var U_e=async(t,e,{baseFs:r,globalHardlinksStore:i,nmMode:n,packageChecksum:s})=>{await K.mkdirPromise(t,{recursive:!0});let o=async(l=Me.dot)=>{let c=k.join(e,l),u=await r.readdirPromise(c,{withFileTypes:!0}),g=new Map;for
|
|||
|
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 ${Hb.map(e=>`\`${e}\``).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.
|
|||
|
|
|||
|
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.
|
|||
|
`,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"]]});var pge=uE;var fO=ge(ti()),hO=ge(require("util")),gE=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r}=await ze.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let x=r.topLevelWorkspace;if(!x.manifest.name)throw new Pe(`Missing ${ae.pretty(e,"name",ae.Type.CODE)} field in ${j.fromPortablePath(k.join(x.cwd,Pt.manifest))}`);c=P.makeDescriptor(x.manifest.name,"unknown")}else c=P.parseDescriptor(l);let u=zt.getIdentUrl(c),g=pO(await zt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:zt.customPackageError})),f=Object.keys(g.versions).sort(fO.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],m=Wt.validRange(c.range);if(m){let x=fO.default.maxSatisfying(f,m);x!==null?p=x:(a.reportWarning($.UNNAMED,`Unmet range ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0)}else Object.prototype.hasOwnProperty.call(g["dist-tags"],c.range)?p=g["dist-tags"][c.range]:c.range!=="unknown"&&(a.reportWarning($.UNNAMED,`Unknown tag ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0);let y=g.versions[p],Q=te(N(N({},g),y),{version:p,versions:f}),S;if(i!==null){S={};for(let x of i){let M=Q[x];if(typeof M!="undefined")S[x]=M;else{a.reportWarning($.EXCEPTION,`The ${ae.pretty(e,x,ae.Type.CODE)} field doesn't exist inside ${P.prettyIdent(e,c)}'s information`),s=!0;continue}}}else this.json||(delete Q.dist,delete Q.readme,delete Q.users),S=Q;a.reportJson(S),this.json||n.push(S)}});hO.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
|
|||
|
`),this.context.stdout.write(`${(0,hO.inspect)(a,{depth:Infinity,colors:!0,compact:!1})}
|
|||
|
`);return o.exitCode()}};gE.paths=[["npm","info"]],gE.usage=Re.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"]]});var dge=gE;function pO(t){if(Array.isArray(t)){let e=[];for(let r of t)r=pO(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let i=pO(t[r]);i&&(e[r]=i)}return e}else return t||null}var Cge=ge($C()),fE=class extends Le{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"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),r=await jb({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await i9e({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await zt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:zt.AuthType.NO_AUTH});return await r9e(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo($.UNNAMED,"Successfully logged in")})).exitCode()}};fE.paths=[["npm","login"]],fE.usage=Re.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"]]});var mge=fE;async function jb({scope:t,publish:e,co
|
|||
|
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.
|
|||
|
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var wge=dE;async function CE(t,e){let r=`/-/package${zt.getIdentUrl(t)}/dist-tags`;return zt.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:zt.customPackageError})}var mE=class extends Le{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(r.cwd,this.context.cwd);let n=P.parseDescriptor(this.package,!0),s=n.range;if(!Bge.default.valid(s))throw new Pe(`The range ${ae.pretty(e,n.range,ae.Type.RANGE)} must be a valid semver version`);let o=br.getPublishRegistry(i.manifest,{configuration:e}),a=ae.pretty(e,n,ae.Type.IDENT),l=ae.pretty(e,s,ae.Type.RANGE),c=ae.pretty(e,this.tag,ae.Type.CODE);return(await Je.start({configuration:e,stdout:this.context.stdout},async g=>{let f=await CE(n,e);Object.prototype.hasOwnProperty.call(f,this.tag)&&f[this.tag]===s&&g.reportWarning($.UNNAMED,`Tag ${c} is already set to version ${l}`);let h=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await zt.put(h,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo($.UNNAMED,`Tag ${c} added to version ${l} of package ${a}`)})).exitCode()}};mE.paths=[["npm","tag","add"]],mE.usage=Re.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
|
|||
|
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.
|
|||
|
`,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 bge=mE;var EE=class extends Le{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){if(this.tag==="latest")throw new Pe("The 'latest' tag cannot be removed.");let e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(r.cwd,this.context.cwd);let n=P.parseIdent(this.package),s=br.getPublishRegistry(i.manifest,{configuration:e}),o=ae.pretty(e,this.tag,ae.Type.CODE),a=ae.pretty(e,n,ae.Type.IDENT),l=await CE(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new Pe(`${o} is not a tag of package ${a}`);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await zt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo($.UNNAMED,`Tag ${o} removed from package ${a}`)})).exitCode()}};EE.paths=[["npm","tag","remove"]],EE.usage=Re.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
|
|||
|
This command will remove a tag from a package from the npm registry.
|
|||
|
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Qge=EE;var IE=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=br.getScopeRegistry(this.scope,{configuration:e,type:br.RegistryType.PUBLISH_REGISTRY}):this.scope?r=br.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=br.getPublishRegistry((await Jf(e,this.context.cwd)).manifest,{configuration:e}):r=br.getDefaultRegistry({configuration:e}),(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await zt.get("/-/whoami",{configuration:e,registry:r,authType:zt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError($.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo($.UNNAMED,s.username)})).exitCode()}};IE.paths=[["npm","whoami"]],IE.usage=Re.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 vge=IE;var o9e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:Ie.STRING,default:null}},commands:[pge,dge,mge,Ige,yge,bge,wge,Qge,vge]},a9e=o9e;var bO={};ft(bO,{default:()=>B9e,patchUtils:()=>CO});var CO={};ft(CO,{applyPatchFile:()=>qb,diffFolders:()=>yO,extractPackageToDisk:()=>IO,extractPatchFlags:()=>Nge,isParentRequired:()=>EO,loadPatchFiles:()=>bE,makeDescriptor:()=>I9e,makeLocator:()=>mO,parseDescriptor:()=>wE,parseLocator:()=>BE,parsePatchFile:()=>Yb});var yE=class extends Error{constructor(e,r){super(`Cannot apply hunk #${e+1}`);this.hunk=r}};var A9e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Bh(t){return k.relative(Me.root,k.resolve(Me.root,j.toPortablePath(t)))}function l9e(t){let e=t.trim().match(A9e);if(!e)throw new Error(`Bad header line: '${t}'`);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 c9e=420,u9e=493,Xr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Xr||(Xr={}));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}),g9e=t=>({header:l9e(t),parts:[]}),f9e={["@"]:"header",["-"]:Xr.Deletion,["+"]:Xr.Insertion,[" "]:Xr.Context,["\\"]:"pragma",undefined:Xr.Context};function p9e(t){let e=[],r=Sge(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),r.hunks.push(n),n=null)}function a(){o(),e.push(r),r=Sge()}for(let l=0;l<t.length;l++){let c=t[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",r.hunks=[],l-=1;else if(c.startsWith("diff --git ")){r&&r.diffLineFromPath&&
|
|||
|
`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":`
|
|||
|
`):"";await e.mkdirpPromise(k.dirname(n.path),{chmod:493,utimes:[Dr.SAFE_TIME,Dr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,Dr.SAFE_TIME,Dr.SAFE_TIME)}break;case"patch":await bh(e,n.path,async()=>{await C9e(n,{baseFs:e,dryRun:r})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(kge(n.newMode)!==kge(o))continue;await bh(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:Se.assertNever(n);break}}function kge(t){return(t&64)>0}function xge(t){return t.replace(/\s+$/,"")}function m9e(t,e){return xge(t)===xge(e)}async function C9e({hunks:t,path:e},{baseFs:r,dryRun:i=!1}){let n=await r.statSync(e).mode,o=(await r.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of t){let f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),m=Math.max(h,p),y=0,Q=0,S=null;for(;y<=m;){if(y<=h&&(Q=f-y,S=Pge(g,o,Q),S!==null)){y=-y;break}if(y<=p&&(Q=f+y,S=Pge(g,o,Q),S!==null))break;y+=1}if(S===null)throw new yE(t.indexOf(g),g);a.push(S),l+=y,c=Q+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:Se.assertNever(f);break}await r.writeFilePromise(e,o.join(`
|
|||
|
`),{mode:n})}function Pge(t,e,r){let i=[];for(let n of t.parts)switch(n.type){case Xr.Context:case Xr.Deletion:{for(let s of n.lines){let o=e[r];if(o==null||!m9e(o,s))return null;r+=1}n.type===Xr.Deletion&&(i.push({type:"splice",index:r-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Xr.Insertion:i.push({type:"splice",index:r,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:Se.assertNever(n.type);break}return i}var E9e=/^builtin<([^>]+)>$/;function Dge(t,e){let{source:r,selector:i,params:n}=P.parseRange(t);if(r===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>j.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?P.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(r);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function wE(t){let i=Dge(t.range,P.parseDescriptor),{sourceItem:e}=i,r=Tr(i,["sourceItem"]);return te(N({},r),{sourceDescriptor:e})}function BE(t){let i=Dge(t.reference,P.parseLocator),{sourceItem:e}=i,r=Tr(i,["sourceItem"]);return te(N({},r),{sourceLocator:e})}function Rge({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:i,patchHash:n},s){let o=t!==null?{locator:P.stringifyLocator(t)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return P.makeRange({protocol:"patch:",source:s(e),selector:r.join("&"),params:N(N(N({},a),l),o)})}function I9e(t,{parentLocator:e,sourceDescriptor:r,patchPaths:i}){return P.makeLocator(t,Rge({parentLocator:e,sourceItem:r,patchPaths:i},P.stringifyDescriptor))}function mO(t,{parentLocator:e,sourcePackage:r,patchPaths:i,patchHash:n}){return P.makeLocator(t,Rge({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:i,patchHash:n},P.stringifyLocator))}function Fge({onAbsolute:t,onRelative:e,onBuiltin:r},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(E9e);return s!==null?r(s[1]):k.isAbsolute(i)?t(i):e(i)}function Nge(t){let e=t.startsWith("~");return e&&(t=t.slice(1)),{optional:e}}function EO(t){return Fge({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},t)}async function bE(t,e,r){let i=t!==null?await r.fetcher.fetch(t,r):null,n=i&&i.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await Se.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Nge(o),l=await Fge({onAbsolute:async()=>await K.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(k.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await r.project.configuration.firstHook(u=>u.getBuiltinPatch,r.project,c)},o);return te(N({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
|
|||
|
`));return s}async function IO(t,{cache:e,project:r}){let i=r.storedPackages.get(t.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=r.storedChecksums,s=new pi,o=r.configuration.makeFetcher(),a=await o.fetch(t,{cache:e,project:r,fetcher:o,checksums:n,report:s}),l=await K.mktempPromise(),c=k.join(l,"source"),u=k.join(l,"user"),g=k.join(l,".yarn-patch.json");return await Promise.all([K.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),K.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),K.writeJsonPromise(g,{locator:P.stringifyLocator(t),version:i.version})]),K.detachTemp(l),u}async function yO(t,e){let r=j.fromPortablePath(t).replace(/\\/g,"/"),i=j.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await Fr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--text",r,i],{cwd:j.toPortablePath(process.cwd()),env:te(N({},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':
|
|||
|
${s}`);let o=r.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${Se.escapeRegExp(`/${o(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${Se.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(Se.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(Se.escapeRegExp(`${i}/`),"g"),"")}function Lge(t,{configuration:e,report:r}){for(let i of t.parts)for(let n of i.lines)switch(i.type){case Xr.Context:r.reportInfo(null,` ${ae.pretty(e,n,"grey")}`);break;case Xr.Deletion:r.reportError($.FROZEN_LOCKFILE_EXCEPTION,`- ${ae.pretty(e,n,ae.Type.REMOVED)}`);break;case Xr.Insertion:r.reportError($.FROZEN_LOCKFILE_EXCEPTION,`+ ${ae.pretty(e,n,ae.Type.ADDED)}`);break;default:Se.assertNever(i.type)}}var wO=class{supports(e,r){return!!e.reference.startsWith("patch:")}getLocalPath(e,r){return null}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,N({onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${P.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),skipIntegrityCheck:r.skipIntegrityCheck},r.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async patchPackage(e,r){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=BE(e),a=await bE(i,o,r),l=await K.mktempPromise(),c=k.join(l,"current.zip"),u=await r.fetcher.fetch(n,r),g=P.getIdentVendorPath(e),f=await fn(),h=new Ai(c,{libzip:f,create:!0,level:r.project.configuration.get("compressionLevel")});await Se.releaseAfterUseAsync(async()=>{await h.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),h.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let y=new Ai(c,{libzip:f,level:r.project.configuration.get("compressionLevel")}),Q=new _t(k.resolve(Me.root,g),{baseFs:y});try{await qb(Yb(p),{baseFs:Q,version:s})}catch(S){if(!(S instanceof yE))throw S;let x=r.project.configuration.get("enableInlineHunks"),M=!x&&!m?" (set enableInlineHunks for details)":"",Y=`${P.prettyLocator(r.project.configuration,e)}: ${S.message}${M}`,U=J=>{!x||Lge(S.hunk,{configuration:r.project.configuration,report:J})};if(y.discardAndClose(),m){r.report.reportWarningOnce($.PATCH_HUNK_FAILED,Y,{reportExtra:U});continue}else throw new ct($.PATCH_HUNK_FAILED,Y,U)}y.saveAndClose()}return new Ai(c,{libzip:f,level:r.project.configuration.get("compressionLevel")})}};var y9e=3,BO=class{supportsDescriptor(e,r){return!!e.range.startsWith("patch:")}supportsLocator(e,r){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){let{patchPaths:n}=wE(e);return n.every(s=>!EO(s))?e:P.bindDescriptor(e,{locator:P.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:i}=wE(e);return[i]}async getCandidates(e,r,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}=wE(e),a=await bE(n,o,i.fetchOptions),l=r.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=Dn.makeHash(`${y9e}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[mO(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,r,i){return null}async resolve(e,r){let{sourceLocator:i}=BE(e),n=await r.resolver.resolve(i,r);return N(N({},n),e)}};var QE=class extends Le{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 e=await ye.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(r.cwd,this.context.cwd);await r.restoreInstallState();let n=k.resolve(this.context.cwd,j.toPortablePath(this.patchFolder)),s=k.join(n,"../source"),o=k.join(n,"../.yarn-patch.json");if(!K.existsSync(s))throw new Pe("Th
|
|||
|
${o.map(a=>`
|
|||
|
- ${P.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!r.storedPackages.has(s.locatorHash))throw new Pe("No package found in the project for the given locator");await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async o=>{let a=await IO(s,{cache:n,project:r});o.reportJson({locator:P.stringifyLocator(s),path:j.fromPortablePath(a)}),o.reportInfo($.UNNAMED,`Package ${P.prettyLocator(e,s)} got extracted with success!`),o.reportInfo($.UNNAMED,`You can now edit the following folder: ${ae.pretty(e,j.fromPortablePath(a),"magenta")}`),o.reportInfo($.UNNAMED,`Once you are done run ${ae.pretty(e,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${j.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};vE.paths=[["patch"]],vE.usage=Re.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 Oge=vE;var w9e={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:Ie.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:Ie.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[Tge,Oge],fetchers:[wO],resolvers:[BO]},B9e=w9e;var kO={};ft(kO,{default:()=>v9e});var QO=class{supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let i=vO(),n=r.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ae.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ae.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=="undefined")throw new Pe(`Couldn't find ${P.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return s}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let i=vO(),n=r.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ae.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ae.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=k.dirname(a);let l=n.locatorByPath.get(a);if(l)return l}while(o!==a);return null}makeInstaller(e){return new Mge(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},Mge=class{constructor(e){this.opts=e;this.asyncActions=new Se.AsyncActions(10);this.customData={pathByLocator:new Map,locatorByPath:new Map}}getCustomDataKey(){return vO()}attachCustomData(e){}async installPackage(e,r,i){switch(e.linkType){case Qt.SOFT:return this.installPackageSoft(e,r,i);case Qt.HARD:return this.installPackageHard(e,r,i)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,r,i){let n=k.resolve(r.packageFs.getRealPath(),r.prefixPath);return this.customData.pathByLocator.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}async installPackageHard(e,r,i){var u;let n=b9e(e,{project:this.opts.project});this.customData.locatorByPath.set(n,P.stringifyLocator(e)),this.customData.pathByLocator.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await K.mkdirPromise(n,{recursive:!0}),await K.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1})}));let o=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e,a={manifest:(u=await At.tryFind(r.prefixPath,{baseFs:r.packageFs}))!=null?u:new At,misc:{hasBindingGyp:wo.hasBindingGyp(r)}}
|
|||
|
/*!
|
|||
|
* 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.
|
|||
|
*/
|