@shopify/create-hydrogen 5.0.9 → 5.0.10

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
3
- import{a as J_}from"./chunk-PMDMUCNY.js";import{$ as P1e,A as D1e,B as $x,C as Ux,D as M4,E as Fv,F as HX,G as Pv,H as Kx,I as TB,J as kB,K as b1e,L as JX,M as fp,N as FB,O as E1e,P as C1e,Q as S1e,R as A1e,S as w1e,T as T1e,U as Nv,V as k1e,W as Ov,X as S5,Y as z_,Z as F1e,_ as PB,a as p1e,aa as A5,b as Nl,ba as N1e,c as D_,ca as O1e,d as kv,da as NB,e as gm,ea as I1e,f as B4,fa as zX,g as CB,ga as OB,h as f1e,ha as B1e,i as VX,ia as L1e,j as d1e,ja as M1e,k as h1e,ka as RA,l as SB,la as IB,m as _1e,ma as R1e,n as ih,na as BB,o as KC,oa as j1e,p as Ph,q as MA,r as C5,ra as q1e,s as L4,t as AB,u as cd,v as g1e,w as wB,x as y1e,y as v1e,z as x1e}from"./chunk-62RC26N6.js";import{a as fEr}from"./chunk-FB327AH7.js";import{e as m1e}from"./chunk-H55SNOVV.js";import"./chunk-EO6F7WJJ.js";import"./chunk-7NPI5OH3.js";import"./chunk-RH6HNOXT.js";import"./chunk-VMIOG46Y.js";import"./chunk-M6JXYI3V.js";import"./chunk-FJPX4XUR.js";import{a as I0,c as vc,e as qx,g as __dirname,h as __filename,i as qa}from"./chunk-MNT4XW23.js";var U1e=vc((ZIr,$1e)=>{"use strict";qa();var jA=class a extends Error{constructor(s,c,f){super("[ParserError] "+s,c,f),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,a)}},LB=class{constructor(s){this.parser=s,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},w5=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new LB(this.parseStart)}parse(s){if(s.length===0||s.length==null)return;this._buf=String(s),this.ii=-1,this.char=-1;let c;for(;c===!1||this.nextChar();)c=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let s;do s=this.state.parser,this.runOne();while(this.state.parser!==s);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(s){if(typeof s!="function")throw new jA("Tried to set state to non-existent state: "+JSON.stringify(s));this.state.parser=s}goto(s){return this.next(s),this.runOne()}call(s,c){c&&this.next(c),this.stack.push(this.state),this.state=new LB(s)}callNow(s,c){return this.call(s,c),this.runOne()}return(s){if(this.stack.length===0)throw this.error(new jA("Stack underflow"));s===void 0&&(s=this.state.buf),this.state=this.stack.pop(),this.state.returned=s}returnNow(s){return this.return(s),this.runOne()}consume(){if(this.char===1114112)throw this.error(new jA("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(s){return s.line=this.line,s.col=this.col,s.pos=this.pos,s}parseStart(){throw new jA("Must declare a parseStart method")}};w5.END=1114112;w5.Error=jA;$1e.exports=w5});var V1e=vc((tBr,K1e)=>{"use strict";qa();K1e.exports=a=>{let s=new Date(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var MB=vc((nBr,H1e)=>{"use strict";qa();H1e.exports=(a,s)=>{for(s=String(s);s.length<a;)s="0"+s;return s}});var z1e=vc((aBr,J1e)=>{"use strict";qa();var R4=MB(),GX=class extends Date{constructor(s){super(s+"Z"),this.isFloating=!0}toISOString(){let s=`${this.getUTCFullYear()}-${R4(2,this.getUTCMonth()+1)}-${R4(2,this.getUTCDate())}`,c=`${R4(2,this.getUTCHours())}:${R4(2,this.getUTCMinutes())}:${R4(2,this.getUTCSeconds())}.${R4(3,this.getUTCMilliseconds())}`;return`${s}T${c}`}};J1e.exports=a=>{let s=new GX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var Y1e=vc((oBr,W1e)=>{"use strict";qa();var G1e=MB(),dEr=global.Date,WX=class extends dEr{constructor(s){super(s),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${G1e(2,this.getUTCMonth()+1)}-${G1e(2,this.getUTCDate())}`}};W1e.exports=a=>{let s=new WX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var Q1e=vc((cBr,X1e)=>{"use strict";qa();var RB=MB(),YX=class extends Date{constructor(s){super(`0000-01-01T${s}Z`),this.isTime=!0}toISOString(){return`${RB(2,this.getUTCHours())}:${RB(2,this.getUTCMinutes())}:${RB(2,this.getUTCSeconds())}.${RB(3,this.getUTCMilliseconds())}`}};X1e.exports=a=>{let s=new YX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var jB=vc((exports,module)=>{"use strict";qa();module.exports=makeParserClass(U1e());module.exports.makeParserClass=makeParserClass;var TomlError=class a extends Error{constructor(s){super(s),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,a),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=a=>{let s=new TomlError(a.message);return s.code=a.code,s.wrapped=a,s};module.exports.TomlError=TomlError;var createDateTime=V1e(),createDateTimeFloat=z1e(),createDate=Y1e(),createTime=Q1e(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
3
+ import{a as J_}from"./chunk-PMDMUCNY.js";import{$ as P1e,A as D1e,B as $x,C as Ux,D as M4,E as Fv,F as HX,G as Pv,H as Kx,I as TB,J as kB,K as b1e,L as JX,M as fp,N as FB,O as E1e,P as C1e,Q as S1e,R as A1e,S as w1e,T as T1e,U as Nv,V as k1e,W as Ov,X as S5,Y as z_,Z as F1e,_ as PB,a as p1e,aa as A5,b as Nl,ba as N1e,c as D_,ca as O1e,d as kv,da as NB,e as gm,ea as I1e,f as B4,fa as zX,g as CB,ga as OB,h as f1e,ha as B1e,i as VX,ia as L1e,j as d1e,ja as M1e,k as h1e,ka as RA,l as SB,la as IB,m as _1e,ma as R1e,n as ih,na as BB,o as KC,oa as j1e,p as Ph,q as MA,r as C5,ra as q1e,s as L4,t as AB,u as cd,v as g1e,w as wB,x as y1e,y as v1e,z as x1e}from"./chunk-5NDCRVGJ.js";import{e as m1e}from"./chunk-H55SNOVV.js";import"./chunk-VMIOG46Y.js";import"./chunk-M6JXYI3V.js";import{a as fEr}from"./chunk-FB327AH7.js";import"./chunk-EO6F7WJJ.js";import"./chunk-7NPI5OH3.js";import"./chunk-RH6HNOXT.js";import{a as I0,c as vc,e as qx,g as __dirname,h as __filename,i as qa}from"./chunk-MNT4XW23.js";var U1e=vc((ZIr,$1e)=>{"use strict";qa();var jA=class a extends Error{constructor(s,c,f){super("[ParserError] "+s,c,f),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,a)}},LB=class{constructor(s){this.parser=s,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},w5=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new LB(this.parseStart)}parse(s){if(s.length===0||s.length==null)return;this._buf=String(s),this.ii=-1,this.char=-1;let c;for(;c===!1||this.nextChar();)c=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let s;do s=this.state.parser,this.runOne();while(this.state.parser!==s);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(s){if(typeof s!="function")throw new jA("Tried to set state to non-existent state: "+JSON.stringify(s));this.state.parser=s}goto(s){return this.next(s),this.runOne()}call(s,c){c&&this.next(c),this.stack.push(this.state),this.state=new LB(s)}callNow(s,c){return this.call(s,c),this.runOne()}return(s){if(this.stack.length===0)throw this.error(new jA("Stack underflow"));s===void 0&&(s=this.state.buf),this.state=this.stack.pop(),this.state.returned=s}returnNow(s){return this.return(s),this.runOne()}consume(){if(this.char===1114112)throw this.error(new jA("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(s){return s.line=this.line,s.col=this.col,s.pos=this.pos,s}parseStart(){throw new jA("Must declare a parseStart method")}};w5.END=1114112;w5.Error=jA;$1e.exports=w5});var V1e=vc((tBr,K1e)=>{"use strict";qa();K1e.exports=a=>{let s=new Date(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var MB=vc((nBr,H1e)=>{"use strict";qa();H1e.exports=(a,s)=>{for(s=String(s);s.length<a;)s="0"+s;return s}});var z1e=vc((aBr,J1e)=>{"use strict";qa();var R4=MB(),GX=class extends Date{constructor(s){super(s+"Z"),this.isFloating=!0}toISOString(){let s=`${this.getUTCFullYear()}-${R4(2,this.getUTCMonth()+1)}-${R4(2,this.getUTCDate())}`,c=`${R4(2,this.getUTCHours())}:${R4(2,this.getUTCMinutes())}:${R4(2,this.getUTCSeconds())}.${R4(3,this.getUTCMilliseconds())}`;return`${s}T${c}`}};J1e.exports=a=>{let s=new GX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var Y1e=vc((oBr,W1e)=>{"use strict";qa();var G1e=MB(),dEr=global.Date,WX=class extends dEr{constructor(s){super(s),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${G1e(2,this.getUTCMonth()+1)}-${G1e(2,this.getUTCDate())}`}};W1e.exports=a=>{let s=new WX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var Q1e=vc((cBr,X1e)=>{"use strict";qa();var RB=MB(),YX=class extends Date{constructor(s){super(`0000-01-01T${s}Z`),this.isTime=!0}toISOString(){return`${RB(2,this.getUTCHours())}:${RB(2,this.getUTCMinutes())}:${RB(2,this.getUTCSeconds())}.${RB(3,this.getUTCMilliseconds())}`}};X1e.exports=a=>{let s=new YX(a);if(isNaN(s))throw new TypeError("Invalid Datetime");return s}});var jB=vc((exports,module)=>{"use strict";qa();module.exports=makeParserClass(U1e());module.exports.makeParserClass=makeParserClass;var TomlError=class a extends Error{constructor(s){super(s),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,a),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=a=>{let s=new TomlError(a.message);return s.code=a.code,s.wrapped=a,s};module.exports.TomlError=TomlError;var createDateTime=V1e(),createDateTimeFloat=z1e(),createDate=Y1e(),createTime=Q1e(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
4
4
  `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(a){return a>=CHAR_0&&a<=CHAR_9}function isHexit(a){return a>=CHAR_A&&a<=CHAR_F||a>=CHAR_a&&a<=CHAR_f||a>=CHAR_0&&a<=CHAR_9}function isBit(a){return a===CHAR_1||a===CHAR_0}function isOctit(a){return a>=CHAR_0&&a<=CHAR_7}function isAlphaNumQuoteHyphen(a){return a>=CHAR_A&&a<=CHAR_Z||a>=CHAR_a&&a<=CHAR_z||a>=CHAR_0&&a<=CHAR_9||a===CHAR_APOS||a===CHAR_QUOT||a===CHAR_LOWBAR||a===CHAR_HYPHEN}function isAlphaNumHyphen(a){return a>=CHAR_A&&a<=CHAR_Z||a>=CHAR_a&&a<=CHAR_z||a>=CHAR_0&&a<=CHAR_9||a===CHAR_LOWBAR||a===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(a,s){return hasOwnProperty.call(a,s)?!0:(s==="__proto__"&&defineProperty(a,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(a){return a===null||typeof a!="object"?!1:a[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(a){return a===null||typeof a!="object"?!1:a[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(a){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:a}})}function isInlineList(a){return a===null||typeof a!="object"?!1:a[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(a){return a===null||typeof a!="object"?!1:a[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(a){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(s){try{this.value=global.BigInt.asIntN(64,s)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(a){let s=Number(a);return Object.is(s,-0)&&(s=0),global.BigInt&&!Number.isSafeInteger(s)?new BoxedBigInt(a):Object.defineProperties(new Number(s),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${a}]`}})}function isInteger(a){return a===null||typeof a!="object"?!1:a[_type]===INTEGER}var FLOAT=Symbol("float");function Float(a){return Object.defineProperties(new Number(a),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${a}]`}})}function isFloat(a){return a===null||typeof a!="object"?!1:a[_type]===FLOAT}function tomlType(a){let s=typeof a;if(s==="object"){if(a===null)return"null";if(a instanceof Date)return"datetime";if(_type in a)switch(a[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return s}function makeParserClass(a){class s extends a{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===a.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===a.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===a.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(f){let h=this.ctx,y=f.key.pop();for(let v of f.key){if(hasKey(h,v)&&(!isTable(h[v])||h[v][_declared]))throw this.error(new TomlError("Can't redefine existing key"));h=h[v]=h[v]||Table()}if(hasKey(h,y))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(f.value)||isFloat(f.value)?h[y]=f.value.valueOf():h[y]=f.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(f){return this.state.resultTable?this.state.resultTable.push(f):this.state.resultTable=[f],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(f){return this.returnNow({key:this.state.resultTable,value:f})}parseComment(){do if(this.char===a.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(f){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,f)&&(!isTable(this.ctx[f])||this.ctx[f][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[f]=this.ctx[f]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,f))this.ctx=this.ctx[f]=Table();else if(isTable(this.ctx[f]))this.ctx=this.ctx[f];else if(isList(this.ctx[f]))this.ctx=this.ctx[f][this.ctx[f].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(f){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,f)||(this.ctx[f]=List()),isInlineList(this.ctx[f]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[f])){let h=Table();this.ctx[f].push(h),this.ctx=h}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,f))this.ctx=this.ctx[f]=Table();else{if(isInlineList(this.ctx[f]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[f]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[f]))this.ctx=this.ctx[f][this.ctx[f].length-1];else if(isTable(this.ctx[f]))this.ctx=this.ctx[f];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(f){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===a.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(f){return this.returnNow(f)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===a.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===a.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(f){return this.state.buf+=f,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===a.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let f="\\u00";return this.char<16&&(f+="0"),f+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${f} instead`))}recordMultiEscapeReplacement(f){return this.state.buf+=f,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(f){try{let h=parseInt(f,16);if(h>=SURROGATE_FIRST&&h<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(h))}catch(h){throw this.error(TomlError.wrap(h))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let f=Integer(this.state.buf);if(f.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(f)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let f=Integer(this.state.buf);if(f.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(f)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let f=Integer(this.state.buf);if(f.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(f)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let f=Integer(this.state.buf);if(f.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(f)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===a.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(f){if(this.state.resultArr){let h=this.state.resultArr[_contentType],y=tomlType(f);if(h!==y)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${h} and ${y}`))}else this.state.resultArr=InlineList(tomlType(f));return isFloat(f)||isInteger(f)?this.state.resultArr.push(f.valueOf()):this.state.resultArr.push(f),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===a.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(f){let h=this.state.resultTable,y=f.key.pop();for(let v of f.key){if(hasKey(h,v)&&(!isTable(h[v])||h[v][_declared]))throw this.error(new TomlError("Can't redefine existing key"));h=h[v]=h[v]||Table()}if(hasKey(h,y))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(f.value)||isFloat(f.value)?h[y]=f.value.valueOf():h[y]=f.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===a.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return s}});var qB=vc((fBr,Z1e)=>{"use strict";qa();Z1e.exports=hEr;function hEr(a,s){if(a.pos==null||a.line==null)return a;let c=a.message;if(c+=` at row ${a.line+1}, col ${a.col+1}, pos ${a.pos}:
5
5
  `,s&&s.split){let f=s.split(/\n/),h=String(Math.min(f.length,a.line+3)).length,y=" ";for(;y.length<h;)y+=" ";for(let v=Math.max(0,a.line-1);v<Math.min(f.length,a.line+2);++v){let D=String(v+1);if(D.length<h&&(D=" "+D),a.line===v){c+=D+"> "+f[v]+`
6
6
  `,c+=y+" ";for(let b=0;b<a.col;++b)c+=" ";c+=`^
@@ -1075,7 +1075,7 @@ ${y}`}s.exports={isPragma:c,hasPragma:f,insertPragma:h}}}),U8r=Ti({"src/language
1075
1075
  `)),a.linkname&&(s+=kte(" linkpath="+a.linkname+`
1076
1076
  `));var c=a.pax;if(c)for(var f in c)s+=kte(" "+f+"="+c[f]+`
1077
1077
  `);return Buffer.from(s)};E8.decodePax=function(a){for(var s={};a.length;){for(var c=0;c<a.length&&a[c]!==32;)c++;var f=parseInt(a.slice(0,c).toString(),10);if(!f)return s;var h=a.slice(c+1,f-1).toString(),y=h.indexOf("=");if(y===-1)return s;s[h.slice(0,y)]=h.slice(y+1),a=a.slice(f)}return s};E8.encode=function(a){var s=nIr(512),c=a.name,f="";if(a.typeflag===5&&c[c.length-1]!=="/"&&(c+="/"),Buffer.byteLength(c)!==c.length)return null;for(;Buffer.byteLength(c)>100;){var h=c.indexOf("/");if(h===-1)return null;f+=f?"/"+c.slice(0,h):c.slice(0,h),c=c.slice(h+1)}return Buffer.byteLength(c)>100||Buffer.byteLength(f)>155||a.linkname&&Buffer.byteLength(a.linkname)>100?null:(s.write(c),s.write(yS(a.mode&cIr,6),100),s.write(yS(a.uid,6),108),s.write(yS(a.gid,6),116),s.write(yS(a.size,11),124),s.write(yS(a.mtime.getTime()/1e3|0,11),136),s[156]=L7e+fIr(a.type),a.linkname&&s.write(a.linkname,157),M7e.copy(s,Tk),sIr.copy(s,Fte),a.uname&&s.write(a.uname,265),a.gname&&s.write(a.gname,297),s.write(yS(a.devmajor||0,6),329),s.write(yS(a.devminor||0,6),337),f&&s.write(f,345),s.write(yS(j7e(s),6),148),s)};E8.decode=function(a,s,c){var f=a[156]===0?0:a[156]-L7e,h=b8(a,0,100,s),y=vS(a,100,8),v=vS(a,108,8),D=vS(a,116,8),b=vS(a,124,12),A=vS(a,136,12),T=pIr(f),k=a[157]===0?null:b8(a,157,100,s),O=b8(a,265,32),w=b8(a,297,32),N=vS(a,329,8),V=vS(a,337,8),ne=j7e(a);if(ne===8*32)return null;if(ne!==vS(a,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(M7e.compare(a,Tk,Tk+6)===0)a[345]&&(h=b8(a,345,155,s)+"/"+h);else if(!(oIr.compare(a,Tk,Tk+6)===0&&uIr.compare(a,Fte,Fte+2)===0)){if(!c)throw new Error("Invalid tar header: unknown format.")}return f===0&&h&&h[h.length-1]==="/"&&(f=5),{name:h,mode:y,uid:v,gid:D,size:b,mtime:new Date(1e3*A),type:T,linkname:k,uname:O,gname:w,devmajor:N,devminor:V}}});var J7e=vc((lXr,H7e)=>{"use strict";qa();var $7e=I0("util"),hIr=B7e(),kk=Pte(),U7e=D8().Writable,K7e=D8().PassThrough,V7e=function(){},q7e=function(a){return a&=511,a&&512-a},_Ir=function(a,s){var c=new OM(a,s);return c.end(),c},mIr=function(a,s){return s.path&&(a.name=s.path),s.linkpath&&(a.linkname=s.linkpath),s.size&&(a.size=parseInt(s.size,10)),a.pax=s,a},OM=function(a,s){this._parent=a,this.offset=s,K7e.call(this,{autoDestroy:!1})};$7e.inherits(OM,K7e);OM.prototype.destroy=function(a){this._parent.destroy(a)};var e3=function(a){if(!(this instanceof e3))return new e3(a);U7e.call(this,a),a=a||{},this._offset=0,this._buffer=hIr(),this._missing=0,this._partial=!1,this._onparse=V7e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var s=this,c=s._buffer,f=function(){s._continue()},h=function(O){if(s._locked=!1,O)return s.destroy(O);s._stream||f()},y=function(){s._stream=null;var O=q7e(s._header.size);O?s._parse(O,v):s._parse(512,k),s._locked||f()},v=function(){s._buffer.consume(q7e(s._header.size)),s._parse(512,k),f()},D=function(){var O=s._header.size;s._paxGlobal=kk.decodePax(c.slice(0,O)),c.consume(O),y()},b=function(){var O=s._header.size;s._pax=kk.decodePax(c.slice(0,O)),s._paxGlobal&&(s._pax=Object.assign({},s._paxGlobal,s._pax)),c.consume(O),y()},A=function(){var O=s._header.size;this._gnuLongPath=kk.decodeLongPath(c.slice(0,O),a.filenameEncoding),c.consume(O),y()},T=function(){var O=s._header.size;this._gnuLongLinkPath=kk.decodeLongPath(c.slice(0,O),a.filenameEncoding),c.consume(O),y()},k=function(){var O=s._offset,w;try{w=s._header=kk.decode(c.slice(0,512),a.filenameEncoding,a.allowUnknownFormat)}catch(N){s.emit("error",N)}if(c.consume(512),!w){s._parse(512,k),f();return}if(w.type==="gnu-long-path"){s._parse(w.size,A),f();return}if(w.type==="gnu-long-link-path"){s._parse(w.size,T),f();return}if(w.type==="pax-global-header"){s._parse(w.size,D),f();return}if(w.type==="pax-header"){s._parse(w.size,b),f();return}if(s._gnuLongPath&&(w.name=s._gnuLongPath,s._gnuLongPath=null),s._gnuLongLinkPath&&(w.linkname=s._gnuLongLinkPath,s._gnuLongLinkPath=null),s._pax&&(s._header=w=mIr(w,s._pax),s._pax=null),s._locked=!0,!w.size||w.type==="directory"){s._parse(512,k),s.emit("entry",w,_Ir(s,O),h);return}s._stream=new OM(s,O),s.emit("entry",w,s._stream,h),s._parse(w.size,y),f()};this._onheader=k,this._parse(512,k)};$7e.inherits(e3,U7e);e3.prototype.destroy=function(a){this._destroyed||(this._destroyed=!0,a&&this.emit("error",a),this.emit("close"),this._stream&&this._stream.emit("close"))};e3.prototype._parse=function(a,s){this._destroyed||(this._offset+=a,this._missing=a,s===this._onheader&&(this._partial=!1),this._onparse=s)};e3.prototype._continue=function(){if(!this._destroyed){var a=this._cb;this._cb=V7e,this._overflow?this._write(this._overflow,void 0,a):a()}};e3.prototype._write=function(a,s,c){if(!this._destroyed){var f=this._stream,h=this._buffer,y=this._missing;if(a.length&&(this._partial=!0),a.length<y)return this._missing-=a.length,this._overflow=null,f?f.write(a,c):(h.append(a),c());this._cb=c,this._missing=0;var v=null;a.length>y&&(v=a.slice(y),a=a.slice(0,y)),f?f.end(a):h.append(a),this._overflow=v,this._onparse()}};e3.prototype._final=function(a){if(this._partial)return this.destroy(new Error("Unexpected end of data"));a()};H7e.exports=e3});var G7e=vc((fXr,z7e)=>{"use strict";qa();z7e.exports=I0("fs").constants||I0("constants")});var Z7e=vc((hXr,Q7e)=>{"use strict";qa();var C8=G7e(),W7e=BB(),BM=J_(),gIr=Buffer.alloc,Y7e=D8().Readable,S8=D8().Writable,yIr=I0("string_decoder").StringDecoder,IM=Pte(),vIr=parseInt("755",8),xIr=parseInt("644",8),X7e=gIr(1024),Ote=function(){},Nte=function(a,s){s&=511,s&&a.push(X7e.slice(0,512-s))};function DIr(a){switch(a&C8.S_IFMT){case C8.S_IFBLK:return"block-device";case C8.S_IFCHR:return"character-device";case C8.S_IFDIR:return"directory";case C8.S_IFIFO:return"fifo";case C8.S_IFLNK:return"symlink"}return"file"}var LM=function(a){S8.call(this),this.written=0,this._to=a,this._destroyed=!1};BM(LM,S8);LM.prototype._write=function(a,s,c){if(this.written+=a.length,this._to.push(a))return c();this._to._drain=c};LM.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var MM=function(){S8.call(this),this.linkname="",this._decoder=new yIr("utf-8"),this._destroyed=!1};BM(MM,S8);MM.prototype._write=function(a,s,c){this.linkname+=this._decoder.write(a),c()};MM.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Fk=function(){S8.call(this),this._destroyed=!1};BM(Fk,S8);Fk.prototype._write=function(a,s,c){c(new Error("No body allowed for this entry"))};Fk.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var JE=function(a){if(!(this instanceof JE))return new JE(a);Y7e.call(this,a),this._drain=Ote,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};BM(JE,Y7e);JE.prototype.entry=function(a,s,c){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof s=="function"&&(c=s,s=null),c||(c=Ote);var f=this;if((!a.size||a.type==="symlink")&&(a.size=0),a.type||(a.type=DIr(a.mode)),a.mode||(a.mode=a.type==="directory"?vIr:xIr),a.uid||(a.uid=0),a.gid||(a.gid=0),a.mtime||(a.mtime=new Date),typeof s=="string"&&(s=Buffer.from(s)),Buffer.isBuffer(s)){a.size=s.length,this._encode(a);var h=this.push(s);return Nte(f,a.size),h?process.nextTick(c):this._drain=c,new Fk}if(a.type==="symlink"&&!a.linkname){var y=new MM;return W7e(y,function(D){if(D)return f.destroy(),c(D);a.linkname=y.linkname,f._encode(a),c()}),y}if(this._encode(a),a.type!=="file"&&a.type!=="contiguous-file")return process.nextTick(c),new Fk;var v=new LM(this);return this._stream=v,W7e(v,function(D){if(f._stream=null,D)return f.destroy(),c(D);if(v.written!==a.size)return f.destroy(),c(new Error("size mismatch"));Nte(f,a.size),f._finalizing&&f.finalize(),c()}),v}};JE.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(X7e),this.push(null))};JE.prototype.destroy=function(a){this._destroyed||(this._destroyed=!0,a&&this.emit("error",a),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};JE.prototype._encode=function(a){if(!a.pax){var s=IM.encode(a);if(s){this.push(s);return}}this._encodePax(a)};JE.prototype._encodePax=function(a){var s=IM.encodePax({name:a.name,linkname:a.linkname,pax:a.pax}),c={name:"PaxHeader",mode:a.mode,uid:a.uid,gid:a.gid,size:s.length,mtime:a.mtime,type:"pax-header",linkname:a.linkname&&"PaxHeader",uname:a.uname,gname:a.gname,devmajor:a.devmajor,devminor:a.devminor};this.push(IM.encode(c)),this.push(s),Nte(this,s.length),c.size=a.size,c.type=a.type,this.push(IM.encode(c))};JE.prototype._read=function(a){var s=this._drain;this._drain=Ote,s()};Q7e.exports=JE});var ebe=vc(Ite=>{"use strict";qa();Ite.extract=J7e();Ite.pack=Z7e()});var nbe=vc((yXr,rbe)=>{"use strict";qa();var bIr=m1e(),EIr=BB(),RM;try{RM=I0("fs")}catch{}var Pk=function(){},CIr=/^v?\.0/.test(process.version),jM=function(a){return typeof a=="function"},SIr=function(a){return!CIr||!RM?!1:(a instanceof(RM.ReadStream||Pk)||a instanceof(RM.WriteStream||Pk))&&jM(a.close)},AIr=function(a){return a.setHeader&&jM(a.abort)},wIr=function(a,s,c,f){f=bIr(f);var h=!1;a.on("close",function(){h=!0}),EIr(a,{readable:s,writable:c},function(v){if(v)return f(v);h=!0,f()});var y=!1;return function(v){if(!h&&!y){if(y=!0,SIr(a))return a.close(Pk);if(AIr(a))return a.abort();if(jM(a.destroy))return a.destroy();f(v||new Error("stream was destroyed"))}}},tbe=function(a){a()},TIr=function(a,s){return a.pipe(s)},kIr=function(){var a=Array.prototype.slice.call(arguments),s=jM(a[a.length-1]||Pk)&&a.pop()||Pk;if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new Error("pump requires two streams per minimum");var c,f=a.map(function(h,y){var v=y<a.length-1,D=y>0;return wIr(h,v,D,function(b){c||(c=b),b&&f.forEach(tbe),!v&&(f.forEach(tbe),s(c))})});return a.reduce(TIr)};rbe.exports=kIr});var obe=vc((xXr,sbe)=>{"use strict";qa();var qM=I0("path"),ibe=I0("fs"),abe=parseInt("0777",8);sbe.exports=A8.mkdirp=A8.mkdirP=A8;function A8(a,s,c,f){typeof s=="function"?(c=s,s={}):(!s||typeof s!="object")&&(s={mode:s});var h=s.mode,y=s.fs||ibe;h===void 0&&(h=abe&~process.umask()),f||(f=null);var v=c||function(){};a=qM.resolve(a),y.mkdir(a,h,function(D){if(!D)return f=f||a,v(null,f);switch(D.code){case"ENOENT":A8(qM.dirname(a),s,function(b,A){b?v(b,A):A8(a,s,v,A)});break;default:y.stat(a,function(b,A){b||!A.isDirectory()?v(D,f):v(null,f)});break}})}A8.sync=function a(s,c,f){(!c||typeof c!="object")&&(c={mode:c});var h=c.mode,y=c.fs||ibe;h===void 0&&(h=abe&~process.umask()),f||(f=null),s=qM.resolve(s);try{y.mkdirSync(s,h),f=f||s}catch(D){switch(D.code){case"ENOENT":f=a(qM.dirname(s),c,f),a(s,c,f);break;default:var v;try{v=y.statSync(s)}catch{throw D}if(!v.isDirectory())throw D;break}}return f}});var _be=vc(Mte=>{"use strict";qa();var FIr=BDe(),cbe=ebe(),lbe=nbe(),PIr=obe(),pbe=I0("fs"),Fy=I0("path"),NIr=I0("os"),Nk=NIr.platform()==="win32",Ok=function(){},Lte=function(a){return a},Bte=Nk?function(a){return a.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:Lte,OIr=function(a,s,c,f,h,y){var v=h||["."];return function(b){if(!v.length)return b();var A=v.shift(),T=Fy.join(c,A);s.call(a,T,function(k,O){if(k)return b(k);if(!O.isDirectory())return b(null,A,O);a.readdir(T,function(w,N){if(w)return b(w);y&&N.sort();for(var V=0;V<N.length;V++)f(Fy.join(c,A,N[V]))||v.push(Fy.join(A,N[V]));b(null,A,O)})})}},fbe=function(a,s){return function(c){c.name=c.name.split("/").slice(s).join("/");var f=c.linkname;return f&&(c.type==="link"||Fy.isAbsolute(f))&&(c.linkname=f.split("/").slice(s).join("/")),a(c)}};Mte.pack=function(a,s){a||(a="."),s||(s={});var c=s.fs||pbe,f=s.ignore||s.filter||Ok,h=s.map||Ok,y=s.mapStream||Lte,v=OIr(c,s.dereference?c.stat:c.lstat,a,f,s.entries,s.sort),D=s.strict!==!1,b=typeof s.umask=="number"?~s.umask:~dbe(),A=typeof s.dmode=="number"?s.dmode:0,T=typeof s.fmode=="number"?s.fmode:0,k=s.pack||cbe.pack(),O=s.finish||Ok;s.strip&&(h=fbe(h,s.strip)),s.readable&&(A|=parseInt(555,8),T|=parseInt(444,8)),s.writable&&(A|=parseInt(333,8),T|=parseInt(222,8));var w=function(ne,se){c.readlink(Fy.join(a,ne),function(J,K){if(J)return k.destroy(J);se.linkname=Bte(K),k.entry(se,V)})},N=function(ne,se,J){if(ne)return k.destroy(ne);if(!se)return s.finalize!==!1&&k.finalize(),O(k);if(J.isSocket())return V();var K={name:Bte(se),mode:(J.mode|(J.isDirectory()?A:T))&b,mtime:J.mtime,size:J.size,type:"file",uid:J.uid,gid:J.gid};if(J.isDirectory())return K.size=0,K.type="directory",K=h(K)||K,k.entry(K,V);if(J.isSymbolicLink())return K.size=0,K.type="symlink",K=h(K)||K,w(se,K);if(K=h(K)||K,!J.isFile())return D?k.destroy(new Error("unsupported type for "+se)):V();var L=k.entry(K,V);if(L){var Y=y(c.createReadStream(Fy.join(a,se),{start:0,end:K.size>0?K.size-1:K.size}),K);Y.on("error",function(pe){L.destroy(pe)}),lbe(Y,L)}},V=function(ne){if(ne)return k.destroy(ne);v(N)};return V(),k};var IIr=function(a){return a.length?a[a.length-1]:null},BIr=function(){return process.getuid?process.getuid():-1},dbe=function(){return process.umask?process.umask():0};Mte.extract=function(a,s){a||(a="."),s||(s={});var c=s.fs||pbe,f=s.ignore||s.filter||Ok,h=s.map||Ok,y=s.mapStream||Lte,v=s.chown!==!1&&!Nk&&BIr()===0,D=s.extract||cbe.extract(),b=[],A=new Date,T=typeof s.umask=="number"?~s.umask:~dbe(),k=typeof s.dmode=="number"?s.dmode:0,O=typeof s.fmode=="number"?s.fmode:0,w=s.strict!==!1;s.strip&&(h=fbe(h,s.strip)),s.readable&&(k|=parseInt(555,8),O|=parseInt(444,8)),s.writable&&(k|=parseInt(333,8),O|=parseInt(222,8));var N=function(se,J){for(var K;(K=IIr(b))&&se.slice(0,K[0].length)!==K[0];)b.pop();if(!K)return J();c.utimes(K[0],A,K[1],J)},V=function(se,J,K){if(s.utimes===!1)return K();if(J.type==="directory")return c.utimes(se,A,J.mtime,K);if(J.type==="symlink")return N(se,K);c.utimes(se,A,J.mtime,function(L){if(L)return K(L);N(se,K)})},ne=function(se,J,K){var L=J.type==="symlink",Y=L?c.lchmod:c.chmod,pe=L?c.lchown:c.chown;if(!Y)return K();var Ie=(J.mode|(J.type==="directory"?k:O))&T;pe&&v?pe.call(c,se,J.uid,J.gid,ae):ae(null);function ae(_e){if(_e)return K(_e);if(!Y)return K();Y.call(c,se,Ie,K)}};return D.on("entry",function(se,J,K){se=h(se)||se,se.name=Bte(se.name);var L=Fy.join(a,Fy.join("/",se.name));if(f(L,se))return J.resume(),K();var Y=function(ge){if(ge)return K(ge);V(L,se,function(be){if(be)return K(be);if(Nk)return K();ne(L,se,K)})},pe=function(){if(Nk)return K();c.unlink(L,function(){c.symlink(se.linkname,L,Y)})},Ie=function(){if(Nk)return K();c.unlink(L,function(){var ge=Fy.join(a,Fy.join("/",se.linkname));c.link(ge,L,function(be){if(be&&be.code==="EPERM"&&s.hardlinkAsFilesFallback)return J=c.createReadStream(ge),ae();Y(be)})})},ae=function(){var ge=c.createWriteStream(L),be=y(J,se);ge.on("error",function(he){be.destroy(he)}),lbe(be,ge,function(he){if(he)return K(he);ge.on("close",Y)})};if(se.type==="directory")return b.push([L,se.mtime]),ube(L,{fs:c,own:v,uid:se.uid,gid:se.gid},Y);var _e=Fy.dirname(L);hbe(c,_e,Fy.join(a,"."),function(ge,be){if(ge)return K(ge);if(!be)return K(new Error(_e+" is not a valid path"));ube(_e,{fs:c,own:v,uid:se.uid,gid:se.gid},function(he){if(he)return K(he);switch(se.type){case"file":return ae();case"link":return Ie();case"symlink":return pe()}if(w)return K(new Error("unsupported type for "+L+" ("+se.type+")"));J.resume(),K()})})}),s.finish&&D.on("finish",s.finish),D};function hbe(a,s,c,f){if(s===c)return f(null,!0);a.lstat(s,function(h,y){if(h&&h.code!=="ENOENT")return f(h);if(h||y.isDirectory())return hbe(a,Fy.join(s,".."),c,f);f(null,!1)})}function ube(a,s,c){PIr(a,{fs:s.fs},function(f,h){!f&&h&&s.own?FIr(h,s.uid,s.gid,c):c(f)})}});qa();import{join as KIr}from"path";import{tmpdir as VIr}from"os";qa();qa();qa();qa();var tQ=qx(ghe(),1);function yhe(a){let s=a.replace(/\r\n$/g,`
1078
- `);return tQ.parse(s)}async function vhe(a,s,c){let f=c?.from&&c?.from!=="."?c.from:VX(),h=await wB(s,{cwd:f,type:"file"});if(!h){Fv({body:"Environment file not found."});return}let v=yhe(await ih(h)).environments;if(!v){Fv({body:["No environments found in",{command:h},{char:"."}]});return}let D=v[a];return D||Fv({body:["Environment",{command:a},"not found."]}),await x1e(()=>({environmentFlags:JSON.stringify(D)})),D}var VB=qx(JX(),1),KB=class extends VB.Command{static descriptionWithoutMarkdown(){return(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)')}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(s){return s.skipOclifErrorHandling=!0,await j1e(s,this.config),VB.Errors.handle(s)}async init(){return this.exitWithTimestampWhenEnvVariablePresent(),S1e()||await q1e(this.config),this.showNpmFlagWarning(),super.init()}showNpmFlagWarning(){let s=this.constructor;Object.keys(s.flags||{}).map(h=>`npm_config_${_1e(h).replace(/^no_/,"")}`).some(h=>process.env[h]!==void 0)&&Fv({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})}exitWithTimestampWhenEnvVariablePresent(){p1e(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&(S5(`
1078
+ `);return tQ.parse(s)}async function vhe(a,s,c){let f=c?.from&&c.from!=="."?c.from:VX(),h=await wB(s,{cwd:f,type:"file"});if(!h){Fv({body:"Environment file not found."});return}let v=yhe(await ih(h)).environments;if(!v){Fv({body:["No environments found in",{command:h},{char:"."}]});return}let D=v[a];return D||Fv({body:["Environment",{command:a},"not found."]}),await x1e(()=>({environmentFlags:JSON.stringify(D)})),D}var VB=qx(JX(),1),KB=class extends VB.Command{static descriptionWithoutMarkdown(){return(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)')}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(s){return s.skipOclifErrorHandling=!0,await j1e(s,this.config),VB.Errors.handle(s)}async init(){return this.exitWithTimestampWhenEnvVariablePresent(),S1e()||await q1e(this.config),this.showNpmFlagWarning(),super.init()}showNpmFlagWarning(){let s=this.constructor;Object.keys(s.flags||{}).map(h=>`npm_config_${_1e(h).replace(/^no_/,"")}`).some(h=>process.env[h]!==void 0)&&Fv({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})}exitWithTimestampWhenEnvVariablePresent(){p1e(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&(S5(`
1079
1079
  SHOPIFY_CLI_TIMESTAMP_START
1080
1080
  { "timestamp": ${Date.now()} }
1081
1081
  SHOPIFY_CLI_TIMESTAMP_END
@@ -1083,7 +1083,7 @@ ${y}`}s.exports={isPragma:c,hasPragma:f,insertPragma:h}}}),U8r=Ti({"src/language
1083
1083
 
1084
1084
  ${Nv.cyan(f)}
1085
1085
 
1086
- This flag is required in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,"To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.")})}async resultWithEnvironment(s,c,f){let h=s.flags,y=this.environmentsFilename();if(!h.environment||!y)return s;let v=await vhe(h.environment,y,{from:h.path});if(!v)return s;let D=await super.parse(UEr(c),f),b=await super.parse(c,[...f||this.argv,...KEr(v,c,D)]);return $Er(D.flags,b.flags,h.environment,v),b}};KB.baseFlags={};async function qEr(a){await v1e(()=>({cmd_all_verbose:a.verbose,cmd_all_path_override:a.path!==void 0,cmd_all_path_override_hash:a.path===void 0?void 0:F1e(a.path)}))}function $Er(a,s,c,f){let h={};for(let[v,D]of Object.entries(s)){let b=Object.prototype.hasOwnProperty.call(a,v),A=Object.prototype.hasOwnProperty.call(f,v);if(!b&&A){let T=v==="password"?`********${D.substr(-4)}`:D;h[v]=T}}if(Object.keys(h).length===0)return;let y=Object.entries(h).map(([v,D])=>`${v}: ${D}`);Ux({headline:["Using applicable flags from",{userInput:c},"environment:"],body:[{list:{items:y}}]})}function UEr(a){return a?.flags?{...a,flags:Object.fromEntries(Object.entries(a.flags).map(([s,c])=>{let f={...c};return delete f.default,[s,f]}))}:a}function KEr(a,s,c){let f=[];for(let[h,y]of Object.entries(a)){let v=s?.flags&&Object.prototype.hasOwnProperty.call(s.flags,h),D=c.flags&&Object.prototype.hasOwnProperty.call(c.flags,h);if(v&&!D)if(typeof y=="boolean")if(y===!0)f.push(`--${h}`);else throw new fp(Ov`Environments can only specify true for boolean flags. Attempted to set ${Nv.yellow(h)} to false.`);else Array.isArray(y)?y.forEach(b=>f.push(`--${h}`,`${b}`)):f.push(`--${h}`,`${y}`)}return f}var xhe=KB;var t3=qx(JX(),1);qa();var ah=qx(JX(),1);qa();qa();qa();import{fileURLToPath as bhe}from"url";qa();import{exec as VEr}from"child_process";import{promisify as HEr}from"util";var Vx=HEr(VEr);function Dhe(){let a=process.listeners("warning")[0];a&&(process.removeAllListeners("warning"),process.prependListener("warning",s=>{s.name!="ExperimentalWarning"&&a(s)}))}var HB=new URL("../../..",import.meta.url).pathname,Iv=HB.endsWith("/hydrogen/packages/"),nQ=Iv?HB:void 0,JEr="assets/hydrogen",zEr="starter",Z3="routes",rQ;async function GEr(){if(rQ??=await wB("package.json",{cwd:bhe(import.meta.url),type:"file"}),!rQ)throw new fp("Could not find assets directory","Please report this error.");return rQ}async function j2(a,...s){return Nl(gm(await GEr()),process.env.SHOPIFY_UNIT_TEST?"assets":`dist/${JEr}`,a??"",...s)}async function k5(a,s){s??=await $A();let c=new URL(`${s}/app${a?`/${a}`:""}`,import.meta.url);return c.protocol==="file:"?bhe(c):c.toString()}function $A(a=!!process.env.SHOPIFY_UNIT_TEST){return a?F5():j2(zEr)}function F5(){if(!Iv)throw new fp("Trying to use skeleton source dir outside of Hydrogen monorepo.","Please report this error.");return Nl(gm(HB),"templates","skeleton")}async function iQ(){let{stdout:a}=await Vx("npm root"),s=a.trim();return!s&&Iv&&(s=Nl(gm(HB),"node_modules")),s}var Ehe=["tailwind","vanilla-extract","css-modules","postcss"];async function Che(a,s,c,f=(h,y)=>h){let h=await j2(a);return Promise.all(Object.entries(s).map(async([y,v])=>{let D=await ih(Nl(h,y));await Ph(Nl(c,v),f(D,y))}))}async function She(a,s,c){let f=Object.values(a).map(y=>cd(Nl(s,y)).then(v=>v?y:null)),h=(await Promise.all(f)).filter(Boolean);return!(h.length>0&&!c&&!await Kx({message:`Some files already exist (${h.join(", ")}). Overwrite?`,defaultValue:!1}))}qa();qa();import{readdir as swr}from"fs/promises";qa();var dL=qx(qme(),1),cZ={arrowParens:"always",singleQuote:!0,bracketSpacing:!1,trailingComma:"all"};async function $E(a=process.cwd()){try{return await dL.resolveConfig(a)||cZ}catch{return cZ}}async function sS(a,s=cZ,c=""){let f=CB(c);return dL.format(a,{parser:f===".tsx"||f===".ts"?"typescript":"babel",...s})}async function HC(a,s,c){let f=await c(await ih(a));if(typeof f=="string")return s&&(f=await sS(f,s,a)),Ph(a,f)}var owr=["tsx","ts","jsx","js","mjs","cjs"];async function q2(a,s,c=owr){let f=await swr(a);if(f.includes(s)){let h=D_(a,s);if(!await AB(h))return{filepath:h};for(let y of["ts","js"]){let v=D_(a,`${s}/index.${y}`);if(await cd(D_(a,v)))return{filepath:v,extension:y,astType:y}}}else for(let h of c){let y=`${s}.${h}`;if(f.includes(y)){let v=h==="mjs"||h==="cjs"?"js":h;return{filepath:D_(a,y),extension:h,astType:v}}}return{}}var $me=Object.freeze(["dependencies","devDependencies","peerDependencies"]);async function X4(a,s,c){let f=await RA(Nl(s,"package.json")),h=await RA(Nl(a,"package.json")),y=new Set(["comment",...c?.ignoredKeys??[]]),v=Object.keys(h).filter(b=>!$me.includes(b));for(let b of v){if(y.has(b))continue;let A=h[b],T=f[b],k=Array.isArray(A)&&Array.isArray(T)?[...T,...A]:typeof A=="object"&&typeof T=="object"?{...T,...A}:A;f[b]=k}let D=Object.entries(f.dependencies||{}).find(([b])=>b.startsWith("@remix-run/"))?.[1];for(let b of $me)y.has(b)||h[b]&&(f[b]=[...new Set([...Object.keys(f[b]??{}),...Object.keys(h[b]??{})])].sort().reduce((A,T)=>{let k=h[b]?.[T]??f[b]?.[T];return T.startsWith("@remix-run/")&&D&&(k=D),A[T]=k,A},{}));await R1e(s,c?.onResult?.(f)??f)}async function Ume(a,s){let f=(await ih(Nl(a,"tsconfig.json"))).match(/"types": \[(.*?)\]/)?.[1];f&&HC(Nl(s,"tsconfig.json"),!1,h=>h.replace(/"types":\s*\[[^\]]*\]/,`"types": [${f}]`))}qa();qa();async function $5(a){let s=await import("@ast-grep/napi");if(!(a in s))throw new Error(`Wrong language for AST: ${a}`);return s[a]}async function Kme(a,s,c){let{filepath:f,astType:h}=await q2(a,"root");if(!f||!h)throw new fp(`Could not find root file in ${a}`);await HC(f,s,async y=>{let v=`import ${c.isDefault?c.name:`{${c.name}}`} from '${(c.isAbsolute?"":"./")+c.path}';`;if(y.includes(v.split("from")[0]))return;let b=(await $5(h)).parse(y).root(),A=b.findAll({rule:{kind:"import_statement"}}).reverse(),T=A.find(V=>V.text().includes(".css"))||A.shift(),k=b.find({utils:{"has-links-id":{has:{kind:"identifier",pattern:"links"}}},rule:{kind:"return_statement",pattern:"return [$$$]",inside:{any:[{kind:"function_declaration",matches:"has-links-id"},{kind:"variable_declarator",matches:"has-links-id"}],stopBy:"end",inside:{stopBy:"end",kind:"export_statement"}}}});if(!T||!k)throw new fp('Could not find a "links" export in root file. Please add one and try again.');let O=T.text(),w=k.text(),N=c.isConditional?`...(${c.name} ? [{ rel: 'stylesheet', href: ${c.name} }] : [])`:`{rel: 'stylesheet', href: ${c.name}}`;return y.replace(O,O+`
1086
+ This flag is required in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,"To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.")})}async resultWithEnvironment(s,c,f){let h=s.flags,y=this.environmentsFilename();if(!h.environment||!y)return s;let v=await vhe(h.environment,y,{from:h.path});if(!v)return s;let D=await super.parse(UEr(c),f),b=await super.parse(c,[...f||this.argv,...KEr(v,c,D)]);return $Er(D.flags,b.flags,h.environment,v),b}};KB.baseFlags={};async function qEr(a){await v1e(()=>({cmd_all_verbose:a.verbose,cmd_all_path_override:a.path!==void 0,cmd_all_path_override_hash:a.path===void 0?void 0:F1e(a.path)}))}function $Er(a,s,c,f){let h={};for(let[v,D]of Object.entries(s)){let b=Object.prototype.hasOwnProperty.call(a,v),A=Object.prototype.hasOwnProperty.call(f,v);if(!b&&A){let T=v==="password"?`********${D.substr(-4)}`:D;h[v]=T}}if(Object.keys(h).length===0)return;let y=Object.entries(h).map(([v,D])=>`${v}: ${D}`);Ux({headline:["Using applicable flags from",{userInput:c},"environment:"],body:[{list:{items:y}}]})}function UEr(a){return a?.flags?{...a,flags:Object.fromEntries(Object.entries(a.flags).map(([s,c])=>{let f={...c};return delete f.default,[s,f]}))}:a}function KEr(a,s,c){let f=[];for(let[h,y]of Object.entries(a)){let v=s?.flags&&Object.prototype.hasOwnProperty.call(s.flags,h),D=c.flags&&Object.prototype.hasOwnProperty.call(c.flags,h);if(v&&!D)if(typeof y=="boolean")if(y)f.push(`--${h}`);else throw new fp(Ov`Environments can only specify true for boolean flags. Attempted to set ${Nv.yellow(h)} to false.`);else Array.isArray(y)?y.forEach(b=>f.push(`--${h}`,`${b}`)):f.push(`--${h}`,`${y}`)}return f}var xhe=KB;var t3=qx(JX(),1);qa();var ah=qx(JX(),1);qa();qa();qa();import{fileURLToPath as bhe}from"url";qa();import{exec as VEr}from"child_process";import{promisify as HEr}from"util";var Vx=HEr(VEr);function Dhe(){let a=process.listeners("warning")[0];a&&(process.removeAllListeners("warning"),process.prependListener("warning",s=>{s.name!="ExperimentalWarning"&&a(s)}))}var HB=new URL("../../..",import.meta.url).pathname,Iv=HB.endsWith("/hydrogen/packages/"),nQ=Iv?HB:void 0,JEr="assets/hydrogen",zEr="starter",Z3="routes",rQ;async function GEr(){if(rQ??=await wB("package.json",{cwd:bhe(import.meta.url),type:"file"}),!rQ)throw new fp("Could not find assets directory","Please report this error.");return rQ}async function j2(a,...s){return Nl(gm(await GEr()),process.env.SHOPIFY_UNIT_TEST?"assets":`dist/${JEr}`,a??"",...s)}async function k5(a,s){s??=await $A();let c=new URL(`${s}/app${a?`/${a}`:""}`,import.meta.url);return c.protocol==="file:"?bhe(c):c.toString()}function $A(a=!!process.env.SHOPIFY_UNIT_TEST){return a?F5():j2(zEr)}function F5(){if(!Iv)throw new fp("Trying to use skeleton source dir outside of Hydrogen monorepo.","Please report this error.");return Nl(gm(HB),"templates","skeleton")}async function iQ(){let{stdout:a}=await Vx("npm root"),s=a.trim();return!s&&Iv&&(s=Nl(gm(HB),"node_modules")),s}var Ehe=["tailwind","vanilla-extract","css-modules","postcss"];async function Che(a,s,c,f=(h,y)=>h){let h=await j2(a);return Promise.all(Object.entries(s).map(async([y,v])=>{let D=await ih(Nl(h,y));await Ph(Nl(c,v),f(D,y))}))}async function She(a,s,c){let f=Object.values(a).map(y=>cd(Nl(s,y)).then(v=>v?y:null)),h=(await Promise.all(f)).filter(Boolean);return!(h.length>0&&!c&&!await Kx({message:`Some files already exist (${h.join(", ")}). Overwrite?`,defaultValue:!1}))}qa();qa();import{readdir as swr}from"fs/promises";qa();var dL=qx(qme(),1),cZ={arrowParens:"always",singleQuote:!0,bracketSpacing:!1,trailingComma:"all"};async function $E(a=process.cwd()){try{return await dL.resolveConfig(a)||cZ}catch{return cZ}}async function sS(a,s=cZ,c=""){let f=CB(c);return dL.format(a,{parser:f===".tsx"||f===".ts"?"typescript":"babel",...s})}async function HC(a,s,c){let f=await c(await ih(a));if(typeof f=="string")return s&&(f=await sS(f,s,a)),Ph(a,f)}var owr=["tsx","ts","jsx","js","mjs","cjs"];async function q2(a,s,c=owr){let f=await swr(a);if(f.includes(s)){let h=D_(a,s);if(!await AB(h))return{filepath:h};for(let y of["ts","js"]){let v=D_(a,`${s}/index.${y}`);if(await cd(D_(a,v)))return{filepath:v,extension:y,astType:y}}}else for(let h of c){let y=`${s}.${h}`;if(f.includes(y)){let v=h==="mjs"||h==="cjs"?"js":h;return{filepath:D_(a,y),extension:h,astType:v}}}return{}}var $me=Object.freeze(["dependencies","devDependencies","peerDependencies"]);async function X4(a,s,c){let f=await RA(Nl(s,"package.json")),h=await RA(Nl(a,"package.json")),y=new Set(["comment",...c?.ignoredKeys??[]]),v=Object.keys(h).filter(b=>!$me.includes(b));for(let b of v){if(y.has(b))continue;let A=h[b],T=f[b],k=Array.isArray(A)&&Array.isArray(T)?[...T,...A]:typeof A=="object"&&typeof T=="object"?{...T,...A}:A;f[b]=k}let D=Object.entries(f.dependencies||{}).find(([b])=>b.startsWith("@remix-run/"))?.[1];for(let b of $me)y.has(b)||h[b]&&(f[b]=[...new Set([...Object.keys(f[b]??{}),...Object.keys(h[b]??{})])].sort().reduce((A,T)=>{let k=h[b]?.[T]??f[b]?.[T];return T.startsWith("@remix-run/")&&D&&(k=D),A[T]=k,A},{}));await R1e(s,c?.onResult?.(f)??f)}async function Ume(a,s){let f=(await ih(Nl(a,"tsconfig.json"))).match(/"types": \[(.*?)\]/)?.[1];f&&HC(Nl(s,"tsconfig.json"),!1,h=>h.replace(/"types":\s*\[[^\]]*\]/,`"types": [${f}]`))}qa();qa();async function $5(a){let s=await import("@ast-grep/napi");if(!(a in s))throw new Error(`Wrong language for AST: ${a}`);return s[a]}async function Kme(a,s,c){let{filepath:f,astType:h}=await q2(a,"root");if(!f||!h)throw new fp(`Could not find root file in ${a}`);await HC(f,s,async y=>{let v=`import ${c.isDefault?c.name:`{${c.name}}`} from '${(c.isAbsolute?"":"./")+c.path}';`;if(y.includes(v.split("from")[0]))return;let b=(await $5(h)).parse(y).root(),A=b.findAll({rule:{kind:"import_statement"}}).reverse(),T=A.find(V=>V.text().includes(".css"))||A.shift(),k=b.find({utils:{"has-links-id":{has:{kind:"identifier",pattern:"links"}}},rule:{kind:"return_statement",pattern:"return [$$$]",inside:{any:[{kind:"function_declaration",matches:"has-links-id"},{kind:"variable_declarator",matches:"has-links-id"}],stopBy:"end",inside:{stopBy:"end",kind:"export_statement"}}}});if(!T||!k)throw new fp('Could not find a "links" export in root file. Please add one and try again.');let O=T.text(),w=k.text(),N=c.isConditional?`...(${c.name} ? [{ rel: 'stylesheet', href: ${c.name} }] : [])`:`{rel: 'stylesheet', href: ${c.name}}`;return y.replace(O,O+`
1087
1087
  `+v).replace(w,w.replace("[",`[${N},`))})}async function hL(a,s,c,f){let{filepath:h,astType:y}=await q2(a,"vite.config");if(!h||!y)throw new fp(`Could not find vite.config file in ${a}`);await HC(h,s,async v=>{let D=`import ${c.isDefault?c.name:`{${c.name}}`} from '${c.path}';`;if(new RegExp(`['"]${c.path.replace("/","\\/")}['"]`).test(v))return;let A=(await $5(y)).parse(v).root(),T=A.findAll({rule:{kind:"import_statement"}}).pop(),k=A.find(uwr);if(!T||!k)throw new fp('Could not find a "plugins" key in Vite config file. Please add one and try again.');let O=T.text(),w=k.text(),N=`${c.name}(${f?JSON.stringify(f):""})`;return v.replace(O,O+`
1088
1088
  `+D).replace(w,w.replace("[",`[${N},`))})}var uwr={rule:{pattern:"[$$$]",inside:{kind:"pair",stopBy:"neighbor",has:{field:"key",regex:"^plugins$",stopBy:"neighbor"},inside:{kind:"object",stopBy:"neighbor",all:[{inside:{kind:"export_statement",regex:"export default",stopBy:"end"}},{not:{inside:{kind:"object",stopBy:"end"}}}]}}}};var Vme="styles/tailwind.css";async function Hme({rootDirectory:a,appDirectory:s},c=!1){let f=kv(a,s),h={"tailwind.css":Nl(f,Vme)};if(!await She(h,s,c)){S5("Skipping CSS setup as some files already exist. You may use `--force` or `-f` to override it.");return}return{workPromise:Promise.all([X4(await j2("tailwind"),a),Che("tailwind",h,a),$E(a).then(v=>Promise.all([Kme(s,v,{name:"tailwindCss",path:`${Vme}?url`,isDefault:!0}),hL(a,v,{name:"tailwindcss",path:"@tailwindcss/vite",isDefault:!0})]))]),generatedAssets:Object.values(h),needsInstallDeps:!0}}qa();async function Jme({rootDirectory:a}){return{workPromise:Promise.all([X4(await j2("vanilla-extract"),a),$E(a).then(c=>hL(a,c,{path:"@vanilla-extract/vite-plugin",name:"vanillaExtractPlugin",isDefault:!1}))]),generatedAssets:[],needsInstallDeps:!0}}var Q4=[...Ehe,"none"],U5={tailwind:"Tailwind (v4 alpha)","vanilla-extract":"Vanilla Extract","css-modules":"CSS Modules",postcss:"PostCSS"};function zme(a,s,c){switch(a){case"tailwind":return Hme(s,c);case"vanilla-extract":return Jme(s);case"postcss":case"css-modules":return{workPromise:Promise.resolve(),generatedAssets:[],needsInstallDeps:!1};default:throw new Error("Unknown strategy")}}async function Gme(a){let s=Object.entries({...U5,...a?.extraChoices});return Pv({message:"Select a styling library",...a,choices:s.map(([c,f])=>({value:c,label:f})),defaultValue:"tailwind"})}qa();qa();qa();qa();async function oS(a,s,c=!0){let{transpileTs:f}=await import("./morph-7M6DKEEJ.js");return f(a,s,c)}qa();var Wme={checkJs:!1,target:"ES2022",module:"ES2022",moduleResolution:"bundler",baseUrl:".",paths:{"~/*":["app/*"]}},cwr=new Set(["noLib","target","module","moduleResolution","checkJs","experimentalDecorators","allowSyntheticDefaultImports","baseUrl","paths",...Object.keys(Wme)]);function lwr(a,s=!1){let c={compilerOptions:{...Wme}};if(a.include&&(c.include=a.include.filter(f=>s||!f.endsWith(".d.ts")).map(f=>f.replace(/(?<!\.d)\.ts(x?)$/,".js$1"))),a.compilerOptions)for(let f of cwr)a.compilerOptions[f]!==void 0&&(c.compilerOptions[f]=a.compilerOptions[f]);return c}async function lZ(a,s=!0){let c=await g1e("**/*.+(ts|tsx)",{absolute:!0,cwd:a,dot:!0,ignore:["**/node_modules/**"]}),f=await $E();for(let h of c){if(h.endsWith(".d.ts")){s||await C5(h);continue}let y=await ih(h),v=await sS(await oS(y,h,s),f);await C5(h),await Ph(h.replace(/\.ts(x?)$/,".js$1"),v)}try{let h=Nl(a,"remix.config.js"),y=await ih(h);y=y.replace(/\/server\.ts/gim,"/server.js"),await Ph(h,y)}catch(h){z_(`Could not change TS extensions in remix.config.js:
1089
1089
  `+h.stack)}try{let h=Nl(a,"tsconfig.json"),y=await ih(h),v=lwr(JSON.parse(y.replace(/^\s*\/\/.*$/gm,"")),s);await C5(h),await Ph(Nl(a,"jsconfig.json"),JSON.stringify(v,null,2))}catch(h){z_(`Could not transpile tsconfig.json:
@@ -1174,7 +1174,7 @@ $profileContent = Get-Content -Path $PROFILE
1174
1174
  if (!$profileContent -or $profileContent -NotLike '*Invoke-Local-H2*') {
1175
1175
  Add-Content -Path $PROFILE -Value '${Ukr}'
1176
1176
  }
1177
- `;async function Kkr(){let a=[];return await tve(nve,"powershell.exe")&&a.push("PowerShell"),await tve(nve,"pwsh.exe")&&a.push("PowerShell 7+"),a}async function nk(a=process.cwd(),s){if(await jkr())return Dg;let c="npx",f=s??await B1e(a).catch(()=>null);return(f==="bun"||f==="pnpm"||f==="yarn")&&(c=f),`${c} shopify hydrogen`}qa();import{readdir as _ve}from"fs/promises";qa();function uve(a){return a.replace(/(^|\.)_index$/,"$1index").replace(/\.(?!\w+\])/g,"/")}qa();import pee from"path";import{readdir as Gkr}from"fs/promises";qa();var cve="^2.1.0";qa();async function Vkr(a){return!!(await q2(a,"vite.config")).filepath}async function lve(a){let s=await Vkr(a);return s&&await fve(a)&&Fv({headline:"Both Vite and Remix config files found.",body:"The remix.config.js file is not used in Vite projects. Please remove it to avoid conflicts."}),s}async function pve(a,s){let c=await Jye(a),f="build",h=process.env.NODE_ENV||"production",y=await c.loadConfigFromFile({command:f,mode:h,isSsrBuild:!0},void 0,a);if(!y||!y.path)throw new Error("No Vite config found");let v=await c.resolveConfig({root:a,build:{ssr:!0}},f,h,h),{appDirectory:D,serverBuildFile:b,routes:A}=Hkr(v),T=v.build.outDir,k=T.replace(/server$/,"client"),O=v.build.rollupOptions.output,{entryFileNames:w}=(Array.isArray(O)?O[0]:O)??{},N=Nl(T,typeof w=="string"?w:b??"index.js"),V=s??v.build.ssr,ne=D_(v.root,typeof V=="string"?V:"server");return{clientOutDir:k,serverOutDir:T,serverOutFile:N,resolvedViteConfig:v,userViteConfig:y.config,remixConfig:{routes:A??{},appDirectory:D??Nl(v.root,"app"),rootDirectory:v.root,serverEntryPoint:(await q2(gm(ne),B4(ne))).filepath||ne}}}function Hkr(a){let{remixConfig:s}=zkr(a)?.api?.getPluginOptions()??{};return s?{appDirectory:s.appDirectory,serverBuildFile:s.serverBuildFile,routes:s.routes}:{}}function Jkr(a,s){return a.plugins.find(c=>c.name===s)}function zkr(a){return Jkr(a,"hydrogen:main")}async function fve(a){return!!(await q2(a,"remix.config")).filepath}function Wkr(){let a=cve;throw new fp("Could not load Remix packages.",`Please make sure you have \`@remix-run/dev@${a}\` installed and all the other Remix packages have the same version.`)}async function dve(a,s=process.env.NODE_ENV){if(await lve(a))return(await pve(a)).remixConfig;await Xye(a);let{readConfig:c}=await RL("@remix-run/dev/dist/config.js",a).catch(Wkr),f=await c(a,s);if(Iv&&nQ){let h=nQ;f.watchPaths??=[],f.watchPaths.push(...(await Gkr(h)).map(y=>y==="hydrogen-react"?pee.resolve(h,y,"dist","browser-dev","index.mjs"):pee.resolve(h,y,"dist","development","index.js"))),f.watchPaths.push(pee.join(h,"cli","dist","virtual-routes","**","*"))}return f}var Ykr=[/robots\.txt/],qL={home:["_index","$"],page:"pages*",cart:["cart","cart.$lines","discount.$code"],products:"products*",collections:"collections*",policies:"policies*",blogs:"blogs*",account:"account*",search:["search","api.predictive-search"],robots:"[robots.txt]",sitemap:"[sitemap.xml]"},fee=[];async function hve(a=Object.keys(qL)){fee.length===0&&(fee=(await _ve(await k5(Z3))).map(f=>f.replace(/\.tsx?$/,"")));let s={},c=[];for(let f of a){s[f]=[];let h=qL[f];if(!h)throw new fp(`No route found for ${f}. Try one of ${Xkr.join()}.`);let y=Array.isArray(h)?h:[h];for(let v of y){let D=v.replace("*","");s[f].push(...fee.filter(b=>b.startsWith(D)))}c.push(...s[f])}return{routeGroups:s,resolvedRouteFiles:c}}var Xkr=[...Object.keys(qL),"all"];async function mve(a,s){let{routeGroups:c,resolvedRouteFiles:f}=a.routeName==="all"?await hve():await hve([a.routeName]),{rootDirectory:h,appDirectory:y}=s||await dve(a.directory),v=f.flatMap(O=>Z3+"/"+O),D=await $E(h),b=Nl(y,Z3),A=await Qkr(b,a),T=!!(a.typescript??await cd(Nl(h,"tsconfig.json"))),k=[];for(let O of v)k.push(await dee(O,{...a,typescript:T,localePrefix:A,rootDirectory:h,appDirectory:y,formatOptions:D}));return A&&await t9r({typescript:T,localePrefix:A,routesDirectory:b,formatOptions:D,adapter:a.adapter}),{routes:k,routeGroups:c,isTypescript:T,formatOptions:D}}async function Qkr(a,{localePrefix:s,routeName:c,v1RouteConvention:f}){if(s)return s;if(s!==void 0||c==="all")return;let h=await _ve(a).catch(()=>[]),y=f?/^\(\$(\w+)\)$/:/^\(\$(\w+)\)\.(_index|\$|cart).[jt]sx?$/,v=h.find(D=>y.test(D));if(v)return v.match(y)?.[1]}async function dee(a,{rootDirectory:s,appDirectory:c,typescript:f,force:h,adapter:y,templatesRoot:v,formatOptions:D,localePrefix:b,v1RouteConvention:A=!1,signal:T,overwriteFileDeps:k=!0}){v??=await $A();let O=(a.match(/(\.[jt]sx?)$/)??[])[1]??".tsx";a=a.replace(O,"");let w=Nl(c,Zkr(a,b,{v1RouteConvention:A})+(f?O:O.replace(".ts",".js"))),N={operation:"created",sourceRoute:a,destinationRoute:f1e(w,s)};if(!h&&await cd(w)){if(!await Kx({message:`The file ${N.destinationRoute} already exists. Do you want to replace it?`,defaultValue:!1,confirmationMessage:"Yes",cancellationMessage:"No",abortSignal:T}))return{...N,operation:"skipped"};N.operation="replaced"}let V=await k5(a+O,v),ne=await e9r(V,await k5("",v));for(let se of ne){let K=se.startsWith(Z3+"/")?w:Nl(c,se.replace(/\.ts(x?)$/,`.${f?"ts$1":"js$1"}`));if(!k&&await cd(K))continue;await cd(gm(K))||await MA(gm(K));let L=await k5(se,v);if(!/\.[jt]sx?$/.test(se)){await KC(L,K);continue}let Y=await ih(L);f||(Y=await oS(Y,L)),y&&(Y=gve(Y,y)),Y=await sS(Y,D,K),await Ph(K,Y)}return N}function gve(a,s){return a.replace(/@shopify\/remix-oxygen/g,s)}function Zkr(a,s,c){let f=a.replace(Z3+"/",""),h=s&&!Ykr.some(y=>y.test(f))?`($${s})`+(c.v1RouteConvention?"/":"."):"";return Z3+"/"+h+(c.v1RouteConvention?uve(f):f)}async function e9r(a,s){let c=new Set([a]),f=new Set([kv(s,a)]);for(let h of c){let y=(await ih(h,{encoding:"utf8"})).matchAll(/^(import|export)\s+.*?\s+from\s+['"](.*?)['"];?$/gims);for(let[,,v]of y){if(!v||!/^(\.|~)/.test(v))continue;v=v.replace(/\?[a-z.]+$/,""),v=v.replace("~",kv(gm(h),s)||".");let D=D_(gm(h),v),b=(await q2(gm(D),B4(D))).filepath||D;b.includes(`/${Z3}/`)||(f.add(kv(s,b)),/\.[jt]sx?$/.test(b)&&c.add(b))}}return[...f]}async function yve(a){return await Kx({message:"Scaffold all standard route files? "+Object.keys(qL).join(", "),confirmationMessage:"Yes",cancellationMessage:"No",...a})?"all":[]}function t9r({typescript:a,localePrefix:s,...c}){return r9r({...c,typescript:a,templateName:"locale-check.ts",routeName:`($${s})${a?".tsx":".jsx"}`})}async function r9r({templateName:a,routeName:s,routesDirectory:c,formatOptions:f,typescript:h,adapter:y}){let v=Nl(c,s);if(await cd(v))return;let D=await j2("routes",a);if(!await cd(D))throw new Error("Unknown strategy");let b=await ih(D);y&&(b=gve(b,y)),h||(b=await oS(b,D)),b=await sS(b,f,v),await Ph(v,b)}qa();qa();async function u8(a,s,c){let f="Admin",h=`https://${s.storeFqdn}/admin/api/unstable/graphql.json`;try{return await NB({query:a,api:f,url:h,token:s.token,variables:c})}catch(y){let v=y.errors;throw v?.some?.(D=>D.message.includes("app is not installed"))?new fp("Hydrogen sales channel isn't installed","Install the Hydrogen sales channel on your store to start creating and linking Hydrogen storefronts: https://apps.shopify.com/hydrogen"):v?.some?.(D=>D.message.includes("Access denied for hydrogenStorefrontCreate field"))?new fp("Couldn't connect storefront to Shopify",["Common reasons for this error include:",{list:{items:["The Hydrogen sales channel isn't installed on the store.","You don't have the required account permission to manage apps or channels.","You're trying to connect to an ineligible store type (Trial, Development store)"]}}]):y}}qa();var n9r=/gid:\/\/shopify\/\w*\/(\d+)/;function vve(a){let s=n9r.exec(a);if(s&&s[1]!==void 0)return s[1];throw new fp(`Invalid Global ID: ${a}`)}var i9r=`#graphql
1177
+ `;async function Kkr(){let a=[];return await tve(nve,"powershell.exe")&&a.push("PowerShell"),await tve(nve,"pwsh.exe")&&a.push("PowerShell 7+"),a}async function nk(a=process.cwd(),s){if(await jkr())return Dg;let c="npx",f=s??await B1e(a).catch(()=>null);return(f==="bun"||f==="pnpm"||f==="yarn")&&(c=f),`${c} shopify hydrogen`}qa();import{readdir as _ve}from"fs/promises";qa();function uve(a){return a.replace(/(^|\.)_index$/,"$1index").replace(/\.(?!\w+\])/g,"/")}qa();import pee from"path";import{readdir as Gkr}from"fs/promises";qa();var cve="^2.1.0";qa();async function Vkr(a){return!!(await q2(a,"vite.config")).filepath}async function lve(a){let s=await Vkr(a);return s&&await fve(a)&&Fv({headline:"Both Vite and Remix config files found.",body:"The remix.config.js file is not used in Vite projects. Please remove it to avoid conflicts."}),s}async function pve(a,s){let c=await Jye(a),f="build",h=process.env.NODE_ENV||"production",y=await c.loadConfigFromFile({command:f,mode:h,isSsrBuild:!0},void 0,a);if(!y||!y.path)throw new Error("No Vite config found");let v=await c.resolveConfig({root:a,build:{ssr:!0}},f,h,h),{appDirectory:D,serverBuildFile:b,routes:A}=Hkr(v),T=v.build.outDir,k=T.replace(/server$/,"client"),O=v.build.rollupOptions.output,{entryFileNames:w}=(Array.isArray(O)?O[0]:O)??{},N=Nl(T,typeof w=="string"?w:b??"index.js"),V=s??v.build.ssr,ne=D_(v.root,typeof V=="string"?V:"server");return{clientOutDir:k,serverOutDir:T,serverOutFile:N,resolvedViteConfig:v,userViteConfig:y.config,remixConfig:{routes:A??{},appDirectory:D??Nl(v.root,"app"),rootDirectory:v.root,serverEntryPoint:(await q2(gm(ne),B4(ne))).filepath||ne}}}function Hkr(a){let{remixConfig:s}=zkr(a)?.api?.getPluginOptions()??{};return s?{appDirectory:s.appDirectory,serverBuildFile:s.serverBuildFile,routes:s.routes}:{}}function Jkr(a,s){return a.plugins.find(c=>c.name===s)}function zkr(a){return Jkr(a,"hydrogen:main")}async function fve(a){return!!(await q2(a,"remix.config")).filepath}function Wkr(){let a=cve;throw new fp("Could not load Remix packages.",`Please make sure you have \`@remix-run/dev@${a}\` installed and all the other Remix packages have the same version.`)}async function dve(a,s=process.env.NODE_ENV){if(await lve(a))return(await pve(a)).remixConfig;await Xye(a);let{readConfig:c}=await RL("@remix-run/dev/dist/config.js",a).catch(Wkr),f=await c(a,s);if(Iv&&nQ){let h=nQ;f.watchPaths??=[],f.watchPaths.push(...(await Gkr(h)).map(y=>y==="hydrogen-react"?pee.resolve(h,y,"dist","browser-dev","index.mjs"):pee.resolve(h,y,"dist","development","index.js"))),f.watchPaths.push(pee.join(h,"cli","dist","virtual-routes","**","*"))}return f}var Ykr=[/robots\.txt/],qL={home:["_index","$"],page:"pages*",cart:["cart","cart.$lines","discount.$code"],products:"products*",collections:"collections*",policies:"policies*",blogs:"blogs*",account:"account*",search:["search","api.predictive-search"],robots:"[robots.txt]",sitemap:["[sitemap.xml]","sitemap.$type.$page[.xml]"]},fee=[];async function hve(a=Object.keys(qL)){fee.length===0&&(fee=(await _ve(await k5(Z3))).map(f=>f.replace(/\.tsx?$/,"")));let s={},c=[];for(let f of a){s[f]=[];let h=qL[f];if(!h)throw new fp(`No route found for ${f}. Try one of ${Xkr.join()}.`);let y=Array.isArray(h)?h:[h];for(let v of y){let D=v.replace("*","");s[f].push(...fee.filter(b=>b.startsWith(D)))}c.push(...s[f])}return{routeGroups:s,resolvedRouteFiles:c}}var Xkr=[...Object.keys(qL),"all"];async function mve(a,s){let{routeGroups:c,resolvedRouteFiles:f}=a.routeName==="all"?await hve():await hve([a.routeName]),{rootDirectory:h,appDirectory:y}=s||await dve(a.directory),v=f.flatMap(O=>Z3+"/"+O),D=await $E(h),b=Nl(y,Z3),A=await Qkr(b,a),T=!!(a.typescript??await cd(Nl(h,"tsconfig.json"))),k=[];for(let O of v)k.push(await dee(O,{...a,typescript:T,localePrefix:A,rootDirectory:h,appDirectory:y,formatOptions:D}));return A&&await t9r({typescript:T,localePrefix:A,routesDirectory:b,formatOptions:D,adapter:a.adapter}),{routes:k,routeGroups:c,isTypescript:T,formatOptions:D}}async function Qkr(a,{localePrefix:s,routeName:c,v1RouteConvention:f}){if(s)return s;if(s!==void 0||c==="all")return;let h=await _ve(a).catch(()=>[]),y=f?/^\(\$(\w+)\)$/:/^\(\$(\w+)\)\.(_index|\$|cart).[jt]sx?$/,v=h.find(D=>y.test(D));if(v)return v.match(y)?.[1]}async function dee(a,{rootDirectory:s,appDirectory:c,typescript:f,force:h,adapter:y,templatesRoot:v,formatOptions:D,localePrefix:b,v1RouteConvention:A=!1,signal:T,overwriteFileDeps:k=!0}){v??=await $A();let O=(a.match(/(\.[jt]sx?)$/)??[])[1]??".tsx";a=a.replace(O,"");let w=Nl(c,Zkr(a,b,{v1RouteConvention:A})+(f?O:O.replace(".ts",".js"))),N={operation:"created",sourceRoute:a,destinationRoute:f1e(w,s)};if(!h&&await cd(w)){if(!await Kx({message:`The file ${N.destinationRoute} already exists. Do you want to replace it?`,defaultValue:!1,confirmationMessage:"Yes",cancellationMessage:"No",abortSignal:T}))return{...N,operation:"skipped"};N.operation="replaced"}let V=await k5(a+O,v),ne=await e9r(V,await k5("",v));for(let se of ne){let K=se.startsWith(Z3+"/")?w:Nl(c,se.replace(/\.ts(x?)$/,`.${f?"ts$1":"js$1"}`));if(!k&&await cd(K))continue;await cd(gm(K))||await MA(gm(K));let L=await k5(se,v);if(!/\.[jt]sx?$/.test(se)){await KC(L,K);continue}let Y=await ih(L);f||(Y=await oS(Y,L)),y&&(Y=gve(Y,y)),Y=await sS(Y,D,K),await Ph(K,Y)}return N}function gve(a,s){return a.replace(/@shopify\/remix-oxygen/g,s)}function Zkr(a,s,c){let f=a.replace(Z3+"/",""),h=s&&!Ykr.some(y=>y.test(f))?`($${s})`+(c.v1RouteConvention?"/":"."):"";return Z3+"/"+h+(c.v1RouteConvention?uve(f):f)}async function e9r(a,s){let c=new Set([a]),f=new Set([kv(s,a)]);for(let h of c){let y=(await ih(h,{encoding:"utf8"})).matchAll(/^(import|export)\s+.*?\s+from\s+['"](.*?)['"];?$/gims);for(let[,,v]of y){if(!v||!/^(\.|~)/.test(v))continue;v=v.replace(/\?[a-z.]+$/,""),v=v.replace("~",kv(gm(h),s)||".");let D=D_(gm(h),v),b=(await q2(gm(D),B4(D))).filepath||D;b.includes(`/${Z3}/`)||(f.add(kv(s,b)),/\.[jt]sx?$/.test(b)&&c.add(b))}}return[...f]}async function yve(a){return await Kx({message:"Scaffold all standard route files? "+Object.keys(qL).join(", "),confirmationMessage:"Yes",cancellationMessage:"No",...a})?"all":[]}function t9r({typescript:a,localePrefix:s,...c}){return r9r({...c,typescript:a,templateName:"locale-check.ts",routeName:`($${s})${a?".tsx":".jsx"}`})}async function r9r({templateName:a,routeName:s,routesDirectory:c,formatOptions:f,typescript:h,adapter:y}){let v=Nl(c,s);if(await cd(v))return;let D=await j2("routes",a);if(!await cd(D))throw new Error("Unknown strategy");let b=await ih(D);y&&(b=gve(b,y)),h||(b=await oS(b,D)),b=await sS(b,f,v),await Ph(v,b)}qa();qa();async function u8(a,s,c){let f="Admin",h=`https://${s.storeFqdn}/admin/api/unstable/graphql.json`;try{return await NB({query:a,api:f,url:h,token:s.token,variables:c})}catch(y){let v=y.errors;throw v?.some?.(D=>D.message.includes("app is not installed"))?new fp("Hydrogen sales channel isn't installed","Install the Hydrogen sales channel on your store to start creating and linking Hydrogen storefronts: https://apps.shopify.com/hydrogen"):v?.some?.(D=>D.message.includes("Access denied for hydrogenStorefrontCreate field"))?new fp("Couldn't connect storefront to Shopify",["Common reasons for this error include:",{list:{items:["The Hydrogen sales channel isn't installed on the store.","You don't have the required account permission to manage apps or channels.","You're trying to connect to an ineligible store type (Trial, Development store)"]}}]):y}}qa();var n9r=/gid:\/\/shopify\/\w*\/(\d+)/;function vve(a){let s=n9r.exec(a);if(s&&s[1]!==void 0)return s[1];throw new fp(`Invalid Global ID: ${a}`)}var i9r=`#graphql
1178
1178
  query LinkStorefront {
1179
1179
  hydrogenStorefronts {
1180
1180
  id
@@ -0,0 +1,2 @@
1
+ import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
+ import{oa as a,pa as b,qa as c,ra as d,sa as e}from"./chunk-5NDCRVGJ.js";import"./chunk-H55SNOVV.js";import"./chunk-VMIOG46Y.js";import"./chunk-M6JXYI3V.js";import"./chunk-FB327AH7.js";import"./chunk-EO6F7WJJ.js";import"./chunk-7NPI5OH3.js";import"./chunk-RH6HNOXT.js";import"./chunk-MNT4XW23.js";export{e as addBugsnagMetadata,c as cleanStackFrameFilePath,a as errorHandler,d as registerCleanBugsnagErrorsFromWithinPlugins,b as sendErrorToBugsnag};
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "5.0.9",
8
+ "version": "5.0.10",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "build": "tsup --clean",
@@ -1,2 +0,0 @@
1
- import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
- import{a as S,c as p,i as o}from"./chunk-MNT4XW23.js";var L=p((ee,I)=>{"use strict";o();I.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&I.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&I.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var V=p((ne,x)=>{"use strict";o();var f=global.process,c=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};c(f)?(U=S("assert"),l=L(),g=/^win/i.test(f.platform),y=S("events"),typeof y!="function"&&(y=y.EventEmitter),f.__signal_exit_emitter__?u=f.__signal_exit_emitter__:(u=f.__signal_exit_emitter__=new y,u.count=0,u.emitted={}),u.infinite||(u.setMaxListeners(1/0),u.infinite=!0),x.exports=function(e,r){if(!c(global.process))return function(){};U.equal(typeof e,"function","a callback must be provided for exit handler"),v===!1&&C();var n="exit";r&&r.alwaysLast&&(n="afterexit");var t=function(){u.removeListener(n,e),u.listeners("exit").length===0&&u.listeners("afterexit").length===0&&d()};return u.on(n,e),t},d=function(){!v||!c(global.process)||(v=!1,l.forEach(function(r){try{f.removeListener(r,h[r])}catch{}}),f.emit=G,f.reallyExit=b,u.count-=1)},x.exports.unload=d,a=function(r,n,t){u.emitted[r]||(u.emitted[r]=!0,u.emit(r,n,t))},h={},l.forEach(function(e){h[e]=function(){if(c(global.process)){var n=f.listeners(e);n.length===u.count&&(d(),a("exit",null,e),a("afterexit",null,e),g&&e==="SIGHUP"&&(e="SIGINT"),f.kill(f.pid,e))}}}),x.exports.signals=function(){return l},v=!1,C=function(){v||!c(global.process)||(v=!0,u.count+=1,l=l.filter(function(r){try{return f.on(r,h[r]),!0}catch{return!1}}),f.emit=O,f.reallyExit=A)},x.exports.load=C,b=f.reallyExit,A=function(r){c(global.process)&&(f.exitCode=r||0,a("exit",f.exitCode,null),a("afterexit",f.exitCode,null),b.call(f,f.exitCode))},G=f.emit,O=function(r,n){if(r==="exit"&&c(global.process)){n!==void 0&&(f.exitCode=n);var t=G.apply(this,arguments);return a("exit",f.exitCode,null),a("afterexit",f.exitCode,null),t}else return G.apply(this,arguments)}):x.exports=function(){return function(){}};var U,l,g,y,u,d,a,h,v,C,b,A,G,O});var H=p((fe,E)=>{"use strict";o();E.exports=F;F.sync=Y;var M=S("fs");function W(e,r){var n=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var t=0;t<n.length;t++){var i=n[t].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function N(e,r,n){return!e.isSymbolicLink()&&!e.isFile()?!1:W(r,n)}function F(e,r,n){M.stat(e,function(t,i){n(t,t?!1:N(i,e,r))})}function Y(e,r){return N(M.statSync(e),e,r)}});var D=p((ie,m)=>{"use strict";o();m.exports=R;R.sync=Z;var P=S("fs");function R(e,r,n){P.stat(e,function(t,i){n(t,t?!1:X(i,r))})}function Z(e,r){return X(P.statSync(e),r)}function X(e,r){return e.isFile()&&z(e,r)}function z(e,r){var n=e.mode,t=e.uid,i=e.gid,s=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),T=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),k=parseInt("100",8),q=parseInt("010",8),B=parseInt("001",8),K=k|q,Q=n&B||n&q&&i===T||n&k&&t===s||n&K&&s===0;return Q}});var $=p((ae,j)=>{"use strict";o();var ce=S("fs"),_;process.platform==="win32"||global.TESTING_WINDOWS?_=H():_=D();j.exports=w;w.sync=J;function w(e,r,n){if(typeof r=="function"&&(n=r,r={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(t,i){w(e,r||{},function(s,T){s?i(s):t(T)})})}_(e,r||{},function(t,i){t&&(t.code==="EACCES"||r&&r.ignoreErrors)&&(t=null,i=!1),n(t,i)})}function J(e,r){try{return _.sync(e,r||{})}catch(n){if(r&&r.ignoreErrors||n.code==="EACCES")return!1;throw n}}});export{V as a,$ as b};
@@ -1,2 +0,0 @@
1
- import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
- import{oa as a,pa as b,qa as c,ra as d,sa as e}from"./chunk-62RC26N6.js";import"./chunk-FB327AH7.js";import"./chunk-H55SNOVV.js";import"./chunk-EO6F7WJJ.js";import"./chunk-7NPI5OH3.js";import"./chunk-RH6HNOXT.js";import"./chunk-VMIOG46Y.js";import"./chunk-M6JXYI3V.js";import"./chunk-FJPX4XUR.js";import"./chunk-MNT4XW23.js";export{e as addBugsnagMetadata,c as cleanStackFrameFilePath,a as errorHandler,d as registerCleanBugsnagErrorsFromWithinPlugins,b as sendErrorToBugsnag};
@@ -1,22 +0,0 @@
1
- import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
- import{a as Ft,b as zt}from"./chunk-FJPX4XUR.js";import{a as x,c as v,i as u}from"./chunk-MNT4XW23.js";var _e=v(N=>{"use strict";u();Object.defineProperty(N,"__esModule",{value:!0});N.mergeOptions=N.arrayifyInput=N.isNullOrUndefined=void 0;function Gt(e){return e==null}N.isNullOrUndefined=Gt;function Vt(e){return Array.isArray(e)?e:[e]}N.arrayifyInput=Vt;function Xt(e){return Object.assign(Object.assign({},{signal:"SIGKILL"}),e)}N.mergeOptions=Xt});var Ne=v((kr,Te)=>{"use strict";u();Te.exports=qe;qe.sync=Wt;var oe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Se=x("path"),Yt=oe?";":":",Ae=zt();function je(e){var t=new Error("not found: "+e);return t.code="ENOENT",t}function Pe(e,t){var r=t.colon||Yt,n=t.path||process.env.PATH||"",i=[""];n=n.split(r);var s="";return oe&&(n.unshift(process.cwd()),s=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM",i=s.split(r),e.indexOf(".")!==-1&&i[0]!==""&&i.unshift("")),(e.match(/\//)||oe&&e.match(/\\/))&&(n=[""]),{env:n,ext:i,extExe:s}}function qe(e,t,r){typeof t=="function"&&(r=t,t={});var n=Pe(e,t),i=n.env,s=n.ext,a=n.extExe,o=[];(function h(l,c){if(l===c)return t.all&&o.length?r(null,o):r(je(e));var f=i[l];f.charAt(0)==='"'&&f.slice(-1)==='"'&&(f=f.slice(1,-1));var b=Se.join(f,e);!f&&/^\.[\\\/]/.test(e)&&(b=e.slice(0,2)+b),function $(A,m){if(A===m)return h(l+1,c);var g=s[A];Ae(b+g,{pathExt:a},function(T,Ht){if(!T&&Ht)if(t.all)o.push(b+g);else return r(null,b+g);return $(A+1,m)})}(0,s.length)})(0,i.length)}function Wt(e,t){t=t||{};for(var r=Pe(e,t),n=r.env,i=r.ext,s=r.extExe,a=[],o=0,h=n.length;o<h;o++){var l=n[o];l.charAt(0)==='"'&&l.slice(-1)==='"'&&(l=l.slice(1,-1));var c=Se.join(l,e);!l&&/^\.[\\\/]/.test(e)&&(c=e.slice(0,2)+c);for(var f=0,b=i.length;f<b;f++){var $=c+i[f],A;try{if(A=Ae.sync($,{pathExt:s}),A)if(t.all)a.push($);else return $}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw je(e)}});var Le=v((tn,Ie)=>{"use strict";u();var Ce=Object.prototype.hasOwnProperty;Ie.exports=w;function w(e){if(!(this instanceof w))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),e)if(e instanceof w||typeof Map=="function"&&e instanceof Map)e.forEach(function(t,r){this.set(r,t)},this);else if(Array.isArray(e))e.forEach(function(t){this.set(t[0],t[1])},this);else throw new TypeError("invalid argument")}w.prototype.forEach=function(e,t){t=t||this,Object.keys(this._data).forEach(function(r){r!=="size"&&e.call(t,this._data[r].value,this._data[r].key)},this)};w.prototype.has=function(e){return!!ue(this._data,e)};w.prototype.get=function(e){var t=ue(this._data,e);return t&&t.value};w.prototype.set=function(e,t){Jt(this._data,e,t)};w.prototype.delete=function(e){var t=ue(this._data,e);t&&(delete this._data[t._index],this._data.size--)};w.prototype.clear=function(){var e=Object.create(null);e.size=0,Object.defineProperty(this,"_data",{value:e,enumerable:!1,configurable:!0,writable:!1})};Object.defineProperty(w.prototype,"size",{get:function(){return this._data.size},set:function(e){},enumerable:!0,configurable:!0});w.prototype.values=w.prototype.keys=w.prototype.entries=function(){throw new Error("iterators are not implemented in this version")};function $e(e,t){return e===t||e!==e&&t!==t}function Qt(e,t,r){this.key=e,this.value=t,this._index=r}function ue(e,t){for(var r=0,n="_"+t,i=n;Ce.call(e,i);i=n+r++)if($e(e[i].key,t))return e[i]}function Jt(e,t,r){for(var n=0,i="_"+t,s=i;Ce.call(e,s);s=i+n++)if($e(e[s].key,t)){e[s].value=r;return}e.size++,e[s]=new Qt(t,r,s)}});var Me=v((nn,ae)=>{"use strict";u();process.env.npm_package_name==="pseudomap"&&process.env.npm_lifecycle_script==="test"&&(process.env.TEST_PSEUDOMAP="true");typeof Map=="function"&&!process.env.TEST_PSEUDOMAP?ae.exports=Map:ae.exports=Le()});var Be=v((on,Re)=>{"use strict";u();Re.exports=p;p.Node=D;p.create=p;function p(e){var t=this;if(t instanceof p||(t=new p),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}p.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null};p.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};p.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};p.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Zt(this,arguments[e]);return this.length};p.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)kt(this,arguments[e]);return this.length};p.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};p.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};p.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};p.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};p.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};p.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};p.prototype.map=function(e,t){t=t||this;for(var r=new p,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};p.prototype.mapReverse=function(e,t){t=t||this;for(var r=new p,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};p.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};p.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};p.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};p.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};p.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new p;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};p.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new p;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};p.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function Zt(e,t){e.tail=new D(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function kt(e,t){e.head=new D(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function D(e,t,r,n){if(!(this instanceof D))return new D(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}});var ce=v((an,Ke)=>{"use strict";u();Ke.exports=d;var er=Me(),K=x("util"),tr=Be(),rr=typeof Symbol=="function"&&process.env._nodeLRUCacheForceNoSymbol!=="1",_;rr?_=function(e){return Symbol(e)}:_=function(e){return"_"+e};var P=_("max"),S=_("length"),I=_("lengthCalculator"),L=_("allowStale"),C=_("maxAge"),j=_("dispose"),Ue=_("noDisposeOnSet"),y=_("lruList"),O=_("cache");function H(){return 1}function d(e){if(!(this instanceof d))return new d(e);typeof e=="number"&&(e={max:e}),e||(e={});var t=this[P]=e.max;(!t||typeof t!="number"||t<=0)&&(this[P]=1/0);var r=e.length||H;typeof r!="function"&&(r=H),this[I]=r,this[L]=e.stale||!1,this[C]=e.maxAge||0,this[j]=e.dispose,this[Ue]=e.noDisposeOnSet||!1,this.reset()}Object.defineProperty(d.prototype,"max",{set:function(e){(!e||typeof e!="number"||e<=0)&&(e=1/0),this[P]=e,F(this)},get:function(){return this[P]},enumerable:!0});Object.defineProperty(d.prototype,"allowStale",{set:function(e){this[L]=!!e},get:function(){return this[L]},enumerable:!0});Object.defineProperty(d.prototype,"maxAge",{set:function(e){(!e||typeof e!="number"||e<0)&&(e=0),this[C]=e,F(this)},get:function(){return this[C]},enumerable:!0});Object.defineProperty(d.prototype,"lengthCalculator",{set:function(e){typeof e!="function"&&(e=H),e!==this[I]&&(this[I]=e,this[S]=0,this[y].forEach(function(t){t.length=this[I](t.value,t.key),this[S]+=t.length},this)),F(this)},get:function(){return this[I]},enumerable:!0});Object.defineProperty(d.prototype,"length",{get:function(){return this[S]},enumerable:!0});Object.defineProperty(d.prototype,"itemCount",{get:function(){return this[y].length},enumerable:!0});d.prototype.rforEach=function(e,t){t=t||this;for(var r=this[y].tail;r!==null;){var n=r.prev;De(this,e,r,t),r=n}};function De(e,t,r,n){var i=r.value;z(e,i)&&(M(e,r),e[L]||(i=void 0)),i&&t.call(n,i.value,i.key,e)}d.prototype.forEach=function(e,t){t=t||this;for(var r=this[y].head;r!==null;){var n=r.next;De(this,e,r,t),r=n}};d.prototype.keys=function(){return this[y].toArray().map(function(e){return e.key},this)};d.prototype.values=function(){return this[y].toArray().map(function(e){return e.value},this)};d.prototype.reset=function(){this[j]&&this[y]&&this[y].length&&this[y].forEach(function(e){this[j](e.key,e.value)},this),this[O]=new er,this[y]=new tr,this[S]=0};d.prototype.dump=function(){return this[y].map(function(e){if(!z(this,e))return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})};d.prototype.dumpLru=function(){return this[y]};d.prototype.inspect=function(e,t){var r="LRUCache {",n=!1,i=this[L];i&&(r+=`
3
- allowStale: true`,n=!0);var s=this[P];s&&s!==1/0&&(n&&(r+=","),r+=`
4
- max: `+K.inspect(s,t),n=!0);var a=this[C];a&&(n&&(r+=","),r+=`
5
- maxAge: `+K.inspect(a,t),n=!0);var o=this[I];o&&o!==H&&(n&&(r+=","),r+=`
6
- length: `+K.inspect(this[S],t),n=!0);var h=!1;return this[y].forEach(function(l){h?r+=`,
7
- `:(n&&(r+=`,
8
- `),h=!0,r+=`
9
- `);var c=K.inspect(l.key).split(`
10
- `).join(`
11
- `),f={value:l.value};l.maxAge!==a&&(f.maxAge=l.maxAge),o!==H&&(f.length=l.length),z(this,l)&&(f.stale=!0),f=K.inspect(f,t).split(`
12
- `).join(`
13
- `),r+=c+" => "+f}),(h||n)&&(r+=`
14
- `),r+="}",r};d.prototype.set=function(e,t,r){r=r||this[C];var n=r?Date.now():0,i=this[I](t,e);if(this[O].has(e)){if(i>this[P])return M(this,this[O].get(e)),!1;var s=this[O].get(e),a=s.value;return this[j]&&(this[Ue]||this[j](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[S]+=i-a.length,a.length=i,this.get(e),F(this),!0}var o=new nr(e,t,i,n,r);return o.length>this[P]?(this[j]&&this[j](e,t),!1):(this[S]+=o.length,this[y].unshift(o),this[O].set(e,this[y].head),F(this),!0)};d.prototype.has=function(e){if(!this[O].has(e))return!1;var t=this[O].get(e).value;return!z(this,t)};d.prototype.get=function(e){return le(this,e,!0)};d.prototype.peek=function(e){return le(this,e,!1)};d.prototype.pop=function(){var e=this[y].tail;return e?(M(this,e),e.value):null};d.prototype.del=function(e){M(this,this[O].get(e))};d.prototype.load=function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(i===0)this.set(n.k,n.v);else{var s=i-t;s>0&&this.set(n.k,n.v,s)}}};d.prototype.prune=function(){var e=this;this[O].forEach(function(t,r){le(e,r,!1)})};function le(e,t,r){var n=e[O].get(t);if(n){var i=n.value;z(e,i)?(M(e,n),e[L]||(i=void 0)):r&&e[y].unshiftNode(n),i&&(i=i.value)}return i}function z(e,t){if(!t||!t.maxAge&&!e[C])return!1;var r=!1,n=Date.now()-t.now;return t.maxAge?r=n>t.maxAge:r=e[C]&&n>e[C],r}function F(e){if(e[S]>e[P])for(var t=e[y].tail;e[S]>e[P]&&t!==null;){var r=t.prev;M(e,t),t=r}}function M(e,t){if(t){var r=t.value;e[j]&&e[j](r.key,r.value),e[S]-=r.length,e[O].delete(r.key),e[y].removeNode(t)}}function nr(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}});var fe=v((cn,Fe)=>{"use strict";u();var ir=x("path"),He=Ne(),sr=ce(),W=new sr({max:50,maxAge:30*1e3});function or(e,t){var r;if(t=!!t,r=W.get(e+"!"+t),W.has(e))return W.get(e);try{r=t?He.sync(e,{pathExt:ir.delimiter+(process.env.PATHEXT||"")}):He.sync(e)}catch{}return W.set(e+"!"+t,r),r}Fe.exports=or});var Ge=v((hn,ze)=>{"use strict";u();function ur(){var e;return process.platform!=="win32"?!1:(e=process.version.substr(1).split(".").map(function(t){return parseInt(t,10)}),e[0]===0&&e[1]<12)}ze.exports=ur()});var he=v((vn,Ve)=>{"use strict";u();function ar(e,t){return e=""+e,t?(e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e='"'+e+'"'):e=e.replace(/([()%!^<>&|;,"'\s])/g,"^$1"),e}Ve.exports=ar});var Ye=v((gn,Xe)=>{"use strict";u();var lr=he();function cr(e){return/^[a-z0-9_-]+$/i.test(e)?e:lr(e,!0)}Xe.exports=cr});var Qe=v((mn,We)=>{"use strict";u();We.exports=/^#!.*/});var Ze=v((wn,Je)=>{"use strict";u();var fr=Qe();Je.exports=function(e){var t=e.match(fr);if(!t)return null;var r=t[0].replace(/#! ?/,"").split(" "),n=r[0].split("/").pop(),i=r[1];return n==="env"?i:n+(i?" "+i:"")}});var et=v((bn,ke)=>{"use strict";u();var pe=x("fs"),hr=ce(),pr=Ze(),ve=new hr({max:50,maxAge:30*1e3});function vr(e){var t,r,n;if(ve.has(e))return ve.get(e);t=new Buffer(150);try{r=pe.openSync(e,"r"),pe.readSync(r,t,0,150,0),pe.closeSync(r)}catch{}return n=pr(t.toString()),ve.set(e,n),n}ke.exports=vr});var st=v((_n,it)=>{"use strict";u();var Q=fe(),tt=Ge(),dr=he(),gr=Ye(),yr=et(),nt=process.platform==="win32",rt=/\.(?:com|exe)$/i,mr=parseInt(process.version.substr(1).split(".")[0],10)>=6||parseInt(process.version.substr(1).split(".")[0],10)===4&&parseInt(process.version.substr(1).split(".")[1],10)>=8;function xr(e){var t,r,n;return nt&&(e.file=Q(e.command),e.file=e.file||Q(e.command,!0),t=e.file&&yr(e.file),t?(e.args.unshift(e.file),e.command=t,r=tt||!rt.test(Q(t)||Q(t,!0))):r=tt||!rt.test(e.file),r&&(n=e.command!=="echo",e.command=gr(e.command),e.args=e.args.map(function(i){return dr(i,n)}),e.args=["/d","/s","/c",'"'+e.command+(e.args.length?" "+e.args.join(" "):"")+'"'],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0)),e}function wr(e){var t;return mr||(t=[e.command].concat(e.args).join(" "),nt?(e.command=typeof e.options.shell=="string"?e.options.shell:process.env.comspec||"cmd.exe",e.args=["/d","/s","/c",'"'+t+'"'],e.options.windowsVerbatimArguments=!0):(typeof e.options.shell=="string"?e.command=e.options.shell:process.platform==="android"?e.command="/system/bin/sh":e.command="/bin/sh",e.args=["-c",t])),e}function Er(e,t,r){var n;return t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=r||{},n={command:e,args:t,options:r,file:void 0,original:e},r.shell?wr(n):xr(n)}it.exports=Er});var ut=v((An,G)=>{"use strict";u();var J=process.platform==="win32",br=fe(),Or=process.version.indexOf("v0.10.")===0;function Z(e,t){var r;return r=new Error(t+" "+e+" ENOENT"),r.code=r.errno="ENOENT",r.syscall=t+" "+e,r}function _r(e,t){var r;J&&(r=e.emit,e.emit=function(n,i){var s;return n==="exit"&&(s=ot(i,t,"spawn"),s)?r.call(e,"error",s):r.apply(e,arguments)})}function ot(e,t){return J&&e===1&&!t.file?Z(t.original,"spawn"):null}function Sr(e,t){return J&&e===1&&!t.file||Or&&e===-1&&(t.file=J?t.file:br(t.original),!t.file)?Z(t.original,"spawnSync"):null}G.exports.hookChildProcess=_r;G.exports.verifyENOENT=ot;G.exports.verifyENOENTSync=Sr;G.exports.notFoundError=Z});var ct=v((Pn,R)=>{"use strict";u();var at=x("child_process"),ge=st(),ye=ut(),de=at.spawnSync;function lt(e,t,r){var n,i;return n=ge(e,t,r),i=at.spawn(n.command,n.args,n.options),ye.hookChildProcess(i,n),i}function Ar(e,t,r){var n,i;if(!de)try{de=x("spawn-sync")}catch{throw new Error(`In order to use spawnSync on node 0.10 or older, you must install spawn-sync:
15
-
16
- npm install spawn-sync --save`)}return n=ge(e,t,r),i=de(n.command,n.args,n.options),i.error=i.error||ye.verifyENOENTSync(i.status,n),i}R.exports=lt;R.exports.spawn=lt;R.exports.sync=Ar;R.exports._parse=ge;R.exports._enoent=ye});var ht=v((Tn,ft)=>{"use strict";u();ft.exports=function(e){var t=typeof e=="string"?`
17
- `:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}});var vt=v((Cn,pt)=>{"use strict";u();pt.exports=e=>{e=e||{};let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).find(n=>n.toUpperCase()==="PATH")||"Path"}});var gt=v((In,k)=>{"use strict";u();var V=x("path"),dt=vt();k.exports=e=>{e=Object.assign({cwd:process.cwd(),path:process.env[dt()]},e);let t,r=V.resolve(e.cwd),n=[];for(;t!==r;)n.push(V.join(r,"node_modules/.bin")),t=r,r=V.resolve(r,"..");return n.push(V.dirname(process.execPath)),n.concat(e.path).join(V.delimiter)};k.exports.env=e=>{e=Object.assign({env:process.env},e);let t=Object.assign({},e.env),r=dt({env:t});return e.path=t[r],t[r]=k.exports(e),t}});var mt=v((Mn,yt)=>{"use strict";u();var q=yt.exports=function(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"};q.writable=function(e){return q(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"};q.readable=function(e){return q(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object"};q.duplex=function(e){return q.writable(e)&&q.readable(e)};q.transform=function(e){return q.duplex(e)&&typeof e._transform=="function"&&typeof e._transformState=="object"}});var wt=v((Bn,xt)=>{"use strict";u();var jr=x("stream").PassThrough;xt.exports=e=>{e=Object.assign({},e);let t=e.array,r=e.encoding,n=r==="buffer",i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);let s=0,a=[],o=new jr({objectMode:i});return r&&o.setEncoding(r),o.on("data",h=>{a.push(h),i?s=a.length:s+=h.length}),o.getBufferedValue=()=>t?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var Et=v((Dn,ee)=>{"use strict";u();var Pr=wt();function me(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t=Object.assign({maxBuffer:1/0},t);let r=t.maxBuffer,n,i,s=new Promise((a,o)=>{let h=l=>{l&&(l.bufferedData=n.getBufferedValue()),o(l)};n=Pr(t),e.once("error",h),e.pipe(n),n.on("data",()=>{n.getBufferedLength()>r&&o(new Error("maxBuffer exceeded"))}),n.once("error",h),n.on("end",a),i=()=>{e.unpipe&&e.unpipe(n)}});return s.then(i,i),s.then(()=>n.getBufferedValue())}ee.exports=me;ee.exports.buffer=(e,t)=>me(e,Object.assign({},t,{encoding:"buffer"}));ee.exports.array=(e,t)=>me(e,Object.assign({},t,{array:!0}))});var Ot=v((Hn,bt)=>{"use strict";u();bt.exports=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))});var St=v((zn,xe)=>{"use strict";u();var te;try{if(te=process.binding("uv"),typeof te.errname!="function")throw new TypeError("uv.errname is not a function")}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e),te=null}function _t(e,t){if(e)return e.errname(t);if(!(t<0))throw new Error("err >= 0");return`Unknown system error ${t}`}xe.exports=e=>_t(te,e);xe.exports.__test__=_t});var jt=v((Vn,At)=>{"use strict";u();var X=["stdin","stdout","stderr"],qr=e=>X.some(t=>!!e[t]);At.exports=e=>{if(!e)return null;if(e.stdio&&qr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${X.map(i=>`\`${i}\``).join(", ")}`);if(typeof e.stdio=="string")return e.stdio;let t=e.stdio||[];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=[],n=Math.max(t.length,X.length);for(let i=0;i<n;i++){let s=null;t[i]!==void 0?s=t[i]:e[X[i]]!==void 0&&(s=e[X[i]]),r[i]=s}return r}});var Rt=v((Yn,E)=>{"use strict";u();var Tr=x("path"),Tt=x("child_process"),Nr=x("util"),Nt=ct(),Cr=ht(),$r=gt(),Ct=mt(),Pt=Et(),Ir=Ot(),Lr=Ft(),Mr=St(),Rr=jt(),Br=1e3*1e3*10;function $t(e,t,r){let n;return r=Object.assign({extendEnv:!0,env:{}},r),r.extendEnv&&(r.env=Object.assign({},process.env,r.env)),r.__winShell===!0?(delete r.__winShell,n={command:e,args:t,options:r,file:e,original:e}):n=Nt._parse(e,t,r),r=Object.assign({maxBuffer:Br,stripEof:!0,preferLocal:!0,localDir:n.options.cwd||process.cwd(),encoding:"utf8",reject:!0,cleanup:!0},n.options),r.stdio=Rr(r),r.preferLocal&&(r.env=$r.env(Object.assign({},r,{cwd:r.localDir}))),r.detached&&(r.cleanup=!1),process.platform==="win32"&&Tr.basename(n.command)==="cmd.exe"&&n.args.unshift("/q"),{cmd:n.command,args:n.args,opts:r,parsed:n}}function Ur(e,t){let r=t.input;r!=null&&(Ct(r)?r.pipe(e.stdin):e.stdin.end(r))}function re(e,t){return t&&e.stripEof&&(t=Cr(t)),t}function It(e,t,r){let n="/bin/sh",i=["-c",t];return r=Object.assign({},r),process.platform==="win32"&&(r.__winShell=!0,n=process.env.comspec||"cmd.exe",i=["/s","/c",`"${t}"`],r.windowsVerbatimArguments=!0),r.shell&&(n=r.shell,delete r.shell),e(n,i,r)}function qt(e,t,r,n){if(!e[t])return null;let i;return r?i=Pt(e[t],{encoding:r,maxBuffer:n}):i=Pt.buffer(e[t],{maxBuffer:n}),i.catch(s=>{throw s.stream=t,s.message=`${t} ${s.message}`,s})}function Lt(e,t){let r=e.stdout,n=e.stderr,i=e.error,s=e.code,a=e.signal,o=t.parsed,h=t.joinedCmd,l=t.timedOut||!1;if(!i){let c="";Array.isArray(o.opts.stdio)?(o.opts.stdio[2]!=="inherit"&&(c+=c.length>0?n:`
18
- ${n}`),o.opts.stdio[1]!=="inherit"&&(c+=`
19
- ${r}`)):o.opts.stdio!=="inherit"&&(c=`
20
- ${n}${r}`),i=new Error(`Command failed: ${h}${c}`),i.code=s<0?Mr(s):s}return i.stdout=r,i.stderr=n,i.failed=!0,i.signal=a||null,i.cmd=h,i.timedOut=l,i}function Mt(e,t){let r=e;return Array.isArray(t)&&t.length>0&&(r+=" "+t.join(" ")),r}E.exports=(e,t,r)=>{let n=$t(e,t,r),i=n.opts.encoding,s=n.opts.maxBuffer,a=Mt(e,t),o;try{o=Tt.spawn(n.cmd,n.args,n.opts)}catch(m){return Promise.reject(m)}let h;n.opts.cleanup&&(h=Lr(()=>{o.kill()}));let l=null,c=!1,f=()=>{l&&(clearTimeout(l),l=null)};n.opts.timeout>0&&(l=setTimeout(()=>{l=null,c=!0,o.kill(n.opts.killSignal)},n.opts.timeout));let b=new Promise(m=>{o.on("exit",(g,T)=>{f(),m({code:g,signal:T})}),o.on("error",g=>{f(),m({error:g})}),o.stdin&&o.stdin.on("error",g=>{f(),m({error:g})})});function $(){o.stdout&&o.stdout.destroy(),o.stderr&&o.stderr.destroy()}let A=()=>Ir(Promise.all([b,qt(o,"stdout",i,s),qt(o,"stderr",i,s)]).then(m=>{let g=m[0];if(g.stdout=m[1],g.stderr=m[2],h&&h(),g.error||g.code!==0||g.signal!==null){let T=Lt(g,{joinedCmd:a,parsed:n,timedOut:c});if(T.killed=T.killed||o.killed,!n.opts.reject)return T;throw T}return{stdout:re(n.opts,g.stdout),stderr:re(n.opts,g.stderr),code:0,failed:!1,killed:!1,signal:null,cmd:a,timedOut:!1}}),$);return Nt._enoent.hookChildProcess(o,n.parsed),Ur(o,n.opts),o.then=(m,g)=>A().then(m,g),o.catch=m=>A().catch(m),o};E.exports.stdout=function(){return E.exports.apply(null,arguments).then(e=>e.stdout)};E.exports.stderr=function(){return E.exports.apply(null,arguments).then(e=>e.stderr)};E.exports.shell=(e,t)=>It(E.exports,e,t);E.exports.sync=(e,t,r)=>{let n=$t(e,t,r),i=Mt(e,t);if(Ct(n.opts.input))throw new TypeError("The `input` option cannot be a stream in sync mode");let s=Tt.spawnSync(n.cmd,n.args,n.opts);if(s.code=s.status,s.error||s.status!==0||s.signal!==null){let a=Lt(s,{joinedCmd:i,parsed:n});if(!n.opts.reject)return a;throw a}return{stdout:re(n.opts,s.stdout),stderr:re(n.opts,s.stderr),code:0,failed:!1,signal:null,cmd:i,timedOut:!1}};E.exports.shellSync=(e,t)=>It(E.exports.sync,e,t);E.exports.spawn=Nr.deprecate(E.exports,"execa.spawn() is deprecated. Use execa() instead.")});var Dt=v((Qn,se)=>{"use strict";u();var ne=Rt(),Dr=()=>ne.stdout("netstat",["-anv","-p","tcp"]).then(e=>Promise.all([e,ne.stdout("netstat",["-anv","-p","udp"])])).then(e=>e.join(`
21
- `)),Kr=()=>ne.stdout("ss",["-tunlp"]),Hr=()=>ne.stdout("netstat",["-ano"]),Fr=process.platform==="darwin"?Dr:process.platform==="linux"?Kr:Hr,ie=process.platform==="darwin"?[3,8]:process.platform==="linux"?[4,6]:[1,4],zr=e=>/^\s*(tcp|udp)/i.test(e),Bt=e=>{if(typeof e!="string")return null;let t=e.match(/(?:^|",|",pid=)(\d+)/);return t?parseInt(t[1],10):null},Ut=(e,t)=>{let r=new RegExp(`[.:]${e}$`),n=t.find(i=>r.test(i[ie[0]]));if(!n)throw new Error(`Couldn't find a process with port \`${e}\``);return Bt(n[ie[1]])},we=()=>Fr().then(e=>e.split(`
22
- `).reduce((t,r)=>(zr(r)&&t.push(r.match(/\S+/g)||[]),t),[]));se.exports=e=>typeof e!="number"?Promise.reject(new TypeError(`Expected a number, got ${typeof e}`)):we().then(t=>Ut(e,t));se.exports.all=e=>Array.isArray(e)?we().then(t=>Promise.all(e.map(r=>[r,Ut(r,t)]))).then(t=>new Map(t)):Promise.reject(new TypeError(`Expected an array, got ${typeof e}`));se.exports.list=()=>we().then(e=>{let t=new Map;for(let r of e){let n=r[ie[0]].match(/[^]*[.:](\d+)$/);n&&t.set(parseInt(n[1],10),Bt(r[ie[1]]))}return t})});var Kt=v(B=>{"use strict";u();var Ee=B&&B.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function h(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):i(c.value).then(o,h)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(B,"__esModule",{value:!0});B.Killer=void 0;var Y=x("child_process"),Gr=x("os"),Vr=Dt(),be=class{constructor(t){this.ports=t}kill(t){return Ee(this,void 0,void 0,function*(){let r=Gr.platform()==="win32"?this.win32Kill:this.unixKill,n=this.ports.map(i=>r(i,t.signal));return Promise.all(n)})}win32Kill(t,r){return Ee(this,void 0,void 0,function*(){let n=yield Vr(t).catch(i=>console.error("Failed to get pid of port",t,i));if(n)return new Promise((i,s)=>{let a=Y.spawn("TASKKILL",["/f","/t","/pid",n.toString()]);a.stdout.on("data",o=>console.log(o.toString())),a.stderr.on("data",o=>console.error(o.toString())),a.on("close",(o,h)=>{if(o!==0)return s(`taskkill process exited with code ${o} and signal ${h}`);i(void 0)}),a.on("error",o=>s(o))})})}unixKill(t,r){return Ee(this,void 0,void 0,function*(){let n={SIGKILL:"-9",SIGTERM:"-15"}[r];return new Promise((i,s)=>{let a=Y.spawn("lsof",["-i",`tcp:${t}`]),o=Y.spawn("grep",["LISTEN"]),h=Y.spawn("awk",["{print $2}"]),l=Y.spawn("xargs",["kill",n]);a.stdout.pipe(o.stdin),a.stderr.on("data",c("lsof")),o.stdout.pipe(h.stdin),o.stderr.on("data",c("grep")),h.stdout.pipe(l.stdin),h.stderr.on("data",c("awk")),l.stdout.pipe(process.stdin),l.stderr.on("data",c("xargs")),l.on("close",f=>{if(f!==0)return s();i(void 0)});function c(f){return b=>console.error(`${f} - ${b.toString()}`)}})})}};B.Killer=be});var Qr=v(U=>{u();var Xr=U&&U.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function h(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):i(c.value).then(o,h)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(U,"__esModule",{value:!0});U.killPortProcess=void 0;var Oe=_e(),Yr=Kt();function Wr(e,t={}){return Xr(this,void 0,void 0,function*(){if(Oe.isNullOrUndefined(e))throw new Error("No ports found in input");let r=Oe.mergeOptions(t),n=a=>Number(a),i=Oe.arrayifyInput(e).map(n);yield new Yr.Killer(i).kill({signal:r.signal})})}U.killPortProcess=Wr});export default Qr();