@seeka-labs/cli-apps 1.1.29 → 1.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
"use strict";var oo=Object.create;var Ot=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var uo=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of so(e))!mo.call(r,o)&&o!==t&&Ot(r,o,{get:()=>e[o],enumerable:!(n=io(e,o))||n.enumerable});return r};var U=(r,e,t)=>(t=r!=null?oo(ao(r)):{},uo(e||!r||!r.__esModule?Ot(t,"default",{value:r,enumerable:!0}):t,r));var kt=x(Ce=>{var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ce.encode=function(r){if(0<=r&&r<Et.length)return Et[r];throw new TypeError("Must be between 0 and 63: "+r)};Ce.decode=function(r){var e=65,t=90,n=97,o=122,i=48,s=57,u=43,a=47,m=26,l=52;return e<=r&&r<=t?r-e:n<=r&&r<=o?r-n+m:i<=r&&r<=s?r-i+l:r==u?62:r==a?63:-1}});var ke=x(Ee=>{var Mt=kt(),Oe=5,Lt=1<<Oe,Tt=Lt-1,jt=Lt;function lo(r){return r<0?(-r<<1)+1:(r<<1)+0}function fo(r){var e=(r&1)===1,t=r>>1;return e?-t:t}Ee.encode=function(e){var t="",n,o=lo(e);do n=o&Tt,o>>>=Oe,o>0&&(n|=jt),t+=Mt.encode(n);while(o>0);return t};Ee.decode=function(e,t,n){var o=e.length,i=0,s=0,u,a;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(a=Mt.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(a&jt),a&=Tt,i=i+(a<<s),s+=Oe}while(u);n.value=fo(i),n.rest=t}});var K=x(O=>{function co(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}O.getArg=co;var Nt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,po=/^data:.+\,.+$/;function ne(r){var e=r.match(Nt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}O.urlParse=ne;function G(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}O.urlGenerate=G;function Me(r){var e=r,t=ne(r);if(t){if(!t.path)return r;e=t.path}for(var n=O.isAbsolute(e),o=e.split(/\/+/),i,s=0,u=o.length-1;u>=0;u--)i=o[u],i==="."?o.splice(u,1):i===".."?s++:s>0&&(i===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,G(t)):e}O.normalize=Me;function It(r,e){r===""&&(r="."),e===""&&(e=".");var t=ne(e),n=ne(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),G(t);if(t||e.match(po))return e;if(n&&!n.host&&!n.path)return n.host=e,G(n);var o=e.charAt(0)==="/"?e:Me(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,G(n)):o}O.join=It;O.isAbsolute=function(r){return r.charAt(0)==="/"||Nt.test(r)};function ho(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}O.relative=ho;var Pt=function(){var r=Object.create(null);return!("__proto__"in r)}();function $t(r){return r}function go(r){return Rt(r)?"$"+r:r}O.toSetString=Pt?$t:go;function vo(r){return Rt(r)?r.slice(1):r}O.fromSetString=Pt?$t:vo;function Rt(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function xo(r,e,t){var n=z(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:z(r.name,e.name)}O.compareByOriginalPositions=xo;function _o(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=z(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:z(r.name,e.name)}O.compareByGeneratedPositionsDeflated=_o;function z(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function yo(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=z(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:z(r.name,e.name)}O.compareByGeneratedPositionsInflated=yo;function bo(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}O.parseSourceMapInput=bo;function wo(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ne(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=It(G(n),e)}return Me(e)}O.computeSourceURL=wo});var je=x(Vt=>{var Le=K(),Te=Object.prototype.hasOwnProperty,F=typeof Map<"u";function I(){this._array=[],this._set=F?new Map:Object.create(null)}I.fromArray=function(e,t){for(var n=new I,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n};I.prototype.size=function(){return F?this._set.size:Object.getOwnPropertyNames(this._set).length};I.prototype.add=function(e,t){var n=F?e:Le.toSetString(e),o=F?this.has(e):Te.call(this._set,n),i=this._array.length;(!o||t)&&this._array.push(e),o||(F?this._set.set(e,i):this._set[n]=i)};I.prototype.has=function(e){if(F)return this._set.has(e);var t=Le.toSetString(e);return Te.call(this._set,t)};I.prototype.indexOf=function(e){if(F){var t=this._set.get(e);if(t>=0)return t}else{var n=Le.toSetString(e);if(Te.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};I.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};I.prototype.toArray=function(){return this._array.slice()};Vt.ArraySet=I});var qt=x(Dt=>{var Ft=K();function So(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||Ft.compareByGeneratedPositionsInflated(r,e)<=0}function ce(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ce.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};ce.prototype.add=function(e){So(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};ce.prototype.toArray=function(){return this._sorted||(this._array.sort(Ft.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Dt.MappingList=ce});var Ne=x(Ht=>{var oe=ke(),S=K(),pe=je().ArraySet,Ao=qt().MappingList;function M(r){r||(r={}),this._file=S.getArg(r,"file",null),this._sourceRoot=S.getArg(r,"sourceRoot",null),this._skipValidation=S.getArg(r,"skipValidation",!1),this._sources=new pe,this._names=new pe,this._mappings=new Ao,this._sourcesContents=null}M.prototype._version=3;M.fromSourceMap=function(e){var t=e.sourceRoot,n=new M({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=S.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=S.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};M.prototype.addMapping=function(e){var t=S.getArg(e,"generated"),n=S.getArg(e,"original",null),o=S.getArg(e,"source",null),i=S.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};M.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=S.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[S.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[S.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};M.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=S.relative(i,o));var s=new pe,u=new pe;this._mappings.unsortedForEach(function(a){if(a.source===o&&a.originalLine!=null){var m=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});m.source!=null&&(a.source=m.source,n!=null&&(a.source=S.join(n,a.source)),i!=null&&(a.source=S.relative(i,a.source)),a.originalLine=m.line,a.originalColumn=m.column,m.name!=null&&(a.name=m.name))}var l=a.source;l!=null&&!s.has(l)&&s.add(l);var c=a.name;c!=null&&!u.has(c)&&u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(a){var m=e.sourceContentFor(a);m!=null&&(n!=null&&(a=S.join(n,a)),i!=null&&(a=S.relative(i,a)),this.setSourceContent(a,m))},this)};M.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};M.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,u="",a,m,l,c,f=this._mappings.toArray(),h=0,g=f.length;h<g;h++){if(m=f[h],a="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)a+=";",t++;else if(h>0){if(!S.compareByGeneratedPositionsInflated(m,f[h-1]))continue;a+=","}a+=oe.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(c=this._sources.indexOf(m.source),a+=oe.encode(c-s),s=c,a+=oe.encode(m.originalLine-1-o),o=m.originalLine-1,a+=oe.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(l=this._names.indexOf(m.name),a+=oe.encode(l-i),i=l)),u+=a}return u};M.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=S.relative(t,n));var o=S.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};M.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};M.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ht.SourceMapGenerator=M});var Bt=x(D=>{D.GREATEST_LOWER_BOUND=1;D.LEAST_UPPER_BOUND=2;function Ie(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,u=o(t,n[s],!0);return u===0?s:u>0?e-s>1?Ie(s,e,t,n,o,i):i==D.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?Ie(r,s,t,n,o,i):i==D.LEAST_UPPER_BOUND?s:r<0?-1:r}D.search=function(e,t,n,o){if(t.length===0)return-1;var i=Ie(-1,t.length,e,t,n,o||D.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var Ut=x(Wt=>{function Pe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Co(r,e){return Math.round(r+Math.random()*(e-r))}function $e(r,e,t,n){if(t<n){var o=Co(t,n),i=t-1;Pe(r,o,n);for(var s=r[n],u=t;u<n;u++)e(r[u],s)<=0&&(i+=1,Pe(r,i,u));Pe(r,i+1,u);var a=i+1;$e(r,e,t,a-1),$e(r,e,a+1,n)}}Wt.quickSort=function(r,e){$e(r,e,0,r.length-1)}});var zt=x(de=>{var p=K(),Re=Bt(),J=je().ArraySet,Oo=ke(),ie=Ut().quickSort;function y(r,e){var t=r;return typeof r=="string"&&(t=p.parseSourceMapInput(r)),t.sections!=null?new T(t,e):new A(t,e)}y.fromSourceMap=function(r,e){return A.fromSourceMap(r,e)};y.prototype._version=3;y.prototype.__generatedMappings=null;Object.defineProperty(y.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});y.prototype.__originalMappings=null;Object.defineProperty(y.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});y.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};y.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};y.GENERATED_ORDER=1;y.ORIGINAL_ORDER=2;y.GREATEST_LOWER_BOUND=1;y.LEAST_UPPER_BOUND=2;y.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||y.GENERATED_ORDER,s;switch(i){case y.GENERATED_ORDER:s=this._generatedMappings;break;case y.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(a){var m=a.source===null?null:this._sources.at(a.source);return m=p.computeSourceURL(u,m,this._sourceMapURL),{source:m,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,o)};y.prototype.allGeneratedPositionsFor=function(e){var t=p.getArg(e,"line"),n={source:p.getArg(e,"source"),originalLine:t,originalColumn:p.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,Re.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};de.SourceMapConsumer=y;function A(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sources"),i=p.getArg(t,"names",[]),s=p.getArg(t,"sourceRoot",null),u=p.getArg(t,"sourcesContent",null),a=p.getArg(t,"mappings"),m=p.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=p.normalize(s)),o=o.map(String).map(p.normalize).map(function(l){return s&&p.isAbsolute(s)&&p.isAbsolute(l)?p.relative(s,l):l}),this._names=J.fromArray(i.map(String),!0),this._sources=J.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(l){return p.computeSourceURL(s,l,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=a,this._sourceMapURL=e,this.file=m}A.prototype=Object.create(y.prototype);A.prototype.consumer=y;A.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=p.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};A.fromSourceMap=function(e,t){var n=Object.create(A.prototype),o=n._names=J.fromArray(e._names.toArray(),!0),i=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return p.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],a=n.__originalMappings=[],m=0,l=s.length;m<l;m++){var c=s[m],f=new Gt;f.generatedLine=c.generatedLine,f.generatedColumn=c.generatedColumn,c.source&&(f.source=i.indexOf(c.source),f.originalLine=c.originalLine,f.originalColumn=c.originalColumn,c.name&&(f.name=o.indexOf(c.name)),a.push(f)),u.push(f)}return ie(n.__originalMappings,p.compareByOriginalPositions),n};A.prototype._version=3;Object.defineProperty(A.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Gt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}A.prototype._parseMappings=function(e,t){for(var n=1,o=0,i=0,s=0,u=0,a=0,m=e.length,l=0,c={},f={},h=[],g=[],_,j,C,W,Ct;l<m;)if(e.charAt(l)===";")n++,l++,o=0;else if(e.charAt(l)===",")l++;else{for(_=new Gt,_.generatedLine=n,W=l;W<m&&!this._charIsMappingSeparator(e,W);W++);if(j=e.slice(l,W),C=c[j],C)l+=j.length;else{for(C=[];l<W;)Oo.decode(e,l,f),Ct=f.value,l=f.rest,C.push(Ct);if(C.length===2)throw new Error("Found a source, but no line and column");if(C.length===3)throw new Error("Found a source and line, but no column");c[j]=C}_.generatedColumn=o+C[0],o=_.generatedColumn,C.length>1&&(_.source=u+C[1],u+=C[1],_.originalLine=i+C[2],i=_.originalLine,_.originalLine+=1,_.originalColumn=s+C[3],s=_.originalColumn,C.length>4&&(_.name=a+C[4],a+=C[4])),g.push(_),typeof _.originalLine=="number"&&h.push(_)}ie(g,p.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,ie(h,p.compareByOriginalPositions),this.__originalMappings=h};A.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Re.search(e,t,i,s)};A.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};A.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",p.compareByGeneratedPositionsDeflated,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=p.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=p.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=p.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:p.getArg(o,"originalLine",null),column:p.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};A.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};A.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=p.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=p.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};A.prototype.generatedPositionFor=function(e){var t=p.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:p.getArg(e,"line"),originalColumn:p.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:p.getArg(i,"generatedLine",null),column:p.getArg(i,"generatedColumn",null),lastColumn:p.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};de.BasicSourceMapConsumer=A;function T(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=p.getArg(s,"offset"),a=p.getArg(u,"line"),m=p.getArg(u,"column");if(a<i.line||a===i.line&&m<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=u,{generatedOffset:{generatedLine:a+1,generatedColumn:m+1},consumer:new y(p.getArg(s,"map"),e)}})}T.prototype=Object.create(y.prototype);T.prototype.constructor=y;T.prototype._version=3;Object.defineProperty(T.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});T.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=Re.search(t,this._sections,function(i,s){var u=i.generatedLine-s.generatedOffset.generatedLine;return u||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};T.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};T.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};T.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(p.getArg(e,"source"))!==-1){var o=n.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};T.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],a=o.consumer._sources.at(u.source);a=p.computeSourceURL(o.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var m=null;u.name&&(m=o.consumer._names.at(u.name),this._names.add(m),m=this._names.indexOf(m));var l={source:a,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:m};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ie(this.__generatedMappings,p.compareByGeneratedPositionsDeflated),ie(this.__originalMappings,p.compareByOriginalPositions)};de.IndexedSourceMapConsumer=T});var Jt=x(Kt=>{var Eo=Ne().SourceMapGenerator,he=K(),ko=/(\r?\n)/,Mo=10,Q="$$$isSourceNode$$$";function k(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=o??null,this[Q]=!0,n!=null&&this.add(n)}k.fromStringWithSourceMap=function(e,t,n){var o=new k,i=e.split(ko),s=0,u=function(){var f=g(),h=g()||"";return f+h;function g(){return s<i.length?i[s++]:void 0}},a=1,m=0,l=null;return t.eachMapping(function(f){if(l!==null)if(a<f.generatedLine)c(l,u()),a++,m=0;else{var h=i[s]||"",g=h.substr(0,f.generatedColumn-m);i[s]=h.substr(f.generatedColumn-m),m=f.generatedColumn,c(l,g),l=f;return}for(;a<f.generatedLine;)o.add(u()),a++;if(m<f.generatedColumn){var h=i[s]||"";o.add(h.substr(0,f.generatedColumn)),i[s]=h.substr(f.generatedColumn),m=f.generatedColumn}l=f},this),s<i.length&&(l&&c(l,u()),o.add(i.splice(s).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=he.join(n,f)),o.setSourceContent(f,h))}),o;function c(f,h){if(f===null||f.source===void 0)o.add(h);else{var g=n?he.join(n,f.source):f.source;o.add(new k(f.originalLine,f.originalColumn,g,h,f.name))}}};k.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Q]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Q]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n<o;n++)t=this.children[n],t[Q]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};k.prototype.join=function(e){var t,n,o=this.children.length;if(o>0){for(t=[],n=0;n<o-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};k.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Q]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};k.prototype.setSourceContent=function(e,t){this.sourceContents[he.toSetString(e)]=t};k.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Q]&&this.children[t].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),t=0,n=o.length;t<n;t++)e(he.fromSetString(o[t]),this.sourceContents[o[t]])};k.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};k.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Eo(e),o=!1,i=null,s=null,u=null,a=null;return this.walk(function(m,l){t.code+=m,l.source!==null&&l.line!==null&&l.column!==null?((i!==l.source||s!==l.line||u!==l.column||a!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),i=l.source,s=l.line,u=l.column,a=l.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,f=m.length;c<f;c++)m.charCodeAt(c)===Mo?(t.line++,t.column=0,c+1===f?(i=null,o=!1):o&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++}),this.walkSourceContents(function(m,l){n.setSourceContent(m,l)}),{code:t.code,map:n}};Kt.SourceNode=k});var Qt=x(ge=>{ge.SourceMapGenerator=Ne().SourceMapGenerator;ge.SourceMapConsumer=zt().SourceMapConsumer;ge.SourceNode=Jt().SourceNode});var Yt=x((Ra,Xt)=>{var Lo=Object.prototype.toString,Ve=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function To(r){return Lo.call(r).slice(8,-1)==="ArrayBuffer"}function jo(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Ve?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function No(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Ve?Buffer.from(r,e):new Buffer(r,e)}function Io(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return To(r)?jo(r,e,t):typeof r=="string"?No(r,e):Ve?Buffer.from(r):new Buffer(r)}Xt.exports=Io});var sr=x((H,He)=>{var Po=Qt().SourceMapConsumer,Fe=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch{}var $o=Yt();function Zt(r,e){return r.require(e)}var er=!1,tr=!1,De=!1,se="auto",q={},ae={},Ro=/^data:application\/json[^,]+base64,/,R=[],V=[];function Be(){return se==="browser"?!0:se==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Vo(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Fo(){return typeof process=="object"&&process!==null?process.version:""}function Do(){if(typeof process=="object"&&process!==null)return process.stderr}function qo(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function ve(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var We=ve(R);R.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,o){return o?"":"/"})),r in q)return q[r];var e="";try{if(N)N.existsSync(r)&&(e=N.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return q[r]=e});function qe(r,e){if(!r)return e;var t=Fe.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),o=n?n[0]:"",i=t.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+Fe.resolve(t.slice(o.length),e).replace(/\\/g,"/")):o+Fe.resolve(t.slice(o.length),e)}function Ho(r){var e;if(Be())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=We(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,s;s=o.exec(e);)i=s;return i?i[1]:null}var Ue=ve(V);V.push(function(r){var e=Ho(r);if(!e)return null;var t;if(Ro.test(e)){var n=e.slice(e.indexOf(",")+1);t=$o(n,"base64").toString(),e=r}else e=qe(r,e),t=We(e);return t?{url:e,map:t}:null});function Ge(r){var e=ae[r.source];if(!e){var t=Ue(r.source);t?(e=ae[r.source]={url:t.url,map:new Po(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var s=e.map.sourcesContent[i];if(s){var u=qe(e.url,o);q[u]=s}})):e=ae[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=qe(e.url,n.source),n}return r}function nr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Ge({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+nr(e[2])+")":r}function Bo(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,u=this.isConstructor(),a=!(this.isToplevel()||u);if(a){var m=this.getTypeName();m==="[object Object]"&&(m="null");var l=this.getMethodName();i?(m&&i.indexOf(m)!=0&&(o+=m+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=m+"."+(l||"<anonymous>")}else u?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function rr(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Bo,e}function or(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(Fo())?0:62;n===1&&o>s&&!Be()&&!r.isEval()&&(o-=s);var u=Ge({source:t,line:n,column:o});e.curPosition=u,r=rr(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return u.source},r.getLineNumber=function(){return u.line},r.getColumnNumber=function(){return u.column+1},r.getScriptNameOrSourceURL=function(){return u.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=nr(m),r=rr(r),r.getEvalOrigin=function(){return m}),r}function Wo(r,e){De&&(q={},ae={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],u=e.length-1;u>=0;u--)s.push(`
|
|
3
|
-
at `+
|
|
2
|
+
"use strict";var ao=Object.create;var Tt=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var lo=Object.getPrototypeOf,fo=Object.prototype.hasOwnProperty;var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var co=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of uo(e))!fo.call(r,o)&&o!==t&&Tt(r,o,{get:()=>e[o],enumerable:!(n=mo(e,o))||n.enumerable});return r};var B=(r,e,t)=>(t=r!=null?ao(lo(r)):{},co(e||!r||!r.__esModule?Tt(t,"default",{value:r,enumerable:!0}):t,r));var Mt=_(Oe=>{var Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Oe.encode=function(r){if(0<=r&&r<Lt.length)return Lt[r];throw new TypeError("Must be between 0 and 63: "+r)};Oe.decode=function(r){var e=65,t=90,n=97,o=122,i=48,s=57,a=43,u=47,m=26,l=52;return e<=r&&r<=t?r-e:n<=r&&r<=o?r-n+m:i<=r&&r<=s?r-i+l:r==a?62:r==u?63:-1}});var Te=_(ke=>{var jt=Mt(),Ee=5,It=1<<Ee,Pt=It-1,Nt=It;function po(r){return r<0?(-r<<1)+1:(r<<1)+0}function ho(r){var e=(r&1)===1,t=r>>1;return e?-t:t}ke.encode=function(e){var t="",n,o=po(e);do n=o&Pt,o>>>=Ee,o>0&&(n|=Nt),t+=jt.encode(n);while(o>0);return t};ke.decode=function(e,t,n){var o=e.length,i=0,s=0,a,u;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=jt.decode(e.charCodeAt(t++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));a=!!(u&Nt),u&=Pt,i=i+(u<<s),s+=Ee}while(a);n.value=ho(i),n.rest=t}});var K=_(O=>{function go(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}O.getArg=go;var $t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_o=/^data:.+\,.+$/;function ne(r){var e=r.match($t);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}O.urlParse=ne;function U(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}O.urlGenerate=U;function Le(r){var e=r,t=ne(r);if(t){if(!t.path)return r;e=t.path}for(var n=O.isAbsolute(e),o=e.split(/\/+/),i,s=0,a=o.length-1;a>=0;a--)i=o[a],i==="."?o.splice(a,1):i===".."?s++:s>0&&(i===""?(o.splice(a+1,s),s=0):(o.splice(a,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,U(t)):e}O.normalize=Le;function Rt(r,e){r===""&&(r="."),e===""&&(e=".");var t=ne(e),n=ne(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),U(t);if(t||e.match(_o))return e;if(n&&!n.host&&!n.path)return n.host=e,U(n);var o=e.charAt(0)==="/"?e:Le(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,U(n)):o}O.join=Rt;O.isAbsolute=function(r){return r.charAt(0)==="/"||$t.test(r)};function vo(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}O.relative=vo;var Ft=function(){var r=Object.create(null);return!("__proto__"in r)}();function Vt(r){return r}function xo(r){return Dt(r)?"$"+r:r}O.toSetString=Ft?Vt:xo;function yo(r){return Dt(r)?r.slice(1):r}O.fromSetString=Ft?Vt:yo;function Dt(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function bo(r,e,t){var n=z(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:z(r.name,e.name)}O.compareByOriginalPositions=bo;function wo(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=z(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:z(r.name,e.name)}O.compareByGeneratedPositionsDeflated=wo;function z(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function Co(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=z(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:z(r.name,e.name)}O.compareByGeneratedPositionsInflated=Co;function So(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}O.parseSourceMapInput=So;function Ao(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ne(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Rt(U(n),e)}return Le(e)}O.computeSourceURL=Ao});var Ie=_(Gt=>{var Me=K(),je=Object.prototype.hasOwnProperty,F=typeof Map<"u";function I(){this._array=[],this._set=F?new Map:Object.create(null)}I.fromArray=function(e,t){for(var n=new I,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n};I.prototype.size=function(){return F?this._set.size:Object.getOwnPropertyNames(this._set).length};I.prototype.add=function(e,t){var n=F?e:Me.toSetString(e),o=F?this.has(e):je.call(this._set,n),i=this._array.length;(!o||t)&&this._array.push(e),o||(F?this._set.set(e,i):this._set[n]=i)};I.prototype.has=function(e){if(F)return this._set.has(e);var t=Me.toSetString(e);return je.call(this._set,t)};I.prototype.indexOf=function(e){if(F){var t=this._set.get(e);if(t>=0)return t}else{var n=Me.toSetString(e);if(je.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};I.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};I.prototype.toArray=function(){return this._array.slice()};Gt.ArraySet=I});var Wt=_(Ht=>{var qt=K();function Oo(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||qt.compareByGeneratedPositionsInflated(r,e)<=0}function ce(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ce.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};ce.prototype.add=function(e){Oo(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};ce.prototype.toArray=function(){return this._sorted||(this._array.sort(qt.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ht.MappingList=ce});var Pe=_(Bt=>{var oe=Te(),C=K(),pe=Ie().ArraySet,Eo=Wt().MappingList;function T(r){r||(r={}),this._file=C.getArg(r,"file",null),this._sourceRoot=C.getArg(r,"sourceRoot",null),this._skipValidation=C.getArg(r,"skipValidation",!1),this._sources=new pe,this._names=new pe,this._mappings=new Eo,this._sourcesContents=null}T.prototype._version=3;T.fromSourceMap=function(e){var t=e.sourceRoot,n=new T({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=C.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=C.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};T.prototype.addMapping=function(e){var t=C.getArg(e,"generated"),n=C.getArg(e,"original",null),o=C.getArg(e,"source",null),i=C.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};T.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=C.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[C.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[C.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};T.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=C.relative(i,o));var s=new pe,a=new pe;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var m=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});m.source!=null&&(u.source=m.source,n!=null&&(u.source=C.join(n,u.source)),i!=null&&(u.source=C.relative(i,u.source)),u.originalLine=m.line,u.originalColumn=m.column,m.name!=null&&(u.name=m.name))}var l=u.source;l!=null&&!s.has(l)&&s.add(l);var f=u.name;f!=null&&!a.has(f)&&a.add(f)},this),this._sources=s,this._names=a,e.sources.forEach(function(u){var m=e.sourceContentFor(u);m!=null&&(n!=null&&(u=C.join(n,u)),i!=null&&(u=C.relative(i,u)),this.setSourceContent(u,m))},this)};T.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};T.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,a="",u,m,l,f,c=this._mappings.toArray(),h=0,x=c.length;h<x;h++){if(m=c[h],u="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)u+=";",t++;else if(h>0){if(!C.compareByGeneratedPositionsInflated(m,c[h-1]))continue;u+=","}u+=oe.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(f=this._sources.indexOf(m.source),u+=oe.encode(f-s),s=f,u+=oe.encode(m.originalLine-1-o),o=m.originalLine-1,u+=oe.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(l=this._names.indexOf(m.name),u+=oe.encode(l-i),i=l)),a+=u}return a};T.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=C.relative(t,n));var o=C.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};T.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};T.prototype.toString=function(){return JSON.stringify(this.toJSON())};Bt.SourceMapGenerator=T});var Ut=_(V=>{V.GREATEST_LOWER_BOUND=1;V.LEAST_UPPER_BOUND=2;function Ne(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,a=o(t,n[s],!0);return a===0?s:a>0?e-s>1?Ne(s,e,t,n,o,i):i==V.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?Ne(r,s,t,n,o,i):i==V.LEAST_UPPER_BOUND?s:r<0?-1:r}V.search=function(e,t,n,o){if(t.length===0)return-1;var i=Ne(-1,t.length,e,t,n,o||V.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var Kt=_(zt=>{function $e(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function ko(r,e){return Math.round(r+Math.random()*(e-r))}function Re(r,e,t,n){if(t<n){var o=ko(t,n),i=t-1;$e(r,o,n);for(var s=r[n],a=t;a<n;a++)e(r[a],s)<=0&&(i+=1,$e(r,i,a));$e(r,i+1,a);var u=i+1;Re(r,e,t,u-1),Re(r,e,u+1,n)}}zt.quickSort=function(r,e){Re(r,e,0,r.length-1)}});var Qt=_(de=>{var p=K(),Fe=Ut(),J=Ie().ArraySet,To=Te(),ie=Kt().quickSort;function y(r,e){var t=r;return typeof r=="string"&&(t=p.parseSourceMapInput(r)),t.sections!=null?new M(t,e):new S(t,e)}y.fromSourceMap=function(r,e){return S.fromSourceMap(r,e)};y.prototype._version=3;y.prototype.__generatedMappings=null;Object.defineProperty(y.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});y.prototype.__originalMappings=null;Object.defineProperty(y.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});y.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};y.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};y.GENERATED_ORDER=1;y.ORIGINAL_ORDER=2;y.GREATEST_LOWER_BOUND=1;y.LEAST_UPPER_BOUND=2;y.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||y.GENERATED_ORDER,s;switch(i){case y.GENERATED_ORDER:s=this._generatedMappings;break;case y.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(u){var m=u.source===null?null:this._sources.at(u.source);return m=p.computeSourceURL(a,m,this._sourceMapURL),{source:m,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)};y.prototype.allGeneratedPositionsFor=function(e){var t=p.getArg(e,"line"),n={source:p.getArg(e,"source"),originalLine:t,originalColumn:p.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,Fe.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var u=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==u;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};de.SourceMapConsumer=y;function S(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sources"),i=p.getArg(t,"names",[]),s=p.getArg(t,"sourceRoot",null),a=p.getArg(t,"sourcesContent",null),u=p.getArg(t,"mappings"),m=p.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=p.normalize(s)),o=o.map(String).map(p.normalize).map(function(l){return s&&p.isAbsolute(s)&&p.isAbsolute(l)?p.relative(s,l):l}),this._names=J.fromArray(i.map(String),!0),this._sources=J.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(l){return p.computeSourceURL(s,l,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=u,this._sourceMapURL=e,this.file=m}S.prototype=Object.create(y.prototype);S.prototype.consumer=y;S.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=p.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};S.fromSourceMap=function(e,t){var n=Object.create(S.prototype),o=n._names=J.fromArray(e._names.toArray(),!0),i=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return p.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],u=n.__originalMappings=[],m=0,l=s.length;m<l;m++){var f=s[m],c=new Jt;c.generatedLine=f.generatedLine,c.generatedColumn=f.generatedColumn,f.source&&(c.source=i.indexOf(f.source),c.originalLine=f.originalLine,c.originalColumn=f.originalColumn,f.name&&(c.name=o.indexOf(f.name)),u.push(c)),a.push(c)}return ie(n.__originalMappings,p.compareByOriginalPositions),n};S.prototype._version=3;Object.defineProperty(S.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Jt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}S.prototype._parseMappings=function(e,t){for(var n=1,o=0,i=0,s=0,a=0,u=0,m=e.length,l=0,f={},c={},h=[],x=[],w,H,A,W,kt;l<m;)if(e.charAt(l)===";")n++,l++,o=0;else if(e.charAt(l)===",")l++;else{for(w=new Jt,w.generatedLine=n,W=l;W<m&&!this._charIsMappingSeparator(e,W);W++);if(H=e.slice(l,W),A=f[H],A)l+=H.length;else{for(A=[];l<W;)To.decode(e,l,c),kt=c.value,l=c.rest,A.push(kt);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");f[H]=A}w.generatedColumn=o+A[0],o=w.generatedColumn,A.length>1&&(w.source=a+A[1],a+=A[1],w.originalLine=i+A[2],i=w.originalLine,w.originalLine+=1,w.originalColumn=s+A[3],s=w.originalColumn,A.length>4&&(w.name=u+A[4],u+=A[4])),x.push(w),typeof w.originalLine=="number"&&h.push(w)}ie(x,p.compareByGeneratedPositionsDeflated),this.__generatedMappings=x,ie(h,p.compareByOriginalPositions),this.__originalMappings=h};S.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Fe.search(e,t,i,s)};S.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};S.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",p.compareByGeneratedPositionsDeflated,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=p.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=p.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=p.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:p.getArg(o,"originalLine",null),column:p.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};S.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};S.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=p.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=p.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};S.prototype.generatedPositionFor=function(e){var t=p.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:p.getArg(e,"line"),originalColumn:p.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:p.getArg(i,"generatedLine",null),column:p.getArg(i,"generatedColumn",null),lastColumn:p.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};de.BasicSourceMapConsumer=S;function M(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=p.getArg(s,"offset"),u=p.getArg(a,"line"),m=p.getArg(a,"column");if(u<i.line||u===i.line&&m<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:u+1,generatedColumn:m+1},consumer:new y(p.getArg(s,"map"),e)}})}M.prototype=Object.create(y.prototype);M.prototype.constructor=y;M.prototype._version=3;Object.defineProperty(M.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});M.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=Fe.search(t,this._sections,function(i,s){var a=i.generatedLine-s.generatedOffset.generatedLine;return a||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};M.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};M.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};M.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(p.getArg(e,"source"))!==-1){var o=n.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};M.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],u=o.consumer._sources.at(a.source);u=p.computeSourceURL(o.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var m=null;a.name&&(m=o.consumer._names.at(a.name),this._names.add(m),m=this._names.indexOf(m));var l={source:u,generatedLine:a.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(o.generatedOffset.generatedLine===a.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:m};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ie(this.__generatedMappings,p.compareByGeneratedPositionsDeflated),ie(this.__originalMappings,p.compareByOriginalPositions)};de.IndexedSourceMapConsumer=M});var Yt=_(Xt=>{var Lo=Pe().SourceMapGenerator,he=K(),Mo=/(\r?\n)/,jo=10,Q="$$$isSourceNode$$$";function k(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=o??null,this[Q]=!0,n!=null&&this.add(n)}k.fromStringWithSourceMap=function(e,t,n){var o=new k,i=e.split(Mo),s=0,a=function(){var c=x(),h=x()||"";return c+h;function x(){return s<i.length?i[s++]:void 0}},u=1,m=0,l=null;return t.eachMapping(function(c){if(l!==null)if(u<c.generatedLine)f(l,a()),u++,m=0;else{var h=i[s]||"",x=h.substr(0,c.generatedColumn-m);i[s]=h.substr(c.generatedColumn-m),m=c.generatedColumn,f(l,x),l=c;return}for(;u<c.generatedLine;)o.add(a()),u++;if(m<c.generatedColumn){var h=i[s]||"";o.add(h.substr(0,c.generatedColumn)),i[s]=h.substr(c.generatedColumn),m=c.generatedColumn}l=c},this),s<i.length&&(l&&f(l,a()),o.add(i.splice(s).join(""))),t.sources.forEach(function(c){var h=t.sourceContentFor(c);h!=null&&(n!=null&&(c=he.join(n,c)),o.setSourceContent(c,h))}),o;function f(c,h){if(c===null||c.source===void 0)o.add(h);else{var x=n?he.join(n,c.source):c.source;o.add(new k(c.originalLine,c.originalColumn,x,h,c.name))}}};k.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Q]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Q]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n<o;n++)t=this.children[n],t[Q]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};k.prototype.join=function(e){var t,n,o=this.children.length;if(o>0){for(t=[],n=0;n<o-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};k.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Q]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};k.prototype.setSourceContent=function(e,t){this.sourceContents[he.toSetString(e)]=t};k.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Q]&&this.children[t].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),t=0,n=o.length;t<n;t++)e(he.fromSetString(o[t]),this.sourceContents[o[t]])};k.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};k.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Lo(e),o=!1,i=null,s=null,a=null,u=null;return this.walk(function(m,l){t.code+=m,l.source!==null&&l.line!==null&&l.column!==null?((i!==l.source||s!==l.line||a!==l.column||u!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),i=l.source,s=l.line,a=l.column,u=l.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var f=0,c=m.length;f<c;f++)m.charCodeAt(f)===jo?(t.line++,t.column=0,f+1===c?(i=null,o=!1):o&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++}),this.walkSourceContents(function(m,l){n.setSourceContent(m,l)}),{code:t.code,map:n}};Xt.SourceNode=k});var Zt=_(ge=>{ge.SourceMapGenerator=Pe().SourceMapGenerator;ge.SourceMapConsumer=Qt().SourceMapConsumer;ge.SourceNode=Yt().SourceNode});var tr=_((Da,er)=>{var Io=Object.prototype.toString,Ve=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Po(r){return Io.call(r).slice(8,-1)==="ArrayBuffer"}function No(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Ve?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function $o(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Ve?Buffer.from(r,e):new Buffer(r,e)}function Ro(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return Po(r)?No(r,e,t):typeof r=="string"?$o(r,e):Ve?Buffer.from(r):new Buffer(r)}er.exports=Ro});var ur=_((G,He)=>{var Fo=Zt().SourceMapConsumer,De=require("path"),j;try{j=require("fs"),(!j.existsSync||!j.readFileSync)&&(j=null)}catch{}var Vo=tr();function rr(r,e){return r.require(e)}var nr=!1,or=!1,Ge=!1,se="auto",D={},ae={},Do=/^data:application\/json[^,]+base64,/,$=[],R=[];function We(){return se==="browser"?!0:se==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Go(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function qo(){return typeof process=="object"&&process!==null?process.version:""}function Ho(){if(typeof process=="object"&&process!==null)return process.stderr}function Wo(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function _e(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var Be=_e($);$.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,o){return o?"":"/"})),r in D)return D[r];var e="";try{if(j)j.existsSync(r)&&(e=j.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return D[r]=e});function qe(r,e){if(!r)return e;var t=De.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),o=n?n[0]:"",i=t.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+De.resolve(t.slice(o.length),e).replace(/\\/g,"/")):o+De.resolve(t.slice(o.length),e)}function Bo(r){var e;if(We())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=Be(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,s;s=o.exec(e);)i=s;return i?i[1]:null}var Ue=_e(R);R.push(function(r){var e=Bo(r);if(!e)return null;var t;if(Do.test(e)){var n=e.slice(e.indexOf(",")+1);t=Vo(n,"base64").toString(),e=r}else e=qe(r,e),t=Be(e);return t?{url:e,map:t}:null});function ze(r){var e=ae[r.source];if(!e){var t=Ue(r.source);t?(e=ae[r.source]={url:t.url,map:new Fo(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var s=e.map.sourcesContent[i];if(s){var a=qe(e.url,o);D[a]=s}})):e=ae[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=qe(e.url,n.source),n}return r}function sr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=ze({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+sr(e[2])+")":r}function Uo(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,a=this.isConstructor(),u=!(this.isToplevel()||a);if(u){var m=this.getTypeName();m==="[object Object]"&&(m="null");var l=this.getMethodName();i?(m&&i.indexOf(m)!=0&&(o+=m+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=m+"."+(l||"<anonymous>")}else a?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function ir(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Uo,e}function ar(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(qo())?0:62;n===1&&o>s&&!We()&&!r.isEval()&&(o-=s);var a=ze({source:t,line:n,column:o});e.curPosition=a,r=ir(r);var u=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},r.getFileName=function(){return a.source},r.getLineNumber=function(){return a.line},r.getColumnNumber=function(){return a.column+1},r.getScriptNameOrSourceURL=function(){return a.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=sr(m),r=ir(r),r.getEvalOrigin=function(){return m}),r}function zo(r,e){Ge&&(D={},ae={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],a=e.length-1;a>=0;a--)s.push(`
|
|
3
|
+
at `+ar(e[a],i)),i.nextPosition=i.curPosition;return i.curPosition=i.nextPosition=null,o+s.reverse().join("")}function mr(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],o=+e[3],i=D[t];if(!i&&j&&j.existsSync(t))try{i=j.readFileSync(t,"utf8")}catch{i=""}if(i){var s=i.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return t+":"+n+`
|
|
4
4
|
`+s+`
|
|
5
|
-
`+new Array(o).join(" ")+"^"}}return null}function
|
|
6
|
-
`).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
`+new Array(o).join(" ")+"^"}}return null}function Ko(r){var e=mr(r),t=Ho();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),Wo(1)}function Jo(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return Ko(arguments[1])}return r.apply(this,arguments)}}var Qo=$.slice(0),Xo=R.slice(0);G.wrapCallSite=ar;G.getErrorSource=mr;G.mapSourcePosition=ze;G.retrieveSourceMap=Ue;G.install=function(r){if(r=r||{},r.environment&&(se=r.environment,["node","browser","auto"].indexOf(se)===-1))throw new Error("environment "+se+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&($.length=0),$.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(R.length=0),R.unshift(r.retrieveSourceMap)),r.hookRequire&&!We()){var e=rr(He,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return D[s]=i,ae[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(Ge||(Ge="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),nr||(nr=!0,Error.prepareStackTrace=zo),!or){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=rr(He,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Go()&&(or=!0,Jo())}};G.resetRetrieveHandlers=function(){$.length=0,R.length=0,$=Qo.slice(0),R=Xo.slice(0),Ue=_e(R),Be=_e($)}});var me=_(Je=>{var ve=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Ke=class extends ve{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Je.CommanderError=ve;Je.InvalidArgumentError=Ke});var xe=_(Xe=>{var{InvalidArgumentError:Yo}=me(),Qe=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Yo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Zo(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Xe.Argument=Qe;Xe.humanReadableArgName=Zo});var et=_(Ze=>{var{humanReadableArgName:ei}=xe(),Ye=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((o,i)=>o.name().localeCompare(i.name())),t}compareOptions(e,t){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!o&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!o&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);t.push(...o)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>ei(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,o)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(o)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(o)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(o)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,o)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(o)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let o=new Map;return e.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[])}),t.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[]),o.get(s).push(i)}),o}formatHelp(e,t){let n=t.padWidth(e,t),o=t.helpWidth??80;function i(f,c){return t.formatItem(f,n,c,t)}let s=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(s=s.concat([t.boxWrap(t.styleCommandDescription(a),o),""]));let u=t.visibleArguments(e).map(f=>i(t.styleArgumentTerm(t.argumentTerm(f)),t.styleArgumentDescription(t.argumentDescription(f))));if(s=s.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),f=>f.helpGroupHeading??"Options:").forEach((f,c)=>{let h=f.map(x=>i(t.styleOptionTerm(t.optionTerm(x)),t.styleOptionDescription(t.optionDescription(x))));s=s.concat(this.formatItemList(c,h,t))}),t.showGlobalOptions){let f=t.visibleGlobalOptions(e).map(c=>i(t.styleOptionTerm(t.optionTerm(c)),t.styleOptionDescription(t.optionDescription(c))));s=s.concat(this.formatItemList("Global Options:",f,t))}return this.groupItems(e.commands,t.visibleCommands(e),f=>f.helpGroup()||"Commands:").forEach((f,c)=>{let h=f.map(x=>i(t.styleSubcommandTerm(t.subcommandTerm(x)),t.styleSubcommandDescription(t.subcommandDescription(x))));s=s.concat(this.formatItemList(c,h,t))}),s.join(`
|
|
6
|
+
`)}displayWidth(e){return lr(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,o){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(t+e.length-o.displayWidth(e)),u=2,l=(this.helpWidth??80)-t-u-2,f;return l<this.minWidthToWrap||o.preformatted(n)?f=n:f=o.boxWrap(n,l).replace(/\n/g,`
|
|
7
|
+
`+" ".repeat(t+u)),s+a+" ".repeat(u)+f.replace(/\n/g,`
|
|
8
|
+
${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,i=[];return n.forEach(s=>{let a=s.match(o);if(a===null){i.push("");return}let u=[a.shift()],m=this.displayWidth(u[0]);a.forEach(l=>{let f=this.displayWidth(l);if(m+f<=t){u.push(l),m+=f;return}i.push(u.join(""));let c=l.trimStart();u=[c],m=this.displayWidth(c)}),i.push(u.join(""))}),i.join(`
|
|
9
|
+
`)}};function lr(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}Ze.Help=Ye;Ze.stripColor=lr});var ot=_(nt=>{var{InvalidArgumentError:ti}=me(),tt=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=ri(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new ti(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?fr(this.name().replace(/^no-/,"")):fr(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},rt=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return t.negate===(i===e)}};function fr(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ri(r){let e,t,n=/^-[^-]$/,o=/^--[^-]/,i=r.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(e=i.shift()),o.test(i[0])&&(t=i.shift()),!e&&n.test(i[0])&&(e=i.shift()),!e&&o.test(i[0])&&(e=t,t=i.shift()),i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${r}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
10
|
+
- a short flag is a single dash and a single character
|
|
11
|
+
- either use a single dash and a single character (for a short flag)
|
|
12
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
13
|
+
- too many short flags`):o.test(s)?new Error(`${a}
|
|
14
|
+
- too many long flags`):new Error(`${a}
|
|
15
|
+
- unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:e,longFlag:t}}nt.Option=tt;nt.DualOptions=rt});var pr=_(cr=>{function ni(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=r.length;o++){let i=1;r[o-1]===e[n-1]?i=0:i=1,t[o][n]=Math.min(t[o-1][n]+1,t[o][n-1]+1,t[o-1][n-1]+i),o>1&&n>1&&r[o-1]===e[n-2]&&r[o-2]===e[n-1]&&(t[o][n]=Math.min(t[o][n],t[o-2][n-2]+1))}return t[r.length][e.length]}function oi(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(s=>s.slice(2)));let n=[],o=3,i=.4;return e.forEach(s=>{if(s.length<=1)return;let a=ni(r,s),u=Math.max(r.length,s.length);(u-a)/u>i&&(a<o?(o=a,n=[s]):a===o&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),t&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
13
16
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
14
|
-
(Did you mean ${n[0]}?)`:""}
|
|
15
|
-
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new
|
|
16
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new
|
|
17
|
-
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=o=>[o.name()].concat(o.aliases()),n=t(e).find(o=>this._findCommand(o));if(n){let o=t(this._findCommand(n)).join("|"),i=t(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(i,s,
|
|
18
|
-
|
|
17
|
+
(Did you mean ${n[0]}?)`:""}cr.suggestSimilar=oi});var _r=_(ut=>{var ii=require("node:events").EventEmitter,it=require("node:child_process"),P=require("node:path"),ye=require("node:fs"),v=require("node:process"),{Argument:si,humanReadableArgName:ai}=xe(),{CommanderError:st}=me(),{Help:mi,stripColor:ui}=et(),{Option:dr,DualOptions:li}=ot(),{suggestSimilar:hr}=pr(),at=class r extends ii{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>v.stdout.write(t),writeErr:t=>v.stderr.write(t),outputError:(t,n)=>n(t),getOutHelpWidth:()=>v.stdout.isTTY?v.stdout.columns:void 0,getErrHelpWidth:()=>v.stderr.isTTY?v.stderr.columns:void 0,getOutHasColors:()=>mt()??(v.stdout.isTTY&&v.stdout.hasColors?.()),getErrHasColors:()=>mt()??(v.stderr.isTTY&&v.stderr.hasColors?.()),stripColor:t=>ui(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let o=t,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return o&&(u.description(o),u._executableHandler=!0),i.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(i.noHelp||i.hidden),u._executableFile=i.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),o?this:u}createCommand(e){return new r(e)}createHelp(){return Object.assign(new mi,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
18
|
+
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new si(e,t)}argument(e,t,n,o){let i=this.createArgument(e,t);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,o,i]=n.match(/([^ ]+) *(.*)/),s=t??"display help for command",a=this.createCommand(o);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
19
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new st(e,t,n)),v.exit(e)}action(e){let t=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=t,this}createOption(e,t){return new dr(e,t)}_callParseArg(e,t,n,o){try{return e.parseArg(t,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
20
|
+
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=o=>[o.name()].concat(o.aliases()),n=t(e).find(o=>this._findCommand(o));if(n){let o=t(this._findCommand(n)).join("|"),i=t(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(i,s,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let u=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,u,s):i!==null&&e.variadic&&(i=e._concatValue(i,u)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+t,i=>{let s=`error: option '${e.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,i=>{let s=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(e,t,n,o,i){if(typeof t=="object"&&t instanceof dr)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let a=o;o=(u,m)=>{let l=a.exec(u);return l?l[0]:m},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(e,t,n,o){return this._optionEx({},e,t,n,o)}requiredOption(e,t,n,o){return this._optionEx({mandatory:!0},e,t,n,o)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){v.versions?.electron&&(t.from="electron");let o=v.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(t.from="eval")}e===void 0&&(e=v.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":v.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
21
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(ye.existsSync(e))return;let o=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${e}' does not exist
|
|
22
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
19
23
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
20
|
-
- ${
|
|
24
|
+
- ${o}`;throw new Error(i)}_executeSubCommand(e,t){t=t.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,f){let c=P.resolve(l,f);if(ye.existsSync(c))return c;if(o.includes(P.extname(f)))return;let h=o.find(x=>ye.existsSync(`${c}${x}`));if(h)return`${c}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=ye.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=P.resolve(P.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=P.basename(this._scriptPath,P.extname(this._scriptPath));f!==this._name&&(l=i(a,`${f}-${e._name}`))}s=l||s}n=o.includes(P.extname(s));let u;v.platform!=="win32"?n?(t.unshift(s),t=gr(v.execArgv).concat(t),u=it.spawn(v.argv[0],t,{stdio:"inherit"})):u=it.spawn(s,t,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),t.unshift(s),t=gr(v.execArgv).concat(t),u=it.spawn(v.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{v.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let m=this._exitCallback;u.on("close",l=>{l=l??1,m?m(new st(l,"commander.executeSubCommandAsync","(close)")):v.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!m)v.exit(1);else{let f=new st(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,m(f)}}),this.runningCommand=u}_dispatchSubcommand(e,t,n){let o=this._findCommand(e);o||this.help({error:!0}),o._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,t.concat(n));else return o._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,a)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,a)=>e(n,a,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=e(n,i,n.defaultValue))),t[o]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[t]!==void 0).forEach(i=>{i._lifeCycleHooks[t].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),t==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,t))}),o}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],o=t,i=e.slice();function s(m){return m.length>1&&m[0]==="-"}let a=m=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(m)?!this._getCommandAndAncestors().some(l=>l.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,u=null;for(;i.length;){let m=i.shift();if(m==="--"){o===n&&o.push(m),o.push(...i);break}if(u&&(!s(m)||a(m))){this.emit(`option:${u.name()}`,m);continue}if(u=null,s(m)){let l=this._findOption(m);if(l){if(l.required){let f=i.shift();f===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,f)}else if(l.optional){let f=null;i.length>0&&(!s(i[0])||a(i[0]))&&(f=i.shift()),this.emit(`option:${l.name()}`,f)}else this.emit(`option:${l.name()}`);u=l.variadic?l:null;continue}}if(m.length>2&&m[0]==="-"&&m[1]!=="-"){let l=this._findOption(`-${m[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,m.slice(2)):(this.emit(`option:${l.name()}`),i.unshift(`-${m.slice(2)}`));continue}}if(/^--[^=]+=/.test(m)){let l=m.indexOf("="),f=this._findOption(m.slice(0,l));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,m.slice(l+1));continue}}if(o===t&&s(m)&&!(this.commands.length===0&&a(m))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(m)){t.push(m),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&m===this._getHelpCommand().name()){t.push(m),i.length>0&&t.push(...i);break}else if(this._defaultCommandName){n.push(m),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){o.push(m),i.length>0&&o.push(...i);break}o.push(m)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
|
|
21
25
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
22
26
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
23
|
-
`),this.outputHelp({error:!0}));let n=t||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in
|
|
24
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>
|
|
27
|
+
`),this.outputHelp({error:!0}));let n=t||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in v.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,v.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new li(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!t(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),m=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return m&&(m.presetArg===void 0&&u===!1||m.presetArg!==void 0&&u===m.presetArg)?m:l||s},o=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${o(e)} cannot be used with ${o(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);t=hr(e,o)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),t=hr(e,o)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let o=this.createOption(t,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
28
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>ai(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=P.basename(e,P.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=t.formatHelp(this,t);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(e){e=e||{};let t=!!e.error,n,o,i;return t?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:i}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getOutputContext(e),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",o))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(v.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
25
29
|
Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let s;typeof t=="function"?s=t({error:i.error,command:i.command}):s=t,s&&i.write(`${s}
|
|
26
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?t=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],o=i[4]),t&&o!=="0"?`${t}=${n}:${parseInt(o)+1}`:e})}pr.Command=st});var xr=x(L=>{var{Argument:hr}=_e(),{Command:at}=dr(),{CommanderError:mi,InvalidArgumentError:gr}=me(),{Help:ui}=Ye(),{Option:vr}=rt();L.program=new at;L.createCommand=r=>new at(r);L.createOption=(r,e)=>new vr(r,e);L.createArgument=(r,e)=>new hr(r,e);L.Command=at;L.Option=vr;L.Argument=hr;L.Help=ui;L.CommanderError=mi;L.InvalidArgumentError=gr;L.InvalidOptionArgumentError=gr});var Mr=x((rm,kr)=>{kr.exports=Er;Er.sync=vi;var Cr=require("fs");function gi(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var o=t[n].toLowerCase();if(o&&r.substr(-o.length).toLowerCase()===o)return!0}return!1}function Or(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:gi(e,t)}function Er(r,e,t){Cr.stat(r,function(n,o){t(n,n?!1:Or(o,r,e))})}function vi(r,e){return Or(Cr.statSync(r),r,e)}});var Ir=x((nm,Nr)=>{Nr.exports=Tr;Tr.sync=xi;var Lr=require("fs");function Tr(r,e,t){Lr.stat(r,function(n,o){t(n,n?!1:jr(o,e))})}function xi(r,e){return jr(Lr.statSync(r),e)}function jr(r,e){return r.isFile()&&_i(r,e)}function _i(r,e){var t=r.mode,n=r.uid,o=r.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),m=parseInt("001",8),l=u|a,c=t&m||t&a&&o===s||t&u&&n===i||t&l&&i===0;return c}});var $r=x((im,Pr)=>{var om=require("fs"),ye;process.platform==="win32"||global.TESTING_WINDOWS?ye=Mr():ye=Ir();Pr.exports=lt;lt.sync=yi;function lt(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){lt(r,e||{},function(i,s){i?o(i):n(s)})})}ye(r,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),t(n,o)})}function yi(r,e){try{return ye.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Br=x((sm,Hr)=>{var X=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Rr=require("path"),bi=X?";":":",Vr=$r(),Fr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Dr=(r,e)=>{let t=e.colon||bi,n=r.match(/\//)||X&&r.match(/\\/)?[""]:[...X?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=X?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=X?o.split(t):[""];return X&&r.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},qr=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Dr(r,e),s=[],u=m=>new Promise((l,c)=>{if(m===n.length)return e.all&&s.length?l(s):c(Fr(r));let f=n[m],h=/^".*"$/.test(f)?f.slice(1,-1):f,g=Rr.join(h,r),_=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+g:g;l(a(_,m,0))}),a=(m,l,c)=>new Promise((f,h)=>{if(c===o.length)return f(u(l+1));let g=o[c];Vr(m+g,{pathExt:i},(_,j)=>{if(!_&&j)if(e.all)s.push(m+g);else return f(m+g);return f(a(m,l,c+1))})});return t?u(0).then(m=>t(null,m),t):u(0)},wi=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:o}=Dr(r,e),i=[];for(let s=0;s<t.length;s++){let u=t[s],a=/^".*"$/.test(u)?u.slice(1,-1):u,m=Rr.join(a,r),l=!a&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let c=0;c<n.length;c++){let f=l+n[c];try{if(Vr.sync(f,{pathExt:o}))if(e.all)i.push(f);else return f}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw Fr(r)};Hr.exports=qr;qr.sync=wi});var Ur=x((am,ft)=>{"use strict";var Wr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ft.exports=Wr;ft.exports.default=Wr});var Jr=x((mm,Kr)=>{"use strict";var Gr=require("path"),Si=Br(),Ai=Ur();function zr(r,e){let t=r.options.env||process.env,n=process.cwd(),o=r.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(r.options.cwd)}catch{}let s;try{s=Si.sync(r.command,{path:t[Ai({env:t})],pathExt:e?Gr.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Gr.resolve(o?r.options.cwd:"",s)),s}function Ci(r){return zr(r)||zr(r,!0)}Kr.exports=Ci});var Qr=x((um,pt)=>{"use strict";var ct=/([()\][%!^"`<>&|;, *?])/g;function Oi(r){return r=r.replace(ct,"^$1"),r}function Ei(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(ct,"^$1"),e&&(r=r.replace(ct,"^$1")),r}pt.exports.command=Oi;pt.exports.argument=Ei});var Yr=x((lm,Xr)=>{"use strict";Xr.exports=/^#!(.*)/});var en=x((fm,Zr)=>{"use strict";var ki=Yr();Zr.exports=(r="")=>{let e=r.match(ki);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var rn=x((cm,tn)=>{"use strict";var dt=require("fs"),Mi=en();function Li(r){let t=Buffer.alloc(150),n;try{n=dt.openSync(r,"r"),dt.readSync(n,t,0,150,0),dt.closeSync(n)}catch{}return Mi(t.toString())}tn.exports=Li});var an=x((pm,sn)=>{"use strict";var Ti=require("path"),nn=Jr(),on=Qr(),ji=rn(),Ni=process.platform==="win32",Ii=/\.(?:com|exe)$/i,Pi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function $i(r){r.file=nn(r);let e=r.file&&ji(r.file);return e?(r.args.unshift(r.file),r.command=e,nn(r)):r.file}function Ri(r){if(!Ni)return r;let e=$i(r),t=!Ii.test(e);if(r.options.forceShell||t){let n=Pi.test(e);r.command=Ti.normalize(r.command),r.command=on.command(r.command),r.args=r.args.map(i=>on.argument(i,n));let o=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${o}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Vi(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Ri(n)}sn.exports=Vi});var ln=x((dm,un)=>{"use strict";var ht=process.platform==="win32";function gt(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Fi(r,e){if(!ht)return;let t=r.emit;r.emit=function(n,o){if(n==="exit"){let i=mn(o,e);if(i)return t.call(r,"error",i)}return t.apply(r,arguments)}}function mn(r,e){return ht&&r===1&&!e.file?gt(e.original,"spawn"):null}function Di(r,e){return ht&&r===1&&!e.file?gt(e.original,"spawnSync"):null}un.exports={hookChildProcess:Fi,verifyENOENT:mn,verifyENOENTSync:Di,notFoundError:gt}});var pn=x((hm,Y)=>{"use strict";var fn=require("child_process"),vt=an(),xt=ln();function cn(r,e,t){let n=vt(r,e,t),o=fn.spawn(n.command,n.args,n.options);return xt.hookChildProcess(o,n),o}function qi(r,e,t){let n=vt(r,e,t),o=fn.spawnSync(n.command,n.args,n.options);return o.error=o.error||xt.verifyENOENTSync(o.status,n),o}Y.exports=cn;Y.exports.spawn=cn;Y.exports.sync=qi;Y.exports._parse=vt;Y.exports._enoent=xt});sr().install();var _r=U(xr(),1),{program:Ua,createCommand:Ga,createArgument:za,createOption:Ka,CommanderError:Ja,InvalidArgumentError:Qa,InvalidOptionArgumentError:Xa,Command:yr,Argument:Ya,Option:$,Help:Za}=_r.default;var li=/[\p{Lu}]/u,fi=/[\p{Ll}]/u,br=/^[\p{Lu}](?![\p{Lu}])/gu,Ar=/([\p{Alpha}\p{N}_]|$)/u,mt=/[_.\- ]+/,ci=new RegExp("^"+mt.source),wr=new RegExp(mt.source+Ar.source,"gu"),Sr=new RegExp("\\d+"+Ar.source,"gu"),pi=(r,e,t,n)=>{let o=!1,i=!1,s=!1,u=!1;for(let a=0;a<r.length;a++){let m=r[a];u=a>2?r[a-3]==="-":!0,o&&li.test(m)?(r=r.slice(0,a)+"-"+r.slice(a),o=!1,s=i,i=!0,a++):i&&s&&fi.test(m)&&(!u||n)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,o=!0):(o=e(m)===m&&t(m)!==m,s=i,i=t(m)===m&&e(m)!==m)}return r},di=(r,e)=>(br.lastIndex=0,r.replaceAll(br,t=>e(t))),hi=(r,e)=>(wr.lastIndex=0,Sr.lastIndex=0,r.replaceAll(Sr,(t,n,o)=>["_","-"].includes(r.charAt(o+t.length))?t:e(t)).replaceAll(wr,(t,n)=>e(n)));function ut(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(i=>i.trim()).filter(i=>i.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return r.length===1?mt.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=pi(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(ci,""),r=e.preserveConsecutiveUppercase?di(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),hi(r,n))}var B=U(pn()),v=U(require("fs"));var Hi=typeof global=="object"&&global&&global.Object===Object&&global,be=Hi;var Bi=typeof self=="object"&&self&&self.Object===Object&&self,Wi=be||Bi||Function("return this")(),we=Wi;var Ui=we.Symbol,Z=Ui;var dn=Object.prototype,Gi=dn.hasOwnProperty,zi=dn.toString,ue=Z?Z.toStringTag:void 0;function Ki(r){var e=Gi.call(r,ue),t=r[ue];try{r[ue]=void 0;var n=!0}catch{}var o=zi.call(r);return n&&(e?r[ue]=t:delete r[ue]),o}var hn=Ki;var Ji=Object.prototype,Qi=Ji.toString;function Xi(r){return Qi.call(r)}var gn=Xi;var Yi="[object Null]",Zi="[object Undefined]",vn=Z?Z.toStringTag:void 0;function es(r){return r==null?r===void 0?Zi:Yi:vn&&vn in Object(r)?hn(r):gn(r)}var ee=es;function ts(r){return r!=null&&typeof r=="object"}var te=ts;var rs=Array.isArray,xn=rs;function ns(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var _n=ns;function os(r){return r}var yn=os;var is="[object AsyncFunction]",ss="[object Function]",as="[object GeneratorFunction]",ms="[object Proxy]";function us(r){if(!_n(r))return!1;var e=ee(r);return e==ss||e==as||e==is||e==ms}var bn=us;var ls=9007199254740991,fs=/^(?:0|[1-9]\d*)$/;function cs(r,e){var t=typeof r;return e=e??ls,!!e&&(t=="number"||t!="symbol"&&fs.test(r))&&r>-1&&r%1==0&&r<e}var wn=cs;var ps=9007199254740991;function ds(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ps}var Se=ds;function hs(r){return r!=null&&Se(r.length)&&!bn(r)}var Sn=hs;var gs=Object.prototype;function vs(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||gs;return r===t}var An=vs;function xs(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Cn=xs;var _s="[object Arguments]";function ys(r){return te(r)&&ee(r)==_s}var _t=ys;var On=Object.prototype,bs=On.hasOwnProperty,ws=On.propertyIsEnumerable,Ss=_t(function(){return arguments}())?_t:function(r){return te(r)&&bs.call(r,"callee")&&!ws.call(r,"callee")},En=Ss;function As(){return!1}var kn=As;var Tn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Tn&&typeof module=="object"&&module&&!module.nodeType&&module,Cs=Mn&&Mn.exports===Tn,Ln=Cs?we.Buffer:void 0,Os=Ln?Ln.isBuffer:void 0,Es=Os||kn,jn=Es;var ks="[object Arguments]",Ms="[object Array]",Ls="[object Boolean]",Ts="[object Date]",js="[object Error]",Ns="[object Function]",Is="[object Map]",Ps="[object Number]",$s="[object Object]",Rs="[object RegExp]",Vs="[object Set]",Fs="[object String]",Ds="[object WeakMap]",qs="[object ArrayBuffer]",Hs="[object DataView]",Bs="[object Float32Array]",Ws="[object Float64Array]",Us="[object Int8Array]",Gs="[object Int16Array]",zs="[object Int32Array]",Ks="[object Uint8Array]",Js="[object Uint8ClampedArray]",Qs="[object Uint16Array]",Xs="[object Uint32Array]",b={};b[Bs]=b[Ws]=b[Us]=b[Gs]=b[zs]=b[Ks]=b[Js]=b[Qs]=b[Xs]=!0;b[ks]=b[Ms]=b[qs]=b[Ls]=b[Hs]=b[Ts]=b[js]=b[Ns]=b[Is]=b[Ps]=b[$s]=b[Rs]=b[Vs]=b[Fs]=b[Ds]=!1;function Ys(r){return te(r)&&Se(r.length)&&!!b[ee(r)]}var Nn=Ys;function Zs(r){return function(e){return r(e)}}var In=Zs;var Pn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,le=Pn&&typeof module=="object"&&module&&!module.nodeType&&module,ea=le&&le.exports===Pn,yt=ea&&be.process,ta=function(){try{var r=le&&le.require&&le.require("util").types;return r||yt&&yt.binding&&yt.binding("util")}catch{}}(),bt=ta;var $n=bt&&bt.isTypedArray,ra=$n?In($n):Nn,Rn=ra;var na=Object.prototype,oa=na.hasOwnProperty;function ia(r,e){var t=xn(r),n=!t&&En(r),o=!t&&!n&&jn(r),i=!t&&!n&&!o&&Rn(r),s=t||n||o||i,u=s?Cn(r.length,String):[],a=u.length;for(var m in r)(e||oa.call(r,m))&&!(s&&(m=="length"||o&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||wn(m,a)))&&u.push(m);return u}var Vn=ia;function sa(r,e){return function(t){return r(e(t))}}var Fn=sa;var aa=Fn(Object.keys,Object),Dn=aa;var ma=Object.prototype,ua=ma.hasOwnProperty;function la(r){if(!An(r))return Dn(r);var e=[];for(var t in Object(r))ua.call(r,t)&&t!="constructor"&&e.push(t);return e}var qn=la;function fa(r){return Sn(r)?Vn(r):qn(r)}var Hn=fa;function ca(r){return function(e,t,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[r?u:++o];if(t(i[a],a,i)===!1)break}return e}}var Bn=ca;var pa=Bn(),Wn=pa;function da(r,e){return r&&Wn(r,e,Hn)}var Un=da;function ha(r){return typeof r=="function"?r:yn}var Gn=ha;function ga(r,e){return r&&Un(r,Gn(e))}var wt=ga;var ro=U(require("os")),d=U(require("path"));var Ae="1.1.29";var Kn=()=>{fe(),console.log(`
|
|
30
|
+
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function gr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?t=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],o=i[4]),t&&o!=="0"?`${t}=${n}:${parseInt(o)+1}`:e})}function mt(){if(v.env.NO_COLOR||v.env.FORCE_COLOR==="0"||v.env.FORCE_COLOR==="false")return!1;if(v.env.FORCE_COLOR||v.env.CLICOLOR_FORCE!==void 0)return!0}ut.Command=at;ut.useColor=mt});var br=_(L=>{var{Argument:vr}=xe(),{Command:lt}=_r(),{CommanderError:fi,InvalidArgumentError:xr}=me(),{Help:ci}=et(),{Option:yr}=ot();L.program=new lt;L.createCommand=r=>new lt(r);L.createOption=(r,e)=>new yr(r,e);L.createArgument=(r,e)=>new vr(r,e);L.Command=lt;L.Option=yr;L.Argument=vr;L.Help=ci;L.CommanderError=fi;L.InvalidArgumentError=xr;L.InvalidOptionArgumentError=xr});var jr=_((im,Mr)=>{Mr.exports=Lr;Lr.sync=yi;var kr=require("fs");function xi(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var o=t[n].toLowerCase();if(o&&r.substr(-o.length).toLowerCase()===o)return!0}return!1}function Tr(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:xi(e,t)}function Lr(r,e,t){kr.stat(r,function(n,o){t(n,n?!1:Tr(o,r,e))})}function yi(r,e){return Tr(kr.statSync(r),r,e)}});var Rr=_((sm,$r)=>{$r.exports=Pr;Pr.sync=bi;var Ir=require("fs");function Pr(r,e,t){Ir.stat(r,function(n,o){t(n,n?!1:Nr(o,e))})}function bi(r,e){return Nr(Ir.statSync(r),e)}function Nr(r,e){return r.isFile()&&wi(r,e)}function wi(r,e){var t=r.mode,n=r.uid,o=r.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),m=parseInt("001",8),l=a|u,f=t&m||t&u&&o===s||t&a&&n===i||t&l&&i===0;return f}});var Vr=_((mm,Fr)=>{var am=require("fs"),be;process.platform==="win32"||global.TESTING_WINDOWS?be=jr():be=Rr();Fr.exports=pt;pt.sync=Ci;function pt(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){pt(r,e||{},function(i,s){i?o(i):n(s)})})}be(r,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),t(n,o)})}function Ci(r,e){try{return be.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Ur=_((um,Br)=>{var X=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dr=require("path"),Si=X?";":":",Gr=Vr(),qr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Hr=(r,e)=>{let t=e.colon||Si,n=r.match(/\//)||X&&r.match(/\\/)?[""]:[...X?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=X?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=X?o.split(t):[""];return X&&r.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Wr=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Hr(r,e),s=[],a=m=>new Promise((l,f)=>{if(m===n.length)return e.all&&s.length?l(s):f(qr(r));let c=n[m],h=/^".*"$/.test(c)?c.slice(1,-1):c,x=Dr.join(h,r),w=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+x:x;l(u(w,m,0))}),u=(m,l,f)=>new Promise((c,h)=>{if(f===o.length)return c(a(l+1));let x=o[f];Gr(m+x,{pathExt:i},(w,H)=>{if(!w&&H)if(e.all)s.push(m+x);else return c(m+x);return c(u(m,l,f+1))})});return t?a(0).then(m=>t(null,m),t):a(0)},Ai=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:o}=Hr(r,e),i=[];for(let s=0;s<t.length;s++){let a=t[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,m=Dr.join(u,r),l=!u&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let f=0;f<n.length;f++){let c=l+n[f];try{if(Gr.sync(c,{pathExt:o}))if(e.all)i.push(c);else return c}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw qr(r)};Br.exports=Wr;Wr.sync=Ai});var Kr=_((lm,dt)=>{"use strict";var zr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};dt.exports=zr;dt.exports.default=zr});var Yr=_((fm,Xr)=>{"use strict";var Jr=require("path"),Oi=Ur(),Ei=Kr();function Qr(r,e){let t=r.options.env||process.env,n=process.cwd(),o=r.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(r.options.cwd)}catch{}let s;try{s=Oi.sync(r.command,{path:t[Ei({env:t})],pathExt:e?Jr.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Jr.resolve(o?r.options.cwd:"",s)),s}function ki(r){return Qr(r)||Qr(r,!0)}Xr.exports=ki});var Zr=_((cm,gt)=>{"use strict";var ht=/([()\][%!^"`<>&|;, *?])/g;function Ti(r){return r=r.replace(ht,"^$1"),r}function Li(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(ht,"^$1"),e&&(r=r.replace(ht,"^$1")),r}gt.exports.command=Ti;gt.exports.argument=Li});var tn=_((pm,en)=>{"use strict";en.exports=/^#!(.*)/});var nn=_((dm,rn)=>{"use strict";var Mi=tn();rn.exports=(r="")=>{let e=r.match(Mi);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var sn=_((hm,on)=>{"use strict";var _t=require("fs"),ji=nn();function Ii(r){let t=Buffer.alloc(150),n;try{n=_t.openSync(r,"r"),_t.readSync(n,t,0,150,0),_t.closeSync(n)}catch{}return ji(t.toString())}on.exports=Ii});var ln=_((gm,un)=>{"use strict";var Pi=require("path"),an=Yr(),mn=Zr(),Ni=sn(),$i=process.platform==="win32",Ri=/\.(?:com|exe)$/i,Fi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vi(r){r.file=an(r);let e=r.file&&Ni(r.file);return e?(r.args.unshift(r.file),r.command=e,an(r)):r.file}function Di(r){if(!$i)return r;let e=Vi(r),t=!Ri.test(e);if(r.options.forceShell||t){let n=Fi.test(e);r.command=Pi.normalize(r.command),r.command=mn.command(r.command),r.args=r.args.map(i=>mn.argument(i,n));let o=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${o}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Gi(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Di(n)}un.exports=Gi});var pn=_((_m,cn)=>{"use strict";var vt=process.platform==="win32";function xt(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function qi(r,e){if(!vt)return;let t=r.emit;r.emit=function(n,o){if(n==="exit"){let i=fn(o,e);if(i)return t.call(r,"error",i)}return t.apply(r,arguments)}}function fn(r,e){return vt&&r===1&&!e.file?xt(e.original,"spawn"):null}function Hi(r,e){return vt&&r===1&&!e.file?xt(e.original,"spawnSync"):null}cn.exports={hookChildProcess:qi,verifyENOENT:fn,verifyENOENTSync:Hi,notFoundError:xt}});var gn=_((vm,Y)=>{"use strict";var dn=require("child_process"),yt=ln(),bt=pn();function hn(r,e,t){let n=yt(r,e,t),o=dn.spawn(n.command,n.args,n.options);return bt.hookChildProcess(o,n),o}function Wi(r,e,t){let n=yt(r,e,t),o=dn.spawnSync(n.command,n.args,n.options);return o.error=o.error||bt.verifyENOENTSync(o.status,n),o}Y.exports=hn;Y.exports.spawn=hn;Y.exports.sync=Wi;Y.exports._parse=yt;Y.exports._enoent=bt});ur().install();var wr=B(br(),1),{program:Ka,createCommand:Ja,createArgument:Qa,createOption:Xa,CommanderError:Ya,InvalidArgumentError:Za,InvalidOptionArgumentError:em,Command:Cr,Argument:tm,Option:N,Help:rm}=wr.default;var pi=/[\p{Lu}]/u,di=/[\p{Ll}]/u,Sr=/^[\p{Lu}](?![\p{Lu}])/gu,Er=/([\p{Alpha}\p{N}_]|$)/u,ft=/[_.\- ]+/,hi=new RegExp("^"+ft.source),Ar=new RegExp(ft.source+Er.source,"gu"),Or=new RegExp("\\d+"+Er.source,"gu"),gi=(r,e,t,n)=>{let o=!1,i=!1,s=!1,a=!1;for(let u=0;u<r.length;u++){let m=r[u];a=u>2?r[u-3]==="-":!0,o&&pi.test(m)?(r=r.slice(0,u)+"-"+r.slice(u),o=!1,s=i,i=!0,u++):i&&s&&di.test(m)&&(!a||n)?(r=r.slice(0,u-1)+"-"+r.slice(u-1),s=i,i=!1,o=!0):(o=e(m)===m&&t(m)!==m,s=i,i=t(m)===m&&e(m)!==m)}return r},_i=(r,e)=>(Sr.lastIndex=0,r.replaceAll(Sr,t=>e(t))),vi=(r,e)=>(Ar.lastIndex=0,Or.lastIndex=0,r.replaceAll(Or,(t,n,o)=>["_","-"].includes(r.charAt(o+t.length))?t:e(t)).replaceAll(Ar,(t,n)=>e(n)));function ct(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(i=>i.trim()).filter(i=>i.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return r.length===1?ft.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=gi(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(hi,""),r=e.preserveConsecutiveUppercase?_i(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),vi(r,n))}var q=B(gn()),g=B(require("fs"));var Bi=typeof global=="object"&&global&&global.Object===Object&&global,we=Bi;var Ui=typeof self=="object"&&self&&self.Object===Object&&self,zi=we||Ui||Function("return this")(),Ce=zi;var Ki=Ce.Symbol,Z=Ki;var _n=Object.prototype,Ji=_n.hasOwnProperty,Qi=_n.toString,ue=Z?Z.toStringTag:void 0;function Xi(r){var e=Ji.call(r,ue),t=r[ue];try{r[ue]=void 0;var n=!0}catch{}var o=Qi.call(r);return n&&(e?r[ue]=t:delete r[ue]),o}var vn=Xi;var Yi=Object.prototype,Zi=Yi.toString;function es(r){return Zi.call(r)}var xn=es;var ts="[object Null]",rs="[object Undefined]",yn=Z?Z.toStringTag:void 0;function ns(r){return r==null?r===void 0?rs:ts:yn&&yn in Object(r)?vn(r):xn(r)}var ee=ns;function os(r){return r!=null&&typeof r=="object"}var te=os;var is=Array.isArray,bn=is;function ss(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var wn=ss;function as(r){return r}var Cn=as;var ms="[object AsyncFunction]",us="[object Function]",ls="[object GeneratorFunction]",fs="[object Proxy]";function cs(r){if(!wn(r))return!1;var e=ee(r);return e==us||e==ls||e==ms||e==fs}var Sn=cs;var ps=9007199254740991,ds=/^(?:0|[1-9]\d*)$/;function hs(r,e){var t=typeof r;return e=e??ps,!!e&&(t=="number"||t!="symbol"&&ds.test(r))&&r>-1&&r%1==0&&r<e}var An=hs;var gs=9007199254740991;function _s(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=gs}var Se=_s;function vs(r){return r!=null&&Se(r.length)&&!Sn(r)}var On=vs;var xs=Object.prototype;function ys(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||xs;return r===t}var En=ys;function bs(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var kn=bs;var ws="[object Arguments]";function Cs(r){return te(r)&&ee(r)==ws}var wt=Cs;var Tn=Object.prototype,Ss=Tn.hasOwnProperty,As=Tn.propertyIsEnumerable,Os=wt(function(){return arguments}())?wt:function(r){return te(r)&&Ss.call(r,"callee")&&!As.call(r,"callee")},Ln=Os;function Es(){return!1}var Mn=Es;var Pn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jn=Pn&&typeof module=="object"&&module&&!module.nodeType&&module,ks=jn&&jn.exports===Pn,In=ks?Ce.Buffer:void 0,Ts=In?In.isBuffer:void 0,Ls=Ts||Mn,Nn=Ls;var Ms="[object Arguments]",js="[object Array]",Is="[object Boolean]",Ps="[object Date]",Ns="[object Error]",$s="[object Function]",Rs="[object Map]",Fs="[object Number]",Vs="[object Object]",Ds="[object RegExp]",Gs="[object Set]",qs="[object String]",Hs="[object WeakMap]",Ws="[object ArrayBuffer]",Bs="[object DataView]",Us="[object Float32Array]",zs="[object Float64Array]",Ks="[object Int8Array]",Js="[object Int16Array]",Qs="[object Int32Array]",Xs="[object Uint8Array]",Ys="[object Uint8ClampedArray]",Zs="[object Uint16Array]",ea="[object Uint32Array]",b={};b[Us]=b[zs]=b[Ks]=b[Js]=b[Qs]=b[Xs]=b[Ys]=b[Zs]=b[ea]=!0;b[Ms]=b[js]=b[Ws]=b[Is]=b[Bs]=b[Ps]=b[Ns]=b[$s]=b[Rs]=b[Fs]=b[Vs]=b[Ds]=b[Gs]=b[qs]=b[Hs]=!1;function ta(r){return te(r)&&Se(r.length)&&!!b[ee(r)]}var $n=ta;function ra(r){return function(e){return r(e)}}var Rn=ra;var Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,le=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,na=le&&le.exports===Fn,Ct=na&&we.process,oa=function(){try{var r=le&&le.require&&le.require("util").types;return r||Ct&&Ct.binding&&Ct.binding("util")}catch{}}(),St=oa;var Vn=St&&St.isTypedArray,ia=Vn?Rn(Vn):$n,Dn=ia;var sa=Object.prototype,aa=sa.hasOwnProperty;function ma(r,e){var t=bn(r),n=!t&&Ln(r),o=!t&&!n&&Nn(r),i=!t&&!n&&!o&&Dn(r),s=t||n||o||i,a=s?kn(r.length,String):[],u=a.length;for(var m in r)(e||aa.call(r,m))&&!(s&&(m=="length"||o&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||An(m,u)))&&a.push(m);return a}var Gn=ma;function ua(r,e){return function(t){return r(e(t))}}var qn=ua;var la=qn(Object.keys,Object),Hn=la;var fa=Object.prototype,ca=fa.hasOwnProperty;function pa(r){if(!En(r))return Hn(r);var e=[];for(var t in Object(r))ca.call(r,t)&&t!="constructor"&&e.push(t);return e}var Wn=pa;function da(r){return On(r)?Gn(r):Wn(r)}var Bn=da;function ha(r){return function(e,t,n){for(var o=-1,i=Object(e),s=n(e),a=s.length;a--;){var u=s[r?a:++o];if(t(i[u],u,i)===!1)break}return e}}var Un=ha;var ga=Un(),zn=ga;function _a(r,e){return r&&zn(r,e,Bn)}var Kn=_a;function va(r){return typeof r=="function"?r:Cn}var Jn=va;function xa(r,e){return r&&Kn(r,Jn(e))}var At=xa;var io=B(require("os")),d=B(require("path"));var Ae="1.1.36";var Xn=()=>{fe(),console.log(`
|
|
27
31
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
28
32
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
29
33
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
@@ -47,7 +51,7 @@ Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let
|
|
|
47
51
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
48
52
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m/\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
49
53
|
\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
|
|
50
|
-
\x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${Ae} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),fe()},fe=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var re=U(require("fs")),Jn=require("os"),Qn=r=>/^[a-zA-Z0-9-]+$/.test(r);function Xn(r){try{let e=re.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function Yn(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let o=t.substring(0,n),i=t.substring(n+1);e[o]=i}),e}var xa=r=>re.readFileSync(r,"utf-8").split(Jn.EOL);var _a=(r,e,t)=>{let n=xa(r),o=n.find(i=>i.split("=")[0]===e);if(o!==void 0){let i=n.indexOf(o);n.splice(i,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);re.writeFileSync(r,n.join(Jn.EOL))},St=(r,e)=>{e&&Object.keys(e).forEach(t=>{_a(r,t,e[t])})};var no=r=>{if(!Qn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=ut(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=d.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let o=d.resolve(n,".git"),i=v.existsSync(o),s=d.resolve(ro.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(v.existsSync(s)||v.mkdirSync(s,{recursive:!0}),!r.skipSubDir&&v.existsSync(n)&&Xn(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),i&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),v.cpSync(o,s,{recursive:!0})),v.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}v.existsSync(n)||v.mkdirSync(n,{recursive:!0}),i&&(v.cpSync(s,o,{recursive:!0}),v.rmSync(s,{recursive:!0}),console.info("Restored .git directory"));let u=d.resolve(__dirname,"init-templates"),a=d.resolve(u,r.template);v.cpSync(a,n,{recursive:!0}),v.renameSync(d.join(n,".example.gitignore"),d.join(n,".gitignore"));let m=require(d.join(n,"package.json"));m.name=r.appName,m.version=Ae,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let l=d.resolve(d.join(n,"README.md")),c=v.readFileSync(l,"utf8");c=c.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(l,c);let f=d.resolve(d.join(n,".gitlab-ci.yml")),h=v.readFileSync(f,"utf8");switch(h=h.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(f,h),r.template){case"aws-lambda":Aa(r,n,m,t);break;case"azure-function":wa(r,n,m,t);break;case"netlify-function":Sa(r,n,m,t);break}if(E(d.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),ba(r,n,u,t),ya(r,m),v.writeFileSync(d.resolve(d.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies){console.info("Installing dependencies with "+r.packageManager);try{switch(r.packageManager){case"npm":B.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("npm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"pnpm":B.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("pnpm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"yarn":B.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("yarn",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}}catch(_){console.error("Error installing dependencies with "+r.packageManager,_)}}fe(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),fe();let g=r.skipSubDir?n:d.relative(process.cwd(),n);console.log(`Run "cd ${g}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},ya=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)};function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var eo=(r,e,t,n)=>{let o;if(r.endsWith(".ts")||r.endsWith(".js"))o="//";else if(r.endsWith(".yml")||r.endsWith(".yaml"))o="#";else throw new Error("Unsupported file type "+r);if(!o)throw new Error("Unsupported file type for components application");wt(e.components,(i,s)=>{let u=Zn(`${o} START: component:${s}`),a=Zn(`${o} END: component:${s}`);i?E(r,{[u+"\r"]:"",[a+"\r"]:""}):E(r,{[`${u}[\\s\\S]*?${a}\r`]:""})})},ba=(r,e,t,n)=>{if(!r.components.browser){to(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),to(e);return}v.mkdirSync(d.resolve(d.join(e,"src","browser")),{recursive:!0}),v.cpSync(d.resolve(d.join(t,"browser")),d.resolve(d.join(e,"src","browser")),{recursive:!0});let o=d.resolve(d.join(e,"src","browser")),i=require(d.join(o,"package.json"));if(i.name=i.name.replace(/seeka-app-example-name/i,r.appName),i.description=i.description.replace(/seeka-app-example-name/i,r.appName),i.scripts.build=i.scripts.build.replace(/seeka-app-example-name/i,r.appName),i.scripts["build:dev"]=i.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),i.scripts.watch=i.scripts.watch.replace(/seeka-app-example-name/i,r.appName),v.writeFileSync(d.join(o,"package.json"),JSON.stringify(i,null,2)),!r.npmUsername||!r.npmPassword)console.warn("npmUsername and npmPassword should be provided for browser plugin support.");else{let s=d.join(o,".npmrc");E(s,{"<<npm_registry_token>>":Buffer.from(`${r.npmUsername}:${r.npmPassword}`).toString("base64")})}E(d.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),E(d.join(o,"README.md"),{"seeka-app-example-name":r.appName}),E(d.join(o,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),E(d.join(o,"src","browser.ts"),{SampleApp:n+"App"}),E(d.join(o,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},E=(r,e)=>{let t=v.readFileSync(d.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);v.writeFileSync(d.resolve(r),t)},to=r=>{v.rmSync(d.resolve(d.join(r,"src","lib","browser")),{recursive:!0})},wa=(r,e,t,n)=>{if(v.renameSync(d.join(e,"local.settings.example.json"),d.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let o=require(d.join(e,"local.settings.json"));o.Values={...o.Values,...r.environmentVariables},v.writeFileSync(d.join(e,"local.settings.json"),JSON.stringify(o,null,2))}r.components.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),E(d.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","functions","seekaAppWebhook.ts"),{SampleApp:n+"App"}),eo(d.join(e,"src","functions","seekaAppWebhook.ts"),r,e,n),eo(d.join(e,".gitlab-ci.yml"),r,e,n),console.info("Scaffolded Azure function")},Sa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","api","seeka-app-webhook","index.ts"),{SampleApp:n+"App"}),console.info("Scaffolded Netlify function")},Aa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","routes","seekaAppWebhook.ts"),{SampleApp:n+"App"}),console.info("Scaffolded AWS lambda function")};var At=new yr;Kn();At.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new $("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new $("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new $("--email <email>","app developer email").makeOptionMandatory()).addOption(new $("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new $("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new $("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).addOption(new $("--npmUsername [npmUsername]","Private NPM registry username for browser plugin dependencies.")).addOption(new $("--npmPassword [npmPassword]","Private NPM registry password for browser plugin dependencies.")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").option("--appSettings [appSettings...]","sets app settings for the app. Use format of --appSettings myAppInstallSetting1=string myAppInstallSetting2=string[]").action((r,e)=>{let t={appName:r,components:{browser:e.browser&&e.template==="azure-function"},template:e.template,skipSubDir:e.skipSubDir,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:Yn(e.env),appSettings:[],npmUsername:e.npmUsername,npmPassword:e.npmPassword};no(t)}).showHelpAfterError(!0);At.showHelpAfterError(!0);At.parse();
|
|
54
|
+
\x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${Ae} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),fe()},fe=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var re=B(require("fs")),Yn=require("os"),Zn=r=>/^[a-zA-Z0-9-]+$/.test(r);function eo(r){try{let e=re.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function to(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let o=t.substring(0,n),i=t.substring(n+1);e[o]=i}),e}var ba=r=>re.readFileSync(r,"utf-8").split(Yn.EOL);var wa=(r,e,t)=>{let n=ba(r),o=n.find(i=>i.split("=")[0]===e);if(o!==void 0){let i=n.indexOf(o);n.splice(i,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);re.writeFileSync(r,n.join(Yn.EOL))},Ot=(r,e)=>{e&&Object.keys(e).forEach(t=>{wa(r,t,e[t])})};var so=r=>{if(!Zn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=ct(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=d.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let o=d.resolve(n,".git"),i=g.existsSync(o),s=d.resolve(io.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(g.existsSync(s)||g.mkdirSync(s,{recursive:!0}),!r.skipSubDir&&g.existsSync(n)&&eo(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),i&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),g.cpSync(o,s,{recursive:!0})),g.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}g.existsSync(n)||g.mkdirSync(n,{recursive:!0}),i&&(g.cpSync(s,o,{recursive:!0}),g.rmSync(s,{recursive:!0}),console.info("Restored .git directory"));let a=d.resolve(__dirname,"init-templates"),u=d.resolve(a,r.template);g.cpSync(u,n,{recursive:!0}),g.renameSync(d.join(n,".example.gitignore"),d.join(n,".gitignore"));let m=require(d.join(n,"package.json"));m.name=r.appName,m.version=Ae,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let l=d.resolve(d.join(n,"README.md")),f=g.readFileSync(l,"utf8");f=f.replace(/seeka-app-example-name/g,r.appName),g.writeFileSync(l,f);let c=d.resolve(d.join(n,".gitlab-ci.yml")),h=g.readFileSync(c,"utf8");switch(h=h.replace(/seeka-app-example-name/g,r.appName),g.writeFileSync(c,h),r.template){case"aws-lambda":Ea(r,n,m,t);break;case"azure-function":Aa(r,n,m,t);break;case"netlify-function":Oa(r,n,m,t);break}if(E(d.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),Sa(r,n,a,t),Ca(r,m),g.writeFileSync(d.resolve(d.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies){console.info("Installing dependencies with "+r.packageManager);try{switch(r.packageManager){case"npm":q.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&q.sync("npm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"pnpm":q.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&q.sync("pnpm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"yarn":q.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&q.sync("yarn",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}}catch(w){console.error("Error installing dependencies with "+r.packageManager,w)}}fe(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),fe();let x=r.skipSubDir?n:d.relative(process.cwd(),n);console.log(`Run "cd ${x}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},Ca=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)};function ro(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var no=(r,e,t,n)=>{let o;if(r.endsWith(".ts")||r.endsWith(".js"))o="//";else if(r.endsWith(".yml")||r.endsWith(".yaml"))o="#";else throw new Error("Unsupported file type "+r);if(!o)throw new Error("Unsupported file type for components application");At(e.components,(i,s)=>{let a=ro(`${o} START: component:${s}`),u=ro(`${o} END: component:${s}`);i?E(r,{[a+"\r"]:"",[u+"\r"]:""}):E(r,{[`${a}[\\s\\S]*?${u}\r`]:""})})},Sa=(r,e,t,n)=>{if(!r.components.browser){oo(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),oo(e);return}g.mkdirSync(d.resolve(d.join(e,"src","browser")),{recursive:!0}),g.cpSync(d.resolve(d.join(t,"browser")),d.resolve(d.join(e,"src","browser")),{recursive:!0});let o=d.resolve(d.join(e,"src","browser")),i=require(d.join(o,"package.json"));if(i.name=i.name.replace(/seeka-app-example-name/i,r.appName),i.description=i.description.replace(/seeka-app-example-name/i,r.appName),i.scripts.build=i.scripts.build.replace(/seeka-app-example-name/i,r.appName),i.scripts["build:dev"]=i.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),i.scripts.watch=i.scripts.watch.replace(/seeka-app-example-name/i,r.appName),g.writeFileSync(d.join(o,"package.json"),JSON.stringify(i,null,2)),!r.npmUsername||!r.npmPassword)console.warn("npmUsername and npmPassword should be provided for browser plugin support.");else{let s=d.join(o,".npmrc");E(s,{"<<npm_registry_token>>":Buffer.from(`${r.npmUsername}:${r.npmPassword}`).toString("base64")})}E(d.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),E(d.join(o,"README.md"),{"seeka-app-example-name":r.appName}),E(d.join(o,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),E(d.join(o,"src","browser.ts"),{SampleApp:n+"App"}),E(d.join(o,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},E=(r,e)=>{let t=g.readFileSync(d.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);g.writeFileSync(d.resolve(r),t)},oo=r=>{g.rmSync(d.resolve(d.join(r,"src","lib","browser")),{recursive:!0})},Aa=(r,e,t,n)=>{if(g.renameSync(d.join(e,"local.settings.example.json"),d.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let o=require(d.join(e,"local.settings.json"));o.Values={...o.Values,...r.environmentVariables},g.writeFileSync(d.join(e,"local.settings.json"),JSON.stringify(o,null,2))}r.components.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),E(d.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","functions","seekaAppWebhook.ts"),{SampleApp:n+"App"}),no(d.join(e,"src","functions","seekaAppWebhook.ts"),r,e,n),no(d.join(e,".gitlab-ci.yml"),r,e,n),console.info("Scaffolded Azure function")},Oa=(r,e,t,n)=>{g.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&Ot(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","api","seeka-app-webhook","index.ts"),{SampleApp:n+"App"}),console.info("Scaffolded Netlify function")},Ea=(r,e,t,n)=>{g.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&Ot(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","routes","seekaAppWebhook.ts"),{SampleApp:n+"App"}),console.info("Scaffolded AWS lambda function")};var Et=new Cr;Xn();Et.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new N("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new N("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new N("--email <email>","app developer email").makeOptionMandatory()).addOption(new N("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new N("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new N("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).addOption(new N("--npmUsername [npmUsername]","Private NPM registry username for browser plugin dependencies.")).addOption(new N("--npmPassword [npmPassword]","Private NPM registry password for browser plugin dependencies.")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").option("--appSettings [appSettings...]","sets app settings for the app. Use format of --appSettings myAppInstallSetting1=string myAppInstallSetting2=string[]").action((r,e)=>{let t={appName:r,components:{browser:e.browser&&e.template==="azure-function"},template:e.template,skipSubDir:e.skipSubDir,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:to(e.env),appSettings:[],npmUsername:e.npmUsername,npmPassword:e.npmPassword};so(t)}).showHelpAfterError(!0);Et.showHelpAfterError(!0);Et.parse();
|
|
51
55
|
/*! Bundled license information:
|
|
52
56
|
|
|
53
57
|
lodash-es/lodash.js:
|