@rechargeapps/storefront-client 1.17.1 → 1.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -1
- package/dist/umd/recharge-client.min.js +21 -17
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -701,7 +701,10 @@ interface CreateSubscriptionRequest extends SubType<Subscription, SubscriptionRe
|
|
|
701
701
|
*/
|
|
702
702
|
gift_id?: number;
|
|
703
703
|
}
|
|
704
|
-
interface UpdateSubscriptionRequest extends Partial<Pick<Subscription, 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity'
|
|
704
|
+
interface UpdateSubscriptionRequest extends Partial<Pick<Subscription, 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity'> & {
|
|
705
|
+
/** subscription plan_id - if included on update request then charge/order intervals are not required */
|
|
706
|
+
plan_id?: Plan['id'];
|
|
707
|
+
}> {
|
|
705
708
|
}
|
|
706
709
|
interface BasicSubscriptionParams {
|
|
707
710
|
/** Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response. */
|
|
@@ -928,6 +931,8 @@ interface ShippingLine {
|
|
|
928
931
|
price: string;
|
|
929
932
|
/** The source of the shipping_line. */
|
|
930
933
|
source: string;
|
|
934
|
+
/** The status the shipping_line. */
|
|
935
|
+
status?: 'active' | 'pending' | 'queued';
|
|
931
936
|
/** The title of the shipping_line. */
|
|
932
937
|
title: string;
|
|
933
938
|
/** A boolean indicating if the shipping_line is taxable. */
|
|
@@ -1149,6 +1154,10 @@ interface Charge {
|
|
|
1149
1154
|
total_refunds: string;
|
|
1150
1155
|
/** The total tax due associated with the Charge. */
|
|
1151
1156
|
total_tax: string;
|
|
1157
|
+
/** A boolean indicating if the total price includes taxes. */
|
|
1158
|
+
taxes_included: boolean;
|
|
1159
|
+
/** The total duties associated with the Charge. */
|
|
1160
|
+
total_duties: string;
|
|
1152
1161
|
/** The total weight of the Charge’s line items in grams. */
|
|
1153
1162
|
total_weight_grams: number;
|
|
1154
1163
|
/** An indicator of the Charge’s type, either checkout or recurring. */
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
// recharge-client-1.17.
|
|
2
|
-
(function(
|
|
3
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var f=a.join(":").trim();e.append(s,f)}}),e}Bn.call(Ue.prototype);function he(t,e){if(!(this instanceof he))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new q(e.headers),this.url=e.url||"",this._initBody(t)}Bn.call(he.prototype),he.prototype.clone=function(){return new he(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new q(this.headers),url:this.url})},he.error=function(){var t=new he(null,{status:0,statusText:""});return t.type="error",t};var qo=[301,302,303,307,308];he.redirect=function(t,e){if(qo.indexOf(e)===-1)throw new RangeError("Invalid status code");return new he(null,{status:e,headers:{location:t}})};var Ce=J.DOMException;try{new Ce}catch{Ce=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},Ce.prototype=Object.create(Error.prototype),Ce.prototype.constructor=Ce}function On(t,e){return new Promise(function(r,n){var a=new Ue(t,e);if(a.signal&&a.signal.aborted)return n(new Ce("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:jo(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var m="response"in s?s.response:s.responseText;setTimeout(function(){r(new he(m,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new Ce("Aborted","AbortError"))},0)};function p(h){try{return h===""&&J.location.href?J.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(te.blob?s.responseType="blob":te.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof q)?Object.getOwnPropertyNames(e.headers).forEach(function(h){s.setRequestHeader(h,wr(e.headers[h]))}):a.headers.forEach(function(h,m){s.setRequestHeader(m,h)}),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",f)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}On.polyfill=!0,J.fetch||(J.fetch=On,J.Headers=q,J.Request=Ue,J.Response=he),self.fetch.bind(self);var Vo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,r);if(f.value!==a||f.enumerable!==!0)return!1}return!0},Tn=typeof Symbol<"u"&&Symbol,zo=Vo,Go=function(){return typeof Tn!="function"||typeof Symbol!="function"||typeof Tn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:zo()},Rn={foo:{}},Wo=Object,Ho=function(){return{__proto__:Rn}.foo===Rn.foo&&!({__proto__:null}instanceof Wo)},Yo="Function.prototype.bind called on incompatible ",br=Array.prototype.slice,Xo=Object.prototype.toString,Jo="[object Function]",Ko=function(e){var r=this;if(typeof r!="function"||Xo.call(r)!==Jo)throw new TypeError(Yo+r);for(var n=br.call(arguments,1),a,s=function(){if(this instanceof a){var v=r.apply(this,n.concat(br.call(arguments)));return Object(v)===v?v:this}else return r.apply(e,n.concat(br.call(arguments)))},f=Math.max(0,r.length-n.length),p=[],h=0;h<f;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=function(){};m.prototype=r.prototype,a.prototype=new m,m.prototype=null}return a},Qo=Ko,Er=Function.prototype.bind||Qo,Zo=Er,ea=Zo.call(Function.call,Object.prototype.hasOwnProperty),C,Ye=SyntaxError,Fn=Function,Xe=TypeError,Ar=function(t){try{return Fn('"use strict"; return ('+t+").constructor;")()}catch{}},De=Object.getOwnPropertyDescriptor;if(De)try{De({},"")}catch{De=null}var xr=function(){throw new Xe},ta=De?function(){try{return arguments.callee,xr}catch{try{return De(arguments,"callee").get}catch{return xr}}}():xr,Je=Go(),ra=Ho(),W=Object.getPrototypeOf||(ra?function(t){return t.__proto__}:null),Ke={},na=typeof Uint8Array>"u"||!W?C:W(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?C:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?C:ArrayBuffer,"%ArrayIteratorPrototype%":Je&&W?W([][Symbol.iterator]()):C,"%AsyncFromSyncIteratorPrototype%":C,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?C:Atomics,"%BigInt%":typeof BigInt>"u"?C:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?C:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?C:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?C:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?C:Float32Array,"%Float64Array%":typeof Float64Array>"u"?C:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?C:FinalizationRegistry,"%Function%":Fn,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?C:Int8Array,"%Int16Array%":typeof Int16Array>"u"?C:Int16Array,"%Int32Array%":typeof Int32Array>"u"?C:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Je&&W?W(W([][Symbol.iterator]())):C,"%JSON%":typeof JSON=="object"?JSON:C,"%Map%":typeof Map>"u"?C:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Je||!W?C:W(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?C:Promise,"%Proxy%":typeof Proxy>"u"?C:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?C:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?C:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Je||!W?C:W(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?C:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Je&&W?W(""[Symbol.iterator]()):C,"%Symbol%":Je?Symbol:C,"%SyntaxError%":Ye,"%ThrowTypeError%":ta,"%TypedArray%":na,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?C:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?C:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?C:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?C:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?C:WeakMap,"%WeakRef%":typeof WeakRef>"u"?C:WeakRef,"%WeakSet%":typeof WeakSet>"u"?C:WeakSet};if(W)try{null.error}catch(t){var ia=W(W(t));Ne["%Error.prototype%"]=ia}var oa=function t(e){var r;if(e==="%AsyncFunction%")r=Ar("async function () {}");else if(e==="%GeneratorFunction%")r=Ar("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ar("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=t("%AsyncGenerator%");a&&W&&(r=W(a.prototype))}return Ne[e]=r,r},Pn={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},dt=Er,Nt=ea,aa=dt.call(Function.call,Array.prototype.concat),sa=dt.call(Function.apply,Array.prototype.splice),$n=dt.call(Function.call,String.prototype.replace),Mt=dt.call(Function.call,String.prototype.slice),ua=dt.call(Function.call,RegExp.prototype.exec),ca=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fa=/\\(\\)?/g,la=function(e){var r=Mt(e,0,1),n=Mt(e,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var a=[];return $n(e,ca,function(s,f,p,h){a[a.length]=p?$n(h,fa,"$1"):f||s}),a},pa=function(e,r){var n=e,a;if(Nt(Pn,n)&&(a=Pn[n],n="%"+a[0]+"%"),Nt(Ne,n)){var s=Ne[n];if(s===Ke&&(s=oa(n)),typeof s>"u"&&!r)throw new Xe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Ye("intrinsic "+e+" does not exist!")},Sr=function(e,r){if(typeof e!="string"||e.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(ua(/^%?[^%]*%?$/,e)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=la(e),a=n.length>0?n[0]:"",s=pa("%"+a+"%",r),f=s.name,p=s.value,h=!1,m=s.alias;m&&(a=m[0],sa(n,aa([0,1],m)));for(var v=1,_=!0;v<n.length;v+=1){var b=n[v],y=Mt(b,0,1),x=Mt(b,-1);if((y==='"'||y==="'"||y==="`"||x==='"'||x==="'"||x==="`")&&y!==x)throw new Ye("property names with quotes must have matching quotes");if((b==="constructor"||!_)&&(h=!0),a+="."+b,f="%"+a+"%",Nt(Ne,f))p=Ne[f];else if(p!=null){if(!(b in p)){if(!r)throw new Xe("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&v+1>=n.length){var I=De(p,b);_=!!I,_&&"get"in I&&!("originalValue"in I.get)?p=I.get:p=p[b]}else _=Nt(p,b),p=p[b];_&&!h&&(Ne[f]=p)}}return p},Un={exports:{}};(function(t){var e=Er,r=Sr,n=r("%Function.prototype.apply%"),a=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(a,n),f=r("%Object.getOwnPropertyDescriptor%",!0),p=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}t.exports=function(_){var b=s(e,a,arguments);if(f&&p){var y=f(b,"length");y.configurable&&p(b,"length",{value:1+h(0,_.length-(arguments.length-1))})}return b};var m=function(){return s(e,n,arguments)};p?p(t.exports,"apply",{value:m}):t.exports.apply=m})(Un);var ha=Un.exports,Cn=Sr,Dn=ha,da=Dn(Cn("String.prototype.indexOf")),ya=function(e,r){var n=Cn(e,!!r);return typeof n=="function"&&da(e,".prototype.")>-1?Dn(n):n},Qe=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},de=[],se=[],ga=typeof Uint8Array<"u"?Uint8Array:Array,Ir=!1;function Nn(){Ir=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)de[e]=t[e],se[t.charCodeAt(e)]=e;se["-".charCodeAt(0)]=62,se["_".charCodeAt(0)]=63}function ma(t){Ir||Nn();var e,r,n,a,s,f,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=t[p-2]==="="?2:t[p-1]==="="?1:0,f=new ga(p*3/4-s),n=s>0?p-4:p;var h=0;for(e=0,r=0;e<n;e+=4,r+=3)a=se[t.charCodeAt(e)]<<18|se[t.charCodeAt(e+1)]<<12|se[t.charCodeAt(e+2)]<<6|se[t.charCodeAt(e+3)],f[h++]=a>>16&255,f[h++]=a>>8&255,f[h++]=a&255;return s===2?(a=se[t.charCodeAt(e)]<<2|se[t.charCodeAt(e+1)]>>4,f[h++]=a&255):s===1&&(a=se[t.charCodeAt(e)]<<10|se[t.charCodeAt(e+1)]<<4|se[t.charCodeAt(e+2)]>>2,f[h++]=a>>8&255,f[h++]=a&255),f}function wa(t){return de[t>>18&63]+de[t>>12&63]+de[t>>6&63]+de[t&63]}function va(t,e,r){for(var n,a=[],s=e;s<r;s+=3)n=(t[s]<<16)+(t[s+1]<<8)+t[s+2],a.push(wa(n));return a.join("")}function Mn(t){Ir||Nn();for(var e,r=t.length,n=r%3,a="",s=[],f=16383,p=0,h=r-n;p<h;p+=f)s.push(va(t,p,p+f>h?h:p+f));return n===1?(e=t[r-1],a+=de[e>>2],a+=de[e<<4&63],a+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],a+=de[e>>10],a+=de[e>>4&63],a+=de[e<<2&63],a+="="),s.push(a),s.join("")}function Lt(t,e,r,n,a){var s,f,p=a*8-n-1,h=(1<<p)-1,m=h>>1,v=-7,_=r?a-1:0,b=r?-1:1,y=t[e+_];for(_+=b,s=y&(1<<-v)-1,y>>=-v,v+=p;v>0;s=s*256+t[e+_],_+=b,v-=8);for(f=s&(1<<-v)-1,s>>=-v,v+=n;v>0;f=f*256+t[e+_],_+=b,v-=8);if(s===0)s=1-m;else{if(s===h)return f?NaN:(y?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-m}return(y?-1:1)*f*Math.pow(2,s-n)}function Ln(t,e,r,n,a,s){var f,p,h,m=s*8-a-1,v=(1<<m)-1,_=v>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,x=n?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,f=v):(f=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-f))<1&&(f--,h*=2),f+_>=1?e+=b/h:e+=b*Math.pow(2,1-_),e*h>=2&&(f++,h/=2),f+_>=v?(p=0,f=v):f+_>=1?(p=(e*h-1)*Math.pow(2,a),f=f+_):(p=e*Math.pow(2,_-1)*Math.pow(2,a),f=0));a>=8;t[r+y]=p&255,y+=x,p/=256,a-=8);for(f=f<<a|p,m+=a;m>0;t[r+y]=f&255,y+=x,f/=256,m-=8);t[r+y-x]|=I*128}var _a={}.toString,kn=Array.isArray||function(t){return _a.call(t)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.17.3.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function(U,ge){typeof exports=="object"&&typeof module<"u"?module.exports=ge():typeof define=="function"&&define.amd?define(ge):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=ge())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ge(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Os(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var C=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof C<"u"&&C,q={searchParams:"URLSearchParams"in C,iterable:"Symbol"in C&&"iterator"in Symbol,blob:"FileReader"in C&&"Blob"in C&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in C,arrayBuffer:"ArrayBuffer"in C};function Ss(r){return r&&DataView.prototype.isPrototypeOf(r)}if(q.arrayBuffer)var Is=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],xs=ArrayBuffer.isView||function(r){return r&&Is.indexOf(Object.prototype.toString.call(r))>-1};function ir(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function Wt(r){return typeof r!="string"&&(r=String(r)),r}function Xt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return q.iterable&&(e[Symbol.iterator]=function(){return e}),e}function N(r){this.map={},r instanceof N?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}N.prototype.append=function(r,e){r=ir(r),e=Wt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},N.prototype.delete=function(r){delete this.map[ir(r)]},N.prototype.get=function(r){return r=ir(r),this.has(r)?this.map[r]:null},N.prototype.has=function(r){return this.map.hasOwnProperty(ir(r))},N.prototype.set=function(r,e){this.map[ir(r)]=Wt(e)},N.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},N.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),Xt(r)},N.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),Xt(r)},N.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),Xt(r)},q.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function zt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function Ei(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function Ps(r){var e=new FileReader,t=Ei(e);return e.readAsArrayBuffer(r),t}function Ts(r){var e=new FileReader,t=Ei(e);return e.readAsText(r),t}function Rs(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function Ai(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Oi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:q.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:q.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:q.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():q.arrayBuffer&&q.blob&&Ss(r)?(this._bodyArrayBuffer=Ai(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):q.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||xs(r))?this._bodyArrayBuffer=Ai(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):q.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},q.blob&&(this.blob=function(){var r=zt(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=zt(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(Ps)}),this.text=function(){var r=zt(this);if(r)return r;if(this._bodyBlob)return Ts(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Rs(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},q.formData&&(this.formData=function(){return this.text().then(Ns)}),this.json=function(){return this.text().then(JSON.parse)},this}var Fs=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ms(r){var e=r.toUpperCase();return Fs.indexOf(e)>-1?e:r}function ve(r,e){if(!(this instanceof ve))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof ve){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new N(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new N(e.headers)),this.method=Ms(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}ve.prototype.clone=function(){return new ve(this,{body:this._bodyInit})};function Ns(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function Bs(r){var e=new N,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
3
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}Oi.call(ve.prototype);function z(r,e){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new N(e.headers),this.url=e.url||"",this._initBody(r)}Oi.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},z.error=function(){var r=new z(null,{status:0,statusText:""});return r.type="error",r};var Ds=[301,302,303,307,308];z.redirect=function(r,e){if(Ds.indexOf(e)===-1)throw new RangeError("Invalid status code");return new z(null,{status:e,headers:{location:r}})};var _e=C.DOMException;try{new _e}catch{_e=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},_e.prototype=Object.create(Error.prototype),_e.prototype.constructor=_e}function Si(r,e){return new Promise(function(t,n){var i=new ve(r,e);if(i.signal&&i.signal.aborted)return n(new _e("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:Bs(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new z(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new _e("Aborted","AbortError"))},0)};function u(f){try{return f===""&&C.location.href?C.location.href:f}catch{return f}}a.open(i.method,u(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(q.blob?a.responseType="blob":q.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof N)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,Wt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Si.polyfill=!0,C.fetch||(C.fetch=Si,C.Headers=N,C.Request=ve,C.Response=z),self.fetch.bind(self);var Us=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Ii=typeof Symbol<"u"&&Symbol,Cs=Us,Ls=function(){return typeof Ii!="function"||typeof Symbol!="function"||typeof Ii("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Cs()},xi={foo:{}},ks=Object,js=function(){return{__proto__:xi}.foo===xi.foo&&!({__proto__:null}instanceof ks)},qs="Function.prototype.bind called on incompatible ",Yt=Array.prototype.slice,Vs=Object.prototype.toString,Gs="[object Function]",Hs=function(e){var t=this;if(typeof t!="function"||Vs.call(t)!==Gs)throw new TypeError(qs+t);for(var n=Yt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Yt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Yt.call(arguments)))},o=Math.max(0,t.length-n.length),u=[],f=0;f<o;f++)u.push("$"+f);if(i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Ws=Hs,Kt=Function.prototype.bind||Ws,Xs=Kt,zs=Xs.call(Function.call,Object.prototype.hasOwnProperty),x,Ne=SyntaxError,Pi=Function,Be=TypeError,Zt=function(r){try{return Pi('"use strict"; return ('+r+").constructor;")()}catch{}},me=Object.getOwnPropertyDescriptor;if(me)try{me({},"")}catch{me=null}var Jt=function(){throw new Be},Ys=me?function(){try{return arguments.callee,Jt}catch{try{return me(arguments,"callee").get}catch{return Jt}}}():Jt,De=Ls(),Ks=js(),B=Object.getPrototypeOf||(Ks?function(r){return r.__proto__}:null),Ue={},Zs=typeof Uint8Array>"u"||!B?x:B(Uint8Array),we={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":De&&B?B([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ue,"%AsyncGenerator%":Ue,"%AsyncGeneratorFunction%":Ue,"%AsyncIteratorPrototype%":Ue,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":Pi,"%GeneratorFunction%":Ue,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De&&B?B(B([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De||!B?x:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De||!B?x:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De&&B?B(""[Symbol.iterator]()):x,"%Symbol%":De?Symbol:x,"%SyntaxError%":Ne,"%ThrowTypeError%":Ys,"%TypedArray%":Zs,"%TypeError%":Be,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet};if(B)try{null.error}catch(r){var Js=B(B(r));we["%Error.prototype%"]=Js}var Qs=function r(e){var t;if(e==="%AsyncFunction%")t=Zt("async function () {}");else if(e==="%GeneratorFunction%")t=Zt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Zt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&B&&(t=B(i.prototype))}return we[e]=t,t},Ti={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ar=Kt,Cr=zs,ef=ar.call(Function.call,Array.prototype.concat),rf=ar.call(Function.apply,Array.prototype.splice),Ri=ar.call(Function.call,String.prototype.replace),Lr=ar.call(Function.call,String.prototype.slice),tf=ar.call(Function.call,RegExp.prototype.exec),nf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,af=/\\(\\)?/g,of=function(e){var t=Lr(e,0,1),n=Lr(e,-1);if(t==="%"&&n!=="%")throw new Ne("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ne("invalid intrinsic syntax, expected opening `%`");var i=[];return Ri(e,nf,function(a,o,u,f){i[i.length]=u?Ri(f,af,"$1"):o||a}),i},uf=function(e,t){var n=e,i;if(Cr(Ti,n)&&(i=Ti[n],n="%"+i[0]+"%"),Cr(we,n)){var a=we[n];if(a===Ue&&(a=Qs(n)),typeof a>"u"&&!t)throw new Be("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Ne("intrinsic "+e+" does not exist!")},Qt=function(e,t){if(typeof e!="string"||e.length===0)throw new Be("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Be('"allowMissing" argument must be a boolean');if(tf(/^%?[^%]*%?$/,e)===null)throw new Ne("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=of(e),i=n.length>0?n[0]:"",a=uf("%"+i+"%",t),o=a.name,u=a.value,f=!1,c=a.alias;c&&(i=c[0],rf(n,ef([0,1],c)));for(var l=1,s=!0;l<n.length;l+=1){var h=n[l],y=Lr(h,0,1),m=Lr(h,-1);if((y==='"'||y==="'"||y==="`"||m==='"'||m==="'"||m==="`")&&y!==m)throw new Ne("property names with quotes must have matching quotes");if((h==="constructor"||!s)&&(f=!0),i+="."+h,o="%"+i+"%",Cr(we,o))u=we[o];else if(u!=null){if(!(h in u)){if(!t)throw new Be("base intrinsic for "+e+" exists, but the property is not available.");return}if(me&&l+1>=n.length){var E=me(u,h);s=!!E,s&&"get"in E&&!("originalValue"in E.get)?u=E.get:u=u[h]}else s=Cr(u,h),u=u[h];s&&!f&&(we[o]=u)}}return u},Fi={exports:{}};(function(r){var e=Kt,t=Qt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),u=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}r.exports=function(s){var h=a(e,i,arguments);if(o&&u){var y=o(h,"length");y.configurable&&u(h,"length",{value:1+f(0,s.length-(arguments.length-1))})}return h};var c=function(){return a(e,n,arguments)};u?u(r.exports,"apply",{value:c}):r.exports.apply=c})(Fi);var sf=Fi.exports,Mi=Qt,Ni=sf,ff=Ni(Mi("String.prototype.indexOf")),cf=function(e,t){var n=Mi(e,!!t);return typeof n=="function"&&ff(e,".prototype.")>-1?Ni(n):n},Ce=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Y=[],H=[],lf=typeof Uint8Array<"u"?Uint8Array:Array,en=!1;function Bi(){en=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)Y[e]=r[e],H[r.charCodeAt(e)]=e;H["-".charCodeAt(0)]=62,H["_".charCodeAt(0)]=63}function hf(r){en||Bi();var e,t,n,i,a,o,u=r.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[u-2]==="="?2:r[u-1]==="="?1:0,o=new lf(u*3/4-a),n=a>0?u-4:u;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=H[r.charCodeAt(e)]<<18|H[r.charCodeAt(e+1)]<<12|H[r.charCodeAt(e+2)]<<6|H[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=H[r.charCodeAt(e)]<<2|H[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=H[r.charCodeAt(e)]<<10|H[r.charCodeAt(e+1)]<<4|H[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function pf(r){return Y[r>>18&63]+Y[r>>12&63]+Y[r>>6&63]+Y[r&63]}function df(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(pf(n));return i.join("")}function Di(r){en||Bi();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,u=0,f=t-n;u<f;u+=o)a.push(df(r,u,u+o>f?f:u+o));return n===1?(e=r[t-1],i+=Y[e>>2],i+=Y[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=Y[e>>10],i+=Y[e>>4&63],i+=Y[e<<2&63],i+="="),a.push(i),a.join("")}function kr(r,e,t,n,i){var a,o,u=i*8-n-1,f=(1<<u)-1,c=f>>1,l=-7,s=t?i-1:0,h=t?-1:1,y=r[e+s];for(s+=h,a=y&(1<<-l)-1,y>>=-l,l+=u;l>0;a=a*256+r[e+s],s+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+s],s+=h,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(y?-1:1)*o*Math.pow(2,a-n)}function Ui(r,e,t,n,i,a){var o,u,f,c=a*8-i-1,l=(1<<c)-1,s=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,m=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+s>=1?e+=h/f:e+=h*Math.pow(2,1-s),e*f>=2&&(o++,f/=2),o+s>=l?(u=0,o=l):o+s>=1?(u=(e*f-1)*Math.pow(2,i),o=o+s):(u=e*Math.pow(2,s-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=u&255,y+=m,u/=256,i-=8);for(o=o<<i|u,c+=i;c>0;r[t+y]=o&255,y+=m,o/=256,c-=8);r[t+y-m]|=E*128}var yf={}.toString,Ci=Array.isArray||function(r){return yf.call(r)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
6
6
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/var ba=50;E.TYPED_ARRAY_SUPPORT=Qe.TYPED_ARRAY_SUPPORT!==void 0?Qe.TYPED_ARRAY_SUPPORT:!0,kt();function kt(){return E.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function be(t,e){if(kt()<e)throw new RangeError("Invalid typed array length");return E.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=E.prototype):(t===null&&(t=new E(e)),t.length=e),t}function E(t,e,r){if(!E.TYPED_ARRAY_SUPPORT&&!(this instanceof E))return new E(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Br(this,t)}return jn(this,t,e,r)}E.poolSize=8192,E._augment=function(t){return t.__proto__=E.prototype,t};function jn(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?xa(t,e,r,n):typeof e=="string"?Aa(t,e,r):Sa(t,e)}E.from=function(t,e,r){return jn(null,t,e,r)},E.TYPED_ARRAY_SUPPORT&&(E.prototype.__proto__=Uint8Array.prototype,E.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&E[Symbol.species]);function qn(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ea(t,e,r,n){return qn(e),e<=0?be(t,e):r!==void 0?typeof n=="string"?be(t,e).fill(r,n):be(t,e).fill(r):be(t,e)}E.alloc=function(t,e,r){return Ea(null,t,e,r)};function Br(t,e){if(qn(e),t=be(t,e<0?0:Tr(e)|0),!E.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}E.allocUnsafe=function(t){return Br(null,t)},E.allocUnsafeSlow=function(t){return Br(null,t)};function Aa(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!E.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Vn(e,r)|0;t=be(t,n);var a=t.write(e,r);return a!==n&&(t=t.slice(0,a)),t}function Or(t,e){var r=e.length<0?0:Tr(e.length)|0;t=be(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function xa(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),E.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=E.prototype):t=Or(t,e),t}function Sa(t,e){if(ye(e)){var r=Tr(e.length)|0;return t=be(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||za(e.length)?be(t,0):Or(t,e);if(e.type==="Buffer"&&kn(e.data))return Or(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Tr(t){if(t>=kt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kt().toString(16)+" bytes");return t|0}E.isBuffer=Ga;function ye(t){return!!(t!=null&&t._isBuffer)}E.compare=function(e,r){if(!ye(e)||!ye(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,a=r.length,s=0,f=Math.min(n,a);s<f;++s)if(e[s]!==r[s]){n=e[s],a=r[s];break}return n<a?-1:a<n?1:0},E.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},E.concat=function(e,r){if(!kn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return E.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var a=E.allocUnsafe(r),s=0;for(n=0;n<e.length;++n){var f=e[n];if(!ye(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(a,s),s+=f.length}return a};function Vn(t,e){if(ye(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Vt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Qn(t).length;default:if(n)return Vt(t).length;e=(""+e).toLowerCase(),n=!0}}E.byteLength=Vn;function Ia(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Da(this,e,r);case"utf8":case"utf-8":return Hn(this,e,r);case"ascii":return Ua(this,e,r);case"latin1":case"binary":return Ca(this,e,r);case"base64":return Pa(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Na(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}E.prototype._isBuffer=!0;function Me(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}E.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Me(this,r,r+1);return this},E.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Me(this,r,r+3),Me(this,r+1,r+2);return this},E.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Me(this,r,r+7),Me(this,r+1,r+6),Me(this,r+2,r+5),Me(this,r+3,r+4);return this},E.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Hn(this,0,e):Ia.apply(this,arguments)},E.prototype.equals=function(e){if(!ye(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:E.compare(this,e)===0},E.prototype.inspect=function(){var e="",r=ba;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},E.prototype.compare=function(e,r,n,a,s){if(!ye(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),r<0||n>e.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&r>=n)return 0;if(a>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,s>>>=0,this===e)return 0;for(var f=s-a,p=n-r,h=Math.min(f,p),m=this.slice(a,s),v=e.slice(r,n),_=0;_<h;++_)if(m[_]!==v[_]){f=m[_],p=v[_];break}return f<p?-1:p<f?1:0};function zn(t,e,r,n,a){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof e=="string"&&(e=E.from(e,n)),ye(e))return e.length===0?-1:Gn(t,e,r,n,a);if(typeof e=="number")return e=e&255,E.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Gn(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function Gn(t,e,r,n,a){var s=1,f=t.length,p=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,f/=2,p/=2,r/=2}function h(y,x){return s===1?y[x]:y.readUInt16BE(x*s)}var m;if(a){var v=-1;for(m=r;m<f;m++)if(h(t,m)===h(e,v===-1?0:m-v)){if(v===-1&&(v=m),m-v+1===p)return v*s}else v!==-1&&(m-=m-v),v=-1}else for(r+p>f&&(r=f-p),m=r;m>=0;m--){for(var _=!0,b=0;b<p;b++)if(h(t,m+b)!==h(e,b)){_=!1;break}if(_)return m}return-1}E.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1},E.prototype.indexOf=function(e,r,n){return zn(this,e,r,n,!0)},E.prototype.lastIndexOf=function(e,r,n){return zn(this,e,r,n,!1)};function Ba(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var f=0;f<n;++f){var p=parseInt(e.substr(f*2,2),16);if(isNaN(p))return f;t[r+f]=p}return f}function Oa(t,e,r,n){return zt(Vt(e,t.length-r),t,r,n)}function Wn(t,e,r,n){return zt(qa(e),t,r,n)}function Ta(t,e,r,n){return Wn(t,e,r,n)}function Ra(t,e,r,n){return zt(Qn(e),t,r,n)}function Fa(t,e,r,n){return zt(Va(e,t.length-r),t,r,n)}E.prototype.write=function(e,r,n,a){if(r===void 0)a="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")a=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-r;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var f=!1;;)switch(a){case"hex":return Ba(this,e,r,n);case"utf8":case"utf-8":return Oa(this,e,r,n);case"ascii":return Wn(this,e,r,n);case"latin1":case"binary":return Ta(this,e,r,n);case"base64":return Ra(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fa(this,e,r,n);default:if(f)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),f=!0}},E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pa(t,e,r){return e===0&&r===t.length?Mn(t):Mn(t.slice(e,r))}function Hn(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var s=t[a],f=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=r){var h,m,v,_;switch(p){case 1:s<128&&(f=s);break;case 2:h=t[a+1],(h&192)===128&&(_=(s&31)<<6|h&63,_>127&&(f=_));break;case 3:h=t[a+1],m=t[a+2],(h&192)===128&&(m&192)===128&&(_=(s&15)<<12|(h&63)<<6|m&63,_>2047&&(_<55296||_>57343)&&(f=_));break;case 4:h=t[a+1],m=t[a+2],v=t[a+3],(h&192)===128&&(m&192)===128&&(v&192)===128&&(_=(s&15)<<18|(h&63)<<12|(m&63)<<6|v&63,_>65535&&_<1114112&&(f=_))}}f===null?(f=65533,p=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),a+=p}return $a(n)}var Yn=4096;function $a(t){var e=t.length;if(e<=Yn)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Yn));return r}function Ua(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]&127);return n}function Ca(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function Da(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",s=e;s<r;++s)a+=ja(t[s]);return a}function Na(t,e,r){for(var n=t.slice(e,r),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}E.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var a;if(E.TYPED_ARRAY_SUPPORT)a=this.subarray(e,r),a.__proto__=E.prototype;else{var s=r-e;a=new E(s,void 0);for(var f=0;f<s;++f)a[f]=this[f+e]}return a};function H(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e],s=1,f=0;++f<r&&(s*=256);)a+=this[e+f]*s;return a},E.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e+--r],s=1;r>0&&(s*=256);)a+=this[e+--r]*s;return a},E.prototype.readUInt8=function(e,r){return r||H(e,1,this.length),this[e]},E.prototype.readUInt16LE=function(e,r){return r||H(e,2,this.length),this[e]|this[e+1]<<8},E.prototype.readUInt16BE=function(e,r){return r||H(e,2,this.length),this[e]<<8|this[e+1]},E.prototype.readUInt32LE=function(e,r){return r||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},E.prototype.readUInt32BE=function(e,r){return r||H(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},E.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e],s=1,f=0;++f<r&&(s*=256);)a+=this[e+f]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a},E.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=r,s=1,f=this[e+--a];a>0&&(s*=256);)f+=this[e+--a]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*r)),f},E.prototype.readInt8=function(e,r){return r||H(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},E.prototype.readInt16LE=function(e,r){r||H(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},E.prototype.readInt16BE=function(e,r){r||H(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},E.prototype.readInt32LE=function(e,r){return r||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},E.prototype.readInt32BE=function(e,r){return r||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},E.prototype.readFloatLE=function(e,r){return r||H(e,4,this.length),Lt(this,e,!0,23,4)},E.prototype.readFloatBE=function(e,r){return r||H(e,4,this.length),Lt(this,e,!1,23,4)},E.prototype.readDoubleLE=function(e,r){return r||H(e,8,this.length),Lt(this,e,!0,52,8)},E.prototype.readDoubleBE=function(e,r){return r||H(e,8,this.length),Lt(this,e,!1,52,8)};function re(t,e,r,n,a,s){if(!ye(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}E.prototype.writeUIntLE=function(e,r,n,a){if(e=+e,r=r|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;re(this,e,r,n,s,0)}var f=1,p=0;for(this[r]=e&255;++p<n&&(f*=256);)this[r+p]=e/f&255;return r+n},E.prototype.writeUIntBE=function(e,r,n,a){if(e=+e,r=r|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;re(this,e,r,n,s,0)}var f=n-1,p=1;for(this[r+f]=e&255;--f>=0&&(p*=256);)this[r+f]=e/p&255;return r+n},E.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,1,255,0),E.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function jt(t,e,r,n){e<0&&(e=65535+e+1);for(var a=0,s=Math.min(t.length-r,2);a<s;++a)t[r+a]=(e&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}E.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,65535,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):jt(this,e,r,!0),r+2},E.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,65535,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):jt(this,e,r,!1),r+2};function qt(t,e,r,n){e<0&&(e=4294967295+e+1);for(var a=0,s=Math.min(t.length-r,4);a<s;++a)t[r+a]=e>>>(n?a:3-a)*8&255}E.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,4294967295,0),E.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):qt(this,e,r,!0),r+4},E.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,4294967295,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):qt(this,e,r,!1),r+4},E.prototype.writeIntLE=function(e,r,n,a){if(e=+e,r=r|0,!a){var s=Math.pow(2,8*n-1);re(this,e,r,n,s-1,-s)}var f=0,p=1,h=0;for(this[r]=e&255;++f<n&&(p*=256);)e<0&&h===0&&this[r+f-1]!==0&&(h=1),this[r+f]=(e/p>>0)-h&255;return r+n},E.prototype.writeIntBE=function(e,r,n,a){if(e=+e,r=r|0,!a){var s=Math.pow(2,8*n-1);re(this,e,r,n,s-1,-s)}var f=n-1,p=1,h=0;for(this[r+f]=e&255;--f>=0&&(p*=256);)e<0&&h===0&&this[r+f+1]!==0&&(h=1),this[r+f]=(e/p>>0)-h&255;return r+n},E.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,1,127,-128),E.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1},E.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,32767,-32768),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):jt(this,e,r,!0),r+2},E.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,32767,-32768),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):jt(this,e,r,!1),r+2},E.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,2147483647,-2147483648),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):qt(this,e,r,!0),r+4},E.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):qt(this,e,r,!1),r+4};function Xn(t,e,r,n,a,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Jn(t,e,r,n,a){return a||Xn(t,e,r,4),Ln(t,e,r,n,23,4),r+4}E.prototype.writeFloatLE=function(e,r,n){return Jn(this,e,r,!0,n)},E.prototype.writeFloatBE=function(e,r,n){return Jn(this,e,r,!1,n)};function Kn(t,e,r,n,a){return a||Xn(t,e,r,8),Ln(t,e,r,n,52,8),r+8}E.prototype.writeDoubleLE=function(e,r,n){return Kn(this,e,r,!0,n)},E.prototype.writeDoubleBE=function(e,r,n){return Kn(this,e,r,!1,n)},E.prototype.copy=function(e,r,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r<a-n&&(a=e.length-r+n);var s=a-n,f;if(this===e&&n<r&&r<a)for(f=s-1;f>=0;--f)e[f+r]=this[f+n];else if(s<1e3||!E.TYPED_ARRAY_SUPPORT)for(f=0;f<s;++f)e[f+r]=this[f+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),r);return s},E.prototype.fill=function(e,r,n,a){if(typeof e=="string"){if(typeof r=="string"?(a=r,r=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),e.length===1){var s=e.charCodeAt(0);s<256&&(e=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!E.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=r;f<n;++f)this[f]=e;else{var p=ye(e)?e:Vt(new E(e,a).toString()),h=p.length;for(f=0;f<n-r;++f)this[f+r]=p[f%h]}return this};var Ma=/[^+\/0-9A-Za-z-_]/g;function La(t){if(t=ka(t).replace(Ma,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ka(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ja(t){return t<16?"0"+t.toString(16):t.toString(16)}function Vt(t,e){e=e||1/0;for(var r,n=t.length,a=null,s=[],f=0;f<n;++f){if(r=t.charCodeAt(f),r>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+1===n){(e-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(e-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function qa(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Va(t,e){for(var r,n,a,s=[],f=0;f<t.length&&!((e-=2)<0);++f)r=t.charCodeAt(f),n=r>>8,a=r%256,s.push(a),s.push(n);return s}function Qn(t){return ma(La(t))}function zt(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function za(t){return t!==t}function Ga(t){return t!=null&&(!!t._isBuffer||Zn(t)||Wa(t))}function Zn(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Wa(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Zn(t.slice(0,0))}function ei(){throw new Error("setTimeout has not been defined")}function ti(){throw new Error("clearTimeout has not been defined")}var Be=ei,Oe=ti;typeof Qe.setTimeout=="function"&&(Be=setTimeout),typeof Qe.clearTimeout=="function"&&(Oe=clearTimeout);function ri(t){if(Be===setTimeout)return setTimeout(t,0);if((Be===ei||!Be)&&setTimeout)return Be=setTimeout,setTimeout(t,0);try{return Be(t,0)}catch{try{return Be.call(null,t,0)}catch{return Be.call(this,t,0)}}}function Ha(t){if(Oe===clearTimeout)return clearTimeout(t);if((Oe===ti||!Oe)&&clearTimeout)return Oe=clearTimeout,clearTimeout(t);try{return Oe(t)}catch{try{return Oe.call(null,t)}catch{return Oe.call(this,t)}}}var Ee=[],Ze=!1,Le,Gt=-1;function Ya(){!Ze||!Le||(Ze=!1,Le.length?Ee=Le.concat(Ee):Gt=-1,Ee.length&&ni())}function ni(){if(!Ze){var t=ri(Ya);Ze=!0;for(var e=Ee.length;e;){for(Le=Ee,Ee=[];++Gt<e;)Le&&Le[Gt].run();Gt=-1,e=Ee.length}Le=null,Ze=!1,Ha(t)}}function Xa(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ee.push(new ii(t,e)),Ee.length===1&&!Ze&&ri(ni)}function ii(t,e){this.fun=t,this.array=e}ii.prototype.run=function(){this.fun.apply(null,this.array)};var Ja="browser",Ka="browser",Qa=!0,Za={},es=[],ts="",rs={},ns={},is={};function ke(){}var os=ke,as=ke,ss=ke,us=ke,cs=ke,fs=ke,ls=ke;function ps(t){throw new Error("process.binding is not supported")}function hs(){return"/"}function ds(t){throw new Error("process.chdir is not supported")}function ys(){return 0}var et=Qe.performance||{},gs=et.now||et.mozNow||et.msNow||et.oNow||et.webkitNow||function(){return new Date().getTime()};function ms(t){var e=gs.call(et)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var ws=new Date;function vs(){var t=new Date,e=t-ws;return e/1e3}var tt={nextTick:Xa,title:Ja,browser:Qa,env:Za,argv:es,version:ts,versions:rs,on:os,addListener:as,once:ss,off:us,removeListener:cs,removeAllListeners:fs,emit:ls,binding:ps,cwd:hs,chdir:ds,umask:ys,hrtime:ms,platform:Ka,release:ns,config:is,uptime:vs},Rr;typeof Object.create=="function"?Rr=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Rr=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};var oi=Rr,ai=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},a=0;a<r.length;a++)n[r[a]]=Object.getOwnPropertyDescriptor(e,r[a]);return n},_s=/%[sdj%]/g;function Wt(t){if(!gt(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ge(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,s=String(t).replace(_s,function(p){if(p==="%%")return"%";if(r>=a)return p;switch(p){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return p}}),f=n[r];r<a;f=n[++r])yt(f)||!je(f)?s+=" "+f:s+=" "+ge(f);return s}function Fr(t,e){if(me(Qe.process))return function(){return Fr(t,e).apply(this,arguments)};if(tt.noDeprecation===!0)return t;var r=!1;function n(){if(!r){if(tt.throwDeprecation)throw new Error(e);tt.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n}var Ht={},Pr;function si(t){if(me(Pr)&&(Pr=tt.env.NODE_DEBUG||""),t=t.toUpperCase(),!Ht[t])if(new RegExp("\\b"+t+"\\b","i").test(Pr)){var e=0;Ht[t]=function(){var r=Wt.apply(null,arguments);console.error("%s %d: %s",t,e,r)}}else Ht[t]=function(){};return Ht[t]}function ge(t,e){var r={seen:[],stylize:Es};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Xt(e)?r.showHidden=e:e&&Lr(r,e),me(r.showHidden)&&(r.showHidden=!1),me(r.depth)&&(r.depth=2),me(r.colors)&&(r.colors=!1),me(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=bs),Yt(r,t,r.depth)}ge.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ge.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function bs(t,e){var r=ge.styles[e];return r?"\x1B["+ge.colors[r][0]+"m"+t+"\x1B["+ge.colors[r][1]+"m":t}function Es(t,e){return t}function As(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Yt(t,e,r){if(t.customInspect&&e&&vt(e.inspect)&&e.inspect!==ge&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return gt(n)||(n=Yt(t,n,r)),n}var a=xs(t,e);if(a)return a;var s=Object.keys(e),f=As(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),wt(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return $r(e);if(s.length===0){if(vt(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(mt(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Jt(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wt(e))return $r(e)}var h="",m=!1,v=["{","}"];if(Cr(e)&&(m=!0,v=["[","]"]),vt(e)){var _=e.name?": "+e.name:"";h=" [Function"+_+"]"}if(mt(e)&&(h=" "+RegExp.prototype.toString.call(e)),Jt(e)&&(h=" "+Date.prototype.toUTCString.call(e)),wt(e)&&(h=" "+$r(e)),s.length===0&&(!m||e.length==0))return v[0]+h+v[1];if(r<0)return mt(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var b;return m?b=Ss(t,e,r,f,s):b=s.map(function(y){return Ur(t,e,r,f,y,m)}),t.seen.pop(),Is(b,h,v)}function xs(t,e){if(me(e))return t.stylize("undefined","undefined");if(gt(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(Dr(e))return t.stylize(""+e,"number");if(Xt(e))return t.stylize(""+e,"boolean");if(yt(e))return t.stylize("null","null")}function $r(t){return"["+Error.prototype.toString.call(t)+"]"}function Ss(t,e,r,n,a){for(var s=[],f=0,p=e.length;f<p;++f)hi(e,String(f))?s.push(Ur(t,e,r,n,String(f),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Ur(t,e,r,n,h,!0))}),s}function Ur(t,e,r,n,a,s){var f,p,h;if(h=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]},h.get?h.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):h.set&&(p=t.stylize("[Setter]","special")),hi(n,a)||(f="["+a+"]"),p||(t.seen.indexOf(h.value)<0?(yt(r)?p=Yt(t,h.value,null):p=Yt(t,h.value,r-1),p.indexOf(`
|
|
9
|
-
`)>-1&&(
|
|
10
|
-
`).map(function(
|
|
11
|
-
`).substr(2):
|
|
12
|
-
`+
|
|
13
|
-
`).map(function(
|
|
14
|
-
`))):
|
|
15
|
-
`)>=0,a
|
|
16
|
-
`)+" "+
|
|
17
|
-
`)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Cr(t){return Array.isArray(t)}function Xt(t){return typeof t=="boolean"}function yt(t){return t===null}function ui(t){return t==null}function Dr(t){return typeof t=="number"}function gt(t){return typeof t=="string"}function ci(t){return typeof t=="symbol"}function me(t){return t===void 0}function mt(t){return je(t)&&Nr(t)==="[object RegExp]"}function je(t){return typeof t=="object"&&t!==null}function Jt(t){return je(t)&&Nr(t)==="[object Date]"}function wt(t){return je(t)&&(Nr(t)==="[object Error]"||t instanceof Error)}function vt(t){return typeof t=="function"}function fi(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}function li(t){return E.isBuffer(t)}function Nr(t){return Object.prototype.toString.call(t)}function Mr(t){return t<10?"0"+t.toString(10):t.toString(10)}var Bs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Os(){var t=new Date,e=[Mr(t.getHours()),Mr(t.getMinutes()),Mr(t.getSeconds())].join(":");return[t.getDate(),Bs[t.getMonth()],e].join(" ")}function pi(){console.log("%s - %s",Os(),Wt.apply(null,arguments))}function Lr(t,e){if(!e||!je(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function hi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var qe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function kr(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(qe&&t[qe]){var e=t[qe];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,qe,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var r,n,a=new Promise(function(p,h){r=p,n=h}),s=[],f=0;f<arguments.length;f++)s.push(arguments[f]);s.push(function(p,h){p?n(p):r(h)});try{t.apply(this,s)}catch(p){n(p)}return a}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),qe&&Object.defineProperty(e,qe,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,ai(t))}kr.custom=qe;function Ts(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}function di(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var a=r.pop();if(typeof a!="function")throw new TypeError("The last argument must be of type Function");var s=this,f=function(){return a.apply(s,arguments)};t.apply(this,r).then(function(p){tt.nextTick(f.bind(null,null,p))},function(p){tt.nextTick(Ts.bind(null,p,f))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,ai(t)),e}var Rs={inherits:oi,_extend:Lr,log:pi,isBuffer:li,isPrimitive:fi,isFunction:vt,isError:wt,isDate:Jt,isObject:je,isRegExp:mt,isUndefined:me,isSymbol:ci,isString:gt,isNumber:Dr,isNullOrUndefined:ui,isNull:yt,isBoolean:Xt,isArray:Cr,inspect:ge,deprecate:Fr,format:Wt,debuglog:si,promisify:kr,callbackify:di},Fs=Object.freeze({__proto__:null,_extend:Lr,callbackify:di,debuglog:si,default:Rs,deprecate:Fr,format:Wt,inherits:oi,inspect:ge,isArray:Cr,isBoolean:Xt,isBuffer:li,isDate:Jt,isError:wt,isFunction:vt,isNull:yt,isNullOrUndefined:ui,isNumber:Dr,isObject:je,isPrimitive:fi,isRegExp:mt,isString:gt,isSymbol:ci,isUndefined:me,log:pi,promisify:kr}),Ps=Fo(Fs),$s=Ps.inspect,jr=typeof Map=="function"&&Map.prototype,qr=Object.getOwnPropertyDescriptor&&jr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Kt=jr&&qr&&typeof qr.get=="function"?qr.get:null,yi=jr&&Map.prototype.forEach,Vr=typeof Set=="function"&&Set.prototype,zr=Object.getOwnPropertyDescriptor&&Vr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qt=Vr&&zr&&typeof zr.get=="function"?zr.get:null,gi=Vr&&Set.prototype.forEach,Us=typeof WeakMap=="function"&&WeakMap.prototype,_t=Us?WeakMap.prototype.has:null,Cs=typeof WeakSet=="function"&&WeakSet.prototype,bt=Cs?WeakSet.prototype.has:null,Ds=typeof WeakRef=="function"&&WeakRef.prototype,mi=Ds?WeakRef.prototype.deref:null,Ns=Boolean.prototype.valueOf,Ms=Object.prototype.toString,Ls=Function.prototype.toString,ks=String.prototype.match,Gr=String.prototype.slice,Te=String.prototype.replace,js=String.prototype.toUpperCase,wi=String.prototype.toLowerCase,vi=RegExp.prototype.test,_i=Array.prototype.concat,we=Array.prototype.join,qs=Array.prototype.slice,bi=Math.floor,Wr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Hr=Object.getOwnPropertySymbols,Yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,rt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",K=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===rt||"symbol")?Symbol.toStringTag:null,Ei=Object.prototype.propertyIsEnumerable,Ai=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function xi(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||vi.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-bi(-t):bi(t);if(n!==t){var a=String(n),s=Gr.call(e,a.length+1);return Te.call(a,r,"$&_")+"."+Te.call(Te.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Te.call(e,r,"$&_")}var Xr=$s,Si=Xr.custom,Ii=Ti(Si)?Si:null,Vs=function t(e,r,n,a){var s=r||{};if(Re(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=Re(s,"customInspect")?s.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Fi(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return p?xi(e,h):h}if(typeof e=="bigint"){var m=String(e)+"n";return p?xi(e,m):m}var v=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=v&&v>0&&typeof e=="object")return Jr(e)?"[Array]":"[Object]";var _=su(s,n);if(typeof a>"u")a=[];else if(Ri(a,e)>=0)return"[Circular]";function b(M,ne,L){if(ne&&(a=qs.call(a),a.push(ne)),L){var ie={depth:s.depth};return Re(s,"quoteStyle")&&(ie.quoteStyle=s.quoteStyle),t(M,ie,n+1,a)}return t(M,s,n+1,a)}if(typeof e=="function"&&!Oi(e)){var y=Qs(e),x=Zt(e,b);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(x.length>0?" { "+we.call(x,", ")+" }":"")}if(Ti(e)){var I=rt?Te.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Yr.call(e);return typeof e=="object"&&!rt?Et(I):I}if(iu(e)){for(var O="<"+wi.call(String(e.nodeName)),S=e.attributes||[],T=0;T<S.length;T++)O+=" "+S[T].name+"="+Bi(zs(S[T].value),"double",s);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+wi.call(String(e.nodeName))+">",O}if(Jr(e)){if(e.length===0)return"[]";var F=Zt(e,b);return _&&!au(F)?"["+Qr(F,_)+"]":"[ "+we.call(F,", ")+" ]"}if(Ws(e)){var R=Zt(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!Ei.call(e,"cause")?"{ ["+String(e)+"] "+we.call(_i.call("[cause]: "+b(e.cause),R),", ")+" }":R.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+we.call(R,", ")+" }"}if(typeof e=="object"&&f){if(Ii&&typeof e[Ii]=="function"&&Xr)return Xr(e,{depth:v-n});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Zs(e)){var D=[];return yi&&yi.call(e,function(M,ne){D.push(b(ne,e,!0)+" => "+b(M,e))}),Pi("Map",Kt.call(e),D,_)}if(ru(e)){var N=[];return gi&&gi.call(e,function(M){N.push(b(M,e))}),Pi("Set",Qt.call(e),N,_)}if(eu(e))return Kr("WeakMap");if(nu(e))return Kr("WeakSet");if(tu(e))return Kr("WeakRef");if(Ys(e))return Et(b(Number(e)));if(Js(e))return Et(b(Wr.call(e)));if(Xs(e))return Et(Ns.call(e));if(Hs(e))return Et(b(String(e)));if(!Gs(e)&&!Oi(e)){var V=Zt(e,b),k=Ai?Ai(e)===Object.prototype:e instanceof Object||e.constructor===Object,ee=e instanceof Object?"":"null prototype",z=!k&&K&&Object(e)===e&&K in e?Gr.call(Fe(e),8,-1):ee?"Object":"",ue=k||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=ue+(z||ee?"["+we.call(_i.call([],z||[],ee||[]),": ")+"] ":"");return V.length===0?Y+"{}":_?Y+"{"+Qr(V,_)+"}":Y+"{ "+we.call(V,", ")+" }"}return String(e)};function Bi(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function zs(t){return Te.call(String(t),/"/g,""")}function Jr(t){return Fe(t)==="[object Array]"&&(!K||!(typeof t=="object"&&K in t))}function Gs(t){return Fe(t)==="[object Date]"&&(!K||!(typeof t=="object"&&K in t))}function Oi(t){return Fe(t)==="[object RegExp]"&&(!K||!(typeof t=="object"&&K in t))}function Ws(t){return Fe(t)==="[object Error]"&&(!K||!(typeof t=="object"&&K in t))}function Hs(t){return Fe(t)==="[object String]"&&(!K||!(typeof t=="object"&&K in t))}function Ys(t){return Fe(t)==="[object Number]"&&(!K||!(typeof t=="object"&&K in t))}function Xs(t){return Fe(t)==="[object Boolean]"&&(!K||!(typeof t=="object"&&K in t))}function Ti(t){if(rt)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Yr)return!1;try{return Yr.call(t),!0}catch{}return!1}function Js(t){if(!t||typeof t!="object"||!Wr)return!1;try{return Wr.call(t),!0}catch{}return!1}var Ks=Object.prototype.hasOwnProperty||function(t){return t in this};function Re(t,e){return Ks.call(t,e)}function Fe(t){return Ms.call(t)}function Qs(t){if(t.name)return t.name;var e=ks.call(Ls.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Ri(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Zs(t){if(!Kt||!t||typeof t!="object")return!1;try{Kt.call(t);try{Qt.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function eu(t){if(!_t||!t||typeof t!="object")return!1;try{_t.call(t,_t);try{bt.call(t,bt)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function tu(t){if(!mi||!t||typeof t!="object")return!1;try{return mi.call(t),!0}catch{}return!1}function ru(t){if(!Qt||!t||typeof t!="object")return!1;try{Qt.call(t);try{Kt.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function nu(t){if(!bt||!t||typeof t!="object")return!1;try{bt.call(t,bt);try{_t.call(t,_t)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function iu(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Fi(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Fi(Gr.call(t,0,e.maxStringLength),e)+n}var a=Te.call(Te.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ou);return Bi(a,"single",e)}function ou(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+js.call(e.toString(16))}function Et(t){return"Object("+t+")"}function Kr(t){return t+" { ? }"}function Pi(t,e,r,n){var a=n?Qr(r,n):we.call(r,", ");return t+" ("+e+") {"+a+"}"}function au(t){for(var e=0;e<t.length;e++)if(Ri(t[e],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
19
|
-
`+e.prev+e.base;return
|
|
20
|
-
`+e.prev}function Zt(t,e){var r=Jr(t),n=[];if(r){n.length=t.length;for(var a=0;a<t.length;a++)n[a]=Re(t,a)?e(t[a],t):""}var s=typeof Hr=="function"?Hr(t):[],f;if(rt){f={};for(var p=0;p<s.length;p++)f["$"+s[p]]=s[p]}for(var h in t)Re(t,h)&&(r&&String(Number(h))===h&&h<t.length||rt&&f["$"+h]instanceof Symbol||(vi.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Hr=="function")for(var m=0;m<s.length;m++)Ei.call(t,s[m])&&n.push("["+e(s[m])+"]: "+e(t[s[m]],t));return n}var Zr=Sr,nt=ya,uu=Vs,cu=Zr("%TypeError%"),er=Zr("%WeakMap%",!0),tr=Zr("%Map%",!0),fu=nt("WeakMap.prototype.get",!0),lu=nt("WeakMap.prototype.set",!0),pu=nt("WeakMap.prototype.has",!0),hu=nt("Map.prototype.get",!0),du=nt("Map.prototype.set",!0),yu=nt("Map.prototype.has",!0),en=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},gu=function(t,e){var r=en(t,e);return r&&r.value},mu=function(t,e,r){var n=en(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},wu=function(t,e){return!!en(t,e)},vu=function(){var e,r,n,a={assert:function(s){if(!a.has(s))throw new cu("Side channel does not contain "+uu(s))},get:function(s){if(er&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fu(e,s)}else if(tr){if(r)return hu(r,s)}else if(n)return gu(n,s)},has:function(s){if(er&&s&&(typeof s=="object"||typeof s=="function")){if(e)return pu(e,s)}else if(tr){if(r)return yu(r,s)}else if(n)return wu(n,s);return!1},set:function(s,f){er&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new er),lu(e,s,f)):tr?(r||(r=new tr),du(r,s,f)):(n||(n={key:{},next:null}),mu(n,s,f))}};return a},_u=String.prototype.replace,bu=/%20/g,tn={RFC1738:"RFC1738",RFC3986:"RFC3986"},$i={default:tn.RFC3986,formatters:{RFC1738:function(t){return _u.call(t,bu,"+")},RFC3986:function(t){return String(t)}},RFC1738:tn.RFC1738,RFC3986:tn.RFC3986},Eu=$i,rn=Object.prototype.hasOwnProperty,Ve=Array.isArray,ve=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Au=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Ve(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);r.obj[r.prop]=a}}},Ui=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(n[a]=e[a]);return n},xu=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Ve(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!rn.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var a=e;return Ve(e)&&!Ve(r)&&(a=Ui(e,n)),Ve(e)&&Ve(r)?(r.forEach(function(s,f){if(rn.call(e,f)){var p=e[f];p&&typeof p=="object"&&s&&typeof s=="object"?e[f]=t(p,s,n):e.push(s)}else e[f]=s}),e):Object.keys(r).reduce(function(s,f){var p=r[f];return rn.call(s,f)?s[f]=t(s[f],p,n):s[f]=p,s},a)},Su=function(e,r){return Object.keys(r).reduce(function(n,a){return n[a]=r[a],n},e)},Iu=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Bu=function(e,r,n,a,s){if(e.length===0)return e;var f=e;if(typeof e=="symbol"?f=Symbol.prototype.toString.call(e):typeof e!="string"&&(f=String(e)),n==="iso-8859-1")return escape(f).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var p="",h=0;h<f.length;++h){var m=f.charCodeAt(h);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||s===Eu.RFC1738&&(m===40||m===41)){p+=f.charAt(h);continue}if(m<128){p=p+ve[m];continue}if(m<2048){p=p+(ve[192|m>>6]+ve[128|m&63]);continue}if(m<55296||m>=57344){p=p+(ve[224|m>>12]+ve[128|m>>6&63]+ve[128|m&63]);continue}h+=1,m=65536+((m&1023)<<10|f.charCodeAt(h)&1023),p+=ve[240|m>>18]+ve[128|m>>12&63]+ve[128|m>>6&63]+ve[128|m&63]}return p},Ou=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],a=0;a<r.length;++a)for(var s=r[a],f=s.obj[s.prop],p=Object.keys(f),h=0;h<p.length;++h){var m=p[h],v=f[m];typeof v=="object"&&v!==null&&n.indexOf(v)===-1&&(r.push({obj:f,prop:m}),n.push(v))}return Au(r),e},Tu=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ru=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Fu=function(e,r){return[].concat(e,r)},Pu=function(e,r){if(Ve(e)){for(var n=[],a=0;a<e.length;a+=1)n.push(r(e[a]));return n}return r(e)},$u={arrayToObject:Ui,assign:Su,combine:Fu,compact:Ou,decode:Iu,encode:Bu,isBuffer:Ru,isRegExp:Tu,maybeMap:Pu,merge:xu},Ci=vu,rr=$u,At=$i,Uu=Object.prototype.hasOwnProperty,Di={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},Ae=Array.isArray,Cu=Array.prototype.push,Ni=function(t,e){Cu.apply(t,Ae(e)?e:[e])},Du=Date.prototype.toISOString,Mi=At.default,Q={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:rr.encode,encodeValuesOnly:!1,format:Mi,formatter:At.formatters[Mi],indices:!1,serializeDate:function(e){return Du.call(e)},skipNulls:!1,strictNullHandling:!1},Nu=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},nn={},Mu=function t(e,r,n,a,s,f,p,h,m,v,_,b,y,x,I,O){for(var S=e,T=O,F=0,R=!1;(T=T.get(nn))!==void 0&&!R;){var D=T.get(e);if(F+=1,typeof D<"u"){if(D===F)throw new RangeError("Cyclic object value");R=!0}typeof T.get(nn)>"u"&&(F=0)}if(typeof h=="function"?S=h(r,S):S instanceof Date?S=_(S):n==="comma"&&Ae(S)&&(S=rr.maybeMap(S,function(ie){return ie instanceof Date?_(ie):ie})),S===null){if(s)return p&&!x?p(r,Q.encoder,I,"key",b):r;S=""}if(Nu(S)||rr.isBuffer(S)){if(p){var N=x?r:p(r,Q.encoder,I,"key",b);return[y(N)+"="+y(p(S,Q.encoder,I,"value",b))]}return[y(r)+"="+y(String(S))]}var V=[];if(typeof S>"u")return V;var k;if(n==="comma"&&Ae(S))x&&p&&(S=rr.maybeMap(S,p)),k=[{value:S.length>0?S.join(",")||null:void 0}];else if(Ae(h))k=h;else{var ee=Object.keys(S);k=m?ee.sort(m):ee}for(var z=a&&Ae(S)&&S.length===1?r+"[]":r,ue=0;ue<k.length;++ue){var Y=k[ue],M=typeof Y=="object"&&typeof Y.value<"u"?Y.value:S[Y];if(!(f&&M===null)){var ne=Ae(S)?typeof n=="function"?n(z,Y):z:z+(v?"."+Y:"["+Y+"]");O.set(e,F);var L=Ci();L.set(nn,O),Ni(V,t(M,ne,n,a,s,f,n==="comma"&&x&&Ae(S)?null:p,h,m,v,_,b,y,x,I,L))}}return V},Lu=function(e){if(!e)return Q;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Q.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=At.default;if(typeof e.format<"u"){if(!Uu.call(At.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=At.formatters[n],s=Q.filter;return(typeof e.filter=="function"||Ae(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Q.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Q.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Q.charsetSentinel,delimiter:typeof e.delimiter>"u"?Q.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Q.encode,encoder:typeof e.encoder=="function"?e.encoder:Q.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Q.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Q.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Q.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Q.strictNullHandling}},ku=function(t,e){var r=t,n=Lu(e),a,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Ae(n.filter)&&(s=n.filter,a=s);var f=[];if(typeof r!="object"||r===null)return"";var p;e&&e.arrayFormat in Di?p=e.arrayFormat:e&&"indices"in e?p=e.indices?"indices":"repeat":p="indices";var h=Di[p];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=h==="comma"&&e&&e.commaRoundTrip;a||(a=Object.keys(r)),n.sort&&a.sort(n.sort);for(var v=Ci(),_=0;_<a.length;++_){var b=a[_];n.skipNulls&&r[b]===null||Ni(f,Mu(r[b],b,h,m,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,v))}var y=f.join(n.delimiter),x=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?x+="utf8=%26%2310003%3B&":x+="utf8=%E2%9C%93&"),y.length>0?x+y:""},ju=$e(ku);let Li={storeIdentifier:"",environment:"prod"};function qu(t){Li=t}function le(){return Li}const Vu=(t,e="")=>{switch(t){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},xt=(t,e="")=>{switch(t){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},zu=t=>{switch(t){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},Gu="/tools/recurring";class nr{constructor(e,r){this.name="RechargeRequestError",this.message=e,this.status=r}}function Wu(t){return ju(t,{encode:!1,indices:!1,arrayFormat:"comma"})}async function ir(t,e,r={}){const n=le();return ae(t,`${zu(n.environment)}/store/${n.storeIdentifier}${e}`,r)}async function B(t,e,{id:r,query:n,data:a,headers:s}={},f){const{environment:p,environmentUri:h,storeIdentifier:m,loginRetryFn:v}=le(),_=f.apiToken,b=Vu(p,h),y={"X-Recharge-Access-Token":_,"X-Recharge-Version":"2021-11",...s||{}},x={shop_url:m,...n};try{return await ae(t,`${b}${e}`,{id:r,query:x,data:a,headers:y})}catch(I){if(v&&I instanceof nr&&I.status===401)return v().then(O=>{if(O)return ae(t,`${b}${e}`,{id:r,query:x,data:a,headers:{...y,"X-Recharge-Access-Token":O.apiToken}});throw I});throw I}}async function St(t,e,r={}){return ae(t,`${Gu}${e}`,r)}async function ae(t,e,{id:r,query:n,data:a,headers:s}={}){let f=e.trim();if(r&&(f=[f,`${r}`.trim()].join("/")),n){let _;[f,_]=f.split("?");const b=[_,Wu(n)].join("&").replace(/^&/,"");f=`${f}${b?`?${b}`:""}`}let p;a&&t!=="get"&&(p=JSON.stringify(a));const h={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...s||{}},m=await fetch(f,{method:t,headers:h,body:p});let v;try{v=await m.json()}catch{}if(!m.ok)throw v&&v.error?new nr(v.error,m.status):v&&v.errors?new nr(JSON.stringify(v.errors),m.status):new nr("A connection error occurred while making the request");return v}function Hu(t,e){return B("get","/addresses",{query:e},t)}async function Yu(t,e,r){const{address:n}=await B("get","/addresses",{id:e,query:{include:r?.include}},t);return n}async function Xu(t,e){const{address:r}=await B("post","/addresses",{data:{customer_id:t.customerId?Number(t.customerId):void 0,...e}},t);return r}async function on(t,e,r){const{address:n}=await B("put","/addresses",{id:e,data:r},t);return n}async function Ju(t,e,r){return on(t,e,{discounts:[{code:r}]})}async function Ku(t,e){return on(t,e,{discounts:[]})}function Qu(t,e){return B("delete","/addresses",{id:e},t)}async function Zu(t,e){const{address:r}=await B("post","/addresses/merge",{data:e},t);return r}async function ec(t,e,r){const{charge:n}=await B("post",`/addresses/${e}/charges/skip`,{data:r},t);return n}var tc=Object.freeze({__proto__:null,applyDiscountToAddress:Ju,createAddress:Xu,deleteAddress:Qu,getAddress:Yu,listAddresses:Hu,mergeAddresses:Zu,removeDiscountsFromAddress:Ku,skipFutureCharge:ec,updateAddress:on});async function rc(){const{storefrontAccessToken:t}=le(),e={};t&&(e["X-Recharge-Storefront-Access-Token"]=t);const r=await St("get","/access",{headers:e});return{apiToken:r.api_token,customerId:r.customer_id,message:r.message}}async function nc(t,e){return ki(t,e)}async function ki(t,e){const{environment:r,environmentUri:n,storefrontAccessToken:a,storeIdentifier:s}=le(),f=xt(r,n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const{api_token:h,customer_id:m,message:v}=await ae("post",`${f}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:t,shop_url:s},headers:p});return h?{apiToken:h,customerId:m,message:v}:null}async function ic(t){const{environment:e,environmentUri:r,storefrontAccessToken:n,storeIdentifier:a}=le(),s=xt(e,r),f={};n&&(f["X-Recharge-Storefront-Access-Token"]=n);const{api_token:p,customer_id:h,message:m}=await ae("post",`${s}/shopify_customer_account_api_access`,{data:{customer_token:t,shop_url:a},headers:f});return p?{apiToken:p,customerId:h,message:m}:null}async function oc(t,e={}){const{environment:r,environmentUri:n,storefrontAccessToken:a,storeIdentifier:s}=le(),f=xt(r,n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await ae("post",`${f}/attempt_login`,{data:{email:t,shop:s,...e},headers:p});if(h.errors)throw new Error(h.errors);return h.session_token}async function ac(t,e={}){const{storefrontAccessToken:r}=le(),n={};r&&(n["X-Recharge-Storefront-Access-Token"]=r);const a=await St("post","/attempt_login",{data:{email:t,...e},headers:n});if(a.errors)throw new Error(a.errors);return a.session_token}async function sc(t,e,r){const{environment:n,environmentUri:a,storefrontAccessToken:s,storeIdentifier:f}=le(),p=xt(n,a),h={};s&&(h["X-Recharge-Storefront-Access-Token"]=s);const m=await ae("post",`${p}/validate_login`,{data:{code:r,email:t,session_token:e,shop:f},headers:h});if(m.errors)throw new Error(m.errors);return{apiToken:m.api_token,customerId:m.customer_id}}async function uc(t,e,r){const{storefrontAccessToken:n}=le(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const s=await St("post","/validate_login",{data:{code:r,email:t,session_token:e},headers:a});if(s.errors)throw new Error(s.errors);return{apiToken:s.api_token,customerId:s.customer_id}}function cc(){const{pathname:t,search:e}=window.location,r=new URLSearchParams(e).get("token"),n=t.split("/").filter(Boolean),a=n.findIndex(f=>f==="portal"),s=a!==-1?n[a+1]:void 0;if(!r||!s)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:s,token:r}}async function fc(){const{customerHash:t,token:e}=cc(),{environment:r,environmentUri:n,storefrontAccessToken:a,storeIdentifier:s}=le(),f=xt(r,n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await ae("post",`${f}/customers/${t}/access`,{headers:p,data:{token:e,shop:s}});return{apiToken:h.api_token,customerId:h.customer_id}}var lc=Object.freeze({__proto__:null,loginCustomerPortal:fc,loginShopifyApi:nc,loginShopifyAppProxy:rc,loginWithShopifyCustomerAccount:ic,loginWithShopifyStorefront:ki,sendPasswordlessCode:oc,sendPasswordlessCodeAppProxy:ac,validatePasswordlessCode:sc,validatePasswordlessCodeAppProxy:uc});let pc=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var ji={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(t,e){(function(r,n){t.exports=n()})(oe,()=>(()=>{var r={899:(s,f,p)=>{const h=p(221);s.exports=h},221:(s,f,p)=>{p.r(f),p.d(f,{Array:()=>lt,Bool:()=>G,Double:()=>hr,Enum:()=>_e,Float:()=>pr,Hyper:()=>M,Int:()=>z,Opaque:()=>$t,Option:()=>Ct,Quadruple:()=>j,Reference:()=>Z,String:()=>Pt,Struct:()=>Pe,Union:()=>Ie,UnsignedHyper:()=>pe,UnsignedInt:()=>L,VarArray:()=>Ut,VarOpaque:()=>Se,Void:()=>X,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class m extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class _ extends v{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class y{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new m("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new m("attempt to read outside the boundary of the buffer");const w=4-(o%4||4);if(w>0){for(let A=0;A<w;A++)if(this._buffer[this._index+A]!==0)throw new m("invalid padding");this._index+=w}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new m("invalid XDR contract typecast - source buffer not entirely consumed")}}var x=p(764).lW;const I=8192;class O{constructor(o){typeof o=="number"?o=x.allocUnsafe(o):o instanceof x||(o=x.allocUnsafe(I)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/I)*I,w=x.allocUnsafe(l);this._buffer.copy(w,0,0,this._length),this._buffer=w,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof x||(o=x.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const w=4-(l%4||4);if(w>0){const A=this.alloc(w);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=I}var S=p(764).lW;class T{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new O;return this.write(this,l),N(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const w=new y(V(o,l)),A=this.read(w);return w.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const w=new O;return this.write(o,w),N(w.finalize(),l)}static fromXDR(o){const l=new y(V(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),w=this.read(l);return l.ensureInputConsumed(),w}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class F extends T{static read(o){throw new _}static write(o,l){throw new _}static isValid(o){return!1}}class R extends T{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function N(d,o){switch(o){case"raw":return d;case"hex":return d.toString("hex");case"base64":return d.toString("base64");default:throw new D(o)}}function V(d,o){switch(o){case"raw":return d;case"hex":return S.from(d,"hex");case"base64":return S.from(d,"base64");default:throw new D(o)}}const k=2147483647,ee=-2147483648;class z extends F{static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=ee&&o<=k}}z.MAX_VALUE=k,z.MIN_VALUE=2147483648;const ue=-9223372036854775808n,Y=9223372036854775807n;class M extends F{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ue||o>Y)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new M(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new M(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}M.MAX_VALUE=new M(Y),M.MIN_VALUE=new M(ue);const ne=4294967295;class L extends F{static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=ne)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=ne}}L.MAX_VALUE=ne,L.MIN_VALUE=0;const ie=0n,lr=0xFFFFFFFFFFFFFFFFn;class pe extends F{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ie||o>lr)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new pe(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new pe(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}pe.MAX_VALUE=new pe(lr),pe.MIN_VALUE=new pe(ie);class pr extends F{static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class hr extends F{static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class j extends F{static read(){throw new v("quadruple not supported")}static write(){throw new v("quadruple not supported")}static isValid(){return!1}}class G extends F{static read(o){const l=z.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new m(`got ${l} when trying to read a bool`)}}static write(o,l){const w=o?1:0;z.write(w,l)}static isValid(o){return typeof o=="boolean"}}var ft=p(764).lW;class Pt extends R{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L.MAX_VALUE;super(),this._maxLength=o}read(o){const l=L.read(o);if(l>this._maxLength)throw new m(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const w=typeof o=="string"?ft.byteLength(o,"utf8"):o.length;if(w>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);L.write(w,l),l.write(o,w)}isValid(o){return typeof o=="string"?ft.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||ft.isBuffer(o))&&o.length<=this._maxLength}}var dr=p(764).lW;class $t extends R{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:w}=o;if(w!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,w)}isValid(o){return dr.isBuffer(o)&&o.length===this._length}}var yr=p(764).lW;class Se extends R{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L.MAX_VALUE;super(),this._maxLength=o}read(o){const l=L.read(o);if(l>this._maxLength)throw new m(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:w}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);L.write(w,l),l.write(o,w)}isValid(o){return yr.isBuffer(o)&&o.length<=this._maxLength}}class lt extends R{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let w=0;w<this._length;w++)l[w]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const w of o)this._childType.write(w,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Ut extends R{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=L.read(o);if(l>this._maxLength)throw new m(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const w=new Array(l);for(let A=0;A<l;A++)w[A]=this._childType.read(o);return w}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);L.write(o.length,l);for(const w of o)this._childType.write(w,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Ct extends F{constructor(o){super(),this._childType=o}read(o){if(G.read(o))return this._childType.read(o)}write(o,l){const w=o!=null;G.write(w,l),w&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class X extends F{static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class _e extends F{constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=z.read(o),w=this._byValue[l];if(w===void 0)throw new m(`unknown ${this.enumName} member for value ${l}`);return w}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);z.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,w){const A=class extends _e{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[$,P]of Object.entries(w)){const U=new A($,P);A._members[$]=U,A._byValue[P]=U,A[$]=()=>U}return A}}class Z extends F{resolve(){throw new v('"resolve" method should be implemented in the descendant class')}}class Pe extends F{constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[w,A]of this._fields)l[w]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[w,A]of this._fields){const $=o._attributes[w];A.write($,l)}}static isValid(o){return o instanceof this}static create(o,l,w){const A=class extends Pe{};A.structName=l,o.results[l]=A;const $=new Array(w.length);for(let P=0;P<w.length;P++){const U=w[P],Dt=U[0];let mr=U[1];mr instanceof Z&&(mr=mr.resolve(o)),$[P]=[Dt,mr],A.prototype[Dt]=gr(Dt)}return A._fields=$,A}}function gr(d){return function(o){return o!==void 0&&(this._attributes[d]=o),this._attributes[d]}}class Ie extends R{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const w=this.constructor.armForSwitch(this._switch);this._arm=w,this._armType=w===X?X:this.constructor._arms[w],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==X&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===X?X:this._arms[o]}static read(o){const l=this._switchOn.read(o),w=this.armForSwitch(l),A=w===X?X:this._arms[w];let $;return $=A!==void 0?A.read(o):w.read(o),new this(l,$)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,w){const A=class extends Ie{};A.unionName=l,o.results[l]=A,w.switchOn instanceof Z?A._switchOn=w.switchOn.resolve(o):A._switchOn=w.switchOn,A._switches=new Map,A._arms={};let $=w.defaultArm;$ instanceof Z&&($=$.resolve(o)),A._defaultArm=$;for(const[P,U]of w.switches){const Dt=typeof P=="string"?A._switchOn.fromName(P):P;A._switches.set(Dt,U)}if(A._switchOn.values!==void 0)for(const P of A._switchOn.values())A[P.name]=function(U){return new A(P,U)},A.prototype[P.name]=function(U){return this.set(P,U)};if(w.arms)for(const[P,U]of Object.entries(w.arms))A._arms[P]=U instanceof Z?U.resolve(o):U,U!==X&&(A.prototype[P]=function(){return this.get(P)});return A}}class ce extends Z{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class pt extends Z{constructor(o,l){let w=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=w}resolve(o){let l=this.childReference,w=this.length;return l instanceof Z&&(l=l.resolve(o)),w instanceof Z&&(w=w.resolve(o)),this.variable?new Ut(l,w):new lt(l,w)}}class xn extends Z{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof Z&&(l=l.resolve(o)),new Ct(l)}}class fe extends Z{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof Z&&(l=l.resolve(o)),new this.sizedType(l)}}class He{constructor(o,l,w){this.constructor=o,this.name=l,this.config=w}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(d,o,l){return l instanceof Z&&(l=l.resolve(d)),d.results[o]=l,l}function u(d,o,l){return d.results[o]=l,l}class c{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const w=new He(_e.create,o,l);this.define(o,w)}struct(o,l){const w=new He(Pe.create,o,l);this.define(o,w)}union(o,l){const w=new He(Ie.create,o,l);this.define(o,w)}typedef(o,l){const w=new He(i,o,l);this.define(o,w)}const(o,l){const w=new He(u,o,l);this.define(o,w)}void(){return X}bool(){return G}int(){return z}hyper(){return M}uint(){return L}uhyper(){return pe}float(){return pr}double(){return hr}quadruple(){return j}string(o){return new fe(Pt,o)}opaque(o){return new fe($t,o)}varOpaque(o){return new fe(Se,o)}array(o,l){return new pt(o,l)}varArray(o,l){return new pt(o,l,!0)}option(o){return new xn(o)}define(o,l){if(this._destination[o]!==void 0)throw new v(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new ce(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(d){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(d){const l=new c(o);d(l),l.resolve()}return o}},742:(s,f)=>{f.byteLength=function(x){var I=b(x),O=I[0],S=I[1];return 3*(O+S)/4-S},f.toByteArray=function(x){var I,O,S=b(x),T=S[0],F=S[1],R=new m(function(V,k,ee){return 3*(k+ee)/4-ee}(0,T,F)),D=0,N=F>0?T-4:T;for(O=0;O<N;O+=4)I=h[x.charCodeAt(O)]<<18|h[x.charCodeAt(O+1)]<<12|h[x.charCodeAt(O+2)]<<6|h[x.charCodeAt(O+3)],R[D++]=I>>16&255,R[D++]=I>>8&255,R[D++]=255&I;return F===2&&(I=h[x.charCodeAt(O)]<<2|h[x.charCodeAt(O+1)]>>4,R[D++]=255&I),F===1&&(I=h[x.charCodeAt(O)]<<10|h[x.charCodeAt(O+1)]<<4|h[x.charCodeAt(O+2)]>>2,R[D++]=I>>8&255,R[D++]=255&I),R},f.fromByteArray=function(x){for(var I,O=x.length,S=O%3,T=[],F=16383,R=0,D=O-S;R<D;R+=F)T.push(y(x,R,R+F>D?D:R+F));return S===1?(I=x[O-1],T.push(p[I>>2]+p[I<<4&63]+"==")):S===2&&(I=(x[O-2]<<8)+x[O-1],T.push(p[I>>10]+p[I>>4&63]+p[I<<2&63]+"=")),T.join("")};for(var p=[],h=[],m=typeof Uint8Array<"u"?Uint8Array:Array,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0;_<64;++_)p[_]=v[_],h[v.charCodeAt(_)]=_;function b(x){var I=x.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=x.indexOf("=");return O===-1&&(O=I),[O,O===I?0:4-O%4]}function y(x,I,O){for(var S,T,F=[],R=I;R<O;R+=3)S=(x[R]<<16&16711680)+(x[R+1]<<8&65280)+(255&x[R+2]),F.push(p[(T=S)>>18&63]+p[T>>12&63]+p[T>>6&63]+p[63&T]);return F.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,f,p)=>{const h=p(742),m=p(645),v=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;f.lW=y,f.h2=50;const _=2147483647;function b(i){if(i>_)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,y.prototype),u}function y(i,u,c){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(i)}return x(i,u,c)}function x(i,u,c){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!y.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const w=0|R(o,l);let A=b(w);const $=A.write(o,l);return $!==w&&(A=A.slice(0,$)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(ce(o,Uint8Array)){const l=new Uint8Array(o);return T(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(ce(i,ArrayBuffer)||i&&ce(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ce(i,SharedArrayBuffer)||i&&ce(i.buffer,SharedArrayBuffer)))return T(i,u,c);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return y.from(g,u,c);const d=function(o){if(y.isBuffer(o)){const l=0|F(o.length),w=b(l);return w.length===0||o.copy(w,0,0,l),w}if(o.length!==void 0)return typeof o.length!="number"||pt(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(d)return d;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return y.from(i[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function I(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function O(i){return I(i),b(i<0?0:0|F(i))}function S(i){const u=i.length<0?0:0|F(i.length),c=b(u);for(let g=0;g<u;g+=1)c[g]=255&i[g];return c}function T(i,u,c){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&c===void 0?new Uint8Array(i):c===void 0?new Uint8Array(i,u):new Uint8Array(i,u,c),Object.setPrototypeOf(g,y.prototype),g}function F(i){if(i>=_)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_.toString(16)+" bytes");return 0|i}function R(i,u){if(y.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||ce(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const c=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&c===0)return 0;let d=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Pe(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return gr(i).length;default:if(d)return g?-1:Pe(i).length;u=(""+u).toLowerCase(),d=!0}}function D(i,u,c){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return pr(this,u,c);case"utf8":case"utf-8":return L(this,u,c);case"ascii":return lr(this,u,c);case"latin1":case"binary":return pe(this,u,c);case"base64":return ne(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hr(this,u,c);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function N(i,u,c){const g=i[u];i[u]=i[c],i[c]=g}function V(i,u,c,g,d){if(i.length===0)return-1;if(typeof c=="string"?(g=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),pt(c=+c)&&(c=d?0:i.length-1),c<0&&(c=i.length+c),c>=i.length){if(d)return-1;c=i.length-1}else if(c<0){if(!d)return-1;c=0}if(typeof u=="string"&&(u=y.from(u,g)),y.isBuffer(u))return u.length===0?-1:k(i,u,c,g,d);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?d?Uint8Array.prototype.indexOf.call(i,u,c):Uint8Array.prototype.lastIndexOf.call(i,u,c):k(i,[u],c,g,d);throw new TypeError("val must be string, number or Buffer")}function k(i,u,c,g,d){let o,l=1,w=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,w/=2,A/=2,c/=2}function $(P,U){return l===1?P[U]:P.readUInt16BE(U*l)}if(d){let P=-1;for(o=c;o<w;o++)if($(i,o)===$(u,P===-1?0:o-P)){if(P===-1&&(P=o),o-P+1===A)return P*l}else P!==-1&&(o-=o-P),P=-1}else for(c+A>w&&(c=w-A),o=c;o>=0;o--){let P=!0;for(let U=0;U<A;U++)if($(i,o+U)!==$(u,U)){P=!1;break}if(P)return o}return-1}function ee(i,u,c,g){c=Number(c)||0;const d=i.length-c;g?(g=Number(g))>d&&(g=d):g=d;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const w=parseInt(u.substr(2*l,2),16);if(pt(w))return l;i[c+l]=w}return l}function z(i,u,c,g){return Ie(Pe(u,i.length-c),i,c,g)}function ue(i,u,c,g){return Ie(function(d){const o=[];for(let l=0;l<d.length;++l)o.push(255&d.charCodeAt(l));return o}(u),i,c,g)}function Y(i,u,c,g){return Ie(gr(u),i,c,g)}function M(i,u,c,g){return Ie(function(d,o){let l,w,A;const $=[];for(let P=0;P<d.length&&!((o-=2)<0);++P)l=d.charCodeAt(P),w=l>>8,A=l%256,$.push(A),$.push(w);return $}(u,i.length-c),i,c,g)}function ne(i,u,c){return u===0&&c===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,c))}function L(i,u,c){c=Math.min(i.length,c);const g=[];let d=u;for(;d<c;){const o=i[d];let l=null,w=o>239?4:o>223?3:o>191?2:1;if(d+w<=c){let A,$,P,U;switch(w){case 1:o<128&&(l=o);break;case 2:A=i[d+1],(192&A)==128&&(U=(31&o)<<6|63&A,U>127&&(l=U));break;case 3:A=i[d+1],$=i[d+2],(192&A)==128&&(192&$)==128&&(U=(15&o)<<12|(63&A)<<6|63&$,U>2047&&(U<55296||U>57343)&&(l=U));break;case 4:A=i[d+1],$=i[d+2],P=i[d+3],(192&A)==128&&(192&$)==128&&(192&P)==128&&(U=(15&o)<<18|(63&A)<<12|(63&$)<<6|63&P,U>65535&&U<1114112&&(l=U))}}l===null?(l=65533,w=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),d+=w}return function(o){const l=o.length;if(l<=ie)return String.fromCharCode.apply(String,o);let w="",A=0;for(;A<l;)w+=String.fromCharCode.apply(String,o.slice(A,A+=ie));return w}(g)}y.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),y.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}}),y.poolSize=8192,y.from=function(i,u,c){return x(i,u,c)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array),y.alloc=function(i,u,c){return function(g,d,o){return I(g),g<=0?b(g):d!==void 0?typeof o=="string"?b(g).fill(d,o):b(g).fill(d):b(g)}(i,u,c)},y.allocUnsafe=function(i){return O(i)},y.allocUnsafeSlow=function(i){return O(i)},y.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==y.prototype},y.compare=function(i,u){if(ce(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),ce(u,Uint8Array)&&(u=y.from(u,u.offset,u.byteLength)),!y.isBuffer(i)||!y.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let c=i.length,g=u.length;for(let d=0,o=Math.min(c,g);d<o;++d)if(i[d]!==u[d]){c=i[d],g=u[d];break}return c<g?-1:g<c?1:0},y.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return y.alloc(0);let c;if(u===void 0)for(u=0,c=0;c<i.length;++c)u+=i[c].length;const g=y.allocUnsafe(u);let d=0;for(c=0;c<i.length;++c){let o=i[c];if(ce(o,Uint8Array))d+o.length>g.length?(y.isBuffer(o)||(o=y.from(o)),o.copy(g,d)):Uint8Array.prototype.set.call(g,o,d);else{if(!y.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,d)}d+=o.length}return g},y.byteLength=R,y.prototype._isBuffer=!0,y.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)N(this,u,u+1);return this},y.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)N(this,u,u+3),N(this,u+1,u+2);return this},y.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)N(this,u,u+7),N(this,u+1,u+6),N(this,u+2,u+5),N(this,u+3,u+4);return this},y.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?L(this,0,i):D.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(i){if(!y.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||y.compare(this,i)===0},y.prototype.inspect=function(){let i="";const u=f.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},v&&(y.prototype[v]=y.prototype.inspect),y.prototype.compare=function(i,u,c,g,d){if(ce(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),c===void 0&&(c=i?i.length:0),g===void 0&&(g=0),d===void 0&&(d=this.length),u<0||c>i.length||g<0||d>this.length)throw new RangeError("out of range index");if(g>=d&&u>=c)return 0;if(g>=d)return-1;if(u>=c)return 1;if(this===i)return 0;let o=(d>>>=0)-(g>>>=0),l=(c>>>=0)-(u>>>=0);const w=Math.min(o,l),A=this.slice(g,d),$=i.slice(u,c);for(let P=0;P<w;++P)if(A[P]!==$[P]){o=A[P],l=$[P];break}return o<l?-1:l<o?1:0},y.prototype.includes=function(i,u,c){return this.indexOf(i,u,c)!==-1},y.prototype.indexOf=function(i,u,c){return V(this,i,u,c,!0)},y.prototype.lastIndexOf=function(i,u,c){return V(this,i,u,c,!1)},y.prototype.write=function(i,u,c,g){if(u===void 0)g="utf8",c=this.length,u=0;else if(c===void 0&&typeof u=="string")g=u,c=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(c)?(c>>>=0,g===void 0&&(g="utf8")):(g=c,c=void 0)}const d=this.length-u;if((c===void 0||c>d)&&(c=d),i.length>0&&(c<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return ee(this,i,u,c);case"utf8":case"utf-8":return z(this,i,u,c);case"ascii":case"latin1":case"binary":return ue(this,i,u,c);case"base64":return Y(this,i,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,i,u,c);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ie=4096;function lr(i,u,c){let g="";c=Math.min(i.length,c);for(let d=u;d<c;++d)g+=String.fromCharCode(127&i[d]);return g}function pe(i,u,c){let g="";c=Math.min(i.length,c);for(let d=u;d<c;++d)g+=String.fromCharCode(i[d]);return g}function pr(i,u,c){const g=i.length;(!u||u<0)&&(u=0),(!c||c<0||c>g)&&(c=g);let d="";for(let o=u;o<c;++o)d+=xn[i[o]];return d}function hr(i,u,c){const g=i.slice(u,c);let d="";for(let o=0;o<g.length-1;o+=2)d+=String.fromCharCode(g[o]+256*g[o+1]);return d}function j(i,u,c){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>c)throw new RangeError("Trying to access beyond buffer length")}function G(i,u,c,g,d,o){if(!y.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>d||u<o)throw new RangeError('"value" argument is out of bounds');if(c+g>i.length)throw new RangeError("Index out of range")}function ft(i,u,c,g,d){Ct(u,g,d,i,c,7);let o=Number(u&BigInt(4294967295));i[c++]=o,o>>=8,i[c++]=o,o>>=8,i[c++]=o,o>>=8,i[c++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[c++]=l,l>>=8,i[c++]=l,l>>=8,i[c++]=l,l>>=8,i[c++]=l,c}function Pt(i,u,c,g,d){Ct(u,g,d,i,c,7);let o=Number(u&BigInt(4294967295));i[c+7]=o,o>>=8,i[c+6]=o,o>>=8,i[c+5]=o,o>>=8,i[c+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[c+3]=l,l>>=8,i[c+2]=l,l>>=8,i[c+1]=l,l>>=8,i[c]=l,c+8}function dr(i,u,c,g,d,o){if(c+g>i.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function $t(i,u,c,g,d){return u=+u,c>>>=0,d||dr(i,0,c,4),m.write(i,u,c,g,23,4),c+4}function yr(i,u,c,g,d){return u=+u,c>>>=0,d||dr(i,0,c,8),m.write(i,u,c,g,52,8),c+8}y.prototype.slice=function(i,u){const c=this.length;(i=~~i)<0?(i+=c)<0&&(i=0):i>c&&(i=c),(u=u===void 0?c:~~u)<0?(u+=c)<0&&(u=0):u>c&&(u=c),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,y.prototype),g},y.prototype.readUintLE=y.prototype.readUIntLE=function(i,u,c){i>>>=0,u>>>=0,c||j(i,u,this.length);let g=this[i],d=1,o=0;for(;++o<u&&(d*=256);)g+=this[i+o]*d;return g},y.prototype.readUintBE=y.prototype.readUIntBE=function(i,u,c){i>>>=0,u>>>=0,c||j(i,u,this.length);let g=this[i+--u],d=1;for(;u>0&&(d*=256);)g+=this[i+--u]*d;return g},y.prototype.readUint8=y.prototype.readUInt8=function(i,u){return i>>>=0,u||j(i,1,this.length),this[i]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(i,u){return i>>>=0,u||j(i,2,this.length),this[i]|this[i+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(i,u){return i>>>=0,u||j(i,2,this.length),this[i]<<8|this[i+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(i,u){return i>>>=0,u||j(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(i,u){return i>>>=0,u||j(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},y.prototype.readBigUInt64LE=fe(function(i){X(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,d=this[++i]+256*this[++i]+65536*this[++i]+c*2**24;return BigInt(g)+(BigInt(d)<<BigInt(32))}),y.prototype.readBigUInt64BE=fe(function(i){X(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],d=this[++i]*2**24+65536*this[++i]+256*this[++i]+c;return(BigInt(g)<<BigInt(32))+BigInt(d)}),y.prototype.readIntLE=function(i,u,c){i>>>=0,u>>>=0,c||j(i,u,this.length);let g=this[i],d=1,o=0;for(;++o<u&&(d*=256);)g+=this[i+o]*d;return d*=128,g>=d&&(g-=Math.pow(2,8*u)),g},y.prototype.readIntBE=function(i,u,c){i>>>=0,u>>>=0,c||j(i,u,this.length);let g=u,d=1,o=this[i+--g];for(;g>0&&(d*=256);)o+=this[i+--g]*d;return d*=128,o>=d&&(o-=Math.pow(2,8*u)),o},y.prototype.readInt8=function(i,u){return i>>>=0,u||j(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},y.prototype.readInt16LE=function(i,u){i>>>=0,u||j(i,2,this.length);const c=this[i]|this[i+1]<<8;return 32768&c?4294901760|c:c},y.prototype.readInt16BE=function(i,u){i>>>=0,u||j(i,2,this.length);const c=this[i+1]|this[i]<<8;return 32768&c?4294901760|c:c},y.prototype.readInt32LE=function(i,u){return i>>>=0,u||j(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},y.prototype.readInt32BE=function(i,u){return i>>>=0,u||j(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},y.prototype.readBigInt64LE=fe(function(i){X(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(c<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),y.prototype.readBigInt64BE=fe(function(i){X(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+c)}),y.prototype.readFloatLE=function(i,u){return i>>>=0,u||j(i,4,this.length),m.read(this,i,!0,23,4)},y.prototype.readFloatBE=function(i,u){return i>>>=0,u||j(i,4,this.length),m.read(this,i,!1,23,4)},y.prototype.readDoubleLE=function(i,u){return i>>>=0,u||j(i,8,this.length),m.read(this,i,!0,52,8)},y.prototype.readDoubleBE=function(i,u){return i>>>=0,u||j(i,8,this.length),m.read(this,i,!1,52,8)},y.prototype.writeUintLE=y.prototype.writeUIntLE=function(i,u,c,g){i=+i,u>>>=0,c>>>=0,!g&&G(this,i,u,c,Math.pow(2,8*c)-1,0);let d=1,o=0;for(this[u]=255&i;++o<c&&(d*=256);)this[u+o]=i/d&255;return u+c},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(i,u,c,g){i=+i,u>>>=0,c>>>=0,!g&&G(this,i,u,c,Math.pow(2,8*c)-1,0);let d=c-1,o=1;for(this[u+d]=255&i;--d>=0&&(o*=256);)this[u+d]=i/o&255;return u+c},y.prototype.writeUint8=y.prototype.writeUInt8=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,1,255,0),this[u]=255&i,u+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},y.prototype.writeBigUInt64LE=fe(function(i,u=0){return ft(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=fe(function(i,u=0){return Pt(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(i,u,c,g){if(i=+i,u>>>=0,!g){const w=Math.pow(2,8*c-1);G(this,i,u,c,w-1,-w)}let d=0,o=1,l=0;for(this[u]=255&i;++d<c&&(o*=256);)i<0&&l===0&&this[u+d-1]!==0&&(l=1),this[u+d]=(i/o>>0)-l&255;return u+c},y.prototype.writeIntBE=function(i,u,c,g){if(i=+i,u>>>=0,!g){const w=Math.pow(2,8*c-1);G(this,i,u,c,w-1,-w)}let d=c-1,o=1,l=0;for(this[u+d]=255&i;--d>=0&&(o*=256);)i<0&&l===0&&this[u+d+1]!==0&&(l=1),this[u+d]=(i/o>>0)-l&255;return u+c},y.prototype.writeInt8=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},y.prototype.writeInt16LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},y.prototype.writeInt16BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},y.prototype.writeInt32LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},y.prototype.writeInt32BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},y.prototype.writeBigInt64LE=fe(function(i,u=0){return ft(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=fe(function(i,u=0){return Pt(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeFloatLE=function(i,u,c){return $t(this,i,u,!0,c)},y.prototype.writeFloatBE=function(i,u,c){return $t(this,i,u,!1,c)},y.prototype.writeDoubleLE=function(i,u,c){return yr(this,i,u,!0,c)},y.prototype.writeDoubleBE=function(i,u,c){return yr(this,i,u,!1,c)},y.prototype.copy=function(i,u,c,g){if(!y.isBuffer(i))throw new TypeError("argument should be a Buffer");if(c||(c=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<c&&(g=c),g===c||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-c&&(g=i.length-u+c);const d=g-c;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,c,g):Uint8Array.prototype.set.call(i,this.subarray(c,g),u),d},y.prototype.fill=function(i,u,c,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,c=this.length):typeof c=="string"&&(g=c,c=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!y.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<c)throw new RangeError("Out of range index");if(c<=u)return this;let d;if(u>>>=0,c=c===void 0?this.length:c>>>0,i||(i=0),typeof i=="number")for(d=u;d<c;++d)this[d]=i;else{const o=y.isBuffer(i)?i:y.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(d=0;d<c-u;++d)this[d+u]=o[d%l]}return this};const Se={};function lt(i,u,c){Se[i]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Ut(i){let u="",c=i.length;const g=i[0]==="-"?1:0;for(;c>=g+4;c-=3)u=`_${i.slice(c-3,c)}${u}`;return`${i.slice(0,c)}${u}`}function Ct(i,u,c,g,d,o){if(i>c||i<u){const l=typeof u=="bigint"?"n":"";let w;throw w=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${c}${l}`,new Se.ERR_OUT_OF_RANGE("value",w,i)}(function(l,w,A){X(w,"offset"),l[w]!==void 0&&l[w+A]!==void 0||_e(w,l.length-(A+1))})(g,d,o)}function X(i,u){if(typeof i!="number")throw new Se.ERR_INVALID_ARG_TYPE(u,"number",i)}function _e(i,u,c){throw Math.floor(i)!==i?(X(i,c),new Se.ERR_OUT_OF_RANGE(c||"offset","an integer",i)):u<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${u}`,i)}lt("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),lt("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),lt("ERR_OUT_OF_RANGE",function(i,u,c){let g=`The value of "${i}" is out of range.`,d=c;return Number.isInteger(c)&&Math.abs(c)>4294967296?d=Ut(String(c)):typeof c=="bigint"&&(d=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(d=Ut(d)),d+="n"),g+=` It must be ${u}. Received ${d}`,g},RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function Pe(i,u){let c;u=u||1/0;const g=i.length;let d=null;const o=[];for(let l=0;l<g;++l){if(c=i.charCodeAt(l),c>55295&&c<57344){if(!d){if(c>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}d=c;continue}if(c<56320){(u-=3)>-1&&o.push(239,191,189),d=c;continue}c=65536+(d-55296<<10|c-56320)}else d&&(u-=3)>-1&&o.push(239,191,189);if(d=null,c<128){if((u-=1)<0)break;o.push(c)}else if(c<2048){if((u-=2)<0)break;o.push(c>>6|192,63&c|128)}else if(c<65536){if((u-=3)<0)break;o.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return o}function gr(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Ie(i,u,c,g){let d;for(d=0;d<g&&!(d+c>=u.length||d>=i.length);++d)u[d+c]=i[d];return d}function ce(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function pt(i){return i!=i}const xn=function(){const i="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){const g=16*c;for(let d=0;d<16;++d)u[g+d]=i[c]+i[d]}return u}();function fe(i){return typeof BigInt>"u"?He:i}function He(){throw new Error("BigInt not supported")}},645:(s,f)=>{f.read=function(p,h,m,v,_){var b,y,x=8*_-v-1,I=(1<<x)-1,O=I>>1,S=-7,T=m?_-1:0,F=m?-1:1,R=p[h+T];for(T+=F,b=R&(1<<-S)-1,R>>=-S,S+=x;S>0;b=256*b+p[h+T],T+=F,S-=8);for(y=b&(1<<-S)-1,b>>=-S,S+=v;S>0;y=256*y+p[h+T],T+=F,S-=8);if(b===0)b=1-O;else{if(b===I)return y?NaN:1/0*(R?-1:1);y+=Math.pow(2,v),b-=O}return(R?-1:1)*y*Math.pow(2,b-v)},f.write=function(p,h,m,v,_,b){var y,x,I,O=8*b-_-1,S=(1<<O)-1,T=S>>1,F=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=v?0:b-1,D=v?1:-1,N=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(x=isNaN(h)?1:0,y=S):(y=Math.floor(Math.log(h)/Math.LN2),h*(I=Math.pow(2,-y))<1&&(y--,I*=2),(h+=y+T>=1?F/I:F*Math.pow(2,1-T))*I>=2&&(y++,I/=2),y+T>=S?(x=0,y=S):y+T>=1?(x=(h*I-1)*Math.pow(2,_),y+=T):(x=h*Math.pow(2,T-1)*Math.pow(2,_),y=0));_>=8;p[m+R]=255&x,R+=D,x/=256,_-=8);for(y=y<<_|x,O+=_;O>0;p[m+R]=255&y,R+=D,y/=256,O-=8);p[m+R-D]|=128*N}}},n={};function a(s){var f=n[s];if(f!==void 0)return f.exports;var p=n[s]={exports:{}};return r[s](p,p.exports,a),p.exports}return a.d=(s,f)=>{for(var p in f)a.o(f,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:f[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,f)=>Object.prototype.hasOwnProperty.call(s,f),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(ji);var hc=ji.exports;function dc(t){const e={variantId:xe.Uint64.fromString(t.variantId.toString()),version:t.version||Math.floor(Date.now()/1e3),items:t.items.map(n=>new xe.BundleItem({collectionId:xe.Uint64.fromString(n.collectionId.toString()),productId:xe.Uint64.fromString(n.productId.toString()),variantId:xe.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new xe.BundleItemExt(0)})),ext:new xe.BundleExt(0)},r=new xe.Bundle(e);return xe.BundleEnvelope.envelopeTypeBundle(r).toXDR("base64")}const xe=hc.config(t=>{t.enum("EnvelopeType",{envelopeTypeBundle:0}),t.typedef("Uint32",t.uint()),t.typedef("Uint64",t.uhyper()),t.union("BundleItemExt",{switchOn:t.int(),switchName:"v",switches:[[0,t.void()]],arms:{}}),t.struct("BundleItem",[["collectionId",t.lookup("Uint64")],["productId",t.lookup("Uint64")],["variantId",t.lookup("Uint64")],["sku",t.string()],["quantity",t.lookup("Uint32")],["ext",t.lookup("BundleItemExt")]]),t.union("BundleExt",{switchOn:t.int(),switchName:"v",switches:[[0,t.void()]],arms:{}}),t.struct("Bundle",[["variantId",t.lookup("Uint64")],["items",t.varArray(t.lookup("BundleItem"),500)],["version",t.lookup("Uint32")],["ext",t.lookup("BundleExt")]]),t.union("BundleEnvelope",{switchOn:t.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:t.lookup("Bundle")}})}),qi="/bundling-storefront-manager";function yc(){return Math.ceil(Date.now()/1e3)}async function gc(){try{const{timestamp:t}=await St("get",`${qi}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return t}catch(t){return console.error(`Fetch failed: ${t}. Using client-side date.`),yc()}}async function mc(t){const e=le(),r=await Vi(t);if(r!==!0)throw new Error(r);const n=await gc(),a=dc({variantId:t.externalVariantId,version:n,items:t.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await St("post",`${qi}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${e.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function wc(t,e){const r=zi(t);if(r!==!0)throw new Error(`Dynamic Bundle is invalid. ${r}`);const n=`${pc(9)}:${t.externalProductId}`;return t.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:t.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function Vi(t){try{return t?!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const vc={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function zi(t){if(!t)return"No bundle defined.";if(t.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:r}=t.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||r){if(!e||!r)return"Shipping intervals do not match on selections.";{const n=vc[r];for(let a=0;a<t.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:f}=t.selections[a];if(s&&s!==e||f&&!n.includes(f))return"Shipping intervals do not match on selections."}}}return!0}async function _c(t,e){const{bundle_selection:r}=await B("get","/bundle_selections",{id:e},t);return r}function bc(t,e){return B("get","/bundle_selections",{query:e},t)}async function Ec(t,e){const{bundle_selection:r}=await B("post","/bundle_selections",{data:e},t);return r}async function Ac(t,e,r){const{bundle_selection:n}=await B("put","/bundle_selections",{id:e,data:r},t);return n}function xc(t,e){return B("delete","/bundle_selections",{id:e},t)}async function Sc(t,e,r,n){const{subscription:a}=await B("put","/bundles",{id:e,data:r,query:n},t);return a}var Ic=Object.freeze({__proto__:null,createBundleSelection:Ec,deleteBundleSelection:xc,getBundleId:mc,getBundleSelection:_c,getDynamicBundleItems:wc,listBundleSelections:bc,updateBundle:Sc,updateBundleSelection:Ac,validateBundle:Vi,validateDynamicBundle:zi}),Bc=200,an="__lodash_hash_undefined__",Oc=1/0,Gi=9007199254740991,Tc="[object Arguments]",Rc="[object Function]",Fc="[object GeneratorFunction]",Pc="[object Symbol]",$c=/[\\^$.*+?()[\]{}|]/g,Uc=/^\[object .+?Constructor\]$/,Cc=/^(?:0|[1-9]\d*)$/,Dc=typeof oe=="object"&&oe&&oe.Object===Object&&oe,Nc=typeof self=="object"&&self&&self.Object===Object&&self,sn=Dc||Nc||Function("return this")();function Mc(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Lc(t,e){var r=t?t.length:0;return!!r&&qc(t,e,0)>-1}function kc(t,e,r){for(var n=-1,a=t?t.length:0;++n<a;)if(r(e,t[n]))return!0;return!1}function Wi(t,e){for(var r=-1,n=t?t.length:0,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}function un(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}function jc(t,e,r,n){for(var a=t.length,s=r+(n?1:-1);n?s--:++s<a;)if(e(t[s],s,t))return s;return-1}function qc(t,e,r){if(e!==e)return jc(t,Vc,r);for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}function Vc(t){return t!==t}function zc(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Gc(t){return function(e){return t(e)}}function Wc(t,e){return t.has(e)}function Hc(t,e){return t?.[e]}function Yc(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function Hi(t,e){return function(r){return t(e(r))}}var Xc=Array.prototype,Jc=Function.prototype,or=Object.prototype,cn=sn["__core-js_shared__"],Yi=function(){var t=/[^.]+$/.exec(cn&&cn.keys&&cn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Xi=Jc.toString,it=or.hasOwnProperty,fn=or.toString,Kc=RegExp("^"+Xi.call(it).replace($c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ji=sn.Symbol,Qc=Hi(Object.getPrototypeOf,Object),Zc=or.propertyIsEnumerable,ef=Xc.splice,Ki=Ji?Ji.isConcatSpreadable:void 0,ln=Object.getOwnPropertySymbols,Qi=Math.max,tf=eo(sn,"Map"),It=eo(Object,"create");function ze(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rf(){this.__data__=It?It(null):{}}function nf(t){return this.has(t)&&delete this.__data__[t]}function of(t){var e=this.__data__;if(It){var r=e[t];return r===an?void 0:r}return it.call(e,t)?e[t]:void 0}function af(t){var e=this.__data__;return It?e[t]!==void 0:it.call(e,t)}function sf(t,e){var r=this.__data__;return r[t]=It&&e===void 0?an:e,this}ze.prototype.clear=rf,ze.prototype.delete=nf,ze.prototype.get=of,ze.prototype.has=af,ze.prototype.set=sf;function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function uf(){this.__data__=[]}function cf(t){var e=this.__data__,r=sr(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ef.call(e,r,1),!0}function ff(t){var e=this.__data__,r=sr(e,t);return r<0?void 0:e[r][1]}function lf(t){return sr(this.__data__,t)>-1}function pf(t,e){var r=this.__data__,n=sr(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ot.prototype.clear=uf,ot.prototype.delete=cf,ot.prototype.get=ff,ot.prototype.has=lf,ot.prototype.set=pf;function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function hf(){this.__data__={hash:new ze,map:new(tf||ot),string:new ze}}function df(t){return ur(this,t).delete(t)}function yf(t){return ur(this,t).get(t)}function gf(t){return ur(this,t).has(t)}function mf(t,e){return ur(this,t).set(t,e),this}at.prototype.clear=hf,at.prototype.delete=df,at.prototype.get=yf,at.prototype.has=gf,at.prototype.set=mf;function ar(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function wf(t){return this.__data__.set(t,an),this}function vf(t){return this.__data__.has(t)}ar.prototype.add=ar.prototype.push=wf,ar.prototype.has=vf;function _f(t,e){var r=pn(t)||to(t)?zc(t.length,String):[],n=r.length,a=!!n;for(var s in t)(e||it.call(t,s))&&!(a&&(s=="length"||Pf(s,n)))&&r.push(s);return r}function sr(t,e){for(var r=t.length;r--;)if(Lf(t[r][0],e))return r;return-1}function bf(t,e,r,n){var a=-1,s=Lc,f=!0,p=t.length,h=[],m=e.length;if(!p)return h;r&&(e=Wi(e,Gc(r))),n?(s=kc,f=!1):e.length>=Bc&&(s=Wc,f=!1,e=new ar(e));e:for(;++a<p;){var v=t[a],_=r?r(v):v;if(v=n||v!==0?v:0,f&&_===_){for(var b=m;b--;)if(e[b]===_)continue e;h.push(v)}else s(e,_,n)||h.push(v)}return h}function Zi(t,e,r,n,a){var s=-1,f=t.length;for(r||(r=Ff),a||(a=[]);++s<f;){var p=t[s];e>0&&r(p)?e>1?Zi(p,e-1,r,n,a):un(a,p):n||(a[a.length]=p)}return a}function Ef(t,e,r){var n=e(t);return pn(t)?n:un(n,r(t))}function Af(t){if(!hn(t)||Uf(t))return!1;var e=no(t)||Yc(t)?Kc:Uc;return e.test(Mf(t))}function xf(t){if(!hn(t))return Df(t);var e=Cf(t),r=[];for(var n in t)n=="constructor"&&(e||!it.call(t,n))||r.push(n);return r}function Sf(t,e){return t=Object(t),If(t,e,function(r,n){return n in t})}function If(t,e,r){for(var n=-1,a=e.length,s={};++n<a;){var f=e[n],p=t[f];r(p,f)&&(s[f]=p)}return s}function Bf(t,e){return e=Qi(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,a=Qi(r.length-e,0),s=Array(a);++n<a;)s[n]=r[e+n];n=-1;for(var f=Array(e+1);++n<e;)f[n]=r[n];return f[e]=s,Mc(t,this,f)}}function Of(t){return Ef(t,Vf,Rf)}function ur(t,e){var r=t.__data__;return $f(e)?r[typeof e=="string"?"string":"hash"]:r.map}function eo(t,e){var r=Hc(t,e);return Af(r)?r:void 0}var Tf=ln?Hi(ln,Object):oo,Rf=ln?function(t){for(var e=[];t;)un(e,Tf(t)),t=Qc(t);return e}:oo;function Ff(t){return pn(t)||to(t)||!!(Ki&&t&&t[Ki])}function Pf(t,e){return e=e??Gi,!!e&&(typeof t=="number"||Cc.test(t))&&t>-1&&t%1==0&&t<e}function $f(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Uf(t){return!!Yi&&Yi in t}function Cf(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||or;return t===r}function Df(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Nf(t){if(typeof t=="string"||qf(t))return t;var e=t+"";return e=="0"&&1/t==-Oc?"-0":e}function Mf(t){if(t!=null){try{return Xi.call(t)}catch{}try{return t+""}catch{}}return""}function Lf(t,e){return t===e||t!==t&&e!==e}function to(t){return kf(t)&&it.call(t,"callee")&&(!Zc.call(t,"callee")||fn.call(t)==Tc)}var pn=Array.isArray;function ro(t){return t!=null&&jf(t.length)&&!no(t)}function kf(t){return io(t)&&ro(t)}function no(t){var e=hn(t)?fn.call(t):"";return e==Rc||e==Fc}function jf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gi}function hn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function io(t){return!!t&&typeof t=="object"}function qf(t){return typeof t=="symbol"||io(t)&&fn.call(t)==Pc}function Vf(t){return ro(t)?_f(t,!0):xf(t)}var zf=Bf(function(t,e){return t==null?{}:(e=Wi(Zi(e,1),Nf),Sf(t,bf(Of(t),e)))});function oo(){return[]}var Gf=zf,dn=$e(Gf);function Wf(t){try{return JSON.parse(t)}catch{return t}}function Hf(t){return Object.entries(t).reduce((e,[r,n])=>({...e,[r]:Wf(n)}),{})}const ao=t=>typeof t=="string"?t!=="0"&&t!=="false":!!t;function so(t){const e=Hf(t),r=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],a=e.first_option==="autodeliver";return{...dn(e,["display_on","first_option"]),auto_inject:r,valid_pages:n,is_subscription_first:a,autoInject:r,validPages:n,isSubscriptionFirst:a}}function uo(t){const e=t.subscription_options?.storefront_purchase_options==="subscription_only";return{...t,is_subscription_only:e,isSubscriptionOnly:e}}function Yf(t){return t.map(e=>{const r={};return Object.entries(e).forEach(([n,a])=>{r[n]=uo(a)}),r})}const yn="2020-12",Xf={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Bt=new Map;function cr(t,e){return Bt.has(t)||Bt.set(t,e()),Bt.get(t)}async function gn(t,e){const r=e?.version??"2020-12",{product:n}=await cr(`product.${t}.${r}`,()=>ir("get",`/product/${r}/${t}.json`));return r==="2020-12"?uo(n):n}async function co(){return await cr("storeSettings",()=>ir("get",`/${yn}/store_settings.json`).catch(()=>Xf))}async function fo(){const{widget_settings:t}=await cr("widgetSettings",()=>ir("get",`/${yn}/widget_settings.json`));return so(t)}async function lo(){const{products:t,widget_settings:e,store_settings:r,meta:n}=await cr("productsAndSettings",()=>ir("get",`/product/${yn}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:Yf(t),widget_settings:so(e),store_settings:r??{}}}async function Jf(){const{products:t}=await lo();return t}async function Kf(t){const[e,r,n]=await Promise.all([gn(t),co(),fo()]);return{product:e,store_settings:r,widget_settings:n,storeSettings:r,widgetSettings:n}}async function Qf(t){const{bundle_product:e}=await gn(t);return e}async function po(){return Array.from(Bt.keys()).forEach(t=>Bt.delete(t))}var Zf=Object.freeze({__proto__:null,getCDNBundleSettings:Qf,getCDNProduct:gn,getCDNProductAndSettings:Kf,getCDNProducts:Jf,getCDNProductsAndSettings:lo,getCDNStoreSettings:co,getCDNWidgetSettings:fo,resetCDNCache:po});async function el(t,e,r){const{charge:n}=await B("get","/charges",{id:e,query:{include:r?.include}},t);return n}function tl(t,e){return B("get","/charges",{query:e},t)}async function rl(t,e,r){const{charge:n}=await B("post",`/charges/${e}/apply_discount`,{data:{discount_code:r}},t);return n}async function nl(t,e){const{charge:r}=await B("post",`/charges/${e}/remove_discount`,{},t);return r}async function il(t,e,r,n){const{charge:a}=await B("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:r.map(s=>Number(s))}},t);return a}async function ol(t,e,r,n){const{charge:a}=await B("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:r.map(s=>Number(s))}},t);return a}async function al(t,e){const{charge:r}=await B("post",`/charges/${e}/process`,{},t);return r}var sl=Object.freeze({__proto__:null,applyDiscountToCharge:rl,getCharge:el,listCharges:tl,processCharge:al,removeDiscountsFromCharge:nl,skipCharge:il,unskipCharge:ol});async function ul(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{customer:n}=await B("get","/customers",{id:r,query:{include:e?.include}},t);return n}async function cl(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{customer:n}=await B("put","/customers",{id:r,data:e},t);return n}async function fl(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{deliveries:n}=await B("get",`/customers/${r}/delivery_schedule`,{query:e},t);return n}async function mn(t){return B("get","/portal_access",{},t)}async function ll(t,e,r){const{base_url:n,customer_hash:a,temp_token:s}=await mn(t);return`${n.replace("portal","pages")}${a}/subscriptions/${e}/cancel?token=${s}&subscription=${e}&redirect_to=${r}`}async function pl(t,e,r){const{base_url:n,customer_hash:a,temp_token:s}=await mn(t);return`${n.replace("portal","pages")}${a}/gifts/${e}?token=${s}&redirect_to=${r}`}const hl={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function dl(t,e,r){const n=t.customerId;if(!n)throw new Error("Not logged in.");const a=hl[e];if(!a)throw new Error("Notification not supported.");return B("post",`/customers/${n}/notifications`,{data:{...a,template_vars:r}},t)}async function yl(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{credit_summary:n}=await B("get",`/customers/${r}/credit_summary`,{query:{include:e?.include}},t);return n}var gl=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:ll,getCreditSummary:yl,getCustomer:ul,getCustomerPortalAccess:mn,getDeliverySchedule:fl,getGiftRedemptionLandingPageURL:pl,sendCustomerNotification:dl,updateCustomer:cl});function ml(t,e){if(!t.customerId)throw new Error("Not logged in.");return B("get","/gift_purchases",{query:e},t)}async function wl(t,e){if(!t.customerId)throw new Error("Not logged in.");const{gift_purchase:r}=await B("get","/gift_purchases",{id:e},t);return r}var vl=Object.freeze({__proto__:null,getGiftPurchase:wl,listGiftPurchases:ml});async function _l(t,e){const{membership:r}=await B("get","/memberships",{id:e},t);return r}function bl(t,e){return B("get","/memberships",{query:e},t)}async function El(t,e,r){const{membership:n}=await B("post",`/memberships/${e}/cancel`,{data:r},t);return n}async function Al(t,e,r){const{membership:n}=await B("post",`/memberships/${e}/activate`,{data:r},t);return n}async function xl(t,e,r){const{membership:n}=await B("post",`/memberships/${e}/change`,{data:r},t);return n}var Sl=Object.freeze({__proto__:null,activateMembership:Al,cancelMembership:El,changeMembership:xl,getMembership:_l,listMemberships:bl});async function Il(t,e,r){const{membership_program:n}=await B("get","/membership_programs",{id:e,query:{include:r?.include}},t);return n}function Bl(t,e){return B("get","/membership_programs",{query:e},t)}var Ol=Object.freeze({__proto__:null,getMembershipProgram:Il,listMembershipPrograms:Bl});async function Tl(t,e){const{metafield:r}=await B("post","/metafields",{data:{metafield:e}},t);return r}async function Rl(t,e,r){const{metafield:n}=await B("put","/metafields",{id:e,data:{metafield:r}},t);return n}function Fl(t,e){return B("delete","/metafields",{id:e},t)}var Pl=Object.freeze({__proto__:null,createMetafield:Tl,deleteMetafield:Fl,updateMetafield:Rl});async function $l(t,e){const{onetime:r}=await B("get","/onetimes",{id:e},t);return r}function Ul(t,e){return B("get","/onetimes",{query:e},t)}async function Cl(t,e){const{onetime:r}=await B("post","/onetimes",{data:e},t);return r}async function Dl(t,e,r){const{onetime:n}=await B("put","/onetimes",{id:e,data:r},t);return n}function Nl(t,e){return B("delete","/onetimes",{id:e},t)}var Ml=Object.freeze({__proto__:null,createOnetime:Cl,deleteOnetime:Nl,getOnetime:$l,listOnetimes:Ul,updateOnetime:Dl});async function Ll(t,e){const{order:r}=await B("get","/orders",{id:e},t);return r}function kl(t,e){return B("get","/orders",{query:e},t)}var jl=Object.freeze({__proto__:null,getOrder:Ll,listOrders:kl});async function ql(t,e,r){const{payment_method:n}=await B("get","/payment_methods",{id:e,query:{include:r?.include}},t);return n}async function Vl(t,e){const{payment_method:r}=await B("post","/payment_methods",{data:{...e,customer_id:t.customerId}},t);return r}async function zl(t,e,r){const{payment_method:n}=await B("put","/payment_methods",{id:e,data:r},t);return n}function Gl(t,e){return B("get","/payment_methods",{query:e},t)}var Wl=Object.freeze({__proto__:null,createPaymentMethod:Vl,getPaymentMethod:ql,listPaymentMethods:Gl,updatePaymentMethod:zl});async function Hl(t,e){const{plan:r}=await B("get","/plans",{id:e},t);return r}function Yl(t,e){return B("get","/plans",{query:e},t)}var Xl=Object.freeze({__proto__:null,getPlan:Hl,listPlans:Yl});async function Jl(t,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return B("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},t)}var Kl=Object.freeze({__proto__:null,productSearch:Jl});async function Ql(t,e){return await B("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},t)}var Zl=Object.freeze({__proto__:null,getShippingCountries:Ql}),ep="Expected a function",ho="__lodash_placeholder__",Ge=1,fr=2,tp=4,st=8,Ot=16,We=32,Tt=64,yo=128,rp=256,go=512,mo=1/0,np=9007199254740991,ip=17976931348623157e292,wo=0/0,op=[["ary",yo],["bind",Ge],["bindKey",fr],["curry",st],["curryRight",Ot],["flip",go],["partial",We],["partialRight",Tt],["rearg",rp]],ap="[object Function]",sp="[object GeneratorFunction]",up="[object Symbol]",cp=/[\\^$.*+?()[\]{}|]/g,fp=/^\s+|\s+$/g,lp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pp=/\{\n\/\* \[wrapped with (.+)\] \*/,hp=/,? & /,dp=/^[-+]0x[0-9a-f]+$/i,yp=/^0b[01]+$/i,gp=/^\[object .+?Constructor\]$/,mp=/^0o[0-7]+$/i,wp=/^(?:0|[1-9]\d*)$/,vp=parseInt,_p=typeof oe=="object"&&oe&&oe.Object===Object&&oe,bp=typeof self=="object"&&self&&self.Object===Object&&self,Rt=_p||bp||Function("return this")();function wn(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ep(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Ap(t,e){var r=t?t.length:0;return!!r&&Sp(t,e,0)>-1}function xp(t,e,r,n){for(var a=t.length,s=r+(n?1:-1);n?s--:++s<a;)if(e(t[s],s,t))return s;return-1}function Sp(t,e,r){if(e!==e)return xp(t,Ip,r);for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}function Ip(t){return t!==t}function Bp(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&n++;return n}function Op(t,e){return t?.[e]}function Tp(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function vn(t,e){for(var r=-1,n=t.length,a=0,s=[];++r<n;){var f=t[r];(f===e||f===ho)&&(t[r]=ho,s[a++]=r)}return s}var Rp=Function.prototype,vo=Object.prototype,_n=Rt["__core-js_shared__"],_o=function(){var t=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),bo=Rp.toString,Fp=vo.hasOwnProperty,Eo=vo.toString,Pp=RegExp("^"+bo.call(Fp).replace(cp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$p=Object.create,ut=Math.max,Up=Math.min,Ao=function(){var t=So(Object,"defineProperty"),e=So.name;return e&&e.length>2?t:void 0}();function Cp(t){return ct(t)?$p(t):{}}function Dp(t){if(!ct(t)||Yp(t))return!1;var e=Qp(t)||Tp(t)?Pp:gp;return e.test(Jp(t))}function Np(t,e){return e=ut(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,a=ut(r.length-e,0),s=Array(a);++n<a;)s[n]=r[e+n];n=-1;for(var f=Array(e+1);++n<e;)f[n]=r[n];return f[e]=s,wn(t,this,f)}}function Mp(t,e,r,n){for(var a=-1,s=t.length,f=r.length,p=-1,h=e.length,m=ut(s-f,0),v=Array(h+m),_=!n;++p<h;)v[p]=e[p];for(;++a<f;)(_||a<s)&&(v[r[a]]=t[a]);for(;m--;)v[p++]=t[a++];return v}function Lp(t,e,r,n){for(var a=-1,s=t.length,f=-1,p=r.length,h=-1,m=e.length,v=ut(s-p,0),_=Array(v+m),b=!n;++a<v;)_[a]=t[a];for(var y=a;++h<m;)_[y+h]=e[h];for(;++f<p;)(b||a<s)&&(_[y+r[f]]=t[a++]);return _}function kp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function jp(t,e,r){var n=e&Ge,a=Ft(t);function s(){var f=this&&this!==Rt&&this instanceof s?a:t;return f.apply(n?r:this,arguments)}return s}function Ft(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Cp(t.prototype),n=t.apply(r,e);return ct(n)?n:r}}function qp(t,e,r){var n=Ft(t);function a(){for(var s=arguments.length,f=Array(s),p=s,h=En(a);p--;)f[p]=arguments[p];var m=s<3&&f[0]!==h&&f[s-1]!==h?[]:vn(f,h);if(s-=m.length,s<r)return xo(t,e,bn,a.placeholder,void 0,f,m,void 0,void 0,r-s);var v=this&&this!==Rt&&this instanceof a?n:t;return wn(v,this,f)}return a}function bn(t,e,r,n,a,s,f,p,h,m){var v=e&yo,_=e&Ge,b=e&fr,y=e&(st|Ot),x=e&go,I=b?void 0:Ft(t);function O(){for(var S=arguments.length,T=Array(S),F=S;F--;)T[F]=arguments[F];if(y)var R=En(O),D=Bp(T,R);if(n&&(T=Mp(T,n,a,y)),s&&(T=Lp(T,s,f,y)),S-=D,y&&S<m){var N=vn(T,R);return xo(t,e,bn,O.placeholder,r,T,N,p,h,m-S)}var V=_?r:this,k=b?V[t]:t;return S=T.length,p?T=Xp(T,p):x&&S>1&&T.reverse(),v&&h<S&&(T.length=h),this&&this!==Rt&&this instanceof O&&(k=I||Ft(k)),k.apply(V,T)}return O}function Vp(t,e,r,n){var a=e&Ge,s=Ft(t);function f(){for(var p=-1,h=arguments.length,m=-1,v=n.length,_=Array(v+h),b=this&&this!==Rt&&this instanceof f?s:t;++m<v;)_[m]=n[m];for(;h--;)_[m++]=arguments[++p];return wn(b,a?r:this,_)}return f}function xo(t,e,r,n,a,s,f,p,h,m){var v=e&st,_=v?f:void 0,b=v?void 0:f,y=v?s:void 0,x=v?void 0:s;e|=v?We:Tt,e&=~(v?Tt:We),e&tp||(e&=~(Ge|fr));var I=r(t,e,a,y,_,x,b,p,h,m);return I.placeholder=n,Io(I,t,e)}function zp(t,e,r,n,a,s,f,p){var h=e&fr;if(!h&&typeof t!="function")throw new TypeError(ep);var m=n?n.length:0;if(m||(e&=~(We|Tt),n=a=void 0),f=f===void 0?f:ut(Bo(f),0),p=p===void 0?p:Bo(p),m-=a?a.length:0,e&Tt){var v=n,_=a;n=a=void 0}var b=[t,e,r,n,a,v,_,s,f,p];if(t=b[0],e=b[1],r=b[2],n=b[3],a=b[4],p=b[9]=b[9]==null?h?0:t.length:ut(b[9]-m,0),!p&&e&(st|Ot)&&(e&=~(st|Ot)),!e||e==Ge)var y=jp(t,e,r);else e==st||e==Ot?y=qp(t,e,p):(e==We||e==(Ge|We))&&!a.length?y=Vp(t,e,r,n):y=bn.apply(void 0,b);return Io(y,t,e)}function En(t){var e=t;return e.placeholder}function So(t,e){var r=Op(t,e);return Dp(r)?r:void 0}function Gp(t){var e=t.match(pp);return e?e[1].split(hp):[]}function Wp(t,e){var r=e.length,n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(lp,`{
|
|
8
|
+
*/var gf=50;d.TYPED_ARRAY_SUPPORT=Ce.TYPED_ARRAY_SUPPORT!==void 0?Ce.TYPED_ARRAY_SUPPORT:!0,jr();function jr(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function re(r,e){if(jr()<e)throw new RangeError("Invalid typed array length");return d.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=d.prototype):(r===null&&(r=new d(e)),r.length=e),r}function d(r,e,t){if(!d.TYPED_ARRAY_SUPPORT&&!(this instanceof d))return new d(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return rn(this,r)}return Li(this,r,e,t)}d.poolSize=8192,d._augment=function(r){return r.__proto__=d.prototype,r};function Li(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?mf(r,e,t,n):typeof e=="string"?_f(r,e,t):wf(r,e)}d.from=function(r,e,t){return Li(null,r,e,t)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&d[Symbol.species]);function ki(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function vf(r,e,t,n){return ki(e),e<=0?re(r,e):t!==void 0?typeof n=="string"?re(r,e).fill(t,n):re(r,e).fill(t):re(r,e)}d.alloc=function(r,e,t){return vf(null,r,e,t)};function rn(r,e){if(ki(e),r=re(r,e<0?0:nn(e)|0),!d.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}d.allocUnsafe=function(r){return rn(null,r)},d.allocUnsafeSlow=function(r){return rn(null,r)};function _f(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!d.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=ji(e,t)|0;r=re(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function tn(r,e){var t=e.length<0?0:nn(e.length)|0;r=re(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function mf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),d.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=d.prototype):r=tn(r,e),r}function wf(r,e){if(K(e)){var t=nn(e.length)|0;return r=re(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Lf(e.length)?re(r,0):tn(r,e);if(e.type==="Buffer"&&Ci(e.data))return tn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nn(r){if(r>=jr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jr().toString(16)+" bytes");return r|0}d.isBuffer=kf;function K(r){return!!(r!=null&&r._isBuffer)}d.compare=function(e,t){if(!K(e)||!K(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Ci(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=d.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!K(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function ji(r,e){if(K(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Gr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ki(r).length;default:if(n)return Gr(r).length;e=(""+e).toLowerCase(),n=!0}}d.byteLength=ji;function bf(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Rf(this,e,t);case"utf8":case"utf-8":return Hi(this,e,t);case"ascii":return Pf(this,e,t);case"latin1":case"binary":return Tf(this,e,t);case"base64":return If(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ff(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function be(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)be(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)be(this,t,t+3),be(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)be(this,t,t+7),be(this,t+1,t+6),be(this,t+2,t+5),be(this,t+3,t+4);return this},d.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Hi(this,0,e):bf.apply(this,arguments)},d.prototype.equals=function(e){if(!K(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0},d.prototype.inspect=function(){var e="",t=gf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},d.prototype.compare=function(e,t,n,i,a){if(!K(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,u=n-t,f=Math.min(o,u),c=this.slice(i,a),l=e.slice(t,n),s=0;s<f;++s)if(c[s]!==l[s]){o=c[s],u=l[s];break}return o<u?-1:u<o?1:0};function qi(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=d.from(e,n)),K(e))return e.length===0?-1:Vi(r,e,t,n,i);if(typeof e=="number")return e=e&255,d.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Vi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Vi(r,e,t,n,i){var a=1,o=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,u/=2,t/=2}function f(y,m){return a===1?y[m]:y.readUInt16BE(m*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===u)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+u>o&&(t=o-u),c=t;c>=0;c--){for(var s=!0,h=0;h<u;h++)if(f(r,c+h)!==f(e,h)){s=!1;break}if(s)return c}return-1}d.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},d.prototype.indexOf=function(e,t,n){return qi(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return qi(this,e,t,n,!1)};function $f(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var u=parseInt(e.substr(o*2,2),16);if(isNaN(u))return o;r[t+o]=u}return o}function Ef(r,e,t,n){return Hr(Gr(e,r.length-t),r,t,n)}function Gi(r,e,t,n){return Hr(Uf(e),r,t,n)}function Af(r,e,t,n){return Gi(r,e,t,n)}function Of(r,e,t,n){return Hr(Ki(e),r,t,n)}function Sf(r,e,t,n){return Hr(Cf(e,r.length-t),r,t,n)}d.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return $f(this,e,t,n);case"utf8":case"utf-8":return Ef(this,e,t,n);case"ascii":return Gi(this,e,t,n);case"latin1":case"binary":return Af(this,e,t,n);case"base64":return Of(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sf(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function If(r,e,t){return e===0&&t===r.length?Di(r):Di(r.slice(e,t))}function Hi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=t){var f,c,l,s;switch(u){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(s=(a&31)<<6|f&63,s>127&&(o=s));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(s=(a&15)<<12|(f&63)<<6|c&63,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(s=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,s>65535&&s<1114112&&(o=s))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=u}return xf(n)}var Wi=4096;function xf(r){var e=r.length;if(e<=Wi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Wi));return t}function Pf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Tf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function Rf(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=Df(r[a]);return i}function Ff(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}d.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(d.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=d.prototype;else{var a=t-e;i=new d(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function D(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},d.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},d.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},d.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},d.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},d.prototype.readInt8=function(e,t){return t||D(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},d.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},d.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},d.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),kr(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),kr(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),kr(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),kr(this,e,!1,52,8)};function V(r,e,t,n,i,a){if(!K(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}d.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=1,u=0;for(this[t]=e&255;++u<n&&(o*=256);)this[t+u]=e/o&255;return t+n},d.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=n-1,u=1;for(this[t+o]=e&255;--o>=0&&(u*=256);)this[t+o]=e/u&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function qr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):qr(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):qr(this,e,t,!1),t+2};function Vr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Vr(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Vr(this,e,t,!1),t+4},d.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=0,u=1,f=0;for(this[t]=e&255;++o<n&&(u*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/u>>0)-f&255;return t+n},d.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=n-1,u=1,f=0;for(this[t+o]=e&255;--o>=0&&(u*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/u>>0)-f&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,127,-128),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):qr(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):qr(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Vr(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Vr(this,e,t,!1),t+4};function Xi(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function zi(r,e,t,n,i){return i||Xi(r,e,t,4),Ui(r,e,t,n,23,4),t+4}d.prototype.writeFloatLE=function(e,t,n){return zi(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return zi(this,e,t,!1,n)};function Yi(r,e,t,n,i){return i||Xi(r,e,t,8),Ui(r,e,t,n,52,8),t+8}d.prototype.writeDoubleLE=function(e,t,n){return Yi(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return Yi(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!d.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},d.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var u=K(e)?e:Gr(new d(e,i).toString()),f=u.length;for(o=0;o<n-t;++o)this[o+t]=u[o%f]}return this};var Mf=/[^+\/0-9A-Za-z-_]/g;function Nf(r){if(r=Bf(r).replace(Mf,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Bf(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Df(r){return r<16?"0"+r.toString(16):r.toString(16)}function Gr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function Uf(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Cf(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Ki(r){return hf(Nf(r))}function Hr(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Lf(r){return r!==r}function kf(r){return r!=null&&(!!r._isBuffer||Zi(r)||jf(r))}function Zi(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function jf(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Zi(r.slice(0,0))}function Ji(){throw new Error("setTimeout has not been defined")}function Qi(){throw new Error("clearTimeout has not been defined")}var ue=Ji,se=Qi;typeof Ce.setTimeout=="function"&&(ue=setTimeout),typeof Ce.clearTimeout=="function"&&(se=clearTimeout);function ea(r){if(ue===setTimeout)return setTimeout(r,0);if((ue===Ji||!ue)&&setTimeout)return ue=setTimeout,setTimeout(r,0);try{return ue(r,0)}catch{try{return ue.call(null,r,0)}catch{return ue.call(this,r,0)}}}function qf(r){if(se===clearTimeout)return clearTimeout(r);if((se===Qi||!se)&&clearTimeout)return se=clearTimeout,clearTimeout(r);try{return se(r)}catch{try{return se.call(null,r)}catch{return se.call(this,r)}}}var te=[],Le=!1,$e,Wr=-1;function Vf(){!Le||!$e||(Le=!1,$e.length?te=$e.concat(te):Wr=-1,te.length&&ra())}function ra(){if(!Le){var r=ea(Vf);Le=!0;for(var e=te.length;e;){for($e=te,te=[];++Wr<e;)$e&&$e[Wr].run();Wr=-1,e=te.length}$e=null,Le=!1,qf(r)}}function Gf(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];te.push(new ta(r,e)),te.length===1&&!Le&&ea(ra)}function ta(r,e){this.fun=r,this.array=e}ta.prototype.run=function(){this.fun.apply(null,this.array)};var Hf="browser",Wf="browser",Xf=!0,zf={},Yf=[],Kf="",Zf={},Jf={},Qf={};function Ee(){}var ec=Ee,rc=Ee,tc=Ee,nc=Ee,ic=Ee,ac=Ee,oc=Ee;function uc(r){throw new Error("process.binding is not supported")}function sc(){return"/"}function fc(r){throw new Error("process.chdir is not supported")}function cc(){return 0}var ke=Ce.performance||{},lc=ke.now||ke.mozNow||ke.msNow||ke.oNow||ke.webkitNow||function(){return new Date().getTime()};function hc(r){var e=lc.call(ke)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var pc=new Date;function dc(){var r=new Date,e=r-pc;return e/1e3}var je={nextTick:Gf,title:Hf,browser:Xf,env:zf,argv:Yf,version:Kf,versions:Zf,on:ec,addListener:rc,once:tc,off:nc,removeListener:ic,removeAllListeners:ac,emit:oc,binding:uc,cwd:sc,chdir:fc,umask:cc,hrtime:hc,platform:Wf,release:Jf,config:Qf,uptime:dc},an;typeof Object.create=="function"?an=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:an=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var na=an,ia=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++)n[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return n},yc=/%[sdj%]/g;function Xr(r){if(!ur(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Z(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(yc,function(u){if(u==="%%")return"%";if(t>=i)return u;switch(u){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return u}}),o=n[t];t<i;o=n[++t])or(o)||!Ae(o)?a+=" "+o:a+=" "+Z(o);return a}function on(r,e){if(J(Ce.process))return function(){return on(r,e).apply(this,arguments)};if(je.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(je.throwDeprecation)throw new Error(e);je.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var zr={},un;function aa(r){if(J(un)&&(un=je.env.NODE_DEBUG||""),r=r.toUpperCase(),!zr[r])if(new RegExp("\\b"+r+"\\b","i").test(un)){var e=0;zr[r]=function(){var t=Xr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else zr[r]=function(){};return zr[r]}function Z(r,e){var t={seen:[],stylize:vc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Kr(e)?t.showHidden=e:e&&dn(t,e),J(t.showHidden)&&(t.showHidden=!1),J(t.depth)&&(t.depth=2),J(t.colors)&&(t.colors=!1),J(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=gc),Yr(t,r,t.depth)}Z.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Z.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function gc(r,e){var t=Z.styles[e];return t?"\x1B["+Z.colors[t][0]+"m"+r+"\x1B["+Z.colors[t][1]+"m":r}function vc(r,e){return r}function _c(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function Yr(r,e,t){if(r.customInspect&&e&&cr(e.inspect)&&e.inspect!==Z&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return ur(n)||(n=Yr(r,n,t)),n}var i=mc(r,e);if(i)return i;var a=Object.keys(e),o=_c(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),fr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return sn(e);if(a.length===0){if(cr(e)){var u=e.name?": "+e.name:"";return r.stylize("[Function"+u+"]","special")}if(sr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Zr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(fr(e))return sn(e)}var f="",c=!1,l=["{","}"];if(cn(e)&&(c=!0,l=["[","]"]),cr(e)){var s=e.name?": "+e.name:"";f=" [Function"+s+"]"}if(sr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Zr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),fr(e)&&(f=" "+sn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return sr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var h;return c?h=wc(r,e,t,o,a):h=a.map(function(y){return fn(r,e,t,o,y,c)}),r.seen.pop(),bc(h,f,l)}function mc(r,e){if(J(e))return r.stylize("undefined","undefined");if(ur(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(ln(e))return r.stylize(""+e,"number");if(Kr(e))return r.stylize(""+e,"boolean");if(or(e))return r.stylize("null","null")}function sn(r){return"["+Error.prototype.toString.call(r)+"]"}function wc(r,e,t,n,i){for(var a=[],o=0,u=e.length;o<u;++o)la(e,String(o))?a.push(fn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(fn(r,e,t,n,f,!0))}),a}function fn(r,e,t,n,i,a){var o,u,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?u=r.stylize("[Getter/Setter]","special"):u=r.stylize("[Getter]","special"):f.set&&(u=r.stylize("[Setter]","special")),la(n,i)||(o="["+i+"]"),u||(r.seen.indexOf(f.value)<0?(or(t)?u=Yr(r,f.value,null):u=Yr(r,f.value,t-1),u.indexOf(`
|
|
9
|
+
`)>-1&&(a?u=u.split(`
|
|
10
|
+
`).map(function(c){return" "+c}).join(`
|
|
11
|
+
`).substr(2):u=`
|
|
12
|
+
`+u.split(`
|
|
13
|
+
`).map(function(c){return" "+c}).join(`
|
|
14
|
+
`))):u=r.stylize("[Circular]","special")),J(o)){if(a&&i.match(/^\d+$/))return u;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+u}function bc(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
|
|
15
|
+
`)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
|
|
16
|
+
`)+" "+r.join(`,
|
|
17
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function cn(r){return Array.isArray(r)}function Kr(r){return typeof r=="boolean"}function or(r){return r===null}function oa(r){return r==null}function ln(r){return typeof r=="number"}function ur(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function J(r){return r===void 0}function sr(r){return Ae(r)&&hn(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function Zr(r){return Ae(r)&&hn(r)==="[object Date]"}function fr(r){return Ae(r)&&(hn(r)==="[object Error]"||r instanceof Error)}function cr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return d.isBuffer(r)}function hn(r){return Object.prototype.toString.call(r)}function pn(r){return r<10?"0"+r.toString(10):r.toString(10)}var $c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ec(){var r=new Date,e=[pn(r.getHours()),pn(r.getMinutes()),pn(r.getSeconds())].join(":");return[r.getDate(),$c[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Ec(),Xr.apply(null,arguments))}function dn(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Oe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function yn(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Oe&&r[Oe]){var e=r[Oe];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Oe,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(u,f){t=u,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(u,f){u?n(u):t(f)});try{r.apply(this,a)}catch(u){n(u)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Oe&&Object.defineProperty(e,Oe,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,ia(r))}yn.custom=Oe;function Ac(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function ha(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(u){je.nextTick(o.bind(null,null,u))},function(u){je.nextTick(Ac.bind(null,u,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,ia(r)),e}var Oc={inherits:na,_extend:dn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:cr,isError:fr,isDate:Zr,isObject:Ae,isRegExp:sr,isUndefined:J,isSymbol:ua,isString:ur,isNumber:ln,isNullOrUndefined:oa,isNull:or,isBoolean:Kr,isArray:cn,inspect:Z,deprecate:on,format:Xr,debuglog:aa,promisify:yn,callbackify:ha},Sc=Object.freeze({__proto__:null,_extend:dn,callbackify:ha,debuglog:aa,default:Oc,deprecate:on,format:Xr,inherits:na,inspect:Z,isArray:cn,isBoolean:Kr,isBuffer:fa,isDate:Zr,isError:fr,isFunction:cr,isNull:or,isNullOrUndefined:oa,isNumber:ln,isObject:Ae,isPrimitive:sa,isRegExp:sr,isString:ur,isSymbol:ua,isUndefined:J,log:ca,promisify:yn}),Ic=Os(Sc),xc=Ic.inspect,gn=typeof Map=="function"&&Map.prototype,vn=Object.getOwnPropertyDescriptor&&gn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Jr=gn&&vn&&typeof vn.get=="function"?vn.get:null,pa=gn&&Map.prototype.forEach,_n=typeof Set=="function"&&Set.prototype,mn=Object.getOwnPropertyDescriptor&&_n?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qr=_n&&mn&&typeof mn.get=="function"?mn.get:null,da=_n&&Set.prototype.forEach,Pc=typeof WeakMap=="function"&&WeakMap.prototype,lr=Pc?WeakMap.prototype.has:null,Tc=typeof WeakSet=="function"&&WeakSet.prototype,hr=Tc?WeakSet.prototype.has:null,Rc=typeof WeakRef=="function"&&WeakRef.prototype,ya=Rc?WeakRef.prototype.deref:null,Fc=Boolean.prototype.valueOf,Mc=Object.prototype.toString,Nc=Function.prototype.toString,Bc=String.prototype.match,wn=String.prototype.slice,fe=String.prototype.replace,Dc=String.prototype.toUpperCase,ga=String.prototype.toLowerCase,va=RegExp.prototype.test,_a=Array.prototype.concat,Q=Array.prototype.join,Uc=Array.prototype.slice,ma=Math.floor,bn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$n=Object.getOwnPropertySymbols,En=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,qe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qe||"symbol")?Symbol.toStringTag:null,wa=Object.prototype.propertyIsEnumerable,ba=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function $a(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||va.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-ma(-r):ma(r);if(n!==r){var i=String(n),a=wn.call(e,i.length+1);return fe.call(i,t,"$&_")+"."+fe.call(fe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fe.call(e,t,"$&_")}var An=xc,Ea=An.custom,Aa=Ia(Ea)?Ea:null,Cc=function r(e,t,n,i){var a=t||{};if(ce(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=ce(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Pa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return u?$a(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return u?$a(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return On(e)?"[Array]":"[Object]";var s=tl(a,n);if(typeof i>"u")i=[];else if(xa(i,e)>=0)return"[Circular]";function h(X,de,nr){if(de&&(i=Uc.call(i),i.push(de)),nr){var ye={depth:a.depth};return ce(a,"quoteStyle")&&(ye.quoteStyle=a.quoteStyle),r(X,ye,n+1,i)}return r(X,a,n+1,i)}if(typeof e=="function"&&!Sa(e)){var y=Xc(e),m=et(e,h);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(m.length>0?" { "+Q.call(m,", ")+" }":"")}if(Ia(e)){var E=qe?fe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):En.call(e);return typeof e=="object"&&!qe?pr(E):E}if(Qc(e)){for(var O="<"+ga.call(String(e.nodeName)),w=e.attributes||[],$=0;$<w.length;$++)O+=" "+w[$].name+"="+Oa(Lc(w[$].value),"double",a);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+ga.call(String(e.nodeName))+">",O}if(On(e)){if(e.length===0)return"[]";var p=et(e,h);return s&&!rl(p)?"["+In(p,s)+"]":"[ "+Q.call(p,", ")+" ]"}if(jc(e)){var S=et(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!wa.call(e,"cause")?"{ ["+String(e)+"] "+Q.call(_a.call("[cause]: "+h(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Q.call(S,", ")+" }"}if(typeof e=="object"&&o){if(Aa&&typeof e[Aa]=="function"&&An)return An(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(zc(e)){var P=[];return pa&&pa.call(e,function(X,de){P.push(h(de,e,!0)+" => "+h(X,e))}),Ta("Map",Jr.call(e),P,s)}if(Zc(e)){var R=[];return da&&da.call(e,function(X){R.push(h(X,e))}),Ta("Set",Qr.call(e),R,s)}if(Yc(e))return Sn("WeakMap");if(Jc(e))return Sn("WeakSet");if(Kc(e))return Sn("WeakRef");if(Vc(e))return pr(h(Number(e)));if(Hc(e))return pr(h(bn.call(e)));if(Gc(e))return pr(Fc.call(e));if(qc(e))return pr(h(String(e)));if(!kc(e)&&!Sa(e)){var _=et(e,h),g=ba?ba(e)===Object.prototype:e instanceof Object||e.constructor===Object,v=e instanceof Object?"":"null prototype",A=!g&&L&&Object(e)===e&&L in e?wn.call(le(e),8,-1):v?"Object":"",I=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",F=I+(A||v?"["+Q.call(_a.call([],A||[],v||[]),": ")+"] ":"");return _.length===0?F+"{}":s?F+"{"+In(_,s)+"}":F+"{ "+Q.call(_,", ")+" }"}return String(e)};function Oa(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Lc(r){return fe.call(String(r),/"/g,""")}function On(r){return le(r)==="[object Array]"&&(!L||!(typeof r=="object"&&L in r))}function kc(r){return le(r)==="[object Date]"&&(!L||!(typeof r=="object"&&L in r))}function Sa(r){return le(r)==="[object RegExp]"&&(!L||!(typeof r=="object"&&L in r))}function jc(r){return le(r)==="[object Error]"&&(!L||!(typeof r=="object"&&L in r))}function qc(r){return le(r)==="[object String]"&&(!L||!(typeof r=="object"&&L in r))}function Vc(r){return le(r)==="[object Number]"&&(!L||!(typeof r=="object"&&L in r))}function Gc(r){return le(r)==="[object Boolean]"&&(!L||!(typeof r=="object"&&L in r))}function Ia(r){if(qe)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!En)return!1;try{return En.call(r),!0}catch{}return!1}function Hc(r){if(!r||typeof r!="object"||!bn)return!1;try{return bn.call(r),!0}catch{}return!1}var Wc=Object.prototype.hasOwnProperty||function(r){return r in this};function ce(r,e){return Wc.call(r,e)}function le(r){return Mc.call(r)}function Xc(r){if(r.name)return r.name;var e=Bc.call(Nc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function xa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function zc(r){if(!Jr||!r||typeof r!="object")return!1;try{Jr.call(r);try{Qr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Yc(r){if(!lr||!r||typeof r!="object")return!1;try{lr.call(r,lr);try{hr.call(r,hr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Kc(r){if(!ya||!r||typeof r!="object")return!1;try{return ya.call(r),!0}catch{}return!1}function Zc(r){if(!Qr||!r||typeof r!="object")return!1;try{Qr.call(r);try{Jr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Jc(r){if(!hr||!r||typeof r!="object")return!1;try{hr.call(r,hr);try{lr.call(r,lr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Qc(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Pa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Pa(wn.call(r,0,e.maxStringLength),e)+n}var i=fe.call(fe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,el);return Oa(i,"single",e)}function el(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Dc.call(e.toString(16))}function pr(r){return"Object("+r+")"}function Sn(r){return r+" { ? }"}function Ta(r,e,t,n){var i=n?In(t,n):Q.call(t,", ");return r+" ("+e+") {"+i+"}"}function rl(r){for(var e=0;e<r.length;e++)if(xa(r[e],`
|
|
18
|
+
`)>=0)return!1;return!0}function tl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Q.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Q.call(Array(e+1),t)}}function In(r,e){if(r.length===0)return"";var t=`
|
|
19
|
+
`+e.prev+e.base;return t+Q.call(r,","+t)+`
|
|
20
|
+
`+e.prev}function et(r,e){var t=On(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ce(r,i)?e(r[i],r):""}var a=typeof $n=="function"?$n(r):[],o;if(qe){o={};for(var u=0;u<a.length;u++)o["$"+a[u]]=a[u]}for(var f in r)ce(r,f)&&(t&&String(Number(f))===f&&f<r.length||qe&&o["$"+f]instanceof Symbol||(va.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof $n=="function")for(var c=0;c<a.length;c++)wa.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var xn=Qt,Ve=cf,nl=Cc,il=xn("%TypeError%"),rt=xn("%WeakMap%",!0),tt=xn("%Map%",!0),al=Ve("WeakMap.prototype.get",!0),ol=Ve("WeakMap.prototype.set",!0),ul=Ve("WeakMap.prototype.has",!0),sl=Ve("Map.prototype.get",!0),fl=Ve("Map.prototype.set",!0),cl=Ve("Map.prototype.has",!0),Pn=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},ll=function(r,e){var t=Pn(r,e);return t&&t.value},hl=function(r,e,t){var n=Pn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},pl=function(r,e){return!!Pn(r,e)},dl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new il("Side channel does not contain "+nl(a))},get:function(a){if(rt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return al(e,a)}else if(tt){if(t)return sl(t,a)}else if(n)return ll(n,a)},has:function(a){if(rt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return ul(e,a)}else if(tt){if(t)return cl(t,a)}else if(n)return pl(n,a);return!1},set:function(a,o){rt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new rt),ol(e,a,o)):tt?(t||(t=new tt),fl(t,a,o)):(n||(n={key:{},next:null}),hl(n,a,o))}};return i},yl=String.prototype.replace,gl=/%20/g,Tn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ra={default:Tn.RFC3986,formatters:{RFC1738:function(r){return yl.call(r,gl,"+")},RFC3986:function(r){return String(r)}},RFC1738:Tn.RFC1738,RFC3986:Tn.RFC3986},vl=Ra,Rn=Object.prototype.hasOwnProperty,Se=Array.isArray,ee=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),_l=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Se(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Fa=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},ml=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Se(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Rn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Se(e)&&!Se(t)&&(i=Fa(e,n)),Se(e)&&Se(t)?(t.forEach(function(a,o){if(Rn.call(e,o)){var u=e[o];u&&typeof u=="object"&&a&&typeof a=="object"?e[o]=r(u,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var u=t[o];return Rn.call(a,o)?a[o]=r(a[o],u,n):a[o]=u,a},i)},wl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},bl=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},$l=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var u="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===vl.RFC1738&&(c===40||c===41)){u+=o.charAt(f);continue}if(c<128){u=u+ee[c];continue}if(c<2048){u=u+(ee[192|c>>6]+ee[128|c&63]);continue}if(c<55296||c>=57344){u=u+(ee[224|c>>12]+ee[128|c>>6&63]+ee[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),u+=ee[240|c>>18]+ee[128|c>>12&63]+ee[128|c>>6&63]+ee[128|c&63]}return u},El=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],u=Object.keys(o),f=0;f<u.length;++f){var c=u[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return _l(t),e},Al=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ol=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Sl=function(e,t){return[].concat(e,t)},Il=function(e,t){if(Se(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},xl={arrayToObject:Fa,assign:wl,combine:Sl,compact:El,decode:bl,encode:$l,isBuffer:Ol,isRegExp:Al,maybeMap:Il,merge:ml},Ma=dl,nt=xl,dr=Ra,Pl=Object.prototype.hasOwnProperty,Na={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ne=Array.isArray,Tl=Array.prototype.push,Ba=function(r,e){Tl.apply(r,ne(e)?e:[e])},Rl=Date.prototype.toISOString,Da=dr.default,k={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:nt.encode,encodeValuesOnly:!1,format:Da,formatter:dr.formatters[Da],indices:!1,serializeDate:function(e){return Rl.call(e)},skipNulls:!1,strictNullHandling:!1},Fl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Fn={},Ml=function r(e,t,n,i,a,o,u,f,c,l,s,h,y,m,E,O){for(var w=e,$=O,p=0,S=!1;($=$.get(Fn))!==void 0&&!S;){var P=$.get(e);if(p+=1,typeof P<"u"){if(P===p)throw new RangeError("Cyclic object value");S=!0}typeof $.get(Fn)>"u"&&(p=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=s(w):n==="comma"&&ne(w)&&(w=nt.maybeMap(w,function(ye){return ye instanceof Date?s(ye):ye})),w===null){if(a)return u&&!m?u(t,k.encoder,E,"key",h):t;w=""}if(Fl(w)||nt.isBuffer(w)){if(u){var R=m?t:u(t,k.encoder,E,"key",h);return[y(R)+"="+y(u(w,k.encoder,E,"value",h))]}return[y(t)+"="+y(String(w))]}var _=[];if(typeof w>"u")return _;var g;if(n==="comma"&&ne(w))m&&u&&(w=nt.maybeMap(w,u)),g=[{value:w.length>0?w.join(",")||null:void 0}];else if(ne(f))g=f;else{var v=Object.keys(w);g=c?v.sort(c):v}for(var A=i&&ne(w)&&w.length===1?t+"[]":t,I=0;I<g.length;++I){var F=g[I],X=typeof F=="object"&&typeof F.value<"u"?F.value:w[F];if(!(o&&X===null)){var de=ne(w)?typeof n=="function"?n(A,F):A:A+(l?"."+F:"["+F+"]");O.set(e,p);var nr=Ma();nr.set(Fn,O),Ba(_,r(X,de,n,i,a,o,n==="comma"&&m&&ne(w)?null:u,f,c,l,s,h,y,m,E,nr))}}return _},Nl=function(e){if(!e)return k;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||k.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=dr.default;if(typeof e.format<"u"){if(!Pl.call(dr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=dr.formatters[n],a=k.filter;return(typeof e.filter=="function"||ne(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:k.addQueryPrefix,allowDots:typeof e.allowDots>"u"?k.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:k.charsetSentinel,delimiter:typeof e.delimiter>"u"?k.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:k.encode,encoder:typeof e.encoder=="function"?e.encoder:k.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:k.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:k.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:k.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:k.strictNullHandling}},Bl=function(r,e){var t=r,n=Nl(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ne(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in Na?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var f=Na[u];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=Ma(),s=0;s<i.length;++s){var h=i[s];n.skipNulls&&t[h]===null||Ba(o,Ml(t[h],h,f,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var y=o.join(n.delimiter),m=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),y.length>0?m+y:""},Dl=ge(Bl);let Ua={storeIdentifier:"",environment:"prod"};function Ul(r){Ua=r}function W(){return Ua}const Cl=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},yr=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},Ll=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},kl="/tools/recurring";class it{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function jl(r){return Dl(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function at(r,e,t={}){const n=W();return G(r,`${Ll(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function b(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:u,environmentUri:f,storeIdentifier:c,loginRetryFn:l}=W(),s=o.apiToken,h=Cl(u,f),y={"X-Recharge-Access-Token":s,"X-Recharge-Version":"2021-11",...a||{}},m={shop_url:c,...n};try{return await G(r,`${h}${e}`,{id:t,query:m,data:i,headers:y})}catch(E){if(l&&E instanceof it&&E.status===401)return l().then(O=>{if(O)return G(r,`${h}${e}`,{id:t,query:m,data:i,headers:{...y,"X-Recharge-Access-Token":O.apiToken}});throw E});throw E}}async function gr(r,e,t={}){return G(r,`${kl}${e}`,t)}async function G(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let s;[o,s]=o.split("?");const h=[s,jl(n)].join("&").replace(/^&/,"");o=`${o}${h?`?${h}`:""}`}let u;i&&r!=="get"&&(u=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:u});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new it(l.error,c.status):l&&l.errors?new it(JSON.stringify(l.errors),c.status):new it("A connection error occurred while making the request");return l}function ql(r,e){return b("get","/addresses",{query:e},r)}async function Vl(r,e,t){const{address:n}=await b("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function Gl(r,e){const{address:t}=await b("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},r);return t}async function Mn(r,e,t){const{address:n}=await b("put","/addresses",{id:e,data:t},r);return n}async function Hl(r,e,t){return Mn(r,e,{discounts:[{code:t}]})}async function Wl(r,e){return Mn(r,e,{discounts:[]})}function Xl(r,e){return b("delete","/addresses",{id:e},r)}async function zl(r,e){const{address:t}=await b("post","/addresses/merge",{data:e},r);return t}async function Yl(r,e,t){const{charge:n}=await b("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Kl=Object.freeze({__proto__:null,applyDiscountToAddress:Hl,createAddress:Gl,deleteAddress:Xl,getAddress:Vl,listAddresses:ql,mergeAddresses:zl,removeDiscountsFromAddress:Wl,skipFutureCharge:Yl,updateAddress:Mn});async function Zl(){const{storefrontAccessToken:r}=W(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await gr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Jl(r,e){return Ca(r,e)}async function Ca(r,e){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=W(),o=yr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const{api_token:f,customer_id:c,message:l}=await G("post",`${o}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:a},headers:u});return f?{apiToken:f,customerId:c,message:l}:null}async function Ql(r){const{environment:e,environmentUri:t,storefrontAccessToken:n,storeIdentifier:i}=W(),a=yr(e,t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const{api_token:u,customer_id:f,message:c}=await G("post",`${a}/shopify_customer_account_api_access`,{data:{customer_token:r,shop_url:i},headers:o});return u?{apiToken:u,customerId:f,message:c}:null}async function eh(r,e={}){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=W(),o=yr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await G("post",`${o}/attempt_login`,{data:{email:r,shop:a,...e},headers:u});if(f.errors)throw new Error(f.errors);return f.session_token}async function rh(r,e={}){const{storefrontAccessToken:t}=W(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await gr("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function th(r,e,t){const{environment:n,environmentUri:i,storefrontAccessToken:a,storeIdentifier:o}=W(),u=yr(n,i),f={};a&&(f["X-Recharge-Storefront-Access-Token"]=a);const c=await G("post",`${u}/validate_login`,{data:{code:t,email:r,session_token:e,shop:o},headers:f});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}async function nh(r,e,t){const{storefrontAccessToken:n}=W(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await gr("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function ih(){const{pathname:r,search:e}=window.location,t=new URLSearchParams(e).get("token"),n=r.split("/").filter(Boolean),i=n.findIndex(o=>o==="portal"),a=i!==-1?n[i+1]:void 0;if(!t||!a)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:a,token:t}}async function ah(){const{customerHash:r,token:e}=ih(),{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=W(),o=yr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await G("post",`${o}/customers/${r}/access`,{headers:u,data:{token:e,shop:a}});return{apiToken:f.api_token,customerId:f.customer_id}}var oh=Object.freeze({__proto__:null,loginCustomerPortal:ah,loginShopifyApi:Jl,loginShopifyAppProxy:Zl,loginWithShopifyCustomerAccount:Ql,loginWithShopifyStorefront:Ca,sendPasswordlessCode:eh,sendPasswordlessCodeAppProxy:rh,validatePasswordlessCode:th,validatePasswordlessCodeAppProxy:nh});let uh=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var La={},Nn={},ie={},sh=typeof U=="object"&&U&&U.Object===Object&&U,ka=sh,fh=ka,ch=typeof self=="object"&&self&&self.Object===Object&&self,lh=fh||ch||Function("return this")(),ae=lh,hh=ae,ph=hh.Symbol,ot=ph,ja=ot,qa=Object.prototype,dh=qa.hasOwnProperty,yh=qa.toString,vr=ja?ja.toStringTag:void 0;function gh(r){var e=dh.call(r,vr),t=r[vr];try{r[vr]=void 0;var n=!0}catch{}var i=yh.call(r);return n&&(e?r[vr]=t:delete r[vr]),i}var vh=gh,_h=Object.prototype,mh=_h.toString;function wh(r){return mh.call(r)}var bh=wh,Va=ot,$h=vh,Eh=bh,Ah="[object Null]",Oh="[object Undefined]",Ga=Va?Va.toStringTag:void 0;function Sh(r){return r==null?r===void 0?Oh:Ah:Ga&&Ga in Object(r)?$h(r):Eh(r)}var he=Sh;function Ih(r){return r!=null&&typeof r=="object"}var pe=Ih,xh=he,Ph=pe,Th="[object Number]";function Rh(r){return typeof r=="number"||Ph(r)&&xh(r)==Th}var ut=Rh,M={};function Fh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Ge=Fh,Mh=he,Nh=Ge,Bh="[object AsyncFunction]",Dh="[object Function]",Uh="[object GeneratorFunction]",Ch="[object Proxy]";function Lh(r){if(!Nh(r))return!1;var e=Mh(r);return e==Dh||e==Uh||e==Bh||e==Ch}var Bn=Lh,kh=ae,jh=kh["__core-js_shared__"],qh=jh,Dn=qh,Ha=function(){var r=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Vh(r){return!!Ha&&Ha in r}var Gh=Vh,Hh=Function.prototype,Wh=Hh.toString;function Xh(r){if(r!=null){try{return Wh.call(r)}catch{}try{return r+""}catch{}}return""}var Wa=Xh,zh=Bn,Yh=Gh,Kh=Ge,Zh=Wa,Jh=/[\\^$.*+?()[\]{}|]/g,Qh=/^\[object .+?Constructor\]$/,ep=Function.prototype,rp=Object.prototype,tp=ep.toString,np=rp.hasOwnProperty,ip=RegExp("^"+tp.call(np).replace(Jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ap(r){if(!Kh(r)||Yh(r))return!1;var e=zh(r)?ip:Qh;return e.test(Zh(r))}var op=ap;function up(r,e){return r?.[e]}var sp=up,fp=op,cp=sp;function lp(r,e){var t=cp(r,e);return fp(t)?t:void 0}var Ie=lp,hp=Ie,pp=function(){try{var r=hp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Xa=pp,za=Xa;function dp(r,e,t){e=="__proto__"&&za?za(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ya=dp;function yp(r,e){return r===e||r!==r&&e!==e}var st=yp,gp=Ya,vp=st,_p=Object.prototype,mp=_p.hasOwnProperty;function wp(r,e,t){var n=r[e];(!(mp.call(r,e)&&vp(n,t))||t===void 0&&!(e in r))&&gp(r,e,t)}var bp=wp,$p=bp,Ep=Ya;function Ap(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var u=e[a],f=n?n(t[u],r[u],u,t,r):void 0;f===void 0&&(f=r[u]),i?Ep(t,u,f):$p(t,u,f)}return t}var Op=Ap;function Sp(r){return r}var ft=Sp;function Ip(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var xp=Ip,Pp=xp,Ka=Math.max;function Tp(r,e,t){return e=Ka(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ka(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=t(o),Pp(r,this,u)}}var Rp=Tp;function Fp(r){return function(){return r}}var Mp=Fp,Np=Mp,Za=Xa,Bp=ft,Dp=Za?function(r,e){return Za(r,"toString",{configurable:!0,enumerable:!1,value:Np(e),writable:!0})}:Bp,Up=Dp,Cp=800,Lp=16,kp=Date.now;function jp(r){var e=0,t=0;return function(){var n=kp(),i=Lp-(n-t);if(t=n,i>0){if(++e>=Cp)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var qp=jp,Vp=Up,Gp=qp,Hp=Gp(Vp),Wp=Hp,Xp=ft,zp=Rp,Yp=Wp;function Kp(r,e){return Yp(zp(r,e,Xp),r+"")}var Zp=Kp,Jp=9007199254740991;function Qp(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Jp}var Un=Qp,ed=Bn,rd=Un;function td(r){return r!=null&&rd(r.length)&&!ed(r)}var _r=td,nd=9007199254740991,id=/^(?:0|[1-9]\d*)$/;function ad(r,e){var t=typeof r;return e=e??nd,!!e&&(t=="number"||t!="symbol"&&id.test(r))&&r>-1&&r%1==0&&r<e}var Cn=ad,od=st,ud=_r,sd=Cn,fd=Ge;function cd(r,e,t){if(!fd(t))return!1;var n=typeof e;return(n=="number"?ud(t)&&sd(e,t.length):n=="string"&&e in t)?od(t[e],r):!1}var Ja=cd,ld=Zp,hd=Ja;function pd(r){return ld(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&hd(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var u=t[n];u&&r(e,u,n,a)}return e})}var dd=pd;function yd(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Qa=yd,gd=he,vd=pe,_d="[object Arguments]";function md(r){return vd(r)&&gd(r)==_d}var wd=md,eo=wd,bd=pe,ro=Object.prototype,$d=ro.hasOwnProperty,Ed=ro.propertyIsEnumerable,Ad=eo(function(){return arguments}())?eo:function(r){return bd(r)&&$d.call(r,"callee")&&!Ed.call(r,"callee")},to=Ad,Od=Array.isArray,j=Od,ct={exports:{}};function Sd(){return!1}var Id=Sd;ct.exports,function(r,e){var t=ae,n=Id,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,u=o?t.Buffer:void 0,f=u?u.isBuffer:void 0,c=f||n;r.exports=c}(ct,ct.exports);var no=ct.exports,xd=he,Pd=Un,Td=pe,Rd="[object Arguments]",Fd="[object Array]",Md="[object Boolean]",Nd="[object Date]",Bd="[object Error]",Dd="[object Function]",Ud="[object Map]",Cd="[object Number]",Ld="[object Object]",kd="[object RegExp]",jd="[object Set]",qd="[object String]",Vd="[object WeakMap]",Gd="[object ArrayBuffer]",Hd="[object DataView]",Wd="[object Float32Array]",Xd="[object Float64Array]",zd="[object Int8Array]",Yd="[object Int16Array]",Kd="[object Int32Array]",Zd="[object Uint8Array]",Jd="[object Uint8ClampedArray]",Qd="[object Uint16Array]",ey="[object Uint32Array]",T={};T[Wd]=T[Xd]=T[zd]=T[Yd]=T[Kd]=T[Zd]=T[Jd]=T[Qd]=T[ey]=!0,T[Rd]=T[Fd]=T[Gd]=T[Md]=T[Hd]=T[Nd]=T[Bd]=T[Dd]=T[Ud]=T[Cd]=T[Ld]=T[kd]=T[jd]=T[qd]=T[Vd]=!1;function ry(r){return Td(r)&&Pd(r.length)&&!!T[xd(r)]}var ty=ry;function ny(r){return function(e){return r(e)}}var iy=ny,lt={exports:{}};lt.exports,function(r,e){var t=ka,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,u=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=u}(lt,lt.exports);var ay=lt.exports,oy=ty,uy=iy,io=ay,ao=io&&io.isTypedArray,sy=ao?uy(ao):oy,oo=sy,fy=Qa,cy=to,ly=j,hy=no,py=Cn,dy=oo,yy=Object.prototype,gy=yy.hasOwnProperty;function vy(r,e){var t=ly(r),n=!t&&cy(r),i=!t&&!n&&hy(r),a=!t&&!n&&!i&&dy(r),o=t||n||i||a,u=o?fy(r.length,String):[],f=u.length;for(var c in r)(e||gy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||py(c,f)))&&u.push(c);return u}var uo=vy,_y=Object.prototype;function my(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||_y;return r===t}var so=my;function wy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var by=wy,$y=Ge,Ey=so,Ay=by,Oy=Object.prototype,Sy=Oy.hasOwnProperty;function Iy(r){if(!$y(r))return Ay(r);var e=Ey(r),t=[];for(var n in r)n=="constructor"&&(e||!Sy.call(r,n))||t.push(n);return t}var xy=Iy,Py=uo,Ty=xy,Ry=_r;function Fy(r){return Ry(r)?Py(r,!0):Ty(r)}var My=Fy,Ny=Op,By=dd,Dy=My,Uy=By(function(r,e){Ny(e,Dy(e),r)}),Cy=Uy,Ly=Cy,ht={},xe={};function ky(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var jy=ky;function qy(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),u=o.length;u--;){var f=o[r?u:++i];if(t(a[f],f,a)===!1)break}return e}}var Vy=qy,Gy=Vy,Hy=Gy(),Wy=Hy;function Xy(r,e){return function(t){return r(e(t))}}var zy=Xy,Yy=zy,Ky=Yy(Object.keys,Object),Zy=Ky,Jy=so,Qy=Zy,eg=Object.prototype,rg=eg.hasOwnProperty;function tg(r){if(!Jy(r))return Qy(r);var e=[];for(var t in Object(r))rg.call(r,t)&&t!="constructor"&&e.push(t);return e}var ng=tg,ig=uo,ag=ng,og=_r;function ug(r){return og(r)?ig(r):ag(r)}var pt=ug,sg=Wy,fg=pt;function cg(r,e){return r&&sg(r,e,fg)}var lg=cg,hg=_r;function pg(r,e){return function(t,n){if(t==null)return t;if(!hg(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var dg=pg,yg=lg,gg=dg,vg=gg(yg),Ln=vg,_g=Ln;function mg(r,e){var t=!0;return _g(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var wg=mg;function bg(){this.__data__=[],this.size=0}var $g=bg,Eg=st;function Ag(r,e){for(var t=r.length;t--;)if(Eg(r[t][0],e))return t;return-1}var dt=Ag,Og=dt,Sg=Array.prototype,Ig=Sg.splice;function xg(r){var e=this.__data__,t=Og(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Ig.call(e,t,1),--this.size,!0}var Pg=xg,Tg=dt;function Rg(r){var e=this.__data__,t=Tg(e,r);return t<0?void 0:e[t][1]}var Fg=Rg,Mg=dt;function Ng(r){return Mg(this.__data__,r)>-1}var Bg=Ng,Dg=dt;function Ug(r,e){var t=this.__data__,n=Dg(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Cg=Ug,Lg=$g,kg=Pg,jg=Fg,qg=Bg,Vg=Cg;function He(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}He.prototype.clear=Lg,He.prototype.delete=kg,He.prototype.get=jg,He.prototype.has=qg,He.prototype.set=Vg;var yt=He,Gg=yt;function Hg(){this.__data__=new Gg,this.size=0}var Wg=Hg;function Xg(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var zg=Xg;function Yg(r){return this.__data__.get(r)}var Kg=Yg;function Zg(r){return this.__data__.has(r)}var Jg=Zg,Qg=Ie,ev=ae,rv=Qg(ev,"Map"),kn=rv,tv=Ie,nv=tv(Object,"create"),gt=nv,fo=gt;function iv(){this.__data__=fo?fo(null):{},this.size=0}var av=iv;function ov(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var uv=ov,sv=gt,fv="__lodash_hash_undefined__",cv=Object.prototype,lv=cv.hasOwnProperty;function hv(r){var e=this.__data__;if(sv){var t=e[r];return t===fv?void 0:t}return lv.call(e,r)?e[r]:void 0}var pv=hv,dv=gt,yv=Object.prototype,gv=yv.hasOwnProperty;function vv(r){var e=this.__data__;return dv?e[r]!==void 0:gv.call(e,r)}var _v=vv,mv=gt,wv="__lodash_hash_undefined__";function bv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=mv&&e===void 0?wv:e,this}var $v=bv,Ev=av,Av=uv,Ov=pv,Sv=_v,Iv=$v;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=Ev,We.prototype.delete=Av,We.prototype.get=Ov,We.prototype.has=Sv,We.prototype.set=Iv;var xv=We,co=xv,Pv=yt,Tv=kn;function Rv(){this.size=0,this.__data__={hash:new co,map:new(Tv||Pv),string:new co}}var Fv=Rv;function Mv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Nv=Mv,Bv=Nv;function Dv(r,e){var t=r.__data__;return Bv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var vt=Dv,Uv=vt;function Cv(r){var e=Uv(this,r).delete(r);return this.size-=e?1:0,e}var Lv=Cv,kv=vt;function jv(r){return kv(this,r).get(r)}var qv=jv,Vv=vt;function Gv(r){return Vv(this,r).has(r)}var Hv=Gv,Wv=vt;function Xv(r,e){var t=Wv(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var zv=Xv,Yv=Fv,Kv=Lv,Zv=qv,Jv=Hv,Qv=zv;function Xe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Xe.prototype.clear=Yv,Xe.prototype.delete=Kv,Xe.prototype.get=Zv,Xe.prototype.has=Jv,Xe.prototype.set=Qv;var jn=Xe,e_=yt,r_=kn,t_=jn,n_=200;function i_(r,e){var t=this.__data__;if(t instanceof e_){var n=t.__data__;if(!r_||n.length<n_-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new t_(n)}return t.set(r,e),this.size=t.size,this}var a_=i_,o_=yt,u_=Wg,s_=zg,f_=Kg,c_=Jg,l_=a_;function ze(r){var e=this.__data__=new o_(r);this.size=e.size}ze.prototype.clear=u_,ze.prototype.delete=s_,ze.prototype.get=f_,ze.prototype.has=c_,ze.prototype.set=l_;var lo=ze,h_="__lodash_hash_undefined__";function p_(r){return this.__data__.set(r,h_),this}var d_=p_;function y_(r){return this.__data__.has(r)}var g_=y_,v_=jn,__=d_,m_=g_;function _t(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new v_;++e<t;)this.add(r[e])}_t.prototype.add=_t.prototype.push=__,_t.prototype.has=m_;var w_=_t;function b_(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var $_=b_;function E_(r,e){return r.has(e)}var A_=E_,O_=w_,S_=$_,I_=A_,x_=1,P_=2;function T_(r,e,t,n,i,a){var o=t&x_,u=r.length,f=e.length;if(u!=f&&!(o&&f>u))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var s=-1,h=!0,y=t&P_?new O_:void 0;for(a.set(r,e),a.set(e,r);++s<u;){var m=r[s],E=e[s];if(n)var O=o?n(E,m,s,e,r,a):n(m,E,s,r,e,a);if(O!==void 0){if(O)continue;h=!1;break}if(y){if(!S_(e,function(w,$){if(!I_(y,$)&&(m===w||i(m,w,t,n,a)))return y.push($)})){h=!1;break}}else if(!(m===E||i(m,E,t,n,a))){h=!1;break}}return a.delete(r),a.delete(e),h}var ho=T_,R_=ae,F_=R_.Uint8Array,M_=F_;function N_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var B_=N_;function D_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var U_=D_,po=ot,yo=M_,C_=st,L_=ho,k_=B_,j_=U_,q_=1,V_=2,G_="[object Boolean]",H_="[object Date]",W_="[object Error]",X_="[object Map]",z_="[object Number]",Y_="[object RegExp]",K_="[object Set]",Z_="[object String]",J_="[object Symbol]",Q_="[object ArrayBuffer]",em="[object DataView]",go=po?po.prototype:void 0,qn=go?go.valueOf:void 0;function rm(r,e,t,n,i,a,o){switch(t){case em:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Q_:return!(r.byteLength!=e.byteLength||!a(new yo(r),new yo(e)));case G_:case H_:case z_:return C_(+r,+e);case W_:return r.name==e.name&&r.message==e.message;case Y_:case Z_:return r==e+"";case X_:var u=k_;case K_:var f=n&q_;if(u||(u=j_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=V_,o.set(r,e);var l=L_(u(r),u(e),n,i,a,o);return o.delete(r),l;case J_:if(qn)return qn.call(r)==qn.call(e)}return!1}var tm=rm;function nm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var im=nm,am=im,om=j;function um(r,e,t){var n=e(r);return om(r)?n:am(n,t(r))}var sm=um;function fm(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var cm=fm;function lm(){return[]}var hm=lm,pm=cm,dm=hm,ym=Object.prototype,gm=ym.propertyIsEnumerable,vo=Object.getOwnPropertySymbols,vm=vo?function(r){return r==null?[]:(r=Object(r),pm(vo(r),function(e){return gm.call(r,e)}))}:dm,_m=vm,mm=sm,wm=_m,bm=pt;function $m(r){return mm(r,bm,wm)}var Em=$m,_o=Em,Am=1,Om=Object.prototype,Sm=Om.hasOwnProperty;function Im(r,e,t,n,i,a){var o=t&Am,u=_o(r),f=u.length,c=_o(e),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var h=u[s];if(!(o?h in e:Sm.call(e,h)))return!1}var y=a.get(r),m=a.get(e);if(y&&m)return y==e&&m==r;var E=!0;a.set(r,e),a.set(e,r);for(var O=o;++s<f;){h=u[s];var w=r[h],$=e[h];if(n)var p=o?n($,w,h,e,r,a):n(w,$,h,r,e,a);if(!(p===void 0?w===$||i(w,$,t,n,a):p)){E=!1;break}O||(O=h=="constructor")}if(E&&!O){var S=r.constructor,P=e.constructor;S!=P&&"constructor"in r&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof P=="function"&&P instanceof P)&&(E=!1)}return a.delete(r),a.delete(e),E}var xm=Im,Pm=Ie,Tm=ae,Rm=Pm(Tm,"DataView"),Fm=Rm,Mm=Ie,Nm=ae,Bm=Mm(Nm,"Promise"),Dm=Bm,Um=Ie,Cm=ae,Lm=Um(Cm,"Set"),km=Lm,jm=Ie,qm=ae,Vm=jm(qm,"WeakMap"),Gm=Vm,Vn=Fm,Gn=kn,Hn=Dm,Wn=km,Xn=Gm,mo=he,Ye=Wa,wo="[object Map]",Hm="[object Object]",bo="[object Promise]",$o="[object Set]",Eo="[object WeakMap]",Ao="[object DataView]",Wm=Ye(Vn),Xm=Ye(Gn),zm=Ye(Hn),Ym=Ye(Wn),Km=Ye(Xn),Pe=mo;(Vn&&Pe(new Vn(new ArrayBuffer(1)))!=Ao||Gn&&Pe(new Gn)!=wo||Hn&&Pe(Hn.resolve())!=bo||Wn&&Pe(new Wn)!=$o||Xn&&Pe(new Xn)!=Eo)&&(Pe=function(r){var e=mo(r),t=e==Hm?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case Wm:return Ao;case Xm:return wo;case zm:return bo;case Ym:return $o;case Km:return Eo}return e});var Zm=Pe,zn=lo,Jm=ho,Qm=tm,ew=xm,Oo=Zm,So=j,Io=no,rw=oo,tw=1,xo="[object Arguments]",Po="[object Array]",mt="[object Object]",nw=Object.prototype,To=nw.hasOwnProperty;function iw(r,e,t,n,i,a){var o=So(r),u=So(e),f=o?Po:Oo(r),c=u?Po:Oo(e);f=f==xo?mt:f,c=c==xo?mt:c;var l=f==mt,s=c==mt,h=f==c;if(h&&Io(r)){if(!Io(e))return!1;o=!0,l=!1}if(h&&!l)return a||(a=new zn),o||rw(r)?Jm(r,e,t,n,i,a):Qm(r,e,f,t,n,i,a);if(!(t&tw)){var y=l&&To.call(r,"__wrapped__"),m=s&&To.call(e,"__wrapped__");if(y||m){var E=y?r.value():r,O=m?e.value():e;return a||(a=new zn),i(E,O,t,n,a)}}return h?(a||(a=new zn),ew(r,e,t,n,i,a)):!1}var aw=iw,ow=aw,Ro=pe;function Fo(r,e,t,n,i){return r===e?!0:r==null||e==null||!Ro(r)&&!Ro(e)?r!==r&&e!==e:ow(r,e,t,n,Fo,i)}var Mo=Fo,uw=lo,sw=Mo,fw=1,cw=2;function lw(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var u=t[i];if(o&&u[2]?u[1]!==r[u[0]]:!(u[0]in r))return!1}for(;++i<a;){u=t[i];var f=u[0],c=r[f],l=u[1];if(o&&u[2]){if(c===void 0&&!(f in r))return!1}else{var s=new uw;if(n)var h=n(c,l,f,r,e,s);if(!(h===void 0?sw(l,c,fw|cw,n,s):h))return!1}}return!0}var hw=lw,pw=Ge;function dw(r){return r===r&&!pw(r)}var No=dw,yw=No,gw=pt;function vw(r){for(var e=gw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,yw(i)]}return e}var _w=vw;function mw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Bo=mw,ww=hw,bw=_w,$w=Bo;function Ew(r){var e=bw(r);return e.length==1&&e[0][2]?$w(e[0][0],e[0][1]):function(t){return t===r||ww(t,r,e)}}var Aw=Ew,Ow=he,Sw=pe,Iw="[object Symbol]";function xw(r){return typeof r=="symbol"||Sw(r)&&Ow(r)==Iw}var wt=xw,Pw=j,Tw=wt,Rw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fw=/^\w*$/;function Mw(r,e){if(Pw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Tw(r)?!0:Fw.test(r)||!Rw.test(r)||e!=null&&r in Object(e)}var Yn=Mw,Do=jn,Nw="Expected a function";function Kn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Nw);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(Kn.Cache||Do),t}Kn.Cache=Do;var Bw=Kn,Dw=Bw,Uw=500;function Cw(r){var e=Dw(r,function(n){return t.size===Uw&&t.clear(),n}),t=e.cache;return e}var Lw=Cw,kw=Lw,jw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qw=/\\(\\)?/g,Vw=kw(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(jw,function(t,n,i,a){e.push(i?a.replace(qw,"$1"):n||t)}),e}),Gw=Vw;function Hw(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var Zn=Hw,Uo=ot,Ww=Zn,Xw=j,zw=wt,Yw=1/0,Co=Uo?Uo.prototype:void 0,Lo=Co?Co.toString:void 0;function ko(r){if(typeof r=="string")return r;if(Xw(r))return Ww(r,ko)+"";if(zw(r))return Lo?Lo.call(r):"";var e=r+"";return e=="0"&&1/r==-Yw?"-0":e}var Kw=ko,Zw=Kw;function Jw(r){return r==null?"":Zw(r)}var Qw=Jw,e0=j,r0=Yn,t0=Gw,n0=Qw;function i0(r,e){return e0(r)?r:r0(r,e)?[r]:t0(n0(r))}var jo=i0,a0=wt,o0=1/0;function u0(r){if(typeof r=="string"||a0(r))return r;var e=r+"";return e=="0"&&1/r==-o0?"-0":e}var bt=u0,s0=jo,f0=bt;function c0(r,e){e=s0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[f0(e[t++])];return t&&t==n?r:void 0}var qo=c0,l0=qo;function h0(r,e,t){var n=r==null?void 0:l0(r,e);return n===void 0?t:n}var p0=h0;function d0(r,e){return r!=null&&e in Object(r)}var y0=d0,g0=jo,v0=to,_0=j,m0=Cn,w0=Un,b0=bt;function $0(r,e,t){e=g0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=b0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&w0(i)&&m0(o,i)&&(_0(r)||v0(r)))}var E0=$0,A0=y0,O0=E0;function S0(r,e){return r!=null&&O0(r,e,A0)}var I0=S0,x0=Mo,P0=p0,T0=I0,R0=Yn,F0=No,M0=Bo,N0=bt,B0=1,D0=2;function U0(r,e){return R0(r)&&F0(e)?M0(N0(r),e):function(t){var n=P0(t,r);return n===void 0&&n===e?T0(t,r):x0(e,n,B0|D0)}}var C0=U0;function L0(r){return function(e){return e?.[r]}}var k0=L0,j0=qo;function q0(r){return function(e){return j0(e,r)}}var V0=q0,G0=k0,H0=V0,W0=Yn,X0=bt;function z0(r){return W0(r)?G0(X0(r)):H0(r)}var Y0=z0,K0=Aw,Z0=C0,J0=ft,Q0=j,eb=Y0;function rb(r){return typeof r=="function"?r:r==null?J0:typeof r=="object"?Q0(r)?Z0(r[0],r[1]):K0(r):eb(r)}var Vo=rb,tb=jy,nb=wg,ib=Vo,ab=j,ob=Ja;function ub(r,e,t){var n=ab(r)?tb:nb;return t&&ob(r,e,t)&&(e=void 0),n(r,ib(e))}var Jn=ub;Object.defineProperty(xe,"__esModule",{value:!0}),xe.calculatePadding=lb,xe.slicePadding=hb;var sb=Jn,fb=cb(sb);function cb(r){return r&&r.__esModule?r:{default:r}}function lb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function hb(r,e){var t=r.slice(e),n=(0,fb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(ht,"__esModule",{value:!0}),ht.Cursor=void 0;var pb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),db=xe;function yb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Qn=function(){function r(e){yb(this,r),e instanceof d||(e=typeof e=="number"?d.alloc(e):d.from(e)),this._setBuffer(e),this.rewind()}return pb(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof d?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=d.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,db.calculatePadding)(t.length),i=d.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Qn.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Qn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),ht.Cursor=Qn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=$b;var gb=Ly,Go=Wo(gb),vb=Bn,_b=Wo(vb),Ho=ht;function Wo(r){return r&&r.__esModule?r:{default:r}}var mb=Math.pow(2,16),wb={toXDR:function(e){var t=new Ho.Cursor(mb);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=d.from(e,"hex");break;case"base64":n=d.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Ho.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},bb={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function $b(r){(0,Go.default)(r,wb),(0,_b.default)(r)&&(0,Go.default)(r.prototype,bb)}Object.defineProperty(ie,"__esModule",{value:!0}),ie.Int=void 0;var Eb=ut,Xo=zo(Eb),Ab=M,Ob=zo(Ab);function zo(r){return r&&r.__esModule?r:{default:r}}var mr=ie.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Xo.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Xo.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,31)-1,mr.MIN_VALUE=-Math.pow(2,31),(0,Ob.default)(mr);var $t={};function Sb(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yo={exports:{}};(function(r){/**
|
|
21
|
+
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
22
|
+
* Released under the Apache License, Version 2.0
|
|
23
|
+
* see: https://github.com/dcodeIO/Long.js for details
|
|
24
|
+
*/(function(e,t){typeof Sb=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,s,h){this.low=l|0,this.high=s|0,this.unsigned=!!h}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(s){return(s&&s.__isLong__)===!0};var t={},n={};e.fromInt=function(s,h){var y,m;return h?(s=s>>>0,0<=s&&s<256&&(m=n[s],m)?m:(y=new e(s,(s|0)<0?-1:0,!0),0<=s&&s<256&&(n[s]=y),y)):(s=s|0,-128<=s&&s<128&&(m=t[s],m)?m:(y=new e(s,s<0?-1:0,!1),-128<=s&&s<128&&(t[s]=y),y))},e.fromNumber=function(s,h){return h=!!h,isNaN(s)||!isFinite(s)?e.ZERO:!h&&s<=-f?e.MIN_VALUE:!h&&s+1>=f?e.MAX_VALUE:h&&s>=u?e.MAX_UNSIGNED_VALUE:s<0?e.fromNumber(-s,h).negate():new e(s%o|0,s/o|0,h)},e.fromBits=function(s,h,y){return new e(s,h,y)},e.fromString=function(s,h,y){if(s.length===0)throw Error("number format error: empty string");if(s==="NaN"||s==="Infinity"||s==="+Infinity"||s==="-Infinity")return e.ZERO;if(typeof h=="number"&&(y=h,h=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var m;if((m=s.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+s);if(m===0)return e.fromString(s.substring(1),h,y).negate();for(var E=e.fromNumber(Math.pow(y,8)),O=e.ZERO,w=0;w<s.length;w+=8){var $=Math.min(8,s.length-w),p=parseInt(s.substring(w,w+$),y);if($<8){var S=e.fromNumber(Math.pow(y,$));O=O.multiply(S).add(e.fromNumber(p))}else O=O.multiply(E),O=O.add(e.fromNumber(p))}return O.unsigned=h,O},e.fromValue=function(s){return s instanceof e?s:typeof s=="number"?e.fromNumber(s):typeof s=="string"?e.fromString(s):new e(s.low,s.high,s.unsigned)};var i=65536,a=1<<24,o=i*i,u=o*o,f=u/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(s){if(s=s||10,s<2||36<s)throw RangeError("radix out of range: "+s);if(this.isZero())return"0";var h;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(s),m=this.divide(y);return h=m.multiply(y).subtract(this),m.toString(s)+h.toInt().toString(s)}else return"-"+this.negate().toString(s);var E=e.fromNumber(Math.pow(s,6),this.unsigned);h=this;for(var O="";;){var w=h.divide(E),$=h.subtract(w.multiply(E)).toInt()>>>0,p=$.toString(s);if(h=w,h.isZero())return p+O;for(;p.length<6;)p="0"+p;O=""+p+O}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var s=this.high!=0?this.high:this.low,h=31;h>0&&!(s&1<<h);h--);return this.high!=0?h+33:h+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.unsigned!==s.unsigned&&this.high>>>31===1&&s.high>>>31===1?!1:this.high===s.high&&this.low===s.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(s){return!this.equals(s)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(s){return this.compare(s)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(s){return this.compare(s)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(s){return this.compare(s)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(s){return this.compare(s)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(s){if(e.isLong(s)||(s=e.fromValue(s)),this.equals(s))return 0;var h=this.isNegative(),y=s.isNegative();return h&&!y?-1:!h&&y?1:this.unsigned?s.high>>>0>this.high>>>0||s.high===this.high&&s.low>>>0>this.low>>>0?-1:1:this.subtract(s).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(s){e.isLong(s)||(s=e.fromValue(s));var h=this.high>>>16,y=this.high&65535,m=this.low>>>16,E=this.low&65535,O=s.high>>>16,w=s.high&65535,$=s.low>>>16,p=s.low&65535,S=0,P=0,R=0,_=0;return _+=E+p,R+=_>>>16,_&=65535,R+=m+$,P+=R>>>16,R&=65535,P+=y+w,S+=P>>>16,P&=65535,S+=h+O,S&=65535,e.fromBits(R<<16|_,S<<16|P,this.unsigned)},e.prototype.subtract=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.add(s.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(s){if(this.isZero()||(e.isLong(s)||(s=e.fromValue(s)),s.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return s.isOdd()?e.MIN_VALUE:e.ZERO;if(s.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().multiply(s.negate()):this.negate().multiply(s).negate();if(s.isNegative())return this.multiply(s.negate()).negate();if(this.lessThan(c)&&s.lessThan(c))return e.fromNumber(this.toNumber()*s.toNumber(),this.unsigned);var h=this.high>>>16,y=this.high&65535,m=this.low>>>16,E=this.low&65535,O=s.high>>>16,w=s.high&65535,$=s.low>>>16,p=s.low&65535,S=0,P=0,R=0,_=0;return _+=E*p,R+=_>>>16,_&=65535,R+=m*p,P+=R>>>16,R&=65535,R+=E*$,P+=R>>>16,R&=65535,P+=y*p,S+=P>>>16,P&=65535,P+=m*$,S+=P>>>16,P&=65535,P+=E*w,S+=P>>>16,P&=65535,S+=h*p+y*$+m*w+E*O,S&=65535,e.fromBits(R<<16|_,S<<16|P,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(s){if(e.isLong(s)||(s=e.fromValue(s)),s.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var h,y,m;if(this.equals(e.MIN_VALUE)){if(s.equals(e.ONE)||s.equals(e.NEG_ONE))return e.MIN_VALUE;if(s.equals(e.MIN_VALUE))return e.ONE;var E=this.shiftRight(1);return h=E.divide(s).shiftLeft(1),h.equals(e.ZERO)?s.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(s.multiply(h)),m=h.add(y.divide(s)),m)}else if(s.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().divide(s.negate()):this.negate().divide(s).negate();if(s.isNegative())return this.divide(s.negate()).negate();for(m=e.ZERO,y=this;y.greaterThanOrEqual(s);){h=Math.max(1,Math.floor(y.toNumber()/s.toNumber()));for(var O=Math.ceil(Math.log(h)/Math.LN2),w=O<=48?1:Math.pow(2,O-48),$=e.fromNumber(h),p=$.multiply(s);p.isNegative()||p.greaterThan(y);)h-=w,$=e.fromNumber(h,this.unsigned),p=$.multiply(s);$.isZero()&&($=e.ONE),m=m.add($),y=y.subtract(p)}return m},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.subtract(this.divide(s).multiply(s))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low&s.low,this.high&s.high,this.unsigned)},e.prototype.or=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low|s.low,this.high|s.high,this.unsigned)},e.prototype.xor=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low^s.low,this.high^s.high,this.unsigned)},e.prototype.shiftLeft=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low<<s,this.high<<s|this.low>>>32-s,this.unsigned):e.fromBits(0,this.low<<s-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low>>>s|this.high<<32-s,this.high>>s,this.unsigned):e.fromBits(this.high>>s-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(s){if(e.isLong(s)&&(s=s.toInt()),s&=63,s===0)return this;var h=this.high;if(s<32){var y=this.low;return e.fromBits(y>>>s|h<<32-s,h>>>s,this.unsigned)}else return s===32?e.fromBits(h,0,this.unsigned):e.fromBits(h>>>s-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(Yo);var Ko=Yo.exports;Object.defineProperty($t,"__esModule",{value:!0}),$t.Hyper=void 0;var Ib=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Zo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},xb=Ko,wr=Jo(xb),Pb=M,Tb=Jo(Pb);function Jo(r){return r&&r.__esModule?r:{default:r}}function Rb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Fb(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Mb(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var br=$t.Hyper=function(r){Mb(e,r),Ib(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Zo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Zo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return Rb(this,e),Fb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(wr.default);(0,Tb.default)(br),br.MAX_VALUE=new br(wr.default.MAX_VALUE.low,wr.default.MAX_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var Nb=ut,Qo=eu(Nb),Bb=M,Db=eu(Bb);function eu(r){return r&&r.__esModule?r:{default:r}}var $r=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Qo.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,Qo.default)(e)||Math.floor(e)!==e?!1:e>=$r.MIN_VALUE&&e<=$r.MAX_VALUE}};$r.MAX_VALUE=Math.pow(2,32)-1,$r.MIN_VALUE=0,(0,Db.default)($r);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.UnsignedHyper=void 0;var Ub=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),ru=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},Cb=Ko,Er=tu(Cb),Lb=M,kb=tu(Lb);function tu(r){return r&&r.__esModule?r:{default:r}}function jb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function qb(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Vb(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Ar=Et.UnsignedHyper=function(r){Vb(e,r),Ub(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=ru(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=ru(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return jb(this,e),qb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Er.default);(0,kb.default)(Ar),Ar.MAX_VALUE=new Ar(Er.default.MAX_UNSIGNED_VALUE.low,Er.default.MAX_UNSIGNED_VALUE.high),Ar.MIN_VALUE=new Ar(Er.default.MIN_VALUE.low,Er.default.MIN_VALUE.high);var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.Float=void 0;var Gb=ut,nu=iu(Gb),Hb=M,Wb=iu(Hb);function iu(r){return r&&r.__esModule?r:{default:r}}var Xb=At.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,nu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,nu.default)(e)}};(0,Wb.default)(Xb);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Double=void 0;var zb=ut,au=ou(zb),Yb=M,Kb=ou(Yb);function ou(r){return r&&r.__esModule?r:{default:r}}var Zb=Ot.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,au.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,au.default)(e)}};(0,Kb.default)(Zb);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Quadruple=void 0;var Jb=M,Qb=e1(Jb);function e1(r){return r&&r.__esModule?r:{default:r}}var r1=St.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,Qb.default)(r1);var Or={},t1=he,n1=pe,i1="[object Boolean]";function a1(r){return r===!0||r===!1||n1(r)&&t1(r)==i1}var o1=a1;Object.defineProperty(Or,"__esModule",{value:!0}),Or.Bool=void 0;var u1=o1,s1=su(u1),uu=ie,f1=M,c1=su(f1);function su(r){return r&&r.__esModule?r:{default:r}}var l1=Or.Bool={read:function(e){var t=uu.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return uu.Int.write(n,t)},isValid:function(e){return(0,s1.default)(e)}};(0,c1.default)(l1);var It={},h1=he,p1=j,d1=pe,y1="[object String]";function g1(r){return typeof r=="string"||!p1(r)&&d1(r)&&h1(r)==y1}var fu=g1;Object.defineProperty(It,"__esModule",{value:!0}),It.String=void 0;var v1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),_1=fu,cu=ei(_1),m1=j,w1=ei(m1),lu=ie,b1=Te,hu=xe,$1=M,E1=ei($1);function ei(r){return r&&r.__esModule?r:{default:r}}function A1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var O1=It.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b1.UnsignedInt.MAX_VALUE;A1(this,r),this._maxLength=e}return v1(r,[{key:"read",value:function(t){var n=lu.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,hu.calculatePadding)(n),a=t.slice(n);return(0,hu.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,cu.default)(t)?i=d.from(t,"utf8"):i=d.from(t),lu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,cu.default)(t))n=d.from(t,"utf8");else if((0,w1.default)(t)||d.isBuffer(t))n=d.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,E1.default)(O1.prototype);var xt={};Object.defineProperty(xt,"__esModule",{value:!0}),xt.Opaque=void 0;var S1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),pu=xe,I1=M,x1=P1(I1);function P1(r){return r&&r.__esModule?r:{default:r}}function T1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var R1=xt.Opaque=function(){function r(e){T1(this,r),this._length=e,this._padding=(0,pu.calculatePadding)(e)}return S1(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,pu.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length===this._length}}]),r}();(0,x1.default)(R1.prototype);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.VarOpaque=void 0;var F1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),du=ie,M1=Te,yu=xe,N1=M,B1=D1(N1);function D1(r){return r&&r.__esModule?r:{default:r}}function U1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var C1=Pt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M1.UnsignedInt.MAX_VALUE;U1(this,r),this._maxLength=e}return F1(r,[{key:"read",value:function(t){var n=du.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,yu.calculatePadding)(n),a=t.slice(n);return(0,yu.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));du.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,B1.default)(C1.prototype);var Tt={};function L1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var k1=L1,j1=ft;function q1(r){return typeof r=="function"?r:j1}var gu=q1,V1=k1,G1=Ln,H1=gu,W1=j;function X1(r,e){var t=W1(r)?V1:G1;return t(r,H1(e))}var z1=X1,Ke=z1,Y1=/\s/;function K1(r){for(var e=r.length;e--&&Y1.test(r.charAt(e)););return e}var Z1=K1,J1=Z1,Q1=/^\s+/;function e$(r){return r&&r.slice(0,J1(r)+1).replace(Q1,"")}var r$=e$,t$=r$,vu=Ge,n$=wt,_u=0/0,i$=/^[-+]0x[0-9a-f]+$/i,a$=/^0b[01]+$/i,o$=/^0o[0-7]+$/i,u$=parseInt;function s$(r){if(typeof r=="number")return r;if(n$(r))return _u;if(vu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=vu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=t$(r);var t=a$.test(r);return t||o$.test(r)?u$(r.slice(2),t?2:8):i$.test(r)?_u:+r}var f$=s$,c$=f$,mu=1/0,l$=17976931348623157e292;function h$(r){if(!r)return r===0?r:0;if(r=c$(r),r===mu||r===-mu){var e=r<0?-1:1;return e*l$}return r===r?r:0}var p$=h$,d$=p$;function y$(r){var e=d$(r),t=e%1;return e===e?t?e-t:e:0}var g$=y$,v$=Qa,_$=gu,m$=g$,w$=9007199254740991,ri=4294967295,b$=Math.min;function $$(r,e){if(r=m$(r),r<1||r>w$)return[];var t=ri,n=b$(r,ri);e=_$(e),r-=ri;for(var i=v$(n,e);++t<r;)e(t);return i}var wu=$$;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Array=void 0;var E$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),A$=Jn,O$=Sr(A$),S$=Ke,I$=Sr(S$),x$=wu,P$=Sr(x$),T$=j,bu=Sr(T$),R$=M,F$=Sr(R$);function Sr(r){return r&&r.__esModule?r:{default:r}}function M$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var N$=Tt.Array=function(){function r(e,t){M$(this,r),this._childType=e,this._length=t}return E$(r,[{key:"read",value:function(t){var n=this;return(0,P$.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,bu.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,I$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,bu.default)(t)||t.length!==this._length?!1:(0,O$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,F$.default)(N$.prototype);var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.VarArray=void 0;var B$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),D$=Jn,U$=Ir(D$),C$=Ke,L$=Ir(C$),k$=wu,j$=Ir(k$),q$=j,$u=Ir(q$),V$=Te,Eu=ie,G$=M,H$=Ir(G$);function Ir(r){return r&&r.__esModule?r:{default:r}}function W$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var X$=Rt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V$.UnsignedInt.MAX_VALUE;W$(this,r),this._childType=e,this._maxLength=t}return B$(r,[{key:"read",value:function(t){var n=this,i=Eu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,j$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,$u.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));Eu.Int.write(t.length,n),(0,L$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,$u.default)(t)||t.length>this._maxLength?!1:(0,U$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,H$.default)(X$.prototype);var Ft={};function z$(r){return r===null}var Y$=z$;function K$(r){return r===void 0}var xr=K$;Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Option=void 0;var Z$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),J$=Y$,Au=ti(J$),Q$=xr,Ou=ti(Q$),Su=Or,eE=M,rE=ti(eE);function ti(r){return r&&r.__esModule?r:{default:r}}function tE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var nE=Ft.Option=function(){function r(e){tE(this,r),this._childType=e}return Z$(r,[{key:"read",value:function(t){if(Su.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Au.default)(t)||(0,Ou.default)(t));Su.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Au.default)(t)||(0,Ou.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,rE.default)(nE.prototype);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.Void=void 0;var iE=xr,Iu=xu(iE),aE=M,oE=xu(aE);function xu(r){return r&&r.__esModule?r:{default:r}}var uE=Pr.Void={read:function(){},write:function(e){if(!(0,Iu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Iu.default)(e)}};(0,oE.default)(uE);var Mt={},sE=Zn;function fE(r,e){return sE(e,function(t){return r[t]})}var cE=fE,lE=cE,hE=pt;function pE(r){return r==null?[]:lE(r,hE(r))}var dE=pE;Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Enum=void 0;var yE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),gE=Ke,vE=ni(gE),_E=dE,mE=ni(_E),Pu=ie,wE=M,bE=ni(wE);function ni(r){return r&&r.__esModule?r:{default:r}}function $E(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function EE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Tu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=Mt.Enum=function(){function r(e,t){Tu(this,r),this.name=e,this.value=t}return yE(r,null,[{key:"read",value:function(t){var n=Pu.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);Pu.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,mE.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){EE(u,o);function u(){return Tu(this,u),$E(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,vE.default)(i,function(o,u){var f=new a(u,o);a._members[u]=f,a._byValue.set(o,f),a[u]=function(){return f}}),a}}]),r}();(0,bE.default)(AE);var Nt={},OE=Ln,SE=_r;function IE(r,e){var t=-1,n=SE(r)?Array(r.length):[];return OE(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var xE=IE,PE=Zn,TE=Vo,RE=xE,FE=j;function ME(r,e){var t=FE(r)?PE:RE;return t(r,TE(e))}var NE=ME;function BE(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var DE=BE,Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});var UE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function CE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Tr.Reference=function(){function r(){CE(this,r)}return UE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Struct=void 0;var Bt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),LE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),kE=Ke,Ru=Rr(kE),jE=NE,qE=Rr(jE),VE=xr,GE=Rr(VE),HE=DE,WE=Rr(HE),XE=Tr,zE=M,YE=Rr(zE);function Rr(r){return r&&r.__esModule?r:{default:r}}function KE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function ZE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Fu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var JE=Nt.Struct=function(){function r(e){Fu(this,r),this._attributes=e||{}}return LE(r,null,[{key:"read",value:function(t){var n=(0,qE.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=u.read(t);return[o,f]});return new this((0,WE.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,Ru.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=t._attributes[o];u.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){ZE(u,o);function u(){return Fu(this,u),KE(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var u=Bt(o,2),f=u[0],c=u[1];return c instanceof XE.Reference&&(c=c.resolve(t)),[f,c]}),(0,Ru.default)(a._fields,function(o){var u=Bt(o,1),f=u[0];a.prototype[f]=QE(f)}),a}}]),r}();(0,YE.default)(JE);function QE(r){return function(t){return(0,GE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Union=void 0;var eA=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),rA=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),tA=Ke,Ut=Lt(tA),nA=xr,Mu=Lt(nA),iA=fu,Nu=Lt(iA),Ct=Pr,ii=Tr,aA=M,oA=Lt(aA);function Lt(r){return r&&r.__esModule?r:{default:r}}function uA(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function sA(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Bu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fA=Dt.Union=function(){function r(e,t){Bu(this,r),this.set(e,t)}return rA(r,[{key:"set",value:function(t,n){(0,Nu.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Ct.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===Ct.Void?Ct.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,Mu.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(u){sA(f,u);function f(){return Bu(this,f),uA(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ii.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Ut.default)(i.arms,function(u,f){u instanceof ii.Reference&&(u=u.resolve(t)),a._arms[f]=u});var o=i.defaultArm;return o instanceof ii.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Ut.default)(i.switches,function(u){var f=eA(u,2),c=f[0],l=f[1];(0,Nu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,Mu.default)(a._switchOn.values)||(0,Ut.default)(a._switchOn.values(),function(u){a[u.name]=function(f){return new a(u,f)},a.prototype[u.name]=function(c){return this.set(u,c)}}),(0,Ut.default)(a._arms,function(u,f){u!==Ct.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,oA.default)(fA),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ie;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=$t;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Te;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Et;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=At;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Ot;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var u=St;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var f=Or;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var c=It;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var l=xt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var s=Pt;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var h=Tt;Object.keys(h).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return h[p]}})});var y=Rt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var m=Ft;Object.keys(m).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return m[p]}})});var E=Pr;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})});var O=Mt;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var w=Nt;Object.keys(w).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return w[p]}})});var $=Dt;Object.keys($).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return $[p]}})})}(Nn);var Du={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function _(g,v){for(var A=0;A<v.length;A++){var I=v[A];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(g,I.key,I)}}return function(g,v,A){return v&&_(g.prototype,v),A&&_(g,A),g}}(),t=Tr;Object.keys(t).forEach(function(_){_==="default"||_==="__esModule"||Object.defineProperty(r,_,{enumerable:!0,get:function(){return t[_]}})}),r.config=m;var n=xr,i=l(n),a=Ke,o=l(a),u=Nn,f=c(u);function c(_){if(_&&_.__esModule)return _;var g={};if(_!=null)for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(g[v]=_[v]);return g.default=_,g}function l(_){return _&&_.__esModule?_:{default:_}}function s(_,g){if(!(_ instanceof g))throw new TypeError("Cannot call a class as a function")}function h(_,g){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:_}function y(_,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);_.prototype=Object.create(g&&g.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(_,g):_.__proto__=g)}function m(_){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_){var v=new R(g);_(v),v.resolve()}return g}var E=function(_){y(g,_);function g(v){s(this,g);var A=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=v,A}return e(g,[{key:"resolve",value:function(A){var I=A.definitions[this.name];return I.resolve(A)}}]),g}(t.Reference),O=function(_){y(g,_);function g(v,A){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(this,g);var F=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return F.childReference=v,F.length=A,F.variable=I,F}return e(g,[{key:"resolve",value:function(A){var I=this.childReference,F=this.length;return I instanceof t.Reference&&(I=I.resolve(A)),F instanceof t.Reference&&(F=F.resolve(A)),this.variable?new f.VarArray(I,F):new f.Array(I,F)}}]),g}(t.Reference),w=function(_){y(g,_);function g(v){s(this,g);var A=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=v,A.name=v.name,A}return e(g,[{key:"resolve",value:function(A){var I=this.childReference;return I instanceof t.Reference&&(I=I.resolve(A)),new f.Option(I)}}]),g}(t.Reference),$=function(_){y(g,_);function g(v,A){s(this,g);var I=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return I.sizedType=v,I.length=A,I}return e(g,[{key:"resolve",value:function(A){var I=this.length;return I instanceof t.Reference&&(I=I.resolve(A)),new this.sizedType(I)}}]),g}(t.Reference),p=function(){function _(g,v,A){s(this,_),this.constructor=g,this.name=v,this.config=A}return e(_,[{key:"resolve",value:function(v){return this.name in v.results?v.results[this.name]:this.constructor(v,this.name,this.config)}}]),_}();function S(_,g,v){return v instanceof t.Reference&&(v=v.resolve(_)),_.results[g]=v,v}function P(_,g,v){return _.results[g]=v,v}var R=function(){function _(g){s(this,_),this._destination=g,this._definitions={}}return e(_,[{key:"enum",value:function(v,A){var I=new p(f.Enum.create,v,A);this.define(v,I)}},{key:"struct",value:function(v,A){var I=new p(f.Struct.create,v,A);this.define(v,I)}},{key:"union",value:function(v,A){var I=new p(f.Union.create,v,A);this.define(v,I)}},{key:"typedef",value:function(v,A){var I=new p(S,v,A);this.define(v,I)}},{key:"const",value:function(v,A){var I=new p(P,v,A);this.define(v,I)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(v){return new $(f.String,v)}},{key:"opaque",value:function(v){return new $(f.Opaque,v)}},{key:"varOpaque",value:function(v){return new $(f.VarOpaque,v)}},{key:"array",value:function(v,A){return new O(v,A)}},{key:"varArray",value:function(v,A){return new O(v,A,!0)}},{key:"option",value:function(v){return new w(v)}},{key:"define",value:function(v,A){if((0,i.default)(this._destination[v]))this._definitions[v]=A;else throw new Error("XDRTypes Error:"+v+" is already defined")}},{key:"lookup",value:function(v){return new E(v)}},{key:"resolve",value:function(){var v=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:v._definitions,results:v._destination})})}}]),_}()})(Du),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Nn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=Du;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(La);function cA(r){const e={variantId:oe.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new oe.BundleItem({collectionId:oe.Uint64.fromString(n.collectionId.toString()),productId:oe.Uint64.fromString(n.productId.toString()),variantId:oe.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new oe.BundleItemExt(0)})),ext:new oe.BundleExt(0)},t=new oe.Bundle(e);return oe.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const oe=La.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),Uu="/bundling-storefront-manager";function lA(){return Math.ceil(Date.now()/1e3)}async function hA(){try{const{timestamp:r}=await gr("get",`${Uu}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),lA()}}async function pA(r){const e=W(),t=await Cu(r);if(t!==!0)throw new Error(t);const n=await hA(),i=cA({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await gr("post",`${Uu}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function dA(r,e){const t=Lu(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${uh(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function Cu(r){try{return r?!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const yA={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function Lu(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=yA[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function gA(r,e){const{bundle_selection:t}=await b("get","/bundle_selections",{id:e},r);return t}function vA(r,e){return b("get","/bundle_selections",{query:e},r)}async function _A(r,e){const{bundle_selection:t}=await b("post","/bundle_selections",{data:e},r);return t}async function mA(r,e,t){const{bundle_selection:n}=await b("put","/bundle_selections",{id:e,data:t},r);return n}function wA(r,e){return b("delete","/bundle_selections",{id:e},r)}async function bA(r,e,t,n){const{subscription:i}=await b("put","/bundles",{id:e,data:t,query:n},r);return i}var $A=Object.freeze({__proto__:null,createBundleSelection:_A,deleteBundleSelection:wA,getBundleId:pA,getBundleSelection:gA,getDynamicBundleItems:dA,listBundleSelections:vA,updateBundle:bA,updateBundleSelection:mA,validateBundle:Cu,validateDynamicBundle:Lu}),EA=200,ai="__lodash_hash_undefined__",AA=1/0,ku=9007199254740991,OA="[object Arguments]",SA="[object Function]",IA="[object GeneratorFunction]",xA="[object Symbol]",PA=/[\\^$.*+?()[\]{}|]/g,TA=/^\[object .+?Constructor\]$/,RA=/^(?:0|[1-9]\d*)$/,FA=typeof U=="object"&&U&&U.Object===Object&&U,MA=typeof self=="object"&&self&&self.Object===Object&&self,oi=FA||MA||Function("return this")();function NA(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function BA(r,e){var t=r?r.length:0;return!!t&&CA(r,e,0)>-1}function DA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function ju(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function ui(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function UA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function CA(r,e,t){if(e!==e)return UA(r,LA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function LA(r){return r!==r}function kA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function jA(r){return function(e){return r(e)}}function qA(r,e){return r.has(e)}function VA(r,e){return r?.[e]}function GA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function qu(r,e){return function(t){return r(e(t))}}var HA=Array.prototype,WA=Function.prototype,kt=Object.prototype,si=oi["__core-js_shared__"],Vu=function(){var r=/[^.]+$/.exec(si&&si.keys&&si.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Gu=WA.toString,Ze=kt.hasOwnProperty,fi=kt.toString,XA=RegExp("^"+Gu.call(Ze).replace(PA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hu=oi.Symbol,zA=qu(Object.getPrototypeOf,Object),YA=kt.propertyIsEnumerable,KA=HA.splice,Wu=Hu?Hu.isConcatSpreadable:void 0,ci=Object.getOwnPropertySymbols,Xu=Math.max,ZA=Yu(oi,"Map"),Fr=Yu(Object,"create");function Re(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function JA(){this.__data__=Fr?Fr(null):{}}function QA(r){return this.has(r)&&delete this.__data__[r]}function eO(r){var e=this.__data__;if(Fr){var t=e[r];return t===ai?void 0:t}return Ze.call(e,r)?e[r]:void 0}function rO(r){var e=this.__data__;return Fr?e[r]!==void 0:Ze.call(e,r)}function tO(r,e){var t=this.__data__;return t[r]=Fr&&e===void 0?ai:e,this}Re.prototype.clear=JA,Re.prototype.delete=QA,Re.prototype.get=eO,Re.prototype.has=rO,Re.prototype.set=tO;function Je(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function nO(){this.__data__=[]}function iO(r){var e=this.__data__,t=qt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():KA.call(e,t,1),!0}function aO(r){var e=this.__data__,t=qt(e,r);return t<0?void 0:e[t][1]}function oO(r){return qt(this.__data__,r)>-1}function uO(r,e){var t=this.__data__,n=qt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}Je.prototype.clear=nO,Je.prototype.delete=iO,Je.prototype.get=aO,Je.prototype.has=oO,Je.prototype.set=uO;function Qe(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function sO(){this.__data__={hash:new Re,map:new(ZA||Je),string:new Re}}function fO(r){return Vt(this,r).delete(r)}function cO(r){return Vt(this,r).get(r)}function lO(r){return Vt(this,r).has(r)}function hO(r,e){return Vt(this,r).set(r,e),this}Qe.prototype.clear=sO,Qe.prototype.delete=fO,Qe.prototype.get=cO,Qe.prototype.has=lO,Qe.prototype.set=hO;function jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new Qe;++e<t;)this.add(r[e])}function pO(r){return this.__data__.set(r,ai),this}function dO(r){return this.__data__.has(r)}jt.prototype.add=jt.prototype.push=pO,jt.prototype.has=dO;function yO(r,e){var t=li(r)||Ku(r)?kA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||Ze.call(r,a))&&!(i&&(a=="length"||IO(a,n)))&&t.push(a);return t}function qt(r,e){for(var t=r.length;t--;)if(NO(r[t][0],e))return t;return-1}function gO(r,e,t,n){var i=-1,a=BA,o=!0,u=r.length,f=[],c=e.length;if(!u)return f;t&&(e=ju(e,jA(t))),n?(a=DA,o=!1):e.length>=EA&&(a=qA,o=!1,e=new jt(e));e:for(;++i<u;){var l=r[i],s=t?t(l):l;if(l=n||l!==0?l:0,o&&s===s){for(var h=c;h--;)if(e[h]===s)continue e;f.push(l)}else a(e,s,n)||f.push(l)}return f}function zu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=SO),i||(i=[]);++a<o;){var u=r[a];e>0&&t(u)?e>1?zu(u,e-1,t,n,i):ui(i,u):n||(i[i.length]=u)}return i}function vO(r,e,t){var n=e(r);return li(r)?n:ui(n,t(r))}function _O(r){if(!hi(r)||PO(r))return!1;var e=Ju(r)||GA(r)?XA:TA;return e.test(MO(r))}function mO(r){if(!hi(r))return RO(r);var e=TO(r),t=[];for(var n in r)n=="constructor"&&(e||!Ze.call(r,n))||t.push(n);return t}function wO(r,e){return r=Object(r),bO(r,e,function(t,n){return n in r})}function bO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],u=r[o];t(u,o)&&(a[o]=u)}return a}function $O(r,e){return e=Xu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=Xu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,NA(r,this,o)}}function EO(r){return vO(r,CO,OO)}function Vt(r,e){var t=r.__data__;return xO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Yu(r,e){var t=VA(r,e);return _O(t)?t:void 0}var AO=ci?qu(ci,Object):es,OO=ci?function(r){for(var e=[];r;)ui(e,AO(r)),r=zA(r);return e}:es;function SO(r){return li(r)||Ku(r)||!!(Wu&&r&&r[Wu])}function IO(r,e){return e=e??ku,!!e&&(typeof r=="number"||RA.test(r))&&r>-1&&r%1==0&&r<e}function xO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function PO(r){return!!Vu&&Vu in r}function TO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||kt;return r===t}function RO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function FO(r){if(typeof r=="string"||UO(r))return r;var e=r+"";return e=="0"&&1/r==-AA?"-0":e}function MO(r){if(r!=null){try{return Gu.call(r)}catch{}try{return r+""}catch{}}return""}function NO(r,e){return r===e||r!==r&&e!==e}function Ku(r){return BO(r)&&Ze.call(r,"callee")&&(!YA.call(r,"callee")||fi.call(r)==OA)}var li=Array.isArray;function Zu(r){return r!=null&&DO(r.length)&&!Ju(r)}function BO(r){return Qu(r)&&Zu(r)}function Ju(r){var e=hi(r)?fi.call(r):"";return e==SA||e==IA}function DO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ku}function hi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Qu(r){return!!r&&typeof r=="object"}function UO(r){return typeof r=="symbol"||Qu(r)&&fi.call(r)==xA}function CO(r){return Zu(r)?yO(r,!0):mO(r)}var LO=$O(function(r,e){return r==null?{}:(e=ju(zu(e,1),FO),wO(r,gO(EO(r),e)))});function es(){return[]}var kO=LO,pi=ge(kO);function jO(r){try{return JSON.parse(r)}catch{return r}}function qO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:jO(n)}),{})}const rs=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function ts(r){const e=qO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...pi(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function ns(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function VO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=ns(i)}),t})}const di="2020-12",GO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Mr=new Map;function Gt(r,e){return Mr.has(r)||Mr.set(r,e()),Mr.get(r)}async function yi(r,e){const t=e?.version??"2020-12",{product:n}=await Gt(`product.${r}.${t}`,()=>at("get",`/product/${t}/${r}.json`));return t==="2020-12"?ns(n):n}async function is(){return await Gt("storeSettings",()=>at("get",`/${di}/store_settings.json`).catch(()=>GO))}async function as(){const{widget_settings:r}=await Gt("widgetSettings",()=>at("get",`/${di}/widget_settings.json`));return ts(r)}async function os(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Gt("productsAndSettings",()=>at("get",`/product/${di}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:VO(r),widget_settings:ts(e),store_settings:t??{}}}async function HO(){const{products:r}=await os();return r}async function WO(r){const[e,t,n]=await Promise.all([yi(r),is(),as()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function XO(r){const{bundle_product:e}=await yi(r);return e}async function us(){return Array.from(Mr.keys()).forEach(r=>Mr.delete(r))}var zO=Object.freeze({__proto__:null,getCDNBundleSettings:XO,getCDNProduct:yi,getCDNProductAndSettings:WO,getCDNProducts:HO,getCDNProductsAndSettings:os,getCDNStoreSettings:is,getCDNWidgetSettings:as,resetCDNCache:us});async function YO(r,e,t){const{charge:n}=await b("get","/charges",{id:e,query:{include:t?.include}},r);return n}function KO(r,e){return b("get","/charges",{query:e},r)}async function ZO(r,e,t){const{charge:n}=await b("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function JO(r,e){const{charge:t}=await b("post",`/charges/${e}/remove_discount`,{},r);return t}async function QO(r,e,t,n){const{charge:i}=await b("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},r);return i}async function eS(r,e,t,n){const{charge:i}=await b("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},r);return i}async function rS(r,e){const{charge:t}=await b("post",`/charges/${e}/process`,{},r);return t}var tS=Object.freeze({__proto__:null,applyDiscountToCharge:ZO,getCharge:YO,listCharges:KO,processCharge:rS,removeDiscountsFromCharge:JO,skipCharge:QO,unskipCharge:eS});async function nS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await b("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function iS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await b("put","/customers",{id:t,data:e},r);return n}async function aS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await b("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function gi(r){return b("get","/portal_access",{},r)}async function oS(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await gi(r);return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function uS(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await gi(r);return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const sS={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function fS(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=sS[e];if(!i)throw new Error("Notification not supported.");return b("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},r)}async function cS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await b("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},r);return n}var lS=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:oS,getCreditSummary:cS,getCustomer:nS,getCustomerPortalAccess:gi,getDeliverySchedule:aS,getGiftRedemptionLandingPageURL:uS,sendCustomerNotification:fS,updateCustomer:iS});function hS(r,e){if(!r.customerId)throw new Error("Not logged in.");return b("get","/gift_purchases",{query:e},r)}async function pS(r,e){if(!r.customerId)throw new Error("Not logged in.");const{gift_purchase:t}=await b("get","/gift_purchases",{id:e},r);return t}var dS=Object.freeze({__proto__:null,getGiftPurchase:pS,listGiftPurchases:hS});async function yS(r,e){const{membership:t}=await b("get","/memberships",{id:e},r);return t}function gS(r,e){return b("get","/memberships",{query:e},r)}async function vS(r,e,t){const{membership:n}=await b("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function _S(r,e,t){const{membership:n}=await b("post",`/memberships/${e}/activate`,{data:t},r);return n}async function mS(r,e,t){const{membership:n}=await b("post",`/memberships/${e}/change`,{data:t},r);return n}var wS=Object.freeze({__proto__:null,activateMembership:_S,cancelMembership:vS,changeMembership:mS,getMembership:yS,listMemberships:gS});async function bS(r,e,t){const{membership_program:n}=await b("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function $S(r,e){return b("get","/membership_programs",{query:e},r)}var ES=Object.freeze({__proto__:null,getMembershipProgram:bS,listMembershipPrograms:$S});async function AS(r,e){const{metafield:t}=await b("post","/metafields",{data:{metafield:e}},r);return t}async function OS(r,e,t){const{metafield:n}=await b("put","/metafields",{id:e,data:{metafield:t}},r);return n}function SS(r,e){return b("delete","/metafields",{id:e},r)}var IS=Object.freeze({__proto__:null,createMetafield:AS,deleteMetafield:SS,updateMetafield:OS});async function xS(r,e){const{onetime:t}=await b("get","/onetimes",{id:e},r);return t}function PS(r,e){return b("get","/onetimes",{query:e},r)}async function TS(r,e){const{onetime:t}=await b("post","/onetimes",{data:e},r);return t}async function RS(r,e,t){const{onetime:n}=await b("put","/onetimes",{id:e,data:t},r);return n}function FS(r,e){return b("delete","/onetimes",{id:e},r)}var MS=Object.freeze({__proto__:null,createOnetime:TS,deleteOnetime:FS,getOnetime:xS,listOnetimes:PS,updateOnetime:RS});async function NS(r,e){const{order:t}=await b("get","/orders",{id:e},r);return t}function BS(r,e){return b("get","/orders",{query:e},r)}var DS=Object.freeze({__proto__:null,getOrder:NS,listOrders:BS});async function US(r,e,t){const{payment_method:n}=await b("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function CS(r,e){const{payment_method:t}=await b("post","/payment_methods",{data:{...e,customer_id:r.customerId}},r);return t}async function LS(r,e,t){const{payment_method:n}=await b("put","/payment_methods",{id:e,data:t},r);return n}function kS(r,e){return b("get","/payment_methods",{query:e},r)}var jS=Object.freeze({__proto__:null,createPaymentMethod:CS,getPaymentMethod:US,listPaymentMethods:kS,updatePaymentMethod:LS});async function qS(r,e){const{plan:t}=await b("get","/plans",{id:e},r);return t}function VS(r,e){return b("get","/plans",{query:e},r)}var GS=Object.freeze({__proto__:null,getPlan:qS,listPlans:VS});async function HS(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return b("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},r)}var WS=Object.freeze({__proto__:null,productSearch:HS});async function XS(r,e){return await b("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},r)}var zS=Object.freeze({__proto__:null,getShippingCountries:XS}),YS="Expected a function",ss="__lodash_placeholder__",Fe=1,Ht=2,KS=4,er=8,Nr=16,Me=32,Br=64,fs=128,ZS=256,cs=512,ls=1/0,JS=9007199254740991,QS=17976931348623157e292,hs=0/0,e2=[["ary",fs],["bind",Fe],["bindKey",Ht],["curry",er],["curryRight",Nr],["flip",cs],["partial",Me],["partialRight",Br],["rearg",ZS]],r2="[object Function]",t2="[object GeneratorFunction]",n2="[object Symbol]",i2=/[\\^$.*+?()[\]{}|]/g,a2=/^\s+|\s+$/g,o2=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,u2=/\{\n\/\* \[wrapped with (.+)\] \*/,s2=/,? & /,f2=/^[-+]0x[0-9a-f]+$/i,c2=/^0b[01]+$/i,l2=/^\[object .+?Constructor\]$/,h2=/^0o[0-7]+$/i,p2=/^(?:0|[1-9]\d*)$/,d2=parseInt,y2=typeof U=="object"&&U&&U.Object===Object&&U,g2=typeof self=="object"&&self&&self.Object===Object&&self,Dr=y2||g2||Function("return this")();function vi(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function v2(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function _2(r,e){var t=r?r.length:0;return!!t&&w2(r,e,0)>-1}function m2(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function w2(r,e,t){if(e!==e)return m2(r,b2,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function b2(r){return r!==r}function $2(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function E2(r,e){return r?.[e]}function A2(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function _i(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===ss)&&(r[t]=ss,a[i++]=t)}return a}var O2=Function.prototype,ps=Object.prototype,mi=Dr["__core-js_shared__"],ds=function(){var r=/[^.]+$/.exec(mi&&mi.keys&&mi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),ys=O2.toString,S2=ps.hasOwnProperty,gs=ps.toString,I2=RegExp("^"+ys.call(S2).replace(i2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x2=Object.create,rr=Math.max,P2=Math.min,vs=function(){var r=ms(Object,"defineProperty"),e=ms.name;return e&&e.length>2?r:void 0}();function T2(r){return tr(r)?x2(r):{}}function R2(r){if(!tr(r)||V2(r))return!1;var e=X2(r)||A2(r)?I2:l2;return e.test(H2(r))}function F2(r,e){return e=rr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=rr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,vi(r,this,o)}}function M2(r,e,t,n){for(var i=-1,a=r.length,o=t.length,u=-1,f=e.length,c=rr(a-o,0),l=Array(f+c),s=!n;++u<f;)l[u]=e[u];for(;++i<o;)(s||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[u++]=r[i++];return l}function N2(r,e,t,n){for(var i=-1,a=r.length,o=-1,u=t.length,f=-1,c=e.length,l=rr(a-u,0),s=Array(l+c),h=!n;++i<l;)s[i]=r[i];for(var y=i;++f<c;)s[y+f]=e[f];for(;++o<u;)(h||i<a)&&(s[y+t[o]]=r[i++]);return s}function B2(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function D2(r,e,t){var n=e&Fe,i=Ur(r);function a(){var o=this&&this!==Dr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function Ur(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=T2(r.prototype),n=r.apply(t,e);return tr(n)?n:t}}function U2(r,e,t){var n=Ur(r);function i(){for(var a=arguments.length,o=Array(a),u=a,f=bi(i);u--;)o[u]=arguments[u];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:_i(o,f);if(a-=c.length,a<t)return _s(r,e,wi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Dr&&this instanceof i?n:r;return vi(l,this,o)}return i}function wi(r,e,t,n,i,a,o,u,f,c){var l=e&fs,s=e&Fe,h=e&Ht,y=e&(er|Nr),m=e&cs,E=h?void 0:Ur(r);function O(){for(var w=arguments.length,$=Array(w),p=w;p--;)$[p]=arguments[p];if(y)var S=bi(O),P=$2($,S);if(n&&($=M2($,n,i,y)),a&&($=N2($,a,o,y)),w-=P,y&&w<c){var R=_i($,S);return _s(r,e,wi,O.placeholder,t,$,R,u,f,c-w)}var _=s?t:this,g=h?_[r]:r;return w=$.length,u?$=G2($,u):m&&w>1&&$.reverse(),l&&f<w&&($.length=f),this&&this!==Dr&&this instanceof O&&(g=E||Ur(g)),g.apply(_,$)}return O}function C2(r,e,t,n){var i=e&Fe,a=Ur(r);function o(){for(var u=-1,f=arguments.length,c=-1,l=n.length,s=Array(l+f),h=this&&this!==Dr&&this instanceof o?a:r;++c<l;)s[c]=n[c];for(;f--;)s[c++]=arguments[++u];return vi(h,i?t:this,s)}return o}function _s(r,e,t,n,i,a,o,u,f,c){var l=e&er,s=l?o:void 0,h=l?void 0:o,y=l?a:void 0,m=l?void 0:a;e|=l?Me:Br,e&=~(l?Br:Me),e&KS||(e&=~(Fe|Ht));var E=t(r,e,i,y,s,m,h,u,f,c);return E.placeholder=n,ws(E,r,e)}function L2(r,e,t,n,i,a,o,u){var f=e&Ht;if(!f&&typeof r!="function")throw new TypeError(YS);var c=n?n.length:0;if(c||(e&=~(Me|Br),n=i=void 0),o=o===void 0?o:rr(bs(o),0),u=u===void 0?u:bs(u),c-=i?i.length:0,e&Br){var l=n,s=i;n=i=void 0}var h=[r,e,t,n,i,l,s,a,o,u];if(r=h[0],e=h[1],t=h[2],n=h[3],i=h[4],u=h[9]=h[9]==null?f?0:r.length:rr(h[9]-c,0),!u&&e&(er|Nr)&&(e&=~(er|Nr)),!e||e==Fe)var y=D2(r,e,t);else e==er||e==Nr?y=U2(r,e,u):(e==Me||e==(Fe|Me))&&!i.length?y=C2(r,e,t,n):y=wi.apply(void 0,h);return ws(y,r,e)}function bi(r){var e=r;return e.placeholder}function ms(r,e){var t=E2(r,e);return R2(t)?t:void 0}function k2(r){var e=r.match(u2);return e?e[1].split(s2):[]}function j2(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(o2,`{
|
|
21
25
|
/* [wrapped with `+e+`] */
|
|
22
|
-
`)}function
|
|
26
|
+
`)}function q2(r,e){return e=e??JS,!!e&&(typeof r=="number"||p2.test(r))&&r>-1&&r%1==0&&r<e}function V2(r){return!!ds&&ds in r}function G2(r,e){for(var t=r.length,n=P2(e.length,t),i=B2(r);n--;){var a=e[n];r[n]=q2(a,t)?i[a]:void 0}return r}var ws=vs?function(r,e,t){var n=e+"";return vs(r,"toString",{configurable:!0,enumerable:!1,value:J2(j2(n,W2(k2(n),t)))})}:Q2;function H2(r){if(r!=null){try{return ys.call(r)}catch{}try{return r+""}catch{}}return""}function W2(r,e){return v2(e2,function(t){var n="_."+t[0];e&t[1]&&!_2(r,n)&&r.push(n)}),r.sort()}var $i=F2(function(r,e){var t=_i(e,bi($i));return L2(r,Me,void 0,e,t)});function X2(r){var e=tr(r)?gs.call(r):"";return e==r2||e==t2}function tr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function z2(r){return!!r&&typeof r=="object"}function Y2(r){return typeof r=="symbol"||z2(r)&&gs.call(r)==n2}function K2(r){if(!r)return r===0?r:0;if(r=Z2(r),r===ls||r===-ls){var e=r<0?-1:1;return e*QS}return r===r?r:0}function bs(r){var e=K2(r),t=e%1;return e===e?t?e-t:e:0}function Z2(r){if(typeof r=="number")return r;if(Y2(r))return hs;if(tr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=tr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(a2,"");var t=c2.test(r);return t||h2.test(r)?d2(r.slice(2),t?2:8):f2.test(r)?hs:+r}function J2(r){return function(){return r}}function Q2(r){return r}$i.placeholder={};var eI=$i,$s=ge(eI);function rI(r,e){return{...pi(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"]),customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0}}function tI(r,e){return{...pi(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"]),shopify_variant_id:e.external_variant_id?.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r}}function Es(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:u,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:s,shopify_variant_id:h,has_queued_charges:y,is_prepaid:m,is_skippable:E,is_swappable:O,max_retries_reached:w,next_charge_scheduled_at:$,order_day_of_month:p,order_day_of_week:S,order_interval_frequency:P,order_interval_unit:R,presentment_currency:_,price:g,product_title:v,properties:A,quantity:I,sku:F,sku_override:X,status:de,updated_at:nr,variant_title:ye}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:u,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${s}`},external_variant_id:{ecommerce:`${h}`},has_queued_charges:rs(y),is_prepaid:m,is_skippable:E,is_swappable:O,max_retries_reached:rs(w),next_charge_scheduled_at:$,order_day_of_month:p,order_day_of_week:S,order_interval_frequency:parseInt(P,10),order_interval_unit:R,presentment_currency:_,price:`${g}`,product_title:v??"",properties:A,quantity:I,sku:F,sku_override:X,status:de.toLowerCase(),updated_at:nr,variant_title:ye}}async function nI(r,e,t){const{subscription:n}=await b("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function iI(r,e){return b("get","/subscriptions",{query:e},r)}async function aI(r,e,t){const{subscription:n}=await b("post","/subscriptions",{data:e,query:t},r);return n}async function oI(r,e,t,n){const{subscription:i}=await b("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function uI(r,e,t,n){const{subscription:i}=await b("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function sI(r,e,t){const{subscription:n}=await b("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function fI(r,e,t,n){const{subscription:i}=await b("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function cI(r,e,t){const{subscription:n}=await b("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function lI(r,e,t){const{charge:n}=await b("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function hI(r,e,t){const{onetimes:n}=await b("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},r);return n}async function pI(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=$s(rI,n),o=e.map(a),{subscriptions:u}=await b("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return u.map(Es)}async function dI(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=$s(tI,!!n?.force_update),u=t.map(o),{subscriptions:f}=await b("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:u},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(Es)}var yI=Object.freeze({__proto__:null,activateSubscription:cI,cancelSubscription:fI,createSubscription:aI,createSubscriptions:pI,getSubscription:nI,listSubscriptions:iI,skipGiftSubscriptionCharge:hI,skipSubscriptionCharge:lI,updateSubscription:oI,updateSubscriptionAddress:sI,updateSubscriptionChargeDate:uI,updateSubscriptions:dI});const gI={get(r,e){return G("get",r,e)},post(r,e){return G("post",r,e)},put(r,e){return G("put",r,e)},delete(r,e){return G("delete",r,e)}};function vI(r){if(r)return r;if(window?.Shopify?.shop)return window.Shopify.shop;let e=window?.domain;if(!e){const t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/,"");t&&(e=`${t}.myshopify.com`)}if(e)return e;throw new Error("No storeIdentifier was passed into init.")}function _I(r={}){const e=r,{storefrontAccessToken:t}=r;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");Ul({storeIdentifier:vI(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:t,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri}),us()}const As={init:_I,api:gI,address:Kl,auth:oh,bundle:$A,charge:tS,cdn:zO,customer:lS,gift:dS,membership:wS,membershipProgram:ES,metafield:IS,onetime:MS,order:DS,paymentMethod:jS,plan:GS,product:WS,store:zS,subscription:yI};try{As.init()}catch{}return As});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rechargeapps/storefront-client",
|
|
3
3
|
"description": "Storefront client for Recharge",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.3",
|
|
5
5
|
"author": "Recharge Inc.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"isomorphic-fetch": "3.0.0",
|
|
34
|
-
"js-xdr": "
|
|
34
|
+
"js-xdr": "1.3.0",
|
|
35
35
|
"lodash.omit": "4.5.0",
|
|
36
36
|
"lodash.partial": "4.2.1",
|
|
37
37
|
"nanoid": "3.3.7",
|