pod-install 1.0.6 → 1.0.7
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/build/index.js +1 -1
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
*/function isSpecificValue(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp?true:false}function cloneSpecificValue(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);e.copy(t);return t}else if(e instanceof Date){return new Date(e.getTime())}else if(e instanceof RegExp){return new RegExp(e)}else{throw new Error("Unexpected situation")}}function deepCloneArray(e){var n=[];e.forEach((function(e,r){if(typeof e==="object"&&e!==null){if(Array.isArray(e)){n[r]=deepCloneArray(e)}else if(isSpecificValue(e)){n[r]=cloneSpecificValue(e)}else{n[r]=t({},e)}}else{n[r]=e}}));return n}function safeGetProperty(e,t){return t==="__proto__"?undefined:e[t]}var t=e.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var e=arguments[0];var n=Array.prototype.slice.call(arguments,1);var r,s,o;n.forEach((function(n){if(typeof n!=="object"||n===null||Array.isArray(n)){return}Object.keys(n).forEach((function(o){s=safeGetProperty(e,o);r=safeGetProperty(n,o);if(r===e){return}else if(typeof r!=="object"||r===null){e[o]=r;return}else if(Array.isArray(r)){e[o]=deepCloneArray(r);return}else if(isSpecificValue(r)){e[o]=cloneSpecificValue(r);return}else if(typeof s!=="object"||s===null||Array.isArray(s)){e[o]=t({},r);return}else{e[o]=t(s,r);return}}))}));return e}},9473:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const r=t.indexOf(n+e);const s=t.indexOf("--");return r!==-1&&(s===-1||r<s)}},2388:(e,t)=>{t.parse=t.decode=decode;t.stringify=t.encode=encode;t.safe=safe;t.unsafe=unsafe;var n=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(e,t){var r=[];var s="";if(typeof t==="string"){t={section:t,whitespace:false}}else{t=t||{};t.whitespace=t.whitespace===true}var o=t.whitespace?" = ":"=";Object.keys(e).forEach((function(t,i,a){var c=e[t];if(c&&Array.isArray(c)){c.forEach((function(e){s+=safe(t+"[]")+o+safe(e)+"\n"}))}else if(c&&typeof c==="object")r.push(t);else s+=safe(t)+o+safe(c)+n}));if(t.section&&s.length)s="["+safe(t.section)+"]"+n+s;r.forEach((function(r,o,i){var a=dotSplit(r).join("\\.");var c=(t.section?t.section+".":"")+a;var l=encode(e[r],{section:c,whitespace:t.whitespace});if(s.length&&l.length)s+=n;s+=l}));return s}function dotSplit(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(e){var t={};var n=t;var r=null;var s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var o=e.split(/[\r\n]+/g);o.forEach((function(e,o,i){if(!e||e.match(/^\s*[;#]/))return;var a=e.match(s);if(!a)return;if(a[1]!==undefined){r=unsafe(a[1]);if(r==="__proto__"){n={};return}n=t[r]=t[r]||{};return}var c=unsafe(a[2]);if(c==="__proto__")return;var l=a[3]?unsafe(a[4]):true;switch(l){case"true":case"false":case"null":l=JSON.parse(l)}if(c.length>2&&c.slice(-2)==="[]"){c=c.substring(0,c.length-2);if(c==="__proto__")return;if(!n[c])n[c]=[];else if(!Array.isArray(n[c]))n[c]=[n[c]]}if(Array.isArray(n[c]))n[c].push(l);else n[c]=l}));Object.keys(t).filter((function(e,n,r){if(!t[e]||typeof t[e]!=="object"||Array.isArray(t[e]))return false;var s=dotSplit(e);var o=t;var i=s.pop();var a=i.replace(/\\\./g,".");s.forEach((function(e,t,n){if(e==="__proto__")return;if(!o[e]||typeof o[e]!=="object")o[e]={};o=o[e]}));if(o===t&&a===i)return false;o[a]=t[e];return true})).forEach((function(e,n,r){delete t[e]}));return t}function isQuoted(e){return e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'"}function safe(e){return typeof e!=="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&isQuoted(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(e,t){e=(e||"").trim();if(isQuoted(e)){if(e.charAt(0)==="'")e=e.substr(1,e.length-2);try{e=JSON.parse(e)}catch(e){}}else{var n=false;var r="";for(var s=0,o=e.length;s<o;s++){var i=e.charAt(s);if(n){if("\\;#".indexOf(i)!==-1)r+=i;else r+="\\"+i;n=false}else if(";#".indexOf(i)!==-1)break;else if(i==="\\")n=true;else r+=i}if(n)r+="\\";return r.trim()}return e}},4750:e=>{"use strict";function hasKey(e,t){var n=e;t.slice(0,-1).forEach((function(e){n=n[e]||{}}));var r=t[t.length-1];return r in n}function isNumber(e){if(typeof e==="number"){return true}if(/^0x[0-9a-f]+$/i.test(e)){return true}return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function isConstructorOrProto(e,t){return t==="constructor"&&typeof e[t]==="function"||t==="__proto__"}e.exports=function(e,t){if(!t){t={}}var n={bools:{},strings:{},unknownFn:null};if(typeof t.unknown==="function"){n.unknownFn=t.unknown}if(typeof t.boolean==="boolean"&&t.boolean){n.allBools=true}else{[].concat(t.boolean).filter(Boolean).forEach((function(e){n.bools[e]=true}))}var r={};function aliasIsBoolean(e){return r[e].some((function(e){return n.bools[e]}))}Object.keys(t.alias||{}).forEach((function(e){r[e]=[].concat(t.alias[e]);r[e].forEach((function(t){r[t]=[e].concat(r[e].filter((function(e){return t!==e})))}))}));[].concat(t.string).filter(Boolean).forEach((function(e){n.strings[e]=true;if(r[e]){[].concat(r[e]).forEach((function(e){n.strings[e]=true}))}}));var s=t.default||{};var o={_:[]};function argDefined(e,t){return n.allBools&&/^--[^=]+$/.test(t)||n.strings[e]||n.bools[e]||r[e]}function setKey(e,t,r){var s=e;for(var o=0;o<t.length-1;o++){var i=t[o];if(isConstructorOrProto(s,i)){return}if(s[i]===undefined){s[i]={}}if(s[i]===Object.prototype||s[i]===Number.prototype||s[i]===String.prototype){s[i]={}}if(s[i]===Array.prototype){s[i]=[]}s=s[i]}var a=t[t.length-1];if(isConstructorOrProto(s,a)){return}if(s===Object.prototype||s===Number.prototype||s===String.prototype){s={}}if(s===Array.prototype){s=[]}if(s[a]===undefined||n.bools[a]||typeof s[a]==="boolean"){s[a]=r}else if(Array.isArray(s[a])){s[a].push(r)}else{s[a]=[s[a],r]}}function setArg(e,t,s){if(s&&n.unknownFn&&!argDefined(e,s)){if(n.unknownFn(s)===false){return}}var i=!n.strings[e]&&isNumber(t)?Number(t):t;setKey(o,e.split("."),i);(r[e]||[]).forEach((function(e){setKey(o,e.split("."),i)}))}Object.keys(n.bools).forEach((function(e){setArg(e,s[e]===undefined?false:s[e])}));var i=[];if(e.indexOf("--")!==-1){i=e.slice(e.indexOf("--")+1);e=e.slice(0,e.indexOf("--"))}for(var a=0;a<e.length;a++){var c=e[a];var l;var u;if(/^--.+=/.test(c)){var f=c.match(/^--([^=]+)=([\s\S]*)$/);l=f[1];var d=f[2];if(n.bools[l]){d=d!=="false"}setArg(l,d,c)}else if(/^--no-.+/.test(c)){l=c.match(/^--no-(.+)/)[1];setArg(l,false,c)}else if(/^--.+/.test(c)){l=c.match(/^--(.+)/)[1];u=e[a+1];if(u!==undefined&&!/^(-|--)[^-]/.test(u)&&!n.bools[l]&&!n.allBools&&(r[l]?!aliasIsBoolean(l):true)){setArg(l,u,c);a+=1}else if(/^(true|false)$/.test(u)){setArg(l,u==="true",c);a+=1}else{setArg(l,n.strings[l]?"":true,c)}}else if(/^-[^-]+/.test(c)){var h=c.slice(1,-1).split("");var p=false;for(var m=0;m<h.length;m++){u=c.slice(m+2);if(u==="-"){setArg(h[m],u,c);continue}if(/[A-Za-z]/.test(h[m])&&u[0]==="="){setArg(h[m],u.slice(1),c);p=true;break}if(/[A-Za-z]/.test(h[m])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(u)){setArg(h[m],u,c);p=true;break}if(h[m+1]&&h[m+1].match(/\W/)){setArg(h[m],c.slice(m+2),c);p=true;break}else{setArg(h[m],n.strings[h[m]]?"":true,c)}}l=c.slice(-1)[0];if(!p&&l!=="-"){if(e[a+1]&&!/^(-|--)[^-]/.test(e[a+1])&&!n.bools[l]&&(r[l]?!aliasIsBoolean(l):true)){setArg(l,e[a+1],c);a+=1}else if(e[a+1]&&/^(true|false)$/.test(e[a+1])){setArg(l,e[a+1]==="true",c);a+=1}else{setArg(l,n.strings[l]?"":true,c)}}}else{if(!n.unknownFn||n.unknownFn(c)!==false){o._.push(n.strings._||!isNumber(c)?c:Number(c))}if(t.stopEarly){o._.push.apply(o._,e.slice(a+1));break}}}Object.keys(s).forEach((function(e){if(!hasKey(o,e.split("."))){setKey(o,e.split("."),s[e]);(r[e]||[]).forEach((function(t){setKey(o,t.split("."),s[e])}))}}));if(t["--"]){o["--"]=i.slice()}else{i.forEach((function(e){o._.push(e)}))}return o}},661:e=>{"use strict";const pathKey=(e={})=>{const t=e.env||process.env;const n=e.platform||process.platform;if(n!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},8987:(e,t,n)=>{var r=n(4038);var s=n(6928).join;var o=n(2536);var i="/etc";var a=process.platform==="win32";var c=a?process.env.USERPROFILE:process.env.HOME;e.exports=function(e,t,l,u){if("string"!==typeof e)throw new Error("rc(name): name *must* be string");if(!l)l=n(4750)(process.argv.slice(2));t=("string"===typeof t?r.json(t):t)||{};u=u||r.parse;var f=r.env(e+"_");var d=[t];var h=[];function addConfigFile(e){if(h.indexOf(e)>=0)return;var t=r.file(e);if(t){d.push(u(t));h.push(e)}}if(!a)[s(i,e,"config"),s(i,e+"rc")].forEach(addConfigFile);if(c)[s(c,".config",e,"config"),s(c,".config",e),s(c,"."+e,"config"),s(c,"."+e+"rc")].forEach(addConfigFile);addConfigFile(r.find("."+e+"rc"));if(f.config)addConfigFile(f.config);if(l.config)addConfigFile(l.config);return o.apply(null,d.concat([f,l,h.length?{configs:h,config:h[h.length-1]}:undefined]))}},4038:(e,t,n)=>{"use strict";var r=n(9896);var s=n(2388);var o=n(6928);var i=n(5405);var a=t.parse=function(e){if(/^\s*{/.test(e))return JSON.parse(i(e));return s.parse(e)};var c=t.file=function(){var e=[].slice.call(arguments).filter((function(e){return e!=null}));for(var t in e)if("string"!==typeof e[t])return;var n=o.join.apply(null,e);var s;try{return r.readFileSync(n,"utf-8")}catch(e){return}};var l=t.json=function(){var e=c.apply(null,arguments);return e?a(e):null};var u=t.env=function(e,t){t=t||process.env;var n={};var r=e.length;for(var s in t){if(s.toLowerCase().indexOf(e.toLowerCase())===0){var o=s.substring(r).split("__");var i;while((i=o.indexOf(""))>-1){o.splice(i,1)}var a=n;o.forEach((function _buildSubObj(e,n){if(!e||typeof a!=="object")return;if(n===o.length-1)a[e]=t[s];if(a[e]===undefined)a[e]={};a=a[e]}))}}return n};var f=t.find=function(){var e=o.join.apply(null,[].slice.call(arguments));function find(e,t){var n=o.join(e,t);try{r.statSync(n);return n}catch(n){if(o.dirname(e)!==e)return find(o.dirname(e),t)}}return find(process.cwd(),e)}},5405:e=>{"use strict";var t=1;var n=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(e,t,n){return e.slice(t,n).replace(/\S/g," ")}e.exports=function(e,r){r=r||{};var s;var o;var i=false;var a=false;var c=0;var l="";var u=r.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var f=0;f<e.length;f++){s=e[f];o=e[f+1];if(!a&&s==='"'){var d=e[f-1]==="\\"&&e[f-2]!=="\\";if(!d){i=!i}}if(i){continue}if(!a&&s+o==="//"){l+=e.slice(c,f);c=f;a=t;f++}else if(a===t&&s+o==="\r\n"){f++;a=false;l+=u(e,c,f);c=f;continue}else if(a===t&&s==="\n"){a=false;l+=u(e,c,f);c=f}else if(!a&&s+o==="/*"){l+=e.slice(c,f);c=f;a=n;f++;continue}else if(a===n&&s+o==="*/"){f++;a=false;l+=u(e,c,f+1);c=f+1;continue}}return l+(a?u(e.substr(c)):e.substr(c))}},8381:(e,t,n)=>{const r=n(5950).Buffer;function decodeBase64(e){return r.from(e,"base64").toString("utf8")}function encodeBase64(e){return r.from(e,"utf8").toString("base64")}e.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},6856:(e,t,n)=>{var r=n(7016);var s=n(8381);var o=s.decodeBase64;var i=s.encodeBase64;var a=":_authToken";var c=":username";var l=":_password";e.exports=function(){var e;var t;if(arguments.length>=2){e=arguments[0];t=arguments[1]}else if(typeof arguments[0]==="string"){e=arguments[0]}else{t=arguments[0]}t=t||{};t.npmrc=t.npmrc||n(8987)("npm",{registry:"https://registry.npmjs.org/"});e=e||t.npmrc.registry;return getRegistryAuthInfo(e,t)||getLegacyAuthInfo(t.npmrc)};function getRegistryAuthInfo(e,t){var n=r.parse(e,false,true);var s;while(s!=="/"&&n.pathname!==s){s=n.pathname||"/";var o="//"+n.host+s.replace(/\/$/,"");var i=getAuthInfoForUrl(o,t.npmrc);if(i){return i}if(!t.recursive){return/\/$/.test(e)?undefined:getRegistryAuthInfo(r.resolve(e,"."),t)}n.pathname=r.resolve(normalizePath(s),"..")||"/"}return undefined}function getLegacyAuthInfo(e){if(e._auth){return{token:e._auth,type:"Basic"}}return undefined}function normalizePath(e){return e[e.length-1]==="/"?e:e+"/"}function getAuthInfoForUrl(e,t){var n=getBearerToken(t[e+a]||t[e+"/"+a]);if(n){return n}var r=t[e+c]||t[e+"/"+c];var s=t[e+l]||t[e+"/"+l];var o=getTokenForUsernameAndPassword(r,s);if(o){return o}return undefined}function getBearerToken(e){if(!e){return undefined}var t=e.replace(/^\$\{?([^}]*)\}?$/,(function(e,t){return process.env[t]}));return{token:t,type:"Bearer"}}function getTokenForUsernameAndPassword(e,t){if(!e||!t){return undefined}var n=o(t.replace(/^\$\{?([^}]*)\}?$/,(function(e,t){return process.env[t]})));var r=i(e+":"+n);return{token:r,type:"Basic",password:n,username:e}}},2139:(e,t,n)=>{"use strict";e.exports=function(e){var t=n(8987)("npm",{registry:"https://registry.npmjs.org/"});var r=t[e+":registry"]||t.registry;return r.slice(-1)==="/"?r:r+"/"}},5950:(e,t,n)=>{
|
|
29
29
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
30
|
-
var r=n(181);var s=r.Buffer;function copyProps(e,t){for(var n in e){t[n]=e[n]}}if(s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow){e.exports=r}else{copyProps(r,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,n){return s(e,t,n)}SafeBuffer.prototype=Object.create(s.prototype);copyProps(s,SafeBuffer);SafeBuffer.from=function(e,t,n){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return s(e,t,n)};SafeBuffer.alloc=function(e,t,n){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var r=s(e);if(t!==undefined){if(typeof n==="string"){r.fill(t,n)}else{r.fill(t)}}else{r.fill(0)}return r};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return s(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return r.SlowBuffer(e)}},2668:(e,t,n)=>{"use strict";const r=n(3570);e.exports=(e="")=>{const t=e.match(r);if(!t){return null}const[n,s]=t[0].replace(/#! ?/,"").split(" ");const o=n.split("/").pop();if(o==="env"){return s}return s?`${o} ${s}`:o}},3570:e=>{"use strict";e.exports=/^#!(.*)/},3662:(e,t,n)=>{"use strict";const r=n(857);const s=n(2018);const o=n(9473);const{env:i}=process;let a;if(o("no-color")||o("no-colors")||o("color=false")||o("color=never")){a=0}else if(o("color")||o("colors")||o("color=true")||o("color=always")){a=1}if("FORCE_COLOR"in i){if(i.FORCE_COLOR==="true"){a=1}else if(i.FORCE_COLOR==="false"){a=0}else{a=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const n=a||0;if(i.TERM==="dumb"){return n}if(process.platform==="win32"){const e=r.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,s.isatty(1))),stderr:translateLevel(supportsColor(true,s.isatty(2)))}},5360:(e,t,n)=>{"use strict";const r=n(3662);const s=n(9473);function parseVersion(e){if(/^\d{3,4}$/.test(e)){const t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}const t=(e||"").split(".").map((e=>parseInt(e,10)));return{major:t[0],minor:t[1],patch:t[2]}}function supportsHyperlink(e){const{env:t}=process;if("FORCE_HYPERLINK"in t){return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0)}if(s("no-hyperlink")||s("no-hyperlinks")||s("hyperlink=false")||s("hyperlink=never")){return false}if(s("hyperlink=true")||s("hyperlink=always")){return true}if(!r.supportsColor(e)){return false}if(e&&!e.isTTY){return false}if(process.platform==="win32"){return false}if("NETLIFY"in t){return true}if("CI"in t){return false}if("TEAMCITY_VERSION"in t){return false}if("TERM_PROGRAM"in t){const e=parseVersion(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":if(e.major===3){return e.minor>=1}return e.major>3}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0"){return false}const e=parseVersion(t.VTE_VERSION);return e.major>0||e.minor>=50}return false}e.exports={supportsHyperlink:supportsHyperlink,stdout:supportsHyperlink(process.stdout),stderr:supportsHyperlink(process.stderr)}},5743:(e,t,n)=>{"use strict";const r=n(3898);const s=n(5360);const terminalLink=(e,t,{target:n="stdout",...o}={})=>{if(!s[n]){if(o.fallback===false){return e}return typeof o.fallback==="function"?o.fallback(e,t):`${e} (${t})`}return r.link(e,t)};e.exports=(e,t,n={})=>terminalLink(e,t,n);e.exports.stderr=(e,t,n={})=>terminalLink(e,t,{target:"stderr",...n});e.exports.isSupported=s.stdout;e.exports.stderr.isSupported=s.stderr},5012:(e,t,n)=>{const{URL:r}=n(7016);const{join:s}=n(6928);const o=n(9896);const{promisify:i}=n(9023);const{tmpdir:a}=n(857);const c=n(2139);const l=i(o.writeFile);const u=i(o.mkdir);const f=i(o.readFile);const compareVersions=(e,t)=>e.localeCompare(t,"en-US",{numeric:true});const encode=e=>encodeURIComponent(e).replace(/^%40/,"@");const getFile=async(e,t)=>{const n=a();const r=s(n,"update-check");if(!o.existsSync(r)){await u(r)}let i=`${e.name}-${t}.json`;if(e.scope){i=`${e.scope}-${i}`}return s(r,i)};const evaluateCache=async(e,t,n)=>{if(o.existsSync(e)){const r=await f(e,"utf8");const{lastUpdate:s,latest:o}=JSON.parse(r);const i=s+n;if(i>t){return{shouldCheck:false,latest:o}}}return{shouldCheck:true,latest:null}};const updateCache=async(e,t,n)=>{const r=JSON.stringify({latest:t,lastUpdate:n});await l(e,r,"utf8")};const loadPackage=(e,t)=>new Promise(((r,s)=>{const o={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(t){o.headers.authorization=`${t.type} ${t.token}`}const{get:i}=n(e.protocol==="https:"?5692:8611);i(o,(e=>{const{statusCode:t}=e;if(t!==200){const n=new Error(`Request failed with code ${t}`);n.code=t;s(n);e.resume();return}let n="";e.setEncoding("utf8");e.on("data",(e=>{n+=e}));e.on("end",(()=>{try{const e=JSON.parse(n);r(e)}catch(e){s(e)}}))})).on("error",s).on("timeout",s)}));const getMostRecent=async({full:e,scope:t},s)=>{const o=c(t);const i=new r(e,o);let a=null;try{a=await loadPackage(i)}catch(e){if(e.code&&String(e.code).startsWith(4)){const e=n(6856);const t=e(o,{recursive:true});a=await loadPackage(i,t)}else{throw e}}const l=a["dist-tags"][s];if(!l){throw new Error(`Distribution tag ${s} is not available`)}return l};const d={interval:36e5,distTag:"latest"};const getDetails=e=>{const t={full:encode(e)};if(e.includes("/")){const n=e.split("/");t.scope=n[0];t.name=n[1]}else{t.scope=null;t.name=e}return t};e.exports=async(e,t)=>{if(typeof e!=="object"){throw new Error("The first parameter should be your package.json file content")}const n=getDetails(e.name);const r=Date.now();const{distTag:s,interval:o}=Object.assign({},d,t);const i=await getFile(n,s);let a=null;let c=true;({shouldCheck:c,latest:a}=await evaluateCache(i,r,o));if(c){a=await getMostRecent(n,s);await updateCache(i,a,r)}const l=compareVersions(e.version,a);if(l===-1){return{latest:a,fromCache:!c}}return null}},4808:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.CocoaPodsPackageManager=t.CocoaPodsError=void 0;t.extractMissingDependencyError=extractMissingDependencyError;t.getPodUpdateMessage=getPodUpdateMessage;t.getPodRepoUpdateMessage=getPodRepoUpdateMessage;t.getImprovedPodInstallError=getImprovedPodInstallError;const s=r(n(8841));const o=r(n(2325));const i=n(9896);const a=r(n(857));const c=r(n(6928));class CocoaPodsError extends Error{code;cause;name="CocoaPodsError";isPackageManagerError=true;constructor(e,t,n){super(n?`${e}\n└─ Cause: ${n.message}`:e);this.code=t;this.cause=n}}t.CocoaPodsError=CocoaPodsError;function extractMissingDependencyError(e){const t=e.match(/Unable to find a specification for ['"`]([\w-_\d\s]+)['"`] depended upon by ['"`]([\w-_\d\s]+)['"`]/);if(t){return[t[1],t[2]]}return null}class CocoaPodsPackageManager{options;silent;static getPodProjectRoot(e){if(CocoaPodsPackageManager.isUsingPods(e))return e;const t=c.default.join(e,"ios");if(CocoaPodsPackageManager.isUsingPods(t))return t;const n=c.default.join(e,"macos");if(CocoaPodsPackageManager.isUsingPods(n))return n;return null}static isUsingPods(e){return(0,i.existsSync)(c.default.join(e,"Podfile"))}static async gemInstallCLIAsync(e=false,t={stdio:"inherit"}){const n=["install","cocoapods","--no-document"];try{await(0,s.default)("gem",n,t)}catch(r){if(e){throw new CocoaPodsError("Failed to install CocoaPods CLI with gem (recommended)","COMMAND_FAILED",r)}console.log("Your password might be needed to install CocoaPods CLI: https://guides.cocoapods.org/using/getting-started.html#installation");await(0,s.default)("sudo",["gem",...n],t)}}static async brewLinkCLIAsync(e={stdio:"inherit"}){await(0,s.default)("brew",["link","cocoapods"],e)}static async brewInstallCLIAsync(e={stdio:"inherit"}){await(0,s.default)("brew",["install","cocoapods"],e)}static async installCLIAsync({nonInteractive:e=false,spawnOptions:t={stdio:"inherit"}}){if(!t){t={stdio:"inherit"}}const n=!!t.ignoreStdio;try{!n&&console.log(`› Attempting to install CocoaPods CLI with Gem`);await CocoaPodsPackageManager.gemInstallCLIAsync(e,t);!n&&console.log(`› Successfully installed CocoaPods CLI with Gem`);return true}catch(e){if(!n){console.log(o.default.yellow(`› Failed to install CocoaPods CLI with Gem`));console.log(o.default.red(e.stderr??e.message));console.log(`› Attempting to install CocoaPods CLI with Homebrew`)}try{await CocoaPodsPackageManager.brewInstallCLIAsync(t);if(!await CocoaPodsPackageManager.isCLIInstalledAsync(t)){try{await CocoaPodsPackageManager.brewLinkCLIAsync(t);if(!await CocoaPodsPackageManager.isCLIInstalledAsync(t)){throw new CocoaPodsError("CLI could not be installed automatically with gem or Homebrew, please install CocoaPods manually and try again","NO_CLI",e)}}catch(e){throw new CocoaPodsError("Homebrew installation appeared to succeed but CocoaPods CLI not found in PATH and unable to link.","NO_CLI",e)}}!n&&console.log(`› Successfully installed CocoaPods CLI with Homebrew`);return true}catch(e){!n&&console.warn(o.default.yellow(`› Failed to install CocoaPods with Homebrew. Install CocoaPods CLI and try again: https://cocoapods.org/`));throw new CocoaPodsError(`Failed to install CocoaPods with Homebrew. Install CocoaPods CLI and try again: https://cocoapods.org/`,"NO_CLI",e)}}}static isAvailable(e,t){if(process.platform!=="darwin"){!t&&console.log(o.default.red("CocoaPods is only supported on macOS machines"));return false}if(!CocoaPodsPackageManager.isUsingPods(e)){!t&&console.log(o.default.yellow("CocoaPods is not supported in this project"));return false}return true}static async isCLIInstalledAsync(e={stdio:"inherit"}){try{await(0,s.default)("pod",["--version"],e);return true}catch{return false}}constructor({cwd:e,silent:t}){this.silent=!!t;this.options={cwd:e,stdio:"pipe"}}get name(){return"CocoaPods"}async installAsync({spinner:e}={}){await this._installAsync({spinner:e})}isCLIInstalledAsync(){return CocoaPodsPackageManager.isCLIInstalledAsync(this.options)}installCLIAsync(){return CocoaPodsPackageManager.installCLIAsync({nonInteractive:true,spawnOptions:this.options})}async handleInstallErrorAsync({error:e,shouldUpdate:t=true,updatedPackages:n=[],spinner:r}){if(!e.output){throw e}if(!t){throw getImprovedPodInstallError(e,{cwd:this.options.cwd})}const s=e.output.join(a.default.EOL).trim();const{updatePackage:i,shouldUpdateRepo:c}=getPodUpdateMessage(s);if(!i||n.includes(i)){return await this._installAsync({spinner:r,shouldRepoUpdate:true,shouldUpdate:false,updatedPackages:n})}n.push(i);return await this.runInstallTypeCommandAsync(["update",i,c?"":"--no-repo-update"].filter(Boolean),{formatWarning(){const e=`Failed to update ${o.default.bold(i)}. Attempting to update the repo instead.`;return e},spinner:r,updatedPackages:n})}async _installAsync({shouldRepoUpdate:e,...t}={}){return await this.runInstallTypeCommandAsync(["install",e?"--repo-update":""].filter(Boolean),{formatWarning(e){return getPodRepoUpdateMessage(e.output.join(a.default.EOL).trim()).message},...t})}async runInstallTypeCommandAsync(e,{formatWarning:t,...n}={}){try{return await this._runAsync(e)}catch(e){if(t){const r=t(e);if(n.spinner){n.spinner.text=o.default.bold(r)}if(!this.silent){console.warn(o.default.yellow(r))}}return await this.handleInstallErrorAsync({error:e,...n})}}async addWithParametersAsync(e,t){throw new Error("Unimplemented")}addAsync(e=[]){throw new Error("Unimplemented")}addDevAsync(e=[]){throw new Error("Unimplemented")}addGlobalAsync(e=[]){throw new Error("Unimplemented")}removeAsync(e=[]){throw new Error("Unimplemented")}removeDevAsync(e=[]){throw new Error("Unimplemented")}removeGlobalAsync(e=[]){throw new Error("Unimplemented")}async versionAsync(){const{stdout:e}=await(0,s.default)("pod",["--version"],this.options);return e.trim()}async configAsync(e){throw new Error("Unimplemented")}async removeLockfileAsync(){throw new Error("Unimplemented")}async uninstallAsync(){throw new Error("Unimplemented")}async podRepoUpdateAsync(){try{await this._runAsync(["repo","update"])}catch(e){e.message=e.message||(e.stderr??e.stdout);throw new CocoaPodsError("The command `pod install --repo-update` failed","COMMAND_FAILED",e)}}async _runAsync(e){if(!this.silent){console.log(`> pod ${e.join(" ")}`)}const t=(0,s.default)("pod",[...e,"--ansi"],{...this.options,stdio:"pipe"});if(!this.silent){if(t.child.stdout){t.child.stdout.pipe(process.stdout)}}return await t}}t.CocoaPodsPackageManager=CocoaPodsPackageManager;function shouldPodRepoUpdate(e){const t=e;const n=t.includes("pod repo update")||t.includes("--no-repo-update");return n}function getPodUpdateMessage(e){const t=e.match(/run ['"`]pod update ([\w-_\d/]+)( --no-repo-update)?['"`] to apply changes/);return{updatePackage:t?.[1]??null,shouldUpdateRepo:!t?.[2]}}function getPodRepoUpdateMessage(e){const t=extractMissingDependencyError(e);const n=getPodUpdateMessage(e);let r;if(t){r=`Couldn't install: ${t[1]} » ${o.default.underline(t[0])}.`}else if(n?.updatePackage){r=`Couldn't install: ${n?.updatePackage}.`}else{r=`Couldn't install Pods.`}r+=` Updating the Pods project and trying again...`;return{message:r,...n}}function getImprovedPodInstallError(e,{cwd:t=process.cwd()}){const n=e.output.join(a.default.EOL).trim();if(e.stdout.match(/No [`'"]Podfile[`'"] found in the project directory/)){e.message=`No Podfile found in directory: ${t}. Ensure CocoaPods is setup any try again.`}else if(shouldPodRepoUpdate(n)){const t=extractMissingDependencyError(n);let r;if(t){r=`Couldn't install: ${t[1]} » ${o.default.underline(t[0])}`}else{r=`This is often due to native package versions mismatching`}let s;if(t?.[0]){if(t[0].match(/^(?:@?expo|@?react)(-|\/)/)){s=`Ensure the node module "${t[0]}" is installed in your project, then run 'npx pod-install' to try again.`}else{s=`Ensure the CocoaPod "${t[0]}" is installed in your project, then run 'npx pod-install' to try again.`}}else{s=`Try deleting the 'ios/Pods' folder or the 'ios/Podfile.lock' file and running 'npx pod-install' to resolve.`}e.message=`${r}. ${s}`;if(e.stdout){const t=e.stdout.split(a.default.EOL);const n=t.findIndex((e=>e.startsWith("[!]")));if(n!==-1){const r=t.slice(n).join(a.default.EOL);e.message+=`\n\n${o.default.gray(r)}`}}return new CocoaPodsError("Command `pod install --repo-update` failed.","COMMAND_FAILED",e)}else{let t=e.stderr.trim();const n=e.stdout.match(/\[!\]\s((?:.|\n)*)/)?.[1];if(n){if(e.message?.match(/pod exited with non-zero code: 1/)){e.message=""}t=null}e.message=[n,e.message,t].filter(Boolean).join("\n")}return new CocoaPodsError("Command `pod install` failed.","COMMAND_FAILED",e)}},3018:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=n(4808);const o=r(n(2325));const i=n(7313);const a=n(9896);const c=n(6928);const l=r(n(6909));const u=n(7583);const f=n(8330);function info(e){if(!d.opts().quiet){console.log(e)}}async function runAsync(e){if(process.platform!=="darwin"){info(o.default.yellow("⚠️ CocoaPods is only supported on darwin machines"));process.exit(0)}const t=e&&!e.startsWith("--");const n=(0,c.resolve)(t?e:process.cwd());if(!(0,a.existsSync)(n)){info(o.default.red(`\n💥 Target directory does not exist: ${n}\n`));process.exit(1)}const r=s.CocoaPodsPackageManager.getPodProjectRoot(n);if(!r){const e=(0,c.join)(n,"package.json");if(!(0,a.existsSync)(e)){info(o.default.red(`\n💥 'package.json' file does not exist: ${e}\n`));process.exit(1)}const r=JSON.parse((0,a.readFileSync)(e).toString());const s=r.dependencies?.hasOwnProperty("expo");if(s){info(o.default.yellow(`⚠️ No 'ios' directory found, skipping installing pods.`,`\nPods will be automatically installed when the 'ios' directory is generated with 'npx expo prebuild' or 'npx expo run:ios'.`,(0,u.learnMore)("https://docs.expo.dev/workflow/prebuild/")));process.exit(0)}if(t){info(o.default.yellow(`⚠️ CocoaPods is not supported in project at ${n}`))}else{info(o.default.yellow("⚠️ CocoaPods is not supported in this project"))}process.exit(0)}info("🔍️ Scanning for pods...");if(!await s.CocoaPodsPackageManager.isCLIInstalledAsync()){await s.CocoaPodsPackageManager.installCLIAsync({nonInteractive:d.opts().nonInteractive})}const i=new s.CocoaPodsPackageManager({cwd:r});try{await i.installAsync()}catch(e){if(e.isPackageManagerError){console.error(o.default.red(e.message));process.exit(1)}throw e}}const d=new i.Command(f.name).version(f.version).arguments("[project-directory]").usage(`${o.default.green("[project-directory]")} [options]`).description("A fast, zero-dependency package for cutting down on common issues developers have when running pod install.").option("--quiet","only print errors").option("--non-interactive","disable interactive prompts").allowUnknownOption().parse(process.argv).action((async e=>{try{await runAsync(e);if(!d.opts().quiet){await(0,l.default)()}}catch(e){console.log("\nAborting run");if(e.command){console.log(` ${o.default.magenta(e.command)} has failed.`)}else{console.log(o.default.red`💥 An unexpected error was encountered. Report it on GitHub: https://github.com/expo/expo/issues`);console.log(e)}console.log();if(!d.opts().quiet){await(0,l.default)()}process.exit(1)}}));(async()=>{await d.parseAsync(process.argv)})()},6909:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t["default"]=shouldUpdate;const s=r(n(2325));const o=r(n(5012));async function shouldUpdate(){const e=n(8330);const t=(0,o.default)(e).catch((()=>null));try{const n=await t;if(n&&n.latest){console.log();console.log(s.default.yellow.bold(`A new version of \`${e.name}\` is available`));console.log("You can update by running: "+s.default.cyan(`npm i -g ${e.name}`));console.log()}}catch{}}},7583:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.learnMore=learnMore;const s=r(n(2325));const o=r(n(5743));function learnMore(e){return(0,o.default)(s.default.underline("Learn more."),e,{fallback:(e,t)=>`Learn more: ${s.default.underline(t)}`})}},181:e=>{"use strict";e.exports=require("buffer")},5317:e=>{"use strict";e.exports=require("child_process")},9896:e=>{"use strict";e.exports=require("fs")},8611:e=>{"use strict";e.exports=require("http")},5692:e=>{"use strict";e.exports=require("https")},1421:e=>{"use strict";e.exports=require("node:child_process")},8474:e=>{"use strict";e.exports=require("node:events")},3024:e=>{"use strict";e.exports=require("node:fs")},6760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},2018:e=>{"use strict";e.exports=require("tty")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},7313:(e,t,n)=>{const{Argument:r}=n(854);const{Command:s}=n(9600);const{CommanderError:o,InvalidArgumentError:i}=n(9851);const{Help:a}=n(1518);const{Option:c}=n(7596);t.program=new s;t.createCommand=e=>new s(e);t.createOption=(e,t)=>new c(e,t);t.createArgument=(e,t)=>new r(e,t);t.Command=s;t.Option=c;t.Argument=r;t.Help=a;t.CommanderError=o;t.InvalidArgumentError=i;t.InvalidOptionArgumentError=i},854:(e,t,n)=>{const{InvalidArgumentError:r}=n(9851);class Argument{constructor(e,t){this.description=t||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(e[0]){case"<":this.required=true;this._name=e.slice(1,-1);break;case"[":this.required=false;this._name=e.slice(1,-1);break;default:this.required=true;this._name=e;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t)){return[e]}return t.concat(e)}default(e,t){this.defaultValue=e;this.defaultValueDescription=t;return this}argParser(e){this.parseArg=e;return this}choices(e){this.argChoices=e.slice();this.parseArg=(e,t)=>{if(!this.argChoices.includes(e)){throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,t)}return e};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(e){const t=e.name()+(e.variadic===true?"...":"");return e.required?"<"+t+">":"["+t+"]"}t.Argument=Argument;t.humanReadableArgName=humanReadableArgName},9600:(e,t,n)=>{const r=n(8474).EventEmitter;const s=n(1421);const o=n(6760);const i=n(3024);const a=n(1708);const{Argument:c,humanReadableArgName:l}=n(854);const{CommanderError:u}=n(9851);const{Help:f}=n(1518);const{Option:d,DualOptions:h}=n(7596);const{suggestSimilar:p}=n(9266);class Command extends r{constructor(e){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=e||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:undefined,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:undefined,outputError:(e,t)=>t(e)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(e){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;return this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent){e.push(t)}return e}command(e,t,n){let r=t;let s=n;if(typeof r==="object"&&r!==null){s=r;r=null}s=s||{};const[,o,i]=e.match(/([^ ]+) *(.*)/);const a=this.createCommand(o);if(r){a.description(r);a._executableHandler=true}if(s.isDefault)this._defaultCommandName=a._name;a._hidden=!!(s.noHelp||s.hidden);a._executableFile=s.executableFile||null;if(i)a.arguments(i);this._registerCommand(a);a.parent=this;a.copyInheritedSettings(this);if(r)return this;return a}createCommand(e){return new Command(e)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(e){if(e===undefined)return this._helpConfiguration;this._helpConfiguration=e;return this}configureOutput(e){if(e===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,e);return this}showHelpAfterError(e=true){if(typeof e!=="string")e=!!e;this._showHelpAfterError=e;return this}showSuggestionAfterError(e=true){this._showSuggestionAfterError=!!e;return this}addCommand(e,t){if(!e._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}t=t||{};if(t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=true;this._registerCommand(e);e.parent=this;e._checkForBrokenPassThrough();return this}createArgument(e,t){return new c(e,t)}argument(e,t,n,r){const s=this.createArgument(e,t);if(typeof n==="function"){s.default(r).argParser(n)}else{s.default(n)}this.addArgument(s);return this}arguments(e){e.trim().split(/ +/).forEach((e=>{this.argument(e)}));return this}addArgument(e){const 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!==undefined&&e.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${e.name()}'`)}this.registeredArguments.push(e);return this}helpCommand(e,t){if(typeof e==="boolean"){this._addImplicitHelpCommand=e;return this}e=e??"help [command]";const[,n,r]=e.match(/([^ ]+) *(.*)/);const s=t??"display help for command";const o=this.createCommand(n);o.helpOption(false);if(r)o.arguments(r);if(s)o.description(s);this._addImplicitHelpCommand=true;this._helpCommand=o;return this}addHelpCommand(e,t){if(typeof e!=="object"){this.helpCommand(e,t);return this}this._addImplicitHelpCommand=true;this._helpCommand=e;return this}_getHelpCommand(){const e=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(e){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e)){throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`)}if(this._lifeCycleHooks[e]){this._lifeCycleHooks[e].push(t)}else{this._lifeCycleHooks[e]=[t]}return this}exitOverride(e){if(e){this._exitCallback=e}else{this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync"){throw e}else{}}}return this}_exit(e,t,n){if(this._exitCallback){this._exitCallback(new u(e,t,n))}a.exit(e)}action(e){const listener=t=>{const n=this.registeredArguments.length;const r=t.slice(0,n);if(this._storeOptionsAsProperties){r[n]=this}else{r[n]=this.opts()}r.push(this);return e.apply(this,r)};this._actionHandler=listener;return this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code==="commander.invalidArgument"){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const 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}'\n- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const knownBy=e=>[e.name()].concat(e.aliases());const t=knownBy(e).find((e=>this._findCommand(e)));if(t){const n=knownBy(this._findCommand(t)).join("|");const r=knownBy(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name();const n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");if(!this._findOption(t)){this.setOptionValueWithSource(n,e.defaultValue===undefined?true:e.defaultValue,"default")}}else if(e.defaultValue!==undefined){this.setOptionValueWithSource(n,e.defaultValue,"default")}const handleOptionValue=(t,r,s)=>{if(t==null&&e.presetArg!==undefined){t=e.presetArg}const o=this.getOptionValue(n);if(t!==null&&e.parseArg){t=this._callParseArg(e,t,o,r)}else if(t!==null&&e.variadic){t=e._concatValue(t,o)}if(t==null){if(e.negate){t=false}else if(e.isBoolean()||e.optional){t=true}else{t=""}}this.setOptionValueWithSource(n,t,s)};this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;handleOptionValue(t,n,"cli")}));if(e.envVar){this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;handleOptionValue(t,n,"env")}))}return this}_optionEx(e,t,n,r,s){if(typeof t==="object"&&t instanceof d){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const o=this.createOption(t,n);o.makeOptionMandatory(!!e.mandatory);if(typeof r==="function"){o.default(s).argParser(r)}else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n};o.default(s).argParser(r)}else{o.default(r)}return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:true},e,t,n,r)}combineFlagAndOptionalValue(e=true){this._combineFlagAndOptionalValue=!!e;return this}allowUnknownOption(e=true){this._allowUnknownOption=!!e;return this}allowExcessArguments(e=true){this._allowExcessArguments=!!e;return this}enablePositionalOptions(e=true){this._enablePositionalOptions=!!e;return this}passThroughOptions(e=true){this._passThroughOptions=!!e;this._checkForBrokenPassThrough();return 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=true){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")}this._storeOptionsAsProperties=!!e;return this}getOptionValue(e){if(this._storeOptionsAsProperties){return this[e]}return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,undefined)}setOptionValueWithSource(e,t,n){if(this._storeOptionsAsProperties){this[e]=t}else{this._optionValues[e]=t}this._optionValueSources[e]=n;return this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;this._getCommandAndAncestors().forEach((n=>{if(n.getOptionValueSource(e)!==undefined){t=n.getOptionValueSource(e)}}));return t}_prepareUserArgs(e,t){if(e!==undefined&&!Array.isArray(e)){throw new Error("first parameter to parse must be array or undefined")}t=t||{};if(e===undefined&&t.from===undefined){if(a.versions?.electron){t.from="electron"}const e=a.execArgv??[];if(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print")){t.from="eval"}}if(e===undefined){e=a.argv}this.rawArgs=e.slice();let n;switch(t.from){case undefined:case"node":this._scriptPath=e[1];n=e.slice(2);break;case"electron":if(a.defaultApp){this._scriptPath=e[1];n=e.slice(2)}else{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}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return n}parse(e,t){const n=this._prepareUserArgs(e,t);this._parseCommand([],n);return this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);await this._parseCommand([],n);return this}_executeSubCommand(e,t){t=t.slice();let n=false;const r=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(e,t){const n=o.resolve(e,t);if(i.existsSync(n))return n;if(r.includes(o.extname(t)))return undefined;const s=r.find((e=>i.existsSync(`${n}${e}`)));if(s)return`${n}${s}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let c=e._executableFile||`${this._name}-${e._name}`;let l=this._executableDir||"";if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}l=o.resolve(o.dirname(e),l)}if(l){let t=findFile(l,c);if(!t&&!e._executableFile&&this._scriptPath){const n=o.basename(this._scriptPath,o.extname(this._scriptPath));if(n!==this._name){t=findFile(l,`${n}-${e._name}`)}}c=t||c}n=r.includes(o.extname(c));let f;if(a.platform!=="win32"){if(n){t.unshift(c);t=incrementNodeInspectorPort(a.execArgv).concat(t);f=s.spawn(a.argv[0],t,{stdio:"inherit"})}else{f=s.spawn(c,t,{stdio:"inherit"})}}else{t.unshift(c);t=incrementNodeInspectorPort(a.execArgv).concat(t);f=s.spawn(a.execPath,t,{stdio:"inherit"})}if(!f.killed){const e=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];e.forEach((e=>{a.on(e,(()=>{if(f.killed===false&&f.exitCode===null){f.kill(e)}}))}))}const d=this._exitCallback;f.on("close",(e=>{e=e??1;if(!d){a.exit(e)}else{d(new u(e,"commander.executeSubCommandAsync","(close)"))}}));f.on("error",(t=>{if(t.code==="ENOENT"){const t=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const n=`'${c}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}else if(t.code==="EACCES"){throw new Error(`'${c}' not executable`)}if(!d){a.exit(1)}else{const e=new u(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t;d(e)}}));this.runningCommand=f}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);if(!r)this.help({error:true});let s;s=this._chainOrCallSubCommandHook(s,r,"preSubcommand");s=this._chainOrCall(s,(()=>{if(r._executableHandler){this._executeSubCommand(r,t.concat(n))}else{return r._parseCommand(t,n)}}));return s}_dispatchHelpCommand(e){if(!e){this.help()}const t=this._findCommand(e);if(t&&!t._executableHandler){t.help()}return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((e,t)=>{if(e.required&&this.args[t]==null){this.missingArgument(e.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,s)}return r};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach(((t,n)=>{let r=t.defaultValue;if(t.variadic){if(n<this.args.length){r=this.args.slice(n);if(t.parseArg){r=r.reduce(((e,n)=>myParseArg(t,n,e)),t.defaultValue)}}else if(r===undefined){r=[]}}else if(n<this.args.length){r=this.args[n];if(t.parseArg){r=myParseArg(t,r,t.defaultValue)}}e[n]=r}));this.processedArgs=e}_chainOrCall(e,t){if(e&&e.then&&typeof e.then==="function"){return e.then((()=>t()))}return t()}_chainOrCallHooks(e,t){let n=e;const r=[];this._getCommandAndAncestors().reverse().filter((e=>e._lifeCycleHooks[t]!==undefined)).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))}));if(t==="postAction"){r.reverse()}r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))}));return n}_chainOrCallSubCommandHook(e,t,n){let r=e;if(this._lifeCycleHooks[n]!==undefined){this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))}))}return r}_parseCommand(e,t){const n=this.parseOptions(t);this._parseOptionsEnv();this._parseOptionsImplied();e=e.concat(n.operands);t=n.unknown;this.args=e.concat(t);if(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){this._outputHelpIfRequested(t);return this._dispatchSubcommand(this._defaultCommandName,e,t)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(n.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(n.unknown.length>0){this.unknownOption(n.unknown[0])}};const r=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let n;n=this._chainOrCallHooks(n,"preAction");n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs)));if(this.parent){n=this._chainOrCall(n,(()=>{this.parent.emit(r,e,t)}))}n=this._chainOrCallHooks(n,"postAction");return n}if(this.parent&&this.parent.listenerCount(r)){checkForUnknownOptions();this._processArguments();this.parent.emit(r,e,t)}else if(e.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",e,t)}if(this.listenerCount("command:*")){this.emit("command:*",e,t)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(e){if(!e)return undefined;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=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===undefined){e.missingMandatoryOptionValue(t)}}))}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();if(this.getOptionValue(t)===undefined){return false}return this.getOptionValueSource(t)!=="default"}));const t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));if(n){this._conflictingOption(t,n)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e=>{e._checkForConflictingLocalOptions()}))}parseOptions(e){const t=[];const n=[];let r=t;const s=e.slice();function maybeOption(e){return e.length>1&&e[0]==="-"}let o=null;while(s.length){const e=s.shift();if(e==="--"){if(r===n)r.push(e);r.push(...s);break}if(o&&!maybeOption(e)){this.emit(`option:${o.name()}`,e);continue}o=null;if(maybeOption(e)){const t=this._findOption(e);if(t){if(t.required){const e=s.shift();if(e===undefined)this.optionMissingArgument(t);this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;if(s.length>0&&!maybeOption(s[0])){e=s.shift()}this.emit(`option:${t.name()}`,e)}else{this.emit(`option:${t.name()}`)}o=t.variadic?t:null;continue}}if(e.length>2&&e[0]==="-"&&e[1]!=="-"){const t=this._findOption(`-${e[1]}`);if(t){if(t.required||t.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${t.name()}`,e.slice(2))}else{this.emit(`option:${t.name()}`);s.unshift(`-${e.slice(2)}`)}continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("=");const n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(maybeOption(e)){r=n}if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(e)){t.push(e);if(s.length>0)n.push(...s);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e);if(s.length>0)t.push(...s);break}else if(this._defaultCommandName){n.push(e);if(s.length>0)n.push(...s);break}}if(this._passThroughOptions){r.push(e);if(s.length>0)r.push(...s);break}r.push(e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={};const t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const n=t||{};const r=n.exitCode||1;const s=n.code||"commander.error";this._exit(r,s,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in a.env){const t=e.attributeName();if(this.getOptionValue(t)===undefined||["default","config","env"].includes(this.getOptionValueSource(t))){if(e.required||e.optional){this.emit(`optionEnv:${e.name()}`,a.env[e.envVar])}else{this.emit(`optionEnv:${e.name()}`)}}}}))}_parseOptionsImplied(){const e=new h(this.options);const hasCustomOptionValue=e=>this.getOptionValue(e)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((t=>t.implied!==undefined&&hasCustomOptionValue(t.attributeName())&&e.valueFromOption(this.getOptionValue(t.attributeName()),t))).forEach((e=>{Object.keys(e.implied).filter((e=>!hasCustomOptionValue(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const findBestOptionFromValue=e=>{const t=e.attributeName();const n=this.getOptionValue(t);const r=this.options.find((e=>e.negate&&t===e.attributeName()));const s=this.options.find((e=>!e.negate&&t===e.attributeName()));if(r&&(r.presetArg===undefined&&n===false||r.presetArg!==undefined&&n===r.presetArg)){return r}return s||e};const getErrorMessage=e=>{const t=findBestOptionFromValue(e);const n=t.attributeName();const r=this.getOptionValueSource(n);if(r==="env"){return`environment variable '${t.envVar}'`}return`option '${t.flags}'`};const n=`error: ${getErrorMessage(e)} cannot be used with ${getErrorMessage(t)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[];let r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e);r=r.parent}while(r&&!r._enablePositionalOptions);t=p(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length;const n=t===1?"":"s";const r=this.parent?` for '${this.name()}'`:"";const s=`error: too many arguments${r}. Expected ${t} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name());if(e.alias())n.push(e.alias())}));t=p(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===undefined)return this._version;this._version=e;t=t||"-V, --version";n=n||"output the version number";const r=this.createOption(t,n);this._versionOptionName=r.attributeName();this._registerOption(r);this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`);this._exit(0,"commander.version",e)}));return this}description(e,t){if(e===undefined&&t===undefined)return this._description;this._description=e;if(t){this._argsDescription=t}return this}summary(e){if(e===undefined)return this._summary;this._summary=e;return this}alias(e){if(e===undefined)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]}if(e===t._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(e);if(n){const t=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}t._aliases.push(e);return this}aliases(e){if(e===undefined)return this._aliases;e.forEach((e=>this.alias(e)));return this}usage(e){if(e===undefined){if(this._usage)return this._usage;const e=this.registeredArguments.map((e=>l(e)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}this._usage=e;return this}name(e){if(e===undefined)return this._name;this._name=e;return this}nameFromFilename(e){this._name=o.basename(e,o.extname(e));return this}executableDir(e){if(e===undefined)return this._executableDir;this._executableDir=e;return this}helpInformation(e){const t=this.createHelp();if(t.helpWidth===undefined){t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return t.formatHelp(this,t)}_getHelpContext(e){e=e||{};const t={error:!!e.error};let n;if(t.error){n=e=>this._outputConfiguration.writeErr(e)}else{n=e=>this._outputConfiguration.writeOut(e)}t.write=e.write||n;t.command=this;return t}outputHelp(e){let t;if(typeof e==="function"){t=e;e=undefined}const n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach((e=>e.emit("beforeAllHelp",n)));this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t){r=t(r);if(typeof r!=="string"&&!Buffer.isBuffer(r)){throw new Error("outputHelp callback must return a string or a Buffer")}}n.write(r);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",n);this._getCommandAndAncestors().forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if(typeof e==="boolean"){if(e){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}e=e??"-h, --help";t=t??"display help for command";this._helpOption=this.createOption(e,t);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(e){this._helpOption=e;return this}help(e){this.outputHelp(e);let t=a.exitCode||0;if(t===0&&e&&typeof e!=="function"&&e.error){t=1}this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`)}const r=`${e}Help`;this.on(r,(e=>{let n;if(typeof t==="function"){n=t({error:e.error,command:e.command})}else{n=t}if(n){e.write(`${n}\n`)}}));return this}_outputHelpIfRequested(e){const t=this._getHelpOption();const n=t&&e.find((e=>t.is(e)));if(n){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(e){return e.map((e=>{if(!e.startsWith("--inspect")){return e}let t;let n="127.0.0.1";let r="9229";let s;if((s=e.match(/^(--inspect(-brk)?)$/))!==null){t=s[1]}else if((s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){t=s[1];if(/^\d+$/.test(s[3])){r=s[3]}else{n=s[3]}}else if((s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){t=s[1];n=s[3];r=s[4]}if(t&&r!=="0"){return`${t}=${n}:${parseInt(r)+1}`}return e}))}t.Command=Command},9851:(e,t)=>{class CommanderError 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=undefined}}class InvalidArgumentError extends CommanderError{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}t.CommanderError=CommanderError;t.InvalidArgumentError=InvalidArgumentError},1518:(e,t,n)=>{const{humanReadableArgName:r}=n(854);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));const n=e._getHelpCommand();if(n&&!n._hidden){t.push(n)}if(this.sortSubcommands){t.sort(((e,t)=>e.name().localeCompare(t.name())))}return t}compareOptions(e,t){const getSortKey=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return getSortKey(e).localeCompare(getSortKey(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden));const n=e._getHelpOption();if(n&&!n.hidden){const r=n.short&&e._findOption(n.short);const s=n.long&&e._findOption(n.long);if(!r&&!s){t.push(n)}else if(n.long&&!s){t.push(e.createOption(n.long,n.description))}else if(n.short&&!r){t.push(e.createOption(n.short,n.description))}}if(this.sortOptions){t.sort(this.compareOptions)}return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}if(this.sortOptions){t.sort(this.compareOptions)}return t}visibleArguments(e){if(e._argsDescription){e.registeredArguments.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""}))}if(e.registeredArguments.find((e=>e.description))){return e.registeredArguments}return[]}subcommandTerm(e){const t=e.registeredArguments.map((e=>r(e))).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(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;if(e._aliases[0]){t=t+"|"+e._aliases[0]}let n="";for(let t=e.parent;t;t=t.parent){n=t.name()+" "+n}return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices){t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){const n=e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean";if(n){t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}}if(e.presetArg!==undefined&&e.optional){t.push(`preset: ${JSON.stringify(e.presetArg)}`)}if(e.envVar!==undefined){t.push(`env: ${e.envVar}`)}if(t.length>0){return`${e.description} (${t.join(", ")})`}return e.description}argumentDescription(e){const t=[];if(e.argChoices){t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(t.length>0){const n=`(${t.join(", ")})`;if(e.description){return`${e.description} ${n}`}return n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t);const r=t.helpWidth||80;const s=2;const o=2;function formatItem(e,i){if(i){const a=`${e.padEnd(n+o)}${i}`;return t.wrap(a,r-s,n+o)}return e}function formatList(e){return e.join("\n").replace(/^/gm," ".repeat(s))}let i=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);if(a.length>0){i=i.concat([t.wrap(a,r,0),""])}const c=t.visibleArguments(e).map((e=>formatItem(t.argumentTerm(e),t.argumentDescription(e))));if(c.length>0){i=i.concat(["Arguments:",formatList(c),""])}const l=t.visibleOptions(e).map((e=>formatItem(t.optionTerm(e),t.optionDescription(e))));if(l.length>0){i=i.concat(["Options:",formatList(l),""])}if(this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>formatItem(t.optionTerm(e),t.optionDescription(e))));if(n.length>0){i=i.concat(["Global Options:",formatList(n),""])}}const u=t.visibleCommands(e).map((e=>formatItem(t.subcommandTerm(e),t.subcommandDescription(e))));if(u.length>0){i=i.concat(["Commands:",formatList(u),""])}return i.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const s=" \\f\\t\\v - \ufeff";const o=new RegExp(`[\\n][${s}]+`);if(e.match(o))return e;const i=t-n;if(i<r)return e;const a=e.slice(0,n);const c=e.slice(n).replace("\r\n","\n");const l=" ".repeat(n);const u="";const f=`\\s${u}`;const d=new RegExp(`\n|.{1,${i-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g");const h=c.match(d)||[];return a+h.map(((e,t)=>{if(e==="\n")return"";return(t>0?l:"")+e.trimEnd()})).join("\n")}}t.Help=Help},7596:(e,t,n)=>{const{InvalidArgumentError:r}=n(9851);class Option{constructor(e,t){this.flags=e;this.description=t||"";this.required=e.includes("<");this.optional=e.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(e);this.mandatory=false;const n=splitOptionFlags(e);this.short=n.shortFlag;this.long=n.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(e,t){this.defaultValue=e;this.defaultValueDescription=t;return this}preset(e){this.presetArg=e;return this}conflicts(e){this.conflictsWith=this.conflictsWith.concat(e);return this}implies(e){let t=e;if(typeof e==="string"){t={[e]:true}}this.implied=Object.assign(this.implied||{},t);return this}env(e){this.envVar=e;return this}argParser(e){this.parseArg=e;return this}makeOptionMandatory(e=true){this.mandatory=!!e;return this}hideHelp(e=true){this.hidden=!!e;return this}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t)){return[e]}return t.concat(e)}choices(e){this.argChoices=e.slice();this.parseArg=(e,t)=>{if(!this.argChoices.includes(e)){throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,t)}return e};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(e){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;e.forEach((e=>{if(e.negate){this.negativeOptions.set(e.attributeName(),e)}else{this.positiveOptions.set(e.attributeName(),e)}}));this.negativeOptions.forEach(((e,t)=>{if(this.positiveOptions.has(t)){this.dualOptions.add(t)}}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return true;const r=this.negativeOptions.get(n).presetArg;const s=r!==undefined?r:false;return t.negate===(s===e)}}function camelcase(e){return e.split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}function splitOptionFlags(e){let t;let n;const r=e.split(/[ |,]+/);if(r.length>1&&!/^[[<]/.test(r[1]))t=r.shift();n=r.shift();if(!t&&/^-[^-]$/.test(n)){t=n;n=undefined}return{shortFlag:t,longFlag:n}}t.Option=Option;t.DualOptions=DualOptions},9266:(e,t)=>{const n=3;function editDistance(e,t){if(Math.abs(e.length-t.length)>n)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++){r[t]=[t]}for(let e=0;e<=t.length;e++){r[0][e]=e}for(let n=1;n<=t.length;n++){for(let s=1;s<=e.length;s++){let o=1;if(e[s-1]===t[n-1]){o=0}else{o=1}r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+o);if(s>1&&n>1&&e[s-1]===t[n-2]&&e[s-2]===t[n-1]){r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1)}}}return r[e.length][t.length]}function suggestSimilar(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));const r=e.startsWith("--");if(r){e=e.slice(2);t=t.map((e=>e.slice(2)))}let s=[];let o=n;const i=.4;t.forEach((t=>{if(t.length<=1)return;const n=editDistance(e,t);const r=Math.max(e.length,t.length);const a=(r-n)/r;if(a>i){if(n<o){o=n;s=[t]}else if(n===o){s.push(t)}}}));s.sort(((e,t)=>e.localeCompare(t)));if(r){s=s.map((e=>`--${e}`))}if(s.length>1){return`\n(Did you mean one of ${s.join(", ")}?)`}if(s.length===1){return`\n(Did you mean ${s[0]}?)`}return""}t.suggestSimilar=suggestSimilar},8330:e=>{"use strict";e.exports=JSON.parse('{"name":"pod-install","version":"1.0.6","description":"A fast, zero-dependency package for cutting down on common issues developers have when running pod install.","main":"./build/index.js","scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"expo-module clean && yarn run build:prod","prepublishOnly":"expo-module prepublishOnly","typecheck":"expo-module typecheck","watch":"yarn run build --watch"},"bin":"./build/index.js","files":["build"],"repository":{"type":"git","url":"https://github.com/expo/expo.git"},"keywords":["cocoapods","pod-install","npx","ios"],"author":"Expo <support@expo.dev>","license":"MIT","homepage":"https://github.com/expo/expo/tree/main/packages/pod-install","bugs":{"url":"https://github.com/expo/expo/issues"},"devDependencies":{"@expo/package-manager":"^1.9.6","chalk":"^4.0.0","commander":"^12.1.0","expo-module-scripts":"^5.0.6","terminal-link":"^2.1.1","update-check":"^1.5.4"},"gitHead":"d635404a12ea7996b987ce0fb7679a238ebcf31b"}')}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var s=t[n]={id:n,loaded:false,exports:{}};var o=true;try{e[n].call(s.exports,s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[n]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(3018);module.exports=n})();
|
|
30
|
+
var r=n(181);var s=r.Buffer;function copyProps(e,t){for(var n in e){t[n]=e[n]}}if(s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow){e.exports=r}else{copyProps(r,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,n){return s(e,t,n)}SafeBuffer.prototype=Object.create(s.prototype);copyProps(s,SafeBuffer);SafeBuffer.from=function(e,t,n){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return s(e,t,n)};SafeBuffer.alloc=function(e,t,n){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var r=s(e);if(t!==undefined){if(typeof n==="string"){r.fill(t,n)}else{r.fill(t)}}else{r.fill(0)}return r};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return s(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return r.SlowBuffer(e)}},2668:(e,t,n)=>{"use strict";const r=n(3570);e.exports=(e="")=>{const t=e.match(r);if(!t){return null}const[n,s]=t[0].replace(/#! ?/,"").split(" ");const o=n.split("/").pop();if(o==="env"){return s}return s?`${o} ${s}`:o}},3570:e=>{"use strict";e.exports=/^#!(.*)/},3662:(e,t,n)=>{"use strict";const r=n(857);const s=n(2018);const o=n(9473);const{env:i}=process;let a;if(o("no-color")||o("no-colors")||o("color=false")||o("color=never")){a=0}else if(o("color")||o("colors")||o("color=true")||o("color=always")){a=1}if("FORCE_COLOR"in i){if(i.FORCE_COLOR==="true"){a=1}else if(i.FORCE_COLOR==="false"){a=0}else{a=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const n=a||0;if(i.TERM==="dumb"){return n}if(process.platform==="win32"){const e=r.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,s.isatty(1))),stderr:translateLevel(supportsColor(true,s.isatty(2)))}},5360:(e,t,n)=>{"use strict";const r=n(3662);const s=n(9473);function parseVersion(e){if(/^\d{3,4}$/.test(e)){const t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}const t=(e||"").split(".").map((e=>parseInt(e,10)));return{major:t[0],minor:t[1],patch:t[2]}}function supportsHyperlink(e){const{env:t}=process;if("FORCE_HYPERLINK"in t){return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0)}if(s("no-hyperlink")||s("no-hyperlinks")||s("hyperlink=false")||s("hyperlink=never")){return false}if(s("hyperlink=true")||s("hyperlink=always")){return true}if(!r.supportsColor(e)){return false}if(e&&!e.isTTY){return false}if(process.platform==="win32"){return false}if("NETLIFY"in t){return true}if("CI"in t){return false}if("TEAMCITY_VERSION"in t){return false}if("TERM_PROGRAM"in t){const e=parseVersion(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":if(e.major===3){return e.minor>=1}return e.major>3}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0"){return false}const e=parseVersion(t.VTE_VERSION);return e.major>0||e.minor>=50}return false}e.exports={supportsHyperlink:supportsHyperlink,stdout:supportsHyperlink(process.stdout),stderr:supportsHyperlink(process.stderr)}},5743:(e,t,n)=>{"use strict";const r=n(3898);const s=n(5360);const terminalLink=(e,t,{target:n="stdout",...o}={})=>{if(!s[n]){if(o.fallback===false){return e}return typeof o.fallback==="function"?o.fallback(e,t):`${e} (${t})`}return r.link(e,t)};e.exports=(e,t,n={})=>terminalLink(e,t,n);e.exports.stderr=(e,t,n={})=>terminalLink(e,t,{target:"stderr",...n});e.exports.isSupported=s.stdout;e.exports.stderr.isSupported=s.stderr},5012:(e,t,n)=>{const{URL:r}=n(7016);const{join:s}=n(6928);const o=n(9896);const{promisify:i}=n(9023);const{tmpdir:a}=n(857);const c=n(2139);const l=i(o.writeFile);const u=i(o.mkdir);const f=i(o.readFile);const compareVersions=(e,t)=>e.localeCompare(t,"en-US",{numeric:true});const encode=e=>encodeURIComponent(e).replace(/^%40/,"@");const getFile=async(e,t)=>{const n=a();const r=s(n,"update-check");if(!o.existsSync(r)){await u(r)}let i=`${e.name}-${t}.json`;if(e.scope){i=`${e.scope}-${i}`}return s(r,i)};const evaluateCache=async(e,t,n)=>{if(o.existsSync(e)){const r=await f(e,"utf8");const{lastUpdate:s,latest:o}=JSON.parse(r);const i=s+n;if(i>t){return{shouldCheck:false,latest:o}}}return{shouldCheck:true,latest:null}};const updateCache=async(e,t,n)=>{const r=JSON.stringify({latest:t,lastUpdate:n});await l(e,r,"utf8")};const loadPackage=(e,t)=>new Promise(((r,s)=>{const o={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(t){o.headers.authorization=`${t.type} ${t.token}`}const{get:i}=n(e.protocol==="https:"?5692:8611);i(o,(e=>{const{statusCode:t}=e;if(t!==200){const n=new Error(`Request failed with code ${t}`);n.code=t;s(n);e.resume();return}let n="";e.setEncoding("utf8");e.on("data",(e=>{n+=e}));e.on("end",(()=>{try{const e=JSON.parse(n);r(e)}catch(e){s(e)}}))})).on("error",s).on("timeout",s)}));const getMostRecent=async({full:e,scope:t},s)=>{const o=c(t);const i=new r(e,o);let a=null;try{a=await loadPackage(i)}catch(e){if(e.code&&String(e.code).startsWith(4)){const e=n(6856);const t=e(o,{recursive:true});a=await loadPackage(i,t)}else{throw e}}const l=a["dist-tags"][s];if(!l){throw new Error(`Distribution tag ${s} is not available`)}return l};const d={interval:36e5,distTag:"latest"};const getDetails=e=>{const t={full:encode(e)};if(e.includes("/")){const n=e.split("/");t.scope=n[0];t.name=n[1]}else{t.scope=null;t.name=e}return t};e.exports=async(e,t)=>{if(typeof e!=="object"){throw new Error("The first parameter should be your package.json file content")}const n=getDetails(e.name);const r=Date.now();const{distTag:s,interval:o}=Object.assign({},d,t);const i=await getFile(n,s);let a=null;let c=true;({shouldCheck:c,latest:a}=await evaluateCache(i,r,o));if(c){a=await getMostRecent(n,s);await updateCache(i,a,r)}const l=compareVersions(e.version,a);if(l===-1){return{latest:a,fromCache:!c}}return null}},4808:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.CocoaPodsPackageManager=t.CocoaPodsError=void 0;t.extractMissingDependencyError=extractMissingDependencyError;t.getPodUpdateMessage=getPodUpdateMessage;t.getPodRepoUpdateMessage=getPodRepoUpdateMessage;t.getImprovedPodInstallError=getImprovedPodInstallError;const s=r(n(8841));const o=r(n(2325));const i=n(9896);const a=r(n(857));const c=r(n(6928));class CocoaPodsError extends Error{code;cause;name="CocoaPodsError";isPackageManagerError=true;constructor(e,t,n){super(n?`${e}\n└─ Cause: ${n.message}`:e);this.code=t;this.cause=n}}t.CocoaPodsError=CocoaPodsError;function extractMissingDependencyError(e){const t=e.match(/Unable to find a specification for ['"`]([\w-_\d\s]+)['"`] depended upon by ['"`]([\w-_\d\s]+)['"`]/);if(t){return[t[1],t[2]]}return null}class CocoaPodsPackageManager{options;silent;static getPodProjectRoot(e){if(CocoaPodsPackageManager.isUsingPods(e))return e;const t=c.default.join(e,"ios");if(CocoaPodsPackageManager.isUsingPods(t))return t;const n=c.default.join(e,"macos");if(CocoaPodsPackageManager.isUsingPods(n))return n;return null}static isUsingPods(e){return(0,i.existsSync)(c.default.join(e,"Podfile"))}static async gemInstallCLIAsync(e=false,t={stdio:"inherit"}){const n=["install","cocoapods","--no-document"];try{await(0,s.default)("gem",n,t)}catch(r){if(e){throw new CocoaPodsError("Failed to install CocoaPods CLI with gem (recommended)","COMMAND_FAILED",r)}console.log("Your password might be needed to install CocoaPods CLI: https://guides.cocoapods.org/using/getting-started.html#installation");await(0,s.default)("sudo",["gem",...n],t)}}static async brewLinkCLIAsync(e={stdio:"inherit"}){await(0,s.default)("brew",["link","cocoapods"],e)}static async brewInstallCLIAsync(e={stdio:"inherit"}){await(0,s.default)("brew",["install","cocoapods"],e)}static async installCLIAsync({nonInteractive:e=false,spawnOptions:t={stdio:"inherit"}}){if(!t){t={stdio:"inherit"}}const n=!!t.ignoreStdio;try{!n&&console.log(`› Attempting to install CocoaPods CLI with Gem`);await CocoaPodsPackageManager.gemInstallCLIAsync(e,t);!n&&console.log(`› Successfully installed CocoaPods CLI with Gem`);return true}catch(e){if(!n){console.log(o.default.yellow(`› Failed to install CocoaPods CLI with Gem`));console.log(o.default.red(e.stderr??e.message));console.log(`› Attempting to install CocoaPods CLI with Homebrew`)}try{await CocoaPodsPackageManager.brewInstallCLIAsync(t);if(!await CocoaPodsPackageManager.isCLIInstalledAsync(t)){try{await CocoaPodsPackageManager.brewLinkCLIAsync(t);if(!await CocoaPodsPackageManager.isCLIInstalledAsync(t)){throw new CocoaPodsError("CLI could not be installed automatically with gem or Homebrew, please install CocoaPods manually and try again","NO_CLI",e)}}catch(e){throw new CocoaPodsError("Homebrew installation appeared to succeed but CocoaPods CLI not found in PATH and unable to link.","NO_CLI",e)}}!n&&console.log(`› Successfully installed CocoaPods CLI with Homebrew`);return true}catch(e){!n&&console.warn(o.default.yellow(`› Failed to install CocoaPods with Homebrew. Install CocoaPods CLI and try again: https://cocoapods.org/`));throw new CocoaPodsError(`Failed to install CocoaPods with Homebrew. Install CocoaPods CLI and try again: https://cocoapods.org/`,"NO_CLI",e)}}}static isAvailable(e,t){if(process.platform!=="darwin"){!t&&console.log(o.default.red("CocoaPods is only supported on macOS machines"));return false}if(!CocoaPodsPackageManager.isUsingPods(e)){!t&&console.log(o.default.yellow("CocoaPods is not supported in this project"));return false}return true}static async isCLIInstalledAsync(e={stdio:"inherit"}){try{await(0,s.default)("pod",["--version"],e);return true}catch{return false}}constructor({cwd:e,silent:t}){this.silent=!!t;this.options={cwd:e,stdio:"pipe"}}get name(){return"CocoaPods"}async installAsync({spinner:e}={}){await this._installAsync({spinner:e})}isCLIInstalledAsync(){return CocoaPodsPackageManager.isCLIInstalledAsync(this.options)}installCLIAsync(){return CocoaPodsPackageManager.installCLIAsync({nonInteractive:true,spawnOptions:this.options})}async handleInstallErrorAsync({error:e,shouldUpdate:t=true,updatedPackages:n=[],spinner:r}){if(!e.output){throw e}if(!t){throw getImprovedPodInstallError(e,{cwd:this.options.cwd})}const s=e.output.join(a.default.EOL).trim();const{updatePackage:i,shouldUpdateRepo:c}=getPodUpdateMessage(s);if(!i||n.includes(i)){return await this._installAsync({spinner:r,shouldRepoUpdate:true,shouldUpdate:false,updatedPackages:n})}n.push(i);return await this.runInstallTypeCommandAsync(["update",i,c?"":"--no-repo-update"].filter(Boolean),{formatWarning(){const e=`Failed to update ${o.default.bold(i)}. Attempting to update the repo instead.`;return e},spinner:r,updatedPackages:n})}async _installAsync({shouldRepoUpdate:e,...t}={}){return await this.runInstallTypeCommandAsync(["install",e?"--repo-update":""].filter(Boolean),{formatWarning(e){return getPodRepoUpdateMessage(e.output.join(a.default.EOL).trim()).message},...t})}async runInstallTypeCommandAsync(e,{formatWarning:t,...n}={}){try{return await this._runAsync(e)}catch(e){if(t){const r=t(e);if(n.spinner){n.spinner.text=o.default.bold(r)}if(!this.silent){console.warn(o.default.yellow(r))}}return await this.handleInstallErrorAsync({error:e,...n})}}async addWithParametersAsync(e,t){throw new Error("Unimplemented")}addAsync(e=[]){throw new Error("Unimplemented")}addDevAsync(e=[]){throw new Error("Unimplemented")}addGlobalAsync(e=[]){throw new Error("Unimplemented")}removeAsync(e=[]){throw new Error("Unimplemented")}removeDevAsync(e=[]){throw new Error("Unimplemented")}removeGlobalAsync(e=[]){throw new Error("Unimplemented")}async versionAsync(){const{stdout:e}=await(0,s.default)("pod",["--version"],this.options);return e.trim()}async configAsync(e){throw new Error("Unimplemented")}async removeLockfileAsync(){throw new Error("Unimplemented")}async uninstallAsync(){throw new Error("Unimplemented")}async podRepoUpdateAsync(){try{await this._runAsync(["repo","update"])}catch(e){e.message=e.message||(e.stderr??e.stdout);throw new CocoaPodsError("The command `pod install --repo-update` failed","COMMAND_FAILED",e)}}async _runAsync(e){if(!this.silent){console.log(`> pod ${e.join(" ")}`)}const t=(0,s.default)("pod",[...e,"--ansi"],{...this.options,stdio:"pipe"});if(!this.silent){if(t.child.stdout){t.child.stdout.pipe(process.stdout)}}return await t}}t.CocoaPodsPackageManager=CocoaPodsPackageManager;function shouldPodRepoUpdate(e){const t=e;const n=t.includes("pod repo update")||t.includes("--no-repo-update");return n}function getPodUpdateMessage(e){const t=e.match(/run ['"`]pod update ([\w-_\d/]+)( --no-repo-update)?['"`] to apply changes/);return{updatePackage:t?.[1]??null,shouldUpdateRepo:!t?.[2]}}function getPodRepoUpdateMessage(e){const t=extractMissingDependencyError(e);const n=getPodUpdateMessage(e);let r;if(t){r=`Couldn't install: ${t[1]} » ${o.default.underline(t[0])}.`}else if(n?.updatePackage){r=`Couldn't install: ${n?.updatePackage}.`}else{r=`Couldn't install Pods.`}r+=` Updating the Pods project and trying again...`;return{message:r,...n}}function getImprovedPodInstallError(e,{cwd:t=process.cwd()}){const n=e.output.join(a.default.EOL).trim();if(e.stdout.match(/No [`'"]Podfile[`'"] found in the project directory/)){e.message=`No Podfile found in directory: ${t}. Ensure CocoaPods is setup any try again.`}else if(shouldPodRepoUpdate(n)){const t=extractMissingDependencyError(n);let r;if(t){r=`Couldn't install: ${t[1]} » ${o.default.underline(t[0])}`}else{r=`This is often due to native package versions mismatching`}let s;if(t?.[0]){if(t[0].match(/^(?:@?expo|@?react)(-|\/)/)){s=`Ensure the node module "${t[0]}" is installed in your project, then run 'npx pod-install' to try again.`}else{s=`Ensure the CocoaPod "${t[0]}" is installed in your project, then run 'npx pod-install' to try again.`}}else{s=`Try deleting the 'ios/Pods' folder or the 'ios/Podfile.lock' file and running 'npx pod-install' to resolve.`}e.message=`${r}. ${s}`;if(e.stdout){const t=e.stdout.split(a.default.EOL);const n=t.findIndex((e=>e.startsWith("[!]")));if(n!==-1){const r=t.slice(n).join(a.default.EOL);e.message+=`\n\n${o.default.gray(r)}`}}return new CocoaPodsError("Command `pod install --repo-update` failed.","COMMAND_FAILED",e)}else{let t=e.stderr.trim();const n=e.stdout.match(/\[!\]\s((?:.|\n)*)/)?.[1];if(n){if(e.message?.match(/pod exited with non-zero code: 1/)){e.message=""}t=null}e.message=[n,e.message,t].filter(Boolean).join("\n")}return new CocoaPodsError("Command `pod install` failed.","COMMAND_FAILED",e)}},3018:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=n(4808);const o=r(n(2325));const i=n(7313);const a=n(9896);const c=n(6928);const l=r(n(6909));const u=n(7583);const f=n(8330);function info(e){if(!d.opts().quiet){console.log(e)}}async function runAsync(e){if(process.platform!=="darwin"){info(o.default.yellow("⚠️ CocoaPods is only supported on darwin machines"));process.exit(0)}const t=e&&!e.startsWith("--");const n=(0,c.resolve)(t?e:process.cwd());if(!(0,a.existsSync)(n)){info(o.default.red(`\n💥 Target directory does not exist: ${n}\n`));process.exit(1)}const r=s.CocoaPodsPackageManager.getPodProjectRoot(n);if(!r){const e=(0,c.join)(n,"package.json");if(!(0,a.existsSync)(e)){info(o.default.red(`\n💥 'package.json' file does not exist: ${e}\n`));process.exit(1)}const r=JSON.parse((0,a.readFileSync)(e).toString());const s=r.dependencies?.hasOwnProperty("expo");if(s){info(o.default.yellow(`⚠️ No 'ios' directory found, skipping installing pods.`,`\nPods will be automatically installed when the 'ios' directory is generated with 'npx expo prebuild' or 'npx expo run:ios'.`,(0,u.learnMore)("https://docs.expo.dev/workflow/prebuild/")));process.exit(0)}if(t){info(o.default.yellow(`⚠️ CocoaPods is not supported in project at ${n}`))}else{info(o.default.yellow("⚠️ CocoaPods is not supported in this project"))}process.exit(0)}info("🔍️ Scanning for pods...");if(!await s.CocoaPodsPackageManager.isCLIInstalledAsync()){await s.CocoaPodsPackageManager.installCLIAsync({nonInteractive:d.opts().nonInteractive})}const i=new s.CocoaPodsPackageManager({cwd:r});try{await i.installAsync()}catch(e){if(e.isPackageManagerError){console.error(o.default.red(e.message));process.exit(1)}throw e}}const d=new i.Command(f.name).version(f.version).arguments("[project-directory]").usage(`${o.default.green("[project-directory]")} [options]`).description("A fast, zero-dependency package for cutting down on common issues developers have when running pod install.").option("--quiet","only print errors").option("--non-interactive","disable interactive prompts").allowUnknownOption().parse(process.argv).action((async e=>{try{await runAsync(e);if(!d.opts().quiet){await(0,l.default)()}}catch(e){console.log("\nAborting run");if(e.command){console.log(` ${o.default.magenta(e.command)} has failed.`)}else{console.log(o.default.red`💥 An unexpected error was encountered. Report it on GitHub: https://github.com/expo/expo/issues`);console.log(e)}console.log();if(!d.opts().quiet){await(0,l.default)()}process.exit(1)}}));(async()=>{await d.parseAsync(process.argv)})()},6909:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t["default"]=shouldUpdate;const s=r(n(2325));const o=r(n(5012));async function shouldUpdate(){const e=n(8330);const t=(0,o.default)(e).catch((()=>null));try{const n=await t;if(n&&n.latest){console.log();console.log(s.default.yellow.bold(`A new version of \`${e.name}\` is available`));console.log("You can update by running: "+s.default.cyan(`npm i -g ${e.name}`));console.log()}}catch{}}},7583:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.learnMore=learnMore;const s=r(n(2325));const o=r(n(5743));function learnMore(e){return(0,o.default)(s.default.underline("Learn more."),e,{fallback:(e,t)=>`Learn more: ${s.default.underline(t)}`})}},181:e=>{"use strict";e.exports=require("buffer")},5317:e=>{"use strict";e.exports=require("child_process")},9896:e=>{"use strict";e.exports=require("fs")},8611:e=>{"use strict";e.exports=require("http")},5692:e=>{"use strict";e.exports=require("https")},1421:e=>{"use strict";e.exports=require("node:child_process")},8474:e=>{"use strict";e.exports=require("node:events")},3024:e=>{"use strict";e.exports=require("node:fs")},6760:e=>{"use strict";e.exports=require("node:path")},1708:e=>{"use strict";e.exports=require("node:process")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},2018:e=>{"use strict";e.exports=require("tty")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},7313:(e,t,n)=>{const{Argument:r}=n(854);const{Command:s}=n(9600);const{CommanderError:o,InvalidArgumentError:i}=n(9851);const{Help:a}=n(1518);const{Option:c}=n(7596);t.program=new s;t.createCommand=e=>new s(e);t.createOption=(e,t)=>new c(e,t);t.createArgument=(e,t)=>new r(e,t);t.Command=s;t.Option=c;t.Argument=r;t.Help=a;t.CommanderError=o;t.InvalidArgumentError=i;t.InvalidOptionArgumentError=i},854:(e,t,n)=>{const{InvalidArgumentError:r}=n(9851);class Argument{constructor(e,t){this.description=t||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(e[0]){case"<":this.required=true;this._name=e.slice(1,-1);break;case"[":this.required=false;this._name=e.slice(1,-1);break;default:this.required=true;this._name=e;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t)){return[e]}return t.concat(e)}default(e,t){this.defaultValue=e;this.defaultValueDescription=t;return this}argParser(e){this.parseArg=e;return this}choices(e){this.argChoices=e.slice();this.parseArg=(e,t)=>{if(!this.argChoices.includes(e)){throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,t)}return e};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(e){const t=e.name()+(e.variadic===true?"...":"");return e.required?"<"+t+">":"["+t+"]"}t.Argument=Argument;t.humanReadableArgName=humanReadableArgName},9600:(e,t,n)=>{const r=n(8474).EventEmitter;const s=n(1421);const o=n(6760);const i=n(3024);const a=n(1708);const{Argument:c,humanReadableArgName:l}=n(854);const{CommanderError:u}=n(9851);const{Help:f}=n(1518);const{Option:d,DualOptions:h}=n(7596);const{suggestSimilar:p}=n(9266);class Command extends r{constructor(e){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=e||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:undefined,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:undefined,outputError:(e,t)=>t(e)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(e){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;return this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent){e.push(t)}return e}command(e,t,n){let r=t;let s=n;if(typeof r==="object"&&r!==null){s=r;r=null}s=s||{};const[,o,i]=e.match(/([^ ]+) *(.*)/);const a=this.createCommand(o);if(r){a.description(r);a._executableHandler=true}if(s.isDefault)this._defaultCommandName=a._name;a._hidden=!!(s.noHelp||s.hidden);a._executableFile=s.executableFile||null;if(i)a.arguments(i);this._registerCommand(a);a.parent=this;a.copyInheritedSettings(this);if(r)return this;return a}createCommand(e){return new Command(e)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(e){if(e===undefined)return this._helpConfiguration;this._helpConfiguration=e;return this}configureOutput(e){if(e===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,e);return this}showHelpAfterError(e=true){if(typeof e!=="string")e=!!e;this._showHelpAfterError=e;return this}showSuggestionAfterError(e=true){this._showSuggestionAfterError=!!e;return this}addCommand(e,t){if(!e._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}t=t||{};if(t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=true;this._registerCommand(e);e.parent=this;e._checkForBrokenPassThrough();return this}createArgument(e,t){return new c(e,t)}argument(e,t,n,r){const s=this.createArgument(e,t);if(typeof n==="function"){s.default(r).argParser(n)}else{s.default(n)}this.addArgument(s);return this}arguments(e){e.trim().split(/ +/).forEach((e=>{this.argument(e)}));return this}addArgument(e){const 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!==undefined&&e.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${e.name()}'`)}this.registeredArguments.push(e);return this}helpCommand(e,t){if(typeof e==="boolean"){this._addImplicitHelpCommand=e;return this}e=e??"help [command]";const[,n,r]=e.match(/([^ ]+) *(.*)/);const s=t??"display help for command";const o=this.createCommand(n);o.helpOption(false);if(r)o.arguments(r);if(s)o.description(s);this._addImplicitHelpCommand=true;this._helpCommand=o;return this}addHelpCommand(e,t){if(typeof e!=="object"){this.helpCommand(e,t);return this}this._addImplicitHelpCommand=true;this._helpCommand=e;return this}_getHelpCommand(){const e=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(e){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e)){throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`)}if(this._lifeCycleHooks[e]){this._lifeCycleHooks[e].push(t)}else{this._lifeCycleHooks[e]=[t]}return this}exitOverride(e){if(e){this._exitCallback=e}else{this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync"){throw e}else{}}}return this}_exit(e,t,n){if(this._exitCallback){this._exitCallback(new u(e,t,n))}a.exit(e)}action(e){const listener=t=>{const n=this.registeredArguments.length;const r=t.slice(0,n);if(this._storeOptionsAsProperties){r[n]=this}else{r[n]=this.opts()}r.push(this);return e.apply(this,r)};this._actionHandler=listener;return this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code==="commander.invalidArgument"){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const 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}'\n- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const knownBy=e=>[e.name()].concat(e.aliases());const t=knownBy(e).find((e=>this._findCommand(e)));if(t){const n=knownBy(this._findCommand(t)).join("|");const r=knownBy(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name();const n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");if(!this._findOption(t)){this.setOptionValueWithSource(n,e.defaultValue===undefined?true:e.defaultValue,"default")}}else if(e.defaultValue!==undefined){this.setOptionValueWithSource(n,e.defaultValue,"default")}const handleOptionValue=(t,r,s)=>{if(t==null&&e.presetArg!==undefined){t=e.presetArg}const o=this.getOptionValue(n);if(t!==null&&e.parseArg){t=this._callParseArg(e,t,o,r)}else if(t!==null&&e.variadic){t=e._concatValue(t,o)}if(t==null){if(e.negate){t=false}else if(e.isBoolean()||e.optional){t=true}else{t=""}}this.setOptionValueWithSource(n,t,s)};this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;handleOptionValue(t,n,"cli")}));if(e.envVar){this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;handleOptionValue(t,n,"env")}))}return this}_optionEx(e,t,n,r,s){if(typeof t==="object"&&t instanceof d){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const o=this.createOption(t,n);o.makeOptionMandatory(!!e.mandatory);if(typeof r==="function"){o.default(s).argParser(r)}else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n};o.default(s).argParser(r)}else{o.default(r)}return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:true},e,t,n,r)}combineFlagAndOptionalValue(e=true){this._combineFlagAndOptionalValue=!!e;return this}allowUnknownOption(e=true){this._allowUnknownOption=!!e;return this}allowExcessArguments(e=true){this._allowExcessArguments=!!e;return this}enablePositionalOptions(e=true){this._enablePositionalOptions=!!e;return this}passThroughOptions(e=true){this._passThroughOptions=!!e;this._checkForBrokenPassThrough();return 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=true){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")}this._storeOptionsAsProperties=!!e;return this}getOptionValue(e){if(this._storeOptionsAsProperties){return this[e]}return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,undefined)}setOptionValueWithSource(e,t,n){if(this._storeOptionsAsProperties){this[e]=t}else{this._optionValues[e]=t}this._optionValueSources[e]=n;return this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;this._getCommandAndAncestors().forEach((n=>{if(n.getOptionValueSource(e)!==undefined){t=n.getOptionValueSource(e)}}));return t}_prepareUserArgs(e,t){if(e!==undefined&&!Array.isArray(e)){throw new Error("first parameter to parse must be array or undefined")}t=t||{};if(e===undefined&&t.from===undefined){if(a.versions?.electron){t.from="electron"}const e=a.execArgv??[];if(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print")){t.from="eval"}}if(e===undefined){e=a.argv}this.rawArgs=e.slice();let n;switch(t.from){case undefined:case"node":this._scriptPath=e[1];n=e.slice(2);break;case"electron":if(a.defaultApp){this._scriptPath=e[1];n=e.slice(2)}else{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}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return n}parse(e,t){const n=this._prepareUserArgs(e,t);this._parseCommand([],n);return this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);await this._parseCommand([],n);return this}_executeSubCommand(e,t){t=t.slice();let n=false;const r=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(e,t){const n=o.resolve(e,t);if(i.existsSync(n))return n;if(r.includes(o.extname(t)))return undefined;const s=r.find((e=>i.existsSync(`${n}${e}`)));if(s)return`${n}${s}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let c=e._executableFile||`${this._name}-${e._name}`;let l=this._executableDir||"";if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}l=o.resolve(o.dirname(e),l)}if(l){let t=findFile(l,c);if(!t&&!e._executableFile&&this._scriptPath){const n=o.basename(this._scriptPath,o.extname(this._scriptPath));if(n!==this._name){t=findFile(l,`${n}-${e._name}`)}}c=t||c}n=r.includes(o.extname(c));let f;if(a.platform!=="win32"){if(n){t.unshift(c);t=incrementNodeInspectorPort(a.execArgv).concat(t);f=s.spawn(a.argv[0],t,{stdio:"inherit"})}else{f=s.spawn(c,t,{stdio:"inherit"})}}else{t.unshift(c);t=incrementNodeInspectorPort(a.execArgv).concat(t);f=s.spawn(a.execPath,t,{stdio:"inherit"})}if(!f.killed){const e=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];e.forEach((e=>{a.on(e,(()=>{if(f.killed===false&&f.exitCode===null){f.kill(e)}}))}))}const d=this._exitCallback;f.on("close",(e=>{e=e??1;if(!d){a.exit(e)}else{d(new u(e,"commander.executeSubCommandAsync","(close)"))}}));f.on("error",(t=>{if(t.code==="ENOENT"){const t=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const n=`'${c}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}else if(t.code==="EACCES"){throw new Error(`'${c}' not executable`)}if(!d){a.exit(1)}else{const e=new u(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t;d(e)}}));this.runningCommand=f}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);if(!r)this.help({error:true});let s;s=this._chainOrCallSubCommandHook(s,r,"preSubcommand");s=this._chainOrCall(s,(()=>{if(r._executableHandler){this._executeSubCommand(r,t.concat(n))}else{return r._parseCommand(t,n)}}));return s}_dispatchHelpCommand(e){if(!e){this.help()}const t=this._findCommand(e);if(t&&!t._executableHandler){t.help()}return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((e,t)=>{if(e.required&&this.args[t]==null){this.missingArgument(e.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,s)}return r};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach(((t,n)=>{let r=t.defaultValue;if(t.variadic){if(n<this.args.length){r=this.args.slice(n);if(t.parseArg){r=r.reduce(((e,n)=>myParseArg(t,n,e)),t.defaultValue)}}else if(r===undefined){r=[]}}else if(n<this.args.length){r=this.args[n];if(t.parseArg){r=myParseArg(t,r,t.defaultValue)}}e[n]=r}));this.processedArgs=e}_chainOrCall(e,t){if(e&&e.then&&typeof e.then==="function"){return e.then((()=>t()))}return t()}_chainOrCallHooks(e,t){let n=e;const r=[];this._getCommandAndAncestors().reverse().filter((e=>e._lifeCycleHooks[t]!==undefined)).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))}));if(t==="postAction"){r.reverse()}r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))}));return n}_chainOrCallSubCommandHook(e,t,n){let r=e;if(this._lifeCycleHooks[n]!==undefined){this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))}))}return r}_parseCommand(e,t){const n=this.parseOptions(t);this._parseOptionsEnv();this._parseOptionsImplied();e=e.concat(n.operands);t=n.unknown;this.args=e.concat(t);if(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){this._outputHelpIfRequested(t);return this._dispatchSubcommand(this._defaultCommandName,e,t)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(n.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(n.unknown.length>0){this.unknownOption(n.unknown[0])}};const r=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let n;n=this._chainOrCallHooks(n,"preAction");n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs)));if(this.parent){n=this._chainOrCall(n,(()=>{this.parent.emit(r,e,t)}))}n=this._chainOrCallHooks(n,"postAction");return n}if(this.parent&&this.parent.listenerCount(r)){checkForUnknownOptions();this._processArguments();this.parent.emit(r,e,t)}else if(e.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",e,t)}if(this.listenerCount("command:*")){this.emit("command:*",e,t)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(e){if(!e)return undefined;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=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===undefined){e.missingMandatoryOptionValue(t)}}))}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();if(this.getOptionValue(t)===undefined){return false}return this.getOptionValueSource(t)!=="default"}));const t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));if(n){this._conflictingOption(t,n)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e=>{e._checkForConflictingLocalOptions()}))}parseOptions(e){const t=[];const n=[];let r=t;const s=e.slice();function maybeOption(e){return e.length>1&&e[0]==="-"}let o=null;while(s.length){const e=s.shift();if(e==="--"){if(r===n)r.push(e);r.push(...s);break}if(o&&!maybeOption(e)){this.emit(`option:${o.name()}`,e);continue}o=null;if(maybeOption(e)){const t=this._findOption(e);if(t){if(t.required){const e=s.shift();if(e===undefined)this.optionMissingArgument(t);this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;if(s.length>0&&!maybeOption(s[0])){e=s.shift()}this.emit(`option:${t.name()}`,e)}else{this.emit(`option:${t.name()}`)}o=t.variadic?t:null;continue}}if(e.length>2&&e[0]==="-"&&e[1]!=="-"){const t=this._findOption(`-${e[1]}`);if(t){if(t.required||t.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${t.name()}`,e.slice(2))}else{this.emit(`option:${t.name()}`);s.unshift(`-${e.slice(2)}`)}continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("=");const n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(maybeOption(e)){r=n}if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(e)){t.push(e);if(s.length>0)n.push(...s);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e);if(s.length>0)t.push(...s);break}else if(this._defaultCommandName){n.push(e);if(s.length>0)n.push(...s);break}}if(this._passThroughOptions){r.push(e);if(s.length>0)r.push(...s);break}r.push(e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={};const t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const n=t||{};const r=n.exitCode||1;const s=n.code||"commander.error";this._exit(r,s,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in a.env){const t=e.attributeName();if(this.getOptionValue(t)===undefined||["default","config","env"].includes(this.getOptionValueSource(t))){if(e.required||e.optional){this.emit(`optionEnv:${e.name()}`,a.env[e.envVar])}else{this.emit(`optionEnv:${e.name()}`)}}}}))}_parseOptionsImplied(){const e=new h(this.options);const hasCustomOptionValue=e=>this.getOptionValue(e)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((t=>t.implied!==undefined&&hasCustomOptionValue(t.attributeName())&&e.valueFromOption(this.getOptionValue(t.attributeName()),t))).forEach((e=>{Object.keys(e.implied).filter((e=>!hasCustomOptionValue(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const findBestOptionFromValue=e=>{const t=e.attributeName();const n=this.getOptionValue(t);const r=this.options.find((e=>e.negate&&t===e.attributeName()));const s=this.options.find((e=>!e.negate&&t===e.attributeName()));if(r&&(r.presetArg===undefined&&n===false||r.presetArg!==undefined&&n===r.presetArg)){return r}return s||e};const getErrorMessage=e=>{const t=findBestOptionFromValue(e);const n=t.attributeName();const r=this.getOptionValueSource(n);if(r==="env"){return`environment variable '${t.envVar}'`}return`option '${t.flags}'`};const n=`error: ${getErrorMessage(e)} cannot be used with ${getErrorMessage(t)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[];let r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e);r=r.parent}while(r&&!r._enablePositionalOptions);t=p(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length;const n=t===1?"":"s";const r=this.parent?` for '${this.name()}'`:"";const s=`error: too many arguments${r}. Expected ${t} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name());if(e.alias())n.push(e.alias())}));t=p(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===undefined)return this._version;this._version=e;t=t||"-V, --version";n=n||"output the version number";const r=this.createOption(t,n);this._versionOptionName=r.attributeName();this._registerOption(r);this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`);this._exit(0,"commander.version",e)}));return this}description(e,t){if(e===undefined&&t===undefined)return this._description;this._description=e;if(t){this._argsDescription=t}return this}summary(e){if(e===undefined)return this._summary;this._summary=e;return this}alias(e){if(e===undefined)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]}if(e===t._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(e);if(n){const t=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}t._aliases.push(e);return this}aliases(e){if(e===undefined)return this._aliases;e.forEach((e=>this.alias(e)));return this}usage(e){if(e===undefined){if(this._usage)return this._usage;const e=this.registeredArguments.map((e=>l(e)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}this._usage=e;return this}name(e){if(e===undefined)return this._name;this._name=e;return this}nameFromFilename(e){this._name=o.basename(e,o.extname(e));return this}executableDir(e){if(e===undefined)return this._executableDir;this._executableDir=e;return this}helpInformation(e){const t=this.createHelp();if(t.helpWidth===undefined){t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return t.formatHelp(this,t)}_getHelpContext(e){e=e||{};const t={error:!!e.error};let n;if(t.error){n=e=>this._outputConfiguration.writeErr(e)}else{n=e=>this._outputConfiguration.writeOut(e)}t.write=e.write||n;t.command=this;return t}outputHelp(e){let t;if(typeof e==="function"){t=e;e=undefined}const n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach((e=>e.emit("beforeAllHelp",n)));this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t){r=t(r);if(typeof r!=="string"&&!Buffer.isBuffer(r)){throw new Error("outputHelp callback must return a string or a Buffer")}}n.write(r);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",n);this._getCommandAndAncestors().forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if(typeof e==="boolean"){if(e){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}e=e??"-h, --help";t=t??"display help for command";this._helpOption=this.createOption(e,t);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(e){this._helpOption=e;return this}help(e){this.outputHelp(e);let t=a.exitCode||0;if(t===0&&e&&typeof e!=="function"&&e.error){t=1}this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`)}const r=`${e}Help`;this.on(r,(e=>{let n;if(typeof t==="function"){n=t({error:e.error,command:e.command})}else{n=t}if(n){e.write(`${n}\n`)}}));return this}_outputHelpIfRequested(e){const t=this._getHelpOption();const n=t&&e.find((e=>t.is(e)));if(n){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(e){return e.map((e=>{if(!e.startsWith("--inspect")){return e}let t;let n="127.0.0.1";let r="9229";let s;if((s=e.match(/^(--inspect(-brk)?)$/))!==null){t=s[1]}else if((s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){t=s[1];if(/^\d+$/.test(s[3])){r=s[3]}else{n=s[3]}}else if((s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){t=s[1];n=s[3];r=s[4]}if(t&&r!=="0"){return`${t}=${n}:${parseInt(r)+1}`}return e}))}t.Command=Command},9851:(e,t)=>{class CommanderError 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=undefined}}class InvalidArgumentError extends CommanderError{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}t.CommanderError=CommanderError;t.InvalidArgumentError=InvalidArgumentError},1518:(e,t,n)=>{const{humanReadableArgName:r}=n(854);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));const n=e._getHelpCommand();if(n&&!n._hidden){t.push(n)}if(this.sortSubcommands){t.sort(((e,t)=>e.name().localeCompare(t.name())))}return t}compareOptions(e,t){const getSortKey=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return getSortKey(e).localeCompare(getSortKey(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden));const n=e._getHelpOption();if(n&&!n.hidden){const r=n.short&&e._findOption(n.short);const s=n.long&&e._findOption(n.long);if(!r&&!s){t.push(n)}else if(n.long&&!s){t.push(e.createOption(n.long,n.description))}else if(n.short&&!r){t.push(e.createOption(n.short,n.description))}}if(this.sortOptions){t.sort(this.compareOptions)}return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}if(this.sortOptions){t.sort(this.compareOptions)}return t}visibleArguments(e){if(e._argsDescription){e.registeredArguments.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""}))}if(e.registeredArguments.find((e=>e.description))){return e.registeredArguments}return[]}subcommandTerm(e){const t=e.registeredArguments.map((e=>r(e))).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(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;if(e._aliases[0]){t=t+"|"+e._aliases[0]}let n="";for(let t=e.parent;t;t=t.parent){n=t.name()+" "+n}return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices){t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){const n=e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean";if(n){t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}}if(e.presetArg!==undefined&&e.optional){t.push(`preset: ${JSON.stringify(e.presetArg)}`)}if(e.envVar!==undefined){t.push(`env: ${e.envVar}`)}if(t.length>0){return`${e.description} (${t.join(", ")})`}return e.description}argumentDescription(e){const t=[];if(e.argChoices){t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`)}if(e.defaultValue!==undefined){t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(t.length>0){const n=`(${t.join(", ")})`;if(e.description){return`${e.description} ${n}`}return n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t);const r=t.helpWidth||80;const s=2;const o=2;function formatItem(e,i){if(i){const a=`${e.padEnd(n+o)}${i}`;return t.wrap(a,r-s,n+o)}return e}function formatList(e){return e.join("\n").replace(/^/gm," ".repeat(s))}let i=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);if(a.length>0){i=i.concat([t.wrap(a,r,0),""])}const c=t.visibleArguments(e).map((e=>formatItem(t.argumentTerm(e),t.argumentDescription(e))));if(c.length>0){i=i.concat(["Arguments:",formatList(c),""])}const l=t.visibleOptions(e).map((e=>formatItem(t.optionTerm(e),t.optionDescription(e))));if(l.length>0){i=i.concat(["Options:",formatList(l),""])}if(this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>formatItem(t.optionTerm(e),t.optionDescription(e))));if(n.length>0){i=i.concat(["Global Options:",formatList(n),""])}}const u=t.visibleCommands(e).map((e=>formatItem(t.subcommandTerm(e),t.subcommandDescription(e))));if(u.length>0){i=i.concat(["Commands:",formatList(u),""])}return i.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const s=" \\f\\t\\v - \ufeff";const o=new RegExp(`[\\n][${s}]+`);if(e.match(o))return e;const i=t-n;if(i<r)return e;const a=e.slice(0,n);const c=e.slice(n).replace("\r\n","\n");const l=" ".repeat(n);const u="";const f=`\\s${u}`;const d=new RegExp(`\n|.{1,${i-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g");const h=c.match(d)||[];return a+h.map(((e,t)=>{if(e==="\n")return"";return(t>0?l:"")+e.trimEnd()})).join("\n")}}t.Help=Help},7596:(e,t,n)=>{const{InvalidArgumentError:r}=n(9851);class Option{constructor(e,t){this.flags=e;this.description=t||"";this.required=e.includes("<");this.optional=e.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(e);this.mandatory=false;const n=splitOptionFlags(e);this.short=n.shortFlag;this.long=n.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(e,t){this.defaultValue=e;this.defaultValueDescription=t;return this}preset(e){this.presetArg=e;return this}conflicts(e){this.conflictsWith=this.conflictsWith.concat(e);return this}implies(e){let t=e;if(typeof e==="string"){t={[e]:true}}this.implied=Object.assign(this.implied||{},t);return this}env(e){this.envVar=e;return this}argParser(e){this.parseArg=e;return this}makeOptionMandatory(e=true){this.mandatory=!!e;return this}hideHelp(e=true){this.hidden=!!e;return this}_concatValue(e,t){if(t===this.defaultValue||!Array.isArray(t)){return[e]}return t.concat(e)}choices(e){this.argChoices=e.slice();this.parseArg=(e,t)=>{if(!this.argChoices.includes(e)){throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(e,t)}return e};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(e){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;e.forEach((e=>{if(e.negate){this.negativeOptions.set(e.attributeName(),e)}else{this.positiveOptions.set(e.attributeName(),e)}}));this.negativeOptions.forEach(((e,t)=>{if(this.positiveOptions.has(t)){this.dualOptions.add(t)}}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return true;const r=this.negativeOptions.get(n).presetArg;const s=r!==undefined?r:false;return t.negate===(s===e)}}function camelcase(e){return e.split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}function splitOptionFlags(e){let t;let n;const r=e.split(/[ |,]+/);if(r.length>1&&!/^[[<]/.test(r[1]))t=r.shift();n=r.shift();if(!t&&/^-[^-]$/.test(n)){t=n;n=undefined}return{shortFlag:t,longFlag:n}}t.Option=Option;t.DualOptions=DualOptions},9266:(e,t)=>{const n=3;function editDistance(e,t){if(Math.abs(e.length-t.length)>n)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++){r[t]=[t]}for(let e=0;e<=t.length;e++){r[0][e]=e}for(let n=1;n<=t.length;n++){for(let s=1;s<=e.length;s++){let o=1;if(e[s-1]===t[n-1]){o=0}else{o=1}r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+o);if(s>1&&n>1&&e[s-1]===t[n-2]&&e[s-2]===t[n-1]){r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1)}}}return r[e.length][t.length]}function suggestSimilar(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));const r=e.startsWith("--");if(r){e=e.slice(2);t=t.map((e=>e.slice(2)))}let s=[];let o=n;const i=.4;t.forEach((t=>{if(t.length<=1)return;const n=editDistance(e,t);const r=Math.max(e.length,t.length);const a=(r-n)/r;if(a>i){if(n<o){o=n;s=[t]}else if(n===o){s.push(t)}}}));s.sort(((e,t)=>e.localeCompare(t)));if(r){s=s.map((e=>`--${e}`))}if(s.length>1){return`\n(Did you mean one of ${s.join(", ")}?)`}if(s.length===1){return`\n(Did you mean ${s[0]}?)`}return""}t.suggestSimilar=suggestSimilar},8330:e=>{"use strict";e.exports=JSON.parse('{"name":"pod-install","version":"1.0.7","description":"A fast, zero-dependency package for cutting down on common issues developers have when running pod install.","main":"./build/index.js","scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"expo-module clean && yarn run build:prod","prepublishOnly":"expo-module prepublishOnly","typecheck":"expo-module typecheck","watch":"yarn run build --watch"},"bin":"./build/index.js","files":["build"],"repository":{"type":"git","url":"https://github.com/expo/expo.git"},"keywords":["cocoapods","pod-install","npx","ios"],"author":"Expo <support@expo.dev>","license":"MIT","homepage":"https://github.com/expo/expo/tree/main/packages/pod-install","bugs":{"url":"https://github.com/expo/expo/issues"},"devDependencies":{"@expo/package-manager":"^1.9.7","chalk":"^4.0.0","commander":"^12.1.0","expo-module-scripts":"^5.0.7","terminal-link":"^2.1.1","update-check":"^1.5.4"},"gitHead":"088e79428be97cf3ee11fc93e0e5a1fc1c8bea1e"}')}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var s=t[n]={id:n,loaded:false,exports:{}};var o=true;try{e[n].call(s.exports,s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[n]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(3018);module.exports=n})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pod-install",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A fast, zero-dependency package for cutting down on common issues developers have when running pod install.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"url": "https://github.com/expo/expo/issues"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@expo/package-manager": "^1.9.
|
|
37
|
+
"@expo/package-manager": "^1.9.7",
|
|
38
38
|
"chalk": "^4.0.0",
|
|
39
39
|
"commander": "^12.1.0",
|
|
40
|
-
"expo-module-scripts": "^5.0.
|
|
40
|
+
"expo-module-scripts": "^5.0.7",
|
|
41
41
|
"terminal-link": "^2.1.1",
|
|
42
42
|
"update-check": "^1.5.4"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "088e79428be97cf3ee11fc93e0e5a1fc1c8bea1e"
|
|
45
45
|
}
|