@rechargeapps/storefront-client 1.2.3 → 1.3.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/utils/init.js
CHANGED
|
@@ -42,10 +42,14 @@ function getStoreIdentifier(storeIdentifier) {
|
|
|
42
42
|
}
|
|
43
43
|
function initRecharge(opt = {}) {
|
|
44
44
|
const hiddenOpts = opt;
|
|
45
|
+
const { storefrontAccessToken } = opt;
|
|
46
|
+
if (storefrontAccessToken && !storefrontAccessToken.startsWith("strfnt")) {
|
|
47
|
+
throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");
|
|
48
|
+
}
|
|
45
49
|
options.setOptions({
|
|
46
50
|
storeIdentifier: getStoreIdentifier(opt.storeIdentifier),
|
|
47
51
|
loginRetryFn: opt.loginRetryFn,
|
|
48
|
-
storefrontAccessToken
|
|
52
|
+
storefrontAccessToken,
|
|
49
53
|
environment: hiddenOpts.environment ? hiddenOpts.environment : "prod"
|
|
50
54
|
});
|
|
51
55
|
cdn.resetCDNCache();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken
|
|
1
|
+
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n const { storefrontAccessToken } = opt;\n if (storefrontAccessToken && !storefrontAccessToken.startsWith('strfnt')) {\n throw new Error(\n 'Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.'\n );\n }\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken,\n environment: hiddenOpts.environment ? hiddenOpts.environment : 'prod',\n });\n\n // When init is called again, reset the cache to make sure we don't have the old cache around\n resetCDNCache();\n}\n"],"names":["request","setOptions","resetCDNCache"],"mappings":";;;;;;;;AAGY,MAAC,GAAG,GAAG;AACnB,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAOA,eAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE;AAC5B,IAAI,OAAOA,eAAO,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAOA,eAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE;AAC9B,IAAI,OAAOA,eAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAClD,GAAG;AACH,EAAE;AACF,SAAS,kBAAkB,CAAC,eAAe,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACb,EAAE,IAAI,eAAe,EAAE;AACvB,IAAI,OAAO,eAAe,CAAC;AAC3B,GAAG;AACH,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;AAClF,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACvD,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,wDAAwD,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACpL,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;AAC5C,KAAK;AACL,GAAG;AACH,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC;AAC9D,CAAC;AACM,SAAS,YAAY,CAAC,GAAG,GAAG,EAAE,EAAE;AACvC,EAAE,MAAM,UAAU,GAAG,GAAG,CAAC;AACzB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,GAAG,CAAC;AACxC,EAAE,IAAI,qBAAqB,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AAC5E,IAAI,MAAM,IAAI,KAAK,CAAC,uKAAuK,CAAC,CAAC;AAC7L,GAAG;AACH,EAAEC,kBAAU,CAAC;AACb,IAAI,eAAe,EAAE,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5D,IAAI,YAAY,EAAE,GAAG,CAAC,YAAY;AAClC,IAAI,qBAAqB;AACzB,IAAI,WAAW,EAAE,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,GAAG,MAAM;AACzE,GAAG,CAAC,CAAC;AACL,EAAEC,iBAAa,EAAE,CAAC;AAClB;;;;;"}
|
package/dist/esm/utils/init.js
CHANGED
|
@@ -38,10 +38,14 @@ function getStoreIdentifier(storeIdentifier) {
|
|
|
38
38
|
}
|
|
39
39
|
function initRecharge(opt = {}) {
|
|
40
40
|
const hiddenOpts = opt;
|
|
41
|
+
const { storefrontAccessToken } = opt;
|
|
42
|
+
if (storefrontAccessToken && !storefrontAccessToken.startsWith("strfnt")) {
|
|
43
|
+
throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");
|
|
44
|
+
}
|
|
41
45
|
setOptions({
|
|
42
46
|
storeIdentifier: getStoreIdentifier(opt.storeIdentifier),
|
|
43
47
|
loginRetryFn: opt.loginRetryFn,
|
|
44
|
-
storefrontAccessToken
|
|
48
|
+
storefrontAccessToken,
|
|
45
49
|
environment: hiddenOpts.environment ? hiddenOpts.environment : "prod"
|
|
46
50
|
});
|
|
47
51
|
resetCDNCache();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken
|
|
1
|
+
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n const { storefrontAccessToken } = opt;\n if (storefrontAccessToken && !storefrontAccessToken.startsWith('strfnt')) {\n throw new Error(\n 'Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.'\n );\n }\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken,\n environment: hiddenOpts.environment ? hiddenOpts.environment : 'prod',\n });\n\n // When init is called again, reset the cache to make sure we don't have the old cache around\n resetCDNCache();\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,GAAG,GAAG;AACnB,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAO,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE;AAC5B,IAAI,OAAO,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAO,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE;AAC9B,IAAI,OAAO,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAClD,GAAG;AACH,EAAE;AACF,SAAS,kBAAkB,CAAC,eAAe,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACb,EAAE,IAAI,eAAe,EAAE;AACvB,IAAI,OAAO,eAAe,CAAC;AAC3B,GAAG;AACH,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;AAClF,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACvD,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,wDAAwD,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACpL,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;AAC5C,KAAK;AACL,GAAG;AACH,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC;AAC9D,CAAC;AACM,SAAS,YAAY,CAAC,GAAG,GAAG,EAAE,EAAE;AACvC,EAAE,MAAM,UAAU,GAAG,GAAG,CAAC;AACzB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,GAAG,CAAC;AACxC,EAAE,IAAI,qBAAqB,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AAC5E,IAAI,MAAM,IAAI,KAAK,CAAC,uKAAuK,CAAC,CAAC;AAC7L,GAAG;AACH,EAAE,UAAU,CAAC;AACb,IAAI,eAAe,EAAE,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5D,IAAI,YAAY,EAAE,GAAG,CAAC,YAAY;AAClC,IAAI,qBAAqB;AACzB,IAAI,WAAW,EAAE,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,GAAG,MAAM;AACzE,GAAG,CAAC,CAAC;AACL,EAAE,aAAa,EAAE,CAAC;AAClB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// recharge-client-1.
|
|
1
|
+
// recharge-client-1.3.0.min.js | MIT License | © Recharge Inc.
|
|
2
2
|
(function(ne,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.recharge=Ke())})(this,function(){"use strict";var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(r){var e=r.default;if(typeof e=="function"){var t=function(){return 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 L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function of(r){return r&&DataView.prototype.isPrototypeOf(r)}if(k.arrayBuffer)var uf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],sf=ArrayBuffer.isView||function(r){return r&&uf.indexOf(Object.prototype.toString.call(r))>-1};function Ze(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 kt(r){return typeof r!="string"&&(r=String(r)),r}function qt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return k.iterable&&(e[Symbol.iterator]=function(){return e}),e}function D(r){this.map={},r instanceof D?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)}D.prototype.append=function(r,e){r=Ze(r),e=kt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},D.prototype.delete=function(r){delete this.map[Ze(r)]},D.prototype.get=function(r){return r=Ze(r),this.has(r)?this.map[r]:null},D.prototype.has=function(r){return this.map.hasOwnProperty(Ze(r))},D.prototype.set=function(r,e){this.map[Ze(r)]=kt(e)},D.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},D.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),qt(r)},D.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),qt(r)},D.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),qt(r)},k.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function Gt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function Oi(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function ff(r){var e=new FileReader,t=Oi(e);return e.readAsArrayBuffer(r),t}function cf(r){var e=new FileReader,t=Oi(e);return e.readAsText(r),t}function lf(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 Si(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Pi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:k.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:k.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():k.arrayBuffer&&k.blob&&of(r)?(this._bodyArrayBuffer=Si(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):k.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||sf(r))?this._bodyArrayBuffer=Si(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):k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},k.blob&&(this.blob=function(){var r=Gt(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=Gt(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(ff)}),this.text=function(){var r=Gt(this);if(r)return r;if(this._bodyBlob)return cf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(lf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k.formData&&(this.formData=function(){return this.text().then(df)}),this.json=function(){return this.text().then(JSON.parse)},this}var pf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function hf(r){var e=r.toUpperCase();return pf.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 D(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 D(e.headers)),this.method=hf(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 yf(r){var e=new D,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
3
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}Pi.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 D(e.headers),this.url=e.url||"",this._initBody(r)}Pi.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var vf=[301,302,303,307,308];Y.redirect=function(r,e){if(vf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:e,headers:{location:r}})};var me=L.DOMException;try{new me}catch{me=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},me.prototype=Object.create(Error.prototype),me.prototype.constructor=me}function Ii(r,e){return new Promise(function(t,n){var i=new _e(r,e);if(i.signal&&i.signal.aborted)return n(new me("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:yf(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 me("Aborted","AbortError"))},0)};function s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.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 D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(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)})}Ii.polyfill=!0,L.fetch||(L.fetch=Ii,L.Headers=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);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},Ti=typeof Symbol<"u"&&Symbol,_f=gf,mf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},wf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,bf=Object.prototype.toString,$f="[object Function]",Af=function(e){var t=this;if(typeof t!="function"||bf.call(t)!==$f)throw new TypeError(wf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.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},Ef=Af,Vt=Function.prototype.bind||Ef,Of=Vt,Sf=Of.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Pf=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=mf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},If=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Pf,"%TypedArray%":If,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Tf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[e]=t,t},Ri={"%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"]},Je=Vt,xr=Sf,xf=Je.call(Function.call,Array.prototype.concat),Rf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Ff=Je.call(Function.call,RegExp.prototype.exec),Mf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Df=/\\(\\)?/g,Bf=function(e){var t=Rr(e,0,1),n=Rr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return Fi(e,Mf,function(a,o,s,f){i[i.length]=s?Fi(f,Df,"$1"):o||a}),i},Nf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Tf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Xt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Ff(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Bf(e),i=n.length>0?n[0]:"",a=Nf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Rf(n,xf([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Uf=Bi(Di("String.prototype.indexOf")),Cf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Uf(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Lf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function jf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Lf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function kf(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(kf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(qf(r,s,s+o>f?f:s+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 Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function Ci(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=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+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var Gf={}.toString,Li=Array.isArray||function(r){return Gf.call(r)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
24
24
|
*/(function(e,t){typeof WE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var $=e.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var P=e.fromNumber(Math.pow(d,A));b=b.multiply(P).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/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(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var $=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},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 u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+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(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).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(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,I+=R>>>16,R&=65535,I+=d+w,P+=I>>>16,I&=65535,P+=p+b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,I+=R>>>16,R&=65535,R+=$*A,I+=R>>>16,R&=65535,I+=d*h,P+=I>>>16,I&=65535,I+=_*A,P+=I>>>16,I&=65535,I+=$*w,P+=I>>>16,I&=65535,P+=p*h+d*A+_*w+$*b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var $=this.shiftRight(1);return p=$.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-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})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var VE=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=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)}},HE=ci.exports,gr=Du(HE),zE=M,XE=Du(zE);function Du(r){return r&&r.__esModule?r:{default:r}}function YE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function KE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function ZE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var _r=_t.Hyper=function(r){ZE(e,r),VE(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=Mu(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=Mu(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 YE(this,e),KE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,XE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var JE=dt,Bu=Nu(JE),QE=M,eO=Nu(QE);function Nu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Bu.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,Bu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,eO.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var rO=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}}(),Uu=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)}},tO=ci.exports,wr=Cu(tO),nO=M,iO=Cu(nO);function Cu(r){return r&&r.__esModule?r:{default:r}}function aO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function oO(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 uO(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var br=mt.UnsignedHyper=function(r){uO(e,r),rO(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=Uu(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=Uu(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 aO(this,e),oO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,iO.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var sO=dt,Lu=ju(sO),fO=M,cO=ju(fO);function ju(r){return r&&r.__esModule?r:{default:r}}var lO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Lu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Lu.default)(e)}};(0,cO.default)(lO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var pO=dt,ku=qu(pO),hO=M,dO=qu(hO);function qu(r){return r&&r.__esModule?r:{default:r}}var yO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,ku.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,ku.default)(e)}};(0,dO.default)(yO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var vO=M,gO=_O(vO);function _O(r){return r&&r.__esModule?r:{default:r}}var mO=$t.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,gO.default)(mO);var $r={},wO=se,bO=V,$O="[object Boolean]";function AO(r){return r===!0||r===!1||bO(r)&&wO(r)==$O}var EO=AO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var OO=EO,SO=Wu(OO),Gu=ce,PO=M,IO=Wu(PO);function Wu(r){return r&&r.__esModule?r:{default:r}}var TO=$r.Bool={read:function(e){var t=Gu.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 Gu.Int.write(n,t)},isValid:function(e){return(0,SO.default)(e)}};(0,IO.default)(TO);var At={},xO=se,RO=U,FO=V,MO="[object String]";function DO(r){return typeof r=="string"||!RO(r)&&FO(r)&&xO(r)==MO}var Vu=DO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var BO=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}}(),NO=Vu,Hu=li(NO),UO=U,CO=li(UO),zu=ce,LO=Te,Xu=Ie,jO=M,kO=li(jO);function li(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:LO.UnsignedInt.MAX_VALUE;qO(this,r),this._maxLength=e}return BO(r,[{key:"read",value:function(t){var n=zu.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,Hu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),zu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Hu.default)(t))n=y.from(t,"utf8");else if((0,CO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,kO.default)(GO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var WO=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}}(),Yu=Ie,VO=M,HO=zO(VO);function zO(r){return r&&r.__esModule?r:{default:r}}function XO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YO=Et.Opaque=function(){function r(e){XO(this,r),this._length=e,this._padding=(0,Yu.calculatePadding)(e)}return WO(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Yu.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 y.isBuffer(t)&&t.length===this._length}}]),r}();(0,HO.default)(YO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var KO=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}}(),Ku=ce,ZO=Te,Zu=Ie,JO=M,QO=eS(JO);function eS(r){return r&&r.__esModule?r:{default:r}}function rS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZO.UnsignedInt.MAX_VALUE;rS(this,r),this._maxLength=e}return KO(r,[{key:"read",value:function(t){var n=Ku.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,Zu.calculatePadding)(n),a=t.slice(n);return(0,Zu.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));Ku.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,QO.default)(tS.prototype);var St={},xe={exports:{}},nS=dr;function iS(r){return typeof r=="function"?r:nS}var Ju=iS,aS=Bn,oS=ai,uS=Ju,sS=U;function fS(r,e){var t=sS(r)?aS:oS;return t(r,uS(e))}var cS=fS;(function(r){r.exports=cS})(xe);var lS=/\s/;function pS(r){for(var e=r.length;e--&&lS.test(r.charAt(e)););return e}var hS=pS,dS=hS,yS=/^\s+/;function vS(r){return r&&r.slice(0,dS(r)+1).replace(yS,"")}var gS=vS,_S=gS,Qu=fe,mS=ct,es=0/0,wS=/^[-+]0x[0-9a-f]+$/i,bS=/^0b[01]+$/i,$S=/^0o[0-7]+$/i,AS=parseInt;function ES(r){if(typeof r=="number")return r;if(mS(r))return es;if(Qu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=_S(r);var t=bS.test(r);return t||$S.test(r)?AS(r.slice(2),t?2:8):wS.test(r)?es:+r}var OS=ES,SS=OS,rs=1/0,PS=17976931348623157e292;function IS(r){if(!r)return r===0?r:0;if(r=SS(r),r===rs||r===-rs){var e=r<0?-1:1;return e*PS}return r===r?r:0}var TS=IS,xS=TS;function RS(r){var e=xS(r),t=e%1;return e===e?t?e-t:e:0}var ts=RS,FS=Qa,MS=Ju,DS=ts,BS=9007199254740991,pi=4294967295,NS=Math.min;function US(r,e){if(r=DS(r),r<1||r>BS)return[];var t=pi,n=NS(r,pi);e=MS(e),r-=pi;for(var i=FS(n,e);++t<r;)e(t);return i}var ns=US;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var CS=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}}(),LS=si,jS=Ar(LS),kS=xe.exports,qS=Ar(kS),GS=ns,WS=Ar(GS),VS=U,is=Ar(VS),HS=M,zS=Ar(HS);function Ar(r){return r&&r.__esModule?r:{default:r}}function XS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YS=St.Array=function(){function r(e,t){XS(this,r),this._childType=e,this._length=t}return CS(r,[{key:"read",value:function(t){var n=this;return(0,WS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,is.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,qS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,is.default)(t)||t.length!==this._length?!1:(0,jS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,zS.default)(YS.prototype);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.VarArray=void 0;var KS=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}}(),ZS=si,JS=Er(ZS),QS=xe.exports,e2=Er(QS),r2=ns,t2=Er(r2),n2=U,as=Er(n2),i2=Te,os=ce,a2=M,o2=Er(a2);function Er(r){return r&&r.__esModule?r:{default:r}}function u2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var s2=Pt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i2.UnsignedInt.MAX_VALUE;u2(this,r),this._childType=e,this._maxLength=t}return KS(r,[{key:"read",value:function(t){var n=this,i=os.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,t2.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,as.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));os.Int.write(t.length,n),(0,e2.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,as.default)(t)||t.length>this._maxLength?!1:(0,JS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,o2.default)(s2.prototype);var It={};function f2(r){return r===null}var c2=f2;function l2(r){return r===void 0}var Or=l2;Object.defineProperty(It,"__esModule",{value:!0}),It.Option=void 0;var p2=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}}(),h2=c2,us=hi(h2),d2=Or,ss=hi(d2),fs=$r,y2=M,v2=hi(y2);function hi(r){return r&&r.__esModule?r:{default:r}}function g2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _2=It.Option=function(){function r(e){g2(this,r),this._childType=e}return p2(r,[{key:"read",value:function(t){if(fs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,us.default)(t)||(0,ss.default)(t));fs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,us.default)(t)||(0,ss.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,v2.default)(_2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var m2=Or,cs=ls(m2),w2=M,b2=ls(w2);function ls(r){return r&&r.__esModule?r:{default:r}}var $2=Sr.Void={read:function(){},write:function(e){if(!(0,cs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,cs.default)(e)}};(0,b2.default)($2);var Tt={},A2=Qr;function E2(r,e){return A2(e,function(t){return r[t]})}var O2=E2,S2=O2,P2=Xe;function I2(r){return r==null?[]:S2(r,P2(r))}var T2=I2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var x2=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}}(),R2=xe.exports,F2=di(R2),M2=T2,D2=di(M2),ps=ce,B2=M,N2=di(B2);function di(r){return r&&r.__esModule?r:{default:r}}function U2(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 C2(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 hs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L2=Tt.Enum=function(){function r(e,t){hs(this,r),this.name=e,this.value=t}return x2(r,null,[{key:"read",value:function(t){var n=ps.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);ps.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,D2.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){C2(s,o);function s(){return hs(this,s),U2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,F2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,N2.default)(L2);var xt={},j2=ai,k2=pr;function q2(r,e){var t=-1,n=k2(r)?Array(r.length):[];return j2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var G2=q2,W2=Qr,V2=Pu,H2=G2,z2=U;function X2(r,e){var t=z2(r)?W2:H2;return t(r,V2(e))}var Y2=X2;function K2(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 Z2=K2,Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});var J2=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 Q2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Pr.Reference=function(){function r(){Q2(this,r)}return J2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),eP=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}}(),rP=xe.exports,ds=Ir(rP),tP=Y2,nP=Ir(tP),iP=Or,aP=Ir(iP),oP=Z2,uP=Ir(oP),sP=Pr,fP=M,cP=Ir(fP);function Ir(r){return r&&r.__esModule?r:{default:r}}function lP(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 pP(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 ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var hP=xt.Struct=function(){function r(e){ys(this,r),this._attributes=e||{}}return eP(r,null,[{key:"read",value:function(t){var n=(0,nP.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,uP.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,ds.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){pP(s,o);function s(){return ys(this,s),lP(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof sP.Reference&&(c=c.resolve(t)),[f,c]}),(0,ds.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=dP(f)}),a}}]),r}();(0,cP.default)(hP);function dP(r){return function(t){return(0,aP.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var yP=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),vP=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}}(),gP=xe.exports,Mt=Bt(gP),_P=Or,vs=Bt(_P),mP=Vu,gs=Bt(mP),Dt=Sr,yi=Pr,wP=M,bP=Bt(wP);function Bt(r){return r&&r.__esModule?r:{default:r}}function $P(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 AP(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 _s(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EP=Ft.Union=function(){function r(e,t){_s(this,r),this.set(e,t)}return vP(r,[{key:"set",value:function(t,n){(0,gs.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!==Dt.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===Dt.Void?Dt.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,vs.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(s){AP(f,s);function f(){return _s(this,f),$P(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,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=yP(s,2),c=f[0],l=f[1];(0,gs.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,vs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,bP.default)(EP),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=Pt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=It;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var ms={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var O=0;O<g.length;O++){var S=g[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,O){return g&&m(v.prototype,g),O&&m(v,O),v}}(),t=Pr;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Or,i=l(n),a=xe.exports,o=l(a),s=ii,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var $=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.name=g,O}return e(v,[{key:"resolve",value:function(O){var S=O.definitions[this.name];return S.resolve(O)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,O){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=O,B.variable=S,B}return e(v,[{key:"resolve",value:function(O){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),B instanceof t.Reference&&(B=B.resolve(O)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.childReference=g,O.name=g.name,O}return e(v,[{key:"resolve",value:function(O){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(O)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,O){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=O,S}return e(v,[{key:"resolve",value:function(O){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,O){u(this,m),this.constructor=v,this.name=g,this.config=O}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function P(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function I(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,O){var S=new h(f.Enum.create,g,O);this.define(g,S)}},{key:"struct",value:function(g,O){var S=new h(f.Struct.create,g,O);this.define(g,S)}},{key:"union",value:function(g,O){var S=new h(f.Union.create,g,O);this.define(g,S)}},{key:"typedef",value:function(g,O){var S=new h(P,g,O);this.define(g,S)}},{key:"const",value:function(g,O){var S=new h(I,g,O);this.define(g,S)}},{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(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,O){return new b(g,O)}},{key:"varArray",value:function(g,O){return new b(g,O,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,O){if((0,i.default)(this._destination[g]))this._definitions[g]=O;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(ms),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=ms;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(uu);function OP(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=uu.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")}})}),ws="/bundling-storefront-manager";function SP(){return Math.ceil(Date.now()/1e3)}async function PP(){try{const{timestamp:r}=await sr("get",`${ws}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),SP()}}async function IP(r){const e=ue(),t=await bs(r);if(t!==!0)throw new Error(t);const n=await PP(),i=OP({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await sr("post",`${ws}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function TP(r,e){const t=$s(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${qp(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 bs(r){try{return r?await au(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const xP={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 $s(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=xP[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 RP(r,e){const{bundle_selection:t}=await E("get","/bundle_selections",{id:e},r);return t}function FP(r,e){return E("get","/bundle_selections",{query:e},r)}async function MP(r,e){const{bundle_selection:t}=await E("post","/bundle_selections",{data:e},r);return t}async function DP(r,e,t){const{bundle_selection:n}=await E("put","/bundle_selections",{id:e,data:t},r);return n}function BP(r,e){return E("delete","/bundle_selections",{id:e},r)}var NP=Object.freeze({__proto__:null,getBundleId:IP,getDynamicBundleItems:TP,validateBundle:bs,validateDynamicBundle:$s,getBundleSelection:RP,listBundleSelections:FP,createBundleSelection:MP,updateBundleSelection:DP,deleteBundleSelection:BP});async function UP(r,e,t){const{charge:n}=await E("get","/charges",{id:e,query:{include:t?.include}},r);return n}function CP(r,e){return E("get","/charges",{query:e},r)}async function LP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function jP(r,e){const{charge:t}=await E("post",`/charges/${e}/remove_discount`,{},r);return t}async function kP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/skip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function qP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/unskip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function GP(r,e){const{charge:t}=await E("post",`/charges/${e}/process`,{},r);return t}var WP=Object.freeze({__proto__:null,getCharge:UP,listCharges:CP,applyDiscountToCharge:LP,removeDiscountsFromCharge:jP,skipCharge:kP,unskipCharge:qP,processCharge:GP});async function VP(r,e){const{membership:t}=await E("get","/memberships",{id:e},r);return t}function HP(r,e){return E("get","/memberships",{query:e},r)}async function zP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function XP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/activate`,{data:t},r);return n}async function YP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/change`,{data:t},r);return n}var KP=Object.freeze({__proto__:null,getMembership:VP,listMemberships:HP,cancelMembership:zP,activateMembership:XP,changeMembership:YP});async function ZP(r,e,t){const{membership_program:n}=await E("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function JP(r,e){return E("get","/membership_programs",{query:e},r)}var QP=Object.freeze({__proto__:null,getMembershipProgram:ZP,listMembershipPrograms:JP});async function eI(r,e){const{metafield:t}=await E("post","/metafields",{data:{metafield:e}},r);return t}async function rI(r,e,t){const{metafield:n}=await E("put","/metafields",{id:e,data:{metafield:t}},r);return n}function tI(r,e){return E("delete","/metafields",{id:e},r)}var nI=Object.freeze({__proto__:null,createMetafield:eI,updateMetafield:rI,deleteMetafield:tI});async function iI(r,e){const{onetime:t}=await E("get","/onetimes",{id:e},r);return t}function aI(r,e){return E("get","/onetimes",{query:e},r)}async function oI(r,e){const{onetime:t}=await E("post","/onetimes",{data:e},r);return t}async function uI(r,e,t){const{onetime:n}=await E("put","/onetimes",{id:e,data:t},r);return n}function sI(r,e){return E("delete","/onetimes",{id:e},r)}var fI=Object.freeze({__proto__:null,getOnetime:iI,listOnetimes:aI,createOnetime:oI,updateOnetime:uI,deleteOnetime:sI});async function cI(r,e){const{order:t}=await E("get","/orders",{id:e},r);return t}function lI(r,e){return E("get","/orders",{query:e},r)}var pI=Object.freeze({__proto__:null,getOrder:cI,listOrders:lI});async function hI(r,e,t){const{payment_method:n}=await E("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function dI(r,e,t){const{payment_method:n}=await E("put","/payment_methods",{id:e,data:t},r);return n}function yI(r,e){return E("get","/payment_methods",{query:e},r)}var vI=Object.freeze({__proto__:null,getPaymentMethod:hI,updatePaymentMethod:dI,listPaymentMethods:yI});async function gI(r,e){const{plan:t}=await E("get","/plans",{id:e},r);return t}function _I(r,e){return E("get","/plans",{query:e},r)}var mI=Object.freeze({__proto__:null,getPlan:gI,listPlans:_I}),As=ho,wI=As&&new As,Es=wI,bI=dr,Os=Es,$I=Os?function(r,e){return Os.set(r,e),r}:bI,Ss=$I,AI=st,EI=fe;function OI(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=AI(r.prototype),n=r.apply(t,e);return EI(n)?n:t}}var Nt=OI,SI=Nt,PI=G,II=1;function TI(r,e,t){var n=e&II,i=SI(r);function a(){var o=this&&this!==PI&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var xI=TI,RI=Math.max;function FI(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=RI(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Ps=FI,MI=Math.max;function DI(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=MI(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Is=DI;function BI(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var NI=BI;function UI(){}var vi=UI,CI=st,LI=vi,jI=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jI,this.__views__=[]}Ut.prototype=CI(LI.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function kI(){}var qI=kI,Ts=Es,GI=qI,WI=Ts?function(r){return Ts.get(r)}:GI,xs=WI,VI={},HI=VI,Rs=HI,zI=Object.prototype,XI=zI.hasOwnProperty;function YI(r){for(var e=r.name+"",t=Rs[e],n=XI.call(Rs,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var KI=YI,ZI=st,JI=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=ZI(JI.prototype),Ct.prototype.constructor=Ct;var Fs=Ct,QI=gi,eT=Fs,rT=kn;function tT(r){if(r instanceof QI)return r.clone();var e=new eT(r.__wrapped__,r.__chain__);return e.__actions__=rT(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var nT=tT,iT=gi,Ms=Fs,aT=vi,oT=U,uT=V,sT=nT,fT=Object.prototype,cT=fT.hasOwnProperty;function Lt(r){if(uT(r)&&!oT(r)&&!(r instanceof iT)){if(r instanceof Ms)return r;if(cT.call(r,"__wrapped__"))return sT(r)}return new Ms(r)}Lt.prototype=aT.prototype,Lt.prototype.constructor=Lt;var lT=Lt,pT=gi,hT=xs,dT=KI,yT=lT;function vT(r){var e=dT(r),t=yT[e];if(typeof t!="function"||!(e in pT.prototype))return!1;if(r===t)return!0;var n=hT(t);return!!n&&r===n[0]}var gT=vT,_T=Ss,mT=Ho,wT=mT(_T),Ds=wT,bT=/\{\n\/\* \[wrapped with (.+)\] \*/,$T=/,? & /;function AT(r){var e=r.match(bT);return e?e[1].split($T):[]}var ET=AT,OT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ST(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(OT,`{
|
|
25
25
|
/* [wrapped with `+e+`] */
|
|
26
|
-
`)}var PT=ST;function IT(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}var TT=IT;function xT(r){return r!==r}var RT=xT;function FT(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var MT=FT,DT=TT,BT=RT,NT=MT;function UT(r,e,t){return e===e?NT(r,e,t):DT(r,BT,t)}var CT=UT,LT=CT;function jT(r,e){var t=r==null?0:r.length;return!!t&<(r,e,0)>-1}var kT=jT,qT=Bn,GT=kT,WT=1,VT=2,HT=8,zT=16,XT=32,YT=64,KT=128,ZT=256,JT=512,QT=[["ary",KT],["bind",WT],["bindKey",VT],["curry",HT],["curryRight",zT],["flip",JT],["partial",XT],["partialRight",YT],["rearg",ZT]];function ex(r,e){return qT(QT,function(t){var n="_."+t[0];e&t[1]&&!GT(r,n)&&r.push(n)}),r.sort()}var rx=ex,tx=ET,nx=PT,ix=ri,ax=rx;function ox(r,e,t){var n=e+"";return ix(r,nx(n,ax(tx(n),t)))}var Bs=ox,ux=gT,sx=Ds,fx=Bs,cx=1,lx=2,px=4,hx=8,Ns=32,Us=64;function dx(r,e,t,n,i,a,o,s,f,c){var l=e&hx,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ns:Us,e&=~(l?Us:Ns),e&px||(e&=~(cx|lx));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return ux(r)&&sx(b,$),b.placeholder=n,fx(b,r,e)}var Cs=dx;function yx(r){var e=r;return e.placeholder}var _i=yx,vx=kn,gx=at,_x=Math.min;function mx(r,e){for(var t=r.length,n=_x(e.length,t),i=vx(r);n--;){var a=e[n];r[n]=gx(a,t)?i[a]:void 0}return r}var wx=mx,Ls="__lodash_placeholder__";function bx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ls)&&(r[t]=Ls,a[i++]=t)}return a}var jt=bx,$x=Ps,Ax=Is,Ex=NI,js=Nt,Ox=Cs,Sx=_i,Px=wx,Ix=jt,Tx=G,xx=1,Rx=2,Fx=8,Mx=16,Dx=128,Bx=512;function ks(r,e,t,n,i,a,o,s,f,c){var l=e&Dx,u=e&xx,p=e&Rx,d=e&(Fx|Mx),_=e&Bx,$=p?void 0:js(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var P=Sx(b),I=Ex(A,P);if(n&&(A=$x(A,n,i,d)),a&&(A=Ax(A,a,o,d)),w-=I,d&&w<c){var R=Ix(A,P);return Ox(r,e,ks,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=Px(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Tx&&this instanceof b&&(v=$||js(v)),v.apply(m,A)}return b}var qs=ks,Nx=ei,Ux=Nt,Cx=qs,Lx=Cs,jx=_i,kx=jt,qx=G;function Gx(r,e,t){var n=Ux(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=jx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:kx(o,f);if(a-=c.length,a<t)return Lx(r,e,Cx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==qx&&this instanceof i?n:r;return Nx(l,this,o)}return i}var Wx=Gx,Vx=ei,Hx=Nt,zx=G,Xx=1;function Yx(r,e,t,n){var i=e&Xx,a=Hx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==zx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Vx(p,i?t:this,u)}return o}var Kx=Yx,Zx=Ps,Jx=Is,Gs=jt,Ws="__lodash_placeholder__",mi=1,Qx=2,eR=4,Vs=8,Tr=128,Hs=256,rR=Math.min;function tR(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|Qx|Tr),o=n==Tr&&t==Vs||n==Tr&&t==Hs&&r[7].length<=e[8]||n==(Tr|Hs)&&e[7].length<=e[8]&&t==Vs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:eR);var s=e[3];if(s){var f=r[3];r[3]=f?Zx(f,s,e[4]):s,r[4]=f?Gs(r[3],Ws):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Jx(f,s,e[6]):s,r[6]=f?Gs(r[5],Ws):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:rR(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var nR=tR,iR=Ss,aR=xI,oR=Wx,uR=qs,sR=Kx,fR=xs,cR=nR,lR=Ds,pR=Bs,zs=ts,hR="Expected a function",Xs=1,dR=2,wi=8,bi=16,$i=32,Ys=64,Ks=Math.max;function yR(r,e,t,n,i,a,o,s){var f=e&dR;if(!f&&typeof r!="function")throw new TypeError(hR);var c=n?n.length:0;if(c||(e&=~($i|Ys),n=i=void 0),o=o===void 0?o:Ks(zs(o),0),s=s===void 0?s:zs(s),c-=i?i.length:0,e&Ys){var l=n,u=i;n=i=void 0}var p=f?void 0:fR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&cR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:Ks(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Xs)var _=aR(r,e,t);else e==wi||e==bi?_=oR(r,e,s):(e==$i||e==(Xs|$i))&&!i.length?_=sR(r,e,t,n):_=uR.apply(void 0,d);var $=p?iR:lR;return pR($(_,d),r,e)}var vR=yR,gR=fu,_R=vR,mR=_i,wR=jt,bR=32,Ai=gR(function(r,e){var t=wR(e,mR(Ai));return _R(r,bR,void 0,e,t)});Ai.placeholder={};var Zs=Ai,$R=Object.defineProperty,AR=Object.defineProperties,ER=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,OR=Object.prototype.hasOwnProperty,SR=Object.prototype.propertyIsEnumerable,Qs=(r,e,t)=>e in r?$R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ef=(r,e)=>{for(var t in e||(e={}))OR.call(e,t)&&Qs(r,t,e[t]);if(Js)for(var t of Js(e))SR.call(e,t)&&Qs(r,t,e[t]);return r},rf=(r,e)=>AR(r,ER(e));function PR(r,e){return rf(ef({},ti(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function IR(r,e){var t;return rf(ef({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r})}function tf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:I,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Yo(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Yo(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:parseInt(I,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function TR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function xR(r,e){return E("get","/subscriptions",{query:e},r)}async function RR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function FR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function MR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function DR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function BR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function NR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function UR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function CR(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Zs(PR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(tf)}async function LR(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Zs(IR,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(tf)}var jR=Object.freeze({__proto__:null,getSubscription:TR,listSubscriptions:xR,createSubscription:RR,updateSubscription:FR,updateSubscriptionChargeDate:MR,updateSubscriptionAddress:DR,cancelSubscription:BR,activateSubscription:NR,skipSubscriptionCharge:UR,createSubscriptions:CR,updateSubscriptions:LR});async function kR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function qR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function GR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function WR(r){return await E("get","/portal_access",{},r)}var VR=Object.freeze({__proto__:null,getCustomer:kR,updateCustomer:qR,getDeliverySchedule:GR,getCustomerPortalAccess:WR});const HR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function zR(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function XR(r={}){const e=r;pp({storeIdentifier:zR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),ou()}const nf={init:XR,api:HR,address:Rp,auth:kp,bundle:NP,charge:WP,cdn:w1,customer:VR,membership:KP,membershipProgram:QP,metafield:nI,onetime:fI,order:pI,paymentMethod:vI,plan:mI,subscription:jR};try{nf.init()}catch{}return nf});
|
|
26
|
+
`)}var PT=ST;function IT(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}var TT=IT;function xT(r){return r!==r}var RT=xT;function FT(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var MT=FT,DT=TT,BT=RT,NT=MT;function UT(r,e,t){return e===e?NT(r,e,t):DT(r,BT,t)}var CT=UT,LT=CT;function jT(r,e){var t=r==null?0:r.length;return!!t&<(r,e,0)>-1}var kT=jT,qT=Bn,GT=kT,WT=1,VT=2,HT=8,zT=16,XT=32,YT=64,KT=128,ZT=256,JT=512,QT=[["ary",KT],["bind",WT],["bindKey",VT],["curry",HT],["curryRight",zT],["flip",JT],["partial",XT],["partialRight",YT],["rearg",ZT]];function ex(r,e){return qT(QT,function(t){var n="_."+t[0];e&t[1]&&!GT(r,n)&&r.push(n)}),r.sort()}var rx=ex,tx=ET,nx=PT,ix=ri,ax=rx;function ox(r,e,t){var n=e+"";return ix(r,nx(n,ax(tx(n),t)))}var Bs=ox,ux=gT,sx=Ds,fx=Bs,cx=1,lx=2,px=4,hx=8,Ns=32,Us=64;function dx(r,e,t,n,i,a,o,s,f,c){var l=e&hx,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ns:Us,e&=~(l?Us:Ns),e&px||(e&=~(cx|lx));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return ux(r)&&sx(b,$),b.placeholder=n,fx(b,r,e)}var Cs=dx;function yx(r){var e=r;return e.placeholder}var _i=yx,vx=kn,gx=at,_x=Math.min;function mx(r,e){for(var t=r.length,n=_x(e.length,t),i=vx(r);n--;){var a=e[n];r[n]=gx(a,t)?i[a]:void 0}return r}var wx=mx,Ls="__lodash_placeholder__";function bx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ls)&&(r[t]=Ls,a[i++]=t)}return a}var jt=bx,$x=Ps,Ax=Is,Ex=NI,js=Nt,Ox=Cs,Sx=_i,Px=wx,Ix=jt,Tx=G,xx=1,Rx=2,Fx=8,Mx=16,Dx=128,Bx=512;function ks(r,e,t,n,i,a,o,s,f,c){var l=e&Dx,u=e&xx,p=e&Rx,d=e&(Fx|Mx),_=e&Bx,$=p?void 0:js(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var P=Sx(b),I=Ex(A,P);if(n&&(A=$x(A,n,i,d)),a&&(A=Ax(A,a,o,d)),w-=I,d&&w<c){var R=Ix(A,P);return Ox(r,e,ks,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=Px(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Tx&&this instanceof b&&(v=$||js(v)),v.apply(m,A)}return b}var qs=ks,Nx=ei,Ux=Nt,Cx=qs,Lx=Cs,jx=_i,kx=jt,qx=G;function Gx(r,e,t){var n=Ux(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=jx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:kx(o,f);if(a-=c.length,a<t)return Lx(r,e,Cx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==qx&&this instanceof i?n:r;return Nx(l,this,o)}return i}var Wx=Gx,Vx=ei,Hx=Nt,zx=G,Xx=1;function Yx(r,e,t,n){var i=e&Xx,a=Hx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==zx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Vx(p,i?t:this,u)}return o}var Kx=Yx,Zx=Ps,Jx=Is,Gs=jt,Ws="__lodash_placeholder__",mi=1,Qx=2,eR=4,Vs=8,Tr=128,Hs=256,rR=Math.min;function tR(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|Qx|Tr),o=n==Tr&&t==Vs||n==Tr&&t==Hs&&r[7].length<=e[8]||n==(Tr|Hs)&&e[7].length<=e[8]&&t==Vs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:eR);var s=e[3];if(s){var f=r[3];r[3]=f?Zx(f,s,e[4]):s,r[4]=f?Gs(r[3],Ws):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Jx(f,s,e[6]):s,r[6]=f?Gs(r[5],Ws):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:rR(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var nR=tR,iR=Ss,aR=xI,oR=Wx,uR=qs,sR=Kx,fR=xs,cR=nR,lR=Ds,pR=Bs,zs=ts,hR="Expected a function",Xs=1,dR=2,wi=8,bi=16,$i=32,Ys=64,Ks=Math.max;function yR(r,e,t,n,i,a,o,s){var f=e&dR;if(!f&&typeof r!="function")throw new TypeError(hR);var c=n?n.length:0;if(c||(e&=~($i|Ys),n=i=void 0),o=o===void 0?o:Ks(zs(o),0),s=s===void 0?s:zs(s),c-=i?i.length:0,e&Ys){var l=n,u=i;n=i=void 0}var p=f?void 0:fR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&cR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:Ks(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Xs)var _=aR(r,e,t);else e==wi||e==bi?_=oR(r,e,s):(e==$i||e==(Xs|$i))&&!i.length?_=sR(r,e,t,n):_=uR.apply(void 0,d);var $=p?iR:lR;return pR($(_,d),r,e)}var vR=yR,gR=fu,_R=vR,mR=_i,wR=jt,bR=32,Ai=gR(function(r,e){var t=wR(e,mR(Ai));return _R(r,bR,void 0,e,t)});Ai.placeholder={};var Zs=Ai,$R=Object.defineProperty,AR=Object.defineProperties,ER=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,OR=Object.prototype.hasOwnProperty,SR=Object.prototype.propertyIsEnumerable,Qs=(r,e,t)=>e in r?$R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ef=(r,e)=>{for(var t in e||(e={}))OR.call(e,t)&&Qs(r,t,e[t]);if(Js)for(var t of Js(e))SR.call(e,t)&&Qs(r,t,e[t]);return r},rf=(r,e)=>AR(r,ER(e));function PR(r,e){return rf(ef({},ti(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function IR(r,e){var t;return rf(ef({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r})}function tf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:I,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Yo(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Yo(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:parseInt(I,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function TR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function xR(r,e){return E("get","/subscriptions",{query:e},r)}async function RR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function FR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function MR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function DR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function BR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function NR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function UR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function CR(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Zs(PR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(tf)}async function LR(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Zs(IR,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(tf)}var jR=Object.freeze({__proto__:null,getSubscription:TR,listSubscriptions:xR,createSubscription:RR,updateSubscription:FR,updateSubscriptionChargeDate:MR,updateSubscriptionAddress:DR,cancelSubscription:BR,activateSubscription:NR,skipSubscriptionCharge:UR,createSubscriptions:CR,updateSubscriptions:LR});async function kR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function qR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function GR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function WR(r){return await E("get","/portal_access",{},r)}var VR=Object.freeze({__proto__:null,getCustomer:kR,updateCustomer:qR,getDeliverySchedule:GR,getCustomerPortalAccess:WR});const HR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function zR(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function XR(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.");pp({storeIdentifier:zR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:t,environment:e.environment?e.environment:"prod"}),ou()}const nf={init:XR,api:HR,address:Rp,auth:kp,bundle:NP,charge:WP,cdn:w1,customer:VR,membership:KP,membershipProgram:QP,metafield:nI,onetime:fI,order:pI,paymentMethod:vI,plan:mI,subscription:jR};try{nf.init()}catch{}return nf});
|