@shopify/create-hydrogen 5.0.23 → 5.0.24

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 S_}from"./chunk-PMDMUCNY.js";import{$ as E3e,A as fie,Aa as xie,B as die,Ba as Jfe,C as h3e,Ca as U3e,D as Vfe,Da as V3e,E as Fl,Ea as zfe,F as _3e,Fa as x9,G as hie,Ga as bie,H as m3e,Ha as H3e,I as g3e,Ia as K3e,J as y3e,Ja as Die,K as tm,Ka as G3e,L as Hfe,M as bg,N as lY,Na as J3e,O as f1,P as v3e,Q as d1,R as mS,S as F1,T as Tw,U as pY,V as RM,W as _ie,X as Sf,Y as b3e,Z as mie,_ as D3e,a as uY,aa as C3e,b as el,ba as A3e,c as n_,ca as gie,d as LD,da as S3e,e as A_,ea as yie,f as BM,fa as w3e,g as uie,ga as T3e,h as a3e,ha as k3e,i as cie,ia as F3e,j as o3e,ja as P3e,k as lie,ka as vie,l as u3e,la as O3e,m as cY,ma as N3e,n as c3e,na as I3e,o as ME,oa as B3e,p as l3e,pa as fY,q as p3e,qa as i_,r as pie,ra as L3e,s as f3e,sa as dY,t as Lx,ta as R3e,u as LM,ua as j3e,v as Jy,va as M3e,w as d3e,wa as q3e,x as Ufe,xa as Kfe,y as RD,ya as $3e,z as qE,za as Gfe}from"./chunk-NIHY2BIB.js";import{a as aAr}from"./chunk-FB327AH7.js";import"./chunk-VMIOG46Y.js";import{f as x3e}from"./chunk-3LZ6M5C2.js";import"./chunk-EO6F7WJJ.js";import"./chunk-D7CI46F7.js";import"./chunk-UASQ33JG.js";import"./chunk-MZPD7BFF.js";import{a as qu,c as n0,e as xg,g as __dirname,h as __filename,i as gi}from"./chunk-MNT4XW23.js";var W3e=n0((zjr,z3e)=>{"use strict";gi();var b9=class s extends Error{constructor(a,o,p){super("[ParserError] "+a,o,p),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,s)}},Eie=class{constructor(a){this.parser=a,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},hY=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 Eie(this.parseStart)}parse(a){if(a.length===0||a.length==null)return;this._buf=String(a),this.ii=-1,this.char=-1;let o;for(;o===!1||this.nextChar();)o=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 a;do a=this.state.parser,this.runOne();while(this.state.parser!==a);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(a){if(typeof a!="function")throw new b9("Tried to set state to non-existent state: "+JSON.stringify(a));this.state.parser=a}goto(a){return this.next(a),this.runOne()}call(a,o){o&&this.next(o),this.stack.push(this.state),this.state=new Eie(a)}callNow(a,o){return this.call(a,o),this.runOne()}return(a){if(this.stack.length===0)throw this.error(new b9("Stack underflow"));a===void 0&&(a=this.state.buf),this.state=this.stack.pop(),this.state.returned=a}returnNow(a){return this.return(a),this.runOne()}consume(){if(this.char===1114112)throw this.error(new b9("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(a){return a.line=this.line,a.col=this.col,a.pos=this.pos,a}parseStart(){throw new b9("Must declare a parseStart method")}};hY.END=1114112;hY.Error=b9;z3e.exports=hY});var X3e=n0((Yjr,Y3e)=>{"use strict";gi();Y3e.exports=s=>{let a=new Date(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var Cie=n0((Qjr,Q3e)=>{"use strict";gi();Q3e.exports=(s,a)=>{for(a=String(a);a.length<s;)a="0"+a;return a}});var eCe=n0((eMr,Z3e)=>{"use strict";gi();var jM=Cie(),Wfe=class extends Date{constructor(a){super(a+"Z"),this.isFloating=!0}toISOString(){let a=`${this.getUTCFullYear()}-${jM(2,this.getUTCMonth()+1)}-${jM(2,this.getUTCDate())}`,o=`${jM(2,this.getUTCHours())}:${jM(2,this.getUTCMinutes())}:${jM(2,this.getUTCSeconds())}.${jM(3,this.getUTCMilliseconds())}`;return`${a}T${o}`}};Z3e.exports=s=>{let a=new Wfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var nCe=n0((rMr,rCe)=>{"use strict";gi();var tCe=Cie(),oAr=global.Date,Yfe=class extends oAr{constructor(a){super(a),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${tCe(2,this.getUTCMonth()+1)}-${tCe(2,this.getUTCDate())}`}};rCe.exports=s=>{let a=new Yfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var sCe=n0((iMr,iCe)=>{"use strict";gi();var Aie=Cie(),Xfe=class extends Date{constructor(a){super(`0000-01-01T${a}Z`),this.isTime=!0}toISOString(){return`${Aie(2,this.getUTCHours())}:${Aie(2,this.getUTCMinutes())}:${Aie(2,this.getUTCSeconds())}.${Aie(3,this.getUTCMilliseconds())}`}};iCe.exports=s=>{let a=new Xfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var Sie=n0((exports,module)=>{"use strict";gi();module.exports=makeParserClass(W3e());module.exports.makeParserClass=makeParserClass;var TomlError=class s extends Error{constructor(a){super(a),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,s),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=s=>{let a=new TomlError(s.message);return a.code=s.code,a.wrapped=s,a};module.exports.TomlError=TomlError;var createDateTime=X3e(),createDateTimeFloat=eCe(),createDate=nCe(),createTime=sCe(),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 S_}from"./chunk-PMDMUCNY.js";import{$ as E3e,A as fie,Aa as xie,B as die,Ba as Jfe,C as h3e,Ca as U3e,D as Vfe,Da as V3e,E as Fl,Ea as zfe,F as _3e,Fa as x9,G as hie,Ga as bie,H as m3e,Ha as H3e,I as g3e,Ia as K3e,J as y3e,Ja as Die,K as tm,Ka as G3e,L as Hfe,M as bg,N as lY,Na as J3e,O as f1,P as v3e,Q as d1,R as mS,S as F1,T as Tw,U as pY,V as RM,W as _ie,X as Sf,Y as b3e,Z as mie,_ as D3e,a as uY,aa as C3e,b as el,ba as A3e,c as n_,ca as gie,d as LD,da as S3e,e as A_,ea as yie,f as BM,fa as w3e,g as uie,ga as T3e,h as a3e,ha as k3e,i as cie,ia as F3e,j as o3e,ja as P3e,k as lie,ka as vie,l as u3e,la as O3e,m as cY,ma as N3e,n as c3e,na as I3e,o as ME,oa as B3e,p as l3e,pa as fY,q as p3e,qa as i_,r as pie,ra as L3e,s as f3e,sa as dY,t as Lx,ta as R3e,u as LM,ua as j3e,v as Jy,va as M3e,w as d3e,wa as q3e,x as Ufe,xa as Kfe,y as RD,ya as $3e,z as qE,za as Gfe}from"./chunk-QUKX7CP5.js";import{a as aAr}from"./chunk-FB327AH7.js";import"./chunk-VMIOG46Y.js";import{f as x3e}from"./chunk-3LZ6M5C2.js";import"./chunk-EO6F7WJJ.js";import"./chunk-D7CI46F7.js";import"./chunk-UASQ33JG.js";import"./chunk-MZPD7BFF.js";import{a as qu,c as n0,e as xg,g as __dirname,h as __filename,i as gi}from"./chunk-MNT4XW23.js";var W3e=n0((zjr,z3e)=>{"use strict";gi();var b9=class s extends Error{constructor(a,o,p){super("[ParserError] "+a,o,p),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,s)}},Eie=class{constructor(a){this.parser=a,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},hY=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 Eie(this.parseStart)}parse(a){if(a.length===0||a.length==null)return;this._buf=String(a),this.ii=-1,this.char=-1;let o;for(;o===!1||this.nextChar();)o=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 a;do a=this.state.parser,this.runOne();while(this.state.parser!==a);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(a){if(typeof a!="function")throw new b9("Tried to set state to non-existent state: "+JSON.stringify(a));this.state.parser=a}goto(a){return this.next(a),this.runOne()}call(a,o){o&&this.next(o),this.stack.push(this.state),this.state=new Eie(a)}callNow(a,o){return this.call(a,o),this.runOne()}return(a){if(this.stack.length===0)throw this.error(new b9("Stack underflow"));a===void 0&&(a=this.state.buf),this.state=this.stack.pop(),this.state.returned=a}returnNow(a){return this.return(a),this.runOne()}consume(){if(this.char===1114112)throw this.error(new b9("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(a){return a.line=this.line,a.col=this.col,a.pos=this.pos,a}parseStart(){throw new b9("Must declare a parseStart method")}};hY.END=1114112;hY.Error=b9;z3e.exports=hY});var X3e=n0((Yjr,Y3e)=>{"use strict";gi();Y3e.exports=s=>{let a=new Date(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var Cie=n0((Qjr,Q3e)=>{"use strict";gi();Q3e.exports=(s,a)=>{for(a=String(a);a.length<s;)a="0"+a;return a}});var eCe=n0((eMr,Z3e)=>{"use strict";gi();var jM=Cie(),Wfe=class extends Date{constructor(a){super(a+"Z"),this.isFloating=!0}toISOString(){let a=`${this.getUTCFullYear()}-${jM(2,this.getUTCMonth()+1)}-${jM(2,this.getUTCDate())}`,o=`${jM(2,this.getUTCHours())}:${jM(2,this.getUTCMinutes())}:${jM(2,this.getUTCSeconds())}.${jM(3,this.getUTCMilliseconds())}`;return`${a}T${o}`}};Z3e.exports=s=>{let a=new Wfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var nCe=n0((rMr,rCe)=>{"use strict";gi();var tCe=Cie(),oAr=global.Date,Yfe=class extends oAr{constructor(a){super(a),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${tCe(2,this.getUTCMonth()+1)}-${tCe(2,this.getUTCDate())}`}};rCe.exports=s=>{let a=new Yfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var sCe=n0((iMr,iCe)=>{"use strict";gi();var Aie=Cie(),Xfe=class extends Date{constructor(a){super(`0000-01-01T${a}Z`),this.isTime=!0}toISOString(){return`${Aie(2,this.getUTCHours())}:${Aie(2,this.getUTCMinutes())}:${Aie(2,this.getUTCSeconds())}.${Aie(3,this.getUTCMilliseconds())}`}};iCe.exports=s=>{let a=new Xfe(s);if(isNaN(a))throw new TypeError("Invalid Datetime");return a}});var Sie=n0((exports,module)=>{"use strict";gi();module.exports=makeParserClass(W3e());module.exports.makeParserClass=makeParserClass;var TomlError=class s extends Error{constructor(a){super(a),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,s),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=s=>{let a=new TomlError(s.message);return a.code=s.code,a.wrapped=s,a};module.exports.TomlError=TomlError;var createDateTime=X3e(),createDateTimeFloat=eCe(),createDate=nCe(),createTime=sCe(),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(s){return s>=CHAR_0&&s<=CHAR_9}function isHexit(s){return s>=CHAR_A&&s<=CHAR_F||s>=CHAR_a&&s<=CHAR_f||s>=CHAR_0&&s<=CHAR_9}function isBit(s){return s===CHAR_1||s===CHAR_0}function isOctit(s){return s>=CHAR_0&&s<=CHAR_7}function isAlphaNumQuoteHyphen(s){return s>=CHAR_A&&s<=CHAR_Z||s>=CHAR_a&&s<=CHAR_z||s>=CHAR_0&&s<=CHAR_9||s===CHAR_APOS||s===CHAR_QUOT||s===CHAR_LOWBAR||s===CHAR_HYPHEN}function isAlphaNumHyphen(s){return s>=CHAR_A&&s<=CHAR_Z||s>=CHAR_a&&s<=CHAR_z||s>=CHAR_0&&s<=CHAR_9||s===CHAR_LOWBAR||s===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(s,a){return hasOwnProperty.call(s,a)?!0:(a==="__proto__"&&defineProperty(s,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(s){return s===null||typeof s!="object"?!1:s[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(s){return s===null||typeof s!="object"?!1:s[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(s){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:s}})}function isInlineList(s){return s===null||typeof s!="object"?!1:s[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(s){return s===null||typeof s!="object"?!1:s[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(s){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(a){try{this.value=global.BigInt.asIntN(64,a)}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(s){let a=Number(s);return Object.is(a,-0)&&(a=0),global.BigInt&&!Number.isSafeInteger(a)?new BoxedBigInt(s):Object.defineProperties(new Number(a),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${s}]`}})}function isInteger(s){return s===null||typeof s!="object"?!1:s[_type]===INTEGER}var FLOAT=Symbol("float");function Float(s){return Object.defineProperties(new Number(s),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${s}]`}})}function isFloat(s){return s===null||typeof s!="object"?!1:s[_type]===FLOAT}function tomlType(s){let a=typeof s;if(a==="object"){if(s===null)return"null";if(s instanceof Date)return"datetime";if(_type in s)switch(s[_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 a}function makeParserClass(s){class a extends s{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===s.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===s.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===s.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(p){let d=this.ctx,h=p.key.pop();for(let g of p.key){if(hasKey(d,g)&&(!isTable(d[g])||d[g][_declared]))throw this.error(new TomlError("Can't redefine existing key"));d=d[g]=d[g]||Table()}if(hasKey(d,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(p.value)||isFloat(p.value)?d[h]=p.value.valueOf():d[h]=p.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(p){return this.state.resultTable?this.state.resultTable.push(p):this.state.resultTable=[p],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(p){return this.returnNow({key:this.state.resultTable,value:p})}parseComment(){do if(this.char===s.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(p){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,p)&&(!isTable(this.ctx[p])||this.ctx[p][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[p]=this.ctx[p]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,p))this.ctx=this.ctx[p]=Table();else if(isTable(this.ctx[p]))this.ctx=this.ctx[p];else if(isList(this.ctx[p]))this.ctx=this.ctx[p][this.ctx[p].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(p){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,p)||(this.ctx[p]=List()),isInlineList(this.ctx[p]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[p])){let d=Table();this.ctx[p].push(d),this.ctx=d}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,p))this.ctx=this.ctx[p]=Table();else{if(isInlineList(this.ctx[p]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[p]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[p]))this.ctx=this.ctx[p][this.ctx[p].length-1];else if(isTable(this.ctx[p]))this.ctx=this.ctx[p];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(p){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===s.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(p){return this.returnNow(p)}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===s.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===s.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(p){return this.state.buf+=p,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===s.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 p="\\u00";return this.char<16&&(p+="0"),p+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${p} instead`))}recordMultiEscapeReplacement(p){return this.state.buf+=p,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(p){try{let d=parseInt(p,16);if(d>=SURROGATE_FIRST&&d<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(d))}catch(d){throw this.error(TomlError.wrap(d))}}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 p=Integer(this.state.buf);if(p.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(p)}}}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 p=Integer(this.state.buf);if(p.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(p)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let p=Integer(this.state.buf);if(p.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(p)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let p=Integer(this.state.buf);if(p.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(p)}}}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===s.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(p){if(this.state.resultArr){let d=this.state.resultArr[_contentType],h=tomlType(p);if(d!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${d} and ${h}`))}else this.state.resultArr=InlineList(tomlType(p));return isFloat(p)||isInteger(p)?this.state.resultArr.push(p.valueOf()):this.state.resultArr.push(p),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===s.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(p){let d=this.state.resultTable,h=p.key.pop();for(let g of p.key){if(hasKey(d,g)&&(!isTable(d[g])||d[g][_declared]))throw this.error(new TomlError("Can't redefine existing key"));d=d[g]=d[g]||Table()}if(hasKey(d,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(p.value)||isFloat(p.value)?d[h]=p.value.valueOf():d[h]=p.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===s.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 a}});var wie=n0((oMr,aCe)=>{"use strict";gi();aCe.exports=uAr;function uAr(s,a){if(s.pos==null||s.line==null)return s;let o=s.message;if(o+=` at row ${s.line+1}, col ${s.col+1}, pos ${s.pos}:
5
5
  `,a&&a.split){let p=a.split(/\n/),d=String(Math.min(p.length,s.line+3)).length,h=" ";for(;h.length<d;)h+=" ";for(let g=Math.max(0,s.line-1);g<Math.min(p.length,s.line+2);++g){let y=String(g+1);if(y.length<d&&(y=" "+y),s.line===g){o+=y+"> "+p[g]+`
6
6
  `,o+=h+" ";for(let v=0;v<s.col;++v)o+=" ";o+=`^
@@ -1426,7 +1426,7 @@ end
1426
1426
  `)),s.linkname&&(a+=J_e(" linkpath="+s.linkname+`
1427
1427
  `));var o=s.pax;if(o)for(var p in o)a+=J_e(" "+p+"="+o[p]+`
1428
1428
  `);return Buffer.from(a)};Dq.decodePax=function(s){for(var a={};s.length;){for(var o=0;o<s.length&&s[o]!==32;)o++;var p=parseInt(s.slice(0,o).toString(),10);if(!p)return a;var d=s.slice(o+1,p-1).toString(),h=d.indexOf("=");if(h===-1)return a;a[d.slice(0,h)]=d.slice(h+1),s=s.slice(p)}return a};Dq.encode=function(s){var a=XRr(512),o=s.name,p="";if(s.typeflag===5&&o[o.length-1]!=="/"&&(o+="/"),Buffer.byteLength(o)!==o.length)return null;for(;Buffer.byteLength(o)>100;){var d=o.indexOf("/");if(d===-1)return null;p+=p?"/"+o.slice(0,d):o.slice(0,d),o=o.slice(d+1)}return Buffer.byteLength(o)>100||Buffer.byteLength(p)>155||s.linkname&&Buffer.byteLength(s.linkname)>100?null:(a.write(o),a.write(Jw(s.mode&njr,6),100),a.write(Jw(s.uid,6),108),a.write(Jw(s.gid,6),116),a.write(Jw(s.size,11),124),a.write(Jw(s.mtime.getTime()/1e3|0,11),136),a[156]=F9e+ajr(s.type),s.linkname&&a.write(s.linkname,157),P9e.copy(a,_X),ejr.copy(a,z_e),s.uname&&a.write(s.uname,265),s.gname&&a.write(s.gname,297),a.write(Jw(s.devmajor||0,6),329),a.write(Jw(s.devminor||0,6),337),p&&a.write(p,345),a.write(Jw(N9e(a),6),148),a)};Dq.decode=function(s,a,o){var p=s[156]===0?0:s[156]-F9e,d=bq(s,0,100,a),h=zw(s,100,8),g=zw(s,108,8),y=zw(s,116,8),v=zw(s,124,12),C=zw(s,136,12),w=sjr(p),k=s[157]===0?null:bq(s,157,100,a),N=bq(s,265,32),T=bq(s,297,32),P=zw(s,329,8),q=zw(s,337,8),ee=N9e(s);if(ee===8*32)return null;if(ee!==zw(s,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(P9e.compare(s,_X,_X+6)===0)s[345]&&(d=bq(s,345,155,a)+"/"+d);else if(!(tjr.compare(s,_X,_X+6)===0&&rjr.compare(s,z_e,z_e+2)===0)){if(!o)throw new Error("Invalid tar header: unknown format.")}return p===0&&d&&d[d.length-1]==="/"&&(p=5),{name:d,mode:h,uid:g,gid:y,size:v,mtime:new Date(1e3*C),type:w,linkname:k,uname:N,gname:T,devmajor:P,devminor:q}}});var q9e=n0((hnn,M9e)=>{"use strict";gi();var B9e=qu("util"),ujr=k9e(),mX=W_e(),L9e=xq().Writable,R9e=xq().PassThrough,j9e=function(){},I9e=function(s){return s&=511,s&&512-s},cjr=function(s,a){var o=new kae(s,a);return o.end(),o},ljr=function(s,a){return a.path&&(s.name=a.path),a.linkpath&&(s.linkname=a.linkpath),a.size&&(s.size=parseInt(a.size,10)),s.pax=a,s},kae=function(s,a){this._parent=s,this.offset=a,R9e.call(this,{autoDestroy:!1})};B9e.inherits(kae,R9e);kae.prototype.destroy=function(s){this._parent.destroy(s)};var PS=function(s){if(!(this instanceof PS))return new PS(s);L9e.call(this,s),s=s||{},this._offset=0,this._buffer=ujr(),this._missing=0,this._partial=!1,this._onparse=j9e,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 a=this,o=a._buffer,p=function(){a._continue()},d=function(N){if(a._locked=!1,N)return a.destroy(N);a._stream||p()},h=function(){a._stream=null;var N=I9e(a._header.size);N?a._parse(N,g):a._parse(512,k),a._locked||p()},g=function(){a._buffer.consume(I9e(a._header.size)),a._parse(512,k),p()},y=function(){var N=a._header.size;a._paxGlobal=mX.decodePax(o.slice(0,N)),o.consume(N),h()},v=function(){var N=a._header.size;a._pax=mX.decodePax(o.slice(0,N)),a._paxGlobal&&(a._pax=Object.assign({},a._paxGlobal,a._pax)),o.consume(N),h()},C=function(){var N=a._header.size;this._gnuLongPath=mX.decodeLongPath(o.slice(0,N),s.filenameEncoding),o.consume(N),h()},w=function(){var N=a._header.size;this._gnuLongLinkPath=mX.decodeLongPath(o.slice(0,N),s.filenameEncoding),o.consume(N),h()},k=function(){var N=a._offset,T;try{T=a._header=mX.decode(o.slice(0,512),s.filenameEncoding,s.allowUnknownFormat)}catch(P){a.emit("error",P)}if(o.consume(512),!T){a._parse(512,k),p();return}if(T.type==="gnu-long-path"){a._parse(T.size,C),p();return}if(T.type==="gnu-long-link-path"){a._parse(T.size,w),p();return}if(T.type==="pax-global-header"){a._parse(T.size,y),p();return}if(T.type==="pax-header"){a._parse(T.size,v),p();return}if(a._gnuLongPath&&(T.name=a._gnuLongPath,a._gnuLongPath=null),a._gnuLongLinkPath&&(T.linkname=a._gnuLongLinkPath,a._gnuLongLinkPath=null),a._pax&&(a._header=T=ljr(T,a._pax),a._pax=null),a._locked=!0,!T.size||T.type==="directory"){a._parse(512,k),a.emit("entry",T,cjr(a,N),d);return}a._stream=new kae(a,N),a.emit("entry",T,a._stream,d),a._parse(T.size,h),p()};this._onheader=k,this._parse(512,k)};B9e.inherits(PS,L9e);PS.prototype.destroy=function(s){this._destroyed||(this._destroyed=!0,s&&this.emit("error",s),this.emit("close"),this._stream&&this._stream.emit("close"))};PS.prototype._parse=function(s,a){this._destroyed||(this._offset+=s,this._missing=s,a===this._onheader&&(this._partial=!1),this._onparse=a)};PS.prototype._continue=function(){if(!this._destroyed){var s=this._cb;this._cb=j9e,this._overflow?this._write(this._overflow,void 0,s):s()}};PS.prototype._write=function(s,a,o){if(!this._destroyed){var p=this._stream,d=this._buffer,h=this._missing;if(s.length&&(this._partial=!0),s.length<h)return this._missing-=s.length,this._overflow=null,p?p.write(s,o):(d.append(s),o());this._cb=o,this._missing=0;var g=null;s.length>h&&(g=s.slice(h),s=s.slice(0,h)),p?p.end(s):d.append(s),this._overflow=g,this._onparse()}};PS.prototype._final=function(s){if(this._partial)return this.destroy(new Error("Unexpected end of data"));s()};M9e.exports=PS});var U9e=n0((mnn,$9e)=>{"use strict";gi();$9e.exports=qu("fs").constants||qu("constants")});var J9e=n0((ynn,G9e)=>{"use strict";gi();var Eq=U9e(),V9e=Die(),Pae=S_(),pjr=Buffer.alloc,H9e=xq().Readable,Cq=xq().Writable,fjr=qu("string_decoder").StringDecoder,Fae=W_e(),djr=parseInt("755",8),hjr=parseInt("644",8),K9e=pjr(1024),X_e=function(){},Y_e=function(s,a){a&=511,a&&s.push(K9e.slice(0,512-a))};function _jr(s){switch(s&Eq.S_IFMT){case Eq.S_IFBLK:return"block-device";case Eq.S_IFCHR:return"character-device";case Eq.S_IFDIR:return"directory";case Eq.S_IFIFO:return"fifo";case Eq.S_IFLNK:return"symlink"}return"file"}var Oae=function(s){Cq.call(this),this.written=0,this._to=s,this._destroyed=!1};Pae(Oae,Cq);Oae.prototype._write=function(s,a,o){if(this.written+=s.length,this._to.push(s))return o();this._to._drain=o};Oae.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Nae=function(){Cq.call(this),this.linkname="",this._decoder=new fjr("utf-8"),this._destroyed=!1};Pae(Nae,Cq);Nae.prototype._write=function(s,a,o){this.linkname+=this._decoder.write(s),o()};Nae.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var gX=function(){Cq.call(this),this._destroyed=!1};Pae(gX,Cq);gX.prototype._write=function(s,a,o){o(new Error("No body allowed for this entry"))};gX.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var xC=function(s){if(!(this instanceof xC))return new xC(s);H9e.call(this,s),this._drain=X_e,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};Pae(xC,H9e);xC.prototype.entry=function(s,a,o){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof a=="function"&&(o=a,a=null),o||(o=X_e);var p=this;if((!s.size||s.type==="symlink")&&(s.size=0),s.type||(s.type=_jr(s.mode)),s.mode||(s.mode=s.type==="directory"?djr:hjr),s.uid||(s.uid=0),s.gid||(s.gid=0),s.mtime||(s.mtime=new Date),typeof a=="string"&&(a=Buffer.from(a)),Buffer.isBuffer(a)){s.size=a.length,this._encode(s);var d=this.push(a);return Y_e(p,s.size),d?process.nextTick(o):this._drain=o,new gX}if(s.type==="symlink"&&!s.linkname){var h=new Nae;return V9e(h,function(y){if(y)return p.destroy(),o(y);s.linkname=h.linkname,p._encode(s),o()}),h}if(this._encode(s),s.type!=="file"&&s.type!=="contiguous-file")return process.nextTick(o),new gX;var g=new Oae(this);return this._stream=g,V9e(g,function(y){if(p._stream=null,y)return p.destroy(),o(y);if(g.written!==s.size)return p.destroy(),o(new Error("size mismatch"));Y_e(p,s.size),p._finalizing&&p.finalize(),o()}),g}};xC.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(K9e),this.push(null))};xC.prototype.destroy=function(s){this._destroyed||(this._destroyed=!0,s&&this.emit("error",s),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};xC.prototype._encode=function(s){if(!s.pax){var a=Fae.encode(s);if(a){this.push(a);return}}this._encodePax(s)};xC.prototype._encodePax=function(s){var a=Fae.encodePax({name:s.name,linkname:s.linkname,pax:s.pax}),o={name:"PaxHeader",mode:s.mode,uid:s.uid,gid:s.gid,size:a.length,mtime:s.mtime,type:"pax-header",linkname:s.linkname&&"PaxHeader",uname:s.uname,gname:s.gname,devmajor:s.devmajor,devminor:s.devminor};this.push(Fae.encode(o)),this.push(a),Y_e(this,a.length),o.size=s.size,o.type=s.type,this.push(Fae.encode(o))};xC.prototype._read=function(s){var a=this._drain;this._drain=X_e,a()};G9e.exports=xC});var z9e=n0(Q_e=>{"use strict";gi();Q_e.extract=q9e();Q_e.pack=J9e()});var X9e=n0((Dnn,Y9e)=>{"use strict";gi();var mjr=x3e(),gjr=Die(),Iae;try{Iae=qu("fs")}catch{}var yX=function(){},yjr=/^v?\.0/.test(process.version),Bae=function(s){return typeof s=="function"},vjr=function(s){return!yjr||!Iae?!1:(s instanceof(Iae.ReadStream||yX)||s instanceof(Iae.WriteStream||yX))&&Bae(s.close)},xjr=function(s){return s.setHeader&&Bae(s.abort)},bjr=function(s,a,o,p){p=mjr(p);var d=!1;s.on("close",function(){d=!0}),gjr(s,{readable:a,writable:o},function(g){if(g)return p(g);d=!0,p()});var h=!1;return function(g){if(!d&&!h){if(h=!0,vjr(s))return s.close(yX);if(xjr(s))return s.abort();if(Bae(s.destroy))return s.destroy();p(g||new Error("stream was destroyed"))}}},W9e=function(s){s()},Djr=function(s,a){return s.pipe(a)},Ejr=function(){var s=Array.prototype.slice.call(arguments),a=Bae(s[s.length-1]||yX)&&s.pop()||yX;if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new Error("pump requires two streams per minimum");var o,p=s.map(function(d,h){var g=h<s.length-1,y=h>0;return bjr(d,g,y,function(v){o||(o=v),v&&p.forEach(W9e),!g&&(p.forEach(W9e),a(o))})});return s.reduce(Djr)};Y9e.exports=Ejr});var tPe=n0((Cnn,ePe)=>{"use strict";gi();var Lae=qu("path"),Q9e=qu("fs"),Z9e=parseInt("0777",8);ePe.exports=Aq.mkdirp=Aq.mkdirP=Aq;function Aq(s,a,o,p){typeof a=="function"?(o=a,a={}):(!a||typeof a!="object")&&(a={mode:a});var d=a.mode,h=a.fs||Q9e;d===void 0&&(d=Z9e&~process.umask()),p||(p=null);var g=o||function(){};s=Lae.resolve(s),h.mkdir(s,d,function(y){if(!y)return p=p||s,g(null,p);switch(y.code){case"ENOENT":Aq(Lae.dirname(s),a,function(v,C){v?g(v,C):Aq(s,a,g,C)});break;default:h.stat(s,function(v,C){v||!C.isDirectory()?g(y,p):g(null,p)});break}})}Aq.sync=function s(a,o,p){(!o||typeof o!="object")&&(o={mode:o});var d=o.mode,h=o.fs||Q9e;d===void 0&&(d=Z9e&~process.umask()),p||(p=null),a=Lae.resolve(a);try{h.mkdirSync(a,d),p=p||a}catch(y){switch(y.code){case"ENOENT":p=s(Lae.dirname(a),o,p),s(a,o,p);break;default:var g;try{g=h.statSync(a)}catch{throw y}if(!g.isDirectory())throw y;break}}return p}});var cPe=n0(tme=>{"use strict";gi();var Cjr=kFe(),nPe=z9e(),iPe=X9e(),Ajr=tPe(),sPe=qu("fs"),Hx=qu("path"),Sjr=qu("os"),vX=Sjr.platform()==="win32",xX=function(){},eme=function(s){return s},Z_e=vX?function(s){return s.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:eme,wjr=function(s,a,o,p,d,h){var g=d||["."];return function(v){if(!g.length)return v();var C=g.shift(),w=Hx.join(o,C);a.call(s,w,function(k,N){if(k)return v(k);if(!N.isDirectory())return v(null,C,N);s.readdir(w,function(T,P){if(T)return v(T);h&&P.sort();for(var q=0;q<P.length;q++)p(Hx.join(o,C,P[q]))||g.push(Hx.join(C,P[q]));v(null,C,N)})})}},aPe=function(s,a){return function(o){o.name=o.name.split("/").slice(a).join("/");var p=o.linkname;return p&&(o.type==="link"||Hx.isAbsolute(p))&&(o.linkname=p.split("/").slice(a).join("/")),s(o)}};tme.pack=function(s,a){s||(s="."),a||(a={});var o=a.fs||sPe,p=a.ignore||a.filter||xX,d=a.map||xX,h=a.mapStream||eme,g=wjr(o,a.dereference?o.stat:o.lstat,s,p,a.entries,a.sort),y=a.strict!==!1,v=typeof a.umask=="number"?~a.umask:~oPe(),C=typeof a.dmode=="number"?a.dmode:0,w=typeof a.fmode=="number"?a.fmode:0,k=a.pack||nPe.pack(),N=a.finish||xX;a.strip&&(d=aPe(d,a.strip)),a.readable&&(C|=parseInt(555,8),w|=parseInt(444,8)),a.writable&&(C|=parseInt(333,8),w|=parseInt(222,8));var T=function(ee,ne){o.readlink(Hx.join(s,ee),function($,M){if($)return k.destroy($);ne.linkname=Z_e(M),k.entry(ne,q)})},P=function(ee,ne,$){if(ee)return k.destroy(ee);if(!ne)return a.finalize!==!1&&k.finalize(),N(k);if($.isSocket())return q();var M={name:Z_e(ne),mode:($.mode|($.isDirectory()?C:w))&v,mtime:$.mtime,size:$.size,type:"file",uid:$.uid,gid:$.gid};if($.isDirectory())return M.size=0,M.type="directory",M=d(M)||M,k.entry(M,q);if($.isSymbolicLink())return M.size=0,M.type="symlink",M=d(M)||M,T(ne,M);if(M=d(M)||M,!$.isFile())return y?k.destroy(new Error("unsupported type for "+ne)):q();var B=k.entry(M,q);if(B){var J=h(o.createReadStream(Hx.join(s,ne),{start:0,end:M.size>0?M.size-1:M.size}),M);J.on("error",function(ae){B.destroy(ae)}),iPe(J,B)}},q=function(ee){if(ee)return k.destroy(ee);g(P)};return q(),k};var Tjr=function(s){return s.length?s[s.length-1]:null},kjr=function(){return process.getuid?process.getuid():-1},oPe=function(){return process.umask?process.umask():0};tme.extract=function(s,a){s||(s="."),a||(a={});var o=a.fs||sPe,p=a.ignore||a.filter||xX,d=a.map||xX,h=a.mapStream||eme,g=a.chown!==!1&&!vX&&kjr()===0,y=a.extract||nPe.extract(),v=[],C=new Date,w=typeof a.umask=="number"?~a.umask:~oPe(),k=typeof a.dmode=="number"?a.dmode:0,N=typeof a.fmode=="number"?a.fmode:0,T=a.strict!==!1;a.strip&&(d=aPe(d,a.strip)),a.readable&&(k|=parseInt(555,8),N|=parseInt(444,8)),a.writable&&(k|=parseInt(333,8),N|=parseInt(222,8));var P=function(ne,$){for(var M;(M=Tjr(v))&&ne.slice(0,M[0].length)!==M[0];)v.pop();if(!M)return $();o.utimes(M[0],C,M[1],$)},q=function(ne,$,M){if(a.utimes===!1)return M();if($.type==="directory")return o.utimes(ne,C,$.mtime,M);if($.type==="symlink")return P(ne,M);o.utimes(ne,C,$.mtime,function(B){if(B)return M(B);P(ne,M)})},ee=function(ne,$,M){var B=$.type==="symlink",J=B?o.lchmod:o.chmod,ae=B?o.lchown:o.chown;if(!J)return M();var Ee=($.mode|($.type==="directory"?k:N))&w;ae&&g?ae.call(o,ne,$.uid,$.gid,re):re(null);function re(ue){if(ue)return M(ue);if(!J)return M();J.call(o,ne,Ee,M)}};return y.on("entry",function(ne,$,M){ne=d(ne)||ne,ne.name=Z_e(ne.name);var B=Hx.join(s,Hx.join("/",ne.name));if(p(B,ne))return $.resume(),M();var J=function(ce){if(ce)return M(ce);q(B,ne,function(de){if(de)return M(de);if(vX)return M();ee(B,ne,M)})},ae=function(){if(vX)return M();o.unlink(B,function(){o.symlink(ne.linkname,B,J)})},Ee=function(){if(vX)return M();o.unlink(B,function(){var ce=Hx.join(s,Hx.join("/",ne.linkname));o.link(ce,B,function(de){if(de&&de.code==="EPERM"&&a.hardlinkAsFilesFallback)return $=o.createReadStream(ce),re();J(de)})})},re=function(){var ce=o.createWriteStream(B),de=h($,ne);ce.on("error",function(oe){de.destroy(oe)}),iPe(de,ce,function(oe){if(oe)return M(oe);ce.on("close",J)})};if(ne.type==="directory")return v.push([B,ne.mtime]),rPe(B,{fs:o,own:g,uid:ne.uid,gid:ne.gid},J);var ue=Hx.dirname(B);uPe(o,ue,Hx.join(s,"."),function(ce,de){if(ce)return M(ce);if(!de)return M(new Error(ue+" is not a valid path"));rPe(ue,{fs:o,own:g,uid:ne.uid,gid:ne.gid},function(oe){if(oe)return M(oe);switch(ne.type){case"file":return re();case"link":return Ee();case"symlink":return ae()}if(T)return M(new Error("unsupported type for "+B+" ("+ne.type+")"));$.resume(),M()})})}),a.finish&&y.on("finish",a.finish),y};function uPe(s,a,o,p){if(a===o)return p(null,!0);s.lstat(a,function(d,h){if(d&&d.code!=="ENOENT")return p(d);if(d||h.isDirectory())return uPe(s,Hx.join(a,".."),o,p);p(null,!1)})}function rPe(s,a,o){Ajr(s,{fs:a.fs},function(p,d){!p&&d&&a.own?Cjr(d,a.uid,a.gid,o):o(p)})}});var nme=n0((Xnn,mPe)=>{"use strict";gi();var Ijr=qu("fs"),Bjr=qu("os"),rme=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");global[rme]||Object.defineProperty(global,rme,{value:Ijr.realpathSync(Bjr.tmpdir())});mPe.exports=global[rme]});gi();import{join as Vjr}from"node:path";import{tmpdir as Hjr}from"node:os";gi();gi();gi();gi();var rde=xg(CCe(),1);function ACe(s){let a=s.replace(/\r\n$/g,`
1429
- `);return rde.parse(a)}async function SCe(s,a,o){let p=o?.from&&o.from!=="."?o.from:cie(),d=await mie(a,{cwd:p,type:"file"});if(!d){Jy({body:"Environment file not found."});return}let g=ACe(await d1(d)).environments;if(!g){Jy({body:["No environments found in",{command:d},{char:"."}]});return}let y=g[s];return y||Jy({body:["Environment",{command:s},"not found."]}),await u3e(()=>({environmentFlags:JSON.stringify(y)})),y}gi();gi();var nde;function wCe(){return nde||(nde={currentCommandId:""}),nde}function TCe(){return wCe().currentCommandId}function kCe(s){wCe().currentCommandId=s}var IAr="https://cdn.shopify.com/static/cli/notifications.json",FCe="Cache is empty",BAr=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function LAr(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??IAr}var RAr=i_.object({id:i_.string(),message:i_.string(),type:i_.enum(["info","warning","error"]),frequency:i_.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:i_.string(),cta:i_.object({label:i_.string(),url:i_.string().url()}).optional(),title:i_.string().optional(),minVersion:i_.string().optional(),maxVersion:i_.string().optional(),minDate:i_.string().optional(),maxDate:i_.string().optional(),commands:i_.array(i_.string()).optional(),surface:i_.string().optional()}),jAr=i_.object({notifications:i_.array(RAr)});async function PCe(s,a=process.env){try{let o=TCe();if(MAr(o,a)||S3e(a))return;let p=await $Ar(),d=UAr(p.notifications,o,s);f1(`Notifications to show: ${d.length}`),await qAr(d)}catch(o){if(o.message===FCe){f1("Notifications to show: 0 (Cache is empty)");return}if(o.message==="abort")throw new _3e;let p=`Error showing notifications: ${o.message}`;f1(p);let{sendErrorToBugsnag:d}=await import("./error-handler-O653XSNU.js");await d(p,"unexpected_error")}}function MAr(s,a=process.env){return uY(a.CI)||uY(a.SHOPIFY_UNIT_TEST)||BAr.includes(s)}async function qAr(s){s.slice(0,2).forEach(a=>{let o={headline:a.title,body:a.message.replaceAll("\\n",`
1429
+ `);return rde.parse(a)}async function SCe(s,a,o){let p=o?.from&&o.from!=="."?o.from:cie(),d=await mie(a,{cwd:p,type:"file"});if(!d){Jy({body:"Environment file not found."});return}let g=ACe(await d1(d)).environments;if(!g){Jy({body:["No environments found in",{command:d},{char:"."}]});return}let y=g[s];return y||Jy({body:["Environment",{command:s},"not found."]}),await u3e(()=>({environmentFlags:JSON.stringify(y)})),y}gi();gi();var nde;function wCe(){return nde||(nde={currentCommandId:""}),nde}function TCe(){return wCe().currentCommandId}function kCe(s){wCe().currentCommandId=s}var IAr="https://cdn.shopify.com/static/cli/notifications.json",FCe="Cache is empty",BAr=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function LAr(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??IAr}var RAr=i_.object({id:i_.string(),message:i_.string(),type:i_.enum(["info","warning","error"]),frequency:i_.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:i_.string(),cta:i_.object({label:i_.string(),url:i_.string().url()}).optional(),title:i_.string().optional(),minVersion:i_.string().optional(),maxVersion:i_.string().optional(),minDate:i_.string().optional(),maxDate:i_.string().optional(),commands:i_.array(i_.string()).optional(),surface:i_.string().optional()}),jAr=i_.object({notifications:i_.array(RAr)});async function PCe(s,a=process.env){try{let o=TCe();if(MAr(o,a)||S3e(a))return;let p=await $Ar(),d=UAr(p.notifications,o,s);f1(`Notifications to show: ${d.length}`),await qAr(d)}catch(o){if(o.message===FCe){f1("Notifications to show: 0 (Cache is empty)");return}if(o.message==="abort")throw new _3e;let p=`Error showing notifications: ${o.message}`;f1(p);let{sendErrorToBugsnag:d}=await import("./error-handler-YXM2BB34.js");await d(p,"unexpected_error")}}function MAr(s,a=process.env){return uY(a.CI)||uY(a.SHOPIFY_UNIT_TEST)||BAr.includes(s)}async function qAr(s){s.slice(0,2).forEach(a=>{let o={headline:a.title,body:a.message.replaceAll("\\n",`
1430
1430
  `),link:a.cta};switch(a.type){case"info":{Lx(o);break}case"warning":{Jy(o);break}case"error":throw d3e(o),new Error("abort")}q3e(`notification-${a.id}`,new Date().getTime().toString())})}async function $Ar(){let s=`notifications-${LAr()}`,a=Kfe(s)?.value;if(!a)throw new Error(FCe);let o=JSON.parse(a);return jAr.parse(o)}function UAr(s,a,o,p=new Date(new Date().setUTCHours(0,0,0,0)),d=yie){return s.filter(h=>VAr(h,d)).filter(h=>HAr(h,p)).filter(h=>KAr(h,a)).filter(h=>GAr(h,a,o)).filter(h=>JAr(h))}function VAr(s,a){let o=!s.minVersion||zfe(a,`>=${s.minVersion}`),p=!s.maxVersion||zfe(a,`<=${s.maxVersion}`);return o&&p}function HAr(s,a){let o=!s.minDate||new Date(s.minDate)<=a,p=!s.maxDate||new Date(s.maxDate)>=a;return o&&p}function KAr(s,a){return a===""?!0:!s.commands||s.commands.includes(a)}function GAr(s,a,o){let p=a.split(":")[0]??"all",d=s.surface??"all";return o?o.includes(d):d===p||d==="all"}function JAr(s){if(!s.frequency)return!0;let a=`notification-${s.id}`,o=Kfe(a)?.value;if(!o)return!0;switch(s.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(o)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(o)>7*24*3600*1e3}}var Pie=xg(Vfe(),1),Fie=class extends Pie.Command{static descriptionWithoutMarkdown(){return(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)')}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(a){return a.skipOclifErrorHandling=!0,await G3e(a,this.config),Pie.Errors.handle(a)}async init(){return this.exitWithTimestampWhenEnvVariablePresent(),kCe(this.id??""),E3e()||await J3e(this.config),this.showNpmFlagWarning(),await PCe(),super.init()}showNpmFlagWarning(){let a=this.constructor;Object.keys(a.flags||{}).map(d=>`npm_config_${f3e(d).replace(/^no_/,"")}`).some(d=>process.env[d]!==void 0)&&Jy({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})}exitWithTimestampWhenEnvVariablePresent(){uY(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&(lY(`
1431
1431
  SHOPIFY_CLI_TIMESTAMP_START
1432
1432
  { "timestamp": ${Date.now()} }
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
- import{Ka as a,La as b,Ma as c,Na as d,Oa as e}from"./chunk-NIHY2BIB.js";import"./chunk-FB327AH7.js";import"./chunk-VMIOG46Y.js";import"./chunk-3LZ6M5C2.js";import"./chunk-EO6F7WJJ.js";import"./chunk-D7CI46F7.js";import"./chunk-UASQ33JG.js";import"./chunk-MZPD7BFF.js";import"./chunk-MNT4XW23.js";export{e as addBugsnagMetadata,c as cleanStackFrameFilePath,a as errorHandler,d as registerCleanBugsnagErrorsFromWithinPlugins,b as sendErrorToBugsnag};
2
+ import{Ka as a,La as b,Ma as c,Na as d,Oa as e}from"./chunk-QUKX7CP5.js";import"./chunk-FB327AH7.js";import"./chunk-VMIOG46Y.js";import"./chunk-3LZ6M5C2.js";import"./chunk-EO6F7WJJ.js";import"./chunk-D7CI46F7.js";import"./chunk-UASQ33JG.js";import"./chunk-MZPD7BFF.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.23",
8
+ "version": "5.0.24",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",