varsnap 1.12.0 → 1.13.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/built/test/core.js +15 -4
- package/built/test/core.js.map +1 -1
- package/built/varsnap/core.d.ts +1 -1
- package/built/varsnap/core.js +11 -2
- package/built/varsnap/core.js.map +1 -1
- package/built/webpack.config.js +1 -5
- package/built/webpack.config.js.map +1 -1
- package/dist/browser.js +1614 -612
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +2 -2
- package/dist/browser.min.js.map +1 -1
- package/dist/node.cjs +3457 -1107
- package/dist/node.cjs.map +1 -1
- package/dist/node.min.cjs +3 -3
- package/dist/node.min.cjs.map +1 -1
- package/package.json +24 -27
- package/varsnap/core.ts +11 -2
package/dist/browser.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Varsnap.js v1.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.varsnap=t():e.varsnap=t()}(this,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.d(t,{default:()=>Pt});var n={};function r(e,t){return function(){return e.apply(t,arguments)}}e.r(n),e.d(n,{hasBrowserEnv:()=>de,hasStandardBrowserEnv:()=>he,hasStandardBrowserWebWorkerEnv:()=>ge,navigator:()=>pe,origin:()=>me});const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:i,toStringTag:a}=Symbol,c=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,p=f("undefined");function h(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=l("ArrayBuffer");const m=f("string"),b=f("function"),y=f("number"),w=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==c(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||i in e)},R=l("Date"),O=l("File"),S=l("Blob"),T=l("FileList");const v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e.g?e.g:{},_=void 0!==v.FormData?v.FormData:void 0,A=l("URLSearchParams"),[C,j,P,N]=["ReadableStream","Request","Response","Headers"].map(l);function x(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(h(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function U(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g,L=e=>!p(e)&&e!==k;const F=(B="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>B&&e instanceof B);var B;const D=l("HTMLFormElement"),q=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),I=l("RegExp"),z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};x(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const M=l("AsyncFunction"),V=(H="function"==typeof setImmediate,J=b(k.postMessage),H?setImmediate:J?(W=`axios@${Math.random()}`,$=[],k.addEventListener("message",({source:e,data:t})=>{e===k&&t===W&&$.length&&$.shift()()},!1),e=>{$.push(e),k.postMessage(W,"*")}):e=>setTimeout(e));var H,J,W,$;const K="undefined"!=typeof queueMicrotask?queueMicrotask.bind(k):"undefined"!=typeof process&&process.nextTick||V,G={isArray:d,isArrayBuffer:g,isBuffer:h,isFormData:e=>{let t;return e&&(_&&e instanceof _||b(e.append)&&("formdata"===(t=c(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:m,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:E,isEmptyObject:e=>{if(!w(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:j,isResponse:P,isHeaders:N,isUndefined:p,isDate:R,isFile:O,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:S,isRegExp:I,isFunction:b,isStream:e=>w(e)&&b(e.pipe),isURLSearchParams:A,isTypedArray:F,isFileList:T,forEach:x,merge:function e(){const{caseless:t,skipUndefined:n}=L(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&U(r,s)||s;E(r[i])&&E(o)?r[i]=e(r[i],o):E(o)?r[i]=e({},o):d(o)?r[i]=o.slice():n&&p(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(x(t,(t,o)=>{n&&b(t)?Object.defineProperty(e,o,{value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!y(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[i]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:D,hasOwnProperty:q,hasOwnProp:q,reduceDescriptors:z,freezeMethods:e=>{z(e,(t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:k,isContextDefined:L,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[a]&&e[i])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return x(e,(e,t)=>{const s=n(e,r+1);!p(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:M,isThenable:e=>e&&(w(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:V,asap:K,isIterable:e=>null!=e&&b(e[i])};class X extends Error{static from(e,t,n,r,o,s){const i=new X(e.message,t||e.code,n,r,o);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}}X.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",X.ERR_BAD_OPTION="ERR_BAD_OPTION",X.ECONNABORTED="ECONNABORTED",X.ETIMEDOUT="ETIMEDOUT",X.ERR_NETWORK="ERR_NETWORK",X.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",X.ERR_DEPRECATED="ERR_DEPRECATED",X.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",X.ERR_BAD_REQUEST="ERR_BAD_REQUEST",X.ERR_CANCELED="ERR_CANCELED",X.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",X.ERR_INVALID_URL="ERR_INVALID_URL";const Q=X;function Y(e){return G.isPlainObject(e)||G.isArray(e)}function Z(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function ee(e,t,n){return e?e.concat(t).map(function(e,t){return e=Z(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const te=G.toFlatObject(G,{},null,function(e){return/^is[A-Z]/.test(e)});const ne=function(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!G.isUndefined(t[e])})).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(G.isBoolean(e))return e.toString();if(!a&&G.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(G.isReactNative(t)&&G.isReactNativeBlob(e))return t.append(ee(o,n,s),c(e)),!1;if(e&&!o&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(Y)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(a=G.toArray(e)))return n=Z(n),a.forEach(function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===i?ee([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!Y(e)||(t.append(ee(o,n,s),c(e)),!1)}const l=[],f=Object.assign(te,{defaultVisitor:u,convertValue:c,isVisitable:Y});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),G.forEach(n,function(n,s){!0===(!(G.isUndefined(n)||null===n)&&o.call(t,n,G.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),l.pop()}}(e),t};function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function oe(e,t){this._pairs=[],e&&ne(e,this,t)}const se=oe.prototype;se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ie=oe;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(e,t,n){if(!t)return e;const r=n&&n.encode||ae,o=G.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):G.isURLSearchParams(t)?t.toString():new ie(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const ue=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,function(t){null!==t&&e(t)})}},le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},de="undefined"!=typeof window&&"undefined"!=typeof document,pe="object"==typeof navigator&&navigator||void 0,he=de&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=de&&window.location.href||"http://localhost",be={...n,...fe};const ye=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&G.isArray(r)?r.length:s,a)return G.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&G.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&G.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,(e,r)=>{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const we={transitional:le,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=G.isObject(e);o&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(ye(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e)||G.isReadableStream(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ne(e,new be.classes.URLSearchParams,{visitor:function(e,t,n,r){return be.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ne(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||we.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(G.isResponse(e)||G.isReadableStream(e))return e;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:be.classes.FormData,Blob:be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{we.headers[e]={}});const Ee=we,Re=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Te(e){return!1===e||null==e?e:G.isArray(e)?e.map(Te):String(e).replace(/[\r\n]+$/,"")}function ve(e,t,n,r,o){return G.isFunction(r)?r.call(this,t,n):(o&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}class _e{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Se(t);if(!o)throw new Error("header name must be a non-empty string");const s=G.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Te(e))}const s=(e,t)=>G.forEach(e,(e,n)=>o(e,n,t));if(G.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Re[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(G.isObject(e)&&G.isIterable(e)){let n,r,o={};for(const t of e){if(!G.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?G.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Se(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Se(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!ve(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Se(e)){const o=G.findKey(n,e);!o||t&&!ve(0,n[o],o,t)||(delete n[o],r=!0)}}return G.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ve(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,(r,o)=>{const s=G.findKey(n,o);if(s)return t[s]=Te(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Te(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Oe]=this[Oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Se(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),G.freezeMethods(_e);const Ae=_e;function Ce(e,t){const n=this||Ee,r=t||n,o=Ae.from(r.headers);let s=r.data;return G.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function je(e){return!(!e||!e.__CANCEL__)}const Pe=class extends Q{constructor(e,t,n){super(null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ne(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const xe=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}};const Ue=function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]},ke=(e,t,n=3)=>{let r=0;const o=xe(50,250);return Ue(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Le=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fe=e=>(...t)=>G.asap(()=>e(...t)),Be=be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(be.origin),be.navigator&&/(msie|trident)/i.test(be.navigator.userAgent)):()=>!0,De=be.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];G.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),G.isString(r)&&a.push(`path=${r}`),G.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),G.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function qe(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ie=e=>e instanceof Ae?{...e}:e;function ze(e,t){t=t||{};const n={};function r(e,t,n,r){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:r},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function o(e,t,n,o){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!G.isUndefined(t))return r(void 0,t)}function i(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Ie(e),Ie(t),0,!0)};return G.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=G.hasOwnProp(c,r)?c[r]:o,i=s(e[r],t[r],r);G.isUndefined(i)&&s!==a||(n[r]=i)}),n}const Me=e=>{const t=ze({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Ae.from(i),t.url=ce(qe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),G.isFormData(n))if(be.hasStandardBrowserEnv||be.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(G.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(be.hasStandardBrowserEnv&&(r&&G.isFunction(r)&&(r=r(t)),r||!1!==r&&Be(t.url))){const e=o&&s&&De.read(s);e&&i.set(o,e)}return t},Ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Me(e);let o=r.data;const s=Ae.from(r.headers).normalize();let i,a,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Ae.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Ne(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new Q("Request aborted",Q.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Q(r,Q.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||le;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Q(t,o.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,g)),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&G.forEach(s.toJSON(),function(e,t){g.setRequestHeader(t,e)}),G.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,l]=ke(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([a,u]=ke(d),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new Pe(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===be.protocols.indexOf(b)?n(new Q("Unsupported protocol "+b+":",Q.ERR_BAD_REQUEST,e)):g.send(o||null)})},He=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Q?t:new Pe(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Q(`timeout of ${t}ms exceeded`,Q.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>G.asap(i),a}},Je=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},We=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},$e=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of We(e))yield*Je(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ke}=G,Ge=(({Request:e,Response:t})=>({Request:e,Response:t}))(G.global),{ReadableStream:Xe,TextEncoder:Qe}=G.global,Ye=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ze=e=>{e=G.merge.call({skipUndefined:!0},Ge,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ke(t):"function"==typeof fetch,s=Ke(n),i=Ke(r);if(!o)return!1;const a=o&&Ke(Xe),c=o&&("function"==typeof Qe?(u=new Qe,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=s&&a&&Ye(()=>{let e=!1;const t=new Xe,r=new n(be.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!r}),f=i&&a&&Ye(()=>G.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=G.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e)){const t=new n(be.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return G.isArrayBufferView(e)||G.isArrayBuffer(e)?e.byteLength:(G.isURLSearchParams(e)&&(e+=""),G.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:g,onUploadProgress:m,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=Me(e),R=t||fetch;b=b?(b+"").toLowerCase():"text";let O=He([c,u&&u.toAbortSignal()],h),S=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let v;try{if(m&&l&&"get"!==i&&"head"!==i&&0!==(v=await p(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(G.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Le(v,ke(Fe(m)));a=$e(t.body,65536,e,n)}}G.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:O,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let u=await(s?R(S,E):R(o,c));const h=f&&("stream"===b||"response"===b);if(f&&(g||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=G.toFiniteNumber(u.headers.get("content-length")),[n,o]=g&&Le(t,ke(Fe(g),!0))||[];u=new r($e(u.body,65536,n,()=>{o&&o(),T&&T()}),e)}b=b||"text";let _=await d[G.findKey(d,b)||"text"](u,e);return!h&&T&&T(),await new Promise((t,n)=>{Ne(t,n,{data:_,headers:Ae.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,S,t&&t.response)}}},et=new Map,tt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,u=et;for(;c--;)i=s[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Ze(t)),u=a;return a},nt=(tt(),{http:null,xhr:Ve,fetch:{get:tt}});G.forEach(nt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const rt=e=>`- ${e}`,ot=e=>G.isFunction(e)||null===e||!1===e;const st={getAdapter:function(e,t){e=G.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!ot(r)&&(o=nt[(n=String(r)).toLowerCase()],void 0===o))throw new Q(`Unknown adapter '${n}'`);if(o&&(G.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(rt).join("\n"):" "+rt(e[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:nt};function it(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pe(null,e)}function at(e){it(e),e.headers=Ae.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return st.getAdapter(e.adapter||Ee.adapter,e)(e).then(function(t){return it(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=Ae.from(t.headers),t},function(t){return je(t)||(it(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=Ae.from(t.response.headers))),Promise.reject(t)})}const ct="1.14.0",ut={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ut[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const lt={};ut.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ct+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Q(r(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!lt[o]&&(lt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},ut.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ft={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Q("option "+s+" must be "+n,Q.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}},validators:ut},dt=ft.validators;class pt{constructor(e){this.defaults=e||{},this.interceptors={request:new ue,response:new ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ze(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ft.assertOptions(n,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean),legacyInterceptorReqResOrdering:dt.transitional(dt.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:ft.assertOptions(r,{encode:dt.function,serialize:dt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ft.assertOptions(t,{baseUrl:dt.spelling("baseURL"),withXsrfToken:dt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&G.merge(o.common,o[t.method]);o&&G.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ae.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||le;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!a){const e=[at.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=at.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return ce(qe((e=ze(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}G.forEach(["delete","get","head","options"],function(e){pt.prototype[e]=function(t,n){return this.request(ze(n||{},{method:e,url:t,data:(n||{}).data}))}}),G.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ze(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}pt.prototype[e]=t(),pt.prototype[e+"Form"]=t(!0)});const ht=pt;class gt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Pe(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new gt(function(t){e=t}),cancel:e}}}const mt=gt;const bt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(bt).forEach(([e,t])=>{bt[t]=e});const yt=bt;const wt=function e(t){const n=new ht(t),o=r(ht.prototype.request,n);return G.extend(o,ht.prototype,n,{allOwnKeys:!0}),G.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(ze(t,n))},o}(Ee);wt.Axios=ht,wt.CanceledError=Pe,wt.CancelToken=mt,wt.isCancel=je,wt.VERSION=ct,wt.toFormData=ne,wt.AxiosError=Q,wt.Cancel=wt.CanceledError,wt.all=function(e){return Promise.all(e)},wt.spread=function(e){return function(t){return e.apply(null,t)}},wt.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},wt.mergeConfig=ze,wt.AxiosHeaders=Ae,wt.formToJSON=e=>ye(G.isHTMLForm(e)?new FormData(e):e),wt.getAdapter=st.getAdapter,wt.HttpStatusCode=yt,wt.default=wt;const Et=wt,Rt="1.12.0",Ot="javascript."+Rt,St={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console};let Tt=[],vt=[];class _t{static getConfig(e,t){if(!e)return"";let n=e[t];return n?(n=n.toString().toLowerCase(),n):""}static setConfig(e,t,n){return"varsnap"===t&&("string"==typeof n&&(n="true"===n),e[t]=n),"env"!==t&&"producerToken"!==t&&"consumerToken"!==t&&"branch"!==t||(e[t]=n),"logger"===t&&(e[t]=n),e}static getSignature(e,t){let n;return""!==t&&void 0!==t?n=t:(n=e.toString().split("{")[0],n=n.replace(/^\s+|\s+$/g,""),n=n.replace(/,\s+/g,",")),"javascript."+Rt+"."+n}static ajax(e,t){const n={method:"POST",url:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:new URLSearchParams(t).toString(),responseType:"json"};_t.isNode()&&n.headers&&(n.headers["User-Agent"]="varsnap.js");return Et(n).then(e=>e.data).catch(e=>e)}static debug(e,t){e.logger&&e.logger.debug(t)}static log(e,t){e.logger&&e.logger.log(t)}static error(e,t){e.logger&&e.logger.error(t)}static resetProducers(){Tt=[]}static resetConsumers(){vt=[]}static getProducers(){return Tt}static getConsumers(){return vt}static limitString(e){const t=String(e);return t.length<=30?t:t.substring(0,27)+"..."}static isNode(){return"object"==typeof process&&"undefined"==typeof window}}class At{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("production"===_t.getConfig(this.config,"env")&&!!_t.getConfig(this.config,"producerToken"))}static serialize(e){return JSON.stringify(e)}static serialize_formatted(e){return JSON.stringify(e,null,2)}produce(e,t){if(!this.isEnabled()){return new Promise(e=>e(!1))}return _t.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then(t=>{const n={producer_token:_t.getConfig(this.config,"producerToken"),signature:this.signature,inputs:At.serialize(e),prod_outputs:At.serialize(t)};return _t.ajax("https://www.varsnap.com/api/snap/produce/",n).then(()=>!0).catch(e=>{if(e.response){if(429===e.response.status)return _t.error(this.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?_t.error(this.config,"Cannot produce to Varsnap; check your producer token"):_t.error(this.config,e.response.statusText)}return!1})})}}class Ct{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("development"===_t.getConfig(this.config,"env")&&!!_t.getConfig(this.config,"consumerToken"))}static deserialize(e){if(""!==e)return JSON.parse(e)}consume(e){if(!this.isEnabled()){return new Promise(e=>(_t.error(this.config,"Varsnap not enabled for testing"),e(!1)))}const t={consumer_token:_t.getConfig(this.config,"consumerToken"),signature:this.signature};return _t.ajax("https://www.varsnap.com/api/snap/consume/",t).then(n=>{const r=n;if(!r||"ok"!==r.status){return[new Promise(e=>(_t.error(this.config,"Received error from Varsnap: "+r.status),e(!1)))]}0===r.results.length&&_t.log(this.config,"No snaps found for signature: "+t.signature);const o=[];for(const t of r.results){const n=Ct.deserialize(t.inputs),r=Ct.deserialize(t.prod_outputs);let s;try{s=this.targetFunc(...n)}catch(e){s=e}const i=Promise.resolve(s).then(o=>{const s=At.serialize(r)===At.serialize(o);return this.reportCentral(e,t,r,o,s).then(e=>{this.reportLog(t.id,n,r,o,s,e)}),s});o.push(i)}return o}).then(e=>Promise.all(e).then(e=>e.every(e=>e))).catch(e=>(_t.error(this.config,"Cannot contact Varsnap: "+e),!1))}reportCentral(e,t,n,r,o){const s={trial_group_id:e.trial_group_id,consumer_token:_t.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:At.serialize(r),matches:o.toString(),snap_outputs_formatted:At.serialize_formatted(n),test_outputs_formatted:At.serialize_formatted(r)};return _t.ajax("https://www.varsnap.com/api/trial/produce/",s).then(e=>{const t=e;if(!t||"ok"!==t.status)return!1;return t.trial_url}).catch(e=>(_t.error(this.config,"Cannot upload test results to Varsnap: "+e),!1))}reportLog(e,t,n,r,o,s){if(o)return;_t.log(this.config,""),_t.log(this.config,"Testing with Varsnap uuid: "+e),_t.log(this.config,"Signature: "+this.signature),_t.log(this.config,"Function input args: "+_t.limitString(t)),_t.log(this.config,"Production function outputs: "+_t.limitString(n)),_t.log(this.config,"Your function outputs: "+_t.limitString(r)),_t.log(this.config,"Matching outputs: "+o);let i="Cannot upload trial";s&&(i=String(s)),_t.log(this.config,"Trial URL: "+i)}reportTrialGroup(e){_t.log(this.config,"Trial Group: "+e.trial_group_url)}}function jt(e,t){void 0===t&&(t="");const n=_t.getSignature(e,t),r=new At(e,n,jt._config),o=new Ct(e,n,jt._config),s=function(...t){let n;try{n=e(...t)}catch(e){throw r.produce(t,e),e}return r.produce(t,n),n};return s.producer=r,s.consumer=o,s.signature=n,Tt.push(r),vt.push(o),s}jt._config=St,jt.updateConfig=function(e){let t=jt._config;for(const n of Object.keys(jt._config))Object.prototype.hasOwnProperty.call(e,n)&&(t=_t.setConfig(t,n,e[n]));jt._config=t},jt.reset=function(){_t.resetConsumers(),_t.resetProducers()},jt.version=Rt,jt.runTests=function(){const e=_t.getConsumers();return 0===e.length?Promise.resolve(!0):function(e){const t={branch:_t.getConfig(e,"branch"),consumer_token:_t.getConfig(e,"consumerToken"),client:Ot};return _t.ajax("https://www.varsnap.com/api/trial_group/",t).then(e=>e).catch(t=>{let n;return n=t&&t.response&&t.response.data?t.response.data.error:t.toString(),_t.error(e,"Cannot generate a new Trial Group: "+n),{status:"not ok",project_id:"",trial_group_id:"",trial_group_url:""}})}(e[0].config).then(t=>{const n=[];for(const r of e){const e=r.consume(t);n.push(e)}return e.length>0&&e[0].reportTrialGroup(t),Promise.all(n)}).then(e=>e.every(e=>e))};const Pt=jt;return t=t.default})());
|
|
1
|
+
/*! Varsnap.js v1.13.0 */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.varsnap=t():e.varsnap=t()}(this,()=>(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var r=0;r<n.length;){var o=n[r++],s=n[r++];e.o(t,o)?0===s&&r++:0===s?Object.defineProperty(t,o,{enumerable:!0,value:n[r++]}):Object.defineProperty(t,o,{enumerable:!0,get:s})}else for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let t={};e.d(t,{default:()=>Ht});var n={};function r(e,t){return function(){return e.apply(t,arguments)}}e.r(n),e.d(n,{hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>Ce,hasStandardBrowserWebWorkerEnv:()=>je,navigator:()=>Pe,origin:()=>Ne});const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:i,toStringTag:a}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),u=(e,t)=>{let n=e;const r=[];for(;null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),c(n,t))return!0;n=s(n)}return!1},l=(f=Object.create(null),e=>{const t=o.call(e);return f[t]||(f[t]=t.slice(8,-1).toLowerCase())});var f;const d=e=>(e=e.toLowerCase(),t=>l(t)===e),p=e=>t=>typeof t===e,{isArray:h}=Array,g=p("undefined");function m(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const b=d("ArrayBuffer");const y=p("string"),w=p("function"),O=p("number"),E=e=>null!==e&&"object"==typeof e,R=e=>{if(!E(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==s(t)||u(e,a)||u(e,i))},S=d("Date"),_=d("File"),v=d("Blob"),T=d("FileList");const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e.g?e.g:{},P=void 0!==A.FormData?A.FormData:void 0,C=d("URLSearchParams"),[j,N,x,U]=["ReadableStream","Request","Response","Headers"].map(d);function D(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(m(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function L(e,t){if(m(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g,k=e=>!g(e)&&e!==F;const B=(q="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>q&&e instanceof q);var q;const I=d("HTMLFormElement"),{propertyIsEnumerable:z}=Object.prototype,M=d("RegExp"),H=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};D(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const J=d("AsyncFunction"),V=(W="function"==typeof setImmediate,$=w(F.postMessage),W?setImmediate:$?(K=`axios@${Math.random()}`,X=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===K&&X.length&&X.shift()()},!1),e=>{X.push(e),F.postMessage(K,"*")}):e=>setTimeout(e));var W,$,K,X;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||V,Q=e=>null!=e&&w(e[i]),Z={isArray:h,isArrayBuffer:b,isBuffer:m,isFormData:e=>{if(!e)return!1;if(P&&e instanceof P)return!0;const t=s(e);if(!t||t===Object.prototype)return!1;if(!w(e.append))return!1;const n=l(e);return"formdata"===n||"object"===n&&w(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&b(e.buffer),t},isString:y,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:R,isEmptyObject:e=>{if(!E(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:j,isRequest:N,isResponse:x,isHeaders:U,isUndefined:g,isDate:S,isFile:_,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:v,isRegExp:M,isFunction:w,isStream:e=>E(e)&&w(e.pipe),isURLSearchParams:C,isTypedArray:B,isFileList:T,forEach:D,merge:function e(...t){const{caseless:n,skipUndefined:r}=k(this)&&this||{},o={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=n&&"string"==typeof s&&L(o,s)||s,a=c(o,i)?o[i]:void 0;R(a)&&R(t)?o[i]=e(a,t):R(t)?o[i]=e({},t):h(t)?o[i]=t.slice():r&&g(t)||(o[i]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||m(n))continue;if(D(n,s),"object"!=typeof n||h(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];z.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:o}={})=>(D(t,(t,o)=>{n&&w(t)?Object.defineProperty(e,o,{__proto__:null,value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:d,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!O(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[i]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:I,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:u,getSafeProp:(e,t)=>null!=e&&u(e,t)?e[t]:void 0,reduceDescriptors:H,freezeMethods:e=>{H(e,(t,n)=>{if(w(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];w(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:L,global:F,isContextDefined:k,isSpecCompliantForm:function(e){return!!(e&&w(e.append)&&"FormData"===e[a]&&e[i])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(E(e)){if(t.has(e))return;if(m(e))return e;if(!("toJSON"in e)){t.add(e);const r=h(e)?[]:{};return D(e,(e,t)=>{const o=n(e);!g(o)&&(r[t]=o)}),t.delete(e),r}}return e};return n(e)},isAsyncFn:J,isThenable:e=>e&&(E(e)||w(e))&&w(e.then)&&w(e.catch),setImmediate:V,asap:G,isIterable:Q,isSafeIterable:e=>null!=e&&u(e,i)&&Q(e)},Y=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Z.isArray(e)?e.map(e=>ne(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function re(e){const t=Object.create(null);return Z.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ne(e,te))(e)}),t}const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:Z.isArray(e)?e.map(ie):(e=>ne(e,ee))(String(e))}function ae(e,t,n,r,o){return Z.isFunction(r)?r.call(this,t,n):(o&&(t=n),Z.isString(t)?Z.isString(r)?-1!==t.indexOf(r):Z.isRegExp(r)?r.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=se(t);if(!o)return;const s=Z.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ie(e))}const s=(e,t)=>Z.forEach(e,(e,n)=>o(e,n,t));if(Z.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Y[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Z.isObject(e)&&Z.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!Z.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],Z.hasOwnProp(o,r)?(n=o[r],o[r]=Z.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=se(e)){const n=Z.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,n);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=Z.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=se(e)){const o=Z.findKey(n,e);!o||t&&!ae(0,n[o],o,t)||(delete n[o],r=!0)}}return Z.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ae(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Z.forEach(this,(r,o)=>{const s=Z.findKey(n,o);if(s)return t[s]=ie(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=ie(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Z.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=Z.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Z.isArray(e)?e.forEach(r):r(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(ce.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Z.freezeMethods(ce);const ue=ce;function le(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Z.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ue&&(e=e.toJSON()),r.push(e),Z.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);Z.isUndefined(r)||(t[n]=r)});else{if(!Z.isPlainObject(e)&&function(e){if(Z.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":o(s);Z.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}class fe extends Error{static from(e,t,n,r,o,s){const i=new fe(e.message,t||e.code,n,r,o);return Object.defineProperty(i,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Z.hasOwnProp(e,"redact")?e.redact:void 0,n=Z.isArray(t)&&t.length>0?le(e,t):Z.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}fe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",fe.ERR_BAD_OPTION="ERR_BAD_OPTION",fe.ECONNABORTED="ECONNABORTED",fe.ETIMEDOUT="ETIMEDOUT",fe.ECONNREFUSED="ECONNREFUSED",fe.ERR_NETWORK="ERR_NETWORK",fe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",fe.ERR_DEPRECATED="ERR_DEPRECATED",fe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",fe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",fe.ERR_CANCELED="ERR_CANCELED",fe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",fe.ERR_INVALID_URL="ERR_INVALID_URL",fe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const de=fe;function pe(e){return Z.isPlainObject(e)||Z.isArray(e)}function he(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function ge(e,t,n){return e?e.concat(t).map(function(e,t){return e=he(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const me=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)});const be=function(e,t,n){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])})).metaTokens,o=n.visitor||p,s=n.dots,i=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=a&&Z.isSpecCompliantForm(t),l=[];if(!Z.isFunction(o))throw new TypeError("visitor must be a function");function f(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!u&&Z.isBlob(e))throw new de("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(e)||Z.isTypedArray(e)){if(u&&"function"==typeof a)return new a([e]);if("undefined"!=typeof Buffer)return Buffer.from(e);throw new de("Blob is not supported. Use a Buffer instead.",de.ERR_NOT_SUPPORT)}return e}function d(e){if(e>c)throw new de("Object is too deeply nested ("+e+" levels). Max depth: "+c,de.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,o){let a=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(ge(o,n,s),f(e)),!1;if(e&&!o&&"object"==typeof e)if(Z.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!Z.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),d(t+n.length-1),r})}(e,1);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(pe)}(e)||(Z.isFileList(e)||Z.endsWith(n,"[]"))&&(a=Z.toArray(e)))return n=he(n),a.forEach(function(e,r){!Z.isUndefined(e)&&null!==e&&t.append(!0===i?ge([n],r,s):null===i?n:n+"[]",f(e))}),!1;return!!pe(e)||(t.append(ge(o,n,s),f(e)),!1)}const h=Object.assign(me,{defaultVisitor:p,convertValue:f,isVisitable:pe});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(n,r,s=0){if(!Z.isUndefined(n)){if(d(s),-1!==l.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));l.push(n),Z.forEach(n,function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&o.call(t,n,Z.isString(i)?i.trim():i,r,h))&&e(n,r?r.concat(i):[i],s+1)}),l.pop()}}(e),t};function ye(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function we(e,t){this._pairs=[],e&&be(e,this,t)}const Oe=we.prototype;Oe.append=function(e,t){this._pairs.push([e,t])},Oe.toString=function(e){const t=e?t=>e.call(this,t,ye):ye;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ee=we;function Re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Se(e,t,n){if(!t)return e;e=e||"";const r=Z.isFunction(n)?{serialize:n}:n,o=Z.getSafeProp(r,"encode")||Re,s=Z.getSafeProp(r,"serialize");let i;if(i=s?s(t,r):Z.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const _e=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(t){null!==t&&e(t)})}},ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ae="undefined"!=typeof window&&"undefined"!=typeof document,Pe="object"==typeof navigator&&navigator||void 0,Ce=Ae&&(!Pe||["ReactNative","NativeScript","NS"].indexOf(Pe.product)<0),je="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ne=Ae&&window.location.href||"http://localhost",xe={...n,...Te};function Ue(e){if(e>100)throw new de("FormData field is too deeply nested ("+e+" levels). Max depth: 100",de.ERR_FORM_DATA_DEPTH_EXCEEDED)}const De=function(e){function t(e,n,r,o){Ue(o);let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Z.isArray(r)?r.length:s,a)return Z.hasOwnProp(r,s)?r[s]=Z.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i;Z.hasOwnProp(r,s)&&Z.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&Z.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const n={};return Z.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;null!==(r=n.exec(e));)Ue(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),n}return null},Le=(e,t)=>null!=e&&Z.hasOwnProp(e,t)?e[t]:void 0;const Fe={transitional:ve,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Z.isObject(e);o&&Z.isHTMLForm(e)&&(e=new FormData(e));if(Z.isFormData(e))return r?JSON.stringify(De(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Le(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return be(e,new xe.classes.URLSearchParams,{visitor:function(e,t,n,r){return xe.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=Z.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Le(this,"env"),r=n&&n.FormData;return be(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Z.isString(e))try{return(t||JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Le(this,"transitional")||Fe.transitional,n=t&&t.forcedJSONParsing,r=Le(this,"responseType"),o="json"===r;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Le(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw de.from(e,de.ERR_BAD_RESPONSE,this,null,Le(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],e=>{Fe.headers[e]={}});const ke=Fe;function Be(e,t){const n=this||ke,r=t||n,o=ue.from(r.headers);let s=r.data;return Z.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function qe(e){return!(!e||!e.__CANCEL__)}const Ie=class extends de{constructor(e,t,n){super(e??"canceled",de.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ze(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new de("Request failed with status code "+n.status,n.status>=400&&n.status<500?de.ERR_BAD_REQUEST:de.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Me=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}};const He=function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]},Je=(e,t,n=3)=>{let r=0;const o=Me(50,250);return He(n=>{if(!n||"number"!=typeof n.loaded)return;const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=null!=i?Math.min(s,i):s,c=Math.max(0,a-r),u=o(c);r=Math.max(r,a);e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i?(i-a)/u:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ve=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>Z.asap(()=>e(...t)),$e=xe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,xe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,Ke=xe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Z.isString(r)&&a.push(`path=${r}`),Z.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),Z.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const Xe=/^https?:(?!\/\/)/i,Ge=/[\t\n\r]/g;function Qe(e,t){if("string"==typeof e&&Xe.test(function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Ge,"")}(e)))throw new de('Invalid URL: missing "//" after protocol',de.ERR_INVALID_URL,t)}function Ze(e,t,n,r){Qe(t,r);let o=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(o||!1===n)?(Qe(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}const Ye=e=>e instanceof ue?{...e}:e;function et(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:r},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function o(e,t,n,o){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Z.isUndefined(t))return r(void 0,t)}function i(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return Z.hasOwnProp(t,s)?r(n,o):Z.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Ye(e),Ye(t),0,!0)};return Z.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=Z.hasOwnProp(c,r)?c[r]:o,i=s(Z.hasOwnProp(e,r)?e[r]:void 0,Z.hasOwnProp(t,r)?t[r]:void 0,r);Z.isUndefined(i)&&s!==a||(n[r]=i)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&!1===function(n){const r=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(r)){if(!Z.isPlainObject(r))return;if(Z.hasOwnProp(r,n))return r[n]}const o=Z.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Z.isPlainObject(o)&&Z.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Z.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const tt=["content-type","content-length"];const nt=function(e){const t=et({},e),n=e=>Z.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),u=n("baseURL"),l=n("allowAbsoluteUrls"),f=n("url");if(t.headers=a=ue.from(a),t.url=Se(Ze(u,f,l,t),n("params"),n("paramsSerializer")),c){const t=Z.getSafeProp(c,"username")||"",n=Z.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw de.from(t,de.ERR_BAD_OPTION_VALUE,e)}}if(Z.isFormData(r)&&(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv||Z.isReactNative(r)?a.setContentType(void 0):Z.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{tt.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,r.getHeaders(),n("formDataHeaderPolicy"))),xe.hasStandardBrowserEnv){Z.isFunction(o)&&(o=o(t));if(!0===o||null==o&&$e(t.url)){const e=s&&i&&Ke.read(i);e&&a.set(s,e)}}return t},rt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=nt(e);let o=r.data;const s=ue.from(r.headers).normalize();let i,a,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=ue.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());ze(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new de("Request aborted",de.ECONNABORTED,e,g)),h(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new de(r,de.ERR_NETWORK,e,g);o.event=t||null,n(o),h(),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ve;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new de(t,o.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,g)),h(),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&Z.forEach(re(s),function(e,t){g.setRequestHeader(t,e)}),Z.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,l]=Je(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([a,u]=Je(d),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new Ie(null,e,g):t),g.abort(),h(),g=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);if(b&&!xe.protocols.includes(b))return n(new de("Unsupported protocol "+b+":",de.ERR_BAD_REQUEST,e)),void h();g.send(o||null)})},ot=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof de?t:new Ie(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new de(`timeout of ${t}ms exceeded`,de.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o,{once:!0}));const{signal:a}=n;return a.unsubscribe=()=>Z.asap(i),a},st=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},it=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},at=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of it(e))yield*st(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},ct=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,ut=(e,t,n)=>t+2<n&&ct(e.charCodeAt(t+1))&&ct(e.charCodeAt(t+2));const{isFunction:lt}=Z,ft=e=>{if(!Z.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},dt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},pt=e=>{const t=void 0!==Z.global&&null!==Z.global?Z.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?lt(o):"function"==typeof fetch,c=lt(s),u=lt(i);if(!a)return!1;const l=a&<(n),f=a&&("function"==typeof r?(d=new r,e=>d.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var d;const p=c&&l&&dt(()=>{let e=!1;const t=new s(xe.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),h=u&&l&&dt(()=>Z.isReadableStream(new i("").body)),g={stream:h&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!g[e]&&(g[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new de(`Response type '${e}' is not supported`,de.ERR_NOT_SUPPORT,n)})});const m=async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new s(xe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await f(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:u,cancelToken:f,timeout:d,onDownloadProgress:b,onUploadProgress:y,responseType:w,headers:O,withCredentials:E="same-origin",fetchOptions:R,maxContentLength:S,maxBodyLength:_}=nt(e);const v=Z.isNumber(S)&&S>-1,T=Z.isNumber(_)&&_>-1;let A=o||fetch;w=w?(w+"").toLowerCase():"text";let P=ot([u,f&&f.toAbortSignal()],d),C=null;const j=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let N,x=null;const U=()=>new de("Request body larger than maxBodyLength limit",de.ERR_BAD_REQUEST,e,C);try{let o;const u=(L="auth",Z.hasOwnProp(e,L)?e[L]:void 0);if(u){const e=Z.getSafeProp(u,"username")||"";o={username:e,password:Z.getSafeProp(u,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,xe.origin);if(!o&&(e.username||e.password)){const t=ft(e.username);o={username:t,password:ft(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((D=(o.username||"")+":"+(o.password||""),encodeURIComponent(D).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),v&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n<t;n++)if(37===r.charCodeAt(n)&&n+2<t){const t=r.charCodeAt(n+1),o=r.charCodeAt(n+2);ct(t)&&ct(o)&&(e-=2,n+=2)}let n=0,o=t-1;const s=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));o>=0&&(61===r.charCodeAt(o)?(n++,o--):s(o)&&(n++,o-=3)),1===n&&o>=0&&(61===r.charCodeAt(o)||s(o))&&n++;const i=3*Math.floor(e/4)-(n||0);return i>0?i:0}let o=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(37===n&&ut(r,e,t))o+=1,e+=2;else if(n<128)o+=1;else if(n<2048)o+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o}(t);if(n>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}if(T&&"get"!==n&&"head"!==n){const e=await m(a);if("number"==typeof e&&isFinite(e)&&(N=e,e>_))throw U()}const f=T&&(Z.isReadableStream(a)||Z.isStream(a)),d=(e,t,n)=>at(e,65536,e=>{if(T&&e>_)throw x=U();t&&t(e)},n);if(p&&"get"!==n&&"head"!==n&&(y||f)){if(N=N??await(async(e,t)=>{const n=Z.toFiniteNumber(e.getContentLength());return n??m(t)})(O,a),0!==N||f){let e,n=new s(t,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=y&&Ve(N,Je(We(y)))||[];a=d(n.body,e,t)}}}else if(f&&!c&&l&&"get"!==n&&"head"!==n)a=d(a);else if(f&&c&&!p&&"get"!==n&&"head"!==n)throw new de("Stream request bodies are not supported by the current fetch implementation",de.ERR_NOT_SUPPORT,e,C);Z.isString(E)||(E=E?"include":"omit");const F=c&&"credentials"in s.prototype;if(Z.isFormData(a)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/1.18.1",!1);const k={...R,signal:P,method:n.toUpperCase(),headers:re(O.normalize()),body:a,duplex:"half",credentials:F?E:void 0};C=c&&new s(t,k);let B=await(c?A(C,R):A(t,k));const q=ue.from(B.headers);if(v){const t=Z.toFiniteNumber(q.getContentLength());if(null!=t&&t>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}const I=h&&("stream"===w||"response"===w);if(h&&B.body&&(b||v||I&&j)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=B[e]});const n=Z.toFiniteNumber(q.getContentLength()),[r,o]=b&&Ve(n,Je(We(b),!0))||[];let s=0;const a=t=>{if(v&&(s=t,s>S))throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C);r&&r(t)};B=new i(at(B.body,65536,a,()=>{o&&o(),j&&j()}),t)}w=w||"text";let z=await g[Z.findKey(g,w)||"text"](B,e);if(v&&!h&&!I){let t;if(null!=z&&("number"==typeof z.byteLength?t=z.byteLength:"number"==typeof z.size?t=z.size:"string"==typeof z&&(t="function"==typeof r?(new r).encode(z).byteLength:z.length)),"number"==typeof t&&t>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}return!I&&j&&j(),await new Promise((t,n)=>{ze(t,n,{data:z,headers:ue.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:C})})}catch(t){if(j&&j(),P&&P.aborted&&P.reason instanceof de){const n=P.reason;throw n.config=e,C&&(n.request=C),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(x)throw C&&!x.request&&(x.request=C),x;if(t instanceof de)throw C&&!t.request&&(t.request=C),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new de("Network Error",de.ERR_NETWORK,e,C,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw de.from(t,t&&t.code,e,C,t&&t.response)}var D,L}},ht=new Map,gt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,u=ht;for(;c--;)i=s[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:pt(t)),u=a;return a},mt=(gt(),{http:null,xhr:rt,fetch:{get:gt}});Z.forEach(mt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const bt=e=>`- ${e}`,yt=e=>Z.isFunction(e)||null===e||!1===e;const wt={getAdapter:function(e,t){e=Z.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!yt(r)&&(o=mt[(n=String(r)).toLowerCase()],void 0===o))throw new de(`Unknown adapter '${n}'`);if(o&&(Z.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(bt).join("\n"):" "+bt(e[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+t,de.ERR_NOT_SUPPORT)}return o},adapters:mt};function Ot(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ie(null,e)}function Et(e){Ot(e),e.headers=ue.from(e.headers),e.data=Be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return wt.getAdapter(e.adapter||ke.adapter,e)(e).then(function(t){Ot(e),e.response=t;try{t.data=Be.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ue.from(t.headers),t},function(t){if(!qe(t)&&(Ot(e),t&&t.response)){e.response=t.response;try{t.response.data=Be.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ue.from(t.response.headers)}return Promise.reject(t)})}const Rt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const St={};Rt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new de(r(o," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!St[o]&&(St[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Rt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const _t={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new de("option "+s+" must be "+n,de.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new de("Unknown option "+s,de.ERR_BAD_OPTION)}},validators:Rt},vt=_t.validators;class Tt{constructor(e){this.defaults=e||{},this.interceptors={request:new _e,response:new _e}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=et(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&_t.assertOptions(n,{silentJSONParsing:vt.transitional(vt.boolean),forcedJSONParsing:vt.transitional(vt.boolean),clarifyTimeoutError:vt.transitional(vt.boolean),legacyInterceptorReqResOrdering:vt.transitional(vt.boolean),advertiseZstdAcceptEncoding:vt.transitional(vt.boolean),validateStatusUndefinedResolves:vt.transitional(vt.boolean)},!1),null!=r&&(Z.isFunction(r)?t.paramsSerializer={serialize:r}:_t.assertOptions(r,{encode:vt.function,serialize:vt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),_t.assertOptions(t,{baseUrl:vt.spelling("baseURL"),withXsrfToken:vt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Z.merge(o.common,o[t.method]);o&&Z.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete o[e]}),t.headers=ue.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||ve;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!a){const e=[Et.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Et.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return Se(Ze((e=et(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(e){Tt.prototype[e]=function(t,n){return this.request(et(n||{},{method:e,url:t,data:n&&Z.hasOwnProp(n,"data")?n.data:void 0}))}}),Z.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,o){return this.request(et(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Tt.prototype[e]=t(),"query"!==e&&(Tt.prototype[e+"Form"]=t(!0))});const At=Tt;class Pt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ie(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Pt(function(t){e=t}),cancel:e}}}const Ct=Pt;const jt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(jt).forEach(([e,t])=>{jt[t]=e});const Nt=jt;const xt=function e(t){const n=new At(t),o=r(At.prototype.request,n);return Z.extend(o,At.prototype,n,{allOwnKeys:!0}),Z.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(et(t,n))},o}(ke);xt.Axios=At,xt.CanceledError=Ie,xt.CancelToken=Ct,xt.isCancel=qe,xt.VERSION="1.18.1",xt.toFormData=be,xt.AxiosError=de,xt.Cancel=xt.CanceledError,xt.all=function(e){return Promise.all(e)},xt.spread=function(e){return function(t){return e.apply(null,t)}},xt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},xt.mergeConfig=et,xt.AxiosHeaders=ue,xt.formToJSON=e=>De(Z.isHTMLForm(e)?new FormData(e):e),xt.getAdapter=wt.getAdapter,xt.HttpStatusCode=Nt,xt.default=xt;const Ut=xt,Dt="1.13.0",Lt="javascript."+Dt,Ft={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console};let kt=[],Bt=[];class qt{static getConfig(e,t){if(!e)return"";let n=e[t];return n?(n=n.toString().toLowerCase(),n):""}static setConfig(e,t,n){return"varsnap"===t&&("string"==typeof n&&(n="true"===n),e[t]=n),"env"!==t&&"producerToken"!==t&&"consumerToken"!==t&&"branch"!==t||(e[t]=n),"logger"===t&&(e[t]=n),e}static getSignature(e,t){let n;return""!==t&&void 0!==t?n=t:(n=e.toString().split("{")[0],n=n.replace(/^\s+|\s+$/g,""),n=n.replace(/,\s+/g,",")),"javascript."+Dt+"."+n}static ajax(e,t){const n={method:"POST",url:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:new URLSearchParams(t).toString(),responseType:"json"};qt.isNode()&&n.headers&&(n.headers["User-Agent"]="varsnap.js");return Ut(n).then(e=>e.data).catch(e=>e)}static debug(e,t){e.logger&&e.logger.debug(t)}static log(e,t){e.logger&&e.logger.log(t)}static error(e,t){e.logger&&e.logger.error(t)}static resetProducers(){kt=[]}static resetConsumers(){Bt=[]}static getProducers(){return kt}static getConsumers(){return Bt}static limitString(e){const t=String(e);return t.length<=30?t:t.substring(0,27)+"..."}static isNode(){return"object"==typeof process&&"undefined"==typeof window}}class It{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("production"===qt.getConfig(this.config,"env")&&!!qt.getConfig(this.config,"producerToken"))}static serialize(e){return"json:"+JSON.stringify(e)}static serialize_formatted(e){return JSON.stringify(e,null,2)}produce(e,t){if(!this.isEnabled()){return new Promise(e=>e(!1))}return qt.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then(t=>{const n={producer_token:qt.getConfig(this.config,"producerToken"),signature:this.signature,inputs:It.serialize(e),prod_outputs:It.serialize(t)};return qt.ajax("https://www.varsnap.com/api/snap/produce/",n).then(()=>!0).catch(e=>{if(e.response){if(429===e.response.status)return qt.error(this.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?qt.error(this.config,"Cannot produce to Varsnap; check your producer token"):qt.error(this.config,e.response.statusText)}return!1})})}}class zt{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("development"===qt.getConfig(this.config,"env")&&!!qt.getConfig(this.config,"consumerToken"))}static deserialize(e){if(""!==e)return e.startsWith("json:")?JSON.parse(e.substring(5)):JSON.parse(e)}consume(e){if(!this.isEnabled()){return new Promise(e=>(qt.error(this.config,"Varsnap not enabled for testing"),e(!1)))}const t={consumer_token:qt.getConfig(this.config,"consumerToken"),signature:this.signature};return qt.ajax("https://www.varsnap.com/api/snap/consume/",t).then(n=>{const r=n;if(!r||"ok"!==r.status){return[new Promise(e=>(qt.error(this.config,"Received error from Varsnap: "+r.status),e(!1)))]}0===r.results.length&&qt.log(this.config,"No snaps found for signature: "+t.signature);const o=[];for(const t of r.results){const n=zt.deserialize(t.inputs),r=zt.deserialize(t.prod_outputs);let s;try{s=this.targetFunc(...n)}catch(e){s=e}const i=Promise.resolve(s).then(o=>{const s=It.serialize(r)===It.serialize(o);return this.reportCentral(e,t,r,o,s).then(e=>{this.reportLog(t.id,n,r,o,s,e)}),s});o.push(i)}return o}).then(e=>Promise.all(e).then(e=>e.every(e=>e))).catch(e=>(qt.error(this.config,"Cannot contact Varsnap: "+e),!1))}reportCentral(e,t,n,r,o){const s={trial_group_id:e.trial_group_id,consumer_token:qt.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:It.serialize(r),matches:o.toString(),snap_outputs_formatted:It.serialize_formatted(n),test_outputs_formatted:It.serialize_formatted(r)};return qt.ajax("https://www.varsnap.com/api/trial/produce/",s).then(e=>{const t=e;if(!t||"ok"!==t.status)return!1;return t.trial_url}).catch(e=>(qt.error(this.config,"Cannot upload test results to Varsnap: "+e),!1))}reportLog(e,t,n,r,o,s){if(o)return;qt.log(this.config,""),qt.log(this.config,"Testing with Varsnap uuid: "+e),qt.log(this.config,"Signature: "+this.signature),qt.log(this.config,"Function input args: "+qt.limitString(t)),qt.log(this.config,"Production function outputs: "+qt.limitString(n)),qt.log(this.config,"Your function outputs: "+qt.limitString(r)),qt.log(this.config,"Matching outputs: "+o);let i="Cannot upload trial";s&&(i=String(s)),qt.log(this.config,"Trial URL: "+i)}reportTrialGroup(e){qt.log(this.config,"Trial Group: "+e.trial_group_url)}}function Mt(e,t){void 0===t&&(t="");const n=qt.getSignature(e,t),r=new It(e,n,Mt._config),o=new zt(e,n,Mt._config),s=function(...t){let n;try{n=e(...t)}catch(e){throw r.produce(t,e),e}return r.produce(t,n),n};return s.producer=r,s.consumer=o,s.signature=n,kt.push(r),Bt.push(o),s}Mt._config=Ft,Mt.updateConfig=function(e){let t=Mt._config;for(const n of Object.keys(Mt._config))Object.prototype.hasOwnProperty.call(e,n)&&(t=qt.setConfig(t,n,e[n]));Mt._config=t},Mt.reset=function(){qt.resetConsumers(),qt.resetProducers()},Mt.version=Dt,Mt.runTests=function(){const e=qt.getConsumers();return 0===e.length?Promise.resolve(!0):function(e){const t={branch:qt.getConfig(e,"branch"),consumer_token:qt.getConfig(e,"consumerToken"),client:Lt};return qt.ajax("https://www.varsnap.com/api/trial_group/",t).then(e=>e).catch(t=>{let n;return n=t&&t.response&&t.response.data?t.response.data.error:t.toString(),qt.error(e,"Cannot generate a new Trial Group: "+n),{status:"not ok",project_id:"",trial_group_id:"",trial_group_url:""}})}(e[0].config).then(t=>{const n=[];for(const r of e){const e=r.consume(t);n.push(e)}return e.length>0&&e[0].reportTrialGroup(t),Promise.all(n)}).then(e=>e.every(e=>e))};const Ht=Mt;return t=t.default,t})());
|
|
3
3
|
//# sourceMappingURL=browser.min.js.map
|