UNPKG

imgur

Version:

Unofficial JavaScript library for Imgur

6 lines 319 kB
(function(c1,E1){typeof exports=="object"&&typeof module<"u"?module.exports=E1():typeof define=="function"&&define.amd?define(E1):(c1=typeof globalThis<"u"?globalThis:c1||self,c1.ImgurClient=E1())})(this,function(){"use strict";function c1(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function E1(u){if(Object.prototype.hasOwnProperty.call(u,"__esModule"))return u;var e=u.default;if(typeof e=="function"){var t=function r(){var n=!1;try{n=this instanceof r}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(u).forEach(function(r){var n=Object.getOwnPropertyDescriptor(u,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return u[r]}})}),t}var y1={exports:{}},Pu;function Z0(){if(Pu)return y1.exports;Pu=1;var u=typeof Reflect=="object"?Reflect:null,e=u&&typeof u.apply=="function"?u.apply:function(B,b,g){return Function.prototype.apply.call(B,b,g)},t;u&&typeof u.ownKeys=="function"?t=u.ownKeys:Object.getOwnPropertySymbols?t=function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:t=function(B){return Object.getOwnPropertyNames(B)};function r(D){console&&console.warn&&console.warn(D)}var n=Number.isNaN||function(B){return B!==B};function s(){s.init.call(this)}y1.exports=s,y1.exports.once=f,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function C(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(D){if(typeof D!="number"||D<0||n(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");i=D}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||n(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function w(D){return D._maxListeners===void 0?s.defaultMaxListeners:D._maxListeners}s.prototype.getMaxListeners=function(){return w(this)},s.prototype.emit=function(B){for(var b=[],g=1;g<arguments.length;g++)b.push(arguments[g]);var R=B==="error",P=this._events;if(P!==void 0)R=R&&P.error===void 0;else if(!R)return!1;if(R){var x;if(b.length>0&&(x=b[0]),x instanceof Error)throw x;var N=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw N.context=x,N}var J=P[B];if(J===void 0)return!1;if(typeof J=="function")e(J,this,b);else for(var i1=J.length,d1=a(J,i1),g=0;g<i1;++g)e(d1[g],this,b);return!0};function o(D,B,b,g){var R,P,x;if(C(b),P=D._events,P===void 0?(P=D._events=Object.create(null),D._eventsCount=0):(P.newListener!==void 0&&(D.emit("newListener",B,b.listener?b.listener:b),P=D._events),x=P[B]),x===void 0)x=P[B]=b,++D._eventsCount;else if(typeof x=="function"?x=P[B]=g?[b,x]:[x,b]:g?x.unshift(b):x.push(b),R=w(D),R>0&&x.length>R&&!x.warned){x.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(B)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=D,N.type=B,N.count=x.length,r(N)}return D}s.prototype.addListener=function(B,b){return o(this,B,b,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(B,b){return o(this,B,b,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F(D,B,b){var g={fired:!1,wrapFn:void 0,target:D,type:B,listener:b},R=d.bind(g);return R.listener=b,g.wrapFn=R,R}s.prototype.once=function(B,b){return C(b),this.on(B,F(this,B,b)),this},s.prototype.prependOnceListener=function(B,b){return C(b),this.prependListener(B,F(this,B,b)),this},s.prototype.removeListener=function(B,b){var g,R,P,x,N;if(C(b),R=this._events,R===void 0)return this;if(g=R[B],g===void 0)return this;if(g===b||g.listener===b)--this._eventsCount===0?this._events=Object.create(null):(delete R[B],R.removeListener&&this.emit("removeListener",B,g.listener||b));else if(typeof g!="function"){for(P=-1,x=g.length-1;x>=0;x--)if(g[x]===b||g[x].listener===b){N=g[x].listener,P=x;break}if(P<0)return this;P===0?g.shift():l(g,P),g.length===1&&(R[B]=g[0]),R.removeListener!==void 0&&this.emit("removeListener",B,N||b)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(B){var b,g,R;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):g[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete g[B]),this;if(arguments.length===0){var P=Object.keys(g),x;for(R=0;R<P.length;++R)x=P[R],x!=="removeListener"&&this.removeAllListeners(x);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(b=g[B],typeof b=="function")this.removeListener(B,b);else if(b!==void 0)for(R=b.length-1;R>=0;R--)this.removeListener(B,b[R]);return this};function S(D,B,b){var g=D._events;if(g===void 0)return[];var R=g[B];return R===void 0?[]:typeof R=="function"?b?[R.listener||R]:[R]:b?h(R):a(R,R.length)}s.prototype.listeners=function(B){return S(this,B,!0)},s.prototype.rawListeners=function(B){return S(this,B,!1)},s.listenerCount=function(D,B){return typeof D.listenerCount=="function"?D.listenerCount(B):c.call(D,B)},s.prototype.listenerCount=c;function c(D){var B=this._events;if(B!==void 0){var b=B[D];if(typeof b=="function")return 1;if(b!==void 0)return b.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function a(D,B){for(var b=new Array(B),g=0;g<B;++g)b[g]=D[g];return b}function l(D,B){for(;B+1<D.length;B++)D[B]=D[B+1];D.pop()}function h(D){for(var B=new Array(D.length),b=0;b<B.length;++b)B[b]=D[b].listener||D[b];return B}function f(D,B){return new Promise(function(b,g){function R(x){D.removeListener(B,P),g(x)}function P(){typeof D.removeListener=="function"&&D.removeListener("error",R),b([].slice.call(arguments))}m(D,B,P,{once:!0}),B!=="error"&&p(D,R,{once:!0})})}function p(D,B,b){typeof D.on=="function"&&m(D,"error",B,b)}function m(D,B,b,g){if(typeof D.on=="function")g.once?D.once(B,b):D.on(B,b);else if(typeof D.addEventListener=="function")D.addEventListener(B,function R(P){g.once&&D.removeEventListener(B,R),b(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}return y1.exports}var Y0=Z0();function u2(u){return u.accessToken!==void 0}function e2(u){return u.refreshToken!==void 0}function t2(u){return u.clientId!==void 0}const o1="https://api.imgur.com",t1="3",r2="oauth2/token",O1=`${t1}/account`,xu=`${t1}/album`,l1=`${t1}/image`,n2=`${t1}/upload`,s2=`${t1}/gallery`,i2=`${t1}/gallery/r`,o2=`${t1}/gallery/search`;async function a2(u){if(u2(u.credentials))return`Bearer ${u.credentials.accessToken}`;const{clientId:e,clientSecret:t,refreshToken:r}=u.credentials;if(e2(u.credentials)){const n={url:r2,baseURL:o1,method:"POST",data:{client_id:e,client_secret:t,refresh_token:r,grant_type:"refresh_token"}},s=await u.plainRequest(n);if(s.status===200&&s.data){const{access_token:i,refresh_token:C}=s.data;return u.credentials.accessToken=i,u.credentials.refreshToken=C,`Bearer ${i}`}}return t2(u.credentials)?`Client-ID ${e}`:null}function Lu(u,e){return function(){return u.apply(e,arguments)}}const{toString:A2}=Object.prototype,{getPrototypeOf:N1}=Object,{iterator:g1,toStringTag:Uu}=Symbol,w1=(u=>e=>{const t=A2.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),G=u=>(u=u.toLowerCase(),e=>w1(e)===u),S1=u=>e=>typeof e===u,{isArray:a1}=Array,f1=S1("undefined");function F2(u){return u!==null&&!f1(u)&&u.constructor!==null&&!f1(u.constructor)&&M(u.constructor.isBuffer)&&u.constructor.isBuffer(u)}const Tu=G("ArrayBuffer");function c2(u){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(u):e=u&&u.buffer&&Tu(u.buffer),e}const E2=S1("string"),M=S1("function"),_u=S1("number"),b1=u=>u!==null&&typeof u=="object",l2=u=>u===!0||u===!1,R1=u=>{if(w1(u)!=="object")return!1;const e=N1(u);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Uu in u)&&!(g1 in u)},f2=G("Date"),D2=G("File"),C2=G("Blob"),B2=G("FileList"),h2=u=>b1(u)&&M(u.pipe),d2=u=>{let e;return u&&(typeof FormData=="function"&&u instanceof FormData||M(u.append)&&((e=w1(u))==="formdata"||e==="object"&&M(u.toString)&&u.toString()==="[object FormData]"))},p2=G("URLSearchParams"),[m2,y2,g2,w2]=["ReadableStream","Request","Response","Headers"].map(G),S2=u=>u.trim?u.trim():u.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function D1(u,e,{allOwnKeys:t=!1}={}){if(u===null||typeof u>"u")return;let r,n;if(typeof u!="object"&&(u=[u]),a1(u))for(r=0,n=u.length;r<n;r++)e.call(null,u[r],r,u);else{const s=t?Object.getOwnPropertyNames(u):Object.keys(u),i=s.length;let C;for(r=0;r<i;r++)C=s[r],e.call(null,u[C],C,u)}}function Iu(u,e){e=e.toLowerCase();const t=Object.keys(u);let r=t.length,n;for(;r-- >0;)if(n=t[r],e===n.toLowerCase())return n;return null}const r1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ou=u=>!f1(u)&&u!==r1;function q1(){const{caseless:u}=Ou(this)&&this||{},e={},t=(r,n)=>{const s=u&&Iu(e,n)||n;R1(e[s])&&R1(r)?e[s]=q1(e[s],r):R1(r)?e[s]=q1({},r):a1(r)?e[s]=r.slice():e[s]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&D1(arguments[r],t);return e}const b2=(u,e,t,{allOwnKeys:r}={})=>(D1(e,(n,s)=>{t&&M(n)?u[s]=Lu(n,t):u[s]=n},{allOwnKeys:r}),u),R2=u=>(u.charCodeAt(0)===65279&&(u=u.slice(1)),u),v2=(u,e,t,r)=>{u.prototype=Object.create(e.prototype,r),u.prototype.constructor=u,Object.defineProperty(u,"super",{value:e.prototype}),t&&Object.assign(u.prototype,t)},P2=(u,e,t,r)=>{let n,s,i;const C={};if(e=e||{},u==null)return e;do{for(n=Object.getOwnPropertyNames(u),s=n.length;s-- >0;)i=n[s],(!r||r(i,u,e))&&!C[i]&&(e[i]=u[i],C[i]=!0);u=t!==!1&&N1(u)}while(u&&(!t||t(u,e))&&u!==Object.prototype);return e},x2=(u,e,t)=>{u=String(u),(t===void 0||t>u.length)&&(t=u.length),t-=e.length;const r=u.indexOf(e,t);return r!==-1&&r===t},L2=u=>{if(!u)return null;if(a1(u))return u;let e=u.length;if(!_u(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=u[e];return t},U2=(u=>e=>u&&e instanceof u)(typeof Uint8Array<"u"&&N1(Uint8Array)),T2=(u,e)=>{const r=(u&&u[g1]).call(u);let n;for(;(n=r.next())&&!n.done;){const s=n.value;e.call(u,s[0],s[1])}},_2=(u,e)=>{let t;const r=[];for(;(t=u.exec(e))!==null;)r.push(t);return r},I2=G("HTMLFormElement"),O2=u=>u.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),Nu=(({hasOwnProperty:u})=>(e,t)=>u.call(e,t))(Object.prototype),N2=G("RegExp"),qu=(u,e)=>{const t=Object.getOwnPropertyDescriptors(u),r={};D1(t,(n,s)=>{let i;(i=e(n,s,u))!==!1&&(r[s]=i||n)}),Object.defineProperties(u,r)},q2=u=>{qu(u,(e,t)=>{if(M(u)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=u[t];if(M(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},k2=(u,e)=>{const t={},r=n=>{n.forEach(s=>{t[s]=!0})};return a1(u)?r(u):r(String(u).split(e)),t},$2=()=>{},z2=(u,e)=>u!=null&&Number.isFinite(u=+u)?u:e;function j2(u){return!!(u&&M(u.append)&&u[Uu]==="FormData"&&u[g1])}const M2=u=>{const e=new Array(10),t=(r,n)=>{if(b1(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[n]=r;const s=a1(r)?[]:{};return D1(r,(i,C)=>{const w=t(i,n+1);!f1(w)&&(s[C]=w)}),e[n]=void 0,s}}return r};return t(u,0)},V2=G("AsyncFunction"),H2=u=>u&&(b1(u)||M(u))&&M(u.then)&&M(u.catch),ku=((u,e)=>u?setImmediate:e?((t,r)=>(r1.addEventListener("message",({source:n,data:s})=>{n===r1&&s===t&&r.length&&r.shift()()},!1),n=>{r.push(n),r1.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",M(r1.postMessage)),W2=typeof queueMicrotask<"u"?queueMicrotask.bind(r1):typeof process<"u"&&process.nextTick||ku,y={isArray:a1,isArrayBuffer:Tu,isBuffer:F2,isFormData:d2,isArrayBufferView:c2,isString:E2,isNumber:_u,isBoolean:l2,isObject:b1,isPlainObject:R1,isReadableStream:m2,isRequest:y2,isResponse:g2,isHeaders:w2,isUndefined:f1,isDate:f2,isFile:D2,isBlob:C2,isRegExp:N2,isFunction:M,isStream:h2,isURLSearchParams:p2,isTypedArray:U2,isFileList:B2,forEach:D1,merge:q1,extend:b2,trim:S2,stripBOM:R2,inherits:v2,toFlatObject:P2,kindOf:w1,kindOfTest:G,endsWith:x2,toArray:L2,forEachEntry:T2,matchAll:_2,isHTMLForm:I2,hasOwnProperty:Nu,hasOwnProp:Nu,reduceDescriptors:qu,freezeMethods:q2,toObjectSet:k2,toCamelCase:O2,noop:$2,toFiniteNumber:z2,findKey:Iu,global:r1,isContextDefined:Ou,isSpecCompliantForm:j2,toJSONObject:M2,isAsyncFn:V2,isThenable:H2,setImmediate:ku,asap:W2,isIterable:u=>u!=null&&M(u[g1])};function _(u,e,t,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=u,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),n&&(this.response=n,this.status=n.status?n.status:null)}y.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:y.toJSONObject(this.config),code:this.code,status:this.status}}});const $u=_.prototype,zu={};["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(u=>{zu[u]={value:u}}),Object.defineProperties(_,zu),Object.defineProperty($u,"isAxiosError",{value:!0}),_.from=(u,e,t,r,n,s)=>{const i=Object.create($u);return y.toFlatObject(u,i,function(w){return w!==Error.prototype},C=>C!=="isAxiosError"),_.call(i,u.message,e,t,r,n),i.cause=u,i.name=u.name,s&&Object.assign(i,s),i};const J2=null;function k1(u){return y.isPlainObject(u)||y.isArray(u)}function ju(u){return y.endsWith(u,"[]")?u.slice(0,-2):u}function Mu(u,e,t){return u?u.concat(e).map(function(n,s){return n=ju(n),!t&&s?"["+n+"]":n}).join(t?".":""):e}function G2(u){return y.isArray(u)&&!u.some(k1)}const K2=y.toFlatObject(y,{},null,function(e){return/^is[A-Z]/.test(e)});function v1(u,e,t){if(!y.isObject(u))throw new TypeError("target must be an object");e=e||new FormData,t=y.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(l,h){return!y.isUndefined(h[l])});const r=t.metaTokens,n=t.visitor||d,s=t.dots,i=t.indexes,w=(t.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(e);if(!y.isFunction(n))throw new TypeError("visitor must be a function");function o(a){if(a===null)return"";if(y.isDate(a))return a.toISOString();if(y.isBoolean(a))return a.toString();if(!w&&y.isBlob(a))throw new _("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(a)||y.isTypedArray(a)?w&&typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function d(a,l,h){let f=a;if(a&&!h&&typeof a=="object"){if(y.endsWith(l,"{}"))l=r?l:l.slice(0,-2),a=JSON.stringify(a);else if(y.isArray(a)&&G2(a)||(y.isFileList(a)||y.endsWith(l,"[]"))&&(f=y.toArray(a)))return l=ju(l),f.forEach(function(m,D){!(y.isUndefined(m)||m===null)&&e.append(i===!0?Mu([l],D,s):i===null?l:l+"[]",o(m))}),!1}return k1(a)?!0:(e.append(Mu(h,l,s),o(a)),!1)}const F=[],S=Object.assign(K2,{defaultVisitor:d,convertValue:o,isVisitable:k1});function c(a,l){if(!y.isUndefined(a)){if(F.indexOf(a)!==-1)throw Error("Circular reference detected in "+l.join("."));F.push(a),y.forEach(a,function(f,p){(!(y.isUndefined(f)||f===null)&&n.call(e,f,y.isString(p)?p.trim():p,l,S))===!0&&c(f,l?l.concat(p):[p])}),F.pop()}}if(!y.isObject(u))throw new TypeError("data must be an object");return c(u),e}function Vu(u){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(u).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function $1(u,e){this._pairs=[],u&&v1(u,this,e)}const Hu=$1.prototype;Hu.append=function(e,t){this._pairs.push([e,t])},Hu.toString=function(e){const t=e?function(r){return e.call(this,r,Vu)}:Vu;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function X2(u){return encodeURIComponent(u).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wu(u,e,t){if(!e)return u;const r=t&&t.encode||X2;y.isFunction(t)&&(t={serialize:t});const n=t&&t.serialize;let s;if(n?s=n(e,t):s=y.isURLSearchParams(e)?e.toString():new $1(e,t).toString(r),s){const i=u.indexOf("#");i!==-1&&(u=u.slice(0,i)),u+=(u.indexOf("?")===-1?"?":"&")+s}return u}class Ju{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Gu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q2={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:$1,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},z1=typeof window<"u"&&typeof document<"u",j1=typeof navigator=="object"&&navigator||void 0,Z2=z1&&(!j1||["ReactNative","NativeScript","NS"].indexOf(j1.product)<0),Y2=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ue=z1&&window.location.href||"http://localhost",j={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:z1,hasStandardBrowserEnv:Z2,hasStandardBrowserWebWorkerEnv:Y2,navigator:j1,origin:ue},Symbol.toStringTag,{value:"Module"})),...Q2};function ee(u,e){return v1(u,new j.classes.URLSearchParams,Object.assign({visitor:function(t,r,n,s){return j.isNode&&y.isBuffer(t)?(this.append(r,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function te(u){return y.matchAll(/\w+|\[(\w*)]/g,u).map(e=>e[0]==="[]"?"":e[1]||e[0])}function re(u){const e={},t=Object.keys(u);let r;const n=t.length;let s;for(r=0;r<n;r++)s=t[r],e[s]=u[s];return e}function Ku(u){function e(t,r,n,s){let i=t[s++];if(i==="__proto__")return!0;const C=Number.isFinite(+i),w=s>=t.length;return i=!i&&y.isArray(n)?n.length:i,w?(y.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!C):((!n[i]||!y.isObject(n[i]))&&(n[i]=[]),e(t,r,n[i],s)&&y.isArray(n[i])&&(n[i]=re(n[i])),!C)}if(y.isFormData(u)&&y.isFunction(u.entries)){const t={};return y.forEachEntry(u,(r,n)=>{e(te(r),n,t,0)}),t}return null}function ne(u,e,t){if(y.isString(u))try{return(e||JSON.parse)(u),y.trim(u)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(u)}const C1={transitional:Gu,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=y.isObject(e);if(s&&y.isHTMLForm(e)&&(e=new FormData(e)),y.isFormData(e))return n?JSON.stringify(Ku(e)):e;if(y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)||y.isReadableStream(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let C;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ee(e,this.formSerializer).toString();if((C=y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const w=this.env&&this.env.FormData;return v1(C?{"files[]":e}:e,w&&new w,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),ne(e)):e}],transformResponse:[function(e){const t=this.transitional||C1.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(y.isResponse(e)||y.isReadableStream(e))return e;if(e&&y.isString(e)&&(r&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(C){if(i)throw C.name==="SyntaxError"?_.from(C,_.ERR_BAD_RESPONSE,this,null,this.response):C}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:j.classes.FormData,Blob:j.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],u=>{C1.headers[u]={}});const se=y.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"]),ie=u=>{const e={};let t,r,n;return u&&u.split(` `).forEach(function(i){n=i.indexOf(":"),t=i.substring(0,n).trim().toLowerCase(),r=i.substring(n+1).trim(),!(!t||e[t]&&se[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},Xu=Symbol("internals");function B1(u){return u&&String(u).trim().toLowerCase()}function P1(u){return u===!1||u==null?u:y.isArray(u)?u.map(P1):String(u)}function oe(u){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(u);)e[r[1]]=r[2];return e}const ae=u=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(u.trim());function M1(u,e,t,r,n){if(y.isFunction(r))return r.call(this,e,t);if(n&&(e=t),!!y.isString(e)){if(y.isString(r))return e.indexOf(r)!==-1;if(y.isRegExp(r))return r.test(e)}}function Ae(u){return u.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Fe(u,e){const t=y.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(u,r+t,{value:function(n,s,i){return this[r].call(this,e,n,s,i)},configurable:!0})})}let V=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(C,w,o){const d=B1(w);if(!d)throw new Error("header name must be a non-empty string");const F=y.findKey(n,d);(!F||n[F]===void 0||o===!0||o===void 0&&n[F]!==!1)&&(n[F||w]=P1(C))}const i=(C,w)=>y.forEach(C,(o,d)=>s(o,d,w));if(y.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(y.isString(e)&&(e=e.trim())&&!ae(e))i(ie(e),t);else if(y.isObject(e)&&y.isIterable(e)){let C={},w,o;for(const d of e){if(!y.isArray(d))throw TypeError("Object iterator must return a key-value pair");C[o=d[0]]=(w=C[o])?y.isArray(w)?[...w,d[1]]:[w,d[1]]:d[1]}i(C,t)}else e!=null&&s(t,e,r);return this}get(e,t){if(e=B1(e),e){const r=y.findKey(this,e);if(r){const n=this[r];if(!t)return n;if(t===!0)return oe(n);if(y.isFunction(t))return t.call(this,n,r);if(y.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=B1(e),e){const r=y.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||M1(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let n=!1;function s(i){if(i=B1(i),i){const C=y.findKey(r,i);C&&(!t||M1(r,r[C],C,t))&&(delete r[C],n=!0)}}return y.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];(!e||M1(this,this[s],s,e,!0))&&(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return y.forEach(this,(n,s)=>{const i=y.findKey(r,s);if(i){t[i]=P1(n),delete t[s];return}const C=e?Ae(s):String(s).trim();C!==s&&delete t[s],t[C]=P1(n),r[C]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return y.forEach(this,(r,n)=>{r!=null&&r!==!1&&(t[n]=e&&y.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}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 r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){const r=(this[Xu]=this[Xu]={accessors:{}}).accessors,n=this.prototype;function s(i){const C=B1(i);r[C]||(Fe(n,i),r[C]=!0)}return y.isArray(e)?e.forEach(s):s(e),this}};V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors(V.prototype,({value:u},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>u,set(r){this[t]=r}}}),y.freezeMethods(V);function V1(u,e){const t=this||C1,r=e||t,n=V.from(r.headers);let s=r.data;return y.forEach(u,function(C){s=C.call(t,s,n.normalize(),e?e.status:void 0)}),n.normalize(),s}function Qu(u){return!!(u&&u.__CANCEL__)}function A1(u,e,t){_.call(this,u??"canceled",_.ERR_CANCELED,e,t),this.name="CanceledError"}y.inherits(A1,_,{__CANCEL__:!0});function Zu(u,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?u(t):e(new _("Request failed with status code "+t.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function ce(u){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(u);return e&&e[1]||""}function Ee(u,e){u=u||10;const t=new Array(u),r=new Array(u);let n=0,s=0,i;return e=e!==void 0?e:1e3,function(w){const o=Date.now(),d=r[s];i||(i=o),t[n]=w,r[n]=o;let F=s,S=0;for(;F!==n;)S+=t[F++],F=F%u;if(n=(n+1)%u,n===s&&(s=(s+1)%u),o-i<e)return;const c=d&&o-d;return c?Math.round(S*1e3/c):void 0}}function le(u,e){let t=0,r=1e3/e,n,s;const i=(o,d=Date.now())=>{t=d,n=null,s&&(clearTimeout(s),s=null),u.apply(null,o)};return[(...o)=>{const d=Date.now(),F=d-t;F>=r?i(o,d):(n=o,s||(s=setTimeout(()=>{s=null,i(n)},r-F)))},()=>n&&i(n)]}const x1=(u,e,t=3)=>{let r=0;const n=Ee(50,250);return le(s=>{const i=s.loaded,C=s.lengthComputable?s.total:void 0,w=i-r,o=n(w),d=i<=C;r=i;const F={loaded:i,total:C,progress:C?i/C:void 0,bytes:w,rate:o||void 0,estimated:o&&C&&d?(C-i)/o:void 0,event:s,lengthComputable:C!=null,[e?"download":"upload"]:!0};u(F)},t)},Yu=(u,e)=>{const t=u!=null;return[r=>e[0]({lengthComputable:t,total:u,loaded:r}),e[1]]},u0=u=>(...e)=>y.asap(()=>u(...e)),fe=j.hasStandardBrowserEnv?((u,e)=>t=>(t=new URL(t,j.origin),u.protocol===t.protocol&&u.host===t.host&&(e||u.port===t.port)))(new URL(j.origin),j.navigator&&/(msie|trident)/i.test(j.navigator.userAgent)):()=>!0,De=j.hasStandardBrowserEnv?{write(u,e,t,r,n,s){const i=[u+"="+encodeURIComponent(e)];y.isNumber(t)&&i.push("expires="+new Date(t).toGMTString()),y.isString(r)&&i.push("path="+r),y.isString(n)&&i.push("domain="+n),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(u){const e=document.cookie.match(new RegExp("(^|;\\s*)("+u+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(u){this.write(u,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ce(u){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(u)}function Be(u,e){return e?u.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):u}function e0(u,e,t){let r=!Ce(e);return u&&(r||t==!1)?Be(u,e):e}const t0=u=>u instanceof V?{...u}:u;function n1(u,e){e=e||{};const t={};function r(o,d,F,S){return y.isPlainObject(o)&&y.isPlainObject(d)?y.merge.call({caseless:S},o,d):y.isPlainObject(d)?y.merge({},d):y.isArray(d)?d.slice():d}function n(o,d,F,S){if(y.isUndefined(d)){if(!y.isUndefined(o))return r(void 0,o,F,S)}else return r(o,d,F,S)}function s(o,d){if(!y.isUndefined(d))return r(void 0,d)}function i(o,d){if(y.isUndefined(d)){if(!y.isUndefined(o))return r(void 0,o)}else return r(void 0,d)}function C(o,d,F){if(F in e)return r(o,d);if(F in u)return r(void 0,o)}const w={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:C,headers:(o,d,F)=>n(t0(o),t0(d),F,!0)};return y.forEach(Object.keys(Object.assign({},u,e)),function(d){const F=w[d]||n,S=F(u[d],e[d],d);y.isUndefined(S)&&F!==C||(t[d]=S)}),t}const r0=u=>{const e=n1({},u);let{data:t,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:s,headers:i,auth:C}=e;e.headers=i=V.from(i),e.url=Wu(e0(e.baseURL,e.url,e.allowAbsoluteUrls),u.params,u.paramsSerializer),C&&i.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let w;if(y.isFormData(t)){if(j.hasStandardBrowserEnv||j.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((w=i.getContentType())!==!1){const[o,...d]=w?w.split(";").map(F=>F.trim()).filter(Boolean):[];i.setContentType([o||"multipart/form-data",...d].join("; "))}}if(j.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&fe(e.url))){const o=n&&s&&De.read(s);o&&i.set(n,o)}return e},he=typeof XMLHttpRequest<"u"&&function(u){return new Promise(function(t,r){const n=r0(u);let s=n.data;const i=V.from(n.headers).normalize();let{responseType:C,onUploadProgress:w,onDownloadProgress:o}=n,d,F,S,c,a;function l(){c&&c(),a&&a(),n.cancelToken&&n.cancelToken.unsubscribe(d),n.signal&&n.signal.removeEventListener("abort",d)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function f(){if(!h)return;const m=V.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),B={data:!C||C==="text"||C==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:m,config:u,request:h};Zu(function(g){t(g),l()},function(g){r(g),l()},B),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new _("Request aborted",_.ECONNABORTED,u,h)),h=null)},h.onerror=function(){r(new _("Network Error",_.ERR_NETWORK,u,h)),h=null},h.ontimeout=function(){let D=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const B=n.transitional||Gu;n.timeoutErrorMessage&&(D=n.timeoutErrorMessage),r(new _(D,B.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,u,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&y.forEach(i.toJSON(),function(D,B){h.setRequestHeader(B,D)}),y.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),C&&C!=="json"&&(h.responseType=n.responseType),o&&([S,a]=x1(o,!0),h.addEventListener("progress",S)),w&&h.upload&&([F,c]=x1(w),h.upload.addEventListener("progress",F),h.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(d=m=>{h&&(r(!m||m.type?new A1(null,u,h):m),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(d),n.signal&&(n.signal.aborted?d():n.signal.addEventListener("abort",d)));const p=ce(n.url);if(p&&j.protocols.indexOf(p)===-1){r(new _("Unsupported protocol "+p+":",_.ERR_BAD_REQUEST,u));return}h.send(s||null)})},de=(u,e)=>{const{length:t}=u=u?u.filter(Boolean):[];if(e||t){let r=new AbortController,n;const s=function(o){if(!n){n=!0,C();const d=o instanceof Error?o:this.reason;r.abort(d instanceof _?d:new A1(d instanceof Error?d.message:d))}};let i=e&&setTimeout(()=>{i=null,s(new _(`timeout ${e} of ms exceeded`,_.ETIMEDOUT))},e);const C=()=>{u&&(i&&clearTimeout(i),i=null,u.forEach(o=>{o.unsubscribe?o.unsubscribe(s):o.removeEventListener("abort",s)}),u=null)};u.forEach(o=>o.addEventListener("abort",s));const{signal:w}=r;return w.unsubscribe=()=>y.asap(C),w}},pe=function*(u,e){let t=u.byteLength;if(t<e){yield u;return}let r=0,n;for(;r<t;)n=r+e,yield u.slice(r,n),r=n},me=async function*(u,e){for await(const t of ye(u))yield*pe(t,e)},ye=async function*(u){if(u[Symbol.asyncIterator]){yield*u;return}const e=u.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},n0=(u,e,t,r)=>{const n=me(u,e);let s=0,i,C=w=>{i||(i=!0,r&&r(w))};return new ReadableStream({async pull(w){try{const{done:o,value:d}=await n.next();if(o){C(),w.close();return}let F=d.byteLength;if(t){let S=s+=F;t(S)}w.enqueue(new Uint8Array(d))}catch(o){throw C(o),o}},cancel(w){return C(w),n.return()}},{highWaterMark:2})},L1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",s0=L1&&typeof ReadableStream=="function",ge=L1&&(typeof TextEncoder=="function"?(u=>e=>u.encode(e))(new TextEncoder):async u=>new Uint8Array(await new Response(u).arrayBuffer())),i0=(u,...e)=>{try{return!!u(...e)}catch{return!1}},we=s0&&i0(()=>{let u=!1;const e=new Request(j.origin,{body:new ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!e}),o0=64*1024,H1=s0&&i0(()=>y.isReadableStream(new Response("").body)),U1={stream:H1&&(u=>u.body)};L1&&(u=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!U1[e]&&(U1[e]=y.isFunction(u[e])?t=>t[e]():(t,r)=>{throw new _(`Response type '${e}' is not supported`,_.ERR_NOT_SUPPORT,r)})})})(new Response);const Se=async u=>{if(u==null)return 0;if(y.isBlob(u))return u.size;if(y.isSpecCompliantForm(u))return(await new Request(j.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(y.isArrayBufferView(u)||y.isArrayBuffer(u))return u.byteLength;if(y.isURLSearchParams(u)&&(u=u+""),y.isString(u))return(await ge(u)).byteLength},be=async(u,e)=>{const t=y.toFiniteNumber(u.getContentLength());return t??Se(e)},W1={http:J2,xhr:he,fetch:L1&&(async u=>{let{url:e,method:t,data:r,signal:n,cancelToken:s,timeout:i,onDownloadProgress:C,onUploadProgress:w,responseType:o,headers:d,withCredentials:F="same-origin",fetchOptions:S}=r0(u);o=o?(o+"").toLowerCase():"text";let c=de([n,s&&s.toAbortSignal()],i),a;const l=c&&c.unsubscribe&&(()=>{c.unsubscribe()});let h;try{if(w&&we&&t!=="get"&&t!=="head"&&(h=await be(d,r))!==0){let B=new Request(e,{method:"POST",body:r,duplex:"half"}),b;if(y.isFormData(r)&&(b=B.headers.get("content-type"))&&d.setContentType(b),B.body){const[g,R]=Yu(h,x1(u0(w)));r=n0(B.body,o0,g,R)}}y.isString(F)||(F=F?"include":"omit");const f="credentials"in Request.prototype;a=new Request(e,{...S,signal:c,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:f?F:void 0});let p=await fetch(a,S);const m=H1&&(o==="stream"||o==="response");if(H1&&(C||m&&l)){const B={};["status","statusText","headers"].forEach(P=>{B[P]=p[P]});const b=y.toFiniteNumber(p.headers.get("content-length")),[g,R]=C&&Yu(b,x1(u0(C),!0))||[];p=new Response(n0(p.body,o0,g,()=>{R&&R(),l&&l()}),B)}o=o||"text";let D=await U1[y.findKey(U1,o)||"text"](p,u);return!m&&l&&l(),await new Promise((B,b)=>{Zu(B,b,{data:D,headers:V.from(p.headers),status:p.status,statusText:p.statusText,config:u,request:a})})}catch(f){throw l&&l(),f&&f.name==="TypeError"&&/Load failed|fetch/i.test(f.message)?Object.assign(new _("Network Error",_.ERR_NETWORK,u,a),{cause:f.cause||f}):_.from(f,f&&f.code,u,a)}})};y.forEach(W1,(u,e)=>{if(u){try{Object.defineProperty(u,"name",{value:e})}catch{}Object.defineProperty(u,"adapterName",{value:e})}});const a0=u=>`- ${u}`,Re=u=>y.isFunction(u)||u===null||u===!1,A0={getAdapter:u=>{u=y.isArray(u)?u:[u];const{length:e}=u;let t,r;const n={};for(let s=0;s<e;s++){t=u[s];let i;if(r=t,!Re(t)&&(r=W1[(i=String(t)).toLowerCase()],r===void 0))throw new _(`Unknown adapter '${i}'`);if(r)break;n[i||"#"+s]=r}if(!r){const s=Object.entries(n).map(([C,w])=>`adapter ${C} `+(w===!1?"is not supported by the environment":"is not available in the build"));let i=e?s.length>1?`since : `+s.map(a0).join(` `):" "+a0(s[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:W1};function J1(u){if(u.cancelToken&&u.cancelToken.throwIfRequested(),u.signal&&u.signal.aborted)throw new A1(null,u)}function F0(u){return J1(u),u.headers=V.from(u.headers),u.data=V1.call(u,u.transformRequest),["post","put","patch"].indexOf(u.method)!==-1&&u.headers.setContentType("application/x-www-form-urlencoded",!1),A0.getAdapter(u.adapter||C1.adapter)(u).then(function(r){return J1(u),r.data=V1.call(u,u.transformResponse,r),r.headers=V.from(r.headers),r},function(r){return Qu(r)||(J1(u),r&&r.response&&(r.response.data=V1.call(u,u.transformResponse,r.response),r.response.headers=V.from(r.response.headers))),Promise.reject(r)})}const c0="1.10.0",T1={};["object","boolean","number","function","string","symbol"].forEach((u,e)=>{T1[u]=function(r){return typeof r===u||"a"+(e<1?"n ":" ")+u}});const E0={};T1.transitional=function(e,t,r){function n(s,i){return"[Axios v"+c0+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,C)=>{if(e===!1)throw new _(n(i," has been removed"+(t?" in "+t:"")),_.ERR_DEPRECATED);return t&&!E0[i]&&(E0[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,i,C):!0}},T1.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ve(u,e,t){if(typeof u!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const r=Object.keys(u);let n=r.length;for(;n-- >0;){const s=r[n],i=e[s];if(i){const C=u[s],w=C===void 0||i(C,s,u);if(w!==!0)throw new _("option "+s+" must be "+w,_.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new _("Unknown option "+s,_.ERR_BAD_OPTION)}}const _1={assertOptions:ve,validators:T1},K=_1.validators;let s1=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ju,response:new Ju}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const s=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+s):r.stack=s}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=n1(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;r!==void 0&&_1.assertOptions(r,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1),n!=null&&(y.isFunction(n)?t.paramsSerializer={serialize:n}:_1.assertOptions(n,{encode:K.function,serialize:K.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),_1.assertOptions(t,{baseUrl:K.spelling("baseURL"),withXsrfToken:K.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&y.merge(s.common,s[t.method]);s&&y.forEach(["delete","get","head","post","put","patch","common"],a=>{delete s[a]}),t.headers=V.concat(i,s);const C=[];let w=!0;this.interceptors.request.forEach(function(l){typeof l.runWhen=="function"&&l.runWhen(t)===!1||(w=w&&l.synchronous,C.unshift(l.fulfilled,l.rejected))});const o=[];this.interceptors.response.forEach(function(l){o.push(l.fulfilled,l.rejected)});let d,F=0,S;if(!w){const a=[F0.bind(this),void 0];for(a.unshift.apply(a,C),a.push.apply(a,o),S=a.length,d=Promise.resolve(t);F<S;)d=d.then(a[F++],a[F++]);return d}S=C.length;let c=t;for(F=0;F<S;){const a=C[F++],l=C[F++];try{c=a(c)}catch(h){l.call(this,h);break}}try{d=F0.call(this,c)}catch(a){return Promise.reject(a)}for(F=0,S=o.length;F<S;)d=d.then(o[F++],o[F++]);return d}getUri(e){e=n1(this.defaults,e);const t=e0(e.baseURL,e.url,e.allowAbsoluteUrls);return Wu(t,e.params,e.paramsSerializer)}};y.forEach(["delete","get","head","options"],function(e){s1.prototype[e]=function(t,r){return this.request(n1(r||{},{method:e,url:t,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(e){function t(r){return function(s,i,C){return this.request(n1(C||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}s1.prototype[e]=t(),s1.prototype[e+"Form"]=t(!0)});let Pe=class X0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const r=this;this.promise.then(n=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](n);r._listeners=null}),this.promise.then=n=>{let s;const i=new Promise(C=>{r.subscribe(C),s=C}).then(n);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,C){r.reason||(r.reason=new A1(s,i,C),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new X0(function(n){e=n}),cancel:e}}};function xe(u){return function(t){return u.apply(null,t)}}function Le(u){return y.isObject(u)&&u.isAxiosError===!0}const G1={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(G1).forEach(([u,e])=>{G1[e]=u});function l0(u){const e=new s1(u),t=Lu(s1.prototype.request,e);return y.extend(t,s1.prototype,e,{allOwnKeys:!0}),y.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return l0(n1(u,n))},t}const q=l0(C1);q.Axios=s1,q.CanceledError=A1,q.CancelToken=Pe,q.isCancel=Qu,q.VERSION=c0,q.toFormData=v1,q.AxiosError=_,q.Cancel=q.CanceledError,q.all=function(e){return Promise.all(e)},q.spread=xe,q.isAxiosError=Le,q.mergeConfig=n1,q.AxiosHeaders=V,q.formToJSON=u=>Ku(y.isHTMLForm(u)?new FormData(u):u),q.getAdapter=A0.getAdapter,q.HttpStatusCode=G1,q.default=q;const{Axios:I3,AxiosError:O3,CanceledError:N3,isCancel:q3,CancelToken:k3,VERSION:$3,all:z3,Cancel:j3,isAxiosError:M3,spread:V3,toFormData:H3,AxiosHeaders:Ue,HttpStatusCode:W3,formToJSON:J3,getAdapter:G3,mergeConfig:K3}=q;var K1,f0;function Te(){return f0||(f0=1,K1=typeof self=="object"?self.FormData:window.FormData),K1}var _e=Te();const Ie=c1(_e);function X1(u){const e=new Ie;if(typeof u=="string")return e.append("image",u),e;for(const[t,r]of Object.entries(u)){const n=["base64","stream"];n.indexOf(t)!==-1?n.indexOf(u.type)!==-1&&e.append(t,u):r&&e.append(t,r)}return e.getHeaders=e.getHeaders?e.getHeaders:()=>({"Content-Type":"multipart/form-data"}),e}function H(u){let e=!0,t=new Ue(u?.headers??{}),r,n=200;const s=u&&(typeof u.status<"u"||typeof u.data?.status<"u")&&typeof u.data<"u",i=s&&!!u.data.success,C=s&&!i&&(typeof u.data.data?.error<"u"||typeof u.data.errors<"u"),w=o=>Array.isArray(o)?o.map(d=>C?d.detail:d.data):o;return typeof u>"u"?(r="response was empty",n=500,e=!1):typeof u=="string"?(r=u,n=500,e=!1):i?(n=u.data.status,t=u.headers,r=u.data.data.error?u.data.data.error:u.data.data):(e=!1,n=u.data.data?.error?.code??u.status??u.data.status,t=u.headers,r=w(C?u.data.errors??u.data.data.error.message??u.data.data.error:u.data.data??u.data.message??u.data)),{headers:t,data:r,status:n,success:e}}function Oe(u){return typeof u=="object"&&u!==null&&("path"in u||"name"in u)}async function Ne(u,e){const t=`${l1}/${e}`;return H(await u.request({url:t,method:"DELETE"}).catch(r=>r.response))}async function qe(u,e){const t=`${l1}/${e}/favorite`;return H(await u.request({url:t,method:"POST"}).catch(r=>r.response))}async function ke(u,e){const t=`${l1}/${e}`;return H(await u.request({url:t}).catch(r=>r.response))}function $e(u){return typeof u.title=="string"||typeof u.description=="string"}async function ze(u,e){if(!$e(e))throw new Error("Update requires a title and/or description");const t=`${l1}/${e.imageHash}`,r=X1(e);return new Promise(async n=>n(H(await u.request({url:t,method:"POST",data:r,headers:r.getHeaders()}).catch(s=>s.response))))}async function je(u,e){const t=X1(e),r=e.image,n=typeof r=="string"?r:Oe(r)?r.path??r.name:"",i=e.type==="stream"&&n&&(n.indexOf(".mp4")!==-1||n.indexOf(".avi")!==-1)?n2:l1;return new Promise(async C=>C(H(await u.request({url:i,method:"POST",data:t,headers:t.getHeaders(),onUploadProgress:w=>{u.emit("uploadProgress",{...w})}}).catch(w=>w.response))))}var z={},I1={},Q1={},Z1={},D0;function Y1(){return D0||(D0=1,function(u){function e(f,p,m){return m.globals&&(f=m.globals[f.name]),new f(`${m.context?m.context:"Value"} ${p}.`)}function t(f,p){if(typeof f=="bigint")throw e(TypeError,"is a BigInt which cannot be converted to a number",p);return p.globals?p.globals.Number(f):Number(f)}function r(f){return f>0&&f%1===.5&&(f&1)===0||f<0&&f%1===-.5&&(f&1)===1?C(Math.floor(f)):C(Math.round(f))}function n(f){return C(Math.trunc(f))}function s(f){return f<0?-1:1}function i(f,p){const m=f%p;return s(p)!==s(m)?m+p:m}function C(f){return f===0?0:f}function w(f,{unsigned:p}){let m,D;p?(m=0,D=2**f-1):(m=-(2**(f-1)),D=2**(f-1)-1);const B=2**f,b=2**(f-1);return(g,R={})=>{let P=t(g,R);if(P=C(P),R.enforceRange){if(!Number.isFinite(P))throw e(TypeError,"is not a finite number",R);if(P=n(P),P<m||P>D)throw e(TypeError,`is outside the accepted range of ${m} to ${D}, inclusive`,R);return P}return!Number.isNaN(P)&&R.clamp?(P=Math.min(Math.max(P,m),D),P=r(P),P):!Number.isFinite(P)||P===0?0:(P=n(P),P>=m&&P<=D?P:(P=i(P,B),!p&&P>=b?P-B:P))}}function o(f,{unsigned:p}){const m=Number.MAX_SAFE_INTEGER,D=p?0:Number.MIN_SAFE_INTEGER,B=p?BigInt.asUintN:BigInt.asIntN;return(b,g={})=>{let R=t(b,g);if(R=C(R),g.enforceRange){if(!Number.isFinite(R))throw e(TypeError,"is not a finite number",g);if(R=n(R),R<D||R>m)throw e(TypeError,`is outside the accepted range of ${D} to ${m}, inclusive`,g);return R}if(!Number.isNaN(R)&&g.clamp)return R=Math.min(Math.max(R,D),m),R=r(R),R;if(!Number.isFinite(R)||R===0)return 0;let P=BigInt(n(R));return P=B(f,P),Number(P)}}u.any=f=>f,u.undefined=()=>{},u.boolean=f=>!!f,u.byte=w(8,{unsigned:!1}),u.octet=w(8,{unsigned:!0}),u.short=w(16,{unsigned:!1}),u["unsigned short"]=w(16,{unsigned:!0}),u.long=w(32,{unsigned:!1}),u["unsigned long"]=w(32,{unsigned:!0}),u["long long"]=o(64,{unsigned:!1}),u["unsigned long long"]=o(64,{unsigned:!0}),u.double=(f,p={})=>{const m=t(f,p);if(!Number.isFinite(m))throw e(TypeError,"is not a finite floating-point value",p);return m},u["unrestricted double"]=(f,p={})=>t(f,p),u.float=(f,p={})=>{const m=t(f,p);if(!Number.isFinite(m))throw e(TypeError,"is not a finite floating-point value",p);if(Object.is(m,-0))return m;const D=Math.fround(m);if(!Number.isFinite(D))throw e(TypeError,"is outside the range of a single-precision floating-point value",p);return D},u["unrestricted float"]=(f,p={})=>{const m=t(f,p);return isNaN(m)||Object.is(m,-0)?m:Math.fround(m)},u.DOMString=(f,p={})=>{if(p.treatNullAsEmptyString&&f===null)return"";if(typeof f=="symbol")throw e(TypeError,"is a symbol, which cannot be converted to a string",p);return(p.globals?p.globals.String:String)(f)},u.ByteString=(f,p={})=>{const m=u.DOMString(f,p);let D;for(let B=0;(D=m.codePointAt(B))!==void 0;++B)if(D>255)throw e(TypeError,"is not a valid ByteString",p);return m},u.USVString=(f,p={})=>{const m=u.DOMString(f,p),D=m.length,B=[];for(let b=0;b<D;++b){const g=m.charCodeAt(b);if(g<55296||g>57343)B.push(String.fromCodePoint(g));else if(56320<=g&&g<=57343)B.push(String.fromCodePoint(65533));else if(b===D-1)B.push(String.fromCodePoint(65533));else{const R=m.charCodeAt(b+1);if(56320<=R&&R<=57343){const P=g&1023,x=R&1023;B.push(String.fromCodePoint(65536+1024*P+x)),++b}else B.push(String.fromCodePoint(65533))}}return B.join("")},u.object=(f,p={})=>{if(f===null||typeof f!="object"&&typeof f!="function")throw e(TypeError,"is not an object",p);return f};const d=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,F=typeof SharedArrayBuffer=="function"?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function S(f){try{return d.call(f),!0}catch{return!1}}function c(f){try{return F.call(f),!0}catch{return!1}}function a(f){try{return new Uint8Array(f),!1}catch{return!0}}u.ArrayBuffer=(f,p={})=>{if(!S(f))throw p.allowShared&&!c(f)?e(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",p):e(TypeError,"is not an ArrayBuffer",p);if(a(f))throw e(TypeError,"is a detached ArrayBuffer",p);return f};const l=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;u.DataView=(f,p={})=>{try{l.call(f)}catch{throw e(TypeError,"is not a DataView",p)}if(!p.allowShared&&c(f.buffer))throw e(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",p);if(a(f.buffer))throw e(TypeError,"is backed by a detached ArrayBuffer",p);return f};const h=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach(f=>{const{name:p}=f,m=/^[AEIOU]/u.test(p)?"an":"a"