shopify 3.94.0 → 3.94.1

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,4 +1,4 @@
1
- import{c as rh,i as ih,o as Iv}from"./chunk-KADPE3PY.js";import{b as Pv}from"./chunk-52KHWFYF.js";import{a as eh,b as th}from"./chunk-DBDY2YEY.js";import{I as An,Na as $l,Qa as ql,X as _l,Z as Sl,_ as Fl,b as Dl,pa as Tl,y as Al,ya as Ml}from"./chunk-7JFIBCHH.js";import{F as kl,G as Pl,J as Il,R as Jo,V as Nl,X as Rl}from"./chunk-AQOYGO3U.js";import{$a as Cn,Ad as Zl,Ba as W,Bc as Gl,Bd as ht,Da as En,Db as Hl,Dc as Lr,Eb as Ul,Ed as K,Fa as bn,Fb as Wl,Ja as zo,Jc as F,Ka as Nr,Lc as Fn,Xc as Vl,Ya as $,_c as Yl,a as gl,ad as Xl,bb as Dn,ca as xl,fa as vl,gc as zl,ha as wl,hc as Jl,ic as V,ja as El,ka as bl,nb as Ol,oc as We,qd as Kl,sc as rt,tb as wv,tc as Mr,uc as we,va as U,wb as _n,wc as Sn,wd as X,xc as ct,xd as Ql,ya as Ir,yc as lt,yd as ie}from"./chunk-DEW5QFGH.js";import{b as Ll,d as Bl,e as Go,f as Rr,g as Cv,h as Vo,i as Dv,j as Av,k as jl,l as Yo,n as Sv,o as Fv,p as Xo,q as Tv,s as Ov,t as kv}from"./chunk-SVA22NZQ.js";import{c as bv,d as ut}from"./chunk-FU2Y2M3M.js";import{c as _v}from"./chunk-QYR5VPQA.js";import{b as Ev}from"./chunk-EENHXSWU.js";import{c as N,e as G,f as Bt,h as me,i as jt,j as wn,m as yl,p as _i}from"./chunk-JBSYWYIP.js";import{a as vv,b as Cl}from"./chunk-T4M5CWAO.js";import{a as S,c as w,e as Ct,g as y}from"./chunk-VPRTJUIN.js";var lh=w((sN,ch)=>{"use strict";y();var nr=class e extends Error{constructor(t,r,i){super("[ParserError] "+t,r,i),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},On=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Fi=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 On(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let r;for(;r===!1||this.nextChar();)r=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 t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new nr("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,r){r&&this.next(r),this.stack.push(this.state),this.state=new On(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new nr("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new nr("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new nr("Must declare a parseStart method")}};Fi.END=1114112;Fi.Error=nr;ch.exports=Fi});var fh=w((aN,hh)=>{"use strict";y();hh.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var kn=w((cN,ph)=>{"use strict";y();ph.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var mh=w((hN,dh)=>{"use strict";y();var jr=kn(),ea=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${jr(2,this.getUTCMonth()+1)}-${jr(2,this.getUTCDate())}`,r=`${jr(2,this.getUTCHours())}:${jr(2,this.getUTCMinutes())}:${jr(2,this.getUTCSeconds())}.${jr(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};dh.exports=e=>{let t=new ea(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var xh=w((pN,yh)=>{"use strict";y();var gh=kn(),Hv=global.Date,ta=class extends Hv{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${gh(2,this.getUTCMonth()+1)}-${gh(2,this.getUTCDate())}`}};yh.exports=e=>{let t=new ta(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var wh=w((mN,vh)=>{"use strict";y();var Pn=kn(),ra=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Pn(2,this.getUTCHours())}:${Pn(2,this.getUTCMinutes())}:${Pn(2,this.getUTCSeconds())}.${Pn(3,this.getUTCMilliseconds())}`}};vh.exports=e=>{let t=new ra(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var In=w((exports,module)=>{"use strict";y();module.exports=makeParserClass(lh());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=fh(),createDateTimeFloat=mh(),createDate=xh(),createTime=wh(),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]:`
1
+ import{c as rh,i as ih,o as Iv}from"./chunk-KADPE3PY.js";import{b as Pv}from"./chunk-52KHWFYF.js";import{a as eh,b as th}from"./chunk-6OKIHCZG.js";import{I as An,Na as $l,Qa as ql,X as _l,Z as Sl,_ as Fl,b as Dl,pa as Tl,y as Al,ya as Ml}from"./chunk-3TG7H626.js";import{F as kl,G as Pl,J as Il,R as Jo,V as Nl,X as Rl}from"./chunk-D24XVLOA.js";import{$a as Cn,Ad as Zl,Ba as W,Bc as Gl,Bd as ht,Da as En,Db as Hl,Dc as Lr,Eb as Ul,Ed as K,Fa as bn,Fb as Wl,Ja as zo,Jc as F,Ka as Nr,Lc as Fn,Xc as Vl,Ya as $,_c as Yl,a as gl,ad as Xl,bb as Dn,ca as xl,fa as vl,gc as zl,ha as wl,hc as Jl,ic as V,ja as El,ka as bl,nb as Ol,oc as We,qd as Kl,sc as rt,tb as wv,tc as Mr,uc as we,va as U,wb as _n,wc as Sn,wd as X,xc as ct,xd as Ql,ya as Ir,yc as lt,yd as ie}from"./chunk-7FYGRWMW.js";import{b as Ll,d as Bl,e as Go,f as Rr,g as Cv,h as Vo,i as Dv,j as Av,k as jl,l as Yo,n as Sv,o as Fv,p as Xo,q as Tv,s as Ov,t as kv}from"./chunk-SVA22NZQ.js";import{c as bv,d as ut}from"./chunk-FU2Y2M3M.js";import{c as _v}from"./chunk-QYR5VPQA.js";import{b as Ev}from"./chunk-EENHXSWU.js";import{c as N,e as G,f as Bt,h as me,i as jt,j as wn,m as yl,p as _i}from"./chunk-JBSYWYIP.js";import{a as vv,b as Cl}from"./chunk-T4M5CWAO.js";import{a as S,c as w,e as Ct,g as y}from"./chunk-VPRTJUIN.js";var lh=w((sN,ch)=>{"use strict";y();var nr=class e extends Error{constructor(t,r,i){super("[ParserError] "+t,r,i),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},On=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Fi=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 On(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let r;for(;r===!1||this.nextChar();)r=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 t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new nr("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,r){r&&this.next(r),this.stack.push(this.state),this.state=new On(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new nr("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new nr("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new nr("Must declare a parseStart method")}};Fi.END=1114112;Fi.Error=nr;ch.exports=Fi});var fh=w((aN,hh)=>{"use strict";y();hh.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var kn=w((cN,ph)=>{"use strict";y();ph.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var mh=w((hN,dh)=>{"use strict";y();var jr=kn(),ea=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${jr(2,this.getUTCMonth()+1)}-${jr(2,this.getUTCDate())}`,r=`${jr(2,this.getUTCHours())}:${jr(2,this.getUTCMinutes())}:${jr(2,this.getUTCSeconds())}.${jr(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};dh.exports=e=>{let t=new ea(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var xh=w((pN,yh)=>{"use strict";y();var gh=kn(),Hv=global.Date,ta=class extends Hv{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${gh(2,this.getUTCMonth()+1)}-${gh(2,this.getUTCDate())}`}};yh.exports=e=>{let t=new ta(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var wh=w((mN,vh)=>{"use strict";y();var Pn=kn(),ra=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Pn(2,this.getUTCHours())}:${Pn(2,this.getUTCMinutes())}:${Pn(2,this.getUTCSeconds())}.${Pn(3,this.getUTCMilliseconds())}`}};vh.exports=e=>{let t=new ra(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var In=w((exports,module)=>{"use strict";y();module.exports=makeParserClass(lh());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=fh(),createDateTimeFloat=mh(),createDate=xh(),createTime=wh(),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]:`
2
2
  `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===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(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}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(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_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 t}function makeParserClass(e){class t extends e{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===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.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===e.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(i){let n=this.ctx,o=i.key.pop();for(let s of i.key){if(hasKey(n,s)&&(!isTable(n[s])||n[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));n=n[s]=n[s]||Table()}if(hasKey(n,o))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(i.value)||isFloat(i.value)?n[o]=i.value.valueOf():n[o]=i.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(i){return this.state.resultTable?this.state.resultTable.push(i):this.state.resultTable=[i],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(i){return this.returnNow({key:this.state.resultTable,value:i})}parseComment(){do if(this.char===e.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(i){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,i)&&(!isTable(this.ctx[i])||this.ctx[i][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[i]=this.ctx[i]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,i))this.ctx=this.ctx[i]=Table();else if(isTable(this.ctx[i]))this.ctx=this.ctx[i];else if(isList(this.ctx[i]))this.ctx=this.ctx[i][this.ctx[i].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(i){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,i)||(this.ctx[i]=List()),isInlineList(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[i])){let n=Table();this.ctx[i].push(n),this.ctx=n}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,i))this.ctx=this.ctx[i]=Table();else{if(isInlineList(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[i]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[i]))this.ctx=this.ctx[i][this.ctx[i].length-1];else if(isTable(this.ctx[i]))this.ctx=this.ctx[i];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(i){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.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(i){return this.returnNow(i)}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===e.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===e.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(i){return this.state.buf+=i,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===e.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 i="\\u00";return this.char<16&&(i+="0"),i+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${i} instead`))}recordMultiEscapeReplacement(i){return this.state.buf+=i,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(i){try{let n=parseInt(i,16);if(n>=SURROGATE_FIRST&&n<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(n))}catch(n){throw this.error(TomlError.wrap(n))}}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 i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}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 i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let i=Integer(this.state.buf);if(i.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(i)}}}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===e.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(i){if(this.state.resultArr){let n=this.state.resultArr[_contentType],o=tomlType(i);if(n!==o)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${n} and ${o}`))}else this.state.resultArr=InlineList(tomlType(i));return isFloat(i)||isInteger(i)?this.state.resultArr.push(i.valueOf()):this.state.resultArr.push(i),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===e.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(i){let n=this.state.resultTable,o=i.key.pop();for(let s of i.key){if(hasKey(n,s)&&(!isTable(n[s])||n[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));n=n[s]=n[s]||Table()}if(hasKey(n,o))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(i.value)||isFloat(i.value)?n[o]=i.value.valueOf():n[o]=i.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.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 t}});var Nn=w((xN,Eh)=>{"use strict";y();Eh.exports=Uv;function Uv(e,t){if(e.pos==null||e.line==null)return e;let r=e.message;if(r+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
3
3
  `,t&&t.split){let i=t.split(/\n/),n=String(Math.min(i.length,e.line+3)).length,o=" ";for(;o.length<n;)o+=" ";for(let s=Math.max(0,e.line-1);s<Math.min(i.length,e.line+2);++s){let u=String(s+1);if(u.length<n&&(u=" "+u),e.line===s){r+=u+"> "+i[s]+`
4
4
  `,r+=o+" ";for(let l=0;l<e.col;++l)r+=" ";r+=`^
@@ -1,4 +1,4 @@
1
- import{a as wh,c as Zu,d as A3}from"./chunk-PRKBO42R.js";import{F as L3,G as D1,a as Qr,b as Qt,c as b3,f as S3,g as x3,h as O3,i as x1,j as D3,k as N3,l as C3,p as R3,r as O1,s as P3}from"./chunk-AQOYGO3U.js";import{A as xH,B as OH,Bb as N1,Bd as Wi,C as f3,Cb as ec,D as DH,Db as C1,Dd as i6,E as NH,Eb as M3,Ed as Z,F as m3,Fb as R1,Fc as B3,G as CH,Gc as U3,Hc as k3,Hd as o6,I as h3,Ic as j3,J as RH,Jc as tt,K as v3,Kc as V3,L as Ih,Lc as Lt,M as y3,Mc as q3,N as E3,Nc as G3,O as PH,Oc as $3,P as _3,Pc as K3,Q as IH,Qc as tc,R as wH,Rc as H3,S as LH,T as FH,U as MH,V as g3,Vc as P1,W as T3,Yc as z3,Zc as Y3,a as b1,c as Ti,d as c3,dd as Q3,e as l3,ed as W3,f as p3,fd as Lh,g as S1,gd as J3,hd as X3,i as hH,ib as BH,id as ts,l as d3,nb as I3,nd as Z3,o as vH,od as Fh,p as yH,pd as I1,q as EH,qb as w3,r as _H,rd as e6,s as gH,sd as t6,t as TH,ud as r6,v as AH,w as bH,wd as Ke,x as SH,xd as n6,yb as F3,yd as me,zb as kH}from"./chunk-DEW5QFGH.js";import{t as UH}from"./chunk-SVA22NZQ.js";import{c as Rh,d as Ph,f as a3,g as s3,p as es,r as u3}from"./chunk-JBSYWYIP.js";import{a as oe,b as V,c as h,d as Xu,e as et,f as ue,g as l}from"./chunk-VPRTJUIN.js";var v6=h(ns=>{"use strict";l();Object.defineProperty(ns,"__esModule",{value:!0});ns.versionInfo=ns.version=void 0;var KH="16.10.0";ns.version=KH;var HH=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});ns.versionInfo=HH});var pr=h(kh=>{"use strict";l();Object.defineProperty(kh,"__esModule",{value:!0});kh.devAssert=zH;function zH(t,e){if(!!!t)throw new Error(e)}});var U1=h(jh=>{"use strict";l();Object.defineProperty(jh,"__esModule",{value:!0});jh.isPromise=YH;function YH(t){return typeof t?.then=="function"}});var $n=h(Vh=>{"use strict";l();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isObjectLike=QH;function QH(t){return typeof t=="object"&&t!==null}});var tr=h(qh=>{"use strict";l();Object.defineProperty(qh,"__esModule",{value:!0});qh.invariant=WH;function WH(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}});var k1=h(Gh=>{"use strict";l();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.getLocation=ZH;var JH=tr(),XH=/\r\n|[\n\r]/g;function ZH(t,e){let r=0,o=1;for(let a of t.body.matchAll(XH)){if(typeof a.index=="number"||(0,JH.invariant)(!1),a.index>=e)break;r=a.index+a[0].length,o+=1}return{line:o,column:e+1-r}}});var $h=h(j1=>{"use strict";l();Object.defineProperty(j1,"__esModule",{value:!0});j1.printLocation=tz;j1.printSourceLocation=E6;var ez=k1();function tz(t){return E6(t.source,(0,ez.getLocation)(t.source,t.start))}function E6(t,e){let r=t.locationOffset.column-1,o="".padStart(r)+t.body,a=e.line-1,s=t.locationOffset.line-1,i=e.line+s,n=e.line===1?r:0,u=e.column+n,c=`${t.name}:${i}:${u}
1
+ import{a as wh,c as Zu,d as A3}from"./chunk-PRKBO42R.js";import{F as L3,G as D1,a as Qr,b as Qt,c as b3,f as S3,g as x3,h as O3,i as x1,j as D3,k as N3,l as C3,p as R3,r as O1,s as P3}from"./chunk-D24XVLOA.js";import{A as xH,B as OH,Bb as N1,Bd as Wi,C as f3,Cb as ec,D as DH,Db as C1,Dd as i6,E as NH,Eb as M3,Ed as Z,F as m3,Fb as R1,Fc as B3,G as CH,Gc as U3,Hc as k3,Hd as o6,I as h3,Ic as j3,J as RH,Jc as tt,K as v3,Kc as V3,L as Ih,Lc as Lt,M as y3,Mc as q3,N as E3,Nc as G3,O as PH,Oc as $3,P as _3,Pc as K3,Q as IH,Qc as tc,R as wH,Rc as H3,S as LH,T as FH,U as MH,V as g3,Vc as P1,W as T3,Yc as z3,Zc as Y3,a as b1,c as Ti,d as c3,dd as Q3,e as l3,ed as W3,f as p3,fd as Lh,g as S1,gd as J3,hd as X3,i as hH,ib as BH,id as ts,l as d3,nb as I3,nd as Z3,o as vH,od as Fh,p as yH,pd as I1,q as EH,qb as w3,r as _H,rd as e6,s as gH,sd as t6,t as TH,ud as r6,v as AH,w as bH,wd as Ke,x as SH,xd as n6,yb as F3,yd as me,zb as kH}from"./chunk-7FYGRWMW.js";import{t as UH}from"./chunk-SVA22NZQ.js";import{c as Rh,d as Ph,f as a3,g as s3,p as es,r as u3}from"./chunk-JBSYWYIP.js";import{a as oe,b as V,c as h,d as Xu,e as et,f as ue,g as l}from"./chunk-VPRTJUIN.js";var v6=h(ns=>{"use strict";l();Object.defineProperty(ns,"__esModule",{value:!0});ns.versionInfo=ns.version=void 0;var KH="16.10.0";ns.version=KH;var HH=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});ns.versionInfo=HH});var pr=h(kh=>{"use strict";l();Object.defineProperty(kh,"__esModule",{value:!0});kh.devAssert=zH;function zH(t,e){if(!!!t)throw new Error(e)}});var U1=h(jh=>{"use strict";l();Object.defineProperty(jh,"__esModule",{value:!0});jh.isPromise=YH;function YH(t){return typeof t?.then=="function"}});var $n=h(Vh=>{"use strict";l();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isObjectLike=QH;function QH(t){return typeof t=="object"&&t!==null}});var tr=h(qh=>{"use strict";l();Object.defineProperty(qh,"__esModule",{value:!0});qh.invariant=WH;function WH(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}});var k1=h(Gh=>{"use strict";l();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.getLocation=ZH;var JH=tr(),XH=/\r\n|[\n\r]/g;function ZH(t,e){let r=0,o=1;for(let a of t.body.matchAll(XH)){if(typeof a.index=="number"||(0,JH.invariant)(!1),a.index>=e)break;r=a.index+a[0].length,o+=1}return{line:o,column:e+1-r}}});var $h=h(j1=>{"use strict";l();Object.defineProperty(j1,"__esModule",{value:!0});j1.printLocation=tz;j1.printSourceLocation=E6;var ez=k1();function tz(t){return E6(t.source,(0,ez.getLocation)(t.source,t.start))}function E6(t,e){let r=t.locationOffset.column-1,o="".padStart(r)+t.body,a=e.line-1,s=t.locationOffset.line-1,i=e.line+s,n=e.line===1?r:0,u=e.column+n,c=`${t.name}:${i}:${u}
2
2
  `,p=o.split(/\r\n|[\n\r]/g),d=p[a];if(d.length>120){let _=Math.floor(u/80),T=u%80,b=[];for(let R=0;R<d.length;R+=80)b.push(d.slice(R,R+80));return c+y6([[`${i} |`,b[0]],...b.slice(1,_+1).map(R=>["|",R]),["|","^".padStart(T)],["|",b[_+1]]])}return c+y6([[`${i-1} |`,p[a-1]],[`${i} |`,d],["|","^".padStart(u)],[`${i+1} |`,p[a+1]]])}function y6(t){let e=t.filter(([o,a])=>a!==void 0),r=Math.max(...e.map(([o])=>o.length));return e.map(([o,a])=>o.padStart(r)+(a?" "+a:"")).join(`
3
3
  `)}});var ne=h(is=>{"use strict";l();Object.defineProperty(is,"__esModule",{value:!0});is.GraphQLError=void 0;is.formatError=oz;is.printError=iz;var rz=$n(),_6=k1(),g6=$h();function nz(t){let e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}var Kh=class t extends Error{constructor(e,...r){var o,a,s;let{nodes:i,source:n,positions:u,path:c,originalError:p,extensions:d}=nz(r);super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=p??void 0,this.nodes=T6(Array.isArray(i)?i:i?[i]:void 0);let _=T6((o=this.nodes)===null||o===void 0?void 0:o.map(b=>b.loc).filter(b=>b!=null));this.source=n??(_==null||(a=_[0])===null||a===void 0?void 0:a.source),this.positions=u??_?.map(b=>b.start),this.locations=u&&n?u.map(b=>(0,_6.getLocation)(n,b)):_?.map(b=>(0,_6.getLocation)(b.source,b.start));let T=(0,rz.isObjectLike)(p?.extensions)?p?.extensions:void 0;this.extensions=(s=d??T)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),p!=null&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let r of this.nodes)r.loc&&(e+=`
4
4
 
@@ -770,14 +770,14 @@ metadata was removed`},g=le(f,null,null,{redactedPaths:Qb,redactedKeys:E})),g},E
770
770
  `).slice(3).join(`
771
771
  `)},Ja.maybeUseFallbackStack=function(f,E){var g=f.stack.split(`
772
772
  `);return(g.length===1||g.length===2&&/at Error \(native\)/.test(g[1]))&&(f.stack=g[0]+`
773
- `+E),f};var _1={},RK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=RK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},PK=Ja.getStack,IK=Ja.maybeUseFallbackStack;g1={name:"intercept",load:function(f){var E=function(g,y){g===void 0&&(g=function(){}),typeof y!="function"&&(y=g,g=function(){});var A=PK();return function(O){if(O){O.stack&&IK(O,A);var C=f.Event.create(O,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);f._notify(C,g);return}for(var j=arguments.length,K=new Array(j>1?j-1:0),_e=1;_e<j;_e++)K[_e-1]=arguments[_e];y.apply(void 0,K)}};return E}},g1.default=g1;function T1(){return T1=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},T1.apply(null,arguments)}var Ju=oe("os"),wK={load:function(f){var E={osName:Ju.platform()+" ("+Ju.arch()+")",osVersion:Ju.release(),totalMemory:Ju.totalmem(),hostname:f._config.hostname,runtimeVersions:{node:process.versions.node}};f._addOnSessionPayload(function(g){g.device=T1({},g.device,E)}),f.addOnError(function(g){g.device=T1({},g.device,E,{freeMemory:Ju.freemem(),time:new Date})},!0)}},r3=oe("path"),LK=r3.join,FK=r3.resolve,n3=function(f){return LK(FK(f),"/")},MK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){A.inProject=typeof A.file=="string"&&A.file.indexOf(g)===0&&!/\/node_modules\//.test(A.file)})}})}};function Sh(){return Sh=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Sh.apply(null,arguments)}function BK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,xh(f,E)}function xh(f,E){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},xh(f,E)}var i3=3,o3=200,UK=oe("fs"),kK=UK.createReadStream,jK=oe("stream"),VK=jK.Writable,qK=U$(),GK=j$(),$K=oe("path"),KK={load:function(f){if(f._config.sendCode){var E=function(g,y){return new Promise(function(A,O){try{if(!g.lineNumber||!g.file)return A(g);var C=$K.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);HK(C,g.lineNumber,function(K,_e){return K||(g.code=y[j]=_e),A(g)})}catch{return A(g)}})};f.addOnError(function(g){return new Promise(function(y,A){var O=Object.create(null),C=g.errors.reduce(function(j,K){return j.concat(K.stacktrace)},[]);YK(C.map(function(j){return function(){return E(j,O)}})).then(y).catch(A)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(f){return f===!0||f===!1},message:"should be true or false"}}},HK=function(f,E,g){var y=E-i3,A=E+i3,O=kK(f,{encoding:"utf8"}),C=new GK.LineStream({keepEmptyLines:!0}),j=new zK({start:y,end:A});j.on("done",function(){return O.destroy()}),qK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},zK=(function(f){function E(y){var A;return A=f.call(this,Sh({},y,{decodeStrings:!1}))||this,A._start=y.start,A._end=y.end,A._n=0,A._code={},A}BK(E,f);var g=E.prototype;return g._write=function(A,O,C){return this._n++,this._n<this._start?C(null):this._n<=this._end?(this._code[String(this._n)]=A.length<=o3?A:A.substr(0,o3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(VK),YK=function(f){return new Promise(function(E,g){var y=[];f.reduce(function(A,O){return A.then(function(C){return y.push(C),O()})},Promise.resolve()).then(function(A){y.push(A)}).then(function(){E(y.slice(1))})})},QK=Ja.maybeUseFallbackStack,Oh,WK={load:function(f){f._config.autoDetectErrors&&f._config.enabledErrorTypes.unhandledExceptions&&(Oh=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f;E.stack&&y.fallbackStack&&QK(E,y.fallbackStack);var A=y.Event.create(E,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(O){y._notify(A,function(){},function(C,j){C&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUncaughtException(E,j,y._logger),O()})})},process.prependListener("uncaughtException",Oh))},destroy:function(){process.removeListener("uncaughtException",Oh)}},A1,JK={load:function(f){!f._config.autoDetectErrors||!f._config.enabledErrorTypes.unhandledRejections||(A1=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f,A=!f._config.reportUnhandledPromiseRejectionsAsHandled,O=y.Event.create(E,!1,{severity:"error",unhandled:A,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(C){y._notify(O,function(){},function(j,K){j&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUnhandledRejection(E,K,y._logger),C()})})},process.prependListener?process.prependListener("unhandledRejection",A1):process.on("unhandledRejection",A1))},destroy:function(){process.removeListener("unhandledRejection",A1)}},XK=Dh;function Dh(f){f=f||{},this.ms=f.min||100,this.max=f.max||1e4,this.factor=f.factor||2,this.jitter=f.jitter>0&&f.jitter<=1?f.jitter:0,this.attempts=0}Dh.prototype.duration=function(){var f=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var E=Math.random(),g=Math.floor(E*this.jitter*f);f=(Math.floor(E*10)&1)==0?f-g:f+g}return Math.min(f,this.max)|0},Dh.prototype.reset=function(){this.attempts=0};function ZK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,Nh(f,E)}function Nh(f,E){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},Nh(f,E)}var eH=10*1e3,tH=oe("events").EventEmitter,rH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||eH,A._summarize=A._summarize.bind(A),A}ZK(E,f);var g=E.prototype;return g.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},g.stop=function(){clearInterval(this._interval),this._interval=null},g.track=function(A){var O=nH(A.startedAt),C=this._sessions.get(O);return this._sessions.set(O,typeof C>"u"?1:C+1),A},g._summarize=function(){var A=this,O=[];this._sessions.forEach(function(C,j){O.push({startedAt:j,sessionsStarted:C}),A._sessions.delete(j)}),O.length&&this.emit("summary",O)},E})(tH),nH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},iH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new rH(g._config.sessionSummaryInterval),E.on("summary",oH(g)),E.start()),g._session=y,g._pausedSession=null,E.track(g._session),g},pauseSession:function(g){g._pausedSession=g._session,g._session=null},resumeSession:function(g){return g._session?g:g._pausedSession?(g._session=g._pausedSession,g._pausedSession=null,g):g.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(f){return f===void 0||T()(f)},message:"should be a positive integer"}}},oH=function(f){return function(E){if(f._config.enabledReleaseStages!==null&&!f._config.enabledReleaseStages.includes(f._config.releaseStage)){f._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!E.length)return;var g=new XK({min:1e3,max:1e4}),y=10;O(A);function A(C){if(!C){var j=E.reduce(function(K,_e){return K+_e.sessionsStarted},0);return f._logger.debug(j+" session(s) reported")}if(g.attempts===10){f._logger.error("Session delivery failed, max retries exceeded",C);return}f._logger.debug("Session delivery failed, retry #"+(g.attempts+1)+"/"+y,C),setTimeout(function(){return O(A)},g.duration())}function O(C){var j={notifier:f._notifier,device:{},app:{releaseStage:f._config.releaseStage,version:f._config.appVersion,type:f._config.appType},sessionCounts:E},K=vh(f._cbs.sp,j,"onSessionPayload",f._logger);if(K)return f._logger.debug("Session not sent due to onSessionPayload callback"),C(null);f._delivery.sendSession(j,C)}}},aH={load:function(f){f.addOnError(function(E){var g=E.errors.reduce(function(y,A){return y.concat(A.stacktrace)},[]);g.forEach(function(y){typeof y.file=="string"&&(y.file=y.file.replace(/\\/g,"/"))})})}},sH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){typeof A.file=="string"&&A.file.indexOf(g)===0&&(A.file=A.file.replace(g,""))})}})}},qo={};function Ch(){return Ch=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Ch.apply(null,arguments)}var uH="Bugsnag Node",cH="8.8.0",lH="https://github.com/bugsnag/bugsnag-js",pH=oe("async_hooks"),dH=pH.AsyncLocalStorage;m1.__type="nodejs";var fH=Ch({},I.schema,xK),mH=[CK,KK,MK,sH,iH,wK,WK,JK,g1,_1,aH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,fH,mH,{name:uH,version:cH,url:lH});return Object.keys(y1.prototype).forEach(function(g){var y=E[g];E[g]=function(){var A=E._clientContext&&typeof E._clientContext.getStore=="function"?E._clientContext.getStore():null,O=A||E,C=A?A[g]:y;O._depth+=1;var j=C.apply(O,arguments);return O._depth-=1,j}}),E._clientContext=new dH,E._setDelivery(TK),E._logger.debug("Loaded!"),E},start:function(f){return _n._client?(_n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),_n._client):(_n._client=_n.createClient(f),_n._client)},isStarted:function(){return _n._client!=null}};return Object.keys(y1.prototype).forEach(function(f){/^_/.test(f)||(_n[f]=function(){var E=_n._client,g=E&&E._clientContext&&E._clientContext.getStore();if(g&&(E=g),!E)return console.error("Bugsnag."+f+"() was called before Bugsnag.start()");E._depth+=1;var y=E[f].apply(E,arguments);return E._depth-=1,y})}),qo=_n,qo.Client=y1,qo.Event=m1,qo.Session=_h,qo.Breadcrumb=a,qo.default=_n,qo})});var $$=h((gQe,G$)=>{l();G$.exports=q$()});l();l();l();l();l();l();import w1 from"crypto";function a6(t){return w1.createHash("sha1").update(t).digest("hex")}function $4e(t){return w1.createHash("md5").update(t).digest("hex")}function K4e(){return w1.randomUUID()}function Wr(t){return w1.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g,""),"hex")).update(t).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function Ji(){return process.env}function Go(){let t=Ji();return t[Ti.appAutomationToken]??t[Ti.partnersToken]}function X4e(){let t=Ji()[c3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function s6(){let t=Ji()[Ti.identityToken],e=Ji()[Ti.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function Z4e(t=Ji()){return u3()||b1(t[Ti.json])}function u6(){return b1(Ji()[Ti.neverUsePartnersApi])}function c6(t=Ji()){return b1(t[Ti.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ti.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();var jH=["access_token","refresh_token","id_token","subject_token","actor_token","device_code","client_secret","code","token"];function rs(t){let e=new URL(t);for(let r of jH)e.searchParams.has(r)&&e.searchParams.set(r,"****");return e.toString()}l();l();var Xi="3.94.0";import VH from"https";var Bh=class extends tt{constructor(e,r){let o=r===403?"Ensure you are using the correct account. You can switch with `shopify auth login`":void 0;super(e,o),this.statusCode=r}},L1=class extends Bh{constructor(e,r,o){super(e,r),this.errors=o,this.stack=void 0}};function Zi(t){let e={},r=["token","authorization","subject_token"];return Object.keys(t).forEach(o=>{r.find(a=>o.toLocaleLowerCase().includes(a))===void 0&&(e[o]=t[o])}),Object.keys(e).map(o=>` - ${o}: ${e[o]}`).join(`
773
+ `+E),f};var _1={},RK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=RK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},PK=Ja.getStack,IK=Ja.maybeUseFallbackStack;g1={name:"intercept",load:function(f){var E=function(g,y){g===void 0&&(g=function(){}),typeof y!="function"&&(y=g,g=function(){});var A=PK();return function(O){if(O){O.stack&&IK(O,A);var C=f.Event.create(O,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);f._notify(C,g);return}for(var j=arguments.length,K=new Array(j>1?j-1:0),_e=1;_e<j;_e++)K[_e-1]=arguments[_e];y.apply(void 0,K)}};return E}},g1.default=g1;function T1(){return T1=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},T1.apply(null,arguments)}var Ju=oe("os"),wK={load:function(f){var E={osName:Ju.platform()+" ("+Ju.arch()+")",osVersion:Ju.release(),totalMemory:Ju.totalmem(),hostname:f._config.hostname,runtimeVersions:{node:process.versions.node}};f._addOnSessionPayload(function(g){g.device=T1({},g.device,E)}),f.addOnError(function(g){g.device=T1({},g.device,E,{freeMemory:Ju.freemem(),time:new Date})},!0)}},r3=oe("path"),LK=r3.join,FK=r3.resolve,n3=function(f){return LK(FK(f),"/")},MK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){A.inProject=typeof A.file=="string"&&A.file.indexOf(g)===0&&!/\/node_modules\//.test(A.file)})}})}};function Sh(){return Sh=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Sh.apply(null,arguments)}function BK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,xh(f,E)}function xh(f,E){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},xh(f,E)}var i3=3,o3=200,UK=oe("fs"),kK=UK.createReadStream,jK=oe("stream"),VK=jK.Writable,qK=U$(),GK=j$(),$K=oe("path"),KK={load:function(f){if(f._config.sendCode){var E=function(g,y){return new Promise(function(A,O){try{if(!g.lineNumber||!g.file)return A(g);var C=$K.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);HK(C,g.lineNumber,function(K,_e){return K||(g.code=y[j]=_e),A(g)})}catch{return A(g)}})};f.addOnError(function(g){return new Promise(function(y,A){var O=Object.create(null),C=g.errors.reduce(function(j,K){return j.concat(K.stacktrace)},[]);YK(C.map(function(j){return function(){return E(j,O)}})).then(y).catch(A)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(f){return f===!0||f===!1},message:"should be true or false"}}},HK=function(f,E,g){var y=E-i3,A=E+i3,O=kK(f,{encoding:"utf8"}),C=new GK.LineStream({keepEmptyLines:!0}),j=new zK({start:y,end:A});j.on("done",function(){return O.destroy()}),qK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},zK=(function(f){function E(y){var A;return A=f.call(this,Sh({},y,{decodeStrings:!1}))||this,A._start=y.start,A._end=y.end,A._n=0,A._code={},A}BK(E,f);var g=E.prototype;return g._write=function(A,O,C){return this._n++,this._n<this._start?C(null):this._n<=this._end?(this._code[String(this._n)]=A.length<=o3?A:A.substr(0,o3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(VK),YK=function(f){return new Promise(function(E,g){var y=[];f.reduce(function(A,O){return A.then(function(C){return y.push(C),O()})},Promise.resolve()).then(function(A){y.push(A)}).then(function(){E(y.slice(1))})})},QK=Ja.maybeUseFallbackStack,Oh,WK={load:function(f){f._config.autoDetectErrors&&f._config.enabledErrorTypes.unhandledExceptions&&(Oh=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f;E.stack&&y.fallbackStack&&QK(E,y.fallbackStack);var A=y.Event.create(E,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(O){y._notify(A,function(){},function(C,j){C&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUncaughtException(E,j,y._logger),O()})})},process.prependListener("uncaughtException",Oh))},destroy:function(){process.removeListener("uncaughtException",Oh)}},A1,JK={load:function(f){!f._config.autoDetectErrors||!f._config.enabledErrorTypes.unhandledRejections||(A1=function(E){var g=f._clientContext&&f._clientContext.getStore(),y=g||f,A=!f._config.reportUnhandledPromiseRejectionsAsHandled,O=y.Event.create(E,!1,{severity:"error",unhandled:A,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(C){y._notify(O,function(){},function(j,K){j&&y._logger.error("Failed to send event to Bugsnag"),y._config.onUnhandledRejection(E,K,y._logger),C()})})},process.prependListener?process.prependListener("unhandledRejection",A1):process.on("unhandledRejection",A1))},destroy:function(){process.removeListener("unhandledRejection",A1)}},XK=Dh;function Dh(f){f=f||{},this.ms=f.min||100,this.max=f.max||1e4,this.factor=f.factor||2,this.jitter=f.jitter>0&&f.jitter<=1?f.jitter:0,this.attempts=0}Dh.prototype.duration=function(){var f=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var E=Math.random(),g=Math.floor(E*this.jitter*f);f=(Math.floor(E*10)&1)==0?f-g:f+g}return Math.min(f,this.max)|0},Dh.prototype.reset=function(){this.attempts=0};function ZK(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,Nh(f,E)}function Nh(f,E){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,y){return g.__proto__=y,g},Nh(f,E)}var eH=10*1e3,tH=oe("events").EventEmitter,rH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||eH,A._summarize=A._summarize.bind(A),A}ZK(E,f);var g=E.prototype;return g.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},g.stop=function(){clearInterval(this._interval),this._interval=null},g.track=function(A){var O=nH(A.startedAt),C=this._sessions.get(O);return this._sessions.set(O,typeof C>"u"?1:C+1),A},g._summarize=function(){var A=this,O=[];this._sessions.forEach(function(C,j){O.push({startedAt:j,sessionsStarted:C}),A._sessions.delete(j)}),O.length&&this.emit("summary",O)},E})(tH),nH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},iH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new rH(g._config.sessionSummaryInterval),E.on("summary",oH(g)),E.start()),g._session=y,g._pausedSession=null,E.track(g._session),g},pauseSession:function(g){g._pausedSession=g._session,g._session=null},resumeSession:function(g){return g._session?g:g._pausedSession?(g._session=g._pausedSession,g._pausedSession=null,g):g.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(f){return f===void 0||T()(f)},message:"should be a positive integer"}}},oH=function(f){return function(E){if(f._config.enabledReleaseStages!==null&&!f._config.enabledReleaseStages.includes(f._config.releaseStage)){f._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!E.length)return;var g=new XK({min:1e3,max:1e4}),y=10;O(A);function A(C){if(!C){var j=E.reduce(function(K,_e){return K+_e.sessionsStarted},0);return f._logger.debug(j+" session(s) reported")}if(g.attempts===10){f._logger.error("Session delivery failed, max retries exceeded",C);return}f._logger.debug("Session delivery failed, retry #"+(g.attempts+1)+"/"+y,C),setTimeout(function(){return O(A)},g.duration())}function O(C){var j={notifier:f._notifier,device:{},app:{releaseStage:f._config.releaseStage,version:f._config.appVersion,type:f._config.appType},sessionCounts:E},K=vh(f._cbs.sp,j,"onSessionPayload",f._logger);if(K)return f._logger.debug("Session not sent due to onSessionPayload callback"),C(null);f._delivery.sendSession(j,C)}}},aH={load:function(f){f.addOnError(function(E){var g=E.errors.reduce(function(y,A){return y.concat(A.stacktrace)},[]);g.forEach(function(y){typeof y.file=="string"&&(y.file=y.file.replace(/\\/g,"/"))})})}},sH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=n3(f._config.projectRoot),y=E.errors.reduce(function(A,O){return A.concat(O.stacktrace)},[]);y.map(function(A){typeof A.file=="string"&&A.file.indexOf(g)===0&&(A.file=A.file.replace(g,""))})}})}},qo={};function Ch(){return Ch=Object.assign?Object.assign.bind():function(f){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var y in g)({}).hasOwnProperty.call(g,y)&&(f[y]=g[y])}return f},Ch.apply(null,arguments)}var uH="Bugsnag Node",cH="8.8.0",lH="https://github.com/bugsnag/bugsnag-js",pH=oe("async_hooks"),dH=pH.AsyncLocalStorage;m1.__type="nodejs";var fH=Ch({},I.schema,xK),mH=[CK,KK,MK,sH,iH,wK,WK,JK,g1,_1,aH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,fH,mH,{name:uH,version:cH,url:lH});return Object.keys(y1.prototype).forEach(function(g){var y=E[g];E[g]=function(){var A=E._clientContext&&typeof E._clientContext.getStore=="function"?E._clientContext.getStore():null,O=A||E,C=A?A[g]:y;O._depth+=1;var j=C.apply(O,arguments);return O._depth-=1,j}}),E._clientContext=new dH,E._setDelivery(TK),E._logger.debug("Loaded!"),E},start:function(f){return _n._client?(_n._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),_n._client):(_n._client=_n.createClient(f),_n._client)},isStarted:function(){return _n._client!=null}};return Object.keys(y1.prototype).forEach(function(f){/^_/.test(f)||(_n[f]=function(){var E=_n._client,g=E&&E._clientContext&&E._clientContext.getStore();if(g&&(E=g),!E)return console.error("Bugsnag."+f+"() was called before Bugsnag.start()");E._depth+=1;var y=E[f].apply(E,arguments);return E._depth-=1,y})}),qo=_n,qo.Client=y1,qo.Event=m1,qo.Session=_h,qo.Breadcrumb=a,qo.default=_n,qo})});var $$=h((gQe,G$)=>{l();G$.exports=q$()});l();l();l();l();l();l();import w1 from"crypto";function a6(t){return w1.createHash("sha1").update(t).digest("hex")}function $4e(t){return w1.createHash("md5").update(t).digest("hex")}function K4e(){return w1.randomUUID()}function Wr(t){return w1.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g,""),"hex")).update(t).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function Ji(){return process.env}function Go(){let t=Ji();return t[Ti.appAutomationToken]??t[Ti.partnersToken]}function X4e(){let t=Ji()[c3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function s6(){let t=Ji()[Ti.identityToken],e=Ji()[Ti.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function Z4e(t=Ji()){return u3()||b1(t[Ti.json])}function u6(){return b1(Ji()[Ti.neverUsePartnersApi])}function c6(t=Ji()){return b1(t[Ti.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ti.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();var jH=["access_token","refresh_token","id_token","subject_token","actor_token","device_code","client_secret","code","token"];function rs(t){let e=new URL(t);for(let r of jH)e.searchParams.has(r)&&e.searchParams.set(r,"****");return e.toString()}l();l();var Xi="3.94.1";import VH from"https";var Bh=class extends tt{constructor(e,r){let o=r===403?"Ensure you are using the correct account. You can switch with `shopify auth login`":void 0;super(e,o),this.statusCode=r}},L1=class extends Bh{constructor(e,r,o){super(e,r),this.errors=o,this.stack=void 0}};function Zi(t){let e={},r=["token","authorization","subject_token"];return Object.keys(t).forEach(o=>{r.find(a=>o.toLocaleLowerCase().includes(a))===void 0&&(e[o]=t[o])}),Object.keys(e).map(o=>` - ${o}: ${e[o]}`).join(`
774
774
  `)}function Uh(t){let r={"User-Agent":`Shopify CLI; v=${Xi}`,"Keep-Alive":"timeout=30","Sec-CH-UA-PLATFORM":process.platform,"Content-Type":"application/json",...ts()&&{"X-Shopify-Cli-Employee":"1"}};if(t){let o=t.match(/^shp(at|ua|ca|tka)/)?t:`Bearer ${t}`;r.authorization=o,r["X-Shopify-Access-Token"]=o}return r}async function F1(){return new VH.Agent({rejectUnauthorized:!0,keepAlive:!0})}l();l();var qH=300,M1=1e4;function GH(t,e,r=M1/3){if(t===0)return 0;let o=2**(t-1);return Math.min(e*o,r)}async function*$H(t,e){let r=0;for(;;){let o=GH(r,e);if(!t(o))return{remainingMs:0,iterations:r};await P1(o/1e3),yield o,r++}}async function*l6(t=M1,e=qH){if(t<=0)return{remainingMs:0,iterations:0};let r=Date.now(),o=$H(i=>Date.now()-r+i<=t,e),a=0;for await(let i of o)yield i,a++;let s=Date.now()-r;return{remainingMs:t-s,iterations:a}}l();l();var B1=JSON;l();var p6=t=>t.toUpperCase(),d6=t=>{let e={};return t.forEach((r,o)=>{e[o]=r}),e};l();var f6=(t,e,r)=>t.document?t:{document:t,variables:e,requestHeaders:r,signal:void 0},m6=(t,e,r)=>t.query?t:{query:t,variables:e,requestHeaders:r,signal:void 0},h6=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};l();var nd=et(T9(),1),A9=t=>{let e,r=t.definitions.filter(o=>o.kind==="OperationDefinition");return r.length===1&&(e=r[0]?.name?.value),e},Ci=t=>{if(typeof t=="string"){let r;try{let o=(0,nd.parse)(t);r=A9(o)}catch{}return{query:t,operationName:r}}let e=A9(t);return{query:(0,nd.print)(t),operationName:e}};l();var Ar=class t extends Error{constructor(e,r){let o=`${t.extractMessage(e)}: ${JSON.stringify({response:e,request:r})}`;super(o),Object.setPrototypeOf(this,t.prototype),this.response=e,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}};var Eo=et(i8(),1);l();var ioe="connection_init",ooe="connection_ack",a8="ping",s8="pong",aoe="subscribe",soe="next",uoe="error",u8="complete",yo=class t{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(e,r,o){this._type=e,this._payload=r,this._id=o}get text(){let e={type:this.type};return this.id!=null&&this.id!=null&&(e.id=this.id),this.payload!=null&&this.payload!=null&&(e.payload=this.payload),JSON.stringify(e)}static parse(e,r){let{type:o,payload:a,id:s}=JSON.parse(e);return new t(o,r(a),s)}},Ed=class{constructor(e,{onInit:r,onAcknowledged:o,onPing:a,onPong:s}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.addEventListener("open",async i=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},e.send(loe(r?await r():null).text)}),e.addEventListener("close",i=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}}),e.addEventListener("error",i=>{console.error(i)}),e.addEventListener("message",i=>{try{let n=coe(i.data);switch(n.type){case ooe:{this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,o&&o(n.payload));return}case a8:{a?a(n.payload).then(d=>e.send(o8(d).text)):e.send(o8(null).text);return}case s8:{s&&s(n.payload);return}}if(!this.socketState.acknowledged||n.id===void 0||n.id===null||!this.socketState.subscriptions[n.id])return;let{query:u,variables:c,subscriber:p}=this.socketState.subscriptions[n.id];switch(n.type){case soe:{!n.payload.errors&&n.payload.data&&p.next&&p.next(n.payload.data),n.payload.errors&&p.error&&p.error(new Ar({...n.payload,status:200},{query:u,variables:c}));return}case uoe:{p.error&&p.error(new Ar({errors:n.payload,status:200},{query:u,variables:c}));return}case u8:{p.complete&&p.complete(),delete this.socketState.subscriptions[n.id];return}}}catch(n){console.error(n),e.close(1006)}e.close(4400,"Unknown graphql-ws message.")})}makeSubscribe(e,r,o,a){let s=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[s]={query:e,variables:a,subscriber:o},this.socket.send(doe(s,{query:e,operationName:r,variables:a}).text),()=>{this.socket.send(foe(s).text),delete this.socketState.subscriptions[s]}}rawRequest(e,r){return new Promise((o,a)=>{let s;this.rawSubscribe(e,{next:(i,n)=>s={data:i,extensions:n},error:a,complete:()=>o(s)},r)})}request(e,r){return new Promise((o,a)=>{let s;this.subscribe(e,{next:i=>s=i,error:a,complete:()=>o(s)},r)})}subscribe(e,r,o){let{query:a,operationName:s}=Ci(e);return this.makeSubscribe(a,s,r,o)}rawSubscribe(e,r,o){return this.makeSubscribe(e,void 0,r,o)}ping(e){this.socket.send(poe(e).text)}close(){this.socket.close(1e3)}};Ed.PROTOCOL="graphql-transport-ws";function coe(t,e=r=>r){return yo.parse(t,e)}function loe(t){return new yo(ioe,t)}function poe(t){return new yo(a8,t,void 0)}function o8(t){return new yo(s8,t,void 0)}function doe(t,e){return new yo(aoe,e,t)}function foe(t){return new yo(u8,void 0,t)}var Rs=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||Eo&&Eo.Headers&&t instanceof Eo.Headers?e=d6(t):Array.isArray(t)?t.forEach(([r,o])=>{r&&o!==void 0&&(e[r]=o)}):e=t),e},c8=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),moe=t=>{if(!Array.isArray(t.query)){let o=t,a=[`query=${encodeURIComponent(c8(o.query))}`];return t.variables&&a.push(`variables=${encodeURIComponent(o.jsonSerializer.stringify(o.variables))}`),o.operationName&&a.push(`operationName=${encodeURIComponent(o.operationName)}`),a.join("&")}if(typeof t.variables<"u"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");let e=t,r=t.query.reduce((o,a,s)=>(o.push({query:c8(a),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),o),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(r))}`},hoe=t=>async e=>{let{url:r,query:o,variables:a,operationName:s,fetch:i,fetchOptions:n,middleware:u}=e,c={...e.headers},p="",d;t==="POST"?(d=voe(o,a,s,n.jsonSerializer),typeof d=="string"&&(c["Content-Type"]="application/json")):p=moe({query:o,variables:a,operationName:s,jsonSerializer:n.jsonSerializer??B1});let _={method:t,headers:c,body:d,...n},T=r,b=_;if(u){let R=await Promise.resolve(u({..._,url:r,operationName:s,variables:a})),{url:I,...B}=R;T=I,b=B}return p&&(T=`${T}?${p}`),await i(T,b)},_d=class{constructor(e,r={}){this.url=e,this.requestConfig=r,this.rawRequest=async(...o)=>{let[a,s,i]=o,n=m6(a,s,i),{headers:u,fetch:c=Eo.default,method:p="POST",requestMiddleware:d,responseMiddleware:_,...T}=this.requestConfig,{url:b}=this;n.signal!==void 0&&(T.signal=n.signal);let{operationName:R}=Ci(n.query);return t_({url:b,query:n.query,variables:n.variables,headers:{...Rs(r_(u)),...Rs(n.requestHeaders)},operationName:R,fetch:c,method:p,fetchOptions:T,middleware:d}).then(I=>(_&&_(I),I)).catch(I=>{throw _&&_(I),I})}}async request(e,...r){let[o,a]=r,s=f6(e,o,a),{headers:i,fetch:n=Eo.default,method:u="POST",requestMiddleware:c,responseMiddleware:p,...d}=this.requestConfig,{url:_}=this;s.signal!==void 0&&(d.signal=s.signal);let{query:T,operationName:b}=Ci(s.document);return t_({url:_,query:T,variables:s.variables,headers:{...Rs(r_(i)),...Rs(s.requestHeaders)},operationName:b,fetch:n,method:u,fetchOptions:d,middleware:c}).then(R=>(p&&p(R),R.data)).catch(R=>{throw p&&p(R),R})}batchRequests(e,r){let o=h6(e,r),{headers:a,...s}=this.requestConfig;o.signal!==void 0&&(s.signal=o.signal);let i=o.documents.map(({document:u})=>Ci(u).query),n=o.documents.map(({variables:u})=>u);return t_({url:this.url,query:i,variables:n,headers:{...Rs(r_(a)),...Rs(o.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Eo.default,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,r){let{headers:o}=this.requestConfig;return o?o[e]=r:this.requestConfig.headers={[e]:r},this}setEndpoint(e){return this.url=e,this}},t_=async t=>{let{query:e,variables:r,fetchOptions:o}=t,a=hoe(p6(t.method??"post")),s=Array.isArray(t.query),i=await a(t),n=await yoe(i,o.jsonSerializer??B1),u=Array.isArray(n)?!n.some(({data:p})=>!p):!!n.data,c=Array.isArray(n)||!n.errors||Array.isArray(n.errors)&&!n.errors.length||o.errorPolicy==="all"||o.errorPolicy==="ignore";if(i.ok&&c&&u){let{errors:p,...d}=(Array.isArray(n),n),_=o.errorPolicy==="ignore"?d:n;return{...s?{data:_}:_,headers:i.headers,status:i.status}}else{let p=typeof n=="string"?{error:n}:n;throw new Ar({...p,status:i.status,headers:i.headers},{query:e,variables:r})}};var voe=(t,e,r,o)=>{let a=o??B1;if(!Array.isArray(t))return a.stringify({query:t,variables:e,operationName:r});if(typeof e<"u"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");let s=t.reduce((i,n,u)=>(i.push({query:n,variables:e?e[u]:void 0}),i),[]);return a.stringify(s)},yoe=async(t,e)=>{let r;return t.headers.forEach((o,a)=>{a.toLowerCase()==="content-type"&&(r=o)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},r_=t=>typeof t=="function"?t():t,eDe=(t,...e)=>t.reduce((r,o,a)=>`${r}${o}${a in e?String(e[a]):""}`,"");import{performance as n_}from"perf_hooks";var p8=["admin","storefront-renderer","partners","business-platform","app-management"],Eoe=1e3,_oe=10,goe=new Set(["cache-control","content-type","etag","x-request-id","server-timing","retry-after"]);function l8(t){return goe.has(t)}function d8(t){if(t instanceof Error){let e=["socket hang up","econnreset","econnaborted","enotfound","enetunreach","network socket disconnected","etimedout","econnrefused","eai_again","epipe","the operation was aborted","timeout","premature close","getaddrinfo"],r=t.message.toLowerCase(),o=e.some(s=>r.includes(s)),a=/^request to .* failed, reason:\s*$/.test(r);return o||a}return!1}function dDe(t){if(d8(t))return!0;if(t instanceof Error){let e=["certificate","cert","tls","ssl","altnames"],r=t.message.toLowerCase();return e.some(o=>r.includes(o))}return!1}async function Toe(t){if(!t.useNetworkLevelRetry)return t.request();let e;for await(let r of l6(t.maxRetryTimeMs))try{return await t.request()}catch(o){if(e=o,!d8(o))throw o;t.recordCommandRetries&&o_(t.url,`network-retry:${o.message}`),Z(`Retrying request to ${t.url} due to network error ${o}`)}throw e}async function i_(t){let e=n_.now(),r=0,o={},a=rs(t.url),s={};try{s=await Toe(t),s.headers.forEach((n,u)=>{l8(u)&&(o[u]=n)})}catch(n){let u=n_.now();if(r=Math.round(u-e),n instanceof Ar){if(n.response.headers)for(let[p,d]of n.response.headers)l8(p)&&(o[p]=d);let c=Zi(o);if(Aoe(n)){let p;try{p=o["retry-after"]?Number.parseInt(o["retry-after"],10):void 0}catch{}return{status:"can-retry",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"],delayMs:p}}else if(n.response.status===401)return{status:"unauthorized",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"],delayMs:500};return{status:"client-error",clientError:n,duration:r,sanitizedHeaders:c,sanitizedUrl:a,requestId:o["x-request-id"]}}return{status:"unknown-error",error:n,duration:r,sanitizedHeaders:Zi(o),sanitizedUrl:a,requestId:o["x-request-id"]}}let i=n_.now();return r=Math.round(i-e),{status:"ok",response:s,duration:r,sanitizedHeaders:Zi(o),sanitizedUrl:a,requestId:o["x-request-id"]}}function Aoe(t){return t.response.status===429?!0:typeof t.response.errors=="string"?!1:t.response.errors?.some(e=>e.extensions?.code==="429")??!1}async function f8(t,e){let r=await i_(t);switch(Z(`Request to ${r.sanitizedUrl} completed in ${r.duration} ms
775
775
  With response headers:
776
776
  ${r.sanitizedHeaders}
777
777
  `),r.status){case"ok":return r.response;case"client-error":throw e?e(r.clientError,r.requestId):r.clientError;case"unknown-error":throw e?e(r.error,r.requestId):r.error;case"can-retry":throw e?e(r.clientError,r.requestId):r.clientError;case"unauthorized":throw e?e(r.clientError,r.requestId):r.clientError}}async function m8(t,e,r={scheduleDelay:setTimeout}){let o=0,a=r.limitRetriesTo??_oe,s=await i_(t);for(Z(`Request to ${s.sanitizedUrl} completed in ${s.duration} ms
778
778
  With response headers:
779
779
  ${s.sanitizedHeaders}
780
- `);;){if(s.status==="ok")return o>0&&Z(`Request to ${s.sanitizedUrl} succeeded after ${o} retries`),s.response;if(s.status==="client-error")throw e?e(s.clientError,s.requestId):s.clientError;if(s.status==="unknown-error")throw e?e(s.error,s.requestId):s.error;if(s.status==="unauthorized")throw s.clientError;if(a<=o)throw Z(`${a} retries exhausted for request to ${s.sanitizedUrl}`),e?e(s.clientError,s.requestId):s.clientError;o+=1,t.recordCommandRetries&&o_(t.url,`http-retry-${o}:${s.status}:`);let i=s.delayMs??r.defaultDelayMs??Eoe;Z(`Scheduling retry request #${o} to ${s.sanitizedUrl} in ${i} ms`),s=await new Promise(n=>{r.scheduleDelay(()=>{n(i_(t))},i)})}}var U5=et(y5(),1);l();import yse from"node:http";import Ese from"node:https";import Bs from"node:zlib";import M5,{PassThrough as B5,pipeline as Us}from"node:stream";import{Buffer as Md}from"node:buffer";l();function sse(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),o="",a=!1,s=r[0]||"text/plain",i=s;for(let p=1;p<r.length;p++)r[p]==="base64"?a=!0:r[p]&&(i+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(o=r[p].substring(8)));!r[0]&&!o.length&&(i+=";charset=US-ASCII",o="US-ASCII");let n=a?"base64":"ascii",u=unescape(t.substring(e+1)),c=Buffer.from(u,n);return c.type=s,c.typeFull=i,c.charset=o,c}var E5=sse;l();import go,{PassThrough as A5}from"node:stream";import{types as b5,deprecate as D_,promisify as use}from"node:util";import{Buffer as dn}from"node:buffer";l();l();var Li=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var mr=class extends Li{constructor(e,r,o){super(e,r),o&&(this.code=this.errno=o.code,this.erroredSysCall=o.syscall)}};l();var Rd=Symbol.toStringTag,x_=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Rd]==="URLSearchParams",ll=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Rd]),_5=t=>typeof t=="object"&&(t[Rd]==="AbortSignal"||t[Rd]==="EventTarget"),g5=(t,e)=>{let r=new URL(e).hostname,o=new URL(t).hostname;return r===o||r.endsWith(`.${o}`)},T5=(t,e)=>{let r=new URL(e).protocol,o=new URL(t).protocol;return r===o};var cse=use(go.pipeline),Or=Symbol("Body internals"),ni=class{constructor(e,{size:r=0}={}){let o=null;e===null?e=null:x_(e)?e=dn.from(e.toString()):ll(e)||dn.isBuffer(e)||(b5.isAnyArrayBuffer(e)?e=dn.from(e):ArrayBuffer.isView(e)?e=dn.from(e.buffer,e.byteOffset,e.byteLength):e instanceof go||(e instanceof Zu?(e=A3(e),o=e.type.split("=")[1]):e=dn.from(String(e))));let a=e;dn.isBuffer(e)?a=go.Readable.from(e):ll(e)&&(a=go.Readable.from(e.stream())),this[Or]={body:e,stream:a,boundary:o,disturbed:!1,error:null},this.size=r,e instanceof go&&e.on("error",s=>{let i=s instanceof Li?s:new mr(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Or].error=i})}get body(){return this[Or].stream}get bodyUsed(){return this[Or].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:o}=await O_(this);return e.slice(r,r+o)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let o=new Zu,a=new URLSearchParams(await this.text());for(let[s,i]of a)o.append(s,i);return o}let{toFormData:r}=await import("./multipart-parser-Q4QJZK3V.js");return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Or].body&&this[Or].body.type||"",r=await this.arrayBuffer();return new wh([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await O_(this);return new TextDecoder().decode(e)}buffer(){return O_(this)}};ni.prototype.buffer=D_(ni.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(ni.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:D_(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function O_(t){if(t[Or].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Or].disturbed=!0,t[Or].error)throw t[Or].error;let{body:e}=t;if(e===null)return dn.alloc(0);if(!(e instanceof go))return dn.alloc(0);let r=[],o=0;try{for await(let a of e){if(t.size>0&&o+a.length>t.size){let s=new mr(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}o+=a.length,r.push(a)}}catch(a){throw a instanceof Li?a:new mr(`Invalid response body while trying to fetch ${t.url}: ${a.message}`,"system",a)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(a=>typeof a=="string")?dn.from(r.join("")):dn.concat(r,o)}catch(a){throw new mr(`Could not create Buffer from response body for ${t.url}: ${a.message}`,"system",a)}else throw new mr(`Premature close of server response while trying to fetch ${t.url}`)}var Fs=(t,e)=>{let r,o,{body:a}=t[Or];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return a instanceof go&&typeof a.getBoundary!="function"&&(r=new A5({highWaterMark:e}),o=new A5({highWaterMark:e}),a.pipe(r),a.pipe(o),t[Or].stream=r,a=o),a},lse=D_(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Pd=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":x_(t)?"application/x-www-form-urlencoded;charset=UTF-8":ll(t)?t.type||null:dn.isBuffer(t)||b5.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Zu?`multipart/form-data; boundary=${e[Or].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${lse(t)}`:t instanceof go?null:"text/plain;charset=UTF-8",S5=t=>{let{body:e}=t[Or];return e===null?0:ll(e)?e.size:dn.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},x5=async(t,{body:e})=>{e===null?t.end():await cse(e,t)};l();l();import{types as O5}from"node:util";import wd from"node:http";var Id=typeof wd.validateHeaderName=="function"?wd.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},N_=typeof wd.validateHeaderValue=="function"?wd.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},jr=class t extends URLSearchParams{constructor(e){let r=[];if(e instanceof t){let o=e.raw();for(let[a,s]of Object.entries(o))r.push(...s.map(i=>[a,i]))}else if(e!=null)if(typeof e=="object"&&!O5.isBoxedPrimitive(e)){let o=e[Symbol.iterator];if(o==null)r.push(...Object.entries(e));else{if(typeof o!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(a=>{if(typeof a!="object"||O5.isBoxedPrimitive(a))throw new TypeError("Each header pair must be an iterable object");return[...a]}).map(a=>{if(a.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...a]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([o,a])=>(Id(o),N_(o,String(a)),[String(o).toLowerCase(),String(a)])):void 0,super(r),new Proxy(this,{get(o,a,s){switch(a){case"append":case"set":return(i,n)=>(Id(i),N_(i,String(n)),URLSearchParams.prototype[a].call(o,String(i).toLowerCase(),String(n)));case"delete":case"has":case"getAll":return i=>(Id(i),URLSearchParams.prototype[a].call(o,String(i).toLowerCase()));case"keys":return()=>(o.sort(),new Set(URLSearchParams.prototype.keys.call(o)).keys());default:return Reflect.get(o,a,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let o=r.join(", ");return/^content-encoding$/i.test(e)&&(o=o.toLowerCase()),o}forEach(e,r=void 0){for(let o of this.keys())Reflect.apply(e,r,[this.get(o),o,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let o=this.getAll(r);return r==="host"?e[r]=o[0]:e[r]=o.length>1?o:o[0],e},{})}};Object.defineProperties(jr.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function D5(t=[]){return new jr(t.reduce((e,r,o,a)=>(o%2===0&&e.push(a.slice(o,o+2)),e),[]).filter(([e,r])=>{try{return Id(e),N_(e,String(r)),!0}catch{return!1}}))}l();var pse=new Set([301,302,303,307,308]),Ld=t=>pse.has(t);var Ln=Symbol("Response internals"),Vr=class t extends ni{constructor(e=null,r={}){super(e,r);let o=r.status!=null?r.status:200,a=new jr(r.headers);if(e!==null&&!a.has("Content-Type")){let s=Pd(e,this);s&&a.append("Content-Type",s)}this[Ln]={type:"default",url:r.url,status:o,statusText:r.statusText||"",headers:a,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ln].type}get url(){return this[Ln].url||""}get status(){return this[Ln].status}get ok(){return this[Ln].status>=200&&this[Ln].status<300}get redirected(){return this[Ln].counter>0}get statusText(){return this[Ln].statusText}get headers(){return this[Ln].headers}get highWaterMark(){return this[Ln].highWaterMark}clone(){return new t(Fs(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Ld(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[Ln].type="error",e}static json(e=void 0,r={}){let o=JSON.stringify(e);if(o===void 0)throw new TypeError("data is not JSON serializable");let a=new jr(r&&r.headers);return a.has("content-type")||a.set("content-type","application/json"),new t(o,{...r,headers:a})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Vr.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});l();import{format as mse}from"node:url";import{deprecate as hse}from"node:util";l();var N5=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};l();import{isIP as dse}from"node:net";function C5(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var R5=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),P5="strict-origin-when-cross-origin";function I5(t){if(!R5.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function fse(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=dse(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Ms(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:fse(t)}function w5(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let o=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let a=t.referrer,s=C5(a),i=C5(a,!0);s.toString().length>4096&&(s=i),e&&(s=e(s)),r&&(i=r(i));let n=new URL(t.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return i;case"unsafe-url":return s;case"strict-origin":return Ms(s)&&!Ms(n)?"no-referrer":i.toString();case"strict-origin-when-cross-origin":return s.origin===n.origin?s:Ms(s)&&!Ms(n)?"no-referrer":i;case"same-origin":return s.origin===n.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===n.origin?s:i;case"no-referrer-when-downgrade":return Ms(s)&&!Ms(n)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function L5(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let o of e)o&&R5.has(o)&&(r=o);return r}var Gt=Symbol("Request internals"),pl=t=>typeof t=="object"&&typeof t[Gt]=="object",vse=hse(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),To=class t extends ni{constructor(e,r={}){let o;if(pl(e)?o=new URL(e.url):(o=new URL(e),e={}),o.username!==""||o.password!=="")throw new TypeError(`${o} is an url with embedded credentials.`);let a=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(a)&&(a=a.toUpperCase()),!pl(r)&&"data"in r&&vse(),(r.body!=null||pl(e)&&e.body!==null)&&(a==="GET"||a==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:pl(e)&&e.body!==null?Fs(e):null;super(s,{size:r.size||e.size||0});let i=new jr(r.headers||e.headers||{});if(s!==null&&!i.has("Content-Type")){let c=Pd(s,this);c&&i.set("Content-Type",c)}let n=pl(e)?e.signal:null;if("signal"in r&&(n=r.signal),n!=null&&!_5(n))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let u=r.referrer==null?e.referrer:r.referrer;if(u==="")u="no-referrer";else if(u){let c=new URL(u);u=/^about:(\/\/)?client$/.test(c)?"client":c}else u=void 0;this[Gt]={method:a,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:o,signal:n,referrer:u},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[Gt].method}get url(){return mse(this[Gt].parsedURL)}get headers(){return this[Gt].headers}get redirect(){return this[Gt].redirect}get signal(){return this[Gt].signal}get referrer(){if(this[Gt].referrer==="no-referrer")return"";if(this[Gt].referrer==="client")return"about:client";if(this[Gt].referrer)return this[Gt].referrer.toString()}get referrerPolicy(){return this[Gt].referrerPolicy}set referrerPolicy(e){this[Gt].referrerPolicy=I5(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(To.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var F5=t=>{let{parsedURL:e}=t[Gt],r=new jr(t[Gt].headers);r.has("Accept")||r.set("Accept","*/*");let o=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(o="0"),t.body!==null){let n=S5(t);typeof n=="number"&&!Number.isNaN(n)&&(o=String(n))}o&&r.set("Content-Length",o),t.referrerPolicy===""&&(t.referrerPolicy=P5),t.referrer&&t.referrer!=="no-referrer"?t[Gt].referrer=w5(t):t[Gt].referrer="no-referrer",t[Gt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:a}=t;typeof a=="function"&&(a=a(e));let s=N5(e),i={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:a};return{parsedURL:e,options:i}};l();var Fd=class extends Li{constructor(e,r="aborted"){super(e,r)}};var _se=new Set(["data:","http:","https:"]);async function Bd(t,e){return new Promise((r,o)=>{let a=new To(t,e),{parsedURL:s,options:i}=F5(a);if(!_se.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let b=E5(a.url),R=new Vr(b,{headers:{"Content-Type":b.typeFull}});r(R);return}let n=(s.protocol==="https:"?Ese:yse).request,{signal:u}=a,c=null,p=()=>{let b=new Fd("The operation was aborted.");o(b),a.body&&a.body instanceof M5.Readable&&a.body.destroy(b),!(!c||!c.body)&&c.body.emit("error",b)};if(u&&u.aborted){p();return}let d=()=>{p(),T()},_=n(s.toString(),i);u&&u.addEventListener("abort",d);let T=()=>{_.abort(),u&&u.removeEventListener("abort",d)};_.on("error",b=>{o(new mr(`request to ${a.url} failed, reason: ${b.message}`,"system",b)),T()}),gse(_,b=>{c&&c.body&&c.body.destroy(b)}),process.version<"v14"&&_.on("socket",b=>{let R;b.prependListener("end",()=>{R=b._eventsCount}),b.prependListener("close",I=>{if(c&&R<b._eventsCount&&!I){let B=new Error("Premature close");B.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",B)}})}),_.on("response",b=>{_.setTimeout(0);let R=D5(b.rawHeaders);if(Ld(b.statusCode)){let te=R.get("Location"),le=null;try{le=te===null?null:new URL(te,a.url)}catch{if(a.redirect!=="manual"){o(new mr(`uri requested responds with an invalid redirect URL: ${te}`,"invalid-redirect")),T();return}}switch(a.redirect){case"error":o(new mr(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`,"no-redirect")),T();return;case"manual":break;case"follow":{if(le===null)break;if(a.counter>=a.follow){o(new mr(`maximum redirect reached at: ${a.url}`,"max-redirect")),T();return}let De={headers:new jr(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:Fs(a),signal:a.signal,size:a.size,referrer:a.referrer,referrerPolicy:a.referrerPolicy};if(!g5(a.url,le)||!T5(a.url,le))for(let Er of["authorization","www-authenticate","cookie","cookie2"])De.headers.delete(Er);if(b.statusCode!==303&&a.body&&e.body instanceof M5.Readable){o(new mr("Cannot follow redirect with body being a readable stream","unsupported-redirect")),T();return}(b.statusCode===303||(b.statusCode===301||b.statusCode===302)&&a.method==="POST")&&(De.method="GET",De.body=void 0,De.headers.delete("content-length"));let ot=L5(R);ot&&(De.referrerPolicy=ot),r(Bd(new To(le,De))),T();return}default:return o(new TypeError(`Redirect option '${a.redirect}' is not a valid value of RequestRedirect`))}}u&&b.once("end",()=>{u.removeEventListener("abort",d)});let I=Us(b,new B5,te=>{te&&o(te)});process.version<"v12.10"&&b.on("aborted",d);let B={url:a.url,status:b.statusCode,statusText:b.statusMessage,headers:R,size:a.size,counter:a.counter,highWaterMark:a.highWaterMark},X=R.get("Content-Encoding");if(!a.compress||a.method==="HEAD"||X===null||b.statusCode===204||b.statusCode===304){c=new Vr(I,B),r(c);return}let de={flush:Bs.Z_SYNC_FLUSH,finishFlush:Bs.Z_SYNC_FLUSH};if(X==="gzip"||X==="x-gzip"){I=Us(I,Bs.createGunzip(de),te=>{te&&o(te)}),c=new Vr(I,B),r(c);return}if(X==="deflate"||X==="x-deflate"){let te=Us(b,new B5,le=>{le&&o(le)});te.once("data",le=>{(le[0]&15)===8?I=Us(I,Bs.createInflate(),De=>{De&&o(De)}):I=Us(I,Bs.createInflateRaw(),De=>{De&&o(De)}),c=new Vr(I,B),r(c)}),te.once("end",()=>{c||(c=new Vr(I,B),r(c))});return}if(X==="br"){I=Us(I,Bs.createBrotliDecompress(),te=>{te&&o(te)}),c=new Vr(I,B),r(c);return}c=new Vr(I,B),r(c)}),x5(_,a).catch(o)})}function gse(t,e){let r=Md.from(`0\r
780
+ `);;){if(s.status==="ok")return o>0&&Z(`Request to ${s.sanitizedUrl} succeeded after ${o} retries`),s.response;if(s.status==="client-error")throw e?e(s.clientError,s.requestId):s.clientError;if(s.status==="unknown-error")throw e?e(s.error,s.requestId):s.error;if(s.status==="unauthorized")throw s.clientError;if(a<=o)throw Z(`${a} retries exhausted for request to ${s.sanitizedUrl}`),e?e(s.clientError,s.requestId):s.clientError;o+=1,t.recordCommandRetries&&o_(t.url,`http-retry-${o}:${s.status}:`);let i=s.delayMs??r.defaultDelayMs??Eoe;Z(`Scheduling retry request #${o} to ${s.sanitizedUrl} in ${i} ms`),s=await new Promise(n=>{r.scheduleDelay(()=>{n(i_(t))},i)})}}var U5=et(y5());l();import yse from"node:http";import Ese from"node:https";import Bs from"node:zlib";import M5,{PassThrough as B5,pipeline as Us}from"node:stream";import{Buffer as Md}from"node:buffer";l();function sse(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),o="",a=!1,s=r[0]||"text/plain",i=s;for(let p=1;p<r.length;p++)r[p]==="base64"?a=!0:r[p]&&(i+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(o=r[p].substring(8)));!r[0]&&!o.length&&(i+=";charset=US-ASCII",o="US-ASCII");let n=a?"base64":"ascii",u=unescape(t.substring(e+1)),c=Buffer.from(u,n);return c.type=s,c.typeFull=i,c.charset=o,c}var E5=sse;l();import go,{PassThrough as A5}from"node:stream";import{types as b5,deprecate as D_,promisify as use}from"node:util";import{Buffer as dn}from"node:buffer";l();l();var Li=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var mr=class extends Li{constructor(e,r,o){super(e,r),o&&(this.code=this.errno=o.code,this.erroredSysCall=o.syscall)}};l();var Rd=Symbol.toStringTag,x_=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Rd]==="URLSearchParams",ll=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Rd]),_5=t=>typeof t=="object"&&(t[Rd]==="AbortSignal"||t[Rd]==="EventTarget"),g5=(t,e)=>{let r=new URL(e).hostname,o=new URL(t).hostname;return r===o||r.endsWith(`.${o}`)},T5=(t,e)=>{let r=new URL(e).protocol,o=new URL(t).protocol;return r===o};var cse=use(go.pipeline),Or=Symbol("Body internals"),ni=class{constructor(e,{size:r=0}={}){let o=null;e===null?e=null:x_(e)?e=dn.from(e.toString()):ll(e)||dn.isBuffer(e)||(b5.isAnyArrayBuffer(e)?e=dn.from(e):ArrayBuffer.isView(e)?e=dn.from(e.buffer,e.byteOffset,e.byteLength):e instanceof go||(e instanceof Zu?(e=A3(e),o=e.type.split("=")[1]):e=dn.from(String(e))));let a=e;dn.isBuffer(e)?a=go.Readable.from(e):ll(e)&&(a=go.Readable.from(e.stream())),this[Or]={body:e,stream:a,boundary:o,disturbed:!1,error:null},this.size=r,e instanceof go&&e.on("error",s=>{let i=s instanceof Li?s:new mr(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Or].error=i})}get body(){return this[Or].stream}get bodyUsed(){return this[Or].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:o}=await O_(this);return e.slice(r,r+o)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let o=new Zu,a=new URLSearchParams(await this.text());for(let[s,i]of a)o.append(s,i);return o}let{toFormData:r}=await import("./multipart-parser-Q4QJZK3V.js");return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Or].body&&this[Or].body.type||"",r=await this.arrayBuffer();return new wh([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await O_(this);return new TextDecoder().decode(e)}buffer(){return O_(this)}};ni.prototype.buffer=D_(ni.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(ni.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:D_(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function O_(t){if(t[Or].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Or].disturbed=!0,t[Or].error)throw t[Or].error;let{body:e}=t;if(e===null)return dn.alloc(0);if(!(e instanceof go))return dn.alloc(0);let r=[],o=0;try{for await(let a of e){if(t.size>0&&o+a.length>t.size){let s=new mr(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}o+=a.length,r.push(a)}}catch(a){throw a instanceof Li?a:new mr(`Invalid response body while trying to fetch ${t.url}: ${a.message}`,"system",a)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(a=>typeof a=="string")?dn.from(r.join("")):dn.concat(r,o)}catch(a){throw new mr(`Could not create Buffer from response body for ${t.url}: ${a.message}`,"system",a)}else throw new mr(`Premature close of server response while trying to fetch ${t.url}`)}var Fs=(t,e)=>{let r,o,{body:a}=t[Or];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return a instanceof go&&typeof a.getBoundary!="function"&&(r=new A5({highWaterMark:e}),o=new A5({highWaterMark:e}),a.pipe(r),a.pipe(o),t[Or].stream=r,a=o),a},lse=D_(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Pd=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":x_(t)?"application/x-www-form-urlencoded;charset=UTF-8":ll(t)?t.type||null:dn.isBuffer(t)||b5.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Zu?`multipart/form-data; boundary=${e[Or].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${lse(t)}`:t instanceof go?null:"text/plain;charset=UTF-8",S5=t=>{let{body:e}=t[Or];return e===null?0:ll(e)?e.size:dn.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},x5=async(t,{body:e})=>{e===null?t.end():await cse(e,t)};l();l();import{types as O5}from"node:util";import wd from"node:http";var Id=typeof wd.validateHeaderName=="function"?wd.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},N_=typeof wd.validateHeaderValue=="function"?wd.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},jr=class t extends URLSearchParams{constructor(e){let r=[];if(e instanceof t){let o=e.raw();for(let[a,s]of Object.entries(o))r.push(...s.map(i=>[a,i]))}else if(e!=null)if(typeof e=="object"&&!O5.isBoxedPrimitive(e)){let o=e[Symbol.iterator];if(o==null)r.push(...Object.entries(e));else{if(typeof o!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(a=>{if(typeof a!="object"||O5.isBoxedPrimitive(a))throw new TypeError("Each header pair must be an iterable object");return[...a]}).map(a=>{if(a.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...a]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([o,a])=>(Id(o),N_(o,String(a)),[String(o).toLowerCase(),String(a)])):void 0,super(r),new Proxy(this,{get(o,a,s){switch(a){case"append":case"set":return(i,n)=>(Id(i),N_(i,String(n)),URLSearchParams.prototype[a].call(o,String(i).toLowerCase(),String(n)));case"delete":case"has":case"getAll":return i=>(Id(i),URLSearchParams.prototype[a].call(o,String(i).toLowerCase()));case"keys":return()=>(o.sort(),new Set(URLSearchParams.prototype.keys.call(o)).keys());default:return Reflect.get(o,a,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let o=r.join(", ");return/^content-encoding$/i.test(e)&&(o=o.toLowerCase()),o}forEach(e,r=void 0){for(let o of this.keys())Reflect.apply(e,r,[this.get(o),o,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let o=this.getAll(r);return r==="host"?e[r]=o[0]:e[r]=o.length>1?o:o[0],e},{})}};Object.defineProperties(jr.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function D5(t=[]){return new jr(t.reduce((e,r,o,a)=>(o%2===0&&e.push(a.slice(o,o+2)),e),[]).filter(([e,r])=>{try{return Id(e),N_(e,String(r)),!0}catch{return!1}}))}l();var pse=new Set([301,302,303,307,308]),Ld=t=>pse.has(t);var Ln=Symbol("Response internals"),Vr=class t extends ni{constructor(e=null,r={}){super(e,r);let o=r.status!=null?r.status:200,a=new jr(r.headers);if(e!==null&&!a.has("Content-Type")){let s=Pd(e,this);s&&a.append("Content-Type",s)}this[Ln]={type:"default",url:r.url,status:o,statusText:r.statusText||"",headers:a,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ln].type}get url(){return this[Ln].url||""}get status(){return this[Ln].status}get ok(){return this[Ln].status>=200&&this[Ln].status<300}get redirected(){return this[Ln].counter>0}get statusText(){return this[Ln].statusText}get headers(){return this[Ln].headers}get highWaterMark(){return this[Ln].highWaterMark}clone(){return new t(Fs(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Ld(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[Ln].type="error",e}static json(e=void 0,r={}){let o=JSON.stringify(e);if(o===void 0)throw new TypeError("data is not JSON serializable");let a=new jr(r&&r.headers);return a.has("content-type")||a.set("content-type","application/json"),new t(o,{...r,headers:a})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Vr.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});l();import{format as mse}from"node:url";import{deprecate as hse}from"node:util";l();var N5=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};l();import{isIP as dse}from"node:net";function C5(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var R5=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),P5="strict-origin-when-cross-origin";function I5(t){if(!R5.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function fse(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=dse(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Ms(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:fse(t)}function w5(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let o=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let a=t.referrer,s=C5(a),i=C5(a,!0);s.toString().length>4096&&(s=i),e&&(s=e(s)),r&&(i=r(i));let n=new URL(t.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return i;case"unsafe-url":return s;case"strict-origin":return Ms(s)&&!Ms(n)?"no-referrer":i.toString();case"strict-origin-when-cross-origin":return s.origin===n.origin?s:Ms(s)&&!Ms(n)?"no-referrer":i;case"same-origin":return s.origin===n.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===n.origin?s:i;case"no-referrer-when-downgrade":return Ms(s)&&!Ms(n)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function L5(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let o of e)o&&R5.has(o)&&(r=o);return r}var Gt=Symbol("Request internals"),pl=t=>typeof t=="object"&&typeof t[Gt]=="object",vse=hse(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),To=class t extends ni{constructor(e,r={}){let o;if(pl(e)?o=new URL(e.url):(o=new URL(e),e={}),o.username!==""||o.password!=="")throw new TypeError(`${o} is an url with embedded credentials.`);let a=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(a)&&(a=a.toUpperCase()),!pl(r)&&"data"in r&&vse(),(r.body!=null||pl(e)&&e.body!==null)&&(a==="GET"||a==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:pl(e)&&e.body!==null?Fs(e):null;super(s,{size:r.size||e.size||0});let i=new jr(r.headers||e.headers||{});if(s!==null&&!i.has("Content-Type")){let c=Pd(s,this);c&&i.set("Content-Type",c)}let n=pl(e)?e.signal:null;if("signal"in r&&(n=r.signal),n!=null&&!_5(n))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let u=r.referrer==null?e.referrer:r.referrer;if(u==="")u="no-referrer";else if(u){let c=new URL(u);u=/^about:(\/\/)?client$/.test(c)?"client":c}else u=void 0;this[Gt]={method:a,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:o,signal:n,referrer:u},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[Gt].method}get url(){return mse(this[Gt].parsedURL)}get headers(){return this[Gt].headers}get redirect(){return this[Gt].redirect}get signal(){return this[Gt].signal}get referrer(){if(this[Gt].referrer==="no-referrer")return"";if(this[Gt].referrer==="client")return"about:client";if(this[Gt].referrer)return this[Gt].referrer.toString()}get referrerPolicy(){return this[Gt].referrerPolicy}set referrerPolicy(e){this[Gt].referrerPolicy=I5(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(To.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var F5=t=>{let{parsedURL:e}=t[Gt],r=new jr(t[Gt].headers);r.has("Accept")||r.set("Accept","*/*");let o=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(o="0"),t.body!==null){let n=S5(t);typeof n=="number"&&!Number.isNaN(n)&&(o=String(n))}o&&r.set("Content-Length",o),t.referrerPolicy===""&&(t.referrerPolicy=P5),t.referrer&&t.referrer!=="no-referrer"?t[Gt].referrer=w5(t):t[Gt].referrer="no-referrer",t[Gt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:a}=t;typeof a=="function"&&(a=a(e));let s=N5(e),i={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:a};return{parsedURL:e,options:i}};l();var Fd=class extends Li{constructor(e,r="aborted"){super(e,r)}};var _se=new Set(["data:","http:","https:"]);async function Bd(t,e){return new Promise((r,o)=>{let a=new To(t,e),{parsedURL:s,options:i}=F5(a);if(!_se.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let b=E5(a.url),R=new Vr(b,{headers:{"Content-Type":b.typeFull}});r(R);return}let n=(s.protocol==="https:"?Ese:yse).request,{signal:u}=a,c=null,p=()=>{let b=new Fd("The operation was aborted.");o(b),a.body&&a.body instanceof M5.Readable&&a.body.destroy(b),!(!c||!c.body)&&c.body.emit("error",b)};if(u&&u.aborted){p();return}let d=()=>{p(),T()},_=n(s.toString(),i);u&&u.addEventListener("abort",d);let T=()=>{_.abort(),u&&u.removeEventListener("abort",d)};_.on("error",b=>{o(new mr(`request to ${a.url} failed, reason: ${b.message}`,"system",b)),T()}),gse(_,b=>{c&&c.body&&c.body.destroy(b)}),process.version<"v14"&&_.on("socket",b=>{let R;b.prependListener("end",()=>{R=b._eventsCount}),b.prependListener("close",I=>{if(c&&R<b._eventsCount&&!I){let B=new Error("Premature close");B.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",B)}})}),_.on("response",b=>{_.setTimeout(0);let R=D5(b.rawHeaders);if(Ld(b.statusCode)){let te=R.get("Location"),le=null;try{le=te===null?null:new URL(te,a.url)}catch{if(a.redirect!=="manual"){o(new mr(`uri requested responds with an invalid redirect URL: ${te}`,"invalid-redirect")),T();return}}switch(a.redirect){case"error":o(new mr(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`,"no-redirect")),T();return;case"manual":break;case"follow":{if(le===null)break;if(a.counter>=a.follow){o(new mr(`maximum redirect reached at: ${a.url}`,"max-redirect")),T();return}let De={headers:new jr(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:Fs(a),signal:a.signal,size:a.size,referrer:a.referrer,referrerPolicy:a.referrerPolicy};if(!g5(a.url,le)||!T5(a.url,le))for(let Er of["authorization","www-authenticate","cookie","cookie2"])De.headers.delete(Er);if(b.statusCode!==303&&a.body&&e.body instanceof M5.Readable){o(new mr("Cannot follow redirect with body being a readable stream","unsupported-redirect")),T();return}(b.statusCode===303||(b.statusCode===301||b.statusCode===302)&&a.method==="POST")&&(De.method="GET",De.body=void 0,De.headers.delete("content-length"));let ot=L5(R);ot&&(De.referrerPolicy=ot),r(Bd(new To(le,De))),T();return}default:return o(new TypeError(`Redirect option '${a.redirect}' is not a valid value of RequestRedirect`))}}u&&b.once("end",()=>{u.removeEventListener("abort",d)});let I=Us(b,new B5,te=>{te&&o(te)});process.version<"v12.10"&&b.on("aborted",d);let B={url:a.url,status:b.statusCode,statusText:b.statusMessage,headers:R,size:a.size,counter:a.counter,highWaterMark:a.highWaterMark},X=R.get("Content-Encoding");if(!a.compress||a.method==="HEAD"||X===null||b.statusCode===204||b.statusCode===304){c=new Vr(I,B),r(c);return}let de={flush:Bs.Z_SYNC_FLUSH,finishFlush:Bs.Z_SYNC_FLUSH};if(X==="gzip"||X==="x-gzip"){I=Us(I,Bs.createGunzip(de),te=>{te&&o(te)}),c=new Vr(I,B),r(c);return}if(X==="deflate"||X==="x-deflate"){let te=Us(b,new B5,le=>{le&&o(le)});te.once("data",le=>{(le[0]&15)===8?I=Us(I,Bs.createInflate(),De=>{De&&o(De)}):I=Us(I,Bs.createInflateRaw(),De=>{De&&o(De)}),c=new Vr(I,B),r(c)}),te.once("end",()=>{c||(c=new Vr(I,B),r(c))});return}if(X==="br"){I=Us(I,Bs.createBrotliDecompress(),te=>{te&&o(te)}),c=new Vr(I,B),r(c);return}c=new Vr(I,B),r(c)}),x5(_,a).catch(o)})}function gse(t,e){let r=Md.from(`0\r
781
781
  \r
782
782
  `),o=!1,a=!1,s;t.on("response",i=>{let{headers:n}=i;o=n["transfer-encoding"]==="chunked"&&!n["content-length"]}),t.on("socket",i=>{let n=()=>{if(o&&!a){let c=new Error("Premature close");c.code="ERR_STREAM_PREMATURE_CLOSE",e(c)}},u=c=>{a=Md.compare(c.slice(-5),r)===0,!a&&s&&(a=Md.compare(s.slice(-3),r.slice(0,3))===0&&Md.compare(c.slice(-2),r.slice(3))===0),s=c};i.prependListener("close",n),i.on("data",u),t.on("close",()=>{i.removeListener("close",n),i.removeListener("data",u)})})}function $Re(){return new U5.default}function ks(t="default",e=process.env){let r=!c6(e);switch(t){case"default":return{useNetworkLevelRetry:r,maxRetryTimeMs:M1,useAbortSignal:!0,timeoutMs:Mh(e)};case"non-blocking":return{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:Mh(e)};case"slow-request":return{useNetworkLevelRetry:!1,useAbortSignal:!1}}return{...t,useNetworkLevelRetry:r&&t.useNetworkLevelRetry}}function C_(t){let e;return t.useAbortSignal===!0?e=AbortSignal.timeout(t.timeoutMs):t.useAbortSignal&&typeof t.useAbortSignal=="function"?e=t.useAbortSignal():t.useAbortSignal&&(e=t.useAbortSignal),e}async function k5({url:t,behaviour:e,init:r,logRequest:o,useHttpsAgent:a}){o&&Z(me`Sending ${r?.method??"GET"} request to URL ${rs(t.toString())}
783
783
  With request headers:
@@ -1,3 +1,3 @@
1
- import{A as n,a as d,i as g,w}from"./chunk-7JFIBCHH.js";import{Q as p,m,n as l}from"./chunk-AQOYGO3U.js";import{Ed as a,Kc as x,Uc as C,a as f,sc as y,uc as N,vc as _}from"./chunk-DEW5QFGH.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var h;function S(){return h??(h={currentCommandId:""}),h}function I(){return S().currentCommandId}function M(e){S().currentCommandId=e}var E="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",V=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function u(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??E}var k=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),b=n.object({notifications:n.array(k)});async function re(e,t=process.env){try{let r=I();if(T(r,t)||g(t))return;let o=await v(),s=F(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await O(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new x;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-JHFQZGYG.js");await s(o,"unexpected_error")}}function T(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||V.includes(e)}async function O(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
1
+ import{A as n,a as d,i as g,w}from"./chunk-3TG7H626.js";import{Q as p,m,n as l}from"./chunk-D24XVLOA.js";import{Ed as a,Kc as x,Uc as C,a as f,sc as y,uc as N,vc as _}from"./chunk-7FYGRWMW.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var h;function S(){return h??(h={currentCommandId:""}),h}function I(){return S().currentCommandId}function M(e){S().currentCommandId=e}var E="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",V=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function u(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??E}var k=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),b=n.object({notifications:n.array(k)});async function re(e,t=process.env){try{let r=I();if(T(r,t)||g(t))return;let o=await v(),s=F(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await O(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new x;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-YQEGKTYS.js");await s(o,"unexpected_error")}}function T(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||V.includes(e)}async function O(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
2
2
  `),link:t.cta};switch(t.type){case"info":{y(r);break}case"warning":{N(r);break}case"error":throw _(r),new Error("abort")}m(`notification-${t.id}`,new Date().getTime().toString())})}async function v(){let e=`notifications-${u()}`,t=l(e)?.value;if(!t)throw new Error(D);let r=JSON.parse(t);return b.parse(r)}async function ne(){a("Fetching notifications...");let e=await w(u(),void 0,{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:3*1e3});if(e.status!==200)throw new Error(`Failed to fetch notifications: ${e.statusText}`);let t=await e.text(),r=JSON.parse(t),o=b.parse(r);return await B(t),o}async function B(e){m(`notifications-${u()}`,e),a(`Notifications from ${u()} stored in the cache`)}function oe(e,t=process.argv,r=process.env){if(T(e,r)||!t[0]||!t[1])return;let o=t[0],i=[t[1],"notifications","list","--ignore-errors"];C(o,i,{background:!0,env:{...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},externalErrorHandler:async $=>{a(`Failed to fetch notifications in background: ${$.message}`)}})}function F(e,t,r,o=new Date(new Date().setUTCHours(0,0,0,0)),s=d){return e.filter(i=>A(i,s)).filter(i=>j(i,o)).filter(i=>q(i,t)).filter(i=>L(i,t,r)).filter(i=>H(i))}function A(e,t){let r=!e.minVersion||p(t,`>=${e.minVersion}`),o=!e.maxVersion||p(t,`<=${e.maxVersion}`);return r&&o}function j(e,t){let r=!e.minDate||new Date(e.minDate)<=t,o=!e.maxDate||new Date(e.maxDate)>=t;return r&&o}function q(e,t){return t===""?!0:!e.commands||e.commands.includes(t)}function L(e,t,r){let o=t.split(":")[0]??"all",s=e.surface??"all";return r?r.includes(s):s===o||s==="all"}function H(e){if(!e.frequency)return!0;let t=`notification-${e.id}`,r=l(t)?.value;if(!r)return!0;switch(e.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(r)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(r)>168*3600*1e3}}function se(e){let t=[];return e.minDate&&t.push(`from ${e.minDate}`),e.maxDate&&t.push(`to ${e.maxDate}`),e.minVersion&&t.push(`from v${e.minVersion}`),e.maxVersion&&t.push(`to v${e.maxVersion}`),e.frequency==="once"&&t.push("show only once"),e.frequency==="once_a_day"&&t.push("show once a day"),e.frequency==="once_a_week"&&t.push("show once a week"),e.surface&&t.push(`surface = ${e.surface}`),e.commands&&t.push(`commands = ${e.commands.join(", ")}`),t.join(`
3
3
  `)}export{M as a,re as b,v as c,ne as d,oe as e,se as f};