shopify 3.93.0 → 3.93.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.
Files changed (62) hide show
  1. package/dist/{chunk-SBSUITP6.js → chunk-PB3UDYWH.js} +1 -1
  2. package/dist/{chunk-MYTB32VB.js → chunk-SVYSLNQH.js} +1 -1
  3. package/dist/{chunk-O6CC6JKI.js → chunk-T57REQVZ.js} +1 -1
  4. package/dist/{chunk-U7JC7ESX.js → chunk-TCRHJ3ZH.js} +2 -2
  5. package/dist/{chunk-POO2TAEO.js → chunk-VLDSGLBP.js} +1 -1
  6. package/dist/{chunk-DLK7L2KZ.js → chunk-WOERFYNW.js} +2 -2
  7. package/dist/cli/commands/store/auth.d.ts +1 -0
  8. package/dist/cli/commands/store/auth.js +10 -3
  9. package/dist/cli/commands/store/execute.d.ts +1 -0
  10. package/dist/cli/commands/store/execute.js +7 -4
  11. package/dist/cli/services/store/auth/callback.d.ts +8 -0
  12. package/dist/cli/services/store/auth/callback.js +140 -0
  13. package/dist/cli/services/store/{auth-config.js → auth/config.js} +1 -1
  14. package/dist/cli/services/store/auth/existing-scopes.d.ts +5 -0
  15. package/dist/cli/services/store/auth/existing-scopes.js +40 -0
  16. package/dist/cli/services/store/auth/index.d.ts +18 -0
  17. package/dist/cli/services/store/auth/index.js +88 -0
  18. package/dist/cli/services/store/auth/pkce.d.ts +36 -0
  19. package/dist/cli/services/store/auth/pkce.js +49 -0
  20. package/dist/cli/services/store/{auth-recovery.js → auth/recovery.js} +1 -1
  21. package/dist/cli/services/store/auth/result.d.ts +24 -0
  22. package/dist/cli/services/store/auth/result.js +39 -0
  23. package/dist/cli/services/store/auth/scopes.d.ts +4 -0
  24. package/dist/cli/services/store/auth/scopes.js +53 -0
  25. package/dist/cli/services/store/auth/session-lifecycle.d.ts +3 -0
  26. package/dist/cli/services/store/auth/session-lifecycle.js +69 -0
  27. package/dist/cli/services/store/{session.d.ts → auth/session-store.d.ts} +1 -2
  28. package/dist/cli/services/store/auth/session-store.js +127 -0
  29. package/dist/cli/services/store/auth/token-client.d.ts +40 -0
  30. package/dist/cli/services/store/auth/token-client.js +95 -0
  31. package/dist/cli/services/store/{admin-graphql-context.d.ts → execute/admin-context.d.ts} +3 -2
  32. package/dist/cli/services/store/execute/admin-context.js +41 -0
  33. package/dist/cli/services/store/execute/admin-transport.d.ts +6 -0
  34. package/dist/cli/services/store/{admin-graphql-transport.js → execute/admin-transport.js} +7 -7
  35. package/dist/cli/services/store/{execute.d.ts → execute/index.d.ts} +2 -3
  36. package/dist/cli/services/store/{execute.js → execute/index.js} +4 -11
  37. package/dist/cli/services/store/{execute-request.d.ts → execute/request.d.ts} +0 -2
  38. package/dist/cli/services/store/{execute-request.js → execute/request.js} +1 -2
  39. package/dist/cli/services/store/execute/result.d.ts +3 -0
  40. package/dist/cli/services/store/execute/result.js +29 -0
  41. package/dist/cli/services/store/{graphql-targets.d.ts → execute/targets.d.ts} +2 -3
  42. package/dist/cli/services/store/{graphql-targets.js → execute/targets.js} +5 -11
  43. package/dist/{error-handler-IRR4EZPS.js → error-handler-54XVSWV5.js} +1 -1
  44. package/dist/hooks/postrun.js +1 -1
  45. package/dist/hooks/prerun.js +1 -1
  46. package/dist/index.js +867 -859
  47. package/dist/{local-PQUMWHWR.js → local-JCUIPKND.js} +1 -1
  48. package/dist/{node-package-manager-HIOT5VLV.js → node-package-manager-P7JQBCHZ.js} +1 -1
  49. package/dist/tsconfig.tsbuildinfo +1 -1
  50. package/dist/{ui-QBSPD4RX.js → ui-XTVYPIVY.js} +1 -1
  51. package/dist/{workerd-QSZBPNES.js → workerd-3GJRSBJN.js} +1 -1
  52. package/oclif.manifest.json +23 -3
  53. package/package.json +6 -6
  54. package/dist/cli/services/store/admin-graphql-context.js +0 -103
  55. package/dist/cli/services/store/admin-graphql-transport.d.ts +0 -9
  56. package/dist/cli/services/store/auth.d.ts +0 -61
  57. package/dist/cli/services/store/auth.js +0 -326
  58. package/dist/cli/services/store/execute-result.d.ts +0 -1
  59. package/dist/cli/services/store/execute-result.js +0 -18
  60. package/dist/cli/services/store/session.js +0 -69
  61. /package/dist/cli/services/store/{auth-config.d.ts → auth/config.d.ts} +0 -0
  62. /package/dist/cli/services/store/{auth-recovery.d.ts → auth/recovery.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import{$a as uu,Ba as Oi,Ed as Ae,Fb as Zn,Jc as ht,Lc as es,Sc as mu,Vc as xi,Wa as Ti,Xa as Xn,Ya as dt,b as au,bb as lu,c as cu,ed as yu,fb as fu,hb as du,qb as hu,sb as pu,va as Pi,wd as pt,yd as ve}from"./chunk-DLK7L2KZ.js";import{a as ki}from"./chunk-P3ASN7B5.js";import{b as Ie,g as Rt}from"./chunk-NOSKVZWJ.js";import{a as R,c as v,e as Oe,g as u}from"./chunk-VPRTJUIN.js";var Gr=v(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.regexpCode=V.getEsmExportName=V.getProperty=V.safeStringify=V.stringify=V.strConcat=V.addCodeArg=V.str=V._=V.nil=V._Code=V.Name=V.IDENTIFIER=V._CodeOrName=void 0;var Vr=class{};V._CodeOrName=Vr;V.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var At=class extends Vr{constructor(e){if(super(),!V.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};V.Name=At;var qe=class extends Vr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof At&&(r[n.str]=(r[n.str]||0)+1),r),{})}};V._Code=qe;V.nil=new qe("");function qu(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Ui(r,e[n]),r.push(t[++n]);return new qe(r)}V._=qu;var zi=new qe("+");function Du(t,...e){let r=[Br(t[0])],n=0;for(;n<e.length;)r.push(zi),Ui(r,e[n]),r.push(zi,Br(t[++n]));return ty(r),new qe(r)}V.str=Du;function Ui(t,e){e instanceof qe?t.push(...e._items):e instanceof At?t.push(e):t.push(sy(e))}V.addCodeArg=Ui;function ty(t){let e=1;for(;e<t.length-1;){if(t[e]===zi){let r=ry(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function ry(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof At||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof At))return`"${t}${e.slice(1)}`}function ny(t,e){return e.emptyStr()?t:t.emptyStr()?e:Du`${t}${e}`}V.strConcat=ny;function sy(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Br(Array.isArray(t)?t.join(","):t)}function iy(t){return new qe(Br(t))}V.stringify=iy;function Br(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V.safeStringify=Br;function oy(t){return typeof t=="string"&&V.IDENTIFIER.test(t)?new qe(`.${t}`):qu`[${t}]`}V.getProperty=oy;function ay(t){if(typeof t=="string"&&V.IDENTIFIER.test(t))return new qe(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}V.getEsmExportName=ay;function cy(t){return new qe(t.toString())}V.regexpCode=cy});var Bi=v(xe=>{"use strict";u();Object.defineProperty(xe,"__esModule",{value:!0});xe.ValueScope=xe.ValueScopeName=xe.Scope=xe.varKinds=xe.UsedValueState=void 0;var ke=Gr(),Hi=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ss;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ss||(xe.UsedValueState=ss={}));xe.varKinds={const:new ke.Name("const"),let:new ke.Name("let"),var:new ke.Name("var")};var is=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ke.Name?e:this.name(e)}name(e){return new ke.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};xe.Scope=is;var os=class extends ke.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ke._)`.${new ke.Name(r)}[${n}]`}};xe.ValueScopeName=os;var uy=(0,ke._)`\n`,Vi=class extends is{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?uy:ke.nil}}get(){return this._scope}name(e){return new os(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let f=a.get(o);if(f)return f}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:i,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ke._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=ke.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ss.Started);let f=r(l);if(f){let d=this.opts.es5?xe.varKinds.var:xe.varKinds.const;i=(0,ke._)`${i}${d} ${l} = ${f};${this.opts._n}`}else if(f=s?.(l))i=(0,ke._)`${i}${f}${this.opts._n}`;else throw new Hi(l);c.set(l,ss.Completed)})}return i}};xe.ValueScope=Vi});var I=v(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.or=q.and=q.not=q.CodeGen=q.operators=q.varKinds=q.ValueScopeName=q.ValueScope=q.Scope=q.Name=q.regexpCode=q.stringify=q.getProperty=q.nil=q.strConcat=q.str=q._=void 0;var F=Gr(),Ve=Bi(),mt=Gr();Object.defineProperty(q,"_",{enumerable:!0,get:function(){return mt._}});Object.defineProperty(q,"str",{enumerable:!0,get:function(){return mt.str}});Object.defineProperty(q,"strConcat",{enumerable:!0,get:function(){return mt.strConcat}});Object.defineProperty(q,"nil",{enumerable:!0,get:function(){return mt.nil}});Object.defineProperty(q,"getProperty",{enumerable:!0,get:function(){return mt.getProperty}});Object.defineProperty(q,"stringify",{enumerable:!0,get:function(){return mt.stringify}});Object.defineProperty(q,"regexpCode",{enumerable:!0,get:function(){return mt.regexpCode}});Object.defineProperty(q,"Name",{enumerable:!0,get:function(){return mt.Name}});var ls=Bi();Object.defineProperty(q,"Scope",{enumerable:!0,get:function(){return ls.Scope}});Object.defineProperty(q,"ValueScope",{enumerable:!0,get:function(){return ls.ValueScope}});Object.defineProperty(q,"ValueScopeName",{enumerable:!0,get:function(){return ls.ValueScopeName}});Object.defineProperty(q,"varKinds",{enumerable:!0,get:function(){return ls.varKinds}});q.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Gi=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ve.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=or(this.rhs,e,r)),this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}},as=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof F.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=or(this.rhs,e,r),this}get names(){let e=this.lhs instanceof F.Name?{}:{...this.lhs.names};return us(e,this.rhs)}},Wi=class extends as{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ki=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ji=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yi=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Qi=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=or(this.code,e,r),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}},Wr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(ly(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qt(e,r.names),{})}},st=class extends Wr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xi=class extends Wr{},ir=class extends st{};ir.kind="else";var jt=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ir(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=or(this.condition,e,r),this}get names(){let e=super.names;return us(e,this.condition),this.else&&qt(e,this.else.names),e}};jt.kind="if";var It=class extends st{};It.kind="for";var Zi=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=or(this.iteration,e,r),this}get names(){return qt(super.names,this.iteration.names)}},eo=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ve.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=us(super.names,this.from);return us(e,this.to)}},cs=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=or(this.iterable,e,r),this}get names(){return qt(super.names,this.iterable.names)}},Kr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kr.kind="func";var Jr=class extends Wr{render(e){return"return "+super.render(e)}};Jr.kind="return";var to=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qt(e,this.catch.names),this.finally&&qt(e,this.finally.names),e}},Yr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yr.kind="catch";var Qr=class extends st{render(e){return"finally"+super.render(e)}};Qr.kind="finally";var ro=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
