varsnap 1.11.2 → 1.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- /*! Varsnap.js v1.11.2 */
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]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>kt});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,i=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,f=u("undefined");const d=c("ArrayBuffer");const p=u("string"),h=u("function"),g=u("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==i(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},b=c("Date"),w=c("File"),E=c("Blob"),S=c("FileList"),O=c("URLSearchParams"),[R,T,v,C]=["ReadableStream","Request","Response","Headers"].map(c);function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{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 _(e,t){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 j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=e=>!f(e)&&e!==j;const P=(N="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>N&&e instanceof N);var N;const k=c("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),U=c("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},B="abcdefghijklmnopqrstuvwxyz",D="0123456789",q={DIGIT:D,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+D};const z=c("AsyncFunction"),M=(I="function"==typeof setImmediate,H=h(j.postMessage),I?setImmediate:H?(J=`axios@${Math.random()}`,V=[],j.addEventListener("message",(({source:e,data:t})=>{e===j&&t===J&&V.length&&V.shift()()}),!1),e=>{V.push(e),j.postMessage(J,"*")}):e=>setTimeout(e));var I,H,J,V;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||M,K={isArray:l,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=i(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isReadableStream:R,isRequest:T,isResponse:v,isHeaders:C,isUndefined:f,isDate:b,isFile:w,isBlob:E,isRegExp:U,isFunction:h,isStream:e=>m(e)&&h(e.pipe),isURLSearchParams:O,isTypedArray:P,isFileList:S,forEach:A,merge:function e(){const{caseless:t}=x(this)&&this||{},n={},r=(r,o)=>{const s=t&&_(n,o)||o;y(n[s])&&y(r)?n[s]=e(n[s],r):y(r)?n[s]=e({},r):l(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:o}={})=>(A(t,((t,o)=>{n&&h(t)?e[o]=r(t,n):e[o]=t}),{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),e.prototype.constructor=e,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:i,kindOfTest:c,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(l(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:k,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(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 l(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:_,global:j,isContextDefined:x,ALPHABET:q,generateString:(e=16,t=q.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return A(e,((e,t)=>{const s=n(e,r+1);!f(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:z,isThenable:e=>e&&(m(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:M,asap:W};function $(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}K.inherits($,Error,{toJSON:function(){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:K.toJSONObject(this.config),code:this.code,status:this.status}}});const G=$.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{X[e]={value:e}})),Object.defineProperties($,X),Object.defineProperty(G,"isAxiosError",{value:!0}),$.from=(e,t,n,r,o,s)=>{const i=Object.create(G);return K.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),$.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Q=$;function Y(e){return K.isPlainObject(e)||K.isArray(e)}function Z(e){return K.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=K.toFlatObject(K,{},null,(function(e){return/^is[A-Z]/.test(e)}));const ne=function(e,t,n){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!K.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(!a&&K.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(K.isArray(e)&&function(e){return K.isArray(e)&&!e.some(Y)}(e)||(K.isFileList(e)||K.endsWith(n,"[]"))&&(a=K.toArray(e)))return n=Z(n),a.forEach((function(e,r){!K.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(!K.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!K.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),K.forEach(n,(function(n,s){!0===(!(K.isUndefined(n)||null===n)&&o.call(t,n,K.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,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ce(e,t,n){if(!t)return e;const r=n&&n.encode||ae;K.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):K.isURLSearchParams(t)?t.toString():new ie(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}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){K.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},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",ye={...n,...fe};const be=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&&K.isArray(r)?r.length:s,a)return K.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&K.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&K.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(K.isFormData(e)&&K.isFunction(e.entries)){const n={};return K.forEachEntry(e,((e,r)=>{t(function(e){return K.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=K.isObject(e);o&&K.isHTMLForm(e)&&(e=new FormData(e));if(K.isFormData(e))return r?JSON.stringify(be(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.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 ye.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ye.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=K.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(K.isString(e))try{return(t||JSON.parse)(e),K.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(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}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:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],(e=>{we.headers[e]={}}));const Ee=we,Se=K.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 Re(e){return e&&String(e).trim().toLowerCase()}function Te(e){return!1===e||null==e?e:K.isArray(e)?e.map(Te):String(e)}function ve(e,t,n,r,o){return K.isFunction(r)?r.call(this,t,n):(o&&(t=n),K.isString(t)?K.isString(r)?-1!==t.indexOf(r):K.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=Re(t);if(!o)throw new Error("header name must be a non-empty string");const s=K.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)=>K.forEach(e,((e,n)=>o(e,n,t)));if(K.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(K.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]&&Se[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(K.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Re(e)){const n=K.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(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Re(e)){const n=K.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=Re(e)){const o=K.findKey(n,e);!o||t&&!ve(0,n[o],o,t)||(delete n[o],r=!0)}}return K.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 K.forEach(this,((r,o)=>{const s=K.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 K.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&K.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")}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=Re(e);t[r]||(!function(e,t){const n=K.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 K.isArray(e)?e.forEach(r):r(e),this}}Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(Ce.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),K.freezeMethods(Ce);const Ae=Ce;function _e(e,t){const n=this||Ee,r=t||n,o=Ae.from(r.headers);let s=r.data;return K.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__)}function xe(e,t,n){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError"}K.inherits(xe,Q,{__CANCEL__:!0});const Pe=xe;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 ke=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 Le=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.apply(null,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)]},Ue=(e,t,n=3)=>{let r=0;const o=ke(50,250);return Le((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)},Fe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Be=e=>(...t)=>K.asap((()=>e(...t))),De=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,qe=ye.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];K.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),K.isString(r)&&i.push("path="+r),K.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ze(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Me=e=>e instanceof Ae?{...e}:e;function Ie(e,t){t=t||{};const n={};function r(e,t,n,r){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:r},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function o(e,t,n,o){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!K.isUndefined(t))return r(void 0,t)}function i(e,t){return K.isUndefined(t)?K.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(Me(e),Me(t),0,!0)};return K.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);K.isUndefined(i)&&s!==a||(n[r]=i)})),n}const He=e=>{const t=Ie({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=Ae.from(a),t.url=ce(ze(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),K.isFormData(r))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(ye.hasStandardBrowserEnv&&(o&&K.isFunction(o)&&(o=o(t)),o||!1!==o&&De(t.url))){const e=s&&i&&qe.read(i);e&&a.set(s,e)}return t},Je="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=He(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(){n(new Q("Network Error",Q.ERR_NETWORK,e,g)),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&&K.forEach(s.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),K.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,l]=Ue(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([a,u]=Ue(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 y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ye.protocols.indexOf(y)?n(new Q("Unsupported protocol "+y+":",Q.ERR_BAD_REQUEST,e)):g.send(o||null)}))},Ve=(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 ${t} of 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=()=>K.asap(i),a}},We=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},Ke=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 Ke(e))yield*We(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})},Ge="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Xe=Ge&&"function"==typeof ReadableStream,Qe=Ge&&("function"==typeof TextEncoder?(Ye=new TextEncoder,e=>Ye.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Ye;const Ze=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},et=Xe&&Ze((()=>{let e=!1;const t=new Request(ye.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),tt=Xe&&Ze((()=>K.isReadableStream(new Response("").body))),nt={stream:tt&&(e=>e.body)};var rt;Ge&&(rt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!nt[e]&&(nt[e]=K.isFunction(rt[e])?t=>t[e]():(t,n)=>{throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})})));const ot=async(e,t)=>{const n=K.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(K.isBlob(e))return e.size;if(K.isSpecCompliantForm(e)){const t=new Request(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e)?(await Qe(e)).byteLength:void 0)})(t):n},st={http:null,xhr:Je,fetch:Ge&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=He(e);u=u?(u+"").toLowerCase():"text";let p,h=Ve([o,s&&s.toAbortSignal()],i);const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&et&&"get"!==n&&"head"!==n&&0!==(m=await ot(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(K.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=Fe(m,Ue(Be(c)));r=$e(n.body,65536,e,t)}}K.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let s=await fetch(p);const i=tt&&("stream"===u||"response"===u);if(tt&&(a||i&&g)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=K.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&Fe(t,Ue(Be(a),!0))||[];s=new Response($e(s.body,65536,n,(()=>{r&&r(),g&&g()})),e)}u=u||"text";let y=await nt[K.findKey(nt,u)||"text"](s,e);return!i&&g&&g(),await new Promise(((t,n)=>{Ne(t,n,{data:y,headers:Ae.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(t){if(g&&g(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,p),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,p)}})};K.forEach(st,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const it=e=>`- ${e}`,at=e=>K.isFunction(e)||null===e||!1===e,ct=e=>{e=K.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!at(n)&&(r=st[(t=String(n)).toLowerCase()],void 0===r))throw new Q(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(it).join("\n"):" "+it(e[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pe(null,e)}function lt(e){ut(e),e.headers=Ae.from(e.headers),e.data=_e.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ct(e.adapter||Ee.adapter)(e).then((function(t){return ut(e),t.data=_e.call(e,e.transformResponse,t),t.headers=Ae.from(t.headers),t}),(function(t){return je(t)||(ut(e),t&&t.response&&(t.response.data=_e.call(e,e.transformResponse,t.response),t.response.headers=Ae.from(t.response.headers))),Promise.reject(t)}))}const ft="1.7.9",dt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{dt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const pt={};dt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] 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&&!pt[o]&&(pt[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)}},dt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ht={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)}else if(!0!==n)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}},validators:dt},gt=ht.validators;class mt{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=Ie(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ht.assertOptions(n,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean)},!1),null!=r&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:ht.assertOptions(r,{encode:gt.function,serialize:gt.function},!0)),ht.assertOptions(t,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&K.merge(o.common,o[t.method]);o&&K.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){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(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=[lt.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,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=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=lt.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(ze((e=Ie(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],(function(e){mt.prototype[e]=function(t,n){return this.request(Ie(n||{},{method:e,url:t,data:(n||{}).data}))}})),K.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ie(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mt.prototype[e]=t(),mt.prototype[e+"Form"]=t(!0)}));const yt=mt;class bt{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 bt((function(t){e=t})),cancel:e}}}const wt=bt;const Et={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};Object.entries(Et).forEach((([e,t])=>{Et[t]=e}));const St=Et;const Ot=function e(t){const n=new yt(t),o=r(yt.prototype.request,n);return K.extend(o,yt.prototype,n,{allOwnKeys:!0}),K.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Ie(t,n))},o}(Ee);Ot.Axios=yt,Ot.CanceledError=Pe,Ot.CancelToken=wt,Ot.isCancel=je,Ot.VERSION=ft,Ot.toFormData=ne,Ot.AxiosError=Q,Ot.Cancel=Ot.CanceledError,Ot.all=function(e){return Promise.all(e)},Ot.spread=function(e){return function(t){return e.apply(null,t)}},Ot.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},Ot.mergeConfig=Ie,Ot.AxiosHeaders=Ae,Ot.formToJSON=e=>be(K.isHTMLForm(e)?new FormData(e):e),Ot.getAdapter=ct,Ot.HttpStatusCode=St,Ot.default=Ot;const Rt=Ot,Tt="1.11.2",vt="javascript."+Tt,Ct={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console};let At=[],_t=[];class jt{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."+Tt+"."+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"};jt.isNode()&&n.headers&&(n.headers["User-Agent"]="varsnap.js");return Rt(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(){At=[]}static resetConsumers(){_t=[]}static getProducers(){return At}static getConsumers(){return _t}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 xt{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("production"===jt.getConfig(this.config,"env")&&!!jt.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 jt.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then((t=>{const n={producer_token:jt.getConfig(this.config,"producerToken"),signature:this.signature,inputs:xt.serialize(e),prod_outputs:xt.serialize(t)};return jt.ajax("https://www.varsnap.com/api/snap/produce/",n).then((()=>!0)).catch((e=>{if(e.response){if(429===e.response.status)return jt.error(this.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?jt.error(this.config,"Cannot produce to Varsnap; check your producer token"):jt.error(this.config,e.response.statusText)}return!1}))}))}}class Pt{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("development"===jt.getConfig(this.config,"env")&&!!jt.getConfig(this.config,"consumerToken"))}static deserialize(e){if(""!==e)return JSON.parse(e)}consume(e){if(!this.isEnabled()){return new Promise((e=>(jt.error(this.config,"Varsnap not enabled for testing"),e(!1))))}const t={consumer_token:jt.getConfig(this.config,"consumerToken"),signature:this.signature};return jt.ajax("https://www.varsnap.com/api/snap/consume/",t).then((n=>{const r=n;if(!r||"ok"!==r.status){return[new Promise((e=>(jt.error(this.config,"Received error from Varsnap: "+r.status),e(!1))))]}0===r.results.length&&jt.log(this.config,"No snaps found for signature: "+t.signature);const o=[];for(const t of r.results){const n=Pt.deserialize(t.inputs),r=Pt.deserialize(t.prod_outputs);let s;try{s=this.targetFunc(...n)}catch(e){s=e}const i=Promise.resolve(s).then((o=>{const s=xt.serialize(r)===xt.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=>(jt.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:jt.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:xt.serialize(r),matches:o.toString(),snap_outputs_formatted:xt.serialize_formatted(n),test_outputs_formatted:xt.serialize_formatted(r)};return jt.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=>(jt.error(this.config,"Cannot upload test results to Varsnap: "+e),!1)))}reportLog(e,t,n,r,o,s){if(o)return;jt.log(this.config,""),jt.log(this.config,"Testing with Varsnap uuid: "+e),jt.log(this.config,"Signature: "+this.signature),jt.log(this.config,"Function input args: "+jt.limitString(t)),jt.log(this.config,"Production function outputs: "+jt.limitString(n)),jt.log(this.config,"Your function outputs: "+jt.limitString(r)),jt.log(this.config,"Matching outputs: "+o);let i="Cannot upload trial";s&&(i=String(s)),jt.log(this.config,"Trial URL: "+i)}reportTrialGroup(e){jt.log(this.config,"Trial Group: "+e.trial_group_url)}}function Nt(e,t){void 0===t&&(t="");const n=jt.getSignature(e,t),r=new xt(e,n,Nt._config),o=new Pt(e,n,Nt._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,At.push(r),_t.push(o),s}Nt._config=Ct,Nt.updateConfig=function(e){let t=Nt._config;for(const n of Object.keys(Nt._config))Object.prototype.hasOwnProperty.call(e,n)&&(t=jt.setConfig(t,n,e[n]));Nt._config=t},Nt.reset=function(){jt.resetConsumers(),jt.resetProducers()},Nt.version=Tt,Nt.runTests=function(){const e=jt.getConsumers();return 0===e.length?Promise.resolve(!0):function(e){const t={branch:jt.getConfig(e,"branch"),consumer_token:jt.getConfig(e,"consumerToken"),client:vt};return jt.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(),jt.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 kt=Nt;return t=t.default})()));
1
+ /*! Varsnap.js v1.11.3 */
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]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>Nt});var n={};function r(e,t){return function(){return e.apply(t,arguments)}}e.r(n),e.d(n,{hasBrowserEnv:()=>fe,hasStandardBrowserEnv:()=>pe,hasStandardBrowserWebWorkerEnv:()=>he,navigator:()=>de,origin:()=>ge});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");const h=l("ArrayBuffer");const g=f("string"),m=f("function"),y=f("number"),b=e=>null!==e&&"object"==typeof e,w=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)},E=l("Date"),S=l("File"),O=l("Blob"),R=l("FileList"),T=l("URLSearchParams"),[v,C,A,j]=["ReadableStream","Request","Response","Headers"].map(l);function _(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{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 x(e,t){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 P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,N=e=>!p(e)&&e!==P;const k=(U="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>U&&e instanceof U);var U;const F=l("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),B=l("RegExp"),D=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)};const q=l("AsyncFunction"),z=(M="function"==typeof setImmediate,I=m(P.postMessage),M?setImmediate:I?(J=`axios@${Math.random()}`,V=[],P.addEventListener("message",(({source:e,data:t})=>{e===P&&t===J&&V.length&&V.shift()()}),!1),e=>{V.push(e),P.postMessage(J,"*")}):e=>setTimeout(e));var M,I,J,V;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(P):"undefined"!=typeof process&&process.nextTick||z,W={isArray:d,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=c(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:g,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:w,isReadableStream:v,isRequest:C,isResponse:A,isHeaders:j,isUndefined:p,isDate:E,isFile:S,isBlob:O,isRegExp:B,isFunction:m,isStream:e=>b(e)&&m(e.pipe),isURLSearchParams:T,isTypedArray:k,isFileList:R,forEach:_,merge:function e(){const{caseless:t}=N(this)&&this||{},n={},r=(r,o)=>{const s=t&&x(n,o)||o;w(n[s])&&w(r)?n[s]=e(n[s],r):w(r)?n[s]=e({},r):d(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:o}={})=>(_(t,((t,o)=>{n&&m(t)?e[o]=r(t,n):e[o]=t}),{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),e.prototype.constructor=e,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:F,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,n)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];m(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:x,global:P,isContextDefined:N,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[a]&&e[i])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return _(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:q,isThenable:e=>e&&(b(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:z,asap:H,isIterable:e=>null!=e&&m(e[i])};function K(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}W.inherits(K,Error,{toJSON:function(){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:W.toJSONObject(this.config),code:this.code,status:this.status}}});const $=K.prototype,G={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{G[e]={value:e}})),Object.defineProperties(K,G),Object.defineProperty($,"isAxiosError",{value:!0}),K.from=(e,t,n,r,o,s)=>{const i=Object.create($);return W.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),K.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const X=K;function Q(e){return W.isPlainObject(e)||W.isArray(e)}function Y(e){return W.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=W.toFlatObject(W,{},null,(function(e){return/^is[A-Z]/.test(e)}));const te=function(e,t,n){if(!W.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!W.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&W.isSpecCompliantForm(t);if(!W.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(W.isDate(e))return e.toISOString();if(!a&&W.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(e)||W.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(W.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(W.isArray(e)&&function(e){return W.isArray(e)&&!e.some(Q)}(e)||(W.isFileList(e)||W.endsWith(n,"[]"))&&(a=W.toArray(e)))return n=Y(n),a.forEach((function(e,r){!W.isUndefined(e)&&null!==e&&t.append(!0===i?Z([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(Z(o,n,s),c(e)),!1)}const l=[],f=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!W.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!W.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),W.forEach(n,(function(n,s){!0===(!(W.isUndefined(n)||null===n)&&o.call(t,n,W.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t};function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const se=re;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,n){if(!t)return e;const r=n&&n.encode||ie;W.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):W.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ce=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){W.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:se,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},fe="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,pe=fe&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ge=fe&&window.location.href||"http://localhost",me={...n,...le};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&&W.isArray(r)?r.length:s,a)return W.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&W.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&W.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(W.isFormData(e)&&W.isFunction(e.entries)){const n={};return W.forEachEntry(e,((e,r)=>{t(function(e){return W.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const be={transitional:ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=W.isObject(e);o&&W.isHTMLForm(e)&&(e=new FormData(e));if(W.isFormData(e))return r?JSON.stringify(ye(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.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 te(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return me.isNode&&W.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=W.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(W.isString(e))try{return(t||JSON.parse)(e),W.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||be.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw X.from(e,X.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:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],(e=>{be.headers[e]={}}));const we=be,Ee=W.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"]),Se=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Re(e){return!1===e||null==e?e:W.isArray(e)?e.map(Re):String(e)}function Te(e,t,n,r,o){return W.isFunction(r)?r.call(this,t,n):(o&&(t=n),W.isString(t)?W.isString(r)?-1!==t.indexOf(r):W.isRegExp(r)?r.test(t):void 0:void 0)}class ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oe(t);if(!o)throw new Error("header name must be a non-empty string");const s=W.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Re(e))}const s=(e,t)=>W.forEach(e,((e,n)=>o(e,n,t)));if(W.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(W.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]&&Ee[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(W.isObject(e)&&W.isIterable(e)){let n,r,o={};for(const t of e){if(!W.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?W.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=Oe(e)){const n=W.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(W.isFunction(t))return t.call(this,e,n);if(W.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oe(e)){const n=W.findKey(this,e);return!(!n||void 0===this[n]||t&&!Te(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oe(e)){const o=W.findKey(n,e);!o||t&&!Te(0,n[o],o,t)||(delete n[o],r=!0)}}return W.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&&!Te(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return W.forEach(this,((r,o)=>{const s=W.findKey(n,o);if(s)return t[s]=Re(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]=Re(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return W.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&W.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[Se]=this[Se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oe(e);t[r]||(!function(e,t){const n=W.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 W.isArray(e)?e.forEach(r):r(e),this}}ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.reduceDescriptors(ve.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),W.freezeMethods(ve);const Ce=ve;function Ae(e,t){const n=this||we,r=t||n,o=Ce.from(r.headers);let s=r.data;return W.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__)}function _e(e,t,n){X.call(this,null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError"}W.inherits(_e,X,{__CANCEL__:!0});const xe=_e;function Pe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ne=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 ke=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.apply(null,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)]},Ue=(e,t,n=3)=>{let r=0;const o=Ne(50,250);return ke((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)},Fe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Le=e=>(...t)=>W.asap((()=>e(...t))),Be=me.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,me.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,De=me.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];W.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),W.isString(r)&&i.push("path="+r),W.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function qe(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ze=e=>e instanceof Ce?{...e}:e;function Me(e,t){t=t||{};const n={};function r(e,t,n,r){return W.isPlainObject(e)&&W.isPlainObject(t)?W.merge.call({caseless:r},e,t):W.isPlainObject(t)?W.merge({},t):W.isArray(t)?t.slice():t}function o(e,t,n,o){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!W.isUndefined(t))return r(void 0,t)}function i(e,t){return W.isUndefined(t)?W.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(ze(e),ze(t),0,!0)};return W.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);W.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Ie=e=>{const t=Me({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=Ce.from(a),t.url=ae(qe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),W.isFormData(r))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(me.hasStandardBrowserEnv&&(o&&W.isFunction(o)&&(o=o(t)),o||!1!==o&&Be(t.url))){const e=s&&i&&De.read(i);e&&a.set(s,e)}return t},Je="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ie(e);let o=r.data;const s=Ce.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=Ce.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Pe((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 X("Request aborted",X.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new X("Network Error",X.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ue;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new X(t,o.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,g)),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&W.forEach(s.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),W.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,l]=Ue(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([a,u]=Ue(d),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new xe(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 y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===me.protocols.indexOf(y)?n(new X("Unsupported protocol "+y+":",X.ERR_BAD_REQUEST,e)):g.send(o||null)}))},Ve=(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 X?t:new xe(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new X(`timeout ${t} of ms exceeded`,X.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=()=>W.asap(i),a}},He=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()}},Ke=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of We(e))yield*He(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})},$e="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ge=$e&&"function"==typeof ReadableStream,Xe=$e&&("function"==typeof TextEncoder?(Qe=new TextEncoder,e=>Qe.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Qe;const Ye=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ze=Ge&&Ye((()=>{let e=!1;const t=new Request(me.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),et=Ge&&Ye((()=>W.isReadableStream(new Response("").body))),tt={stream:et&&(e=>e.body)};var nt;$e&&(nt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!tt[e]&&(tt[e]=W.isFunction(nt[e])?t=>t[e]():(t,n)=>{throw new X(`Response type '${e}' is not supported`,X.ERR_NOT_SUPPORT,n)})})));const rt=async(e,t)=>{const n=W.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(W.isBlob(e))return e.size;if(W.isSpecCompliantForm(e)){const t=new Request(me.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return W.isArrayBufferView(e)||W.isArrayBuffer(e)?e.byteLength:(W.isURLSearchParams(e)&&(e+=""),W.isString(e)?(await Xe(e)).byteLength:void 0)})(t):n},ot={http:null,xhr:Je,fetch:$e&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Ie(e);u=u?(u+"").toLowerCase():"text";let p,h=Ve([o,s&&s.toAbortSignal()],i);const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&Ze&&"get"!==n&&"head"!==n&&0!==(m=await rt(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(W.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=Fe(m,Ue(Le(c)));r=Ke(n.body,65536,e,t)}}W.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let s=await fetch(p);const i=et&&("stream"===u||"response"===u);if(et&&(a||i&&g)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=W.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&Fe(t,Ue(Le(a),!0))||[];s=new Response(Ke(s.body,65536,n,(()=>{r&&r(),g&&g()})),e)}u=u||"text";let y=await tt[W.findKey(tt,u)||"text"](s,e);return!i&&g&&g(),await new Promise(((t,n)=>{Pe(t,n,{data:y,headers:Ce.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(t){if(g&&g(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new X("Network Error",X.ERR_NETWORK,e,p),{cause:t.cause||t});throw X.from(t,t&&t.code,e,p)}})};W.forEach(ot,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const st=e=>`- ${e}`,it=e=>W.isFunction(e)||null===e||!1===e,at=e=>{e=W.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!it(n)&&(r=ot[(t=String(n)).toLowerCase()],void 0===r))throw new X(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(st).join("\n"):" "+st(e[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function ct(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xe(null,e)}function ut(e){ct(e),e.headers=Ce.from(e.headers),e.data=Ae.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return at(e.adapter||we.adapter)(e).then((function(t){return ct(e),t.data=Ae.call(e,e.transformResponse,t),t.headers=Ce.from(t.headers),t}),(function(t){return je(t)||(ct(e),t&&t.response&&(t.response.data=Ae.call(e,e.transformResponse,t.response),t.response.headers=Ce.from(t.response.headers))),Promise.reject(t)}))}const lt="1.9.0",ft={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ft[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const dt={};ft.transitional=function(e,t,n){function r(e,t){return"[Axios v1.9.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new X(r(o," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!dt[o]&&(dt[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)}},ft.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const pt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.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 X("option "+s+" must be "+n,X.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new X("Unknown option "+s,X.ERR_BAD_OPTION)}},validators:ft},ht=pt.validators;class gt{constructor(e){this.defaults=e||{},this.interceptors={request:new ce,response:new ce}}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=Me(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&pt.assertOptions(n,{silentJSONParsing:ht.transitional(ht.boolean),forcedJSONParsing:ht.transitional(ht.boolean),clarifyTimeoutError:ht.transitional(ht.boolean)},!1),null!=r&&(W.isFunction(r)?t.paramsSerializer={serialize:r}:pt.assertOptions(r,{encode:ht.function,serialize:ht.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pt.assertOptions(t,{baseUrl:ht.spelling("baseURL"),withXsrfToken:ht.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&W.merge(o.common,o[t.method]);o&&W.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Ce.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(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=[ut.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,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=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=ut.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 ae(qe((e=Me(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}W.forEach(["delete","get","head","options"],(function(e){gt.prototype[e]=function(t,n){return this.request(Me(n||{},{method:e,url:t,data:(n||{}).data}))}})),W.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Me(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}gt.prototype[e]=t(),gt.prototype[e+"Form"]=t(!0)}));const mt=gt;class yt{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 xe(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 yt((function(t){e=t})),cancel:e}}}const bt=yt;const wt={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};Object.entries(wt).forEach((([e,t])=>{wt[t]=e}));const Et=wt;const St=function e(t){const n=new mt(t),o=r(mt.prototype.request,n);return W.extend(o,mt.prototype,n,{allOwnKeys:!0}),W.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Me(t,n))},o}(we);St.Axios=mt,St.CanceledError=xe,St.CancelToken=bt,St.isCancel=je,St.VERSION=lt,St.toFormData=te,St.AxiosError=X,St.Cancel=St.CanceledError,St.all=function(e){return Promise.all(e)},St.spread=function(e){return function(t){return e.apply(null,t)}},St.isAxiosError=function(e){return W.isObject(e)&&!0===e.isAxiosError},St.mergeConfig=Me,St.AxiosHeaders=Ce,St.formToJSON=e=>ye(W.isHTMLForm(e)?new FormData(e):e),St.getAdapter=at,St.HttpStatusCode=Et,St.default=St;const Ot=St,Rt="1.11.3",Tt="javascript."+Rt,vt={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console};let Ct=[],At=[];class jt{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"};jt.isNode()&&n.headers&&(n.headers["User-Agent"]="varsnap.js");return Ot(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(){Ct=[]}static resetConsumers(){At=[]}static getProducers(){return Ct}static getConsumers(){return At}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 _t{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("production"===jt.getConfig(this.config,"env")&&!!jt.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 jt.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then((t=>{const n={producer_token:jt.getConfig(this.config,"producerToken"),signature:this.signature,inputs:_t.serialize(e),prod_outputs:_t.serialize(t)};return jt.ajax("https://www.varsnap.com/api/snap/produce/",n).then((()=>!0)).catch((e=>{if(e.response){if(429===e.response.status)return jt.error(this.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?jt.error(this.config,"Cannot produce to Varsnap; check your producer token"):jt.error(this.config,e.response.statusText)}return!1}))}))}}class xt{constructor(e,t,n){this.targetFunc=e,this.signature=t,this.config=n}isEnabled(){return!!this.config.varsnap&&("development"===jt.getConfig(this.config,"env")&&!!jt.getConfig(this.config,"consumerToken"))}static deserialize(e){if(""!==e)return JSON.parse(e)}consume(e){if(!this.isEnabled()){return new Promise((e=>(jt.error(this.config,"Varsnap not enabled for testing"),e(!1))))}const t={consumer_token:jt.getConfig(this.config,"consumerToken"),signature:this.signature};return jt.ajax("https://www.varsnap.com/api/snap/consume/",t).then((n=>{const r=n;if(!r||"ok"!==r.status){return[new Promise((e=>(jt.error(this.config,"Received error from Varsnap: "+r.status),e(!1))))]}0===r.results.length&&jt.log(this.config,"No snaps found for signature: "+t.signature);const o=[];for(const t of r.results){const n=xt.deserialize(t.inputs),r=xt.deserialize(t.prod_outputs);let s;try{s=this.targetFunc(...n)}catch(e){s=e}const i=Promise.resolve(s).then((o=>{const s=_t.serialize(r)===_t.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=>(jt.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:jt.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:_t.serialize(r),matches:o.toString(),snap_outputs_formatted:_t.serialize_formatted(n),test_outputs_formatted:_t.serialize_formatted(r)};return jt.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=>(jt.error(this.config,"Cannot upload test results to Varsnap: "+e),!1)))}reportLog(e,t,n,r,o,s){if(o)return;jt.log(this.config,""),jt.log(this.config,"Testing with Varsnap uuid: "+e),jt.log(this.config,"Signature: "+this.signature),jt.log(this.config,"Function input args: "+jt.limitString(t)),jt.log(this.config,"Production function outputs: "+jt.limitString(n)),jt.log(this.config,"Your function outputs: "+jt.limitString(r)),jt.log(this.config,"Matching outputs: "+o);let i="Cannot upload trial";s&&(i=String(s)),jt.log(this.config,"Trial URL: "+i)}reportTrialGroup(e){jt.log(this.config,"Trial Group: "+e.trial_group_url)}}function Pt(e,t){void 0===t&&(t="");const n=jt.getSignature(e,t),r=new _t(e,n,Pt._config),o=new xt(e,n,Pt._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,Ct.push(r),At.push(o),s}Pt._config=vt,Pt.updateConfig=function(e){let t=Pt._config;for(const n of Object.keys(Pt._config))Object.prototype.hasOwnProperty.call(e,n)&&(t=jt.setConfig(t,n,e[n]));Pt._config=t},Pt.reset=function(){jt.resetConsumers(),jt.resetProducers()},Pt.version=Rt,Pt.runTests=function(){const e=jt.getConsumers();return 0===e.length?Promise.resolve(!0):function(e){const t={branch:jt.getConfig(e,"branch"),consumer_token:jt.getConfig(e,"consumerToken"),client:Tt};return jt.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(),jt.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 Nt=Pt;return t=t.default})()));
3
3
  //# sourceMappingURL=browser.min.js.map