@rechargeapps/storefront-client 1.48.0 → 1.49.0
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/cjs/api/auth.js +1 -1
- package/dist/cjs/api/bundle.js.map +1 -1
- package/dist/cjs/api/bundleData.js +44 -0
- package/dist/cjs/api/bundleData.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/bundleData.js +224 -0
- package/dist/cjs/utils/bundleData.js.map +1 -0
- package/dist/cjs/utils/request.js +1 -1
- package/dist/esm/api/auth.js +1 -1
- package/dist/esm/api/bundle.js.map +1 -1
- package/dist/esm/api/bundleData.js +42 -0
- package/dist/esm/api/bundleData.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/bundleData.js +222 -0
- package/dist/esm/utils/bundleData.js.map +1 -0
- package/dist/esm/utils/request.js +1 -1
- package/dist/index.d.ts +487 -11
- package/dist/umd/recharge-client.min.js +11 -11
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// recharge-client-1.
|
|
2
|
-
(function(U,be){typeof exports=="object"&&typeof module<"u"?module.exports=be():typeof define=="function"&&define.amd?define(be):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=be())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function be(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function
|
|
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}ki.call($e.prototype);function Y(r,e){if(!(this instanceof Y))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 C(e.headers),this.url=e.url||"",this._initBody(r)}ki.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var uf=[301,302,303,307,308];Y.redirect=function(r,e){if(uf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:e,headers:{location:r}})};var Ee=q.DOMException;try{new Ee}catch{Ee=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Ee.prototype=Object.create(Error.prototype),Ee.prototype.constructor=Ee}function ji(r,e){return new Promise(function(t,n){var i=new $e(r,e);if(i.signal&&i.signal.aborted)return n(new Ee("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:of(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 Y(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 Ee("Aborted","AbortError"))},0)};function u(f){try{return f===""&&q.location.href?q.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&&(G.blob?a.responseType="blob":G.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 C)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,nn(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)})}ji.polyfill=!0,q.fetch||(q.fetch=ji,q.Headers=C,q.Request=$e,q.Response=Y),self.fetch.bind(self);let sf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Vi=(r=21)=>{let e="",t=r;for(;t--;)e+=sf[Math.random()*64|0];return e};var ff=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},Gi=typeof Symbol<"u"&&Symbol,cf=ff,lf=function(){return typeof Gi!="function"||typeof Symbol!="function"||typeof Gi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:cf()},Hi={foo:{}},hf=Object,df=function(){return{__proto__:Hi}.foo===Hi.foo&&!({__proto__:null}instanceof hf)},pf="Function.prototype.bind called on incompatible ",un=Array.prototype.slice,yf=Object.prototype.toString,gf="[object Function]",vf=function(e){var t=this;if(typeof t!="function"||yf.call(t)!==gf)throw new TypeError(pf+t);for(var n=un.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(un.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(un.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},_f=vf,sn=Function.prototype.bind||_f,mf=sn,wf=mf.call(Function.call,Object.prototype.hasOwnProperty),x,Le=SyntaxError,Wi=Function,ke=TypeError,fn=function(r){try{return Wi('"use strict"; return ('+r+").constructor;")()}catch{}},Ae=Object.getOwnPropertyDescriptor;if(Ae)try{Ae({},"")}catch{Ae=null}var cn=function(){throw new ke},bf=Ae?function(){try{return arguments.callee,cn}catch{try{return Ae(arguments,"callee").get}catch{return cn}}}():cn,je=lf(),$f=df(),N=Object.getPrototypeOf||($f?function(r){return r.__proto__}:null),Ve={},Ef=typeof Uint8Array>"u"||!N?x:N(Uint8Array),Se={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":je&&N?N([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ve,"%AsyncGenerator%":Ve,"%AsyncGeneratorFunction%":Ve,"%AsyncIteratorPrototype%":Ve,"%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%":Wi,"%GeneratorFunction%":Ve,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":je&&N?N(N([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!je||!N?x:N(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"||!je||!N?x:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":je&&N?N(""[Symbol.iterator]()):x,"%Symbol%":je?Symbol:x,"%SyntaxError%":Le,"%ThrowTypeError%":bf,"%TypedArray%":Ef,"%TypeError%":ke,"%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(N)try{null.error}catch(r){var Af=N(N(r));Se["%Error.prototype%"]=Af}var Sf=function r(e){var t;if(e==="%AsyncFunction%")t=fn("async function () {}");else if(e==="%GeneratorFunction%")t=fn("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=fn("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&N&&(t=N(i.prototype))}return Se[e]=t,t},Xi={"%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"]},dr=sn,zr=wf,Of=dr.call(Function.call,Array.prototype.concat),If=dr.call(Function.apply,Array.prototype.splice),zi=dr.call(Function.call,String.prototype.replace),Yr=dr.call(Function.call,String.prototype.slice),Pf=dr.call(Function.call,RegExp.prototype.exec),xf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Tf=/\\(\\)?/g,Rf=function(e){var t=Yr(e,0,1),n=Yr(e,-1);if(t==="%"&&n!=="%")throw new Le("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Le("invalid intrinsic syntax, expected opening `%`");var i=[];return zi(e,xf,function(a,o,u,f){i[i.length]=u?zi(f,Tf,"$1"):o||a}),i},Ff=function(e,t){var n=e,i;if(zr(Xi,n)&&(i=Xi[n],n="%"+i[0]+"%"),zr(Se,n)){var a=Se[n];if(a===Ve&&(a=Sf(n)),typeof a>"u"&&!t)throw new ke("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Le("intrinsic "+e+" does not exist!")},ln=function(e,t){if(typeof e!="string"||e.length===0)throw new ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ke('"allowMissing" argument must be a boolean');if(Pf(/^%?[^%]*%?$/,e)===null)throw new Le("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Rf(e),i=n.length>0?n[0]:"",a=Ff("%"+i+"%",t),o=a.name,u=a.value,f=!1,c=a.alias;c&&(i=c[0],If(n,Of([0,1],c)));for(var l=1,s=!0;l<n.length;l+=1){var h=n[l],y=Yr(h,0,1),w=Yr(h,-1);if((y==='"'||y==="'"||y==="`"||w==='"'||w==="'"||w==="`")&&y!==w)throw new Le("property names with quotes must have matching quotes");if((h==="constructor"||!s)&&(f=!0),i+="."+h,o="%"+i+"%",zr(Se,o))u=Se[o];else if(u!=null){if(!(h in u)){if(!t)throw new ke("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ae&&l+1>=n.length){var A=Ae(u,h);s=!!A,s&&"get"in A&&!("originalValue"in A.get)?u=A.get:u=u[h]}else s=zr(u,h),u=u[h];s&&!f&&(Se[o]=u)}}return u},Yi={exports:{}};(function(r){var e=sn,t=ln,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})(Yi);var Mf=Yi.exports,Ki=ln,Zi=Mf,Df=Zi(Ki("String.prototype.indexOf")),Cf=function(e,t){var n=Ki(e,!!t);return typeof n=="function"&&Df(e,".prototype.")>-1?Zi(n):n},Ge=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],X=[],Nf=typeof Uint8Array<"u"?Uint8Array:Array,hn=!1;function Ji(){hn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],X[r.charCodeAt(e)]=e;X["-".charCodeAt(0)]=62,X["_".charCodeAt(0)]=63}function Bf(r){hn||Ji();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 Nf(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=X[r.charCodeAt(e)]<<18|X[r.charCodeAt(e+1)]<<12|X[r.charCodeAt(e+2)]<<6|X[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=X[r.charCodeAt(e)]<<2|X[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=X[r.charCodeAt(e)]<<10|X[r.charCodeAt(e+1)]<<4|X[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Uf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function qf(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(Uf(n));return i.join("")}function Qi(r){hn||Ji();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,u=0,f=t-n;u<f;u+=o)a.push(qf(r,u,u+o>f?f:u+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[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 ea(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,w=n?1:-1,A=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+=w,u/=256,i-=8);for(o=o<<i|u,c+=i;c>0;r[t+y]=o&255,y+=w,o/=256,c-=8);r[t+y-w]|=A*128}var Lf={}.toString,ra=Array.isArray||function(r){return Lf.call(r)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.49.0.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function(U,be){typeof exports=="object"&&typeof module<"u"?module.exports=be():typeof define=="function"&&define.amd?define(be):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=be())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function be(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function tf(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 q=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof q<"u"&&q,G={searchParams:"URLSearchParams"in q,iterable:"Symbol"in q&&"iterator"in Symbol,blob:"FileReader"in q&&"Blob"in q&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in q,arrayBuffer:"ArrayBuffer"in q};function nf(r){return r&&DataView.prototype.isPrototypeOf(r)}if(G.arrayBuffer)var af=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],of=ArrayBuffer.isView||function(r){return r&&af.indexOf(Object.prototype.toString.call(r))>-1};function pr(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 an(r){return typeof r!="string"&&(r=String(r)),r}function on(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return G.iterable&&(e[Symbol.iterator]=function(){return e}),e}function C(r){this.map={},r instanceof C?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)}C.prototype.append=function(r,e){r=pr(r),e=an(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},C.prototype.delete=function(r){delete this.map[pr(r)]},C.prototype.get=function(r){return r=pr(r),this.has(r)?this.map[r]:null},C.prototype.has=function(r){return this.map.hasOwnProperty(pr(r))},C.prototype.set=function(r,e){this.map[pr(r)]=an(e)},C.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},C.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),on(r)},C.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),on(r)},C.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),on(r)},G.iterable&&(C.prototype[Symbol.iterator]=C.prototype.entries);function un(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function ki(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function uf(r){var e=new FileReader,t=ki(e);return e.readAsArrayBuffer(r),t}function sf(r){var e=new FileReader,t=ki(e);return e.readAsText(r),t}function ff(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 ji(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Vi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:G.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:G.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:G.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():G.arrayBuffer&&G.blob&&nf(r)?(this._bodyArrayBuffer=ji(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):G.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||of(r))?this._bodyArrayBuffer=ji(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):G.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},G.blob&&(this.blob=function(){var r=un(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=un(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(uf)}),this.text=function(){var r=un(this);if(r)return r;if(this._bodyBlob)return sf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ff(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},G.formData&&(this.formData=function(){return this.text().then(df)}),this.json=function(){return this.text().then(JSON.parse)},this}var cf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function lf(r){var e=r.toUpperCase();return cf.indexOf(e)>-1?e:r}function $e(r,e){if(!(this instanceof $e))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 $e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new C(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 C(e.headers)),this.method=lf(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()}}}$e.prototype.clone=function(){return new $e(this,{body:this._bodyInit})};function df(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 pf(r){var e=new C,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}Vi.call($e.prototype);function K(r,e){if(!(this instanceof K))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 C(e.headers),this.url=e.url||"",this._initBody(r)}Vi.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},K.error=function(){var r=new K(null,{status:0,statusText:""});return r.type="error",r};var hf=[301,302,303,307,308];K.redirect=function(r,e){if(hf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new K(null,{status:e,headers:{location:r}})};var Ee=q.DOMException;try{new Ee}catch{Ee=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Ee.prototype=Object.create(Error.prototype),Ee.prototype.constructor=Ee}function Gi(r,e){return new Promise(function(t,n){var i=new $e(r,e);if(i.signal&&i.signal.aborted)return n(new Ee("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:pf(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 K(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 Ee("Aborted","AbortError"))},0)};function u(f){try{return f===""&&q.location.href?q.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&&(G.blob?a.responseType="blob":G.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 C)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,an(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)})}Gi.polyfill=!0,q.fetch||(q.fetch=Gi,q.Headers=C,q.Request=$e,q.Response=K),self.fetch.bind(self);let yf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Hi=(r=21)=>{let e="",t=r;for(;t--;)e+=yf[Math.random()*64|0];return e};var gf=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},Wi=typeof Symbol<"u"&&Symbol,_f=gf,vf=function(){return typeof Wi!="function"||typeof Symbol!="function"||typeof Wi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},zi={foo:{}},mf=Object,wf=function(){return{__proto__:zi}.foo===zi.foo&&!({__proto__:null}instanceof mf)},bf="Function.prototype.bind called on incompatible ",sn=Array.prototype.slice,$f=Object.prototype.toString,Ef="[object Function]",Sf=function(e){var t=this;if(typeof t!="function"||$f.call(t)!==Ef)throw new TypeError(bf+t);for(var n=sn.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(sn.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(sn.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},Af=Sf,fn=Function.prototype.bind||Af,Of=fn,If=Of.call(Function.call,Object.prototype.hasOwnProperty),P,ke=SyntaxError,Xi=Function,je=TypeError,cn=function(r){try{return Xi('"use strict"; return ('+r+").constructor;")()}catch{}},Se=Object.getOwnPropertyDescriptor;if(Se)try{Se({},"")}catch{Se=null}var ln=function(){throw new je},xf=Se?function(){try{return arguments.callee,ln}catch{try{return Se(arguments,"callee").get}catch{return ln}}}():ln,Ve=vf(),Pf=wf(),N=Object.getPrototypeOf||(Pf?function(r){return r.__proto__}:null),Ge={},Tf=typeof Uint8Array>"u"||!N?P:N(Uint8Array),Ae={"%AggregateError%":typeof AggregateError>"u"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?P:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&N?N([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?P:Atomics,"%BigInt%":typeof BigInt>"u"?P:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?P:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?P:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?P:Float32Array,"%Float64Array%":typeof Float64Array>"u"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?P:FinalizationRegistry,"%Function%":Xi,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?P:Int8Array,"%Int16Array%":typeof Int16Array>"u"?P:Int16Array,"%Int32Array%":typeof Int32Array>"u"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&N?N(N([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map>"u"?P:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!N?P:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?P:Promise,"%Proxy%":typeof Proxy>"u"?P:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?P:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!N?P:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&N?N(""[Symbol.iterator]()):P,"%Symbol%":Ve?Symbol:P,"%SyntaxError%":ke,"%ThrowTypeError%":xf,"%TypedArray%":Tf,"%TypeError%":je,"%Uint8Array%":typeof Uint8Array>"u"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?P:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?P:WeakMap,"%WeakRef%":typeof WeakRef>"u"?P:WeakRef,"%WeakSet%":typeof WeakSet>"u"?P:WeakSet};if(N)try{null.error}catch(r){var Rf=N(N(r));Ae["%Error.prototype%"]=Rf}var Ff=function r(e){var t;if(e==="%AsyncFunction%")t=cn("async function () {}");else if(e==="%GeneratorFunction%")t=cn("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=cn("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&N&&(t=N(i.prototype))}return Ae[e]=t,t},Yi={"%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"]},hr=fn,Xr=If,Mf=hr.call(Function.call,Array.prototype.concat),Df=hr.call(Function.apply,Array.prototype.splice),Ki=hr.call(Function.call,String.prototype.replace),Yr=hr.call(Function.call,String.prototype.slice),Cf=hr.call(Function.call,RegExp.prototype.exec),Nf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bf=/\\(\\)?/g,Uf=function(e){var t=Yr(e,0,1),n=Yr(e,-1);if(t==="%"&&n!=="%")throw new ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Ki(e,Nf,function(a,o,u,f){i[i.length]=u?Ki(f,Bf,"$1"):o||a}),i},qf=function(e,t){var n=e,i;if(Xr(Yi,n)&&(i=Yi[n],n="%"+i[0]+"%"),Xr(Ae,n)){var a=Ae[n];if(a===Ge&&(a=Ff(n)),typeof a>"u"&&!t)throw new je("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new ke("intrinsic "+e+" does not exist!")},dn=function(e,t){if(typeof e!="string"||e.length===0)throw new je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new je('"allowMissing" argument must be a boolean');if(Cf(/^%?[^%]*%?$/,e)===null)throw new ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Uf(e),i=n.length>0?n[0]:"",a=qf("%"+i+"%",t),o=a.name,u=a.value,f=!1,c=a.alias;c&&(i=c[0],Df(n,Mf([0,1],c)));for(var l=1,s=!0;l<n.length;l+=1){var d=n[l],y=Yr(d,0,1),w=Yr(d,-1);if((y==='"'||y==="'"||y==="`"||w==='"'||w==="'"||w==="`")&&y!==w)throw new ke("property names with quotes must have matching quotes");if((d==="constructor"||!s)&&(f=!0),i+="."+d,o="%"+i+"%",Xr(Ae,o))u=Ae[o];else if(u!=null){if(!(d in u)){if(!t)throw new je("base intrinsic for "+e+" exists, but the property is not available.");return}if(Se&&l+1>=n.length){var S=Se(u,d);s=!!S,s&&"get"in S&&!("originalValue"in S.get)?u=S.get:u=u[d]}else s=Xr(u,d),u=u[d];s&&!f&&(Ae[o]=u)}}return u},Zi={exports:{}};(function(r){var e=fn,t=dn,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 d=a(e,i,arguments);if(o&&u){var y=o(d,"length");y.configurable&&u(d,"length",{value:1+f(0,s.length-(arguments.length-1))})}return d};var c=function(){return a(e,n,arguments)};u?u(r.exports,"apply",{value:c}):r.exports.apply=c})(Zi);var Lf=Zi.exports,Ji=dn,Qi=Lf,kf=Qi(Ji("String.prototype.indexOf")),jf=function(e,t){var n=Ji(e,!!t);return typeof n=="function"&&kf(e,".prototype.")>-1?Qi(n):n},He=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Z=[],z=[],Vf=typeof Uint8Array<"u"?Uint8Array:Array,pn=!1;function ea(){pn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)Z[e]=r[e],z[r.charCodeAt(e)]=e;z["-".charCodeAt(0)]=62,z["_".charCodeAt(0)]=63}function Gf(r){pn||ea();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 Vf(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=z[r.charCodeAt(e)]<<18|z[r.charCodeAt(e+1)]<<12|z[r.charCodeAt(e+2)]<<6|z[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=z[r.charCodeAt(e)]<<2|z[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=z[r.charCodeAt(e)]<<10|z[r.charCodeAt(e+1)]<<4|z[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Hf(r){return Z[r>>18&63]+Z[r>>12&63]+Z[r>>6&63]+Z[r&63]}function Wf(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(Hf(n));return i.join("")}function ra(r){pn||ea();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,u=0,f=t-n;u<f;u+=o)a.push(Wf(r,u,u+o>f?f:u+o));return n===1?(e=r[t-1],i+=Z[e>>2],i+=Z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=Z[e>>10],i+=Z[e>>4&63],i+=Z[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,d=t?-1:1,y=r[e+s];for(s+=d,a=y&(1<<-l)-1,y>>=-l,l+=u;l>0;a=a*256+r[e+s],s+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+s],s+=d,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 ta(r,e,t,n,i,a){var o,u,f,c=a*8-i-1,l=(1<<c)-1,s=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,w=n?1:-1,S=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+=d/f:e+=d*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+=w,u/=256,i-=8);for(o=o<<i|u,c+=i;c>0;r[t+y]=o&255,y+=w,o/=256,c-=8);r[t+y-w]|=S*128}var zf={}.toString,na=Array.isArray||function(r){return zf.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 kf=50;p.TYPED_ARRAY_SUPPORT=Ge.TYPED_ARRAY_SUPPORT!==void 0?Ge.TYPED_ARRAY_SUPPORT:!0,Zr();function Zr(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ae(r,e){if(Zr()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=p.prototype):(r===null&&(r=new p(e)),r.length=e),r}function p(r,e,t){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(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 dn(this,r)}return ta(this,r,e,t)}p.poolSize=8192,p._augment=function(r){return r.__proto__=p.prototype,r};function ta(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?Gf(r,e,t,n):typeof e=="string"?Vf(r,e,t):Hf(r,e)}p.from=function(r,e,t){return ta(null,r,e,t)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&p[Symbol.species]);function na(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 jf(r,e,t,n){return na(e),e<=0?ae(r,e):t!==void 0?typeof n=="string"?ae(r,e).fill(t,n):ae(r,e).fill(t):ae(r,e)}p.alloc=function(r,e,t){return jf(null,r,e,t)};function dn(r,e){if(na(e),r=ae(r,e<0?0:yn(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}p.allocUnsafe=function(r){return dn(null,r)},p.allocUnsafeSlow=function(r){return dn(null,r)};function Vf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!p.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=ia(e,t)|0;r=ae(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function pn(r,e){var t=e.length<0?0:yn(e.length)|0;r=ae(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Gf(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),p.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=p.prototype):r=pn(r,e),r}function Hf(r,e){if(Z(e)){var t=yn(e.length)|0;return r=ae(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"||cc(e.length)?ae(r,0):pn(r,e);if(e.type==="Buffer"&&ra(e.data))return pn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function yn(r){if(r>=Zr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zr().toString(16)+" bytes");return r|0}p.isBuffer=lc;function Z(r){return!!(r!=null&&r._isBuffer)}p.compare=function(e,t){if(!Z(e)||!Z(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},p.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}},p.concat=function(e,t){if(!ra(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=p.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!Z(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function ia(r,e){if(Z(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 et(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return da(r).length;default:if(n)return et(r).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=ia;function Wf(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 tc(this,e,t);case"utf8":case"utf-8":return sa(this,e,t);case"ascii":return ec(this,e,t);case"latin1":case"binary":return rc(this,e,t);case"base64":return Jf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Oe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}p.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)Oe(this,t,t+1);return this},p.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)Oe(this,t,t+3),Oe(this,t+1,t+2);return this},p.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)Oe(this,t,t+7),Oe(this,t+1,t+6),Oe(this,t+2,t+5),Oe(this,t+3,t+4);return this},p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?sa(this,0,e):Wf.apply(this,arguments)},p.prototype.equals=function(e){if(!Z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},p.prototype.inspect=function(){var e="",t=kf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},p.prototype.compare=function(e,t,n,i,a){if(!Z(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 aa(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=p.from(e,n)),Z(e))return e.length===0?-1:oa(r,e,t,n,i);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):oa(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function oa(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,w){return a===1?y[w]:y.readUInt16BE(w*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}p.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},p.prototype.indexOf=function(e,t,n){return aa(this,e,t,n,!0)},p.prototype.lastIndexOf=function(e,t,n){return aa(this,e,t,n,!1)};function Xf(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 zf(r,e,t,n){return rt(et(e,r.length-t),r,t,n)}function ua(r,e,t,n){return rt(sc(e),r,t,n)}function Yf(r,e,t,n){return ua(r,e,t,n)}function Kf(r,e,t,n){return rt(da(e),r,t,n)}function Zf(r,e,t,n){return rt(fc(e,r.length-t),r,t,n)}p.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 Xf(this,e,t,n);case"utf8":case"utf-8":return zf(this,e,t,n);case"ascii":return ua(this,e,t,n);case"latin1":case"binary":return Yf(this,e,t,n);case"base64":return Kf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zf(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jf(r,e,t){return e===0&&t===r.length?Qi(r):Qi(r.slice(e,t))}function sa(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 Qf(n)}var fa=4096;function Qf(r){var e=r.length;if(e<=fa)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=fa));return t}function ec(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 rc(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 tc(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+=uc(r[a]);return i}function nc(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}p.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(p.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=p.prototype;else{var a=t-e;i=new p(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function B(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")}p.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},p.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},p.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},p.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||B(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},p.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||B(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},p.prototype.readInt8=function(e,t){return t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},p.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},p.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},p.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!1,52,8)};function H(r,e,t,n,i,a){if(!Z(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")}p.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;H(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},p.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;H(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},p.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Jr(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}p.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2};function Qr(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}p.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Qr(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(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},p.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(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},p.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},p.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Qr(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4};function ca(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 la(r,e,t,n,i){return i||ca(r,e,t,4),ea(r,e,t,n,23,4),t+4}p.prototype.writeFloatLE=function(e,t,n){return la(this,e,t,!0,n)},p.prototype.writeFloatBE=function(e,t,n){return la(this,e,t,!1,n)};function ha(r,e,t,n,i){return i||ca(r,e,t,8),ea(r,e,t,n,52,8),t+8}p.prototype.writeDoubleLE=function(e,t,n){return ha(this,e,t,!0,n)},p.prototype.writeDoubleBE=function(e,t,n){return ha(this,e,t,!1,n)},p.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||!p.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},p.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"&&!p.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=Z(e)?e:et(new p(e,i).toString()),f=u.length;for(o=0;o<n-t;++o)this[o+t]=u[o%f]}return this};var ic=/[^+\/0-9A-Za-z-_]/g;function ac(r){if(r=oc(r).replace(ic,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function oc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function uc(r){return r<16?"0"+r.toString(16):r.toString(16)}function et(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 sc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function fc(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 da(r){return Bf(ac(r))}function rt(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 cc(r){return r!==r}function lc(r){return r!=null&&(!!r._isBuffer||pa(r)||hc(r))}function pa(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function hc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&pa(r.slice(0,0))}function ya(){throw new Error("setTimeout has not been defined")}function ga(){throw new Error("clearTimeout has not been defined")}var le=ya,he=ga;typeof Ge.setTimeout=="function"&&(le=setTimeout),typeof Ge.clearTimeout=="function"&&(he=clearTimeout);function va(r){if(le===setTimeout)return setTimeout(r,0);if((le===ya||!le)&&setTimeout)return le=setTimeout,setTimeout(r,0);try{return le(r,0)}catch{try{return le.call(null,r,0)}catch{return le.call(this,r,0)}}}function dc(r){if(he===clearTimeout)return clearTimeout(r);if((he===ga||!he)&&clearTimeout)return he=clearTimeout,clearTimeout(r);try{return he(r)}catch{try{return he.call(null,r)}catch{return he.call(this,r)}}}var oe=[],He=!1,Ie,tt=-1;function pc(){!He||!Ie||(He=!1,Ie.length?oe=Ie.concat(oe):tt=-1,oe.length&&_a())}function _a(){if(!He){var r=va(pc);He=!0;for(var e=oe.length;e;){for(Ie=oe,oe=[];++tt<e;)Ie&&Ie[tt].run();tt=-1,e=oe.length}Ie=null,He=!1,dc(r)}}function yc(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];oe.push(new ma(r,e)),oe.length===1&&!He&&va(_a)}function ma(r,e){this.fun=r,this.array=e}ma.prototype.run=function(){this.fun.apply(null,this.array)};var gc="browser",vc="browser",_c=!0,mc={},wc=[],bc="",$c={},Ec={},Ac={};function Pe(){}var Sc=Pe,Oc=Pe,Ic=Pe,Pc=Pe,xc=Pe,Tc=Pe,Rc=Pe;function Fc(r){throw new Error("process.binding is not supported")}function Mc(){return"/"}function Dc(r){throw new Error("process.chdir is not supported")}function Cc(){return 0}var We=Ge.performance||{},Nc=We.now||We.mozNow||We.msNow||We.oNow||We.webkitNow||function(){return new Date().getTime()};function Bc(r){var e=Nc.call(We)*.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 Uc=new Date;function qc(){var r=new Date,e=r-Uc;return e/1e3}var Xe={nextTick:yc,title:gc,browser:_c,env:mc,argv:wc,version:bc,versions:$c,on:Sc,addListener:Oc,once:Ic,off:Pc,removeListener:xc,removeAllListeners:Tc,emit:Rc,binding:Fc,cwd:Mc,chdir:Dc,umask:Cc,hrtime:Bc,platform:vc,release:Ec,config:Ac,uptime:qc},gn;typeof Object.create=="function"?gn=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:gn=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var wa=gn,ba=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},Lc=/%[sdj%]/g;function nt(r){if(!yr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(J(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Lc,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])pr(o)||!xe(o)?a+=" "+o:a+=" "+J(o);return a}function vn(r,e){if(Q(Ge.process))return function(){return vn(r,e).apply(this,arguments)};if(Xe.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Xe.throwDeprecation)throw new Error(e);Xe.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var it={},_n;function $a(r){if(Q(_n)&&(_n=Xe.env.NODE_DEBUG||""),r=r.toUpperCase(),!it[r])if(new RegExp("\\b"+r+"\\b","i").test(_n)){var e=0;it[r]=function(){var t=nt.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else it[r]=function(){};return it[r]}function J(r,e){var t={seen:[],stylize:jc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ot(e)?t.showHidden=e:e&&Sn(t,e),Q(t.showHidden)&&(t.showHidden=!1),Q(t.depth)&&(t.depth=2),Q(t.colors)&&(t.colors=!1),Q(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=kc),at(t,r,t.depth)}J.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]},J.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function kc(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function jc(r,e){return r}function Vc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function at(r,e,t){if(r.customInspect&&e&&_r(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return yr(n)||(n=at(r,n,t)),n}var i=Gc(r,e);if(i)return i;var a=Object.keys(e),o=Vc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),vr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return mn(e);if(a.length===0){if(_r(e)){var u=e.name?": "+e.name:"";return r.stylize("[Function"+u+"]","special")}if(gr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(ut(e))return r.stylize(Date.prototype.toString.call(e),"date");if(vr(e))return mn(e)}var f="",c=!1,l=["{","}"];if(bn(e)&&(c=!0,l=["[","]"]),_r(e)){var s=e.name?": "+e.name:"";f=" [Function"+s+"]"}if(gr(e)&&(f=" "+RegExp.prototype.toString.call(e)),ut(e)&&(f=" "+Date.prototype.toUTCString.call(e)),vr(e)&&(f=" "+mn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return gr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var h;return c?h=Hc(r,e,t,o,a):h=a.map(function(y){return wn(r,e,t,o,y,c)}),r.seen.pop(),Wc(h,f,l)}function Gc(r,e){if(Q(e))return r.stylize("undefined","undefined");if(yr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if($n(e))return r.stylize(""+e,"number");if(ot(e))return r.stylize(""+e,"boolean");if(pr(e))return r.stylize("null","null")}function mn(r){return"["+Error.prototype.toString.call(r)+"]"}function Hc(r,e,t,n,i){for(var a=[],o=0,u=e.length;o<u;++o)Pa(e,String(o))?a.push(wn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(wn(r,e,t,n,f,!0))}),a}function wn(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")),Pa(n,i)||(o="["+i+"]"),u||(r.seen.indexOf(f.value)<0?(pr(t)?u=at(r,f.value,null):u=at(r,f.value,t-1),u.indexOf(`
|
|
8
|
+
*/var Xf=50;h.TYPED_ARRAY_SUPPORT=He.TYPED_ARRAY_SUPPORT!==void 0?He.TYPED_ARRAY_SUPPORT:!0,Zr();function Zr(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ae(r,e){if(Zr()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=h.prototype):(r===null&&(r=new h(e)),r.length=e),r}function h(r,e,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(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 hn(this,r)}return ia(this,r,e,t)}h.poolSize=8192,h._augment=function(r){return r.__proto__=h.prototype,r};function ia(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?Zf(r,e,t,n):typeof e=="string"?Kf(r,e,t):Jf(r,e)}h.from=function(r,e,t){return ia(null,r,e,t)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function aa(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 Yf(r,e,t,n){return aa(e),e<=0?ae(r,e):t!==void 0?typeof n=="string"?ae(r,e).fill(t,n):ae(r,e).fill(t):ae(r,e)}h.alloc=function(r,e,t){return Yf(null,r,e,t)};function hn(r,e){if(aa(e),r=ae(r,e<0?0:gn(e)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}h.allocUnsafe=function(r){return hn(null,r)},h.allocUnsafeSlow=function(r){return hn(null,r)};function Kf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=oa(e,t)|0;r=ae(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function yn(r,e){var t=e.length<0?0:gn(e.length)|0;r=ae(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Zf(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),h.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=h.prototype):r=yn(r,e),r}function Jf(r,e){if(J(e)){var t=gn(e.length)|0;return r=ae(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"||_c(e.length)?ae(r,0):yn(r,e);if(e.type==="Buffer"&&na(e.data))return yn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function gn(r){if(r>=Zr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zr().toString(16)+" bytes");return r|0}h.isBuffer=vc;function J(r){return!!(r!=null&&r._isBuffer)}h.compare=function(e,t){if(!J(e)||!J(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},h.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}},h.concat=function(e,t){if(!na(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return h.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=h.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!J(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function oa(r,e){if(J(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 et(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ya(r).length;default:if(n)return et(r).length;e=(""+e).toLowerCase(),n=!0}}h.byteLength=oa;function Qf(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 fc(this,e,t);case"utf8":case"utf-8":return ca(this,e,t);case"ascii":return uc(this,e,t);case"latin1":case"binary":return sc(this,e,t);case"base64":return ac(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}h.prototype._isBuffer=!0;function Oe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}h.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)Oe(this,t,t+1);return this},h.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)Oe(this,t,t+3),Oe(this,t+1,t+2);return this},h.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)Oe(this,t,t+7),Oe(this,t+1,t+6),Oe(this,t+2,t+5),Oe(this,t+3,t+4);return this},h.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?ca(this,0,e):Qf.apply(this,arguments)},h.prototype.equals=function(e){if(!J(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:h.compare(this,e)===0},h.prototype.inspect=function(){var e="",t=Xf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},h.prototype.compare=function(e,t,n,i,a){if(!J(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 ua(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=h.from(e,n)),J(e))return e.length===0?-1:sa(r,e,t,n,i);if(typeof e=="number")return e=e&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):sa(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function sa(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,w){return a===1?y[w]:y.readUInt16BE(w*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,d=0;d<u;d++)if(f(r,c+d)!==f(e,d)){s=!1;break}if(s)return c}return-1}h.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},h.prototype.indexOf=function(e,t,n){return ua(this,e,t,n,!0)},h.prototype.lastIndexOf=function(e,t,n){return ua(this,e,t,n,!1)};function ec(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 rc(r,e,t,n){return rt(et(e,r.length-t),r,t,n)}function fa(r,e,t,n){return rt(yc(e),r,t,n)}function tc(r,e,t,n){return fa(r,e,t,n)}function nc(r,e,t,n){return rt(ya(e),r,t,n)}function ic(r,e,t,n){return rt(gc(e,r.length-t),r,t,n)}h.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 ec(this,e,t,n);case"utf8":case"utf-8":return rc(this,e,t,n);case"ascii":return fa(this,e,t,n);case"latin1":case"binary":return tc(this,e,t,n);case"base64":return nc(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ic(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ac(r,e,t){return e===0&&t===r.length?ra(r):ra(r.slice(e,t))}function ca(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 oc(n)}var la=4096;function oc(r){var e=r.length;if(e<=la)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=la));return t}function uc(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 sc(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 fc(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+=hc(r[a]);return i}function cc(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}h.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(h.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=h.prototype;else{var a=t-e;i=new h(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function B(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")}h.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},h.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},h.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},h.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||B(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},h.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||B(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},h.prototype.readInt8=function(e,t){return t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},h.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},h.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},h.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!1,52,8)};function H(r,e,t,n,i,a){if(!J(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")}h.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;H(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},h.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;H(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},h.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Jr(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}h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2};function Qr(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}h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Qr(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(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},h.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(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},h.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Qr(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4};function da(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 pa(r,e,t,n,i){return i||da(r,e,t,4),ta(r,e,t,n,23,4),t+4}h.prototype.writeFloatLE=function(e,t,n){return pa(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return pa(this,e,t,!1,n)};function ha(r,e,t,n,i){return i||da(r,e,t,8),ta(r,e,t,n,52,8),t+8}h.prototype.writeDoubleLE=function(e,t,n){return ha(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return ha(this,e,t,!1,n)},h.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||!h.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},h.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"&&!h.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=J(e)?e:et(new h(e,i).toString()),f=u.length;for(o=0;o<n-t;++o)this[o+t]=u[o%f]}return this};var lc=/[^+\/0-9A-Za-z-_]/g;function dc(r){if(r=pc(r).replace(lc,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function pc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function hc(r){return r<16?"0"+r.toString(16):r.toString(16)}function et(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 yc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function gc(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 ya(r){return Gf(dc(r))}function rt(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 _c(r){return r!==r}function vc(r){return r!=null&&(!!r._isBuffer||ga(r)||mc(r))}function ga(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function mc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&ga(r.slice(0,0))}function _a(){throw new Error("setTimeout has not been defined")}function va(){throw new Error("clearTimeout has not been defined")}var le=_a,de=va;typeof He.setTimeout=="function"&&(le=setTimeout),typeof He.clearTimeout=="function"&&(de=clearTimeout);function ma(r){if(le===setTimeout)return setTimeout(r,0);if((le===_a||!le)&&setTimeout)return le=setTimeout,setTimeout(r,0);try{return le(r,0)}catch{try{return le.call(null,r,0)}catch{return le.call(this,r,0)}}}function wc(r){if(de===clearTimeout)return clearTimeout(r);if((de===va||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{return de(r)}catch{try{return de.call(null,r)}catch{return de.call(this,r)}}}var oe=[],We=!1,Ie,tt=-1;function bc(){!We||!Ie||(We=!1,Ie.length?oe=Ie.concat(oe):tt=-1,oe.length&&wa())}function wa(){if(!We){var r=ma(bc);We=!0;for(var e=oe.length;e;){for(Ie=oe,oe=[];++tt<e;)Ie&&Ie[tt].run();tt=-1,e=oe.length}Ie=null,We=!1,wc(r)}}function $c(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];oe.push(new ba(r,e)),oe.length===1&&!We&&ma(wa)}function ba(r,e){this.fun=r,this.array=e}ba.prototype.run=function(){this.fun.apply(null,this.array)};var Ec="browser",Sc="browser",Ac=!0,Oc={},Ic=[],xc="",Pc={},Tc={},Rc={};function xe(){}var Fc=xe,Mc=xe,Dc=xe,Cc=xe,Nc=xe,Bc=xe,Uc=xe;function qc(r){throw new Error("process.binding is not supported")}function Lc(){return"/"}function kc(r){throw new Error("process.chdir is not supported")}function jc(){return 0}var ze=He.performance||{},Vc=ze.now||ze.mozNow||ze.msNow||ze.oNow||ze.webkitNow||function(){return new Date().getTime()};function Gc(r){var e=Vc.call(ze)*.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 Hc=new Date;function Wc(){var r=new Date,e=r-Hc;return e/1e3}var Xe={nextTick:$c,title:Ec,browser:Ac,env:Oc,argv:Ic,version:xc,versions:Pc,on:Fc,addListener:Mc,once:Dc,off:Cc,removeListener:Nc,removeAllListeners:Bc,emit:Uc,binding:qc,cwd:Lc,chdir:kc,umask:jc,hrtime:Gc,platform:Sc,release:Tc,config:Rc,uptime:Wc},_n;typeof Object.create=="function"?_n=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:_n=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var $a=_n,Ea=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},zc=/%[sdj%]/g;function nt(r){if(!gr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Q(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(zc,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])yr(o)||!Pe(o)?a+=" "+o:a+=" "+Q(o);return a}function vn(r,e){if(ee(He.process))return function(){return vn(r,e).apply(this,arguments)};if(Xe.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Xe.throwDeprecation)throw new Error(e);Xe.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var it={},mn;function Sa(r){if(ee(mn)&&(mn=Xe.env.NODE_DEBUG||""),r=r.toUpperCase(),!it[r])if(new RegExp("\\b"+r+"\\b","i").test(mn)){var e=0;it[r]=function(){var t=nt.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else it[r]=function(){};return it[r]}function Q(r,e){var t={seen:[],stylize:Yc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ot(e)?t.showHidden=e:e&&On(t,e),ee(t.showHidden)&&(t.showHidden=!1),ee(t.depth)&&(t.depth=2),ee(t.colors)&&(t.colors=!1),ee(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Xc),at(t,r,t.depth)}Q.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]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Xc(r,e){var t=Q.styles[e];return t?"\x1B["+Q.colors[t][0]+"m"+r+"\x1B["+Q.colors[t][1]+"m":r}function Yc(r,e){return r}function Kc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function at(r,e,t){if(r.customInspect&&e&&mr(e.inspect)&&e.inspect!==Q&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return gr(n)||(n=at(r,n,t)),n}var i=Zc(r,e);if(i)return i;var a=Object.keys(e),o=Kc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),vr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return wn(e);if(a.length===0){if(mr(e)){var u=e.name?": "+e.name:"";return r.stylize("[Function"+u+"]","special")}if(_r(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(ut(e))return r.stylize(Date.prototype.toString.call(e),"date");if(vr(e))return wn(e)}var f="",c=!1,l=["{","}"];if($n(e)&&(c=!0,l=["[","]"]),mr(e)){var s=e.name?": "+e.name:"";f=" [Function"+s+"]"}if(_r(e)&&(f=" "+RegExp.prototype.toString.call(e)),ut(e)&&(f=" "+Date.prototype.toUTCString.call(e)),vr(e)&&(f=" "+wn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return _r(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var d;return c?d=Jc(r,e,t,o,a):d=a.map(function(y){return bn(r,e,t,o,y,c)}),r.seen.pop(),Qc(d,f,l)}function Zc(r,e){if(ee(e))return r.stylize("undefined","undefined");if(gr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(En(e))return r.stylize(""+e,"number");if(ot(e))return r.stylize(""+e,"boolean");if(yr(e))return r.stylize("null","null")}function wn(r){return"["+Error.prototype.toString.call(r)+"]"}function Jc(r,e,t,n,i){for(var a=[],o=0,u=e.length;o<u;++o)Ta(e,String(o))?a.push(bn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(bn(r,e,t,n,f,!0))}),a}function bn(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")),Ta(n,i)||(o="["+i+"]"),u||(r.seen.indexOf(f.value)<0?(yr(t)?u=at(r,f.value,null):u=at(r,f.value,t-1),u.indexOf(`
|
|
9
9
|
`)>-1&&(a?u=u.split(`
|
|
10
10
|
`).map(function(c){return" "+c}).join(`
|
|
11
11
|
`).substr(2):u=`
|
|
12
12
|
`+u.split(`
|
|
13
13
|
`).map(function(c){return" "+c}).join(`
|
|
14
|
-
`))):u=r.stylize("[Circular]","special")),
|
|
14
|
+
`))):u=r.stylize("[Circular]","special")),ee(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 Qc(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
|
|
15
15
|
`)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
|
|
16
16
|
`)+" "+r.join(`,
|
|
17
|
-
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function bn(r){return Array.isArray(r)}function ot(r){return typeof r=="boolean"}function pr(r){return r===null}function Ea(r){return r==null}function $n(r){return typeof r=="number"}function yr(r){return typeof r=="string"}function Aa(r){return typeof r=="symbol"}function Q(r){return r===void 0}function gr(r){return xe(r)&&En(r)==="[object RegExp]"}function xe(r){return typeof r=="object"&&r!==null}function ut(r){return xe(r)&&En(r)==="[object Date]"}function vr(r){return xe(r)&&(En(r)==="[object Error]"||r instanceof Error)}function _r(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 Oa(r){return p.isBuffer(r)}function En(r){return Object.prototype.toString.call(r)}function An(r){return r<10?"0"+r.toString(10):r.toString(10)}var Xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zc(){var r=new Date,e=[An(r.getHours()),An(r.getMinutes()),An(r.getSeconds())].join(":");return[r.getDate(),Xc[r.getMonth()],e].join(" ")}function Ia(){console.log("%s - %s",zc(),nt.apply(null,arguments))}function Sn(r,e){if(!e||!xe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Pa(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Te=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function On(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Te&&r[Te]){var e=r[Te];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Te,{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)),Te&&Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,ba(r))}On.custom=Te;function Yc(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function xa(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){Xe.nextTick(o.bind(null,null,u))},function(u){Xe.nextTick(Yc.bind(null,u,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,ba(r)),e}var Kc={inherits:wa,_extend:Sn,log:Ia,isBuffer:Oa,isPrimitive:Sa,isFunction:_r,isError:vr,isDate:ut,isObject:xe,isRegExp:gr,isUndefined:Q,isSymbol:Aa,isString:yr,isNumber:$n,isNullOrUndefined:Ea,isNull:pr,isBoolean:ot,isArray:bn,inspect:J,deprecate:vn,format:nt,debuglog:$a,promisify:On,callbackify:xa},Zc=Object.freeze({__proto__:null,_extend:Sn,callbackify:xa,debuglog:$a,default:Kc,deprecate:vn,format:nt,inherits:wa,inspect:J,isArray:bn,isBoolean:ot,isBuffer:Oa,isDate:ut,isError:vr,isFunction:_r,isNull:pr,isNullOrUndefined:Ea,isNumber:$n,isObject:xe,isPrimitive:Sa,isRegExp:gr,isString:yr,isSymbol:Aa,isUndefined:Q,log:Ia,promisify:On}),Jc=Ys(Zc),Qc=Jc.inspect,In=typeof Map=="function"&&Map.prototype,Pn=Object.getOwnPropertyDescriptor&&In?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,st=In&&Pn&&typeof Pn.get=="function"?Pn.get:null,Ta=In&&Map.prototype.forEach,xn=typeof Set=="function"&&Set.prototype,Tn=Object.getOwnPropertyDescriptor&&xn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ft=xn&&Tn&&typeof Tn.get=="function"?Tn.get:null,Ra=xn&&Set.prototype.forEach,el=typeof WeakMap=="function"&&WeakMap.prototype,mr=el?WeakMap.prototype.has:null,rl=typeof WeakSet=="function"&&WeakSet.prototype,wr=rl?WeakSet.prototype.has:null,tl=typeof WeakRef=="function"&&WeakRef.prototype,Fa=tl?WeakRef.prototype.deref:null,nl=Boolean.prototype.valueOf,il=Object.prototype.toString,al=Function.prototype.toString,ol=String.prototype.match,Rn=String.prototype.slice,de=String.prototype.replace,ul=String.prototype.toUpperCase,Ma=String.prototype.toLowerCase,Da=RegExp.prototype.test,Ca=Array.prototype.concat,ee=Array.prototype.join,sl=Array.prototype.slice,Na=Math.floor,Fn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Mn=Object.getOwnPropertySymbols,Dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ze||"symbol")?Symbol.toStringTag:null,Ba=Object.prototype.propertyIsEnumerable,Ua=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function qa(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Na(-r):Na(r);if(n!==r){var i=String(n),a=Rn.call(e,i.length+1);return de.call(i,t,"$&_")+"."+de.call(de.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return de.call(e,t,"$&_")}var Cn=Qc,La=Cn.custom,ka=Ga(La)?La:null,fl=function r(e,t,n,i){var a=t||{};if(pe(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pe(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=pe(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(pe(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(pe(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 Wa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return u?qa(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return u?qa(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 Nn(e)?"[Array]":"[Object]";var s=Il(a,n);if(typeof i>"u")i=[];else if(Ha(i,e)>=0)return"[Circular]";function h(z,me,lr){if(me&&(i=sl.call(i),i.push(me)),lr){var we={depth:a.depth};return pe(a,"quoteStyle")&&(we.quoteStyle=a.quoteStyle),r(z,we,n+1,i)}return r(z,a,n+1,i)}if(typeof e=="function"&&!Va(e)){var y=_l(e),w=ct(e,h);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(w.length>0?" { "+ee.call(w,", ")+" }":"")}if(Ga(e)){var A=ze?de.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Dn.call(e);return typeof e=="object"&&!ze?br(A):A}if(Al(e)){for(var O="<"+Ma.call(String(e.nodeName)),b=e.attributes||[],E=0;E<b.length;E++)O+=" "+b[E].name+"="+ja(cl(b[E].value),"double",a);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Ma.call(String(e.nodeName))+">",O}if(Nn(e)){if(e.length===0)return"[]";var d=ct(e,h);return s&&!Ol(d)?"["+Un(d,s)+"]":"[ "+ee.call(d,", ")+" ]"}if(hl(e)){var I=ct(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!Ba.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(Ca.call("[cause]: "+h(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ka&&typeof e[ka]=="function"&&Cn)return Cn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ml(e)){var T=[];return Ta&&Ta.call(e,function(z,me){T.push(h(me,e,!0)+" => "+h(z,e))}),Xa("Map",st.call(e),T,s)}if($l(e)){var F=[];return Ra&&Ra.call(e,function(z){F.push(h(z,e))}),Xa("Set",ft.call(e),F,s)}if(wl(e))return Bn("WeakMap");if(El(e))return Bn("WeakSet");if(bl(e))return Bn("WeakRef");if(pl(e))return br(h(Number(e)));if(gl(e))return br(h(Fn.call(e)));if(yl(e))return br(nl.call(e));if(dl(e))return br(h(String(e)));if(!ll(e)&&!Va(e)){var m=ct(e,h),g=Ua?Ua(e)===Object.prototype:e instanceof Object||e.constructor===Object,v=e instanceof Object?"":"null prototype",S=!g&&L&&Object(e)===e&&L in e?Rn.call(ye(e),8,-1):v?"Object":"",P=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=P+(S||v?"["+ee.call(Ca.call([],S||[],v||[]),": ")+"] ":"");return m.length===0?M+"{}":s?M+"{"+Un(m,s)+"}":M+"{ "+ee.call(m,", ")+" }"}return String(e)};function ja(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function cl(r){return de.call(String(r),/"/g,""")}function Nn(r){return ye(r)==="[object Array]"&&(!L||!(typeof r=="object"&&L in r))}function ll(r){return ye(r)==="[object Date]"&&(!L||!(typeof r=="object"&&L in r))}function Va(r){return ye(r)==="[object RegExp]"&&(!L||!(typeof r=="object"&&L in r))}function hl(r){return ye(r)==="[object Error]"&&(!L||!(typeof r=="object"&&L in r))}function dl(r){return ye(r)==="[object String]"&&(!L||!(typeof r=="object"&&L in r))}function pl(r){return ye(r)==="[object Number]"&&(!L||!(typeof r=="object"&&L in r))}function yl(r){return ye(r)==="[object Boolean]"&&(!L||!(typeof r=="object"&&L in r))}function Ga(r){if(ze)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Dn)return!1;try{return Dn.call(r),!0}catch{}return!1}function gl(r){if(!r||typeof r!="object"||!Fn)return!1;try{return Fn.call(r),!0}catch{}return!1}var vl=Object.prototype.hasOwnProperty||function(r){return r in this};function pe(r,e){return vl.call(r,e)}function ye(r){return il.call(r)}function _l(r){if(r.name)return r.name;var e=ol.call(al.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Ha(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 ml(r){if(!st||!r||typeof r!="object")return!1;try{st.call(r);try{ft.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function wl(r){if(!mr||!r||typeof r!="object")return!1;try{mr.call(r,mr);try{wr.call(r,wr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function bl(r){if(!Fa||!r||typeof r!="object")return!1;try{return Fa.call(r),!0}catch{}return!1}function $l(r){if(!ft||!r||typeof r!="object")return!1;try{ft.call(r);try{st.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function El(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r,wr);try{mr.call(r,mr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Al(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Wa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Wa(Rn.call(r,0,e.maxStringLength),e)+n}var i=de.call(de.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Sl);return ja(i,"single",e)}function Sl(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":"")+ul.call(e.toString(16))}function br(r){return"Object("+r+")"}function Bn(r){return r+" { ? }"}function Xa(r,e,t,n){var i=n?Un(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function Ol(r){for(var e=0;e<r.length;e++)if(Ha(r[e],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
19
|
-
`+e.prev+e.base;return t+
|
|
20
|
-
`+e.prev}function ct(r,e){var t=Nn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=pe(r,i)?e(r[i],r):""}var a=typeof Mn=="function"?Mn(r):[],o;if(ze){o={};for(var u=0;u<a.length;u++)o["$"+a[u]]=a[u]}for(var f in r)pe(r,f)&&(t&&String(Number(f))===f&&f<r.length||ze&&o["$"+f]instanceof Symbol||(Da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof Mn=="function")for(var c=0;c<a.length;c++)Ba.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var qn=ln,Ye=Cf,Pl=fl,xl=qn("%TypeError%"),lt=qn("%WeakMap%",!0),ht=qn("%Map%",!0),Tl=Ye("WeakMap.prototype.get",!0),Rl=Ye("WeakMap.prototype.set",!0),Fl=Ye("WeakMap.prototype.has",!0),Ml=Ye("Map.prototype.get",!0),Dl=Ye("Map.prototype.set",!0),Cl=Ye("Map.prototype.has",!0),Ln=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},Nl=function(r,e){var t=Ln(r,e);return t&&t.value},Bl=function(r,e,t){var n=Ln(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Ul=function(r,e){return!!Ln(r,e)},ql=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xl("Side channel does not contain "+Pl(a))},get:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Tl(e,a)}else if(ht){if(t)return Ml(t,a)}else if(n)return Nl(n,a)},has:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Fl(e,a)}else if(ht){if(t)return Cl(t,a)}else if(n)return Ul(n,a);return!1},set:function(a,o){lt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new lt),Rl(e,a,o)):ht?(t||(t=new ht),Dl(t,a,o)):(n||(n={key:{},next:null}),Bl(n,a,o))}};return i},Ll=String.prototype.replace,kl=/%20/g,kn={RFC1738:"RFC1738",RFC3986:"RFC3986"},za={default:kn.RFC3986,formatters:{RFC1738:function(r){return Ll.call(r,kl,"+")},RFC3986:function(r){return String(r)}},RFC1738:kn.RFC1738,RFC3986:kn.RFC3986},jl=za,jn=Object.prototype.hasOwnProperty,Re=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Vl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Re(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ya=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},Gl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Re(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!jn.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 Re(e)&&!Re(t)&&(i=Ya(e,n)),Re(e)&&Re(t)?(t.forEach(function(a,o){if(jn.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 jn.call(a,o)?a[o]=r(a[o],u,n):a[o]=u,a},i)},Hl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Wl=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}},Xl=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===jl.RFC1738&&(c===40||c===41)){u+=o.charAt(f);continue}if(c<128){u=u+re[c];continue}if(c<2048){u=u+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){u=u+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),u+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return u},zl=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 Vl(t),e},Yl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Kl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Zl=function(e,t){return[].concat(e,t)},Jl=function(e,t){if(Re(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},Ql={arrayToObject:Ya,assign:Hl,combine:Zl,compact:zl,decode:Wl,encode:Xl,isBuffer:Kl,isRegExp:Yl,maybeMap:Jl,merge:Gl},Ka=ql,dt=Ql,$r=za,eh=Object.prototype.hasOwnProperty,Za={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ue=Array.isArray,rh=Array.prototype.push,Ja=function(r,e){rh.apply(r,ue(e)?e:[e])},th=Date.prototype.toISOString,Qa=$r.default,k={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:dt.encode,encodeValuesOnly:!1,format:Qa,formatter:$r.formatters[Qa],indices:!1,serializeDate:function(e){return th.call(e)},skipNulls:!1,strictNullHandling:!1},nh=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Vn={},ih=function r(e,t,n,i,a,o,u,f,c,l,s,h,y,w,A,O){for(var b=e,E=O,d=0,I=!1;(E=E.get(Vn))!==void 0&&!I;){var T=E.get(e);if(d+=1,typeof T<"u"){if(T===d)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Vn)>"u"&&(d=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=s(b):n==="comma"&&ue(b)&&(b=dt.maybeMap(b,function(we){return we instanceof Date?s(we):we})),b===null){if(a)return u&&!w?u(t,k.encoder,A,"key",h):t;b=""}if(nh(b)||dt.isBuffer(b)){if(u){var F=w?t:u(t,k.encoder,A,"key",h);return[y(F)+"="+y(u(b,k.encoder,A,"value",h))]}return[y(t)+"="+y(String(b))]}var m=[];if(typeof b>"u")return m;var g;if(n==="comma"&&ue(b))w&&u&&(b=dt.maybeMap(b,u)),g=[{value:b.length>0?b.join(",")||null:void 0}];else if(ue(f))g=f;else{var v=Object.keys(b);g=c?v.sort(c):v}for(var S=i&&ue(b)&&b.length===1?t+"[]":t,P=0;P<g.length;++P){var M=g[P],z=typeof M=="object"&&typeof M.value<"u"?M.value:b[M];if(!(o&&z===null)){var me=ue(b)?typeof n=="function"?n(S,M):S:S+(l?"."+M:"["+M+"]");O.set(e,d);var lr=Ka();lr.set(Vn,O),Ja(m,r(z,me,n,i,a,o,n==="comma"&&w&&ue(b)?null:u,f,c,l,s,h,y,w,A,lr))}}return m},ah=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=$r.default;if(typeof e.format<"u"){if(!eh.call($r.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=$r.formatters[n],a=k.filter;return(typeof e.filter=="function"||ue(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}},oh=function(r,e){var t=r,n=ah(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ue(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in Za?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var f=Za[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=Ka(),s=0;s<i.length;++s){var h=i[s];n.skipNulls&&t[h]===null||Ja(o,ih(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),w=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),y.length>0?w+y:""},uh=be(oh);let eo={storeIdentifier:"",environment:"prod"};function sh(r){eo=r}function W(){return eo}const fh=(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`}},ch=(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}},lh=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},hh="/tools/recurring";class Ke{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function dh(r){return uh(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function _(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Vi()}}async function pt(r,e,t={}){const n=W();return te(r,`${lh(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function $(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:u,environmentUri:f,storeIdentifier:c,loginRetryFn:l,__unstable_twoFactorRetryFn:s,appName:h,appVersion:y}=W();if(!c)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const w=o.apiToken;if(!w)throw new Error("No API token defined on session.");const A=fh(u,f),O={"X-Recharge-Access-Token":w,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...h?{"X-Recharge-Sdk-App-Name":h}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.48.0","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},b={shop_url:c,...n};try{return await te(r,`${A}${e}`,{id:t,query:b,data:i,headers:O})}catch(E){if(l&&E instanceof Ke&&E.status===401)return l().then(d=>{if(d)return te(r,`${A}${e}`,{id:t,query:b,data:i,headers:{...O,"X-Recharge-Access-Token":d.apiToken}});throw E});if(s&&E instanceof Ke&&E.status===423)return s().then(d=>{if(d)return te(r,`${A}${e}`,{id:t,query:b,data:i,headers:{...O,"X-Recharge-Access-Token":d.apiToken}});throw E});throw E}}async function Er(r,e,t={}){return te(r,`${hh}${e}`,t)}async function te(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,dh(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 c.status===502||c.status===504?new Ke("A gateway error occurred while making the request",c.status):l&&l.error?new Ke(l.error,c.status):l&&l.errors?new Ke(JSON.stringify(l.errors),c.status):new Ke("A connection error occurred while making the request");return l}function ph(r,e){return $("get","/addresses",{query:e},_(r,"listAddresses"))}async function yh(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await $("get","/addresses",{id:e,query:{include:t?.include}},_(r,"getAddress"));return n}async function gh(r,e){const{address:t}=await $("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},_(r,"createAddress"));return t}async function Gn(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await $("put","/addresses",{id:e,data:t,query:n},_(r,"updateAddress"));return i}async function vh(r,e,t,n){return Gn(_(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function _h(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return Gn(_(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function mh(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/addresses",{id:e},_(r,"deleteAddress"))}async function wh(r,e){const{address:t}=await $("post","/addresses/merge",{data:e},_(r,"mergeAddresses"));return t}async function bh(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("post",`/addresses/${e}/charges/skip`,{data:t},_(r,"skipFutureCharge"));return n}var $h=Object.freeze({__proto__:null,applyDiscountToAddress:vh,createAddress:gh,deleteAddress:mh,getAddress:yh,listAddresses:ph,mergeAddresses:wh,removeDiscountsFromAddress:_h,skipFutureCharge:bh,updateAddress:Gn});async function Eh(){const{storefrontAccessToken:r}=W(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Er("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Ah(r,e){return ro(r,e)}async function ro(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=W();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Ar("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function Sh(r){const{storeIdentifier:e}=W();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Ar("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function Oh(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=W();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Ar("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function Ih(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=W(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Er("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Ph(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=W();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Ar("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function xh(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=W(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Er("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 Th(){const{customerHash:r}=W(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(u=>u==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Rh(){const{customerHash:r,token:e}=Th(),{storeIdentifier:t}=W(),n=await Ar("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Ar(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:u,storefrontAccessToken:f,appName:c,appVersion:l}=W(),s=ch(o,u),h={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...c?{"X-Recharge-Sdk-App-Name":c}:{},...l?{"X-Recharge-Sdk-App-Version":l}:{},"X-Recharge-Sdk-Version":"1.48.0",...a||{}};return te(r,`${s}${e}`,{id:t,query:n,data:i,headers:h})}var Fh=Object.freeze({__proto__:null,loginCustomerPortal:Rh,loginShopifyApi:Ah,loginShopifyAppProxy:Eh,loginWithShopifyCustomerAccount:Sh,loginWithShopifyStorefront:ro,sendPasswordlessCode:Oh,sendPasswordlessCodeAppProxy:Ih,validatePasswordlessCode:Ph,validatePasswordlessCodeAppProxy:xh}),to={},Hn={},se={},Mh=typeof U=="object"&&U&&U.Object===Object&&U,no=Mh,Dh=no,Ch=typeof self=="object"&&self&&self.Object===Object&&self,Nh=Dh||Ch||Function("return this")(),fe=Nh,Bh=fe,Uh=Bh.Symbol,yt=Uh,io=yt,ao=Object.prototype,qh=ao.hasOwnProperty,Lh=ao.toString,Sr=io?io.toStringTag:void 0;function kh(r){var e=qh.call(r,Sr),t=r[Sr];try{r[Sr]=void 0;var n=!0}catch{}var i=Lh.call(r);return n&&(e?r[Sr]=t:delete r[Sr]),i}var jh=kh,Vh=Object.prototype,Gh=Vh.toString;function Hh(r){return Gh.call(r)}var Wh=Hh,oo=yt,Xh=jh,zh=Wh,Yh="[object Null]",Kh="[object Undefined]",uo=oo?oo.toStringTag:void 0;function Zh(r){return r==null?r===void 0?Kh:Yh:uo&&uo in Object(r)?Xh(r):zh(r)}var ge=Zh;function Jh(r){return r!=null&&typeof r=="object"}var ve=Jh,Qh=ge,ed=ve,rd="[object Number]";function td(r){return typeof r=="number"||ed(r)&&Qh(r)==rd}var gt=td,D={};function nd(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Ze=nd,id=ge,ad=Ze,od="[object AsyncFunction]",ud="[object Function]",sd="[object GeneratorFunction]",fd="[object Proxy]";function cd(r){if(!ad(r))return!1;var e=id(r);return e==ud||e==sd||e==od||e==fd}var Wn=cd,ld=fe,hd=ld["__core-js_shared__"],dd=hd,Xn=dd,so=function(){var r=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function pd(r){return!!so&&so in r}var yd=pd,gd=Function.prototype,vd=gd.toString;function _d(r){if(r!=null){try{return vd.call(r)}catch{}try{return r+""}catch{}}return""}var fo=_d,md=Wn,wd=yd,bd=Ze,$d=fo,Ed=/[\\^$.*+?()[\]{}|]/g,Ad=/^\[object .+?Constructor\]$/,Sd=Function.prototype,Od=Object.prototype,Id=Sd.toString,Pd=Od.hasOwnProperty,xd=RegExp("^"+Id.call(Pd).replace(Ed,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Td(r){if(!bd(r)||wd(r))return!1;var e=md(r)?xd:Ad;return e.test($d(r))}var Rd=Td;function Fd(r,e){return r?.[e]}var Md=Fd,Dd=Rd,Cd=Md;function Nd(r,e){var t=Cd(r,e);return Dd(t)?t:void 0}var Fe=Nd,Bd=Fe,Ud=function(){try{var r=Bd(Object,"defineProperty");return r({},"",{}),r}catch{}}(),co=Ud,lo=co;function qd(r,e,t){e=="__proto__"&&lo?lo(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var ho=qd;function Ld(r,e){return r===e||r!==r&&e!==e}var vt=Ld,kd=ho,jd=vt,Vd=Object.prototype,Gd=Vd.hasOwnProperty;function Hd(r,e,t){var n=r[e];(!(Gd.call(r,e)&&jd(n,t))||t===void 0&&!(e in r))&&kd(r,e,t)}var Wd=Hd,Xd=Wd,zd=ho;function Yd(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?zd(t,u,f):Xd(t,u,f)}return t}var Kd=Yd;function Zd(r){return r}var _t=Zd;function Jd(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 Qd=Jd,ep=Qd,po=Math.max;function rp(r,e,t){return e=po(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=po(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),ep(r,this,u)}}var tp=rp;function np(r){return function(){return r}}var ip=np,ap=ip,yo=co,op=_t,up=yo?function(r,e){return yo(r,"toString",{configurable:!0,enumerable:!1,value:ap(e),writable:!0})}:op,sp=up,fp=800,cp=16,lp=Date.now;function hp(r){var e=0,t=0;return function(){var n=lp(),i=cp-(n-t);if(t=n,i>0){if(++e>=fp)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var dp=hp,pp=sp,yp=dp,gp=yp(pp),vp=gp,_p=_t,mp=tp,wp=vp;function bp(r,e){return wp(mp(r,e,_p),r+"")}var $p=bp,Ep=9007199254740991;function Ap(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ep}var zn=Ap,Sp=Wn,Op=zn;function Ip(r){return r!=null&&Op(r.length)&&!Sp(r)}var Or=Ip,Pp=9007199254740991,xp=/^(?:0|[1-9]\d*)$/;function Tp(r,e){var t=typeof r;return e=e??Pp,!!e&&(t=="number"||t!="symbol"&&xp.test(r))&&r>-1&&r%1==0&&r<e}var Yn=Tp,Rp=vt,Fp=Or,Mp=Yn,Dp=Ze;function Cp(r,e,t){if(!Dp(t))return!1;var n=typeof e;return(n=="number"?Fp(t)&&Mp(e,t.length):n=="string"&&e in t)?Rp(t[e],r):!1}var go=Cp,Np=$p,Bp=go;function Up(r){return Np(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&&Bp(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 qp=Up;function Lp(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var vo=Lp,kp=ge,jp=ve,Vp="[object Arguments]";function Gp(r){return jp(r)&&kp(r)==Vp}var Hp=Gp,_o=Hp,Wp=ve,mo=Object.prototype,Xp=mo.hasOwnProperty,zp=mo.propertyIsEnumerable,Yp=_o(function(){return arguments}())?_o:function(r){return Wp(r)&&Xp.call(r,"callee")&&!zp.call(r,"callee")},wo=Yp,Kp=Array.isArray,V=Kp,mt={exports:{}};function Zp(){return!1}var Jp=Zp;mt.exports,function(r,e){var t=fe,n=Jp,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}(mt,mt.exports);var bo=mt.exports,Qp=ge,ey=zn,ry=ve,ty="[object Arguments]",ny="[object Array]",iy="[object Boolean]",ay="[object Date]",oy="[object Error]",uy="[object Function]",sy="[object Map]",fy="[object Number]",cy="[object Object]",ly="[object RegExp]",hy="[object Set]",dy="[object String]",py="[object WeakMap]",yy="[object ArrayBuffer]",gy="[object DataView]",vy="[object Float32Array]",_y="[object Float64Array]",my="[object Int8Array]",wy="[object Int16Array]",by="[object Int32Array]",$y="[object Uint8Array]",Ey="[object Uint8ClampedArray]",Ay="[object Uint16Array]",Sy="[object Uint32Array]",R={};R[vy]=R[_y]=R[my]=R[wy]=R[by]=R[$y]=R[Ey]=R[Ay]=R[Sy]=!0,R[ty]=R[ny]=R[yy]=R[iy]=R[gy]=R[ay]=R[oy]=R[uy]=R[sy]=R[fy]=R[cy]=R[ly]=R[hy]=R[dy]=R[py]=!1;function Oy(r){return ry(r)&&ey(r.length)&&!!R[Qp(r)]}var Iy=Oy;function Py(r){return function(e){return r(e)}}var xy=Py,wt={exports:{}};wt.exports,function(r,e){var t=no,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}(wt,wt.exports);var Ty=wt.exports,Ry=Iy,Fy=xy,$o=Ty,Eo=$o&&$o.isTypedArray,My=Eo?Fy(Eo):Ry,Ao=My,Dy=vo,Cy=wo,Ny=V,By=bo,Uy=Yn,qy=Ao,Ly=Object.prototype,ky=Ly.hasOwnProperty;function jy(r,e){var t=Ny(r),n=!t&&Cy(r),i=!t&&!n&&By(r),a=!t&&!n&&!i&&qy(r),o=t||n||i||a,u=o?Dy(r.length,String):[],f=u.length;for(var c in r)(e||ky.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Uy(c,f)))&&u.push(c);return u}var So=jy,Vy=Object.prototype;function Gy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Vy;return r===t}var Oo=Gy;function Hy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Wy=Hy,Xy=Ze,zy=Oo,Yy=Wy,Ky=Object.prototype,Zy=Ky.hasOwnProperty;function Jy(r){if(!Xy(r))return Yy(r);var e=zy(r),t=[];for(var n in r)n=="constructor"&&(e||!Zy.call(r,n))||t.push(n);return t}var Qy=Jy,eg=So,rg=Qy,tg=Or;function ng(r){return tg(r)?eg(r,!0):rg(r)}var ig=ng,ag=Kd,og=qp,ug=ig,sg=og(function(r,e){ag(e,ug(e),r)}),fg=sg,cg=fg,bt={},Me={};function lg(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 hg=lg;function dg(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 pg=dg,yg=pg,gg=yg(),vg=gg;function _g(r,e){return function(t){return r(e(t))}}var mg=_g,wg=mg,bg=wg(Object.keys,Object),$g=bg,Eg=Oo,Ag=$g,Sg=Object.prototype,Og=Sg.hasOwnProperty;function Ig(r){if(!Eg(r))return Ag(r);var e=[];for(var t in Object(r))Og.call(r,t)&&t!="constructor"&&e.push(t);return e}var Pg=Ig,xg=So,Tg=Pg,Rg=Or;function Fg(r){return Rg(r)?xg(r):Tg(r)}var $t=Fg,Mg=vg,Dg=$t;function Cg(r,e){return r&&Mg(r,e,Dg)}var Ng=Cg,Bg=Or;function Ug(r,e){return function(t,n){if(t==null)return t;if(!Bg(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 qg=Ug,Lg=Ng,kg=qg,jg=kg(Lg),Kn=jg,Vg=Kn;function Gg(r,e){var t=!0;return Vg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Hg=Gg;function Wg(){this.__data__=[],this.size=0}var Xg=Wg,zg=vt;function Yg(r,e){for(var t=r.length;t--;)if(zg(r[t][0],e))return t;return-1}var Et=Yg,Kg=Et,Zg=Array.prototype,Jg=Zg.splice;function Qg(r){var e=this.__data__,t=Kg(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Jg.call(e,t,1),--this.size,!0}var ev=Qg,rv=Et;function tv(r){var e=this.__data__,t=rv(e,r);return t<0?void 0:e[t][1]}var nv=tv,iv=Et;function av(r){return iv(this.__data__,r)>-1}var ov=av,uv=Et;function sv(r,e){var t=this.__data__,n=uv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var fv=sv,cv=Xg,lv=ev,hv=nv,dv=ov,pv=fv;function Je(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])}}Je.prototype.clear=cv,Je.prototype.delete=lv,Je.prototype.get=hv,Je.prototype.has=dv,Je.prototype.set=pv;var At=Je,yv=At;function gv(){this.__data__=new yv,this.size=0}var vv=gv;function _v(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var mv=_v;function wv(r){return this.__data__.get(r)}var bv=wv;function $v(r){return this.__data__.has(r)}var Ev=$v,Av=Fe,Sv=fe,Ov=Av(Sv,"Map"),Zn=Ov,Iv=Fe,Pv=Iv(Object,"create"),St=Pv,Io=St;function xv(){this.__data__=Io?Io(null):{},this.size=0}var Tv=xv;function Rv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Fv=Rv,Mv=St,Dv="__lodash_hash_undefined__",Cv=Object.prototype,Nv=Cv.hasOwnProperty;function Bv(r){var e=this.__data__;if(Mv){var t=e[r];return t===Dv?void 0:t}return Nv.call(e,r)?e[r]:void 0}var Uv=Bv,qv=St,Lv=Object.prototype,kv=Lv.hasOwnProperty;function jv(r){var e=this.__data__;return qv?e[r]!==void 0:kv.call(e,r)}var Vv=jv,Gv=St,Hv="__lodash_hash_undefined__";function Wv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Gv&&e===void 0?Hv:e,this}var Xv=Wv,zv=Tv,Yv=Fv,Kv=Uv,Zv=Vv,Jv=Xv;function Qe(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])}}Qe.prototype.clear=zv,Qe.prototype.delete=Yv,Qe.prototype.get=Kv,Qe.prototype.has=Zv,Qe.prototype.set=Jv;var Qv=Qe,Po=Qv,e_=At,r_=Zn;function t_(){this.size=0,this.__data__={hash:new Po,map:new(r_||e_),string:new Po}}var n_=t_;function i_(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var a_=i_,o_=a_;function u_(r,e){var t=r.__data__;return o_(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Ot=u_,s_=Ot;function f_(r){var e=s_(this,r).delete(r);return this.size-=e?1:0,e}var c_=f_,l_=Ot;function h_(r){return l_(this,r).get(r)}var d_=h_,p_=Ot;function y_(r){return p_(this,r).has(r)}var g_=y_,v_=Ot;function __(r,e){var t=v_(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var m_=__,w_=n_,b_=c_,$_=d_,E_=g_,A_=m_;function er(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])}}er.prototype.clear=w_,er.prototype.delete=b_,er.prototype.get=$_,er.prototype.has=E_,er.prototype.set=A_;var Jn=er,S_=At,O_=Zn,I_=Jn,P_=200;function x_(r,e){var t=this.__data__;if(t instanceof S_){var n=t.__data__;if(!O_||n.length<P_-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new I_(n)}return t.set(r,e),this.size=t.size,this}var T_=x_,R_=At,F_=vv,M_=mv,D_=bv,C_=Ev,N_=T_;function rr(r){var e=this.__data__=new R_(r);this.size=e.size}rr.prototype.clear=F_,rr.prototype.delete=M_,rr.prototype.get=D_,rr.prototype.has=C_,rr.prototype.set=N_;var xo=rr,B_="__lodash_hash_undefined__";function U_(r){return this.__data__.set(r,B_),this}var q_=U_;function L_(r){return this.__data__.has(r)}var k_=L_,j_=Jn,V_=q_,G_=k_;function It(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new j_;++e<t;)this.add(r[e])}It.prototype.add=It.prototype.push=V_,It.prototype.has=G_;var H_=It;function W_(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 X_=W_;function z_(r,e){return r.has(e)}var Y_=z_,K_=H_,Z_=X_,J_=Y_,Q_=1,em=2;function rm(r,e,t,n,i,a){var o=t&Q_,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&em?new K_:void 0;for(a.set(r,e),a.set(e,r);++s<u;){var w=r[s],A=e[s];if(n)var O=o?n(A,w,s,e,r,a):n(w,A,s,r,e,a);if(O!==void 0){if(O)continue;h=!1;break}if(y){if(!Z_(e,function(b,E){if(!J_(y,E)&&(w===b||i(w,b,t,n,a)))return y.push(E)})){h=!1;break}}else if(!(w===A||i(w,A,t,n,a))){h=!1;break}}return a.delete(r),a.delete(e),h}var To=rm,tm=fe,nm=tm.Uint8Array,im=nm;function am(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var om=am;function um(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var sm=um,Ro=yt,Fo=im,fm=vt,cm=To,lm=om,hm=sm,dm=1,pm=2,ym="[object Boolean]",gm="[object Date]",vm="[object Error]",_m="[object Map]",mm="[object Number]",wm="[object RegExp]",bm="[object Set]",$m="[object String]",Em="[object Symbol]",Am="[object ArrayBuffer]",Sm="[object DataView]",Mo=Ro?Ro.prototype:void 0,Qn=Mo?Mo.valueOf:void 0;function Om(r,e,t,n,i,a,o){switch(t){case Sm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Am:return!(r.byteLength!=e.byteLength||!a(new Fo(r),new Fo(e)));case ym:case gm:case mm:return fm(+r,+e);case vm:return r.name==e.name&&r.message==e.message;case wm:case $m:return r==e+"";case _m:var u=lm;case bm:var f=n&dm;if(u||(u=hm),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=pm,o.set(r,e);var l=cm(u(r),u(e),n,i,a,o);return o.delete(r),l;case Em:if(Qn)return Qn.call(r)==Qn.call(e)}return!1}var Im=Om;function Pm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var xm=Pm,Tm=xm,Rm=V;function Fm(r,e,t){var n=e(r);return Rm(r)?n:Tm(n,t(r))}var Mm=Fm;function Dm(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=Dm;function Nm(){return[]}var Bm=Nm,Um=Cm,qm=Bm,Lm=Object.prototype,km=Lm.propertyIsEnumerable,Do=Object.getOwnPropertySymbols,jm=Do?function(r){return r==null?[]:(r=Object(r),Um(Do(r),function(e){return km.call(r,e)}))}:qm,Vm=jm,Gm=Mm,Hm=Vm,Wm=$t;function Xm(r){return Gm(r,Wm,Hm)}var zm=Xm,Co=zm,Ym=1,Km=Object.prototype,Zm=Km.hasOwnProperty;function Jm(r,e,t,n,i,a){var o=t&Ym,u=Co(r),f=u.length,c=Co(e),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var h=u[s];if(!(o?h in e:Zm.call(e,h)))return!1}var y=a.get(r),w=a.get(e);if(y&&w)return y==e&&w==r;var A=!0;a.set(r,e),a.set(e,r);for(var O=o;++s<f;){h=u[s];var b=r[h],E=e[h];if(n)var d=o?n(E,b,h,e,r,a):n(b,E,h,r,e,a);if(!(d===void 0?b===E||i(b,E,t,n,a):d)){A=!1;break}O||(O=h=="constructor")}if(A&&!O){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(A=!1)}return a.delete(r),a.delete(e),A}var Qm=Jm,ew=Fe,rw=fe,tw=ew(rw,"DataView"),nw=tw,iw=Fe,aw=fe,ow=iw(aw,"Promise"),uw=ow,sw=Fe,fw=fe,cw=sw(fw,"Set"),lw=cw,hw=Fe,dw=fe,pw=hw(dw,"WeakMap"),yw=pw,ei=nw,ri=Zn,ti=uw,ni=lw,ii=yw,No=ge,tr=fo,Bo="[object Map]",gw="[object Object]",Uo="[object Promise]",qo="[object Set]",Lo="[object WeakMap]",ko="[object DataView]",vw=tr(ei),_w=tr(ri),mw=tr(ti),ww=tr(ni),bw=tr(ii),De=No;(ei&&De(new ei(new ArrayBuffer(1)))!=ko||ri&&De(new ri)!=Bo||ti&&De(ti.resolve())!=Uo||ni&&De(new ni)!=qo||ii&&De(new ii)!=Lo)&&(De=function(r){var e=No(r),t=e==gw?r.constructor:void 0,n=t?tr(t):"";if(n)switch(n){case vw:return ko;case _w:return Bo;case mw:return Uo;case ww:return qo;case bw:return Lo}return e});var $w=De,ai=xo,Ew=To,Aw=Im,Sw=Qm,jo=$w,Vo=V,Go=bo,Ow=Ao,Iw=1,Ho="[object Arguments]",Wo="[object Array]",Pt="[object Object]",Pw=Object.prototype,Xo=Pw.hasOwnProperty;function xw(r,e,t,n,i,a){var o=Vo(r),u=Vo(e),f=o?Wo:jo(r),c=u?Wo:jo(e);f=f==Ho?Pt:f,c=c==Ho?Pt:c;var l=f==Pt,s=c==Pt,h=f==c;if(h&&Go(r)){if(!Go(e))return!1;o=!0,l=!1}if(h&&!l)return a||(a=new ai),o||Ow(r)?Ew(r,e,t,n,i,a):Aw(r,e,f,t,n,i,a);if(!(t&Iw)){var y=l&&Xo.call(r,"__wrapped__"),w=s&&Xo.call(e,"__wrapped__");if(y||w){var A=y?r.value():r,O=w?e.value():e;return a||(a=new ai),i(A,O,t,n,a)}}return h?(a||(a=new ai),Sw(r,e,t,n,i,a)):!1}var Tw=xw,Rw=Tw,zo=ve;function Yo(r,e,t,n,i){return r===e?!0:r==null||e==null||!zo(r)&&!zo(e)?r!==r&&e!==e:Rw(r,e,t,n,Yo,i)}var Ko=Yo,Fw=xo,Mw=Ko,Dw=1,Cw=2;function Nw(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 Fw;if(n)var h=n(c,l,f,r,e,s);if(!(h===void 0?Mw(l,c,Dw|Cw,n,s):h))return!1}}return!0}var Bw=Nw,Uw=Ze;function qw(r){return r===r&&!Uw(r)}var Zo=qw,Lw=Zo,kw=$t;function jw(r){for(var e=kw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Lw(i)]}return e}var Vw=jw;function Gw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Jo=Gw,Hw=Bw,Ww=Vw,Xw=Jo;function zw(r){var e=Ww(r);return e.length==1&&e[0][2]?Xw(e[0][0],e[0][1]):function(t){return t===r||Hw(t,r,e)}}var Yw=zw,Kw=ge,Zw=ve,Jw="[object Symbol]";function Qw(r){return typeof r=="symbol"||Zw(r)&&Kw(r)==Jw}var xt=Qw,e0=V,r0=xt,t0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n0=/^\w*$/;function i0(r,e){if(e0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||r0(r)?!0:n0.test(r)||!t0.test(r)||e!=null&&r in Object(e)}var oi=i0,Qo=Jn,a0="Expected a function";function ui(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(a0);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(ui.Cache||Qo),t}ui.Cache=Qo;var o0=ui,u0=o0,s0=500;function f0(r){var e=u0(r,function(n){return t.size===s0&&t.clear(),n}),t=e.cache;return e}var c0=f0,l0=c0,h0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d0=/\\(\\)?/g,p0=l0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(h0,function(t,n,i,a){e.push(i?a.replace(d0,"$1"):n||t)}),e}),y0=p0;function g0(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 si=g0,eu=yt,v0=si,_0=V,m0=xt,w0=1/0,ru=eu?eu.prototype:void 0,tu=ru?ru.toString:void 0;function nu(r){if(typeof r=="string")return r;if(_0(r))return v0(r,nu)+"";if(m0(r))return tu?tu.call(r):"";var e=r+"";return e=="0"&&1/r==-w0?"-0":e}var b0=nu,$0=b0;function E0(r){return r==null?"":$0(r)}var A0=E0,S0=V,O0=oi,I0=y0,P0=A0;function x0(r,e){return S0(r)?r:O0(r,e)?[r]:I0(P0(r))}var iu=x0,T0=xt,R0=1/0;function F0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-R0?"-0":e}var Tt=F0,M0=iu,D0=Tt;function C0(r,e){e=M0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[D0(e[t++])];return t&&t==n?r:void 0}var au=C0,N0=au;function B0(r,e,t){var n=r==null?void 0:N0(r,e);return n===void 0?t:n}var U0=B0;function q0(r,e){return r!=null&&e in Object(r)}var L0=q0,k0=iu,j0=wo,V0=V,G0=Yn,H0=zn,W0=Tt;function X0(r,e,t){e=k0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=W0(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&&H0(i)&&G0(o,i)&&(V0(r)||j0(r)))}var z0=X0,Y0=L0,K0=z0;function Z0(r,e){return r!=null&&K0(r,e,Y0)}var J0=Z0,Q0=Ko,eb=U0,rb=J0,tb=oi,nb=Zo,ib=Jo,ab=Tt,ob=1,ub=2;function sb(r,e){return tb(r)&&nb(e)?ib(ab(r),e):function(t){var n=eb(t,r);return n===void 0&&n===e?rb(t,r):Q0(e,n,ob|ub)}}var fb=sb;function cb(r){return function(e){return e?.[r]}}var lb=cb,hb=au;function db(r){return function(e){return hb(e,r)}}var pb=db,yb=lb,gb=pb,vb=oi,_b=Tt;function mb(r){return vb(r)?yb(_b(r)):gb(r)}var wb=mb,bb=Yw,$b=fb,Eb=_t,Ab=V,Sb=wb;function Ob(r){return typeof r=="function"?r:r==null?Eb:typeof r=="object"?Ab(r)?$b(r[0],r[1]):bb(r):Sb(r)}var ou=Ob,Ib=hg,Pb=Hg,xb=ou,Tb=V,Rb=go;function Fb(r,e,t){var n=Tb(r)?Ib:Pb;return t&&Rb(r,e,t)&&(e=void 0),n(r,xb(e))}var fi=Fb;Object.defineProperty(Me,"__esModule",{value:!0}),Me.calculatePadding=Nb,Me.slicePadding=Bb;var Mb=fi,Db=Cb(Mb);function Cb(r){return r&&r.__esModule?r:{default:r}}function Nb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Bb(r,e){var t=r.slice(e),n=(0,Db.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(bt,"__esModule",{value:!0}),bt.Cursor=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}}(),qb=Me;function Lb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var ci=function(){function r(e){Lb(this,r),e instanceof p||(e=typeof e=="number"?p.alloc(e):p.from(e)),this._setBuffer(e),this.rewind()}return Ub(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 p?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=p.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,qb.calculatePadding)(t.length),i=p.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){ci.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){ci.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),bt.Cursor=ci,Object.defineProperty(D,"__esModule",{value:!0}),D.default=Xb;var kb=cg,uu=fu(kb),jb=Wn,Vb=fu(jb),su=bt;function fu(r){return r&&r.__esModule?r:{default:r}}var Gb=Math.pow(2,16),Hb={toXDR:function(e){var t=new su.Cursor(Gb);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=p.from(e,"hex");break;case"base64":n=p.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new su.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}}},Wb={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 Xb(r){(0,uu.default)(r,Hb),(0,Vb.default)(r)&&(0,uu.default)(r.prototype,Wb)}Object.defineProperty(se,"__esModule",{value:!0}),se.Int=void 0;var zb=gt,cu=lu(zb),Yb=D,Kb=lu(Yb);function lu(r){return r&&r.__esModule?r:{default:r}}var Ir=se.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,cu.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,cu.default)(e)||Math.floor(e)!==e?!1:e>=Ir.MIN_VALUE&&e<=Ir.MAX_VALUE}};Ir.MAX_VALUE=Math.pow(2,31)-1,Ir.MIN_VALUE=-Math.pow(2,31),(0,Kb.default)(Ir);var Rt={};function Zb(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 hu={exports:{}};(function(r){/**
|
|
17
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function $n(r){return Array.isArray(r)}function ot(r){return typeof r=="boolean"}function yr(r){return r===null}function Aa(r){return r==null}function En(r){return typeof r=="number"}function gr(r){return typeof r=="string"}function Oa(r){return typeof r=="symbol"}function ee(r){return r===void 0}function _r(r){return Pe(r)&&Sn(r)==="[object RegExp]"}function Pe(r){return typeof r=="object"&&r!==null}function ut(r){return Pe(r)&&Sn(r)==="[object Date]"}function vr(r){return Pe(r)&&(Sn(r)==="[object Error]"||r instanceof Error)}function mr(r){return typeof r=="function"}function Ia(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function xa(r){return h.isBuffer(r)}function Sn(r){return Object.prototype.toString.call(r)}function An(r){return r<10?"0"+r.toString(10):r.toString(10)}var el=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function rl(){var r=new Date,e=[An(r.getHours()),An(r.getMinutes()),An(r.getSeconds())].join(":");return[r.getDate(),el[r.getMonth()],e].join(" ")}function Pa(){console.log("%s - %s",rl(),nt.apply(null,arguments))}function On(r,e){if(!e||!Pe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Ta(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Te=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function In(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Te&&r[Te]){var e=r[Te];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Te,{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)),Te&&Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,Ea(r))}In.custom=Te;function tl(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function Ra(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){Xe.nextTick(o.bind(null,null,u))},function(u){Xe.nextTick(tl.bind(null,u,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,Ea(r)),e}var nl={inherits:$a,_extend:On,log:Pa,isBuffer:xa,isPrimitive:Ia,isFunction:mr,isError:vr,isDate:ut,isObject:Pe,isRegExp:_r,isUndefined:ee,isSymbol:Oa,isString:gr,isNumber:En,isNullOrUndefined:Aa,isNull:yr,isBoolean:ot,isArray:$n,inspect:Q,deprecate:vn,format:nt,debuglog:Sa,promisify:In,callbackify:Ra},il=Object.freeze({__proto__:null,_extend:On,callbackify:Ra,debuglog:Sa,default:nl,deprecate:vn,format:nt,inherits:$a,inspect:Q,isArray:$n,isBoolean:ot,isBuffer:xa,isDate:ut,isError:vr,isFunction:mr,isNull:yr,isNullOrUndefined:Aa,isNumber:En,isObject:Pe,isPrimitive:Ia,isRegExp:_r,isString:gr,isSymbol:Oa,isUndefined:ee,log:Pa,promisify:In}),al=tf(il),ol=al.inspect,xn=typeof Map=="function"&&Map.prototype,Pn=Object.getOwnPropertyDescriptor&&xn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,st=xn&&Pn&&typeof Pn.get=="function"?Pn.get:null,Fa=xn&&Map.prototype.forEach,Tn=typeof Set=="function"&&Set.prototype,Rn=Object.getOwnPropertyDescriptor&&Tn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ft=Tn&&Rn&&typeof Rn.get=="function"?Rn.get:null,Ma=Tn&&Set.prototype.forEach,ul=typeof WeakMap=="function"&&WeakMap.prototype,wr=ul?WeakMap.prototype.has:null,sl=typeof WeakSet=="function"&&WeakSet.prototype,br=sl?WeakSet.prototype.has:null,fl=typeof WeakRef=="function"&&WeakRef.prototype,Da=fl?WeakRef.prototype.deref:null,cl=Boolean.prototype.valueOf,ll=Object.prototype.toString,dl=Function.prototype.toString,pl=String.prototype.match,Fn=String.prototype.slice,pe=String.prototype.replace,hl=String.prototype.toUpperCase,Ca=String.prototype.toLowerCase,Na=RegExp.prototype.test,Ba=Array.prototype.concat,re=Array.prototype.join,yl=Array.prototype.slice,Ua=Math.floor,Mn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Dn=Object.getOwnPropertySymbols,Cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ye||"symbol")?Symbol.toStringTag:null,qa=Object.prototype.propertyIsEnumerable,La=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ka(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Na.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Ua(-r):Ua(r);if(n!==r){var i=String(n),a=Fn.call(e,i.length+1);return pe.call(i,t,"$&_")+"."+pe.call(pe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pe.call(e,t,"$&_")}var Nn=ol,ja=Nn.custom,Va=Wa(ja)?ja:null,gl=function r(e,t,n,i){var a=t||{};if(he(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(he(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=he(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(he(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(he(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 Xa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return u?ka(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return u?ka(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 Bn(e)?"[Array]":"[Object]";var s=Dl(a,n);if(typeof i>"u")i=[];else if(za(i,e)>=0)return"[Circular]";function d(Y,me,dr){if(me&&(i=yl.call(i),i.push(me)),dr){var we={depth:a.depth};return he(a,"quoteStyle")&&(we.quoteStyle=a.quoteStyle),r(Y,we,n+1,i)}return r(Y,a,n+1,i)}if(typeof e=="function"&&!Ha(e)){var y=Al(e),w=ct(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(w.length>0?" { "+re.call(w,", ")+" }":"")}if(Wa(e)){var S=Ye?pe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cn.call(e);return typeof e=="object"&&!Ye?$r(S):S}if(Rl(e)){for(var O="<"+Ca.call(String(e.nodeName)),b=e.attributes||[],E=0;E<b.length;E++)O+=" "+b[E].name+"="+Ga(_l(b[E].value),"double",a);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Ca.call(String(e.nodeName))+">",O}if(Bn(e)){if(e.length===0)return"[]";var p=ct(e,d);return s&&!Ml(p)?"["+qn(p,s)+"]":"[ "+re.call(p,", ")+" ]"}if(ml(e)){var I=ct(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!qa.call(e,"cause")?"{ ["+String(e)+"] "+re.call(Ba.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+re.call(I,", ")+" }"}if(typeof e=="object"&&o){if(Va&&typeof e[Va]=="function"&&Nn)return Nn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ol(e)){var T=[];return Fa&&Fa.call(e,function(Y,me){T.push(d(me,e,!0)+" => "+d(Y,e))}),Ya("Map",st.call(e),T,s)}if(Pl(e)){var F=[];return Ma&&Ma.call(e,function(Y){F.push(d(Y,e))}),Ya("Set",ft.call(e),F,s)}if(Il(e))return Un("WeakMap");if(Tl(e))return Un("WeakSet");if(xl(e))return Un("WeakRef");if(bl(e))return $r(d(Number(e)));if(El(e))return $r(d(Mn.call(e)));if($l(e))return $r(cl.call(e));if(wl(e))return $r(d(String(e)));if(!vl(e)&&!Ha(e)){var m=ct(e,d),g=La?La(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",A=!g&&L&&Object(e)===e&&L in e?Fn.call(ye(e),8,-1):_?"Object":"",x=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=x+(A||_?"["+re.call(Ba.call([],A||[],_||[]),": ")+"] ":"");return m.length===0?M+"{}":s?M+"{"+qn(m,s)+"}":M+"{ "+re.call(m,", ")+" }"}return String(e)};function Ga(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function _l(r){return pe.call(String(r),/"/g,""")}function Bn(r){return ye(r)==="[object Array]"&&(!L||!(typeof r=="object"&&L in r))}function vl(r){return ye(r)==="[object Date]"&&(!L||!(typeof r=="object"&&L in r))}function Ha(r){return ye(r)==="[object RegExp]"&&(!L||!(typeof r=="object"&&L in r))}function ml(r){return ye(r)==="[object Error]"&&(!L||!(typeof r=="object"&&L in r))}function wl(r){return ye(r)==="[object String]"&&(!L||!(typeof r=="object"&&L in r))}function bl(r){return ye(r)==="[object Number]"&&(!L||!(typeof r=="object"&&L in r))}function $l(r){return ye(r)==="[object Boolean]"&&(!L||!(typeof r=="object"&&L in r))}function Wa(r){if(Ye)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Cn)return!1;try{return Cn.call(r),!0}catch{}return!1}function El(r){if(!r||typeof r!="object"||!Mn)return!1;try{return Mn.call(r),!0}catch{}return!1}var Sl=Object.prototype.hasOwnProperty||function(r){return r in this};function he(r,e){return Sl.call(r,e)}function ye(r){return ll.call(r)}function Al(r){if(r.name)return r.name;var e=pl.call(dl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function za(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 Ol(r){if(!st||!r||typeof r!="object")return!1;try{st.call(r);try{ft.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Il(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r,wr);try{br.call(r,br)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function xl(r){if(!Da||!r||typeof r!="object")return!1;try{return Da.call(r),!0}catch{}return!1}function Pl(r){if(!ft||!r||typeof r!="object")return!1;try{ft.call(r);try{st.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Tl(r){if(!br||!r||typeof r!="object")return!1;try{br.call(r,br);try{wr.call(r,wr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Rl(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Xa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Xa(Fn.call(r,0,e.maxStringLength),e)+n}var i=pe.call(pe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Fl);return Ga(i,"single",e)}function Fl(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":"")+hl.call(e.toString(16))}function $r(r){return"Object("+r+")"}function Un(r){return r+" { ? }"}function Ya(r,e,t,n){var i=n?qn(t,n):re.call(t,", ");return r+" ("+e+") {"+i+"}"}function Ml(r){for(var e=0;e<r.length;e++)if(za(r[e],`
|
|
18
|
+
`)>=0)return!1;return!0}function Dl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=re.call(Array(r.indent+1)," ");else return null;return{base:t,prev:re.call(Array(e+1),t)}}function qn(r,e){if(r.length===0)return"";var t=`
|
|
19
|
+
`+e.prev+e.base;return t+re.call(r,","+t)+`
|
|
20
|
+
`+e.prev}function ct(r,e){var t=Bn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=he(r,i)?e(r[i],r):""}var a=typeof Dn=="function"?Dn(r):[],o;if(Ye){o={};for(var u=0;u<a.length;u++)o["$"+a[u]]=a[u]}for(var f in r)he(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ye&&o["$"+f]instanceof Symbol||(Na.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof Dn=="function")for(var c=0;c<a.length;c++)qa.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var Ln=dn,Ke=jf,Cl=gl,Nl=Ln("%TypeError%"),lt=Ln("%WeakMap%",!0),dt=Ln("%Map%",!0),Bl=Ke("WeakMap.prototype.get",!0),Ul=Ke("WeakMap.prototype.set",!0),ql=Ke("WeakMap.prototype.has",!0),Ll=Ke("Map.prototype.get",!0),kl=Ke("Map.prototype.set",!0),jl=Ke("Map.prototype.has",!0),kn=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},Vl=function(r,e){var t=kn(r,e);return t&&t.value},Gl=function(r,e,t){var n=kn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Hl=function(r,e){return!!kn(r,e)},Wl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Nl("Side channel does not contain "+Cl(a))},get:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Bl(e,a)}else if(dt){if(t)return Ll(t,a)}else if(n)return Vl(n,a)},has:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return ql(e,a)}else if(dt){if(t)return jl(t,a)}else if(n)return Hl(n,a);return!1},set:function(a,o){lt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new lt),Ul(e,a,o)):dt?(t||(t=new dt),kl(t,a,o)):(n||(n={key:{},next:null}),Gl(n,a,o))}};return i},zl=String.prototype.replace,Xl=/%20/g,jn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ka={default:jn.RFC3986,formatters:{RFC1738:function(r){return zl.call(r,Xl,"+")},RFC3986:function(r){return String(r)}},RFC1738:jn.RFC1738,RFC3986:jn.RFC3986},Yl=Ka,Vn=Object.prototype.hasOwnProperty,Re=Array.isArray,te=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Kl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Re(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Za=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},Zl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Re(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Vn.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 Re(e)&&!Re(t)&&(i=Za(e,n)),Re(e)&&Re(t)?(t.forEach(function(a,o){if(Vn.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 Vn.call(a,o)?a[o]=r(a[o],u,n):a[o]=u,a},i)},Jl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Ql=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}},ed=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===Yl.RFC1738&&(c===40||c===41)){u+=o.charAt(f);continue}if(c<128){u=u+te[c];continue}if(c<2048){u=u+(te[192|c>>6]+te[128|c&63]);continue}if(c<55296||c>=57344){u=u+(te[224|c>>12]+te[128|c>>6&63]+te[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),u+=te[240|c>>18]+te[128|c>>12&63]+te[128|c>>6&63]+te[128|c&63]}return u},rd=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 Kl(t),e},td=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},nd=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},id=function(e,t){return[].concat(e,t)},ad=function(e,t){if(Re(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},od={arrayToObject:Za,assign:Jl,combine:id,compact:rd,decode:Ql,encode:ed,isBuffer:nd,isRegExp:td,maybeMap:ad,merge:Zl},Ja=Wl,pt=od,Er=Ka,ud=Object.prototype.hasOwnProperty,Qa={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ue=Array.isArray,sd=Array.prototype.push,eo=function(r,e){sd.apply(r,ue(e)?e:[e])},fd=Date.prototype.toISOString,ro=Er.default,k={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:pt.encode,encodeValuesOnly:!1,format:ro,formatter:Er.formatters[ro],indices:!1,serializeDate:function(e){return fd.call(e)},skipNulls:!1,strictNullHandling:!1},cd=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Gn={},ld=function r(e,t,n,i,a,o,u,f,c,l,s,d,y,w,S,O){for(var b=e,E=O,p=0,I=!1;(E=E.get(Gn))!==void 0&&!I;){var T=E.get(e);if(p+=1,typeof T<"u"){if(T===p)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Gn)>"u"&&(p=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=s(b):n==="comma"&&ue(b)&&(b=pt.maybeMap(b,function(we){return we instanceof Date?s(we):we})),b===null){if(a)return u&&!w?u(t,k.encoder,S,"key",d):t;b=""}if(cd(b)||pt.isBuffer(b)){if(u){var F=w?t:u(t,k.encoder,S,"key",d);return[y(F)+"="+y(u(b,k.encoder,S,"value",d))]}return[y(t)+"="+y(String(b))]}var m=[];if(typeof b>"u")return m;var g;if(n==="comma"&&ue(b))w&&u&&(b=pt.maybeMap(b,u)),g=[{value:b.length>0?b.join(",")||null:void 0}];else if(ue(f))g=f;else{var _=Object.keys(b);g=c?_.sort(c):_}for(var A=i&&ue(b)&&b.length===1?t+"[]":t,x=0;x<g.length;++x){var M=g[x],Y=typeof M=="object"&&typeof M.value<"u"?M.value:b[M];if(!(o&&Y===null)){var me=ue(b)?typeof n=="function"?n(A,M):A:A+(l?"."+M:"["+M+"]");O.set(e,p);var dr=Ja();dr.set(Gn,O),eo(m,r(Y,me,n,i,a,o,n==="comma"&&w&&ue(b)?null:u,f,c,l,s,d,y,w,S,dr))}}return m},dd=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=Er.default;if(typeof e.format<"u"){if(!ud.call(Er.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Er.formatters[n],a=k.filter;return(typeof e.filter=="function"||ue(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}},pd=function(r,e){var t=r,n=dd(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ue(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in Qa?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var f=Qa[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=Ja(),s=0;s<i.length;++s){var d=i[s];n.skipNulls&&t[d]===null||eo(o,ld(t[d],d,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),w=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),y.length>0?w+y:""},hd=be(pd);let to={storeIdentifier:"",environment:"prod"};function yd(r){to=r}function W(){return to}const gd=(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`}},_d=(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}},vd=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},no="/tools/recurring";class Ze{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function md(r){return hd(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function v(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Hi()}}async function ht(r,e,t={}){const n=W();return X(r,`${vd(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function $(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:u,environmentUri:f,storeIdentifier:c,loginRetryFn:l,__unstable_twoFactorRetryFn:s,appName:d,appVersion:y}=W();if(!c)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const w=o.apiToken;if(!w)throw new Error("No API token defined on session.");const S=gd(u,f),O={"X-Recharge-Access-Token":w,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...d?{"X-Recharge-Sdk-App-Name":d}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.49.0","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},b={shop_url:c,...n};try{return await X(r,`${S}${e}`,{id:t,query:b,data:i,headers:O})}catch(E){if(l&&E instanceof Ze&&E.status===401)return l().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:b,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});if(s&&E instanceof Ze&&E.status===423)return s().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:b,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});throw E}}async function Fe(r,e,t={}){return X(r,`${no}${e}`,t)}async function X(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 d=[s,md(n)].join("&").replace(/^&/,"");o=`${o}${d?`?${d}`:""}`}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 c.status===502||c.status===504?new Ze("A gateway error occurred while making the request",c.status):l&&l.error?new Ze(l.error,c.status):l&&l.errors?new Ze(JSON.stringify(l.errors),c.status):new Ze("A connection error occurred while making the request");return l}function wd(r,e){return $("get","/addresses",{query:e},v(r,"listAddresses"))}async function bd(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await $("get","/addresses",{id:e,query:{include:t?.include}},v(r,"getAddress"));return n}async function $d(r,e){const{address:t}=await $("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},v(r,"createAddress"));return t}async function Hn(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await $("put","/addresses",{id:e,data:t,query:n},v(r,"updateAddress"));return i}async function Ed(r,e,t,n){return Hn(v(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function Sd(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return Hn(v(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function Ad(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/addresses",{id:e},v(r,"deleteAddress"))}async function Od(r,e){const{address:t}=await $("post","/addresses/merge",{data:e},v(r,"mergeAddresses"));return t}async function Id(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("post",`/addresses/${e}/charges/skip`,{data:t},v(r,"skipFutureCharge"));return n}var xd=Object.freeze({__proto__:null,applyDiscountToAddress:Ed,createAddress:$d,deleteAddress:Ad,getAddress:bd,listAddresses:wd,mergeAddresses:Od,removeDiscountsFromAddress:Sd,skipFutureCharge:Id,updateAddress:Hn});async function Pd(){const{storefrontAccessToken:r}=W(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Fe("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Td(r,e){return io(r,e)}async function io(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=W();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Sr("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function Rd(r){const{storeIdentifier:e}=W();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Sr("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function Fd(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=W();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Sr("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function Md(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=W(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Fe("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Dd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=W();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function Cd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=W(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Fe("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 Nd(){const{customerHash:r}=W(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(u=>u==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Bd(){const{customerHash:r,token:e}=Nd(),{storeIdentifier:t}=W(),n=await Sr("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Sr(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:u,storefrontAccessToken:f,appName:c,appVersion:l}=W(),s=_d(o,u),d={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...c?{"X-Recharge-Sdk-App-Name":c}:{},...l?{"X-Recharge-Sdk-App-Version":l}:{},"X-Recharge-Sdk-Version":"1.49.0",...a||{}};return X(r,`${s}${e}`,{id:t,query:n,data:i,headers:d})}var Ud=Object.freeze({__proto__:null,loginCustomerPortal:Bd,loginShopifyApi:Td,loginShopifyAppProxy:Pd,loginWithShopifyCustomerAccount:Rd,loginWithShopifyStorefront:io,sendPasswordlessCode:Fd,sendPasswordlessCodeAppProxy:Md,validatePasswordlessCode:Dd,validatePasswordlessCodeAppProxy:Cd}),ao={},Wn={},se={},qd=typeof U=="object"&&U&&U.Object===Object&&U,oo=qd,Ld=oo,kd=typeof self=="object"&&self&&self.Object===Object&&self,jd=Ld||kd||Function("return this")(),fe=jd,Vd=fe,Gd=Vd.Symbol,yt=Gd,uo=yt,so=Object.prototype,Hd=so.hasOwnProperty,Wd=so.toString,Ar=uo?uo.toStringTag:void 0;function zd(r){var e=Hd.call(r,Ar),t=r[Ar];try{r[Ar]=void 0;var n=!0}catch{}var i=Wd.call(r);return n&&(e?r[Ar]=t:delete r[Ar]),i}var Xd=zd,Yd=Object.prototype,Kd=Yd.toString;function Zd(r){return Kd.call(r)}var Jd=Zd,fo=yt,Qd=Xd,ep=Jd,rp="[object Null]",tp="[object Undefined]",co=fo?fo.toStringTag:void 0;function np(r){return r==null?r===void 0?tp:rp:co&&co in Object(r)?Qd(r):ep(r)}var ge=np;function ip(r){return r!=null&&typeof r=="object"}var _e=ip,ap=ge,op=_e,up="[object Number]";function sp(r){return typeof r=="number"||op(r)&&ap(r)==up}var gt=sp,D={};function fp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Je=fp,cp=ge,lp=Je,dp="[object AsyncFunction]",pp="[object Function]",hp="[object GeneratorFunction]",yp="[object Proxy]";function gp(r){if(!lp(r))return!1;var e=cp(r);return e==pp||e==hp||e==dp||e==yp}var zn=gp,_p=fe,vp=_p["__core-js_shared__"],mp=vp,Xn=mp,lo=function(){var r=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wp(r){return!!lo&&lo in r}var bp=wp,$p=Function.prototype,Ep=$p.toString;function Sp(r){if(r!=null){try{return Ep.call(r)}catch{}try{return r+""}catch{}}return""}var po=Sp,Ap=zn,Op=bp,Ip=Je,xp=po,Pp=/[\\^$.*+?()[\]{}|]/g,Tp=/^\[object .+?Constructor\]$/,Rp=Function.prototype,Fp=Object.prototype,Mp=Rp.toString,Dp=Fp.hasOwnProperty,Cp=RegExp("^"+Mp.call(Dp).replace(Pp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Np(r){if(!Ip(r)||Op(r))return!1;var e=Ap(r)?Cp:Tp;return e.test(xp(r))}var Bp=Np;function Up(r,e){return r?.[e]}var qp=Up,Lp=Bp,kp=qp;function jp(r,e){var t=kp(r,e);return Lp(t)?t:void 0}var Me=jp,Vp=Me,Gp=function(){try{var r=Vp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),ho=Gp,yo=ho;function Hp(r,e,t){e=="__proto__"&&yo?yo(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var go=Hp;function Wp(r,e){return r===e||r!==r&&e!==e}var _t=Wp,zp=go,Xp=_t,Yp=Object.prototype,Kp=Yp.hasOwnProperty;function Zp(r,e,t){var n=r[e];(!(Kp.call(r,e)&&Xp(n,t))||t===void 0&&!(e in r))&&zp(r,e,t)}var Jp=Zp,Qp=Jp,eh=go;function rh(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?eh(t,u,f):Qp(t,u,f)}return t}var th=rh;function nh(r){return r}var vt=nh;function ih(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 ah=ih,oh=ah,_o=Math.max;function uh(r,e,t){return e=_o(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=_o(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),oh(r,this,u)}}var sh=uh;function fh(r){return function(){return r}}var ch=fh,lh=ch,vo=ho,dh=vt,ph=vo?function(r,e){return vo(r,"toString",{configurable:!0,enumerable:!1,value:lh(e),writable:!0})}:dh,hh=ph,yh=800,gh=16,_h=Date.now;function vh(r){var e=0,t=0;return function(){var n=_h(),i=gh-(n-t);if(t=n,i>0){if(++e>=yh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var mh=vh,wh=hh,bh=mh,$h=bh(wh),Eh=$h,Sh=vt,Ah=sh,Oh=Eh;function Ih(r,e){return Oh(Ah(r,e,Sh),r+"")}var xh=Ih,Ph=9007199254740991;function Th(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ph}var Yn=Th,Rh=zn,Fh=Yn;function Mh(r){return r!=null&&Fh(r.length)&&!Rh(r)}var Or=Mh,Dh=9007199254740991,Ch=/^(?:0|[1-9]\d*)$/;function Nh(r,e){var t=typeof r;return e=e??Dh,!!e&&(t=="number"||t!="symbol"&&Ch.test(r))&&r>-1&&r%1==0&&r<e}var Kn=Nh,Bh=_t,Uh=Or,qh=Kn,Lh=Je;function kh(r,e,t){if(!Lh(t))return!1;var n=typeof e;return(n=="number"?Uh(t)&&qh(e,t.length):n=="string"&&e in t)?Bh(t[e],r):!1}var mo=kh,jh=xh,Vh=mo;function Gh(r){return jh(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&&Vh(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 Hh=Gh;function Wh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var wo=Wh,zh=ge,Xh=_e,Yh="[object Arguments]";function Kh(r){return Xh(r)&&zh(r)==Yh}var Zh=Kh,bo=Zh,Jh=_e,$o=Object.prototype,Qh=$o.hasOwnProperty,ey=$o.propertyIsEnumerable,ry=bo(function(){return arguments}())?bo:function(r){return Jh(r)&&Qh.call(r,"callee")&&!ey.call(r,"callee")},Eo=ry,ty=Array.isArray,V=ty,mt={exports:{}};function ny(){return!1}var iy=ny;mt.exports,function(r,e){var t=fe,n=iy,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}(mt,mt.exports);var So=mt.exports,ay=ge,oy=Yn,uy=_e,sy="[object Arguments]",fy="[object Array]",cy="[object Boolean]",ly="[object Date]",dy="[object Error]",py="[object Function]",hy="[object Map]",yy="[object Number]",gy="[object Object]",_y="[object RegExp]",vy="[object Set]",my="[object String]",wy="[object WeakMap]",by="[object ArrayBuffer]",$y="[object DataView]",Ey="[object Float32Array]",Sy="[object Float64Array]",Ay="[object Int8Array]",Oy="[object Int16Array]",Iy="[object Int32Array]",xy="[object Uint8Array]",Py="[object Uint8ClampedArray]",Ty="[object Uint16Array]",Ry="[object Uint32Array]",R={};R[Ey]=R[Sy]=R[Ay]=R[Oy]=R[Iy]=R[xy]=R[Py]=R[Ty]=R[Ry]=!0,R[sy]=R[fy]=R[by]=R[cy]=R[$y]=R[ly]=R[dy]=R[py]=R[hy]=R[yy]=R[gy]=R[_y]=R[vy]=R[my]=R[wy]=!1;function Fy(r){return uy(r)&&oy(r.length)&&!!R[ay(r)]}var My=Fy;function Dy(r){return function(e){return r(e)}}var Cy=Dy,wt={exports:{}};wt.exports,function(r,e){var t=oo,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}(wt,wt.exports);var Ny=wt.exports,By=My,Uy=Cy,Ao=Ny,Oo=Ao&&Ao.isTypedArray,qy=Oo?Uy(Oo):By,Io=qy,Ly=wo,ky=Eo,jy=V,Vy=So,Gy=Kn,Hy=Io,Wy=Object.prototype,zy=Wy.hasOwnProperty;function Xy(r,e){var t=jy(r),n=!t&&ky(r),i=!t&&!n&&Vy(r),a=!t&&!n&&!i&&Hy(r),o=t||n||i||a,u=o?Ly(r.length,String):[],f=u.length;for(var c in r)(e||zy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Gy(c,f)))&&u.push(c);return u}var xo=Xy,Yy=Object.prototype;function Ky(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Yy;return r===t}var Po=Ky;function Zy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Jy=Zy,Qy=Je,eg=Po,rg=Jy,tg=Object.prototype,ng=tg.hasOwnProperty;function ig(r){if(!Qy(r))return rg(r);var e=eg(r),t=[];for(var n in r)n=="constructor"&&(e||!ng.call(r,n))||t.push(n);return t}var ag=ig,og=xo,ug=ag,sg=Or;function fg(r){return sg(r)?og(r,!0):ug(r)}var cg=fg,lg=th,dg=Hh,pg=cg,hg=dg(function(r,e){lg(e,pg(e),r)}),yg=hg,gg=yg,bt={},De={};function _g(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 vg=_g;function mg(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 wg=mg,bg=wg,$g=bg(),Eg=$g;function Sg(r,e){return function(t){return r(e(t))}}var Ag=Sg,Og=Ag,Ig=Og(Object.keys,Object),xg=Ig,Pg=Po,Tg=xg,Rg=Object.prototype,Fg=Rg.hasOwnProperty;function Mg(r){if(!Pg(r))return Tg(r);var e=[];for(var t in Object(r))Fg.call(r,t)&&t!="constructor"&&e.push(t);return e}var Dg=Mg,Cg=xo,Ng=Dg,Bg=Or;function Ug(r){return Bg(r)?Cg(r):Ng(r)}var $t=Ug,qg=Eg,Lg=$t;function kg(r,e){return r&&qg(r,e,Lg)}var jg=kg,Vg=Or;function Gg(r,e){return function(t,n){if(t==null)return t;if(!Vg(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 Hg=Gg,Wg=jg,zg=Hg,Xg=zg(Wg),Zn=Xg,Yg=Zn;function Kg(r,e){var t=!0;return Yg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Zg=Kg;function Jg(){this.__data__=[],this.size=0}var Qg=Jg,e_=_t;function r_(r,e){for(var t=r.length;t--;)if(e_(r[t][0],e))return t;return-1}var Et=r_,t_=Et,n_=Array.prototype,i_=n_.splice;function a_(r){var e=this.__data__,t=t_(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():i_.call(e,t,1),--this.size,!0}var o_=a_,u_=Et;function s_(r){var e=this.__data__,t=u_(e,r);return t<0?void 0:e[t][1]}var f_=s_,c_=Et;function l_(r){return c_(this.__data__,r)>-1}var d_=l_,p_=Et;function h_(r,e){var t=this.__data__,n=p_(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var y_=h_,g_=Qg,__=o_,v_=f_,m_=d_,w_=y_;function Qe(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])}}Qe.prototype.clear=g_,Qe.prototype.delete=__,Qe.prototype.get=v_,Qe.prototype.has=m_,Qe.prototype.set=w_;var St=Qe,b_=St;function $_(){this.__data__=new b_,this.size=0}var E_=$_;function S_(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var A_=S_;function O_(r){return this.__data__.get(r)}var I_=O_;function x_(r){return this.__data__.has(r)}var P_=x_,T_=Me,R_=fe,F_=T_(R_,"Map"),Jn=F_,M_=Me,D_=M_(Object,"create"),At=D_,To=At;function C_(){this.__data__=To?To(null):{},this.size=0}var N_=C_;function B_(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var U_=B_,q_=At,L_="__lodash_hash_undefined__",k_=Object.prototype,j_=k_.hasOwnProperty;function V_(r){var e=this.__data__;if(q_){var t=e[r];return t===L_?void 0:t}return j_.call(e,r)?e[r]:void 0}var G_=V_,H_=At,W_=Object.prototype,z_=W_.hasOwnProperty;function X_(r){var e=this.__data__;return H_?e[r]!==void 0:z_.call(e,r)}var Y_=X_,K_=At,Z_="__lodash_hash_undefined__";function J_(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=K_&&e===void 0?Z_:e,this}var Q_=J_,ev=N_,rv=U_,tv=G_,nv=Y_,iv=Q_;function er(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])}}er.prototype.clear=ev,er.prototype.delete=rv,er.prototype.get=tv,er.prototype.has=nv,er.prototype.set=iv;var av=er,Ro=av,ov=St,uv=Jn;function sv(){this.size=0,this.__data__={hash:new Ro,map:new(uv||ov),string:new Ro}}var fv=sv;function cv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var lv=cv,dv=lv;function pv(r,e){var t=r.__data__;return dv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Ot=pv,hv=Ot;function yv(r){var e=hv(this,r).delete(r);return this.size-=e?1:0,e}var gv=yv,_v=Ot;function vv(r){return _v(this,r).get(r)}var mv=vv,wv=Ot;function bv(r){return wv(this,r).has(r)}var $v=bv,Ev=Ot;function Sv(r,e){var t=Ev(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Av=Sv,Ov=fv,Iv=gv,xv=mv,Pv=$v,Tv=Av;function rr(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])}}rr.prototype.clear=Ov,rr.prototype.delete=Iv,rr.prototype.get=xv,rr.prototype.has=Pv,rr.prototype.set=Tv;var Qn=rr,Rv=St,Fv=Jn,Mv=Qn,Dv=200;function Cv(r,e){var t=this.__data__;if(t instanceof Rv){var n=t.__data__;if(!Fv||n.length<Dv-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Mv(n)}return t.set(r,e),this.size=t.size,this}var Nv=Cv,Bv=St,Uv=E_,qv=A_,Lv=I_,kv=P_,jv=Nv;function tr(r){var e=this.__data__=new Bv(r);this.size=e.size}tr.prototype.clear=Uv,tr.prototype.delete=qv,tr.prototype.get=Lv,tr.prototype.has=kv,tr.prototype.set=jv;var Fo=tr,Vv="__lodash_hash_undefined__";function Gv(r){return this.__data__.set(r,Vv),this}var Hv=Gv;function Wv(r){return this.__data__.has(r)}var zv=Wv,Xv=Qn,Yv=Hv,Kv=zv;function It(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Xv;++e<t;)this.add(r[e])}It.prototype.add=It.prototype.push=Yv,It.prototype.has=Kv;var Zv=It;function Jv(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 Qv=Jv;function em(r,e){return r.has(e)}var rm=em,tm=Zv,nm=Qv,im=rm,am=1,om=2;function um(r,e,t,n,i,a){var o=t&am,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,d=!0,y=t&om?new tm:void 0;for(a.set(r,e),a.set(e,r);++s<u;){var w=r[s],S=e[s];if(n)var O=o?n(S,w,s,e,r,a):n(w,S,s,r,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(y){if(!nm(e,function(b,E){if(!im(y,E)&&(w===b||i(w,b,t,n,a)))return y.push(E)})){d=!1;break}}else if(!(w===S||i(w,S,t,n,a))){d=!1;break}}return a.delete(r),a.delete(e),d}var Mo=um,sm=fe,fm=sm.Uint8Array,cm=fm;function lm(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var dm=lm;function pm(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var hm=pm,Do=yt,Co=cm,ym=_t,gm=Mo,_m=dm,vm=hm,mm=1,wm=2,bm="[object Boolean]",$m="[object Date]",Em="[object Error]",Sm="[object Map]",Am="[object Number]",Om="[object RegExp]",Im="[object Set]",xm="[object String]",Pm="[object Symbol]",Tm="[object ArrayBuffer]",Rm="[object DataView]",No=Do?Do.prototype:void 0,ei=No?No.valueOf:void 0;function Fm(r,e,t,n,i,a,o){switch(t){case Rm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Tm:return!(r.byteLength!=e.byteLength||!a(new Co(r),new Co(e)));case bm:case $m:case Am:return ym(+r,+e);case Em:return r.name==e.name&&r.message==e.message;case Om:case xm:return r==e+"";case Sm:var u=_m;case Im:var f=n&mm;if(u||(u=vm),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=wm,o.set(r,e);var l=gm(u(r),u(e),n,i,a,o);return o.delete(r),l;case Pm:if(ei)return ei.call(r)==ei.call(e)}return!1}var Mm=Fm;function Dm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Cm=Dm,Nm=Cm,Bm=V;function Um(r,e,t){var n=e(r);return Bm(r)?n:Nm(n,t(r))}var qm=Um;function Lm(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 km=Lm;function jm(){return[]}var Vm=jm,Gm=km,Hm=Vm,Wm=Object.prototype,zm=Wm.propertyIsEnumerable,Bo=Object.getOwnPropertySymbols,Xm=Bo?function(r){return r==null?[]:(r=Object(r),Gm(Bo(r),function(e){return zm.call(r,e)}))}:Hm,Ym=Xm,Km=qm,Zm=Ym,Jm=$t;function Qm(r){return Km(r,Jm,Zm)}var ew=Qm,Uo=ew,rw=1,tw=Object.prototype,nw=tw.hasOwnProperty;function iw(r,e,t,n,i,a){var o=t&rw,u=Uo(r),f=u.length,c=Uo(e),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var d=u[s];if(!(o?d in e:nw.call(e,d)))return!1}var y=a.get(r),w=a.get(e);if(y&&w)return y==e&&w==r;var S=!0;a.set(r,e),a.set(e,r);for(var O=o;++s<f;){d=u[s];var b=r[d],E=e[d];if(n)var p=o?n(E,b,d,e,r,a):n(b,E,d,r,e,a);if(!(p===void 0?b===E||i(b,E,t,n,a):p)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(S=!1)}return a.delete(r),a.delete(e),S}var aw=iw,ow=Me,uw=fe,sw=ow(uw,"DataView"),fw=sw,cw=Me,lw=fe,dw=cw(lw,"Promise"),pw=dw,hw=Me,yw=fe,gw=hw(yw,"Set"),_w=gw,vw=Me,mw=fe,ww=vw(mw,"WeakMap"),bw=ww,ri=fw,ti=Jn,ni=pw,ii=_w,ai=bw,qo=ge,nr=po,Lo="[object Map]",$w="[object Object]",ko="[object Promise]",jo="[object Set]",Vo="[object WeakMap]",Go="[object DataView]",Ew=nr(ri),Sw=nr(ti),Aw=nr(ni),Ow=nr(ii),Iw=nr(ai),Ce=qo;(ri&&Ce(new ri(new ArrayBuffer(1)))!=Go||ti&&Ce(new ti)!=Lo||ni&&Ce(ni.resolve())!=ko||ii&&Ce(new ii)!=jo||ai&&Ce(new ai)!=Vo)&&(Ce=function(r){var e=qo(r),t=e==$w?r.constructor:void 0,n=t?nr(t):"";if(n)switch(n){case Ew:return Go;case Sw:return Lo;case Aw:return ko;case Ow:return jo;case Iw:return Vo}return e});var xw=Ce,oi=Fo,Pw=Mo,Tw=Mm,Rw=aw,Ho=xw,Wo=V,zo=So,Fw=Io,Mw=1,Xo="[object Arguments]",Yo="[object Array]",xt="[object Object]",Dw=Object.prototype,Ko=Dw.hasOwnProperty;function Cw(r,e,t,n,i,a){var o=Wo(r),u=Wo(e),f=o?Yo:Ho(r),c=u?Yo:Ho(e);f=f==Xo?xt:f,c=c==Xo?xt:c;var l=f==xt,s=c==xt,d=f==c;if(d&&zo(r)){if(!zo(e))return!1;o=!0,l=!1}if(d&&!l)return a||(a=new oi),o||Fw(r)?Pw(r,e,t,n,i,a):Tw(r,e,f,t,n,i,a);if(!(t&Mw)){var y=l&&Ko.call(r,"__wrapped__"),w=s&&Ko.call(e,"__wrapped__");if(y||w){var S=y?r.value():r,O=w?e.value():e;return a||(a=new oi),i(S,O,t,n,a)}}return d?(a||(a=new oi),Rw(r,e,t,n,i,a)):!1}var Nw=Cw,Bw=Nw,Zo=_e;function Jo(r,e,t,n,i){return r===e?!0:r==null||e==null||!Zo(r)&&!Zo(e)?r!==r&&e!==e:Bw(r,e,t,n,Jo,i)}var Qo=Jo,Uw=Fo,qw=Qo,Lw=1,kw=2;function jw(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 d=n(c,l,f,r,e,s);if(!(d===void 0?qw(l,c,Lw|kw,n,s):d))return!1}}return!0}var Vw=jw,Gw=Je;function Hw(r){return r===r&&!Gw(r)}var eu=Hw,Ww=eu,zw=$t;function Xw(r){for(var e=zw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Ww(i)]}return e}var Yw=Xw;function Kw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var ru=Kw,Zw=Vw,Jw=Yw,Qw=ru;function e0(r){var e=Jw(r);return e.length==1&&e[0][2]?Qw(e[0][0],e[0][1]):function(t){return t===r||Zw(t,r,e)}}var r0=e0,t0=ge,n0=_e,i0="[object Symbol]";function a0(r){return typeof r=="symbol"||n0(r)&&t0(r)==i0}var Pt=a0,o0=V,u0=Pt,s0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f0=/^\w*$/;function c0(r,e){if(o0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||u0(r)?!0:f0.test(r)||!s0.test(r)||e!=null&&r in Object(e)}var ui=c0,tu=Qn,l0="Expected a function";function si(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(l0);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(si.Cache||tu),t}si.Cache=tu;var d0=si,p0=d0,h0=500;function y0(r){var e=p0(r,function(n){return t.size===h0&&t.clear(),n}),t=e.cache;return e}var g0=y0,_0=g0,v0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m0=/\\(\\)?/g,w0=_0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(v0,function(t,n,i,a){e.push(i?a.replace(m0,"$1"):n||t)}),e}),b0=w0;function $0(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 fi=$0,nu=yt,E0=fi,S0=V,A0=Pt,O0=1/0,iu=nu?nu.prototype:void 0,au=iu?iu.toString:void 0;function ou(r){if(typeof r=="string")return r;if(S0(r))return E0(r,ou)+"";if(A0(r))return au?au.call(r):"";var e=r+"";return e=="0"&&1/r==-O0?"-0":e}var I0=ou,x0=I0;function P0(r){return r==null?"":x0(r)}var T0=P0,R0=V,F0=ui,M0=b0,D0=T0;function C0(r,e){return R0(r)?r:F0(r,e)?[r]:M0(D0(r))}var uu=C0,N0=Pt,B0=1/0;function U0(r){if(typeof r=="string"||N0(r))return r;var e=r+"";return e=="0"&&1/r==-B0?"-0":e}var Tt=U0,q0=uu,L0=Tt;function k0(r,e){e=q0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var su=k0,j0=su;function V0(r,e,t){var n=r==null?void 0:j0(r,e);return n===void 0?t:n}var G0=V0;function H0(r,e){return r!=null&&e in Object(r)}var W0=H0,z0=uu,X0=Eo,Y0=V,K0=Kn,Z0=Yn,J0=Tt;function Q0(r,e,t){e=z0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=J0(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&&Z0(i)&&K0(o,i)&&(Y0(r)||X0(r)))}var eb=Q0,rb=W0,tb=eb;function nb(r,e){return r!=null&&tb(r,e,rb)}var ib=nb,ab=Qo,ob=G0,ub=ib,sb=ui,fb=eu,cb=ru,lb=Tt,db=1,pb=2;function hb(r,e){return sb(r)&&fb(e)?cb(lb(r),e):function(t){var n=ob(t,r);return n===void 0&&n===e?ub(t,r):ab(e,n,db|pb)}}var yb=hb;function gb(r){return function(e){return e?.[r]}}var _b=gb,vb=su;function mb(r){return function(e){return vb(e,r)}}var wb=mb,bb=_b,$b=wb,Eb=ui,Sb=Tt;function Ab(r){return Eb(r)?bb(Sb(r)):$b(r)}var Ob=Ab,Ib=r0,xb=yb,Pb=vt,Tb=V,Rb=Ob;function Fb(r){return typeof r=="function"?r:r==null?Pb:typeof r=="object"?Tb(r)?xb(r[0],r[1]):Ib(r):Rb(r)}var fu=Fb,Mb=vg,Db=Zg,Cb=fu,Nb=V,Bb=mo;function Ub(r,e,t){var n=Nb(r)?Mb:Db;return t&&Bb(r,e,t)&&(e=void 0),n(r,Cb(e))}var ci=Ub;Object.defineProperty(De,"__esModule",{value:!0}),De.calculatePadding=jb,De.slicePadding=Vb;var qb=ci,Lb=kb(qb);function kb(r){return r&&r.__esModule?r:{default:r}}function jb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Vb(r,e){var t=r.slice(e),n=(0,Lb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(bt,"__esModule",{value:!0}),bt.Cursor=void 0;var Gb=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}}(),Hb=De;function Wb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var li=function(){function r(e){Wb(this,r),e instanceof h||(e=typeof e=="number"?h.alloc(e):h.from(e)),this._setBuffer(e),this.rewind()}return Gb(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 h?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=h.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,Hb.calculatePadding)(t.length),i=h.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){li.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){li.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),bt.Cursor=li,Object.defineProperty(D,"__esModule",{value:!0}),D.default=Qb;var zb=gg,cu=du(zb),Xb=zn,Yb=du(Xb),lu=bt;function du(r){return r&&r.__esModule?r:{default:r}}var Kb=Math.pow(2,16),Zb={toXDR:function(e){var t=new lu.Cursor(Kb);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=h.from(e,"hex");break;case"base64":n=h.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new lu.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}}},Jb={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 Qb(r){(0,cu.default)(r,Zb),(0,Yb.default)(r)&&(0,cu.default)(r.prototype,Jb)}Object.defineProperty(se,"__esModule",{value:!0}),se.Int=void 0;var e1=gt,pu=hu(e1),r1=D,t1=hu(r1);function hu(r){return r&&r.__esModule?r:{default:r}}var Ir=se.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,pu.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,pu.default)(e)||Math.floor(e)!==e?!1:e>=Ir.MIN_VALUE&&e<=Ir.MAX_VALUE}};Ir.MAX_VALUE=Math.pow(2,31)-1,Ir.MIN_VALUE=-Math.pow(2,31),(0,t1.default)(Ir);var Rt={};function n1(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 yu={exports:{}};(function(r){/**
|
|
21
21
|
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
22
22
|
* Released under the Apache License, Version 2.0
|
|
23
23
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
24
|
-
*/(function(e,t){typeof Zb=="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,w;return h?(s=s>>>0,0<=s&&s<256&&(w=n[s],w)?w:(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&&(w=t[s],w)?w:(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 w;if((w=s.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+s);if(w===0)return e.fromString(s.substring(1),h,y).negate();for(var A=e.fromNumber(Math.pow(y,8)),O=e.ZERO,b=0;b<s.length;b+=8){var E=Math.min(8,s.length-b),d=parseInt(s.substring(b,b+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));O=O.multiply(I).add(e.fromNumber(d))}else O=O.multiply(A),O=O.add(e.fromNumber(d))}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),w=this.divide(y);return h=w.multiply(y).subtract(this),w.toString(s)+h.toInt().toString(s)}else return"-"+this.negate().toString(s);var A=e.fromNumber(Math.pow(s,6),this.unsigned);h=this;for(var O="";;){var b=h.divide(A),E=h.subtract(b.multiply(A)).toInt()>>>0,d=E.toString(s);if(h=b,h.isZero())return d+O;for(;d.length<6;)d="0"+d;O=""+d+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,w=this.low>>>16,A=this.low&65535,O=s.high>>>16,b=s.high&65535,E=s.low>>>16,d=s.low&65535,I=0,T=0,F=0,m=0;return m+=A+d,F+=m>>>16,m&=65535,F+=w+E,T+=F>>>16,F&=65535,T+=y+b,I+=T>>>16,T&=65535,I+=h+O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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,w=this.low>>>16,A=this.low&65535,O=s.high>>>16,b=s.high&65535,E=s.low>>>16,d=s.low&65535,I=0,T=0,F=0,m=0;return m+=A*d,F+=m>>>16,m&=65535,F+=w*d,T+=F>>>16,F&=65535,F+=A*E,T+=F>>>16,F&=65535,T+=y*d,I+=T>>>16,T&=65535,T+=w*E,I+=T>>>16,T&=65535,T+=A*b,I+=T>>>16,T&=65535,I+=h*d+y*E+w*b+A*O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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,w;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 A=this.shiftRight(1);return h=A.divide(s).shiftLeft(1),h.equals(e.ZERO)?s.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(s.multiply(h)),w=h.add(y.divide(s)),w)}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(w=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),b=O<=48?1:Math.pow(2,O-48),E=e.fromNumber(h),d=E.multiply(s);d.isNegative()||d.greaterThan(y);)h-=b,E=e.fromNumber(h,this.unsigned),d=E.multiply(s);E.isZero()&&(E=e.ONE),w=w.add(E),y=y.subtract(d)}return w},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})})(hu);var du=hu.exports;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Hyper=void 0;var Jb=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=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)}},Qb=du,Pr=yu(Qb),e1=D,r1=yu(e1);function yu(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")}function n1(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 i1(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 xr=Rt.Hyper=function(r){i1(e,r),Jb(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=pu(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=pu(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 t1(this,e),n1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(Pr.default);(0,r1.default)(xr),xr.MAX_VALUE=new xr(Pr.default.MAX_VALUE.low,Pr.default.MAX_VALUE.high),xr.MIN_VALUE=new xr(Pr.default.MIN_VALUE.low,Pr.default.MIN_VALUE.high);var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.UnsignedInt=void 0;var a1=gt,gu=vu(a1),o1=D,u1=vu(o1);function vu(r){return r&&r.__esModule?r:{default:r}}var Tr=Ce.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,gu.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,gu.default)(e)||Math.floor(e)!==e?!1:e>=Tr.MIN_VALUE&&e<=Tr.MAX_VALUE}};Tr.MAX_VALUE=Math.pow(2,32)-1,Tr.MIN_VALUE=0,(0,u1.default)(Tr);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.UnsignedHyper=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}}(),_u=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)}},f1=du,Rr=mu(f1),c1=D,l1=mu(c1);function mu(r){return r&&r.__esModule?r:{default:r}}function h1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(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 p1(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 Fr=Ft.UnsignedHyper=function(r){p1(e,r),s1(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=_u(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=_u(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 h1(this,e),d1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Rr.default);(0,l1.default)(Fr),Fr.MAX_VALUE=new Fr(Rr.default.MAX_UNSIGNED_VALUE.low,Rr.default.MAX_UNSIGNED_VALUE.high),Fr.MIN_VALUE=new Fr(Rr.default.MIN_VALUE.low,Rr.default.MIN_VALUE.high);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Float=void 0;var y1=gt,wu=bu(y1),g1=D,v1=bu(g1);function bu(r){return r&&r.__esModule?r:{default:r}}var _1=Mt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,wu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,wu.default)(e)}};(0,v1.default)(_1);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Double=void 0;var m1=gt,$u=Eu(m1),w1=D,b1=Eu(w1);function Eu(r){return r&&r.__esModule?r:{default:r}}var $1=Dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,$u.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,$u.default)(e)}};(0,b1.default)($1);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Quadruple=void 0;var E1=D,A1=S1(E1);function S1(r){return r&&r.__esModule?r:{default:r}}var O1=Ct.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,A1.default)(O1);var Mr={},I1=ge,P1=ve,x1="[object Boolean]";function T1(r){return r===!0||r===!1||P1(r)&&I1(r)==x1}var R1=T1;Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.Bool=void 0;var F1=R1,M1=Su(F1),Au=se,D1=D,C1=Su(D1);function Su(r){return r&&r.__esModule?r:{default:r}}var N1=Mr.Bool={read:function(e){var t=Au.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 Au.Int.write(n,t)},isValid:function(e){return(0,M1.default)(e)}};(0,C1.default)(N1);var Nt={},B1=ge,U1=V,q1=ve,L1="[object String]";function k1(r){return typeof r=="string"||!U1(r)&&q1(r)&&B1(r)==L1}var Ou=k1;Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.String=void 0;var j1=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}}(),V1=Ou,Iu=li(V1),G1=V,H1=li(G1),Pu=se,W1=Ce,xu=Me,X1=D,z1=li(X1);function li(r){return r&&r.__esModule?r:{default:r}}function Y1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var K1=Nt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W1.UnsignedInt.MAX_VALUE;Y1(this,r),this._maxLength=e}return j1(r,[{key:"read",value:function(t){var n=Pu.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,xu.calculatePadding)(n),a=t.slice(n);return(0,xu.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,Iu.default)(t)?i=p.from(t,"utf8"):i=p.from(t),Pu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Iu.default)(t))n=p.from(t,"utf8");else if((0,H1.default)(t)||p.isBuffer(t))n=p.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,z1.default)(K1.prototype);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Opaque=void 0;var Z1=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}}(),Tu=Me,J1=D,Q1=e$(J1);function e$(r){return r&&r.__esModule?r:{default:r}}function r$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var t$=Bt.Opaque=function(){function r(e){r$(this,r),this._length=e,this._padding=(0,Tu.calculatePadding)(e)}return Z1(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Tu.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 p.isBuffer(t)&&t.length===this._length}}]),r}();(0,Q1.default)(t$.prototype);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.VarOpaque=void 0;var n$=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=se,i$=Ce,Fu=Me,a$=D,o$=u$(a$);function u$(r){return r&&r.__esModule?r:{default:r}}function s$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var f$=Ut.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i$.UnsignedInt.MAX_VALUE;s$(this,r),this._maxLength=e}return n$(r,[{key:"read",value:function(t){var n=Ru.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,Fu.calculatePadding)(n),a=t.slice(n);return(0,Fu.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));Ru.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return p.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,o$.default)(f$.prototype);var qt={};function c$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var l$=c$,h$=_t;function d$(r){return typeof r=="function"?r:h$}var Mu=d$,p$=l$,y$=Kn,g$=Mu,v$=V;function _$(r,e){var t=v$(r)?p$:y$;return t(r,g$(e))}var m$=_$,nr=m$,w$=/\s/;function b$(r){for(var e=r.length;e--&&w$.test(r.charAt(e)););return e}var $$=b$,E$=$$,A$=/^\s+/;function S$(r){return r&&r.slice(0,E$(r)+1).replace(A$,"")}var O$=S$,I$=O$,Du=Ze,P$=xt,Cu=0/0,x$=/^[-+]0x[0-9a-f]+$/i,T$=/^0b[01]+$/i,R$=/^0o[0-7]+$/i,F$=parseInt;function M$(r){if(typeof r=="number")return r;if(P$(r))return Cu;if(Du(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Du(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=I$(r);var t=T$.test(r);return t||R$.test(r)?F$(r.slice(2),t?2:8):x$.test(r)?Cu:+r}var D$=M$,C$=D$,Nu=1/0,N$=17976931348623157e292;function B$(r){if(!r)return r===0?r:0;if(r=C$(r),r===Nu||r===-Nu){var e=r<0?-1:1;return e*N$}return r===r?r:0}var U$=B$,q$=U$;function L$(r){var e=q$(r),t=e%1;return e===e?t?e-t:e:0}var k$=L$,j$=vo,V$=Mu,G$=k$,H$=9007199254740991,hi=4294967295,W$=Math.min;function X$(r,e){if(r=G$(r),r<1||r>H$)return[];var t=hi,n=W$(r,hi);e=V$(e),r-=hi;for(var i=j$(n,e);++t<r;)e(t);return i}var Bu=X$;Object.defineProperty(qt,"__esModule",{value:!0}),qt.Array=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}}(),Y$=fi,K$=Dr(Y$),Z$=nr,J$=Dr(Z$),Q$=Bu,eE=Dr(Q$),rE=V,Uu=Dr(rE),tE=D,nE=Dr(tE);function Dr(r){return r&&r.__esModule?r:{default:r}}function iE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var aE=qt.Array=function(){function r(e,t){iE(this,r),this._childType=e,this._length=t}return z$(r,[{key:"read",value:function(t){var n=this;return(0,eE.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Uu.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,J$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Uu.default)(t)||t.length!==this._length?!1:(0,K$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,nE.default)(aE.prototype);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.VarArray=void 0;var oE=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}}(),uE=fi,sE=Cr(uE),fE=nr,cE=Cr(fE),lE=Bu,hE=Cr(lE),dE=V,qu=Cr(dE),pE=Ce,Lu=se,yE=D,gE=Cr(yE);function Cr(r){return r&&r.__esModule?r:{default:r}}function vE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _E=Lt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pE.UnsignedInt.MAX_VALUE;vE(this,r),this._childType=e,this._maxLength=t}return oE(r,[{key:"read",value:function(t){var n=this,i=Lu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,hE.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,qu.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));Lu.Int.write(t.length,n),(0,cE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,qu.default)(t)||t.length>this._maxLength?!1:(0,sE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,gE.default)(_E.prototype);var kt={};function mE(r){return r===null}var wE=mE;function bE(r){return r===void 0}var Nr=bE;Object.defineProperty(kt,"__esModule",{value:!0}),kt.Option=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}}(),EE=wE,ku=di(EE),AE=Nr,ju=di(AE),Vu=Mr,SE=D,OE=di(SE);function di(r){return r&&r.__esModule?r:{default:r}}function IE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var PE=kt.Option=function(){function r(e){IE(this,r),this._childType=e}return $E(r,[{key:"read",value:function(t){if(Vu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,ku.default)(t)||(0,ju.default)(t));Vu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,ku.default)(t)||(0,ju.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,OE.default)(PE.prototype);var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Void=void 0;var xE=Nr,Gu=Hu(xE),TE=D,RE=Hu(TE);function Hu(r){return r&&r.__esModule?r:{default:r}}var FE=Br.Void={read:function(){},write:function(e){if(!(0,Gu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Gu.default)(e)}};(0,RE.default)(FE);var jt={},ME=si;function DE(r,e){return ME(e,function(t){return r[t]})}var CE=DE,NE=CE,BE=$t;function UE(r){return r==null?[]:NE(r,BE(r))}var qE=UE;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Enum=void 0;var 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=nr,jE=pi(kE),VE=qE,GE=pi(VE),Wu=se,HE=D,WE=pi(HE);function pi(r){return r&&r.__esModule?r:{default:r}}function XE(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 Xu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YE=jt.Enum=function(){function r(e,t){Xu(this,r),this.name=e,this.value=t}return LE(r,null,[{key:"read",value:function(t){var n=Wu.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);Wu.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,GE.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){zE(u,o);function u(){return Xu(this,u),XE(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,jE.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,WE.default)(YE);var Vt={},KE=Kn,ZE=Or;function JE(r,e){var t=-1,n=ZE(r)?Array(r.length):[];return KE(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var QE=JE,eA=si,rA=ou,tA=QE,nA=V;function iA(r,e){var t=nA(r)?eA:tA;return t(r,rA(e))}var aA=iA;function oA(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 uA=oA,Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var sA=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 fA(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ur.Reference=function(){function r(){fA(this,r)}return sA(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Struct=void 0;var Gt=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")}}(),cA=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}}(),lA=nr,zu=qr(lA),hA=aA,dA=qr(hA),pA=Nr,yA=qr(pA),gA=uA,vA=qr(gA),_A=Ur,mA=D,wA=qr(mA);function qr(r){return r&&r.__esModule?r:{default:r}}function bA(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 $A(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 Yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EA=Vt.Struct=function(){function r(e){Yu(this,r),this._attributes=e||{}}return cA(r,null,[{key:"read",value:function(t){var n=(0,dA.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],u=a[1],f=u.read(t);return[o,f]});return new this((0,vA.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,zu.default)(this._fields,function(i){var a=Gt(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){$A(u,o);function u(){return Yu(this,u),bA(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=Gt(o,2),f=u[0],c=u[1];return c instanceof _A.Reference&&(c=c.resolve(t)),[f,c]}),(0,zu.default)(a._fields,function(o){var u=Gt(o,1),f=u[0];a.prototype[f]=AA(f)}),a}}]),r}();(0,wA.default)(EA);function AA(r){return function(t){return(0,yA.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Union=void 0;var SA=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")}}(),OA=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}}(),IA=nr,Wt=zt(IA),PA=Nr,Ku=zt(PA),xA=Ou,Zu=zt(xA),Xt=Br,yi=Ur,TA=D,RA=zt(TA);function zt(r){return r&&r.__esModule?r:{default:r}}function FA(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 MA(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 Ju(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var DA=Ht.Union=function(){function r(e,t){Ju(this,r),this.set(e,t)}return OA(r,[{key:"set",value:function(t,n){(0,Zu.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!==Xt.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===Xt.Void?Xt.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,Ku.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){MA(f,u);function f(){return Ju(this,f),FA(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Wt.default)(i.arms,function(u,f){u instanceof yi.Reference&&(u=u.resolve(t)),a._arms[f]=u});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Wt.default)(i.switches,function(u){var f=SA(u,2),c=f[0],l=f[1];(0,Zu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,Ku.default)(a._switchOn.values)||(0,Wt.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,Wt.default)(a._arms,function(u,f){u!==Xt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,RA.default)(DA),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=se;Object.keys(e).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return e[d]}})});var t=Rt;Object.keys(t).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return t[d]}})});var n=Ce;Object.keys(n).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return n[d]}})});var i=Ft;Object.keys(i).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return i[d]}})});var a=Mt;Object.keys(a).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return a[d]}})});var o=Dt;Object.keys(o).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return o[d]}})});var u=Ct;Object.keys(u).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return u[d]}})});var f=Mr;Object.keys(f).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return f[d]}})});var c=Nt;Object.keys(c).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return c[d]}})});var l=Bt;Object.keys(l).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return l[d]}})});var s=Ut;Object.keys(s).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return s[d]}})});var h=qt;Object.keys(h).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return h[d]}})});var y=Lt;Object.keys(y).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return y[d]}})});var w=kt;Object.keys(w).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return w[d]}})});var A=Br;Object.keys(A).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return A[d]}})});var O=jt;Object.keys(O).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return O[d]}})});var b=Vt;Object.keys(b).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return b[d]}})});var E=Ht;Object.keys(E).forEach(function(d){d==="default"||d==="__esModule"||Object.defineProperty(r,d,{enumerable:!0,get:function(){return E[d]}})})}(Hn);var Qu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(g,v){for(var S=0;S<v.length;S++){var P=v[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,v,S){return v&&m(g.prototype,v),S&&m(g,S),g}}(),t=Ur;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=w;var n=Nr,i=l(n),a=nr,o=l(a),u=Hn,f=c(u);function c(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(g[v]=m[v]);return g.default=m,g}function l(m){return m&&m.__esModule?m:{default:m}}function s(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function h(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function y(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}function w(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var v=new F(g);m(v),v.resolve()}return g}var A=function(m){y(g,m);function g(v){s(this,g);var S=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return S.name=v,S}return e(g,[{key:"resolve",value:function(S){var P=S.definitions[this.name];return P.resolve(S)}}]),g}(t.Reference),O=function(m){y(g,m);function g(v,S){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(this,g);var M=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=v,M.length=S,M.variable=P,M}return e(g,[{key:"resolve",value:function(S){var P=this.childReference,M=this.length;return P instanceof t.Reference&&(P=P.resolve(S)),M instanceof t.Reference&&(M=M.resolve(S)),this.variable?new f.VarArray(P,M):new f.Array(P,M)}}]),g}(t.Reference),b=function(m){y(g,m);function g(v){s(this,g);var S=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return S.childReference=v,S.name=v.name,S}return e(g,[{key:"resolve",value:function(S){var P=this.childReference;return P instanceof t.Reference&&(P=P.resolve(S)),new f.Option(P)}}]),g}(t.Reference),E=function(m){y(g,m);function g(v,S){s(this,g);var P=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return P.sizedType=v,P.length=S,P}return e(g,[{key:"resolve",value:function(S){var P=this.length;return P instanceof t.Reference&&(P=P.resolve(S)),new this.sizedType(P)}}]),g}(t.Reference),d=function(){function m(g,v,S){s(this,m),this.constructor=g,this.name=v,this.config=S}return e(m,[{key:"resolve",value:function(v){return this.name in v.results?v.results[this.name]:this.constructor(v,this.name,this.config)}}]),m}();function I(m,g,v){return v instanceof t.Reference&&(v=v.resolve(m)),m.results[g]=v,v}function T(m,g,v){return m.results[g]=v,v}var F=function(){function m(g){s(this,m),this._destination=g,this._definitions={}}return e(m,[{key:"enum",value:function(v,S){var P=new d(f.Enum.create,v,S);this.define(v,P)}},{key:"struct",value:function(v,S){var P=new d(f.Struct.create,v,S);this.define(v,P)}},{key:"union",value:function(v,S){var P=new d(f.Union.create,v,S);this.define(v,P)}},{key:"typedef",value:function(v,S){var P=new d(I,v,S);this.define(v,P)}},{key:"const",value:function(v,S){var P=new d(T,v,S);this.define(v,P)}},{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 E(f.String,v)}},{key:"opaque",value:function(v){return new E(f.Opaque,v)}},{key:"varOpaque",value:function(v){return new E(f.VarOpaque,v)}},{key:"array",value:function(v,S){return new O(v,S)}},{key:"varArray",value:function(v,S){return new O(v,S,!0)}},{key:"option",value:function(v){return new b(v)}},{key:"define",value:function(v,S){if((0,i.default)(this._destination[v]))this._definitions[v]=S;else throw new Error("XDRTypes Error:"+v+" is already defined")}},{key:"lookup",value:function(v){return new A(v)}},{key:"resolve",value:function(){var v=this;(0,o.default)(this._definitions,function(S){S.resolve({definitions:v._definitions,results:v._destination})})}}]),m}()})(Qu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Hn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=Qu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(to);var gi=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(gi(r,e,"read from private field"),t?t.call(r):e.get(r)),Ne=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},vi=(r,e,t,n)=>(gi(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),_e=(r,e,t)=>(gi(r,e,"access private method"),t),ne,ie,Lr,_i,es,mi,rs,Yt,wi,ir,kr;function CA(r){const e={variantId:ce.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ce.BundleItem({collectionId:ce.Uint64.fromString(n.collectionId.toString()),productId:ce.Uint64.fromString(n.productId.toString()),variantId:ce.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ce.BundleItemExt(0)})),ext:new ce.BundleExt(0)},t=new ce.Bundle(e);return ce.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ce=to.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")}})});class NA{constructor(e,t){Ne(this,_i),Ne(this,mi),Ne(this,Yt),Ne(this,ir),Ne(this,ne,void 0),Ne(this,ie,void 0),Ne(this,Lr,void 0),vi(this,ne,_e(this,_i,es).call(this,t)),vi(this,Lr,_e(this,mi,rs).call(this,t)),vi(this,ie,e)}isInitialDataValid(){if(!j(this,Lr))throw"Bundle data does not exist for the given product.";if(!j(this,ne))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(j(this,ie))||!j(this,ie).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!j(this,ne)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=j(this,ie).reduce((i,a)=>i+a.quantity,0),n=j(this,ne)?.variantsSettings[e].ranges||[];if(!_e(this,Yt,wi).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=j(this,ne)?.bundleSettings.maxPerItem||0,t=j(this,ie).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${_e(this,ir,kr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=j(this,ne)?.variantsSettings[e],n=j(this,ie).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${_e(this,ir,kr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=j(this,ie).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=j(this,ne)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!_e(this,Yt,wi).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${_e(this,ir,kr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=j(this,ne)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const u=j(this,Lr)?.collections[o.collectionId];return u&&(a[o.collectionId]=u),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=j(this,ie).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${_e(this,ir,kr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ne=new WeakMap,ie=new WeakMap,Lr=new WeakMap,_i=new WeakSet,es=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},mi=new WeakSet,rs=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},Yt=new WeakSet,wi=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},ir=new WeakSet,kr=function(r){return Array.from(new Set(r))};const BA="/bundling-storefront-manager";function ts(r){return CA({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function UA(r){const e=W(),t=await bi(r);if(t!==!0)throw new Error(t);const n=ts(r);try{const i=await Er("post",`${BA}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function qA(r,e){const t=await bi(e);if(t!==!0)throw new Error(t);const n=ts(e);try{const i=await $("post","/bundle_selections/bundle_id",{data:{bundle:n}},_(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function LA(r,e){const t=ns(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Vi(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 bi(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function kA(r){try{const e=await Er("get",`/bundle-data/${r.externalProductId}`);return{valid:new NA(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const jA={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 ns(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=jA[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 VA(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await $("get","/bundle_selections",{id:e},_(r,"getBundleSelection"));return t}function GA(r,e){return $("get","/bundle_selections",{query:e},_(r,"listBundleSelections"))}async function HA(r,e){const{bundle_selection:t}=await $("post","/bundle_selections",{data:e},_(r,"createBundleSelection"));return t}async function WA(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await $("put","/bundle_selections",{id:e,data:t},_(r,"updateBundleSelection"));return n}function XA(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/bundle_selections",{id:e},_(r,"deleteBundleSelection"))}async function zA(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await $("put","/bundles",{id:e,data:t,query:n},_(r,"updateBundle"));return i}var YA=Object.freeze({__proto__:null,createBundleSelection:HA,deleteBundleSelection:XA,getBundleId:UA,getBundleSelection:VA,getBundleSelectionId:qA,getDynamicBundleItems:LA,listBundleSelections:GA,updateBundle:zA,updateBundleSelection:WA,validateBundle:bi,validateBundleSelection:kA,validateDynamicBundle:ns}),KA=200,$i="__lodash_hash_undefined__",ZA=1/0,is=9007199254740991,JA="[object Arguments]",QA="[object Function]",eS="[object GeneratorFunction]",rS="[object Symbol]",tS=/[\\^$.*+?()[\]{}|]/g,nS=/^\[object .+?Constructor\]$/,iS=/^(?:0|[1-9]\d*)$/,aS=typeof U=="object"&&U&&U.Object===Object&&U,oS=typeof self=="object"&&self&&self.Object===Object&&self,Ei=aS||oS||Function("return this")();function uS(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 sS(r,e){var t=r?r.length:0;return!!t&&lS(r,e,0)>-1}function fS(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function as(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 Ai(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function cS(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 lS(r,e,t){if(e!==e)return cS(r,hS,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function hS(r){return r!==r}function dS(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function pS(r){return function(e){return r(e)}}function yS(r,e){return r.has(e)}function gS(r,e){return r?.[e]}function vS(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function os(r,e){return function(t){return r(e(t))}}var _S=Array.prototype,mS=Function.prototype,Kt=Object.prototype,Si=Ei["__core-js_shared__"],us=function(){var r=/[^.]+$/.exec(Si&&Si.keys&&Si.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),ss=mS.toString,ar=Kt.hasOwnProperty,Oi=Kt.toString,wS=RegExp("^"+ss.call(ar).replace(tS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=Ei.Symbol,bS=os(Object.getPrototypeOf,Object),$S=Kt.propertyIsEnumerable,ES=_S.splice,cs=fs?fs.isConcatSpreadable:void 0,Ii=Object.getOwnPropertySymbols,ls=Math.max,AS=ds(Ei,"Map"),jr=ds(Object,"create");function Be(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 SS(){this.__data__=jr?jr(null):{}}function OS(r){return this.has(r)&&delete this.__data__[r]}function IS(r){var e=this.__data__;if(jr){var t=e[r];return t===$i?void 0:t}return ar.call(e,r)?e[r]:void 0}function PS(r){var e=this.__data__;return jr?e[r]!==void 0:ar.call(e,r)}function xS(r,e){var t=this.__data__;return t[r]=jr&&e===void 0?$i:e,this}Be.prototype.clear=SS,Be.prototype.delete=OS,Be.prototype.get=IS,Be.prototype.has=PS,Be.prototype.set=xS;function or(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 TS(){this.__data__=[]}function RS(r){var e=this.__data__,t=Jt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():ES.call(e,t,1),!0}function FS(r){var e=this.__data__,t=Jt(e,r);return t<0?void 0:e[t][1]}function MS(r){return Jt(this.__data__,r)>-1}function DS(r,e){var t=this.__data__,n=Jt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}or.prototype.clear=TS,or.prototype.delete=RS,or.prototype.get=FS,or.prototype.has=MS,or.prototype.set=DS;function ur(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 CS(){this.__data__={hash:new Be,map:new(AS||or),string:new Be}}function NS(r){return Qt(this,r).delete(r)}function BS(r){return Qt(this,r).get(r)}function US(r){return Qt(this,r).has(r)}function qS(r,e){return Qt(this,r).set(r,e),this}ur.prototype.clear=CS,ur.prototype.delete=NS,ur.prototype.get=BS,ur.prototype.has=US,ur.prototype.set=qS;function Zt(r){var e=-1,t=r?r.length:0;for(this.__data__=new ur;++e<t;)this.add(r[e])}function LS(r){return this.__data__.set(r,$i),this}function kS(r){return this.__data__.has(r)}Zt.prototype.add=Zt.prototype.push=LS,Zt.prototype.has=kS;function jS(r,e){var t=Pi(r)||ps(r)?dS(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||ar.call(r,a))&&!(i&&(a=="length"||eO(a,n)))&&t.push(a);return t}function Jt(r,e){for(var t=r.length;t--;)if(uO(r[t][0],e))return t;return-1}function VS(r,e,t,n){var i=-1,a=sS,o=!0,u=r.length,f=[],c=e.length;if(!u)return f;t&&(e=as(e,pS(t))),n?(a=fS,o=!1):e.length>=KA&&(a=yS,o=!1,e=new Zt(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 hs(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=QS),i||(i=[]);++a<o;){var u=r[a];e>0&&t(u)?e>1?hs(u,e-1,t,n,i):Ai(i,u):n||(i[i.length]=u)}return i}function GS(r,e,t){var n=e(r);return Pi(r)?n:Ai(n,t(r))}function HS(r){if(!xi(r)||tO(r))return!1;var e=gs(r)||vS(r)?wS:nS;return e.test(oO(r))}function WS(r){if(!xi(r))return iO(r);var e=nO(r),t=[];for(var n in r)n=="constructor"&&(e||!ar.call(r,n))||t.push(n);return t}function XS(r,e){return r=Object(r),zS(r,e,function(t,n){return n in r})}function zS(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 YS(r,e){return e=ls(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=ls(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,uS(r,this,o)}}function KS(r){return GS(r,lO,JS)}function Qt(r,e){var t=r.__data__;return rO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function ds(r,e){var t=gS(r,e);return HS(t)?t:void 0}var ZS=Ii?os(Ii,Object):_s,JS=Ii?function(r){for(var e=[];r;)Ai(e,ZS(r)),r=bS(r);return e}:_s;function QS(r){return Pi(r)||ps(r)||!!(cs&&r&&r[cs])}function eO(r,e){return e=e??is,!!e&&(typeof r=="number"||iS.test(r))&&r>-1&&r%1==0&&r<e}function rO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function tO(r){return!!us&&us in r}function nO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Kt;return r===t}function iO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function aO(r){if(typeof r=="string"||cO(r))return r;var e=r+"";return e=="0"&&1/r==-ZA?"-0":e}function oO(r){if(r!=null){try{return ss.call(r)}catch{}try{return r+""}catch{}}return""}function uO(r,e){return r===e||r!==r&&e!==e}function ps(r){return sO(r)&&ar.call(r,"callee")&&(!$S.call(r,"callee")||Oi.call(r)==JA)}var Pi=Array.isArray;function ys(r){return r!=null&&fO(r.length)&&!gs(r)}function sO(r){return vs(r)&&ys(r)}function gs(r){var e=xi(r)?Oi.call(r):"";return e==QA||e==eS}function fO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=is}function xi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function vs(r){return!!r&&typeof r=="object"}function cO(r){return typeof r=="symbol"||vs(r)&&Oi.call(r)==rS}function lO(r){return ys(r)?jS(r,!0):WS(r)}var hO=YS(function(r,e){return r==null?{}:(e=as(hs(e,1),aO),XS(r,VS(KS(r),e)))});function _s(){return[]}var dO=hO,Ti=be(dO);function pO(r){try{return JSON.parse(r)}catch{return r}}function yO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:pO(n)}),{})}const ms=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function ws(r){const e=yO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...Ti(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function bs(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function gO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=bs(i)}),t})}const Ri="2020-12",vO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Vr=new Map;function en(r,e){return Vr.has(r)||Vr.set(r,e()),Vr.get(r)}async function Fi(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await en(`product.${r}.${t}`,()=>pt("get",`/product/${t}/${r}.json`));return t==="2020-12"?bs(n):n}async function $s(){return await en("storeSettings",()=>pt("get",`/${Ri}/store_settings.json`).catch(()=>vO))}async function Es(){const{widget_settings:r}=await en("widgetSettings",()=>pt("get",`/${Ri}/widget_settings.json`));return ws(r)}async function As(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await en("productsAndSettings",()=>pt("get",`/product/${Ri}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:gO(r),widget_settings:ws(e),store_settings:t??{}}}async function _O(){const{products:r}=await As();return r}async function mO(r){const[e,t,n]=await Promise.all([Fi(r),$s(),Es()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function wO(r){const{bundle_product:e}=await Fi(r);return e}async function Ss(){return Array.from(Vr.keys()).forEach(r=>Vr.delete(r))}var bO=Object.freeze({__proto__:null,getCDNBundleSettings:wO,getCDNProduct:Fi,getCDNProductAndSettings:mO,getCDNProducts:_O,getCDNProductsAndSettings:As,getCDNStoreSettings:$s,getCDNWidgetSettings:Es,resetCDNCache:Ss});async function $O(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("get","/charges",{id:e,query:{include:t?.include}},_(r,"getCharge"));return n}function EO(r,e){return $("get","/charges",{query:e},_(r,"listCharges"))}async function AO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},_(r,"applyDiscountToCharge"));return n}async function SO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await $("post",`/charges/${e}/remove_discount`,{},_(r,"removeDiscountsFromCharge"));return t}async function OO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await $("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},_(r,"skipCharge"));return i}async function IO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await $("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},_(r,"unskipCharge"));return i}async function PO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await $("post",`/charges/${e}/process`,{},_(r,"processCharge"));return t}var xO=Object.freeze({__proto__:null,applyDiscountToCharge:AO,getCharge:$O,listCharges:EO,processCharge:PO,removeDiscountsFromCharge:SO,skipCharge:OO,unskipCharge:IO});async function Os(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return $("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},_(r,"productSearch"))}var TO=Object.freeze({__proto__:null,productSearch:Os});async function Is(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await $("get","/collections",{id:e},_(r,"getCollection"));return t}function RO(r,e){return $("get","/collections",{query:e},_(r,"listCollections"))}async function FO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=_(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Is(n,e),Os(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((u,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&u.push(c),u},[])};{const u=MO(i);return{products:o.slice().sort(u)}}}function Ps(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function xs(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Ts(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function MO(r){switch(r){case"created_at-asc":return Ps;case"created_at-desc":return(e,t)=>Ps(t,e);case"id-asc":return xs;case"id-desc":return(e,t)=>xs(t,e);case"title-asc":return Ts;case"title-desc":return(e,t)=>Ts(t,e)}}var DO=Object.freeze({__proto__:null,getCollection:Is,listCollectionProducts:FO,listCollections:RO});async function CO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("get","/customers",{id:t,query:{include:e?.include}},_(r,"getCustomer"));return n}async function Rs(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("put","/customers",{id:t,data:e},_(r,"updateCustomer"));return n}async function NO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await $("get",`/customers/${t}/delivery_schedule`,{query:e},_(r,"getDeliverySchedule"));return n}async function rn(r,e){return $("get","/portal_access",{query:e},_(r,"getCustomerPortalAccess"))}async function BO(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await rn(_(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function UO(r){const{base_url:e,customer_hash:t,temp_token:n}=await rn(_(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function qO(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await rn(_(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const LO={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function kO(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=LO[e];if(!i)throw new Error("Notification not supported.");return $("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},_(r,"sendCustomerNotification"))}async function jO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},_(r,"getCreditSummary"));return n}var VO=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:BO,getCreditSummary:jO,getCustomer:CO,getCustomerPortalAccess:rn,getDeliverySchedule:NO,getFailedPaymentMethodRecoveryLandingPageURL:UO,getGiftRedemptionLandingPageURL:qO,sendCustomerNotification:kO,updateCustomer:Rs});async function GO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},_(r,"getCreditSummary"));return n}function HO(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),Rs(_(r,"setApplyCreditsToNextCharge"),t)}async function WO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await $("get","/credit_accounts",{query:{customer_id:t,...e}},_(r,"listCreditAccounts"))}var XO=Object.freeze({__proto__:null,getCreditSummary:GO,listCreditAccounts:WO,setApplyCreditsToNextCharge:HO});function zO(r,e){if(!r.customerId)throw new Error("Not logged in.");return $("get","/gift_purchases",{query:e},_(r,"listGiftPurchases"))}async function YO(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await $("get","/gift_purchases",{id:e},_(r,"getGiftPurchase"));return t}var KO=Object.freeze({__proto__:null,getGiftPurchase:YO,listGiftPurchases:zO});async function ZO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await $("get","/memberships",{id:e},_(r,"getMembership"));return t}function JO(r,e){return $("get","/memberships",{query:e},_(r,"listMemberships"))}async function QO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/cancel`,{data:t},_(r,"cancelMembership"));return n}async function eI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/activate`,{data:t},_(r,"activateMembership"));return n}async function rI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/change`,{data:t},_(r,"changeMembership"));return n}var tI=Object.freeze({__proto__:null,activateMembership:eI,cancelMembership:QO,changeMembership:rI,getMembership:ZO,listMemberships:JO});async function nI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await $("get","/membership_programs",{id:e,query:{include:t?.include}},_(r,"getMembershipProgram"));return n}function iI(r,e){return $("get","/membership_programs",{query:e},_(r,"listMembershipPrograms"))}var aI=Object.freeze({__proto__:null,getMembershipProgram:nI,listMembershipPrograms:iI});async function oI(r,e){const{metafield:t}=await $("post","/metafields",{data:{metafield:e}},_(r,"createMetafield"));return t}async function uI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await $("put","/metafields",{id:e,data:{metafield:t}},_(r,"updateMetafield"));return n}function sI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/metafields",{id:e},_(r,"deleteMetafield"))}var fI=Object.freeze({__proto__:null,createMetafield:oI,deleteMetafield:sI,updateMetafield:uI});async function cI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await $("get","/onetimes",{id:e},_(r,"getOnetime"));return t}function lI(r,e){return $("get","/onetimes",{query:e},_(r,"listOnetimes"))}async function hI(r,e){const{onetime:t}=await $("post","/onetimes",{data:e},_(r,"createOnetime"));return t}async function dI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await $("put","/onetimes",{id:e,data:t},_(r,"updateOnetime"));return n}function pI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/onetimes",{id:e},_(r,"deleteOnetime"))}var yI=Object.freeze({__proto__:null,createOnetime:hI,deleteOnetime:pI,getOnetime:cI,listOnetimes:lI,updateOnetime:dI});async function gI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await $("get","/orders",{id:e},_(r,"getOrder"));return t}function vI(r,e){return $("get","/orders",{query:e},_(r,"listOrders"))}async function _I(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await $("post",`/orders/${e}/delay`,{},_(r,"delayOrder"));return t}var mI=Object.freeze({__proto__:null,delayOrder:_I,getOrder:gI,listOrders:vI});async function wI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await $("get","/payment_methods",{id:e,query:{include:t?.include}},_(r,"getPaymentMethod"));return n}async function bI(r,e){const{payment_method:t}=await $("post","/payment_methods",{data:{...e,customer_id:r.customerId}},_(r,"createPaymentMethod"));return t}async function $I(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await $("put","/payment_methods",{id:e,data:t},_(r,"updatePaymentMethod"));return n}function EI(r,e){return $("get","/payment_methods",{query:e},_(r,"listPaymentMethods"))}var AI=Object.freeze({__proto__:null,createPaymentMethod:bI,getPaymentMethod:wI,listPaymentMethods:EI,updatePaymentMethod:$I});async function SI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await $("get","/plans",{id:e},_(r,"getPlan"));return t}function OI(r,e){return $("get","/plans",{query:e},_(r,"listPlans"))}var II=Object.freeze({__proto__:null,getPlan:SI,listPlans:OI});async function PI(r,e){return await $("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},_(r,"getShippingCountries"))}async function xI(r){return await $("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},_(r,"getStoreSettings"))}var TI=Object.freeze({__proto__:null,getShippingCountries:PI,getStoreSettings:xI}),RI="Expected a function",Fs="__lodash_placeholder__",Ue=1,tn=2,FI=4,sr=8,Gr=16,qe=32,Hr=64,Ms=128,MI=256,Ds=512,Cs=1/0,DI=9007199254740991,CI=17976931348623157e292,Ns=0/0,NI=[["ary",Ms],["bind",Ue],["bindKey",tn],["curry",sr],["curryRight",Gr],["flip",Ds],["partial",qe],["partialRight",Hr],["rearg",MI]],BI="[object Function]",UI="[object GeneratorFunction]",qI="[object Symbol]",LI=/[\\^$.*+?()[\]{}|]/g,kI=/^\s+|\s+$/g,jI=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,VI=/\{\n\/\* \[wrapped with (.+)\] \*/,GI=/,? & /,HI=/^[-+]0x[0-9a-f]+$/i,WI=/^0b[01]+$/i,XI=/^\[object .+?Constructor\]$/,zI=/^0o[0-7]+$/i,YI=/^(?:0|[1-9]\d*)$/,KI=parseInt,ZI=typeof U=="object"&&U&&U.Object===Object&&U,JI=typeof self=="object"&&self&&self.Object===Object&&self,Wr=ZI||JI||Function("return this")();function Mi(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 QI(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function e2(r,e){var t=r?r.length:0;return!!t&&t2(r,e,0)>-1}function r2(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 t2(r,e,t){if(e!==e)return r2(r,n2,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function n2(r){return r!==r}function i2(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function a2(r,e){return r?.[e]}function o2(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Di(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Fs)&&(r[t]=Fs,a[i++]=t)}return a}var u2=Function.prototype,Bs=Object.prototype,Ci=Wr["__core-js_shared__"],Us=function(){var r=/[^.]+$/.exec(Ci&&Ci.keys&&Ci.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),qs=u2.toString,s2=Bs.hasOwnProperty,Ls=Bs.toString,f2=RegExp("^"+qs.call(s2).replace(LI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),c2=Object.create,fr=Math.max,l2=Math.min,ks=function(){var r=Vs(Object,"defineProperty"),e=Vs.name;return e&&e.length>2?r:void 0}();function h2(r){return cr(r)?c2(r):{}}function d2(r){if(!cr(r)||S2(r))return!1;var e=x2(r)||o2(r)?f2:XI;return e.test(I2(r))}function p2(r,e){return e=fr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=fr(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,Mi(r,this,o)}}function y2(r,e,t,n){for(var i=-1,a=r.length,o=t.length,u=-1,f=e.length,c=fr(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 g2(r,e,t,n){for(var i=-1,a=r.length,o=-1,u=t.length,f=-1,c=e.length,l=fr(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 v2(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function _2(r,e,t){var n=e&Ue,i=Xr(r);function a(){var o=this&&this!==Wr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function Xr(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=h2(r.prototype),n=r.apply(t,e);return cr(n)?n:t}}function m2(r,e,t){var n=Xr(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?[]:Di(o,f);if(a-=c.length,a<t)return js(r,e,Ni,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Wr&&this instanceof i?n:r;return Mi(l,this,o)}return i}function Ni(r,e,t,n,i,a,o,u,f,c){var l=e&Ms,s=e&Ue,h=e&tn,y=e&(sr|Gr),w=e&Ds,A=h?void 0:Xr(r);function O(){for(var b=arguments.length,E=Array(b),d=b;d--;)E[d]=arguments[d];if(y)var I=Bi(O),T=i2(E,I);if(n&&(E=y2(E,n,i,y)),a&&(E=g2(E,a,o,y)),b-=T,y&&b<c){var F=Di(E,I);return js(r,e,Ni,O.placeholder,t,E,F,u,f,c-b)}var m=s?t:this,g=h?m[r]:r;return b=E.length,u?E=O2(E,u):w&&b>1&&E.reverse(),l&&f<b&&(E.length=f),this&&this!==Wr&&this instanceof O&&(g=A||Xr(g)),g.apply(m,E)}return O}function w2(r,e,t,n){var i=e&Ue,a=Xr(r);function o(){for(var u=-1,f=arguments.length,c=-1,l=n.length,s=Array(l+f),h=this&&this!==Wr&&this instanceof o?a:r;++c<l;)s[c]=n[c];for(;f--;)s[c++]=arguments[++u];return Mi(h,i?t:this,s)}return o}function js(r,e,t,n,i,a,o,u,f,c){var l=e&sr,s=l?o:void 0,h=l?void 0:o,y=l?a:void 0,w=l?void 0:a;e|=l?qe:Hr,e&=~(l?Hr:qe),e&FI||(e&=~(Ue|tn));var A=t(r,e,i,y,s,w,h,u,f,c);return A.placeholder=n,Gs(A,r,e)}function b2(r,e,t,n,i,a,o,u){var f=e&tn;if(!f&&typeof r!="function")throw new TypeError(RI);var c=n?n.length:0;if(c||(e&=~(qe|Hr),n=i=void 0),o=o===void 0?o:fr(Hs(o),0),u=u===void 0?u:Hs(u),c-=i?i.length:0,e&Hr){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:fr(h[9]-c,0),!u&&e&(sr|Gr)&&(e&=~(sr|Gr)),!e||e==Ue)var y=_2(r,e,t);else e==sr||e==Gr?y=m2(r,e,u):(e==qe||e==(Ue|qe))&&!i.length?y=w2(r,e,t,n):y=Ni.apply(void 0,h);return Gs(y,r,e)}function Bi(r){var e=r;return e.placeholder}function Vs(r,e){var t=a2(r,e);return d2(t)?t:void 0}function $2(r){var e=r.match(VI);return e?e[1].split(GI):[]}function E2(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(jI,`{
|
|
24
|
+
*/(function(e,t){typeof n1=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,s,d){this.low=l|0,this.high=s|0,this.unsigned=!!d}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,d){var y,w;return d?(s=s>>>0,0<=s&&s<256&&(w=n[s],w)?w:(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&&(w=t[s],w)?w:(y=new e(s,s<0?-1:0,!1),-128<=s&&s<128&&(t[s]=y),y))},e.fromNumber=function(s,d){return d=!!d,isNaN(s)||!isFinite(s)?e.ZERO:!d&&s<=-f?e.MIN_VALUE:!d&&s+1>=f?e.MAX_VALUE:d&&s>=u?e.MAX_UNSIGNED_VALUE:s<0?e.fromNumber(-s,d).negate():new e(s%o|0,s/o|0,d)},e.fromBits=function(s,d,y){return new e(s,d,y)},e.fromString=function(s,d,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 d=="number"&&(y=d,d=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var w;if((w=s.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+s);if(w===0)return e.fromString(s.substring(1),d,y).negate();for(var S=e.fromNumber(Math.pow(y,8)),O=e.ZERO,b=0;b<s.length;b+=8){var E=Math.min(8,s.length-b),p=parseInt(s.substring(b,b+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));O=O.multiply(I).add(e.fromNumber(p))}else O=O.multiply(S),O=O.add(e.fromNumber(p))}return O.unsigned=d,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 d;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(s),w=this.divide(y);return d=w.multiply(y).subtract(this),w.toString(s)+d.toInt().toString(s)}else return"-"+this.negate().toString(s);var S=e.fromNumber(Math.pow(s,6),this.unsigned);d=this;for(var O="";;){var b=d.divide(S),E=d.subtract(b.multiply(S)).toInt()>>>0,p=E.toString(s);if(d=b,d.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,d=31;d>0&&!(s&1<<d);d--);return this.high!=0?d+33:d+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 d=this.isNegative(),y=s.isNegative();return d&&!y?-1:!d&&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 d=this.high>>>16,y=this.high&65535,w=this.low>>>16,S=this.low&65535,O=s.high>>>16,b=s.high&65535,E=s.low>>>16,p=s.low&65535,I=0,T=0,F=0,m=0;return m+=S+p,F+=m>>>16,m&=65535,F+=w+E,T+=F>>>16,F&=65535,T+=y+b,I+=T>>>16,T&=65535,I+=d+O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d=this.high>>>16,y=this.high&65535,w=this.low>>>16,S=this.low&65535,O=s.high>>>16,b=s.high&65535,E=s.low>>>16,p=s.low&65535,I=0,T=0,F=0,m=0;return m+=S*p,F+=m>>>16,m&=65535,F+=w*p,T+=F>>>16,F&=65535,F+=S*E,T+=F>>>16,F&=65535,T+=y*p,I+=T>>>16,T&=65535,T+=w*E,I+=T>>>16,T&=65535,T+=S*b,I+=T>>>16,T&=65535,I+=d*p+y*E+w*b+S*O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d,y,w;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 S=this.shiftRight(1);return d=S.divide(s).shiftLeft(1),d.equals(e.ZERO)?s.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(s.multiply(d)),w=d.add(y.divide(s)),w)}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(w=e.ZERO,y=this;y.greaterThanOrEqual(s);){d=Math.max(1,Math.floor(y.toNumber()/s.toNumber()));for(var O=Math.ceil(Math.log(d)/Math.LN2),b=O<=48?1:Math.pow(2,O-48),E=e.fromNumber(d),p=E.multiply(s);p.isNegative()||p.greaterThan(y);)d-=b,E=e.fromNumber(d,this.unsigned),p=E.multiply(s);E.isZero()&&(E=e.ONE),w=w.add(E),y=y.subtract(p)}return w},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 d=this.high;if(s<32){var y=this.low;return e.fromBits(y>>>s|d<<32-s,d>>>s,this.unsigned)}else return s===32?e.fromBits(d,0,this.unsigned):e.fromBits(d>>>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})})(yu);var gu=yu.exports;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Hyper=void 0;var i1=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}}(),_u=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)}},a1=gu,xr=vu(a1),o1=D,u1=vu(o1);function vu(r){return r&&r.__esModule?r:{default:r}}function s1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function f1(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 c1(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 Pr=Rt.Hyper=function(r){c1(e,r),i1(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=_u(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=_u(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 s1(this,e),f1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(xr.default);(0,u1.default)(Pr),Pr.MAX_VALUE=new Pr(xr.default.MAX_VALUE.low,xr.default.MAX_VALUE.high),Pr.MIN_VALUE=new Pr(xr.default.MIN_VALUE.low,xr.default.MIN_VALUE.high);var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.UnsignedInt=void 0;var l1=gt,mu=wu(l1),d1=D,p1=wu(d1);function wu(r){return r&&r.__esModule?r:{default:r}}var Tr=Ne.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,mu.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,mu.default)(e)||Math.floor(e)!==e?!1:e>=Tr.MIN_VALUE&&e<=Tr.MAX_VALUE}};Tr.MAX_VALUE=Math.pow(2,32)-1,Tr.MIN_VALUE=0,(0,p1.default)(Tr);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.UnsignedHyper=void 0;var h1=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}}(),bu=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)}},y1=gu,Rr=$u(y1),g1=D,_1=$u(g1);function $u(r){return r&&r.__esModule?r:{default:r}}function v1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(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 w1(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 Fr=Ft.UnsignedHyper=function(r){w1(e,r),h1(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=bu(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=bu(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 v1(this,e),m1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Rr.default);(0,_1.default)(Fr),Fr.MAX_VALUE=new Fr(Rr.default.MAX_UNSIGNED_VALUE.low,Rr.default.MAX_UNSIGNED_VALUE.high),Fr.MIN_VALUE=new Fr(Rr.default.MIN_VALUE.low,Rr.default.MIN_VALUE.high);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Float=void 0;var b1=gt,Eu=Su(b1),$1=D,E1=Su($1);function Su(r){return r&&r.__esModule?r:{default:r}}var S1=Mt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Eu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Eu.default)(e)}};(0,E1.default)(S1);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Double=void 0;var A1=gt,Au=Ou(A1),O1=D,I1=Ou(O1);function Ou(r){return r&&r.__esModule?r:{default:r}}var x1=Dt.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,I1.default)(x1);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Quadruple=void 0;var P1=D,T1=R1(P1);function R1(r){return r&&r.__esModule?r:{default:r}}var F1=Ct.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,T1.default)(F1);var Mr={},M1=ge,D1=_e,C1="[object Boolean]";function N1(r){return r===!0||r===!1||D1(r)&&M1(r)==C1}var B1=N1;Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.Bool=void 0;var U1=B1,q1=xu(U1),Iu=se,L1=D,k1=xu(L1);function xu(r){return r&&r.__esModule?r:{default:r}}var j1=Mr.Bool={read:function(e){var t=Iu.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 Iu.Int.write(n,t)},isValid:function(e){return(0,q1.default)(e)}};(0,k1.default)(j1);var Nt={},V1=ge,G1=V,H1=_e,W1="[object String]";function z1(r){return typeof r=="string"||!G1(r)&&H1(r)&&V1(r)==W1}var Pu=z1;Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.String=void 0;var X1=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}}(),Y1=Pu,Tu=di(Y1),K1=V,Z1=di(K1),Ru=se,J1=Ne,Fu=De,Q1=D,e$=di(Q1);function di(r){return r&&r.__esModule?r:{default:r}}function r$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var t$=Nt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J1.UnsignedInt.MAX_VALUE;r$(this,r),this._maxLength=e}return X1(r,[{key:"read",value:function(t){var n=Ru.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,Fu.calculatePadding)(n),a=t.slice(n);return(0,Fu.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,Tu.default)(t)?i=h.from(t,"utf8"):i=h.from(t),Ru.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Tu.default)(t))n=h.from(t,"utf8");else if((0,Z1.default)(t)||h.isBuffer(t))n=h.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,e$.default)(t$.prototype);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Opaque=void 0;var n$=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}}(),Mu=De,i$=D,a$=o$(i$);function o$(r){return r&&r.__esModule?r:{default:r}}function u$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var s$=Bt.Opaque=function(){function r(e){u$(this,r),this._length=e,this._padding=(0,Mu.calculatePadding)(e)}return n$(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Mu.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 h.isBuffer(t)&&t.length===this._length}}]),r}();(0,a$.default)(s$.prototype);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.VarOpaque=void 0;var f$=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=se,c$=Ne,Cu=De,l$=D,d$=p$(l$);function p$(r){return r&&r.__esModule?r:{default:r}}function h$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var y$=Ut.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c$.UnsignedInt.MAX_VALUE;h$(this,r),this._maxLength=e}return f$(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,Cu.calculatePadding)(n),a=t.slice(n);return(0,Cu.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 h.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,d$.default)(y$.prototype);var qt={};function g$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var _$=g$,v$=vt;function m$(r){return typeof r=="function"?r:v$}var Nu=m$,w$=_$,b$=Zn,$$=Nu,E$=V;function S$(r,e){var t=E$(r)?w$:b$;return t(r,$$(e))}var A$=S$,ir=A$,O$=/\s/;function I$(r){for(var e=r.length;e--&&O$.test(r.charAt(e)););return e}var x$=I$,P$=x$,T$=/^\s+/;function R$(r){return r&&r.slice(0,P$(r)+1).replace(T$,"")}var F$=R$,M$=F$,Bu=Je,D$=Pt,Uu=0/0,C$=/^[-+]0x[0-9a-f]+$/i,N$=/^0b[01]+$/i,B$=/^0o[0-7]+$/i,U$=parseInt;function q$(r){if(typeof r=="number")return r;if(D$(r))return Uu;if(Bu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Bu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=M$(r);var t=N$.test(r);return t||B$.test(r)?U$(r.slice(2),t?2:8):C$.test(r)?Uu:+r}var L$=q$,k$=L$,qu=1/0,j$=17976931348623157e292;function V$(r){if(!r)return r===0?r:0;if(r=k$(r),r===qu||r===-qu){var e=r<0?-1:1;return e*j$}return r===r?r:0}var G$=V$,H$=G$;function W$(r){var e=H$(r),t=e%1;return e===e?t?e-t:e:0}var z$=W$,X$=wo,Y$=Nu,K$=z$,Z$=9007199254740991,pi=4294967295,J$=Math.min;function Q$(r,e){if(r=K$(r),r<1||r>Z$)return[];var t=pi,n=J$(r,pi);e=Y$(e),r-=pi;for(var i=X$(n,e);++t<r;)e(t);return i}var Lu=Q$;Object.defineProperty(qt,"__esModule",{value:!0}),qt.Array=void 0;var eE=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}}(),rE=ci,tE=Dr(rE),nE=ir,iE=Dr(nE),aE=Lu,oE=Dr(aE),uE=V,ku=Dr(uE),sE=D,fE=Dr(sE);function Dr(r){return r&&r.__esModule?r:{default:r}}function cE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var lE=qt.Array=function(){function r(e,t){cE(this,r),this._childType=e,this._length=t}return eE(r,[{key:"read",value:function(t){var n=this;return(0,oE.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ku.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,iE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ku.default)(t)||t.length!==this._length?!1:(0,tE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,fE.default)(lE.prototype);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.VarArray=void 0;var dE=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}}(),pE=ci,hE=Cr(pE),yE=ir,gE=Cr(yE),_E=Lu,vE=Cr(_E),mE=V,ju=Cr(mE),wE=Ne,Vu=se,bE=D,$E=Cr(bE);function Cr(r){return r&&r.__esModule?r:{default:r}}function EE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var SE=Lt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wE.UnsignedInt.MAX_VALUE;EE(this,r),this._childType=e,this._maxLength=t}return dE(r,[{key:"read",value:function(t){var n=this,i=Vu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,vE.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ju.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));Vu.Int.write(t.length,n),(0,gE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ju.default)(t)||t.length>this._maxLength?!1:(0,hE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,$E.default)(SE.prototype);var kt={};function AE(r){return r===null}var OE=AE;function IE(r){return r===void 0}var Nr=IE;Object.defineProperty(kt,"__esModule",{value:!0}),kt.Option=void 0;var xE=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}}(),PE=OE,Gu=hi(PE),TE=Nr,Hu=hi(TE),Wu=Mr,RE=D,FE=hi(RE);function hi(r){return r&&r.__esModule?r:{default:r}}function ME(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var DE=kt.Option=function(){function r(e){ME(this,r),this._childType=e}return xE(r,[{key:"read",value:function(t){if(Wu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Gu.default)(t)||(0,Hu.default)(t));Wu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Gu.default)(t)||(0,Hu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,FE.default)(DE.prototype);var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Void=void 0;var CE=Nr,zu=Xu(CE),NE=D,BE=Xu(NE);function Xu(r){return r&&r.__esModule?r:{default:r}}var UE=Br.Void={read:function(){},write:function(e){if(!(0,zu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,zu.default)(e)}};(0,BE.default)(UE);var jt={},qE=fi;function LE(r,e){return qE(e,function(t){return r[t]})}var kE=LE,jE=kE,VE=$t;function GE(r){return r==null?[]:jE(r,VE(r))}var HE=GE;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Enum=void 0;var WE=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}}(),zE=ir,XE=yi(zE),YE=HE,KE=yi(YE),Yu=se,ZE=D,JE=yi(ZE);function yi(r){return r&&r.__esModule?r:{default:r}}function QE(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 eS(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 Ku(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var rS=jt.Enum=function(){function r(e,t){Ku(this,r),this.name=e,this.value=t}return WE(r,null,[{key:"read",value:function(t){var n=Yu.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);Yu.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,KE.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){eS(u,o);function u(){return Ku(this,u),QE(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,XE.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,JE.default)(rS);var Vt={},tS=Zn,nS=Or;function iS(r,e){var t=-1,n=nS(r)?Array(r.length):[];return tS(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var aS=iS,oS=fi,uS=fu,sS=aS,fS=V;function cS(r,e){var t=fS(r)?oS:sS;return t(r,uS(e))}var lS=cS;function dS(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 pS=dS,Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var hS=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 yS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ur.Reference=function(){function r(){yS(this,r)}return hS(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Struct=void 0;var Gt=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")}}(),gS=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}}(),_S=ir,Zu=qr(_S),vS=lS,mS=qr(vS),wS=Nr,bS=qr(wS),$S=pS,ES=qr($S),SS=Ur,AS=D,OS=qr(AS);function qr(r){return r&&r.__esModule?r:{default:r}}function IS(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 xS(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 Ju(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var PS=Vt.Struct=function(){function r(e){Ju(this,r),this._attributes=e||{}}return gS(r,null,[{key:"read",value:function(t){var n=(0,mS.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],u=a[1],f=u.read(t);return[o,f]});return new this((0,ES.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,Zu.default)(this._fields,function(i){var a=Gt(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){xS(u,o);function u(){return Ju(this,u),IS(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=Gt(o,2),f=u[0],c=u[1];return c instanceof SS.Reference&&(c=c.resolve(t)),[f,c]}),(0,Zu.default)(a._fields,function(o){var u=Gt(o,1),f=u[0];a.prototype[f]=TS(f)}),a}}]),r}();(0,OS.default)(PS);function TS(r){return function(t){return(0,bS.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Union=void 0;var RS=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")}}(),FS=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}}(),MS=ir,Wt=Xt(MS),DS=Nr,Qu=Xt(DS),CS=Pu,es=Xt(CS),zt=Br,gi=Ur,NS=D,BS=Xt(NS);function Xt(r){return r&&r.__esModule?r:{default:r}}function US(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 qS(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 rs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var LS=Ht.Union=function(){function r(e,t){rs(this,r),this.set(e,t)}return FS(r,[{key:"set",value:function(t,n){(0,es.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!==zt.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===zt.Void?zt.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,Qu.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){qS(f,u);function f(){return rs(this,f),US(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof gi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Wt.default)(i.arms,function(u,f){u instanceof gi.Reference&&(u=u.resolve(t)),a._arms[f]=u});var o=i.defaultArm;return o instanceof gi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Wt.default)(i.switches,function(u){var f=RS(u,2),c=f[0],l=f[1];(0,es.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,Qu.default)(a._switchOn.values)||(0,Wt.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,Wt.default)(a._arms,function(u,f){u!==zt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,BS.default)(LS),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=se;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=Rt;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Ne;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Ft;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=Mt;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Dt;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var u=Ct;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var f=Mr;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var c=Nt;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var l=Bt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var s=Ut;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var d=qt;Object.keys(d).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return d[p]}})});var y=Lt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var w=kt;Object.keys(w).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return w[p]}})});var S=Br;Object.keys(S).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return S[p]}})});var O=jt;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var b=Vt;Object.keys(b).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return b[p]}})});var E=Ht;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})})}(Wn);var ts={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(g,_){for(var A=0;A<_.length;A++){var x=_[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,_,A){return _&&m(g.prototype,_),A&&m(g,A),g}}(),t=Ur;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=w;var n=Nr,i=l(n),a=ir,o=l(a),u=Wn,f=c(u);function c(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(g[_]=m[_]);return g.default=m,g}function l(m){return m&&m.__esModule?m:{default:m}}function s(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function y(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}function w(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new F(g);m(_),_.resolve()}return g}var S=function(m){y(g,m);function g(_){s(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=_,A}return e(g,[{key:"resolve",value:function(A){var x=A.definitions[this.name];return x.resolve(A)}}]),g}(t.Reference),O=function(m){y(g,m);function g(_,A){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(this,g);var M=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=_,M.length=A,M.variable=x,M}return e(g,[{key:"resolve",value:function(A){var x=this.childReference,M=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),M instanceof t.Reference&&(M=M.resolve(A)),this.variable?new f.VarArray(x,M):new f.Array(x,M)}}]),g}(t.Reference),b=function(m){y(g,m);function g(_){s(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=_,A.name=_.name,A}return e(g,[{key:"resolve",value:function(A){var x=this.childReference;return x instanceof t.Reference&&(x=x.resolve(A)),new f.Option(x)}}]),g}(t.Reference),E=function(m){y(g,m);function g(_,A){s(this,g);var x=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return x.sizedType=_,x.length=A,x}return e(g,[{key:"resolve",value:function(A){var x=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),new this.sizedType(x)}}]),g}(t.Reference),p=function(){function m(g,_,A){s(this,m),this.constructor=g,this.name=_,this.config=A}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function I(m,g,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[g]=_,_}function T(m,g,_){return m.results[g]=_,_}var F=function(){function m(g){s(this,m),this._destination=g,this._definitions={}}return e(m,[{key:"enum",value:function(_,A){var x=new p(f.Enum.create,_,A);this.define(_,x)}},{key:"struct",value:function(_,A){var x=new p(f.Struct.create,_,A);this.define(_,x)}},{key:"union",value:function(_,A){var x=new p(f.Union.create,_,A);this.define(_,x)}},{key:"typedef",value:function(_,A){var x=new p(I,_,A);this.define(_,x)}},{key:"const",value:function(_,A){var x=new p(T,_,A);this.define(_,x)}},{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(_){return new E(f.String,_)}},{key:"opaque",value:function(_){return new E(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new E(f.VarOpaque,_)}},{key:"array",value:function(_,A){return new O(_,A)}},{key:"varArray",value:function(_,A){return new O(_,A,!0)}},{key:"option",value:function(_){return new b(_)}},{key:"define",value:function(_,A){if((0,i.default)(this._destination[_]))this._definitions[_]=A;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new S(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(ts),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Wn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=ts;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ao);var _i=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(_i(r,e,"read from private field"),t?t.call(r):e.get(r)),Be=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},vi=(r,e,t,n)=>(_i(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ve=(r,e,t)=>(_i(r,e,"access private method"),t),ne,ie,Lr,mi,ns,wi,is,Yt,bi,ar,kr;function kS(r){const e={variantId:ce.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ce.BundleItem({collectionId:ce.Uint64.fromString(n.collectionId.toString()),productId:ce.Uint64.fromString(n.productId.toString()),variantId:ce.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ce.BundleItemExt(0)})),ext:new ce.BundleExt(0)},t=new ce.Bundle(e);return ce.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ce=ao.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")}})});class jS{constructor(e,t){Be(this,mi),Be(this,wi),Be(this,Yt),Be(this,ar),Be(this,ne,void 0),Be(this,ie,void 0),Be(this,Lr,void 0),vi(this,ne,ve(this,mi,ns).call(this,t)),vi(this,Lr,ve(this,wi,is).call(this,t)),vi(this,ie,e)}isInitialDataValid(){if(!j(this,Lr))throw"Bundle data does not exist for the given product.";if(!j(this,ne))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(j(this,ie))||!j(this,ie).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!j(this,ne)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=j(this,ie).reduce((i,a)=>i+a.quantity,0),n=j(this,ne)?.variantsSettings[e].ranges||[];if(!ve(this,Yt,bi).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=j(this,ne)?.bundleSettings.maxPerItem||0,t=j(this,ie).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${ve(this,ar,kr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=j(this,ne)?.variantsSettings[e],n=j(this,ie).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${ve(this,ar,kr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=j(this,ie).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=j(this,ne)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!ve(this,Yt,bi).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${ve(this,ar,kr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=j(this,ne)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const u=j(this,Lr)?.collections[o.collectionId];return u&&(a[o.collectionId]=u),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=j(this,ie).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${ve(this,ar,kr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ne=new WeakMap,ie=new WeakMap,Lr=new WeakMap,mi=new WeakSet,ns=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},wi=new WeakSet,is=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},Yt=new WeakSet,bi=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},ar=new WeakSet,kr=function(r){return Array.from(new Set(r))};const VS="/bundling-storefront-manager";function as(r){return kS({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function GS(r){const e=W(),t=await $i(r);if(t!==!0)throw new Error(t);const n=as(r);try{const i=await Fe("post",`${VS}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function HS(r,e){const t=await $i(e);if(t!==!0)throw new Error(t);const n=as(e);try{const i=await $("post","/bundle_selections/bundle_id",{data:{bundle:n}},v(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function WS(r,e){const t=os(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Hi(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 $i(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function zS(r){try{const e=await Fe("get",`/bundle-data/${r.externalProductId}`);return{valid:new jS(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const XS={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 os(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=XS[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 YS(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await $("get","/bundle_selections",{id:e},v(r,"getBundleSelection"));return t}function KS(r,e){return $("get","/bundle_selections",{query:e},v(r,"listBundleSelections"))}async function ZS(r,e){const{bundle_selection:t}=await $("post","/bundle_selections",{data:e},v(r,"createBundleSelection"));return t}async function JS(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await $("put","/bundle_selections",{id:e,data:t},v(r,"updateBundleSelection"));return n}function QS(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/bundle_selections",{id:e},v(r,"deleteBundleSelection"))}async function eA(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await $("put","/bundles",{id:e,data:t,query:n},v(r,"updateBundle"));return i}var rA=Object.freeze({__proto__:null,createBundleSelection:ZS,deleteBundleSelection:QS,getBundleId:GS,getBundleSelection:YS,getBundleSelectionId:HS,getDynamicBundleItems:WS,listBundleSelections:KS,updateBundle:eA,updateBundleSelection:JS,validateBundle:$i,validateBundleSelection:zS,validateDynamicBundle:os});const tA=r=>{const e=r.layout_settings.addons,t=r.layout_settings.crossSells,n=r.customization_window,i=r.default_bundle_variant_id;return{default_variant_id:i?String(i):null,is_customizable:r.is_customizable,price_rule:String(r.price_rule).toUpperCase(),customization_window:n?{active_days:n,disabled_message:r.customization_window_disabled_message||""}:null,addons:e.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,cross_sells:t.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null}},nA=r=>r.tiered_discounts.length===0?null:{tiered_discounts:r.tiered_discounts.map(e=>({eligible_charge_types:e.eligible_charge_types,eligible_line_item_types:e.eligible_line_item_types,external_product_id:e.external_product_id,name:e.name,status:e.status,tiers:e.tiers.map(t=>({discount_type:t.discount_type,discount_value:t.discount_value,condition_quantity_gte:t.condition_quantity_gte}))}))},Kt=r=>({id:r.id,name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),recurring_deliveries:r.recurring_deliveries,price_adjustments:r.price_adjustments.map(({value:e,value_type:t})=>({value:e,value_type:t}))}),us=r=>({name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),selling_plans:r.selling_plans.map(Kt)}),ss=r=>({id:String(r.id),title:r.title,price:r.price,compare_at_price:r.compare_at_price,options:r.options,available_for_sale:r.available}),fs=r=>({id:String(r.id),title:r.title,description:r.description,available_for_sale:r.available,featured_image:r.featured_image,images:r.images,requires_selling_plan:r.requires_selling_plan,selling_plan_groups:r.selling_plan_groups.map(us)}),cs=r=>{const e=aA(r.selling_plan_groups);return{...fs(r),handle:r.handle,tags:r.tags,price_range:{min:r.price_min,max:r.price_max},compare_at_price_range:{min:r.compare_at_price_min,max:r.compare_at_price_max},options:r.options,variants:r.variants.map(t=>({...ss(t),selling_plan_allocations:t.selling_plan_allocations.map(n=>({price:n.price,compare_at_price:n.compare_at_price,selling_plan:Kt(e[`${n.selling_plan_group_id}-${n.selling_plan_id}`])})),option1:t.option1,option2:t.option2,option3:t.option3,sku:t.sku,requires_shipping:t.requires_shipping,taxable:t.taxable,featured_image:t.featured_image,public_title:t.public_title,requires_selling_plan:t.requires_selling_plan}))}},iA=({items_count:r,ranges:e})=>e.length>0?e.map(({quantity_max:t,quantity_min:n})=>({min:n,max:t})):[{min:r,max:r}],aA=r=>r.reduce((e,t)=>(t.selling_plans.forEach(n=>{const i=`${t.id}-${n.id}`;e[i]=n}),e),{});function Ei(r){const e=tA(r.bundle_settings),t=r.variants.reduce((n,i)=>(n[i.id]=i,n),{});return{id:String(r.id),title:r.title,handle:r.handle,options:r.options.map(n=>({name:n.name,position:n.position,values:n.values})),default_variant_id:e.default_variant_id,available_for_sale:r.available,requires_selling_plan:r.requires_selling_plan,bundle_settings:{is_customizable:e.is_customizable,price_rule:e.price_rule,customization_window:e.customization_window,max_quantity_per_variant:null},variants:r.bundle_settings.variants.filter(({enabled:n})=>n).map((n,i)=>{const a=t[String(n.external_variant_id)];return{id:String(n.external_variant_id),title:a.title,price:a.price,compare_at_price:a.compare_at_price,image:a.image||"",available_for_sale:a.available,options:a.options,requires_selling_plan:a.requires_selling_plan,selling_plan_allocations:a.selling_plan_allocations.map(o=>({price:o.price,compare_at_price:o.compare_at_price,selling_plan:Kt(o.selling_plan)})),ranges:iA(n),collections:n.option_sources.map(o=>({id:o.option_source_id,source_platform:"shopify",min:o.quantity_min||0,max:o.quantity_max})),default_selections:n.selection_defaults.map(o=>({quantity:o.quantity,product:{id:String(o.product.id),handle:o.handle,title:o.product.title,description:o.product.description,images:o.product.images},variant:{id:o.external_variant_id,title:o.variant.title,featured_image:o.variant.featured_image,sku:o.sku}})),position:i}}),selling_plan_groups:r.selling_plan_groups.map(us),collections:Object.values(r.collections).reduce((n,i)=>(n[String(i.id)]={id:String(i.id),title:i.title,handle:i.handle,products:i.products.map(cs)},n),{}),addons:r.addons.products.length?{collection_id:e.addons?.collection_id||"",collection_handle:e.addons?.collection_handle||"",products:r.addons.products.map(n=>({...fs(n),price_range:{min:n.price,max:n.price},compare_at_price_range:{min:n.compare_at_price||0,max:n.compare_at_price},variants:n.variants.map(i=>({...ss(i),image:i.image,selling_plan_allocations:i.selling_plan_allocations.map(a=>({price:a.price,compare_at_price:a.compare_at_price,selling_plan:Kt(a.selling_plan)}))}))}))}:null,cross_sells:r.cross_sells.products.length?{collection_id:e.cross_sells?.collection_id||"",collection_handle:e.cross_sells?.collection_handle||"",products:r.cross_sells.products.map(cs)}:null,incentives:nA(r.incentives)}}async function oA(r,e){return e?.source==="shopify_storefront"?sA():uA(r,e?.country_code)}async function uA(r,e){if(!e){const n=await Fe("get",`/bundle-data/${r}`);return Ei(n)}const t=new FormData;t.append("form_type","localization"),t.append("_method","put"),t.append("return_to",`${no}/bundle-data/${r}`),t.append("country_code",e);try{const n=await X("post","/localization",{headers:{"Content-Type":"multipart/form-data"},data:t});return Ei(n)}catch{const n=await Fe("get",`/bundle-data/${r}`);return Ei(n)}}async function sA(r,e){if(!W().storeIdentifier)throw new Error("Store identifier is required for Shopify Storefront API requests");return{}}var fA=Object.freeze({__proto__:null,loadBundleData:oA}),cA=200,Si="__lodash_hash_undefined__",lA=1/0,ls=9007199254740991,dA="[object Arguments]",pA="[object Function]",hA="[object GeneratorFunction]",yA="[object Symbol]",gA=/[\\^$.*+?()[\]{}|]/g,_A=/^\[object .+?Constructor\]$/,vA=/^(?:0|[1-9]\d*)$/,mA=typeof U=="object"&&U&&U.Object===Object&&U,wA=typeof self=="object"&&self&&self.Object===Object&&self,Ai=mA||wA||Function("return this")();function bA(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 $A(r,e){var t=r?r.length:0;return!!t&&AA(r,e,0)>-1}function EA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function ds(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 Oi(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function SA(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 AA(r,e,t){if(e!==e)return SA(r,OA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function OA(r){return r!==r}function IA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function xA(r){return function(e){return r(e)}}function PA(r,e){return r.has(e)}function TA(r,e){return r?.[e]}function RA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function ps(r,e){return function(t){return r(e(t))}}var FA=Array.prototype,MA=Function.prototype,Zt=Object.prototype,Ii=Ai["__core-js_shared__"],hs=function(){var r=/[^.]+$/.exec(Ii&&Ii.keys&&Ii.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),ys=MA.toString,or=Zt.hasOwnProperty,xi=Zt.toString,DA=RegExp("^"+ys.call(or).replace(gA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gs=Ai.Symbol,CA=ps(Object.getPrototypeOf,Object),NA=Zt.propertyIsEnumerable,BA=FA.splice,_s=gs?gs.isConcatSpreadable:void 0,Pi=Object.getOwnPropertySymbols,vs=Math.max,UA=ws(Ai,"Map"),jr=ws(Object,"create");function Ue(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 qA(){this.__data__=jr?jr(null):{}}function LA(r){return this.has(r)&&delete this.__data__[r]}function kA(r){var e=this.__data__;if(jr){var t=e[r];return t===Si?void 0:t}return or.call(e,r)?e[r]:void 0}function jA(r){var e=this.__data__;return jr?e[r]!==void 0:or.call(e,r)}function VA(r,e){var t=this.__data__;return t[r]=jr&&e===void 0?Si:e,this}Ue.prototype.clear=qA,Ue.prototype.delete=LA,Ue.prototype.get=kA,Ue.prototype.has=jA,Ue.prototype.set=VA;function ur(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 GA(){this.__data__=[]}function HA(r){var e=this.__data__,t=Qt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():BA.call(e,t,1),!0}function WA(r){var e=this.__data__,t=Qt(e,r);return t<0?void 0:e[t][1]}function zA(r){return Qt(this.__data__,r)>-1}function XA(r,e){var t=this.__data__,n=Qt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}ur.prototype.clear=GA,ur.prototype.delete=HA,ur.prototype.get=WA,ur.prototype.has=zA,ur.prototype.set=XA;function sr(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 YA(){this.__data__={hash:new Ue,map:new(UA||ur),string:new Ue}}function KA(r){return en(this,r).delete(r)}function ZA(r){return en(this,r).get(r)}function JA(r){return en(this,r).has(r)}function QA(r,e){return en(this,r).set(r,e),this}sr.prototype.clear=YA,sr.prototype.delete=KA,sr.prototype.get=ZA,sr.prototype.has=JA,sr.prototype.set=QA;function Jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new sr;++e<t;)this.add(r[e])}function eO(r){return this.__data__.set(r,Si),this}function rO(r){return this.__data__.has(r)}Jt.prototype.add=Jt.prototype.push=eO,Jt.prototype.has=rO;function tO(r,e){var t=Ti(r)||bs(r)?IA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||or.call(r,a))&&!(i&&(a=="length"||hO(a,n)))&&t.push(a);return t}function Qt(r,e){for(var t=r.length;t--;)if(bO(r[t][0],e))return t;return-1}function nO(r,e,t,n){var i=-1,a=$A,o=!0,u=r.length,f=[],c=e.length;if(!u)return f;t&&(e=ds(e,xA(t))),n?(a=EA,o=!1):e.length>=cA&&(a=PA,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 d=c;d--;)if(e[d]===s)continue e;f.push(l)}else a(e,s,n)||f.push(l)}return f}function ms(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=pO),i||(i=[]);++a<o;){var u=r[a];e>0&&t(u)?e>1?ms(u,e-1,t,n,i):Oi(i,u):n||(i[i.length]=u)}return i}function iO(r,e,t){var n=e(r);return Ti(r)?n:Oi(n,t(r))}function aO(r){if(!Ri(r)||gO(r))return!1;var e=Es(r)||RA(r)?DA:_A;return e.test(wO(r))}function oO(r){if(!Ri(r))return vO(r);var e=_O(r),t=[];for(var n in r)n=="constructor"&&(e||!or.call(r,n))||t.push(n);return t}function uO(r,e){return r=Object(r),sO(r,e,function(t,n){return n in r})}function sO(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 fO(r,e){return e=vs(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=vs(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,bA(r,this,o)}}function cO(r){return iO(r,AO,dO)}function en(r,e){var t=r.__data__;return yO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function ws(r,e){var t=TA(r,e);return aO(t)?t:void 0}var lO=Pi?ps(Pi,Object):As,dO=Pi?function(r){for(var e=[];r;)Oi(e,lO(r)),r=CA(r);return e}:As;function pO(r){return Ti(r)||bs(r)||!!(_s&&r&&r[_s])}function hO(r,e){return e=e??ls,!!e&&(typeof r=="number"||vA.test(r))&&r>-1&&r%1==0&&r<e}function yO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function gO(r){return!!hs&&hs in r}function _O(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Zt;return r===t}function vO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function mO(r){if(typeof r=="string"||SO(r))return r;var e=r+"";return e=="0"&&1/r==-lA?"-0":e}function wO(r){if(r!=null){try{return ys.call(r)}catch{}try{return r+""}catch{}}return""}function bO(r,e){return r===e||r!==r&&e!==e}function bs(r){return $O(r)&&or.call(r,"callee")&&(!NA.call(r,"callee")||xi.call(r)==dA)}var Ti=Array.isArray;function $s(r){return r!=null&&EO(r.length)&&!Es(r)}function $O(r){return Ss(r)&&$s(r)}function Es(r){var e=Ri(r)?xi.call(r):"";return e==pA||e==hA}function EO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ls}function Ri(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Ss(r){return!!r&&typeof r=="object"}function SO(r){return typeof r=="symbol"||Ss(r)&&xi.call(r)==yA}function AO(r){return $s(r)?tO(r,!0):oO(r)}var OO=fO(function(r,e){return r==null?{}:(e=ds(ms(e,1),mO),uO(r,nO(cO(r),e)))});function As(){return[]}var IO=OO,Fi=be(IO);function xO(r){try{return JSON.parse(r)}catch{return r}}function PO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:xO(n)}),{})}const Os=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function Is(r){const e=PO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...Fi(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function xs(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function TO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=xs(i)}),t})}const Mi="2020-12",RO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Vr=new Map;function rn(r,e){return Vr.has(r)||Vr.set(r,e()),Vr.get(r)}async function Di(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await rn(`product.${r}.${t}`,()=>ht("get",`/product/${t}/${r}.json`));return t==="2020-12"?xs(n):n}async function Ps(){return await rn("storeSettings",()=>ht("get",`/${Mi}/store_settings.json`).catch(()=>RO))}async function Ts(){const{widget_settings:r}=await rn("widgetSettings",()=>ht("get",`/${Mi}/widget_settings.json`));return Is(r)}async function Rs(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await rn("productsAndSettings",()=>ht("get",`/product/${Mi}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:TO(r),widget_settings:Is(e),store_settings:t??{}}}async function FO(){const{products:r}=await Rs();return r}async function MO(r){const[e,t,n]=await Promise.all([Di(r),Ps(),Ts()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function DO(r){const{bundle_product:e}=await Di(r);return e}async function Fs(){return Array.from(Vr.keys()).forEach(r=>Vr.delete(r))}var CO=Object.freeze({__proto__:null,getCDNBundleSettings:DO,getCDNProduct:Di,getCDNProductAndSettings:MO,getCDNProducts:FO,getCDNProductsAndSettings:Rs,getCDNStoreSettings:Ps,getCDNWidgetSettings:Ts,resetCDNCache:Fs});async function NO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("get","/charges",{id:e,query:{include:t?.include}},v(r,"getCharge"));return n}function BO(r,e){return $("get","/charges",{query:e},v(r,"listCharges"))}async function UO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},v(r,"applyDiscountToCharge"));return n}async function qO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await $("post",`/charges/${e}/remove_discount`,{},v(r,"removeDiscountsFromCharge"));return t}async function LO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await $("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"skipCharge"));return i}async function kO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await $("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"unskipCharge"));return i}async function jO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await $("post",`/charges/${e}/process`,{},v(r,"processCharge"));return t}var VO=Object.freeze({__proto__:null,applyDiscountToCharge:UO,getCharge:NO,listCharges:BO,processCharge:jO,removeDiscountsFromCharge:qO,skipCharge:LO,unskipCharge:kO});async function Ms(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return $("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"productSearch"))}var GO=Object.freeze({__proto__:null,productSearch:Ms});async function Ds(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await $("get","/collections",{id:e},v(r,"getCollection"));return t}function HO(r,e){return $("get","/collections",{query:e},v(r,"listCollections"))}async function WO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=v(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Ds(n,e),Ms(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((u,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&u.push(c),u},[])};{const u=zO(i);return{products:o.slice().sort(u)}}}function Cs(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function Ns(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Bs(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function zO(r){switch(r){case"created_at-asc":return Cs;case"created_at-desc":return(e,t)=>Cs(t,e);case"id-asc":return Ns;case"id-desc":return(e,t)=>Ns(t,e);case"title-asc":return Bs;case"title-desc":return(e,t)=>Bs(t,e)}}var XO=Object.freeze({__proto__:null,getCollection:Ds,listCollectionProducts:WO,listCollections:HO});async function YO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("get","/customers",{id:t,query:{include:e?.include}},v(r,"getCustomer"));return n}async function Us(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("put","/customers",{id:t,data:e},v(r,"updateCustomer"));return n}async function KO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await $("get",`/customers/${t}/delivery_schedule`,{query:e},v(r,"getDeliverySchedule"));return n}async function tn(r,e){return $("get","/portal_access",{query:e},v(r,"getCustomerPortalAccess"))}async function ZO(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function JO(r){const{base_url:e,customer_hash:t,temp_token:n}=await tn(v(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function QO(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const eI={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function rI(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=eI[e];if(!i)throw new Error("Notification not supported.");return $("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},v(r,"sendCustomerNotification"))}async function tI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},v(r,"getCreditSummary"));return n}var nI=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:ZO,getCreditSummary:tI,getCustomer:YO,getCustomerPortalAccess:tn,getDeliverySchedule:KO,getFailedPaymentMethodRecoveryLandingPageURL:JO,getGiftRedemptionLandingPageURL:QO,sendCustomerNotification:rI,updateCustomer:Us});async function iI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},v(r,"getCreditSummary"));return n}function aI(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),Us(v(r,"setApplyCreditsToNextCharge"),t)}async function oI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await $("get","/credit_accounts",{query:{customer_id:t,...e}},v(r,"listCreditAccounts"))}var uI=Object.freeze({__proto__:null,getCreditSummary:iI,listCreditAccounts:oI,setApplyCreditsToNextCharge:aI});function sI(r,e){if(!r.customerId)throw new Error("Not logged in.");return $("get","/gift_purchases",{query:e},v(r,"listGiftPurchases"))}async function fI(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await $("get","/gift_purchases",{id:e},v(r,"getGiftPurchase"));return t}var cI=Object.freeze({__proto__:null,getGiftPurchase:fI,listGiftPurchases:sI});async function lI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await $("get","/memberships",{id:e},v(r,"getMembership"));return t}function dI(r,e){return $("get","/memberships",{query:e},v(r,"listMemberships"))}async function pI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/cancel`,{data:t},v(r,"cancelMembership"));return n}async function hI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/activate`,{data:t},v(r,"activateMembership"));return n}async function yI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await $("post",`/memberships/${e}/change`,{data:t},v(r,"changeMembership"));return n}var gI=Object.freeze({__proto__:null,activateMembership:hI,cancelMembership:pI,changeMembership:yI,getMembership:lI,listMemberships:dI});async function _I(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await $("get","/membership_programs",{id:e,query:{include:t?.include}},v(r,"getMembershipProgram"));return n}function vI(r,e){return $("get","/membership_programs",{query:e},v(r,"listMembershipPrograms"))}var mI=Object.freeze({__proto__:null,getMembershipProgram:_I,listMembershipPrograms:vI});async function wI(r,e){const{metafield:t}=await $("post","/metafields",{data:{metafield:e}},v(r,"createMetafield"));return t}async function bI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await $("put","/metafields",{id:e,data:{metafield:t}},v(r,"updateMetafield"));return n}function $I(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/metafields",{id:e},v(r,"deleteMetafield"))}var EI=Object.freeze({__proto__:null,createMetafield:wI,deleteMetafield:$I,updateMetafield:bI});async function SI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await $("get","/onetimes",{id:e},v(r,"getOnetime"));return t}function AI(r,e){return $("get","/onetimes",{query:e},v(r,"listOnetimes"))}async function OI(r,e){const{onetime:t}=await $("post","/onetimes",{data:e},v(r,"createOnetime"));return t}async function II(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await $("put","/onetimes",{id:e,data:t},v(r,"updateOnetime"));return n}function xI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return $("delete","/onetimes",{id:e},v(r,"deleteOnetime"))}var PI=Object.freeze({__proto__:null,createOnetime:OI,deleteOnetime:xI,getOnetime:SI,listOnetimes:AI,updateOnetime:II});async function TI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await $("get","/orders",{id:e},v(r,"getOrder"));return t}function RI(r,e){return $("get","/orders",{query:e},v(r,"listOrders"))}async function FI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await $("post",`/orders/${e}/delay`,{},v(r,"delayOrder"));return t}var MI=Object.freeze({__proto__:null,delayOrder:FI,getOrder:TI,listOrders:RI});async function DI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await $("get","/payment_methods",{id:e,query:{include:t?.include}},v(r,"getPaymentMethod"));return n}async function CI(r,e){const{payment_method:t}=await $("post","/payment_methods",{data:{...e,customer_id:r.customerId}},v(r,"createPaymentMethod"));return t}async function NI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await $("put","/payment_methods",{id:e,data:t},v(r,"updatePaymentMethod"));return n}function BI(r,e){return $("get","/payment_methods",{query:e},v(r,"listPaymentMethods"))}var UI=Object.freeze({__proto__:null,createPaymentMethod:CI,getPaymentMethod:DI,listPaymentMethods:BI,updatePaymentMethod:NI});async function qI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await $("get","/plans",{id:e},v(r,"getPlan"));return t}function LI(r,e){return $("get","/plans",{query:e},v(r,"listPlans"))}var kI=Object.freeze({__proto__:null,getPlan:qI,listPlans:LI});async function jI(r,e){return await $("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"getShippingCountries"))}async function VI(r){return await $("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},v(r,"getStoreSettings"))}var GI=Object.freeze({__proto__:null,getShippingCountries:jI,getStoreSettings:VI}),HI="Expected a function",qs="__lodash_placeholder__",qe=1,nn=2,WI=4,fr=8,Gr=16,Le=32,Hr=64,Ls=128,zI=256,ks=512,js=1/0,XI=9007199254740991,YI=17976931348623157e292,Vs=0/0,KI=[["ary",Ls],["bind",qe],["bindKey",nn],["curry",fr],["curryRight",Gr],["flip",ks],["partial",Le],["partialRight",Hr],["rearg",zI]],ZI="[object Function]",JI="[object GeneratorFunction]",QI="[object Symbol]",ex=/[\\^$.*+?()[\]{}|]/g,rx=/^\s+|\s+$/g,tx=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nx=/\{\n\/\* \[wrapped with (.+)\] \*/,ix=/,? & /,ax=/^[-+]0x[0-9a-f]+$/i,ox=/^0b[01]+$/i,ux=/^\[object .+?Constructor\]$/,sx=/^0o[0-7]+$/i,fx=/^(?:0|[1-9]\d*)$/,cx=parseInt,lx=typeof U=="object"&&U&&U.Object===Object&&U,dx=typeof self=="object"&&self&&self.Object===Object&&self,Wr=lx||dx||Function("return this")();function Ci(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 px(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function hx(r,e){var t=r?r.length:0;return!!t&&gx(r,e,0)>-1}function yx(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 gx(r,e,t){if(e!==e)return yx(r,_x,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function _x(r){return r!==r}function vx(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function mx(r,e){return r?.[e]}function wx(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Ni(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===qs)&&(r[t]=qs,a[i++]=t)}return a}var bx=Function.prototype,Gs=Object.prototype,Bi=Wr["__core-js_shared__"],Hs=function(){var r=/[^.]+$/.exec(Bi&&Bi.keys&&Bi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Ws=bx.toString,$x=Gs.hasOwnProperty,zs=Gs.toString,Ex=RegExp("^"+Ws.call($x).replace(ex,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sx=Object.create,cr=Math.max,Ax=Math.min,Xs=function(){var r=Ks(Object,"defineProperty"),e=Ks.name;return e&&e.length>2?r:void 0}();function Ox(r){return lr(r)?Sx(r):{}}function Ix(r){if(!lr(r)||qx(r))return!1;var e=Vx(r)||wx(r)?Ex:ux;return e.test(kx(r))}function xx(r,e){return e=cr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=cr(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,Ci(r,this,o)}}function Px(r,e,t,n){for(var i=-1,a=r.length,o=t.length,u=-1,f=e.length,c=cr(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 Tx(r,e,t,n){for(var i=-1,a=r.length,o=-1,u=t.length,f=-1,c=e.length,l=cr(a-u,0),s=Array(l+c),d=!n;++i<l;)s[i]=r[i];for(var y=i;++f<c;)s[y+f]=e[f];for(;++o<u;)(d||i<a)&&(s[y+t[o]]=r[i++]);return s}function Rx(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function Fx(r,e,t){var n=e&qe,i=zr(r);function a(){var o=this&&this!==Wr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function zr(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=Ox(r.prototype),n=r.apply(t,e);return lr(n)?n:t}}function Mx(r,e,t){var n=zr(r);function i(){for(var a=arguments.length,o=Array(a),u=a,f=qi(i);u--;)o[u]=arguments[u];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Ni(o,f);if(a-=c.length,a<t)return Ys(r,e,Ui,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Wr&&this instanceof i?n:r;return Ci(l,this,o)}return i}function Ui(r,e,t,n,i,a,o,u,f,c){var l=e&Ls,s=e&qe,d=e&nn,y=e&(fr|Gr),w=e&ks,S=d?void 0:zr(r);function O(){for(var b=arguments.length,E=Array(b),p=b;p--;)E[p]=arguments[p];if(y)var I=qi(O),T=vx(E,I);if(n&&(E=Px(E,n,i,y)),a&&(E=Tx(E,a,o,y)),b-=T,y&&b<c){var F=Ni(E,I);return Ys(r,e,Ui,O.placeholder,t,E,F,u,f,c-b)}var m=s?t:this,g=d?m[r]:r;return b=E.length,u?E=Lx(E,u):w&&b>1&&E.reverse(),l&&f<b&&(E.length=f),this&&this!==Wr&&this instanceof O&&(g=S||zr(g)),g.apply(m,E)}return O}function Dx(r,e,t,n){var i=e&qe,a=zr(r);function o(){for(var u=-1,f=arguments.length,c=-1,l=n.length,s=Array(l+f),d=this&&this!==Wr&&this instanceof o?a:r;++c<l;)s[c]=n[c];for(;f--;)s[c++]=arguments[++u];return Ci(d,i?t:this,s)}return o}function Ys(r,e,t,n,i,a,o,u,f,c){var l=e&fr,s=l?o:void 0,d=l?void 0:o,y=l?a:void 0,w=l?void 0:a;e|=l?Le:Hr,e&=~(l?Hr:Le),e&WI||(e&=~(qe|nn));var S=t(r,e,i,y,s,w,d,u,f,c);return S.placeholder=n,Zs(S,r,e)}function Cx(r,e,t,n,i,a,o,u){var f=e&nn;if(!f&&typeof r!="function")throw new TypeError(HI);var c=n?n.length:0;if(c||(e&=~(Le|Hr),n=i=void 0),o=o===void 0?o:cr(Js(o),0),u=u===void 0?u:Js(u),c-=i?i.length:0,e&Hr){var l=n,s=i;n=i=void 0}var d=[r,e,t,n,i,l,s,a,o,u];if(r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],u=d[9]=d[9]==null?f?0:r.length:cr(d[9]-c,0),!u&&e&(fr|Gr)&&(e&=~(fr|Gr)),!e||e==qe)var y=Fx(r,e,t);else e==fr||e==Gr?y=Mx(r,e,u):(e==Le||e==(qe|Le))&&!i.length?y=Dx(r,e,t,n):y=Ui.apply(void 0,d);return Zs(y,r,e)}function qi(r){var e=r;return e.placeholder}function Ks(r,e){var t=mx(r,e);return Ix(t)?t:void 0}function Nx(r){var e=r.match(nx);return e?e[1].split(ix):[]}function Bx(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(tx,`{
|
|
25
25
|
/* [wrapped with `+e+`] */
|
|
26
|
-
`)}function
|
|
26
|
+
`)}function Ux(r,e){return e=e??XI,!!e&&(typeof r=="number"||fx.test(r))&&r>-1&&r%1==0&&r<e}function qx(r){return!!Hs&&Hs in r}function Lx(r,e){for(var t=r.length,n=Ax(e.length,t),i=Rx(r);n--;){var a=e[n];r[n]=Ux(a,t)?i[a]:void 0}return r}var Zs=Xs?function(r,e,t){var n=e+"";return Xs(r,"toString",{configurable:!0,enumerable:!1,value:Xx(Bx(n,jx(Nx(n),t)))})}:Yx;function kx(r){if(r!=null){try{return Ws.call(r)}catch{}try{return r+""}catch{}}return""}function jx(r,e){return px(KI,function(t){var n="_."+t[0];e&t[1]&&!hx(r,n)&&r.push(n)}),r.sort()}var Li=xx(function(r,e){var t=Ni(e,qi(Li));return Cx(r,Le,void 0,e,t)});function Vx(r){var e=lr(r)?zs.call(r):"";return e==ZI||e==JI}function lr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Gx(r){return!!r&&typeof r=="object"}function Hx(r){return typeof r=="symbol"||Gx(r)&&zs.call(r)==QI}function Wx(r){if(!r)return r===0?r:0;if(r=zx(r),r===js||r===-js){var e=r<0?-1:1;return e*YI}return r===r?r:0}function Js(r){var e=Wx(r),t=e%1;return e===e?t?e-t:e:0}function zx(r){if(typeof r=="number")return r;if(Hx(r))return Vs;if(lr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=lr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(rx,"");var t=ox.test(r);return t||sx.test(r)?cx(r.slice(2),t?2:8):ax.test(r)?Vs:+r}function Xx(r){return function(){return r}}function Yx(r){return r}Li.placeholder={};var Kx=Li,Qs=be(Kx);function Zx(r,e){return{...Fi(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,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:{},...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:{},status:e.status?e.status.toUpperCase():void 0}}function Jx(r,e){return{...Fi(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,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:void 0,...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:void 0,force_update:r}}function ef(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:d,has_queued_charges:y,is_prepaid:w,is_skippable:S,is_swappable:O,max_retries_reached:b,next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:T,order_interval_unit:F,presentment_currency:m,price:g,product_title:_,properties:A,quantity:x,sku:M,sku_override:Y,status:me,updated_at:dr,variant_title:we}=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:`${d}`},has_queued_charges:Os(y),is_prepaid:w,is_skippable:S,is_swappable:O,max_retries_reached:Os(b),next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:parseInt(T,10),order_interval_unit:F,presentment_currency:m,price:`${g}`,product_title:_??"",properties:A,quantity:x,sku:M,sku_override:Y,status:me.toLowerCase(),updated_at:dr,variant_title:we}}async function Qx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await $("get","/subscriptions",{id:e,query:{include:t?.include}},v(r,"getSubscription"));return n}function e2(r,e){return $("get","/subscriptions",{query:e},v(r,"listSubscriptions"))}async function r2(r,e,t){const{subscription:n}=await $("post","/subscriptions",{data:e,query:t},v(r,"createSubscription"));return n}async function t2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await $("put","/subscriptions",{id:e,data:t,query:n},v(r,"updateSubscription"));return i}async function n2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await $("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},v(r,"updateSubscriptionChargeDate"));return i}async function i2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await $("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},v(r,"updateSubscriptionAddress"));return n}async function a2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await $("post",`/subscriptions/${e}/cancel`,{data:t,query:n},v(r,"cancelSubscription"));return i}async function o2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await $("post",`/subscriptions/${e}/activate`,{query:t},v(r,"activateSubscription"));return n}async function u2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await $("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},v(r,"skipSubscriptionCharge"));return n}async function s2(r,e,t){if(e===void 0||e.length===0)throw new Error("Subscription IDs are required");const{onetimes:n}=await $("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},v(r,"skipGiftSubscriptionCharge"));return n}async function f2(r,e,t){const n=e.length;if(n<1||n>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:i}=r;if(!i)throw new Error("No customerId in session.");const a=e[0].address_id;if(!e.every(l=>l.address_id===a))throw new Error("All subscriptions must have the same address_id.");const o=Qs(Zx,i),u=e.map(o);let f;t?.allow_onetimes!==void 0&&(f={allow_onetimes:t.allow_onetimes});const{subscriptions:c}=await $("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:u,commit_update:!!t?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"createSubscriptions"));return c.map(ef)}async function c2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");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=Qs(Jx,!!n?.force_update),u=t.map(o);let f;n?.allow_onetimes!==void 0&&(f={allow_onetimes:n.allow_onetimes});const{subscriptions:c}=await $("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:u,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"updateSubscriptions"));return c.map(ef)}async function l2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");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.");let o;n?.allow_onetimes!==void 0&&(o={allow_onetimes:n.allow_onetimes}),await $("delete",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:t,send_email:!!n?.send_email,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:o},v(r,"deleteSubscriptions"))}var d2=Object.freeze({__proto__:null,activateSubscription:o2,cancelSubscription:a2,createSubscription:r2,createSubscriptions:f2,deleteSubscriptions:l2,getSubscription:Qx,listSubscriptions:e2,skipGiftSubscriptionCharge:s2,skipSubscriptionCharge:u2,updateSubscription:t2,updateSubscriptionAddress:i2,updateSubscriptionChargeDate:n2,updateSubscriptions:c2});const p2={get(r,e){return X("get",r,e)},post(r,e){return X("post",r,e)},put(r,e){return X("put",r,e)},delete(r,e){return X("delete",r,e)}};function h2(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 y2(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.");yd({storeIdentifier:h2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,__unstable_twoFactorRetryFn:r.__unstable_twoFactorRetryFn,storefrontAccessToken:t,appName:r.appName,appVersion:r.appVersion,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri,customerHash:e.customerHash}),Fs()}const rf={init:y2,api:p2,address:xd,auth:Ud,bundle:rA,bundleData:fA,charge:VO,cdn:CO,collection:XO,credit:uI,customer:nI,gift:cI,membership:gI,membershipProgram:mI,metafield:EI,onetime:PI,order:MI,paymentMethod:UI,plan:kI,product:GO,store:GI,subscription:d2};try{rf.init()}catch{}return rf});
|