1
+ import{$a as uu,Ba as Oi,Ed as Ae,Fb as Zn,Jc as ht,Lc as es,Sc as mu,Vc as xi,Wa as Ti,Xa as Xn,Ya as dt,b as au,bb as lu,c as cu,ed as yu,fb as fu,hb as du,qb as hu,sb as pu,va as Pi,wd as pt,yd as ve}from"./chunk-WOERFYNW.js";import{a as ki}from"./chunk-P3ASN7B5.js";import{b as Ie,g as Rt}from"./chunk-NOSKVZWJ.js";import{a as R,c as v,e as Oe,g as u}from"./chunk-VPRTJUIN.js";var Gr=v(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.regexpCode=V.getEsmExportName=V.getProperty=V.safeStringify=V.stringify=V.strConcat=V.addCodeArg=V.str=V._=V.nil=V._Code=V.Name=V.IDENTIFIER=V._CodeOrName=void 0;var Vr=class{};V._CodeOrName=Vr;V.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var At=class extends Vr{constructor(e){if(super(),!V.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};V.Name=At;var qe=class extends Vr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof At&&(r[n.str]=(r[n.str]||0)+1),r),{})}};V._Code=qe;V.nil=new qe("");function qu(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Ui(r,e[n]),r.push(t[++n]);return new qe(r)}V._=qu;var zi=new qe("+");function Du(t,...e){let r=[Br(t[0])],n=0;for(;n<e.length;)r.push(zi),Ui(r,e[n]),r.push(zi,Br(t[++n]));return ty(r),new qe(r)}V.str=Du;function Ui(t,e){e instanceof qe?t.push(...e._items):e instanceof At?t.push(e):t.push(sy(e))}V.addCodeArg=Ui;function ty(t){let e=1;for(;e<t.length-1;){if(t[e]===zi){let r=ry(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function ry(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof At||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof At))return`"${t}${e.slice(1)}`}function ny(t,e){return e.emptyStr()?t:t.emptyStr()?e:Du`${t}${e}`}V.strConcat=ny;function sy(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Br(Array.isArray(t)?t.join(","):t)}function iy(t){return new qe(Br(t))}V.stringify=iy;function Br(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V.safeStringify=Br;function oy(t){return typeof t=="string"&&V.IDENTIFIER.test(t)?new qe(`.${t}`):qu`[${t}]`}V.getProperty=oy;function ay(t){if(typeof t=="string"&&V.IDENTIFIER.test(t))return new qe(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}V.getEsmExportName=ay;function cy(t){return new qe(t.toString())}V.regexpCode=cy});var Bi=v(xe=>{"use strict";u();Object.defineProperty(xe,"__esModule",{value:!0});xe.ValueScope=xe.ValueScopeName=xe.Scope=xe.varKinds=xe.UsedValueState=void 0;var ke=Gr(),Hi=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ss;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ss||(xe.UsedValueState=ss={}));xe.varKinds={const:new ke.Name("const"),let:new ke.Name("let"),var:new ke.Name("var")};var is=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ke.Name?e:this.name(e)}name(e){return new ke.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};xe.Scope=is;var os=class extends ke.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ke._)`.${new ke.Name(r)}[${n}]`}};xe.ValueScopeName=os;var uy=(0,ke._)`\n`,Vi=class extends is{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?uy:ke.nil}}get(){return this._scope}name(e){return new os(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let f=a.get(o);if(f)return f}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:i,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ke._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=ke.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ss.Started);let f=r(l);if(f){let d=this.opts.es5?xe.varKinds.var:xe.varKinds.const;i=(0,ke._)`${i}${d} ${l} = ${f};${this.opts._n}`}else if(f=s?.(l))i=(0,ke._)`${i}${f}${this.opts._n}`;else throw new Hi(l);c.set(l,ss.Completed)})}return i}};xe.ValueScope=Vi});var I=v(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.or=q.and=q.not=q.CodeGen=q.operators=q.varKinds=q.ValueScopeName=q.ValueScope=q.Scope=q.Name=q.regexpCode=q.stringify=q.getProperty=q.nil=q.strConcat=q.str=q._=void 0;var F=Gr(),Ve=Bi(),mt=Gr();Object.defineProperty(q,"_",{enumerable:!0,get:function(){return mt._}});Object.defineProperty(q,"str",{enumerable:!0,get:function(){return mt.str}});Object.defineProperty(q,"strConcat",{enumerable:!0,get:function(){return mt.strConcat}});Object.defineProperty(q,"nil",{enumerable:!0,get:function(){return mt.nil}});Object.defineProperty(q,"getProperty",{enumerable:!0,get:function(){return mt.getProperty}});Object.defineProperty(q,"stringify",{enumerable:!0,get:function(){return mt.stringify}});Object.defineProperty(q,"regexpCode",{enumerable:!0,get:function(){return mt.regexpCode}});Object.defineProperty(q,"Name",{enumerable:!0,get:function(){return mt.Name}});var ls=Bi();Object.defineProperty(q,"Scope",{enumerable:!0,get:function(){return ls.Scope}});Object.defineProperty(q,"ValueScope",{enumerable:!0,get:function(){return ls.ValueScope}});Object.defineProperty(q,"ValueScopeName",{enumerable:!0,get:function(){return ls.ValueScopeName}});Object.defineProperty(q,"varKinds",{enumerable:!0,get:function(){return ls.varKinds}});q.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Gi=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ve.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=or(this.rhs,e,r)),this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}},as=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof F.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=or(this.rhs,e,r),this}get names(){let e=this.lhs instanceof F.Name?{}:{...this.lhs.names};return us(e,this.rhs)}},Wi=class extends as{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ki=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ji=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yi=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Qi=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=or(this.code,e,r),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}},Wr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(ly(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qt(e,r.names),{})}},st=class extends Wr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xi=class extends Wr{},ir=class extends st{};ir.kind="else";var jt=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ir(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=or(this.condition,e,r),this}get names(){let e=super.names;return us(e,this.condition),this.else&&qt(e,this.else.names),e}};jt.kind="if";var It=class extends st{};It.kind="for";var Zi=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=or(this.iteration,e,r),this}get names(){return qt(super.names,this.iteration.names)}},eo=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ve.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=us(super.names,this.from);return us(e,this.to)}},cs=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=or(this.iterable,e,r),this}get names(){return qt(super.names,this.iterable.names)}},Kr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Kr.kind="func";var Jr=class extends Wr{render(e){return"return "+super.render(e)}};Jr.kind="return";var to=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qt(e,this.catch.names),this.finally&&qt(e,this.finally.names),e}},Yr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yr.kind="catch";var Qr=class extends st{render(e){return"finally"+super.render(e)}};Qr.kind="finally";var ro=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
2
  `:""},this._extScope=e,this._scope=new Ve.Scope({parent:e}),this._nodes=[new Xi]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Gi(e,i,n)),i}const(e,r,n){return this._def(Ve.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ve.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ve.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new as(e,r,n))}add(e,r){return this._leafNode(new Wi(e,q.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==F.nil&&this._leafNode(new Qi(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,F.addCodeArg)(r,s));return r.push("}"),new F._Code(r)}if(e,r,n){if(this._blockNode(new jt(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new jt(e))}else(){return this._elseNode(new ir)}endIf(){return this._endBlockNode(jt,ir)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zi(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ve.varKinds.var:Ve.varKinds.let){let o=this._scope.toName(e);return this._for(new eo(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ve.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof F.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,F._)`${o}.length`,a=>{this.var(i,(0,F._)`${o}[${a}]`),n(i)})}return this._for(new cs("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ve.varKinds.var:Ve.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,F._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new cs("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(It)}label(e){return this._leafNode(new Ki(e))}break(e){return this._leafNode(new Ji(e))}return(e){let r=new Jr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Jr)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new to;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Yr(i),r(i)}return n&&(this._currNode=s.finally=new Qr,this.code(n)),this._endBlockNode(Yr,Qr)}throw(e){return this._leafNode(new Yi(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=F.nil,n,s){return this._blockNode(new Kr(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Kr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof jt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};q.CodeGen=ro;function qt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function us(t,e){return e instanceof F._CodeOrName?qt(t,e.names):t}function or(t,e,r){if(t instanceof F.Name)return n(t);if(!s(t))return t;return new F._Code(t._items.reduce((i,o)=>(o instanceof F.Name&&(o=n(o)),o instanceof F._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof F._Code&&i._items.some(o=>o instanceof F.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ly(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Mu(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,F._)`!${no(t)}`}q.not=Mu;var fy=Lu(q.operators.AND);function dy(...t){return t.reduce(fy)}q.and=dy;var hy=Lu(q.operators.OR);function py(...t){return t.reduce(hy)}q.or=py;function Lu(t){return(e,r)=>e===F.nil?r:r===F.nil?e:(0,F._)`${no(e)} ${t} ${no(r)}`}function no(t){return t instanceof F.Name?t:(0,F._)`(${t})`}});var z=v(M=>{"use strict";u();Object.defineProperty(M,"__esModule",{value:!0});M.checkStrictMode=M.getErrorPath=M.Type=M.useFunc=M.setEvaluated=M.evaluatedPropsToName=M.mergeEvaluated=M.eachItem=M.unescapeJsonPointer=M.escapeJsonPointer=M.escapeFragment=M.unescapeFragment=M.schemaRefOrVal=M.schemaHasRulesButRef=M.schemaHasRules=M.checkUnknownRules=M.alwaysValidSchema=M.toHash=void 0;var W=I(),my=Gr();function yy(t){let e={};for(let r of t)e[r]=!0;return e}M.toHash=yy;function gy(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Uu(t,e),!Hu(e,t.self.RULES.all))}M.alwaysValidSchema=gy;function Uu(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||Gu(t,`unknown keyword: "${i}"`)}M.checkUnknownRules=Uu;function Hu(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}M.schemaHasRules=Hu;function _y(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}M.schemaHasRulesButRef=_y;function wy({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,W._)`${r}`}return(0,W._)`${t}${e}${(0,W.getProperty)(n)}`}M.schemaRefOrVal=wy;function by(t){return Vu(decodeURIComponent(t))}M.unescapeFragment=by;function vy(t){return encodeURIComponent(io(t))}M.escapeFragment=vy;function io(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}M.escapeJsonPointer=io;function Vu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}M.unescapeJsonPointer=Vu;function Ey(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}M.eachItem=Ey;function Fu({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof W.Name?(i instanceof W.Name?t(s,i,o):e(s,i,o),o):i instanceof W.Name?(e(s,o,i),i):r(i,o);return a===W.Name&&!(c instanceof W.Name)?n(s,c):c}}M.mergeEvaluated={props:Fu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,W._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,W._)`${r} || {}`).code((0,W._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,W._)`${r} || {}`),oo(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Bu}),items:Fu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,W._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,W._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Bu(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,W._)`{}`);return e!==void 0&&oo(t,r,e),r}M.evaluatedPropsToName=Bu;function oo(t,e,r){Object.keys(r).forEach(n=>t.assign((0,W._)`${e}${(0,W.getProperty)(n)}`,!0))}M.setEvaluated=oo;var zu={};function Sy(t,e){return t.scopeValue("func",{ref:e,code:zu[e.code]||(zu[e.code]=new my._Code(e.code))})}M.useFunc=Sy;var so;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(so||(M.Type=so={}));function $y(t,e,r){if(t instanceof W.Name){let n=e===so.Num;return r?n?(0,W._)`"[" + ${t} + "]"`:(0,W._)`"['" + ${t} + "']"`:n?(0,W._)`"/" + ${t}`:(0,W._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,W.getProperty)(t).toString():"/"+io(t)}M.getErrorPath=$y;function Gu(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}M.checkStrictMode=Gu});var it=v(ao=>{"use strict";u();Object.defineProperty(ao,"__esModule",{value:!0});var ye=I(),Py={data:new ye.Name("data"),valCxt:new ye.Name("valCxt"),instancePath:new ye.Name("instancePath"),parentData:new ye.Name("parentData"),parentDataProperty:new ye.Name("parentDataProperty"),rootData:new ye.Name("rootData"),dynamicAnchors:new ye.Name("dynamicAnchors"),vErrors:new ye.Name("vErrors"),errors:new ye.Name("errors"),this:new ye.Name("this"),self:new ye.Name("self"),scope:new ye.Name("scope"),json:new ye.Name("json"),jsonPos:new ye.Name("jsonPos"),jsonLen:new ye.Name("jsonLen"),jsonPart:new ye.Name("jsonPart")};ao.default=Py});var Xr=v(ge=>{"use strict";u();Object.defineProperty(ge,"__esModule",{value:!0});ge.extendErrors=ge.resetErrorsCount=ge.reportExtraError=ge.reportError=ge.keyword$DataError=ge.keywordError=void 0;var U=I(),fs=z(),Ee=it();ge.keywordError={message:({keyword:t})=>(0,U.str)`must pass "${t}" keyword validation`};ge.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,U.str)`"${t}" keyword must be ${e} ($data)`:(0,U.str)`"${t}" keyword is invalid ($data)`};function Oy(t,e=ge.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,c=Ju(t,e,r);n??(o||a)?Wu(i,c):Ku(s,(0,U._)`[${c}]`)}ge.reportError=Oy;function Ty(t,e=ge.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=Ju(t,e,r);Wu(s,a),i||o||Ku(n,Ee.default.vErrors)}ge.reportExtraError=Ty;function ky(t,e){t.assign(Ee.default.errors,e),t.if((0,U._)`${Ee.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,U._)`${Ee.default.vErrors}.length`,e),()=>t.assign(Ee.default.vErrors,null)))}ge.resetErrorsCount=ky;function xy({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,Ee.default.errors,a=>{t.const(o,(0,U._)`${Ee.default.vErrors}[${a}]`),t.if((0,U._)`${o}.instancePath === undefined`,()=>t.assign((0,U._)`${o}.instancePath`,(0,U.strConcat)(Ee.default.instancePath,i.errorPath))),t.assign((0,U._)`${o}.schemaPath`,(0,U.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,U._)`${o}.schema`,r),t.assign((0,U._)`${o}.data`,n))})}ge.extendErrors=xy;function Wu(t,e){let r=t.const("err",e);t.if((0,U._)`${Ee.default.vErrors} === null`,()=>t.assign(Ee.default.vErrors,(0,U._)`[${r}]`),(0,U._)`${Ee.default.vErrors}.push(${r})`),t.code((0,U._)`${Ee.default.errors}++`)}function Ku(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,U._)`new ${t.ValidationError}(${e})`):(r.assign((0,U._)`${n}.errors`,e),r.return(!1))}var Dt={keyword:new U.Name("keyword"),schemaPath:new U.Name("schemaPath"),params:new U.Name("params"),propertyName:new U.Name("propertyName"),message:new U.Name("message"),schema:new U.Name("schema"),parentSchema:new U.Name("parentSchema")};function Ju(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,U._)`{}`:Ry(t,e,r)}function Ry(t,e,r={}){let{gen:n,it:s}=t,i=[Cy(s,r),Ny(t,r)];return Ay(t,e,i),n.object(...i)}function Cy({errorPath:t},{instancePath:e}){let r=e?(0,U.str)`${t}${(0,fs.getErrorPath)(e,fs.Type.Str)}`:t;return[Ee.default.instancePath,(0,U.strConcat)(Ee.default.instancePath,r)]}function Ny({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,U.str)`${e}/${t}`;return r&&(s=(0,U.str)`${s}${(0,fs.getErrorPath)(r,fs.Type.Str)}`),[Dt.schemaPath,s]}function Ay(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:f,schemaPath:d}=a;n.push([Dt.keyword,s],[Dt.params,typeof e=="function"?e(t):e||(0,U._)`{}`]),c.messages&&n.push([Dt.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Dt.schema,o],[Dt.parentSchema,(0,U._)`${f}${d}`],[Ee.default.data,i]),l&&n.push([Dt.propertyName,l])}});var Qu=v(ar=>{"use strict";u();Object.defineProperty(ar,"__esModule",{value:!0});ar.boolOrEmptySchema=ar.topBoolOrEmptySchema=void 0;var jy=Xr(),Iy=I(),qy=it(),Dy={message:"boolean schema is false"};function My(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Yu(t,!1):typeof r=="object"&&r.$async===!0?e.return(qy.default.data):(e.assign((0,Iy._)`${n}.errors`,null),e.return(!0))}ar.topBoolOrEmptySchema=My;function Ly(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Yu(t)):r.var(e,!0)}ar.boolOrEmptySchema=Ly;function Yu(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,jy.reportError)(s,Dy,void 0,e)}});var co=v(cr=>{"use strict";u();Object.defineProperty(cr,"__esModule",{value:!0});cr.getRules=cr.isJSONType=void 0;var Fy=["string","number","integer","boolean","null","object","array"],zy=new Set(Fy);function Uy(t){return typeof t=="string"&&zy.has(t)}cr.isJSONType=Uy;function Hy(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}cr.getRules=Hy});var uo=v(yt=>{"use strict";u();Object.defineProperty(yt,"__esModule",{value:!0});yt.shouldUseRule=yt.shouldUseGroup=yt.schemaHasRulesForType=void 0;function Vy({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Xu(t,n)}yt.schemaHasRulesForType=Vy;function Xu(t,e){return e.rules.some(r=>Zu(t,r))}yt.shouldUseGroup=Xu;function Zu(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}yt.shouldUseRule=Zu});var Zr=v(_e=>{"use strict";u();Object.defineProperty(_e,"__esModule",{value:!0});_e.reportTypeError=_e.checkDataTypes=_e.checkDataType=_e.coerceAndCheckDataType=_e.getJSONTypes=_e.getSchemaTypes=_e.DataType=void 0;var By=co(),Gy=uo(),Wy=Xr(),j=I(),el=z(),ur;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ur||(_e.DataType=ur={}));function Ky(t){let e=tl(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_e.getSchemaTypes=Ky;function tl(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(By.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_e.getJSONTypes=tl;function Jy(t,e){let{gen:r,data:n,opts:s}=t,i=Yy(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,Gy.schemaHasRulesForType)(t,e[0]));if(o){let a=fo(e,n,s.strictNumbers,ur.Wrong);r.if(a,()=>{i.length?Qy(t,e,i):ho(t)})}return o}_e.coerceAndCheckDataType=Jy;var rl=new Set(["string","number","integer","boolean","null"]);function Yy(t,e){return e?t.filter(r=>rl.has(r)||e==="array"&&r==="array"):[]}function Qy(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,j._)`typeof ${s}`),a=n.let("coerced",(0,j._)`undefined`);i.coerceTypes==="array"&&n.if((0,j._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,j._)`${s}[0]`).assign(o,(0,j._)`typeof ${s}`).if(fo(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,j._)`${a} !== undefined`);for(let l of r)(rl.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),ho(t),n.endIf(),n.if((0,j._)`${a} !== undefined`,()=>{n.assign(s,a),Xy(t,a)});function c(l){switch(l){case"string":n.elseIf((0,j._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,j._)`"" + ${s}`).elseIf((0,j._)`${s} === null`).assign(a,(0,j._)`""`);return;case"number":n.elseIf((0,j._)`${o} == "boolean" || ${s} === null
3
3
  || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,j._)`+${s}`);return;case"integer":n.elseIf((0,j._)`${o} === "boolean" || ${s} === null
4
4
  || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,j._)`+${s}`);return;case"boolean":n.elseIf((0,j._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,j._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,j._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,j._)`${o} === "string" || ${o} === "number"
@@ -1,4 +1,4 @@
1
- import{c as lh,i as hh,o as Wv}from"./chunk-KADPE3PY.js";import{a as uh,b as ch}from"./chunk-O6CC6JKI.js";import{I as Sn,Na as Vl,Qa as Yl,X as Il,Z as Nl,_ as Rl,b as kl,pa as Ml,y as Pl,ya as Ul}from"./chunk-U7JC7ESX.js";import{F as Bl,G as jl,I as $l,Q as Ko,U as ql,W as Hl}from"./chunk-SBSUITP6.js";import{$a as An,Ad as ah,Ba as z,Bc as th,Bd as dt,Da as Cn,Db as Xl,Dc as jr,Eb as Kl,Ed as K,Fa as Dn,Fb as Ql,Ja as Xo,Jc as F,Ka as Mr,Lc as On,Xc as rh,Ya as $,_c as ih,a as Cl,ad as nh,bb as _n,ca as Al,fa as _l,gc as Zl,ha as Sl,hc as eh,ic as V,ja as Fl,ka as Tl,nb as Ll,oc as Je,qd as sh,sc as nt,tb as Pv,tc as Br,uc as Ee,va as U,wb as Fn,wc as Tn,wd as X,xc as ht,xd as oh,ya as Rr,yc as ft,yd as ie}from"./chunk-DLK7L2KZ.js";import{b as zl,d as Jl,e as Qo,f as Lr,g as Rv,h as Zo,i as Mv,j as Lv,k as Gl,l as ea,n as jv,o as $v,p as ta,q as qv,r as Uv,s as zv}from"./chunk-P3ASN7B5.js";import{a as Nv,c as Wl}from"./chunk-XV44IQDO.js";import{c as Bv,e as Hv}from"./chunk-QJEBL3WX.js";import{b as Iv}from"./chunk-EENHXSWU.js";import{b as N,d as G,e as $t,g as me,h as qt,i as bn,k as Dl,n as Fi}from"./chunk-NOSKVZWJ.js";import{a as kv,b as Ol}from"./chunk-T4M5CWAO.js";import{a as S,c as w,e as At,g as y}from"./chunk-VPRTJUIN.js";var xh=w((PN,yh)=>{"use strict";y();var or=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)}},Pn=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Oi=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 Pn(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 or("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 Pn(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new or("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 or("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 or("Must declare a parseStart method")}};Oi.END=1114112;Oi.Error=or;yh.exports=Oi});var wh=w((NN,vh)=>{"use strict";y();vh.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var In=w((MN,Eh)=>{"use strict";y();Eh.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var Ch=w((BN,bh)=>{"use strict";y();var qr=In(),sa=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${qr(2,this.getUTCMonth()+1)}-${qr(2,this.getUTCDate())}`,r=`${qr(2,this.getUTCHours())}:${qr(2,this.getUTCMinutes())}:${qr(2,this.getUTCSeconds())}.${qr(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};bh.exports=e=>{let t=new sa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var _h=w(($N,Ah)=>{"use strict";y();var Dh=In(),ew=global.Date,oa=class extends ew{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${Dh(2,this.getUTCMonth()+1)}-${Dh(2,this.getUTCDate())}`}};Ah.exports=e=>{let t=new oa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Fh=w((HN,Sh)=>{"use strict";y();var Nn=In(),aa=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Nn(2,this.getUTCHours())}:${Nn(2,this.getUTCMinutes())}:${Nn(2,this.getUTCSeconds())}.${Nn(3,this.getUTCMilliseconds())}`}};Sh.exports=e=>{let t=new aa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Rn=w((exports,module)=>{"use strict";y();module.exports=makeParserClass(xh());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=wh(),createDateTimeFloat=Ch(),createDate=_h(),createTime=Fh(),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 lh,i as hh,o as Wv}from"./chunk-KADPE3PY.js";import{a as uh,b as ch}from"./chunk-T57REQVZ.js";import{I as Sn,Na as Vl,Qa as Yl,X as Il,Z as Nl,_ as Rl,b as kl,pa as Ml,y as Pl,ya as Ul}from"./chunk-TCRHJ3ZH.js";import{F as Bl,G as jl,I as $l,Q as Ko,U as ql,W as Hl}from"./chunk-PB3UDYWH.js";import{$a as An,Ad as ah,Ba as z,Bc as th,Bd as dt,Da as Cn,Db as Xl,Dc as jr,Eb as Kl,Ed as K,Fa as Dn,Fb as Ql,Ja as Xo,Jc as F,Ka as Mr,Lc as On,Xc as rh,Ya as $,_c as ih,a as Cl,ad as nh,bb as _n,ca as Al,fa as _l,gc as Zl,ha as Sl,hc as eh,ic as V,ja as Fl,ka as Tl,nb as Ll,oc as Je,qd as sh,sc as nt,tb as Pv,tc as Br,uc as Ee,va as U,wb as Fn,wc as Tn,wd as X,xc as ht,xd as oh,ya as Rr,yc as ft,yd as ie}from"./chunk-WOERFYNW.js";import{b as zl,d as Jl,e as Qo,f as Lr,g as Rv,h as Zo,i as Mv,j as Lv,k as Gl,l as ea,n as jv,o as $v,p as ta,q as qv,r as Uv,s as zv}from"./chunk-P3ASN7B5.js";import{a as Nv,c as Wl}from"./chunk-XV44IQDO.js";import{c as Bv,e as Hv}from"./chunk-QJEBL3WX.js";import{b as Iv}from"./chunk-EENHXSWU.js";import{b as N,d as G,e as $t,g as me,h as qt,i as bn,k as Dl,n as Fi}from"./chunk-NOSKVZWJ.js";import{a as kv,b as Ol}from"./chunk-T4M5CWAO.js";import{a as S,c as w,e as At,g as y}from"./chunk-VPRTJUIN.js";var xh=w((PN,yh)=>{"use strict";y();var or=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)}},Pn=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Oi=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 Pn(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 or("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 Pn(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new or("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 or("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 or("Must declare a parseStart method")}};Oi.END=1114112;Oi.Error=or;yh.exports=Oi});var wh=w((NN,vh)=>{"use strict";y();vh.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var In=w((MN,Eh)=>{"use strict";y();Eh.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var Ch=w((BN,bh)=>{"use strict";y();var qr=In(),sa=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${qr(2,this.getUTCMonth()+1)}-${qr(2,this.getUTCDate())}`,r=`${qr(2,this.getUTCHours())}:${qr(2,this.getUTCMinutes())}:${qr(2,this.getUTCSeconds())}.${qr(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};bh.exports=e=>{let t=new sa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var _h=w(($N,Ah)=>{"use strict";y();var Dh=In(),ew=global.Date,oa=class extends ew{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${Dh(2,this.getUTCMonth()+1)}-${Dh(2,this.getUTCDate())}`}};Ah.exports=e=>{let t=new oa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Fh=w((HN,Sh)=>{"use strict";y();var Nn=In(),aa=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Nn(2,this.getUTCHours())}:${Nn(2,this.getUTCMinutes())}:${Nn(2,this.getUTCSeconds())}.${Nn(3,this.getUTCMilliseconds())}`}};Sh.exports=e=>{let t=new aa(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Rn=w((exports,module)=>{"use strict";y();module.exports=makeParserClass(xh());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=wh(),createDateTimeFloat=Ch(),createDate=_h(),createTime=Fh(),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 Mn=w((WN,Th)=>{"use strict";y();Th.exports=tw;function tw(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,3 +1,3 @@
1
- import{A as n,a as d,i as g,w}from"./chunk-U7JC7ESX.js";import{P as p,m,n as l}from"./chunk-SBSUITP6.js";import{Ed as a,Kc as x,Vc as C,a as f,sc as y,uc as N,vc as _}from"./chunk-DLK7L2KZ.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-IRR4EZPS.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-TCRHJ3ZH.js";import{P as p,m,n as l}from"./chunk-PB3UDYWH.js";import{Ed as a,Kc as x,Vc as C,a as f,sc as y,uc as N,vc as _}from"./chunk-WOERFYNW.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-54XVSWV5.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};
@@ -1,4 +1,4 @@
1
- import{a as wh,c as Zu,d as b3}from"./chunk-PRKBO42R.js";import{F as w3,G as D1,a as Qr,b as Qt,c as S3,f as x3,g as O3,h as D3,i as x1,j as N3,k as C3,l as R3,p as P3,r as O1}from"./chunk-SBSUITP6.js";import{A as SH,B as xH,Bb as N1,Bd as Wi,C as m3,Cb as ec,D as OH,Db as C1,Dd as n6,E as DH,Eb as F3,Ed as Z,F as h3,Fb as R1,Fc as M3,G as NH,Gc as B3,Hc as U3,Hd as i6,I as v3,Ic as k3,J as CH,Jc as tt,K as y3,Kc as j3,L as Ih,Lc as Lt,M as E3,Mc as V3,N as _3,Nc as q3,O as RH,Oc as G3,P as g3,Pc as $3,Q as PH,Qc as tc,R as IH,Rc as K3,S as wH,T as LH,U as FH,V as T3,W as A3,Wc as P1,Yc as H3,Zc as z3,a as b1,c as Ai,d as l3,dd as Y3,e as p3,ed as Q3,f as d3,fd as Lh,g as S1,gd as W3,hd as J3,i as mH,ib as MH,id as ts,l as f3,nb as I3,nd as X3,o as hH,od as Fh,p as vH,pd as I1,q as yH,r as EH,rd as Z3,s as _H,sd as e6,t as gH,ud as t6,v as TH,w as AH,wd as Ke,x as bH,xd as r6,yb as L3,yd as me,zb as UH}from"./chunk-DLK7L2KZ.js";import{s as BH}from"./chunk-P3ASN7B5.js";import{b as Rh,c as Ph,e as s3,f as u3,n as es,p as c3}from"./chunk-NOSKVZWJ.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 h6=h(ns=>{"use strict";l();Object.defineProperty(ns,"__esModule",{value:!0});ns.versionInfo=ns.version=void 0;var GH="16.10.0";ns.version=GH;var $H=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});ns.versionInfo=$H});var pr=h(kh=>{"use strict";l();Object.defineProperty(kh,"__esModule",{value:!0});kh.devAssert=KH;function KH(t,e){if(!!!t)throw new Error(e)}});var U1=h(jh=>{"use strict";l();Object.defineProperty(jh,"__esModule",{value:!0});jh.isPromise=HH;function HH(t){return typeof t?.then=="function"}});var $n=h(Vh=>{"use strict";l();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isObjectLike=zH;function zH(t){return typeof t=="object"&&t!==null}});var tr=h(qh=>{"use strict";l();Object.defineProperty(qh,"__esModule",{value:!0});qh.invariant=YH;function YH(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=JH;var QH=tr(),WH=/\r\n|[\n\r]/g;function JH(t,e){let r=0,o=1;for(let a of t.body.matchAll(WH)){if(typeof a.index=="number"||(0,QH.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=ZH;j1.printSourceLocation=y6;var XH=k1();function ZH(t){return y6(t.source,(0,XH.getLocation)(t.source,t.start))}function y6(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 b3}from"./chunk-PRKBO42R.js";import{F as w3,G as D1,a as Qr,b as Qt,c as S3,f as x3,g as O3,h as D3,i as x1,j as N3,k as C3,l as R3,p as P3,r as O1}from"./chunk-PB3UDYWH.js";import{A as SH,B as xH,Bb as N1,Bd as Wi,C as m3,Cb as ec,D as OH,Db as C1,Dd as n6,E as DH,Eb as F3,Ed as Z,F as h3,Fb as R1,Fc as M3,G as NH,Gc as B3,Hc as U3,Hd as i6,I as v3,Ic as k3,J as CH,Jc as tt,K as y3,Kc as j3,L as Ih,Lc as Lt,M as E3,Mc as V3,N as _3,Nc as q3,O as RH,Oc as G3,P as g3,Pc as $3,Q as PH,Qc as tc,R as IH,Rc as K3,S as wH,T as LH,U as FH,V as T3,W as A3,Wc as P1,Yc as H3,Zc as z3,a as b1,c as Ai,d as l3,dd as Y3,e as p3,ed as Q3,f as d3,fd as Lh,g as S1,gd as W3,hd as J3,i as mH,ib as MH,id as ts,l as f3,nb as I3,nd as X3,o as hH,od as Fh,p as vH,pd as I1,q as yH,r as EH,rd as Z3,s as _H,sd as e6,t as gH,ud as t6,v as TH,w as AH,wd as Ke,x as bH,xd as r6,yb as L3,yd as me,zb as UH}from"./chunk-WOERFYNW.js";import{s as BH}from"./chunk-P3ASN7B5.js";import{b as Rh,c as Ph,e as s3,f as u3,n as es,p as c3}from"./chunk-NOSKVZWJ.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 h6=h(ns=>{"use strict";l();Object.defineProperty(ns,"__esModule",{value:!0});ns.versionInfo=ns.version=void 0;var GH="16.10.0";ns.version=GH;var $H=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});ns.versionInfo=$H});var pr=h(kh=>{"use strict";l();Object.defineProperty(kh,"__esModule",{value:!0});kh.devAssert=KH;function KH(t,e){if(!!!t)throw new Error(e)}});var U1=h(jh=>{"use strict";l();Object.defineProperty(jh,"__esModule",{value:!0});jh.isPromise=HH;function HH(t){return typeof t?.then=="function"}});var $n=h(Vh=>{"use strict";l();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isObjectLike=zH;function zH(t){return typeof t=="object"&&t!==null}});var tr=h(qh=>{"use strict";l();Object.defineProperty(qh,"__esModule",{value:!0});qh.invariant=YH;function YH(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=JH;var QH=tr(),WH=/\r\n|[\n\r]/g;function JH(t,e){let r=0,o=1;for(let a of t.body.matchAll(WH)){if(typeof a.index=="number"||(0,QH.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=ZH;j1.printSourceLocation=y6;var XH=k1();function ZH(t){return y6(t.source,(0,XH.getLocation)(t.source,t.start))}function y6(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+v6([[`${i} |`,b[0]],...b.slice(1,_+1).map(R=>["|",R]),["|","^".padStart(T)],["|",b[_+1]]])}return c+v6([[`${i-1} |`,p[a-1]],[`${i} |`,d],["|","^".padStart(u)],[`${i+1} |`,p[a+1]]])}function v6(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=nz;is.printError=rz;var ez=$n(),E6=k1(),_6=$h();function tz(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}=tz(r);super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=p??void 0,this.nodes=g6(Array.isArray(i)?i:i?[i]:void 0);let _=g6((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,E6.getLocation)(n,b)):_?.map(b=>(0,E6.getLocation)(b.source,b.start));let T=(0,ez.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,7 +770,7 @@ metadata was removed`},g=le(f,null,null,{redactedPaths:Wb,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={},CK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=CK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},RK=Ja.getStack,PK=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=RK();return function(O){if(O){O.stack&&PK(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"),IK={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)}},n3=oe("path"),wK=n3.join,LK=n3.resolve,i3=function(f){return wK(LK(f),"/")},FK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=i3(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 MK(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 o3=3,a3=200,BK=oe("fs"),UK=BK.createReadStream,kK=oe("stream"),jK=kK.Writable,VK=B$(),qK=k$(),GK=oe("path"),$K={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=GK.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);KK(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)},[]);zK(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"}}},KK=function(f,E,g){var y=E-o3,A=E+o3,O=UK(f,{encoding:"utf8"}),C=new qK.LineStream({keepEmptyLines:!0}),j=new HK({start:y,end:A});j.on("done",function(){return O.destroy()}),VK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},HK=(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}MK(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<=a3?A:A.substr(0,a3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(jK),zK=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))})})},YK=Ja.maybeUseFallbackStack,Oh,QK={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&&YK(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,WK={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)}},JK=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 XK(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 ZK=10*1e3,eH=oe("events").EventEmitter,tH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||ZK,A._summarize=A._summarize.bind(A),A}XK(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=rH(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})(eH),rH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},nH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new tH(g._config.sessionSummaryInterval),E.on("summary",iH(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"}}},iH=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 JK({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)}}},oH={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,"/"))})})}},aH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=i3(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 sH="Bugsnag Node",uH="8.8.0",cH="https://github.com/bugsnag/bugsnag-js",lH=oe("async_hooks"),pH=lH.AsyncLocalStorage;m1.__type="nodejs";var dH=Ch({},I.schema,SK),fH=[NK,$K,FK,aH,nH,IK,QK,WK,g1,_1,oH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,dH,fH,{name:sH,version:uH,url:cH});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 pH,E._setDelivery(gK),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 G$=h((yQe,q$)=>{l();q$.exports=V$()});l();l();l();l();l();l();import w1 from"crypto";function o6(t){return w1.createHash("sha1").update(t).digest("hex")}function V4e(t){return w1.createHash("md5").update(t).digest("hex")}function q4e(){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[Ai.appAutomationToken]??t[Ai.partnersToken]}function Q4e(){let t=Ji()[l3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function a6(){let t=Ji()[Ai.identityToken],e=Ji()[Ai.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function W4e(t=Ji()){return c3()||b1(t[Ai.json])}function s6(){return b1(Ji()[Ai.neverUsePartnersApi])}function u6(t=Ji()){return b1(t[Ai.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ai.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();function rs(t){let e=new URL(t);return e.searchParams.has("subject_token")&&e.searchParams.set("subject_token","****"),e.searchParams.has("token")&&e.searchParams.set("token","****"),e.toString()}l();l();var Xi="3.93.0";import kH 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={},CK=Ja.getStack;_1={name:"contextualize",load:function(f){var E=function(g,y){var A=CK(),O=bh(f);return O.fallbackStack=A,O.addOnError(y),f._clientContext.run(O,g)};return E}},_1.default=_1;var g1={},RK=Ja.getStack,PK=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=RK();return function(O){if(O){O.stack&&PK(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"),IK={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)}},n3=oe("path"),wK=n3.join,LK=n3.resolve,i3=function(f){return wK(LK(f),"/")},FK={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=i3(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 MK(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 o3=3,a3=200,BK=oe("fs"),UK=BK.createReadStream,kK=oe("stream"),jK=kK.Writable,VK=B$(),qK=k$(),GK=oe("path"),$K={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=GK.resolve(f._config.projectRoot,g.file),j=C+"@"+g.lineNumber;if(j in y)return g.code=y[j],A(g);KK(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)},[]);zK(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"}}},KK=function(f,E,g){var y=E-o3,A=E+o3,O=UK(f,{encoding:"utf8"}),C=new qK.LineStream({keepEmptyLines:!0}),j=new HK({start:y,end:A});j.on("done",function(){return O.destroy()}),VK(O,C,j,function(K){if(K&&K.message!=="premature close")return g(K);g(null,j.getCode())})},HK=(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}MK(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<=a3?A:A.substr(0,a3),C(null)):(this.emit("done"),C(null))},g.getCode=function(){return this._code},E})(jK),zK=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))})})},YK=Ja.maybeUseFallbackStack,Oh,QK={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&&YK(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,WK={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)}},JK=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 XK(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 ZK=10*1e3,eH=oe("events").EventEmitter,tH=(function(f){function E(y){var A;return A=f.call(this)||this,A._sessions=new Map,A._interval=null,A._intervalLength=y||ZK,A._summarize=A._summarize.bind(A),A}XK(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=rH(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})(eH),rH=function(f){var E=new Date(f);return E.setSeconds(0),E.setMilliseconds(0),E.toISOString()},nH={load:function(f){var E=null;f._sessionDelegate={startSession:function(g,y){return E||(E=new tH(g._config.sessionSummaryInterval),E.on("summary",iH(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"}}},iH=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 JK({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)}}},oH={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,"/"))})})}},aH={load:function(f){return f.addOnError(function(E){if(f._config.projectRoot){var g=i3(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 sH="Bugsnag Node",uH="8.8.0",cH="https://github.com/bugsnag/bugsnag-js",lH=oe("async_hooks"),pH=lH.AsyncLocalStorage;m1.__type="nodejs";var dH=Ch({},I.schema,SK),fH=[NK,$K,FK,aH,nH,IK,QK,WK,g1,_1,oH,Ah],_n={_client:null,createClient:function(f){typeof f=="string"&&(f={apiKey:f}),f||(f={});var E=new y1(f,dH,fH,{name:sH,version:uH,url:cH});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 pH,E._setDelivery(gK),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 G$=h((yQe,q$)=>{l();q$.exports=V$()});l();l();l();l();l();l();import w1 from"crypto";function o6(t){return w1.createHash("sha1").update(t).digest("hex")}function V4e(t){return w1.createHash("md5").update(t).digest("hex")}function q4e(){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[Ai.appAutomationToken]??t[Ai.partnersToken]}function Q4e(){let t=Ji()[l3.backendPort];if(t&&!isNaN(Number(t)))return Number(t)}function a6(){let t=Ji()[Ai.identityToken],e=Ji()[Ai.refreshToken];if(!(!t||!e))return{accessToken:t,refreshToken:e,userId:Wr(t)}}function W4e(t=Ji()){return c3()||b1(t[Ai.json])}function s6(){return b1(Ji()[Ai.neverUsePartnersApi])}function u6(t=Ji()){return b1(t[Ai.skipNetworkLevelRetry])}function Mh(t=Ji()){let e=t[Ai.maxRequestTimeForNetworkCalls];return e&&!isNaN(Number(e))?Number(e):30*1e3}l();function rs(t){let e=new URL(t);return e.searchParams.has("subject_token")&&e.searchParams.set("subject_token","****"),e.searchParams.has("token")&&e.searchParams.set("token","****"),e.toString()}l();l();var Xi="3.93.1";import kH 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 kH.Agent({rejectUnauthorized:!0,keepAlive:!0})}l();l();var jH=300,M1=1e4;function VH(t,e,r=M1/3){if(t===0)return 0;let o=2**(t-1);return Math.min(e*o,r)}async function*qH(t,e){let r=0;for(;;){let o=VH(r,e);if(!t(o))return{remainingMs:0,iterations:r};await P1(o/1e3),yield o,r++}}async function*c6(t=M1,e=jH){if(t<=0)return{remainingMs:0,iterations:0};let r=Date.now(),o=qH(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 l6=t=>t.toUpperCase(),p6=t=>{let e={};return t.forEach((r,o)=>{e[o]=r}),e};l();var d6=(t,e,r)=>t.document?t:{document:t,variables:e,requestHeaders:r,signal:void 0},f6=(t,e,r)=>t.query?t:{query:t,variables:e,requestHeaders:r,signal:void 0},m6=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};l();var nd=et(g9(),1),T9=t=>{let e,r=t.definitions.filter(o=>o.kind==="OperationDefinition");return r.length===1&&(e=r[0]?.name?.value),e},Ri=t=>{if(typeof t=="string"){let r;try{let o=(0,nd.parse)(t);r=T9(o)}catch{}return{query:t,operationName:r}}let e=T9(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(n8(),1);l();var roe="connection_init",noe="connection_ack",o8="ping",a8="pong",ioe="subscribe",ooe="next",aoe="error",s8="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(uoe(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=soe(i.data);switch(n.type){case noe:{this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,o&&o(n.payload));return}case o8:{a?a(n.payload).then(d=>e.send(i8(d).text)):e.send(i8(null).text);return}case a8:{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 ooe:{!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 aoe:{p.error&&p.error(new Ar({errors:n.payload,status:200},{query:u,variables:c}));return}case s8:{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(loe(s,{query:e,operationName:r,variables:a}).text),()=>{this.socket.send(poe(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}=Ri(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(coe(e).text)}close(){this.socket.close(1e3)}};Ed.PROTOCOL="graphql-transport-ws";function soe(t,e=r=>r){return yo.parse(t,e)}function uoe(t){return new yo(roe,t)}function coe(t){return new yo(o8,t,void 0)}function i8(t){return new yo(a8,t,void 0)}function loe(t,e){return new yo(ioe,e,t)}function poe(t){return new yo(s8,void 0,t)}var Rs=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||Eo&&Eo.Headers&&t instanceof Eo.Headers?e=p6(t):Array.isArray(t)?t.forEach(([r,o])=>{r&&o!==void 0&&(e[r]=o)}):e=t),e},u8=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),doe=t=>{if(!Array.isArray(t.query)){let o=t,a=[`query=${encodeURIComponent(u8(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:u8(a),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),o),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(r))}`},foe=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=moe(o,a,s,n.jsonSerializer),typeof d=="string"&&(c["Content-Type"]="application/json")):p=doe({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=f6(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}=Ri(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=d6(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}=Ri(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=m6(e,r),{headers:a,...s}=this.requestConfig;o.signal!==void 0&&(s.signal=o.signal);let i=o.documents.map(({document:u})=>Ri(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=foe(l6(t.method??"post")),s=Array.isArray(t.query),i=await a(t),n=await hoe(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 moe=(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)},hoe=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,J5e=(t,...e)=>t.reduce((r,o,a)=>`${r}${o}${a in e?String(e[a]):""}`,"");import{performance as n_}from"perf_hooks";var l8=["admin","storefront-renderer","partners","business-platform","app-management"],voe=1e3,yoe=10,Eoe=new Set(["cache-control","content-type","etag","x-request-id","server-timing","retry-after"]);function c8(t){return Eoe.has(t)}function p8(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 cDe(t){if(p8(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 _oe(t){if(!t.useNetworkLevelRetry)return t.request();let e;for await(let r of c6(t.maxRetryTimeMs))try{return await t.request()}catch(o){if(e=o,!p8(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 _oe(t),s.headers.forEach((n,u)=>{c8(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)c8(p)&&(o[p]=d);let c=Zi(o);if(goe(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 goe(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 d8(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}
@@ -1 +1 @@
1
- import{Da as F,a as s,sa as R}from"./chunk-U7JC7ESX.js";import{G as P,M as _,N as x,O as k,S as T,U as b,q as f,s as C,t as L}from"./chunk-SBSUITP6.js";import{Bd as l,Cb as $,Eb as V,Ed as r,Fd as m,Vc as W,Yc as v,ad as G,lb as I,mb as E,nb as M,qb as g,rb as O,uc as N,wd as u,yc as J,yd as d}from"./chunk-DLK7L2KZ.js";import{m as U,n as D,o as S}from"./chunk-NOSKVZWJ.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var H=e=>{let t=R();if(t){let n=e.id.includes("theme");Z(t,n)}};function Z(e,t){let a=`Upgrade to the latest CLI version by ${new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(e)}.`;N({headline:a,body:"This command requires an upgrade to continue working as intended.",nextSteps:[["Run",{command:"upgrade"},"to",{link:{label:"upgrade Shopify CLI",url:t?"https://shopify.dev/docs/themes/tools/cli#upgrade-shopify-cli":"https://shopify.dev/docs/apps/tools/cli#upgrade-shopify-cli"}}]]})}c();function Y(){let e=g();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function q(){let e=S()??D(),t=O(e),n=M();if(!n&&G()){l("Skipping upgrade in development mode.");return}if(n){let o=Y();if(!o)throw new Error("Could not determine the package manager");let[a,...p]=o.split(" ");if(!a)throw new Error("Could not determine the command to run");l(d`Upgrading Shopify CLI by running: ${u.genericShellCommand(o)}...`),await W(a,p,{stdio:"inherit"})}else if(t)await ee(t,s);else throw new Error("Could not determine the local project directory")}function B(){let e=s,t=k("@shopify/cli",e);if(!t){r("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return r("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),t;if(!C()){r("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(v()){r("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(I(e)){r("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return t}async function K(){if(v()||I(s)||C())return;let e=k("@shopify/cli",s);e&&await f("warn-on-available-upgrade",{days:1},async()=>{m(y(e))})}function y(e){let t=Y();return t?d`💡 Version ${e} available! Run ${u.genericShellCommand(t)}`.value:d`💡 Version ${e} available!`.value}async function Ie(){let e=await J({message:"Enable automatic updates for Shopify CLI?",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, I'll update manually"});return L(e),e}async function ee(e,t){let n=(await b(e)).content,o=n.dependencies??{},a=n.devDependencies??{},i={...o,...a}[await A()];if(!i){r("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}i.slice(0,1).match(/[\^~]/)&&(i=t);let h=await x(await A(),i);h?oe(i,h):ne(i),await j("prod",o,e),await j("dev",a,e)}async function j(e,t,n){let o=[await A(),...await te()].filter(p=>!!t[p]).map(p=>({name:p,version:"latest"})),a=await _(n);o.length>0&&await T(o,{packageManager:await P(n),type:e,directory:n,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:a})}async function A(){return(await z()).name}async function te(){return(await z())?.oclif?.plugins??[]}var w;async function z(){if(!w){let e=await b(U(import.meta.url));w=w??e.content}return w}function ne(e){l(d`You're on the latest version, ${u.yellow(e)}, no need to upgrade!`)}function oe(e,t){l(d`Upgrading CLI from ${u.yellow(e)} to ${u.yellow(t)}...`)}var X=!1;function Oe(){return X}var Pe=async({config:e,Command:t})=>{await re(t),await F({config:e,exitMode:"ok"}),H(t);let n=t.id.replace(/:/g," ");if(r(`Completed command ${n}`),X=!0,!t.id?.includes("upgrade")&&!t.id?.startsWith("notifications"))try{await ae()}catch(o){r(`Auto-upgrade check failed: ${o}`)}};async function ae(){let e=B();if(!e){await K();return}process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1"?await Q(e):await f("auto-upgrade",{days:1},async()=>{await Q(e)})}async function Q(e){if(E(s,e))return m(y(e));try{await q()}catch(t){let n=`Auto-upgrade failed: ${t}`;r(n),m(y(e));let{sendErrorToBugsnag:o}=await import("./error-handler-IRR4EZPS.js"),a=Object.assign(new Error(n),{packageManager:g(),platform:process.platform,cliVersion:s});await o(a,"expected_error")}}async function re(e){let t=new Date().getTime();if(e&&Object.prototype.hasOwnProperty.call(e,"analyticsStopCommand")){let n=e.analyticsStopCommand();if(n){let{commandStartOptions:o}=$();if(!o)return;await V(()=>({commandStartOptions:{...o,startTime:t,startCommand:n}}))}}}export{q as a,Ie as b,Oe as c,Pe as d};
1
+ import{Da as F,a as s,sa as R}from"./chunk-TCRHJ3ZH.js";import{G as P,M as _,N as x,O as k,S as T,U as b,q as f,s as C,t as L}from"./chunk-PB3UDYWH.js";import{Bd as l,Cb as $,Eb as V,Ed as r,Fd as m,Vc as W,Yc as v,ad as G,lb as I,mb as E,nb as M,qb as g,rb as O,uc as N,wd as u,yc as J,yd as d}from"./chunk-WOERFYNW.js";import{m as U,n as D,o as S}from"./chunk-NOSKVZWJ.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var H=e=>{let t=R();if(t){let n=e.id.includes("theme");Z(t,n)}};function Z(e,t){let a=`Upgrade to the latest CLI version by ${new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(e)}.`;N({headline:a,body:"This command requires an upgrade to continue working as intended.",nextSteps:[["Run",{command:"upgrade"},"to",{link:{label:"upgrade Shopify CLI",url:t?"https://shopify.dev/docs/themes/tools/cli#upgrade-shopify-cli":"https://shopify.dev/docs/apps/tools/cli#upgrade-shopify-cli"}}]]})}c();function Y(){let e=g();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function q(){let e=S()??D(),t=O(e),n=M();if(!n&&G()){l("Skipping upgrade in development mode.");return}if(n){let o=Y();if(!o)throw new Error("Could not determine the package manager");let[a,...p]=o.split(" ");if(!a)throw new Error("Could not determine the command to run");l(d`Upgrading Shopify CLI by running: ${u.genericShellCommand(o)}...`),await W(a,p,{stdio:"inherit"})}else if(t)await ee(t,s);else throw new Error("Could not determine the local project directory")}function B(){let e=s,t=k("@shopify/cli",e);if(!t){r("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return r("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),t;if(!C()){r("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(v()){r("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(I(e)){r("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return t}async function K(){if(v()||I(s)||C())return;let e=k("@shopify/cli",s);e&&await f("warn-on-available-upgrade",{days:1},async()=>{m(y(e))})}function y(e){let t=Y();return t?d`💡 Version ${e} available! Run ${u.genericShellCommand(t)}`.value:d`💡 Version ${e} available!`.value}async function Ie(){let e=await J({message:"Enable automatic updates for Shopify CLI?",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, I'll update manually"});return L(e),e}async function ee(e,t){let n=(await b(e)).content,o=n.dependencies??{},a=n.devDependencies??{},i={...o,...a}[await A()];if(!i){r("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}i.slice(0,1).match(/[\^~]/)&&(i=t);let h=await x(await A(),i);h?oe(i,h):ne(i),await j("prod",o,e),await j("dev",a,e)}async function j(e,t,n){let o=[await A(),...await te()].filter(p=>!!t[p]).map(p=>({name:p,version:"latest"})),a=await _(n);o.length>0&&await T(o,{packageManager:await P(n),type:e,directory:n,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:a})}async function A(){return(await z()).name}async function te(){return(await z())?.oclif?.plugins??[]}var w;async function z(){if(!w){let e=await b(U(import.meta.url));w=w??e.content}return w}function ne(e){l(d`You're on the latest version, ${u.yellow(e)}, no need to upgrade!`)}function oe(e,t){l(d`Upgrading CLI from ${u.yellow(e)} to ${u.yellow(t)}...`)}var X=!1;function Oe(){return X}var Pe=async({config:e,Command:t})=>{await re(t),await F({config:e,exitMode:"ok"}),H(t);let n=t.id.replace(/:/g," ");if(r(`Completed command ${n}`),X=!0,!t.id?.includes("upgrade")&&!t.id?.startsWith("notifications"))try{await ae()}catch(o){r(`Auto-upgrade check failed: ${o}`)}};async function ae(){let e=B();if(!e){await K();return}process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1"?await Q(e):await f("auto-upgrade",{days:1},async()=>{await Q(e)})}async function Q(e){if(E(s,e))return m(y(e));try{await q()}catch(t){let n=`Auto-upgrade failed: ${t}`;r(n),m(y(e));let{sendErrorToBugsnag:o}=await import("./error-handler-54XVSWV5.js"),a=Object.assign(new Error(n),{packageManager:g(),platform:process.platform,cliVersion:s});await o(a,"expected_error")}}async function re(e){let t=new Date().getTime();if(e&&Object.prototype.hasOwnProperty.call(e,"analyticsStopCommand")){let n=e.analyticsStopCommand();if(n){let{commandStartOptions:o}=$();if(!o)return;await V(()=>({commandStartOptions:{...o,startTime:t,startCommand:n}}))}}}export{q as a,Ie as b,Oe as c,Pe as d};