let e=function(e){return e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media",e}({}),t=function(e){return e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements",e}({});class n{static INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}};static TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}};static SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}};static RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}};static PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}};static FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}};static SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}};static COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}};static RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}};static COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}};static VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}};static PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}};static ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}}}const r="\r\n";function o(e,t){const n=[],o=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),s={"Content-Type":`multipart/mixed; boundary=${o}`};n.push(function(e,t){return[`--${t}`,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(r)+r}(e,o));const i=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const s=i[t];n.push(function(e,t){return[`--${t}`,`Content-Type: ${e.contentType}`,"Content-Transfer-Encoding: binary",`X-Experience-API-Hash: ${e.sha2}`].join(r)+r+r}(s,o)),n.push(e)})),n.push(`${r}--${o}--${r}`),{header:s,blob:new Blob(n)}}function s(e){const t={};if(-1===e.indexOf("?"))return t;let n=e.substring(e.indexOf("?"));n=n.split("#").shift();return new URLSearchParams(n).forEach(((e,n)=>{try{t[n]=JSON.parse(e)}catch{t[n]=e}var r;"actor"===n&&"object"==typeof t.actor&&(t.actor=(r=t.actor,["name","mbox","account"].forEach((e=>{Array.isArray(r[e])&&(r[e]="account"===e?{...!!r.account[0].accountServiceHomePage&&{homePage:r.account[0].accountServiceHomePage},...!!r.account[0].accountName&&{name:r.account[0].accountName}}:r[e][0])})),r))})),t}const i=6e4,a=36e5,c=864e5;function u(e,t){const n=t.getTime()-e.getTime();if(n<=0)return"PT0S";const r=Math.floor(n/c),o=n%c,s=Math.floor(o/a),u=o%a,l=Math.floor(u/i),d=u%i/1e3;return`P${r?r+"D":""}T${s?s+"H":""}${l?l+"M":""}${d?d+"S":""}`}function l(e,t){return function(){return e.apply(t,arguments)}}const{toString:d}=Object.prototype,{getPrototypeOf:f}=Object,{iterator:p,toStringTag:h}=Symbol,m=(g=Object.create(null),e=>{const t=d.call(e);return g[t]||(g[t]=t.slice(8,-1).toLowerCase())});var g;const y=e=>(e=e.toLowerCase(),t=>m(t)===e),b=e=>t=>typeof t===e,{isArray:E}=Array,R=b("undefined");function O(e){return null!==e&&!R(e)&&null!==e.constructor&&!R(e.constructor)&&S(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const T=y("ArrayBuffer");const w=b("string"),S=b("function"),v=b("number"),A=e=>null!==e&&"object"==typeof e,P=e=>{if("object"!==m(e))return!1;const t=f(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||h in e||p in e)},C=y("Date"),I=y("File"),_=y("Blob"),N=y("FileList");const x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},q=void 0!==x.FormData?x.FormData:void 0,U=y("URLSearchParams"),[j,D,L,B]=["ReadableStream","Request","Response","Headers"].map(y);function F(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),E(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$=e=>!R(e)&&e!==M;const H=(z="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>z&&e instanceof z);var z;const V=y("HTMLFormElement"),J=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),W=y("RegExp"),K=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};F(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)};const G=y("AsyncFunction"),X=(Y="function"==typeof setImmediate,Q=S(M.postMessage),Y?setImmediate:Q?(Z=`axios@${Math.random()}`,ee=[],M.addEventListener("message",(({source:e,data:t})=>{e===M&&t===Z&&ee.length&&ee.shift()()}),!1),e=>{ee.push(e),M.postMessage(Z,"*")}):e=>setTimeout(e));var Y,Q,Z,ee;const te="undefined"!=typeof queueMicrotask?queueMicrotask.bind(M):"undefined"!=typeof process&&process.nextTick||X;var ne={isArray:E,isArrayBuffer:T,isBuffer:O,isFormData:e=>{if(!e)return!1;if(q&&e instanceof q)return!0;const t=f(e);if(!t||t===Object.prototype)return!1;if(!S(e.append))return!1;const n=m(e);return"formdata"===n||"object"===n&&S(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&T(e.buffer),t},isString:w,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:A,isPlainObject:P,isEmptyObject:e=>{if(!A(e)||O(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:j,isRequest:D,isResponse:L,isHeaders:B,isUndefined:R,isDate:C,isFile:I,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:_,isRegExp:W,isFunction:S,isStream:e=>A(e)&&S(e.pipe),isURLSearchParams:U,isTypedArray:H,isFileList:N,forEach:F,merge:function e(){const{caseless:t,skipUndefined:n}=$(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&k(r,s)||s;P(r[i])&&P(o)?r[i]=e(r[i],o):P(o)?r[i]=e({},o):E(o)?r[i]=o.slice():n&&R(o)||(r[i]=o)};for(let e=0,t=arguments.length;e(F(t,((t,r)=>{n&&S(t)?Object.defineProperty(e,r,{value:l(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:m,kindOfTest:y,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(E(e))return e;let t=e.length;if(!v(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[p]).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:V,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:K,freezeMethods:e=>{K(e,((t,n)=>{if(S(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];S(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 E(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:k,global:M,isContextDefined:$,isSpecCompliantForm:function(e){return!!(e&&S(e.append)&&"FormData"===e[h]&&e[p])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(A(e)){if(t.indexOf(e)>=0)return;if(O(e))return e;if(!("toJSON"in e)){t[r]=e;const o=E(e)?[]:{};return F(e,((e,t)=>{const s=n(e,r+1);!R(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:G,isThenable:e=>e&&(A(e)||S(e))&&S(e.then)&&S(e.catch),setImmediate:X,asap:te,isIterable:e=>null!=e&&S(e[p])};class re extends Error{static from(e,t,n,r,o,s){const i=new re(e.message,t||e.code,n,r,o);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ne.toJSONObject(this.config),code:this.code,status:this.status}}}re.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",re.ERR_BAD_OPTION="ERR_BAD_OPTION",re.ECONNABORTED="ECONNABORTED",re.ETIMEDOUT="ETIMEDOUT",re.ERR_NETWORK="ERR_NETWORK",re.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",re.ERR_DEPRECATED="ERR_DEPRECATED",re.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",re.ERR_BAD_REQUEST="ERR_BAD_REQUEST",re.ERR_CANCELED="ERR_CANCELED",re.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",re.ERR_INVALID_URL="ERR_INVALID_URL",re.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function oe(e){return ne.isPlainObject(e)||ne.isArray(e)}function se(e){return ne.endsWith(e,"[]")?e.slice(0,-2):e}function ie(e,t,n){return e?e.concat(t).map((function(e,t){return e=se(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ae=ne.toFlatObject(ne,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ce(e,t,n){if(!ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ne.isUndefined(t[e])}))).metaTokens,o=n.visitor||d,s=n.dots,i=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=a&&ne.isSpecCompliantForm(t);if(!ne.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(ne.isDate(e))return e.toISOString();if(ne.isBoolean(e))return e.toString();if(!u&&ne.isBlob(e))throw new re("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(e)||ne.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,o){let a=e;if(ne.isReactNative(t)&&ne.isReactNativeBlob(e))return t.append(ie(o,n,s),l(e)),!1;if(e&&!o&&"object"==typeof e)if(ne.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ne.isArray(e)&&function(e){return ne.isArray(e)&&!e.some(oe)}(e)||(ne.isFileList(e)||ne.endsWith(n,"[]"))&&(a=ne.toArray(e)))return n=se(n),a.forEach((function(e,r){!ne.isUndefined(e)&&null!==e&&t.append(!0===i?ie([n],r,s):null===i?n:n+"[]",l(e))})),!1;return!!oe(e)||(t.append(ie(o,n,s),l(e)),!1)}const f=[],p=Object.assign(ae,{defaultVisitor:d,convertValue:l,isVisitable:oe});if(!ne.isObject(e))throw new TypeError("data must be an object");return function e(n,r,s=0){if(!ne.isUndefined(n)){if(s>c)throw new re("Object is too deeply nested ("+s+" levels). Max depth: "+c,re.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),ne.forEach(n,(function(n,i){!0===(!(ne.isUndefined(n)||null===n)&&o.call(t,n,ne.isString(i)?i.trim():i,r,p))&&e(n,r?r.concat(i):[i],s+1)})),f.pop()}}(e),t}function ue(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function le(e,t){this._pairs=[],e&&ce(e,this,t)}const de=le.prototype;function fe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function pe(e,t,n){if(!t)return e;const r=n&&n.encode||fe,o=ne.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):ne.isURLSearchParams(t)?t.toString():new le(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}de.append=function(e,t){this._pairs.push([e,t])},de.toString=function(e){const t=e?function(t){return e.call(this,t,ue)}:ue;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class he{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){ne.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ge={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:le,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ye="undefined"!=typeof window&&"undefined"!=typeof document,be="object"==typeof navigator&&navigator||void 0,Ee=ye&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),Re="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Oe=ye&&window.location.href||"http://localhost";var Te={...Object.freeze({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:Ee,hasStandardBrowserWebWorkerEnv:Re,navigator:be,origin:Oe}),...ge};function we(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&&ne.isArray(r)?r.length:s,a)return ne.hasOwnProp(r,s)?r[s]=ne.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i;r[s]&&ne.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&ne.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{t(function(e){return ne.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const Se=(e,t)=>null!=e&&ne.hasOwnProp(e,t)?e[t]:void 0;const ve={transitional:me,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ne.isObject(e);o&&ne.isHTMLForm(e)&&(e=new FormData(e));if(ne.isFormData(e))return r?JSON.stringify(we(e)):e;if(ne.isArrayBuffer(e)||ne.isBuffer(e)||ne.isStream(e)||ne.isFile(e)||ne.isBlob(e)||ne.isReadableStream(e))return e;if(ne.isArrayBufferView(e))return e.buffer;if(ne.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Se(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ce(e,new Te.classes.URLSearchParams,{visitor:function(e,t,n,r){return Te.isNode&&ne.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=ne.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Se(this,"env"),r=n&&n.FormData;return ce(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t){if(ne.isString(e))try{return(t||JSON.parse)(e),ne.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Se(this,"transitional")||ve.transitional,n=t&&t.forcedJSONParsing,r=Se(this,"responseType"),o="json"===r;if(ne.isResponse(e)||ne.isReadableStream(e))return e;if(e&&ne.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Se(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw re.from(e,re.ERR_BAD_RESPONSE,this,null,Se(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Te.classes.FormData,Blob:Te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],(e=>{ve.headers[e]={}}));const Ae=ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Pe=Symbol("internals"),Ce=/[^\x09\x20-\x7E\x80-\xFF]/g;function Ie(e){return e&&String(e).trim().toLowerCase()}function _e(e){return!1===e||null==e?e:ne.isArray(e)?e.map(_e):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(Ce,""))}function Ne(e,t,n,r,o){return ne.isFunction(r)?r.call(this,t,n):(o&&(t=n),ne.isString(t)?ne.isString(r)?-1!==t.indexOf(r):ne.isRegExp(r)?r.test(t):void 0:void 0)}class xe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ie(t);if(!o)throw new Error("header name must be a non-empty string");const s=ne.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=_e(e))}const s=(e,t)=>ne.forEach(e,((e,n)=>o(e,n,t)));if(ne.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(ne.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]&&Ae[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(ne.isObject(e)&&ne.isIterable(e)){let n,r,o={};for(const t of e){if(!ne.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?ne.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=Ie(e)){const n=ne.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(ne.isFunction(t))return t.call(this,e,n);if(ne.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ie(e)){const n=ne.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ne(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ie(e)){const o=ne.findKey(n,e);!o||t&&!Ne(0,n[o],o,t)||(delete n[o],r=!0)}}return ne.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&&!Ne(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ne.forEach(this,((r,o)=>{const s=ne.findKey(n,o);if(s)return t[s]=_e(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]=_e(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ne.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ne.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[Pe]=this[Pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ie(e);t[r]||(!function(e,t){const n=ne.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 ne.isArray(e)?e.forEach(r):r(e),this}}function qe(e,t){const n=this||ve,r=t||n,o=xe.from(r.headers);let s=r.data;return ne.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Ue(e){return!(!e||!e.__CANCEL__)}xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ne.reduceDescriptors(xe.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ne.freezeMethods(xe);class je extends re{constructor(e,t,n){super(null==e?"canceled":e,re.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}function De(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Le=(e,t,n=3)=>{let r=0;const o=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,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=null!=i?Math.min(s,i):s,c=Math.max(0,a-r),u=o(c);r=Math.max(r,a);e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i?(i-a)/u:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},Be=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fe=e=>(...t)=>ne.asap((()=>e(...t)));var ke=Te.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Te.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,Me=Te.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];ne.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),ne.isString(r)&&a.push(`path=${r}`),ne.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),ne.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function $e(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const He=e=>e instanceof xe?{...e}:e;function ze(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return ne.isPlainObject(e)&&ne.isPlainObject(t)?ne.merge.call({caseless:r},e,t):ne.isPlainObject(t)?ne.merge({},t):ne.isArray(t)?t.slice():t}function o(e,t,n,o){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!ne.isUndefined(t))return r(void 0,t)}function i(e,t){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return ne.hasOwnProp(t,s)?r(n,o):ne.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(He(e),He(t),0,!0)};return ne.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=ne.hasOwnProp(c,r)?c[r]:o,i=s(ne.hasOwnProp(e,r)?e[r]:void 0,ne.hasOwnProp(t,r)?t[r]:void 0,r);ne.isUndefined(i)&&s!==a||(n[r]=i)})),n}var Ve=e=>{const t=ze({},e),n=e=>ne.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),u=n("baseURL"),l=n("allowAbsoluteUrls"),d=n("url");if(t.headers=a=xe.from(a),t.url=pe($e(u,d,l),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ne.isFormData(r))if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ne.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)}))}if(Te.hasStandardBrowserEnv){ne.isFunction(o)&&(o=o(t));if(!0===o||null==o&&ke(t.url)){const e=s&&i&&Me.read(i);e&&a.set(s,e)}}return t};var Je="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ve(e);let o=r.data;const s=xe.from(r.headers).normalize();let i,a,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=xe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());De((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new re("Request aborted",re.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new re(r,re.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||me;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new re(t,o.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&ne.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),ne.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,l]=Le(p,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,u]=Le(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new je(null,e,m):t),m.abort(),m=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===Te.protocols.indexOf(y)?n(new re("Unsupported protocol "+y+":",re.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const We=(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 re?t:new je(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new re(`timeout of ${t}ms exceeded`,re.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=()=>ne.asap(i),a}},Ke=function*(e,t){let n=e.byteLength;if(n{const o=async function*(e,t){for await(const n of Ge(e))yield*Ke(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ye}=ne,Qe=(({Request:e,Response:t})=>({Request:e,Response:t}))(ne.global),{ReadableStream:Ze,TextEncoder:et}=ne.global,tt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nt=e=>{e=ne.merge.call({skipUndefined:!0},Qe,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ye(t):"function"==typeof fetch,s=Ye(n),i=Ye(r);if(!o)return!1;const a=o&&Ye(Ze),c=o&&("function"==typeof et?(u=new et,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=s&&a&&tt((()=>{let e=!1;const t=new n(Te.origin,{body:new Ze,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),d=i&&a&&tt((()=>ne.isReadableStream(new r("").body))),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new re(`Response type '${e}' is not supported`,re.ERR_NOT_SUPPORT,n)})}));const p=async(e,t)=>{const r=ne.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(ne.isBlob(e))return e.size;if(ne.isSpecCompliantForm(e)){const t=new n(Te.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ne.isArrayBufferView(e)||ne.isArrayBuffer(e)?e.byteLength:(ne.isURLSearchParams(e)&&(e+=""),ne.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:b,withCredentials:E="same-origin",fetchOptions:R}=Ve(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let T=We([c,u&&u.toAbortSignal()],h),w=null;const S=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let v;try{if(g&&l&&"get"!==i&&"head"!==i&&0!==(v=await p(b,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(ne.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Be(v,Le(Fe(g)));a=Xe(t.body,65536,e,n)}}ne.isString(E)||(E=E?"include":"omit");const t=s&&"credentials"in n.prototype;if(ne.isFormData(a)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}const c={...R,signal:T,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?E:void 0};w=s&&new n(o,c);let u=await(s?O(w,R):O(o,c));const h=d&&("stream"===y||"response"===y);if(d&&(m||h&&S)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=ne.toFiniteNumber(u.headers.get("content-length")),[n,o]=m&&Be(t,Le(Fe(m),!0))||[];u=new r(Xe(u.body,65536,n,(()=>{o&&o(),S&&S()})),e)}y=y||"text";let A=await f[ne.findKey(f,y)||"text"](u,e);return!h&&S&&S(),await new Promise(((t,n)=>{De(t,n,{data:A,headers:xe.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:w})}))}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new re("Network Error",re.ERR_NETWORK,e,w,t&&t.response),{cause:t.cause||t});throw re.from(t,t&&t.code,e,w,t&&t.response)}}},rt=new Map,ot=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,u=rt;for(;c--;)i=s[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:nt(t)),u=a;return a};ot();const st={http:null,xhr:Je,fetch:{get:ot}};ne.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=>ne.isFunction(e)||null===e||!1===e;var ct={getAdapter:function(e,t){e=ne.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(it).join("\n"):" "+it(e[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:st};function ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new je(null,e)}function lt(e){ut(e),e.headers=xe.from(e.headers),e.data=qe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ct.getAdapter(e.adapter||ve.adapter,e)(e).then((function(t){return ut(e),t.data=qe.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Ue(t)||(ut(e),t&&t.response&&(t.response.data=qe.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}const dt="1.15.2",ft={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ft[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const pt={};ft.transitional=function(e,t,n){function r(e,t){return"[Axios v"+dt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new re(r(o," has been removed"+(t?" in "+t:"")),re.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)}},ft.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ht={assertOptions:function(e,t,n){if("object"!=typeof e)throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new re("option "+s+" must be "+n,re.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new re("Unknown option "+s,re.ERR_BAD_OPTION)}},validators:ft};const mt=ht.validators;class gt{constructor(e){this.defaults=e||{},this.interceptors={request:new he,response:new he}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ze(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ht.assertOptions(n,{silentJSONParsing:mt.transitional(mt.boolean),forcedJSONParsing:mt.transitional(mt.boolean),clarifyTimeoutError:mt.transitional(mt.boolean),legacyInterceptorReqResOrdering:mt.transitional(mt.boolean)},!1),null!=r&&(ne.isFunction(r)?t.paramsSerializer={serialize:r}:ht.assertOptions(r,{encode:mt.function,serialize:mt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ht.assertOptions(t,{baseUrl:mt.spelling("baseURL"),withXsrfToken:mt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&ne.merge(o.common,o[t.method]);o&&ne.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=xe.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||me;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[lt.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);d{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 je(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={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(bt).forEach((([e,t])=>{bt[t]=e}));const Et=function e(t){const n=new gt(t),r=l(gt.prototype.request,n);return ne.extend(r,gt.prototype,n,{allOwnKeys:!0}),ne.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ze(t,n))},r}(ve);Et.Axios=gt,Et.CanceledError=je,Et.CancelToken=yt,Et.isCancel=Ue,Et.VERSION=dt,Et.toFormData=ce,Et.AxiosError=re,Et.Cancel=Et.CanceledError,Et.all=function(e){return Promise.all(e)},Et.spread=function(e){return function(t){return e.apply(null,t)}},Et.isAxiosError=function(e){return ne.isObject(e)&&!0===e.isAxiosError},Et.mergeConfig=ze,Et.AxiosHeaders=xe,Et.formToJSON=e=>we(ne.isHTMLForm(e)?new FormData(e):e),Et.getAdapter=ct.getAdapter,Et.HttpStatusCode=bt,Et.default=Et;const Rt=({url:e,method:t,data:n,headers:r})=>Et.request({url:e,method:t,data:n,headers:r}).then((({data:e,headers:t,status:n})=>({data:e,headers:t,status:n}))),Ot=async({url:e,method:t,data:n,headers:r})=>{let o=n;"application/json"===r["Content-Type"]&&(o=JSON.stringify(o));const s=await fetch(e,{method:t,body:o,headers:r});if(!s.ok){const e=await s.text();throw new Error(e)}let i=await s.text();try{i=JSON.parse(i)}catch{}return{data:i,headers:Object.fromEntries(s.headers.entries()),status:s.status}},Tt=e=>"function"==typeof e?e:"fetch"===e?Ot:Rt;function wt(e){if("undefined"==typeof location)return Promise.reject(new Error("Environment does not support location.search"));const t=s(location.search);if(!t.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const n=new URL(t.xAPILaunchService);n.pathname+=`launch/${t.xAPILaunchKey}`;return Tt(e.adapter)({method:"POST",url:n.toString()}).then((e=>e.data))}function St(){if("undefined"==typeof location)throw new Error("Environment does not support location.search");return s(location.search)}function vt(e,t){const n=`${e}:${t}`;if("function"==typeof btoa)return`Basic ${btoa(n)}`;if("undefined"!=typeof Buffer)return`Basic ${Buffer.from(n,"binary").toString("base64")}`;throw new Error("Environment does not support base64 conversion.")}class At{static default=At;static AttachmentUsages=e;static Verbs=n;static calculateISO8601Duration=u;static getSearchQueryParamsAsObject=s;static getXAPILaunchData=wt;static getTinCanLaunchData=St;static toBasicAuth=vt;constructor(e){const t=e.version||"1.0.3";var n;this.endpoint=(n=e.endpoint).endsWith("/")?n:`${n}/`,this.headers={"X-Experience-API-Version":t,"Content-Type":"application/json",Authorization:e.auth?e.auth:vt("","")},this.adapter=Tt(e.adapter)}requestResource(e){var t;const n=Object.assign({},e.queryParams);null!==(t=e.requestOptions)&&void 0!==t&&t.useCacheBuster&&(n.cachebuster=(new Date).getTime().toString());const r=this.generateURL(e.resource,n);return this.requestURL(r,e.requestConfig)}requestURL(e,t){return this.adapter({url:e,method:(null==t?void 0:t.method)||"GET",headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(r)[0].trim(),n=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),o=[];for(let e=0;e-1&&(i=JSON.parse(i)),o.push(i)}return o}(e.data)),e}))}generateURL(e,t){const n=Object.keys(t).map((e=>{let n="object"==typeof t[e]?JSON.stringify(t[e]):t[e];return n=encodeURIComponent(n),`${e}=${n}`})).join("&");return`${this.endpoint}${e}${n?"?"+n:""}`}}At.prototype.getAbout=function(e){return this.requestResource({resource:t.ABOUT,requestOptions:{useCacheBuster:null==e?void 0:e.useCacheBuster}})},At.prototype.getActivity=function(e){return this.requestResource({resource:t.ACTIVITIES,queryParams:{activityId:e.activityId},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getAgent=function(e){return this.requestResource({resource:t.AGENTS,queryParams:{agent:e.agent},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.createActivityProfile=function(e){const n={};return e.etag&&(n[e.matchHeader]=e.etag),this.requestResource({resource:t.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"POST",data:e.profile,headers:n}})},At.prototype.setActivityProfile=function(e){const n={};return n[e.matchHeader]=e.etag,e.contentType&&(n["Content-Type"]=e.contentType),this.requestResource({resource:t.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"PUT",data:e.profile,headers:n}})},At.prototype.getActivityProfiles=function(e){return this.requestResource({resource:t.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getActivityProfile=function(e){return this.requestResource({resource:t.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.deleteActivityProfile=function(e){const n={};return e.etag&&(n["If-Match"]=e.etag),this.requestResource({resource:t.ACTIVITY_PROFILE,queryParams:{activityId:e.activityId,profileId:e.profileId},requestConfig:{method:"DELETE",headers:n}})},At.prototype.createAgentProfile=function(e){const n={};return e.etag&&(n[e.matchHeader]=e.etag),this.requestResource({resource:t.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"POST",data:e.profile,headers:n}})},At.prototype.setAgentProfile=function(e){const n={};return n[e.matchHeader]=e.etag,e.contentType&&(n["Content-Type"]=e.contentType),this.requestResource({resource:t.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"PUT",data:e.profile,headers:n}})},At.prototype.getAgentProfiles=function(e){return this.requestResource({resource:t.AGENT_PROFILE,queryParams:{agent:e.agent,...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getAgentProfile=function(e){return this.requestResource({resource:t.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.deleteAgentProfile=function(e){const n={};return e.etag&&(n["If-Match"]=e.etag),this.requestResource({resource:t.AGENT_PROFILE,queryParams:{agent:e.agent,profileId:e.profileId},requestConfig:{method:"DELETE",headers:n}})},At.prototype.createState=function(e){const n={};return e.etag&&e.matchHeader&&(n[e.matchHeader]=e.etag),this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"POST",data:e.state,headers:n}})},At.prototype.setState=function(e){const n={};return e.etag&&e.matchHeader&&(n[e.matchHeader]=e.etag),e.contentType&&(n["Content-Type"]=e.contentType),this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"PUT",data:e.state,headers:n}})},At.prototype.getStates=function(e){return this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,...!!e.registration&&{registration:e.registration},...!!e.since&&{since:e.since}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getState=function(e){return this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.deleteState=function(e){const n={};return e.etag&&(n["If-Match"]=e.etag),this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,stateId:e.stateId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"DELETE",headers:n}})},At.prototype.deleteStates=function(e){const n={};return e.etag&&(n["If-Match"]=e.etag),this.requestResource({resource:t.STATE,queryParams:{agent:e.agent,activityId:e.activityId,...!!e.registration&&{registration:e.registration}},requestConfig:{method:"DELETE",headers:n}})},At.prototype.getStatement=function(e){return this.requestResource({resource:t.STATEMENT,queryParams:{statementId:e.statementId,...!!e.attachments&&{attachments:e.attachments},...!!e.format&&{format:e.format}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getVoidedStatement=function(e){return this.requestResource({resource:t.STATEMENT,queryParams:{voidedStatementId:e.voidedStatementId,...!!e.attachments&&{attachments:e.attachments},...!!e.format&&{format:e.format}},requestOptions:{useCacheBuster:e.useCacheBuster}})},At.prototype.getStatements=function(e){return this.requestResource({resource:t.STATEMENT,queryParams:{...!(null==e||!e.activity)&&{activity:e.activity},...!(null==e||!e.agent)&&{agent:e.agent},...!(null==e||!e.ascending)&&{ascending:e.ascending},...!(null==e||!e.attachments)&&{attachments:e.attachments},...!(null==e||!e.format)&&{format:e.format},...!(null==e||!e.limit)&&{limit:e.limit},...!(null==e||!e.registration)&&{registration:e.registration},...!(null==e||!e.related_activities)&&{related_activities:e.related_activities},...!(null==e||!e.related_agents)&&{related_agents:e.related_agents},...!(null==e||!e.since)&&{since:e.since},...!(null==e||!e.until)&&{until:e.until},...!(null==e||!e.verb)&&{verb:e.verb}},requestOptions:{useCacheBuster:null==e?void 0:e.useCacheBuster}})},At.prototype.getMoreStatements=function(e){const t=new URL(this.endpoint),n=`${t.protocol}//${t.host}${e.more}`;return this.requestURL(n)},At.prototype.sendStatement=function(e){var n;if(null===(n=e.attachments)||void 0===n?void 0:n.length){const n=o(e.statement,e.attachments);return this.requestResource({resource:t.STATEMENT,requestConfig:{method:"POST",headers:n.header,data:n.blob}})}return this.requestResource({resource:t.STATEMENT,requestConfig:{method:"POST",data:e.statement}})},At.prototype.sendStatements=function(e){var n;if(null===(n=e.attachments)||void 0===n?void 0:n.length){const n=o(e.statements,e.attachments);return this.requestResource({resource:t.STATEMENT,requestConfig:{method:"POST",headers:n.header,data:n.blob}})}return this.requestResource({resource:t.STATEMENT,requestConfig:{method:"POST",data:e.statements}})},At.prototype.voidStatement=function(e){const t={actor:e.actor,verb:n.VOIDED,object:{objectType:"StatementRef",id:e.statementId}};return this.sendStatement({statement:t})},At.prototype.voidStatements=function(e){const t=e.statementIds.map((t=>({actor:e.actor,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements({statements:t})};export{At as default};