@itk-wasm/image-io
Version:
Input and output for scientific and medical image file formats.
6 lines • 243 kB
JavaScript
var gi=Object.defineProperty;var Bi=(A,e)=>{for(var t in e)gi(A,t,{get:e[t],enumerable:!0})};var Ci=new Map([["bmp","bmp"],["dcm","gdcm"],["gipl","gipl"],["gipl.gz","gipl"],["hdf5","hdf5"],["jpg","jpeg"],["jpeg","jpeg"],["iwi","wasm"],["iwi.cbor","wasm"],["iwi.cbor.zst","wasmZstd"],["lsm","lsm"],["mnc","mnc"],["mnc.gz","mnc"],["mnc2","mnc"],["mgh","mgh"],["mgz","mgh"],["mgh.gz","mgh"],["mha","meta"],["mhd","meta"],["mrc","mrc"],["nia","nifti"],["nii","nifti"],["nii.gz","nifti"],["hdr","nifti"],["nrrd","nrrd"],["nhdr","nrrd"],["png","png"],["pic","bioRad"],["tif","tiff"],["tiff","tiff"],["vtk","vtk"],["isq","scanco"],["aim","scanco"],["fdf","fdf"]]),AA=Ci;var li={Int8:"int8",UInt8:"uint8",Int16:"int16",UInt16:"uint16",Int32:"int32",UInt32:"uint32",Int64:"int64",UInt64:"uint64",SizeValueType:"uint64",IdentifierType:"uint64",IndexValueType:"int64",OffsetValueType:"int64"},w=li;var Qi={Float32:"float32",Float64:"float64",SpacePrecisionType:"float64"},S=Qi;function Ei(A,e){let t=null;switch(A){case w.UInt8:{t=new Uint8Array(e);break}case w.Int8:{t=new Int8Array(e);break}case w.UInt16:{t=new Uint16Array(e);break}case w.Int16:{t=new Int16Array(e);break}case w.UInt32:{t=new Uint32Array(e);break}case w.Int32:{t=new Int32Array(e);break}case w.UInt64:{typeof globalThis.BigUint64Array=="function"?t=new BigUint64Array(e):t=new Uint8Array(e);break}case w.Int64:{typeof globalThis.BigInt64Array=="function"?t=new BigInt64Array(e):t=new Uint8Array(e);break}case S.Float32:{t=new Float32Array(e);break}case S.Float64:{t=new Float64Array(e);break}case"null":{t=null;break}case null:{t=null;break}default:throw new Error("Type is not supported as a TypedArray")}return t}var J=Ei;var pi={Unknown:"Unknown",Scalar:"Scalar",RGB:"RGB",RGBA:"RGBA",Offset:"Offset",Vector:"Vector",Point:"Point",CovariantVector:"CovariantVector",SymmetricSecondRankTensor:"SymmetricSecondRankTensor",DiffusionTensor3D:"DiffusionTensor3D",Complex:"Complex",FixedArray:"FixedArray",Array:"Array",Matrix:"Matrix",VariableLengthVector:"VariableLengthVector",VariableSizeMatrix:"VariableSizeMatrix"},LA=pi;var Ie=class{dimension;componentType;pixelType;components;constructor(e=2,t=w.UInt8,r=LA.Scalar,o=1){this.dimension=e,this.componentType=t,this.pixelType=r,this.components=o}},vt=Ie;function mi(A,e,t,r,o){A[r+t*e]=o}var Vt=mi;var se=class{imageType;name="Image";origin;spacing;direction;size;metadata;data;constructor(e=new vt){this.imageType=e;let t=e.dimension;this.origin=new Array(t),this.origin.fill(0),this.spacing=new Array(t),this.spacing.fill(1),this.direction=new Float64Array(t*t),this.direction.fill(0);for(let r=0;r<t;r++)Vt(this.direction,t,r,r,1);this.size=new Array(t),this.size.fill(0),this.metadata=new Map,this.data=null}},iA=se;function ui(A){let e=new iA(A.imageType);if(e.name=A.name,e.origin=Array.from(A.origin),e.spacing=Array.from(A.spacing),e.direction=A.direction.slice(),e.size=Array.from(A.size),A.data!==null){let t=A.data.constructor;e.data=new t(A.data.length),e.data!=null&&e.data.set(A.data,0)}return e}var ge=ui;function fi(A){if(A.length<1)throw Error("At least one images is required.");let e=A[0];if(e.data===null)throw Error("Image data is null.");let t=new iA(e.imageType);t.origin=Array.from(e.origin),t.spacing=Array.from(e.spacing);let r=t.imageType.dimension;t.direction=e.direction.slice();let o=r-1;t.size=Array.from(e.size);let i=A.reduce((a,g)=>a+g.size[o],0);t.size[o]=i;let n=t.size.reduce((a,g)=>a*g,1)*t.imageType.components,C=e.data.constructor;t.data=new C(n);let p=t.imageType.components;for(let a=0;a<t.size.length-1;a++)p*=t.size[a];let B=0;if(t.data!=null)for(let a=0;a<A.length;a++)t.data.set(A[a].data,p*B),B+=A[a].size[o];else throw Error("Could not create result image data.");return t}var Be=fi;function ci(A){let e=A.slice((A.lastIndexOf(".")-1>>>0)+2);if(e.toLowerCase()==="gz"){let t=A.slice(0,-3).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="cbor"){let t=A.slice(0,-5).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="zst"){let t=A.slice(0,-10).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="zip"){let t=A.slice(0,-4).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}return e}var mA=ci;function di(A,e){let t={...A.imageType};if(typeof e<"u"&&typeof e.pixelType<"u"&&(t.pixelType=e.pixelType,e.pixelType===LA.Scalar&&t.components!==1))throw new Error("Cannot cast multi-component image to a scalar image");typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType&&(t.componentType=e.componentType);let r=new iA(t);if(r.name=A.name,r.origin=Array.from(A.origin),r.spacing=Array.from(A.spacing),r.direction=A.direction.slice(),r.size=Array.from(A.size),r.metadata=new Map(JSON.parse(JSON.stringify(Array.from(A.metadata)))),A.data!==null)if(typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType)switch(A.imageType.componentType){case w.UInt8:case w.Int8:case w.UInt16:case w.Int16:case w.UInt32:case w.Int32:case S.Float32:case S.Float64:switch(r.imageType.componentType){case w.UInt8:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Uint8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Uint8Array(A.data);break;case w.Int8:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Int8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Int8Array(A.data);break;case w.UInt16:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Uint16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Uint16Array(A.data);break;case w.Int16:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Int16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Int16Array(A.data);break;case w.UInt32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Uint32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Uint32Array(A.data);break;case w.Int32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Int32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Int32Array(A.data);break;case S.Float32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Float32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Float32Array(A.data);break;case S.Float64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){r.data=new Float64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o])}else r.data=new Float64Array(A.data);break;case w.UInt64:r.data=new BigUint64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asIntN(64,BigInt(A.data[o]));break;case w.Int64:r.data=new BigInt64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asUintN(64,BigInt(A.data[o]));break}break;case w.UInt64:case w.Int64:switch(r.imageType.componentType){case w.UInt8:r.data=new Uint8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.Int8:r.data=new Int8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.UInt16:r.data=new Uint16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.Int16:r.data=new Int16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.UInt32:r.data=new Uint32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.Int32:r.data=new Int32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case S.Float32:r.data=new Float32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case S.Float64:r.data=new Float64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case w.UInt64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array)r.data=new BigUint64Array(A.data);else{r.data=new BigUint64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asUintN(64,BigInt(A.data[o]))}break;case w.Int64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array)r.data=new BigInt64Array(A.data);else{r.data=new BigInt64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asIntN(64,BigInt(A.data[o]))}break}break}else{let o=A.data.constructor;r.data=new o(A.data.length),r.data!=null&&r.data.set(A.data,0)}return r}var Z=di;var Ce=class{fcn;workerQueue;runInfo;constructor(e,t){this.fcn=t,this.workerQueue=new Array(e),this.workerQueue.fill(null),this.runInfo=[]}runTasks(e,t=null){let r={taskQueue:[],results:[],addingTasks:!1,postponed:!1,runningWorkers:0,index:0,completedTasks:0,progressCallback:t,canceled:!1};return this.runInfo.push(r),r.index=this.runInfo.length-1,{promise:new Promise((o,i)=>{r.resolve=o,r.reject=i,r.results=new Array(e.length),r.completedTasks=0,r.addingTasks=!0,e.forEach((n,C)=>{this.addTask(r.index,C,n)}),r.addingTasks=!1}),runId:r.index}}terminateWorkers(){for(let e=0;e<this.workerQueue.length;e++){let t=this.workerQueue[e];t?.terminate(),this.workerQueue[e]=null}}cancel(e){let t=this.runInfo[e];t!=null&&(t.canceled=!0)}addTask(e,t,r){let o=this.runInfo[e];if(o?.canceled===!0){o.reject("Remaining tasks canceled"),this.clearTask(o.index);return}if(this.workerQueue.length>0){let i=this.workerQueue.pop();o.runningWorkers++,r[r.length-1].webWorker=i,this.fcn(...r).then(({webWorker:n,...C})=>{if(this.workerQueue.push(n),this.runInfo[e]!==null){if(o.runningWorkers--,o.results[t]=C,o.completedTasks++,o.progressCallback!=null&&o.progressCallback(o.completedTasks,o.results.length),o.taskQueue.length>0){let p=o.taskQueue.shift();this.addTask(e,p[0],p[1])}else if(!o.addingTasks&&o.runningWorkers===0){let p=o.results;o.resolve(p),this.clearTask(o.index)}}}).catch(n=>{o.reject(n),this.clearTask(o.index)})}else o.runningWorkers!==0||o.postponed?o.taskQueue.push([t,r]):(o.postponed=!0,setTimeout(()=>{o.postponed=!1,this.addTask(o.index,t,r)},50))}clearTask(e){this.runInfo[e].results=[],this.runInfo[e].taskQueue=[],this.runInfo[e].progressCallback=null,this.runInfo[e].canceled=null,this.runInfo[e].reject=()=>{},this.runInfo[e].resolve=()=>{}}},le=Ce;var yi={TextFile:"TextFile",BinaryFile:"BinaryFile",TextStream:"TextStream",BinaryStream:"BinaryStream",Image:"Image",PointSet:"PointSet",Mesh:"Mesh",PolyData:"PolyData",TransformList:"TransformList",JsonCompatible:"JsonCompatible"},l=yi;var zt=Symbol("Comlink.proxy"),hi=Symbol("Comlink.endpoint"),pe=Symbol("Comlink.releaseProxy"),Qe=Symbol("Comlink.finalizer"),PA=Symbol("Comlink.thrown"),_t=A=>typeof A=="object"&&A!==null||typeof A=="function",wi={canHandle:A=>_t(A)&&A[zt],serialize(A){let{port1:e,port2:t}=new MessageChannel;return $t(A,e),[t,[t]]},deserialize(A){return A.start(),me(A)}},Di={canHandle:A=>_t(A)&&PA in A,serialize({value:A}){let e;return A instanceof Error?e={isError:!0,value:{message:A.message,name:A.name,stack:A.stack}}:e={isError:!1,value:A},[e,[]]},deserialize(A){throw A.isError?Object.assign(new Error(A.value.message),A.value):A.value}},Xt=new Map([["proxy",wi],["throw",Di]]);function Ri(A,e){for(let t of A)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function $t(A,e=globalThis,t=["*"]){e.addEventListener("message",function r(o){if(!o||!o.data)return;if(!Ri(t,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}let{id:i,type:n,path:C}=Object.assign({path:[]},o.data),p=(o.data.argumentList||[]).map(eA),B;try{let a=C.slice(0,-1).reduce((Q,I)=>Q[I],A),g=C.reduce((Q,I)=>Q[I],A);switch(n){case"GET":B=g;break;case"SET":a[C.slice(-1)[0]]=eA(o.data.value),B=!0;break;case"APPLY":B=g.apply(a,p);break;case"CONSTRUCT":{let Q=new g(...p);B=Si(Q)}break;case"ENDPOINT":{let{port1:Q,port2:I}=new MessageChannel;$t(A,I),B=ue(Q,[Q])}break;case"RELEASE":B=void 0;break;default:return}}catch(a){B={value:a,[PA]:0}}Promise.resolve(B).catch(a=>({value:a,[PA]:0})).then(a=>{let[g,Q]=TA(a);e.postMessage(Object.assign(Object.assign({},g),{id:i}),Q),n==="RELEASE"&&(e.removeEventListener("message",r),Ar(e),Qe in A&&typeof A[Qe]=="function"&&A[Qe]())}).catch(a=>{let[g,Q]=TA({value:new TypeError("Unserializable return value"),[PA]:0});e.postMessage(Object.assign(Object.assign({},g),{id:i}),Q)})}),e.start&&e.start()}function ki(A){return A.constructor.name==="MessagePort"}function Ar(A){ki(A)&&A.close()}function me(A,e){return Ee(A,[],e)}function JA(A){if(A)throw new Error("Proxy has been released and is not useable")}function er(A){return oA(A,{type:"RELEASE"}).then(()=>{Ar(A)})}var xA=new WeakMap,MA="FinalizationRegistry"in globalThis&&new FinalizationRegistry(A=>{let e=(xA.get(A)||0)-1;xA.set(A,e),e===0&&er(A)});function Fi(A,e){let t=(xA.get(e)||0)+1;xA.set(e,t),MA&&MA.register(A,e,A)}function Ui(A){MA&&MA.unregister(A)}function Ee(A,e=[],t=function(){}){let r=!1,o=new Proxy(t,{get(i,n){if(JA(r),n===pe)return()=>{Ui(o),er(A),r=!0};if(n==="then"){if(e.length===0)return{then:()=>o};let C=oA(A,{type:"GET",path:e.map(p=>p.toString())}).then(eA);return C.then.bind(C)}return Ee(A,[...e,n])},set(i,n,C){JA(r);let[p,B]=TA(C);return oA(A,{type:"SET",path:[...e,n].map(a=>a.toString()),value:p},B).then(eA)},apply(i,n,C){JA(r);let p=e[e.length-1];if(p===hi)return oA(A,{type:"ENDPOINT"}).then(eA);if(p==="bind")return Ee(A,e.slice(0,-1));let[B,a]=Zt(C);return oA(A,{type:"APPLY",path:e.map(g=>g.toString()),argumentList:B},a).then(eA)},construct(i,n){JA(r);let[C,p]=Zt(n);return oA(A,{type:"CONSTRUCT",path:e.map(B=>B.toString()),argumentList:C},p).then(eA)}});return Fi(o,A),o}function Ni(A){return Array.prototype.concat.apply([],A)}function Zt(A){let e=A.map(TA);return[e.map(t=>t[0]),Ni(e.map(t=>t[1]))]}var tr=new WeakMap;function ue(A,e){return tr.set(A,e),A}function Si(A){return Object.assign(A,{[zt]:!0})}function TA(A){for(let[e,t]of Xt)if(t.canHandle(A)){let[r,o]=t.serialize(A);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:A},tr.get(A)||[]]}function eA(A){switch(A.type){case"HANDLER":return Xt.get(A.name).deserialize(A.value);case"RAW":return A.value}}function oA(A,e,t){return new Promise(r=>{let o=bi();A.addEventListener("message",function i(n){!n.data||!n.data.id||n.data.id!==o||(A.removeEventListener("message",i),r(n.data))}),A.start&&A.start(),A.postMessage(Object.assign({id:o},e),t)})}function bi(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function uA(A,e){return function(){return A.apply(e,arguments)}}var{toString:Wi}=Object.prototype,{getPrototypeOf:ce}=Object,{iterator:YA,toStringTag:or}=Symbol,qA=(A=>e=>{let t=Wi.call(e);return A[t]||(A[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),H=A=>(A=A.toLowerCase(),e=>qA(e)===A),KA=A=>e=>typeof e===A,{isArray:nA}=Array,aA=KA("undefined");function fA(A){return A!==null&&!aA(A)&&A.constructor!==null&&!aA(A.constructor)&&P(A.constructor.isBuffer)&&A.constructor.isBuffer(A)}var ar=H("ArrayBuffer");function Gi(A){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(A):e=A&&A.buffer&&ar(A.buffer),e}var Oi=KA("string"),P=KA("function"),nr=KA("number"),cA=A=>A!==null&&typeof A=="object",Li=A=>A===!0||A===!1,HA=A=>{if(qA(A)!=="object")return!1;let e=ce(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(or in A)&&!(YA in A)},Ji=A=>{if(!cA(A)||fA(A))return!1;try{return Object.keys(A).length===0&&Object.getPrototypeOf(A)===Object.prototype}catch{return!1}},Pi=H("Date"),xi=H("File"),Mi=H("Blob"),Ti=H("FileList"),Hi=A=>cA(A)&&P(A.pipe),Yi=A=>{let e;return A&&(typeof FormData=="function"&&A instanceof FormData||P(A.append)&&((e=qA(A))==="formdata"||e==="object"&&P(A.toString)&&A.toString()==="[object FormData]"))},qi=H("URLSearchParams"),[Ki,ji,vi,Vi]=["ReadableStream","Request","Response","Headers"].map(H),Zi=A=>A.trim?A.trim():A.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dA(A,e,{allOwnKeys:t=!1}={}){if(A===null||typeof A>"u")return;let r,o;if(typeof A!="object"&&(A=[A]),nA(A))for(r=0,o=A.length;r<o;r++)e.call(null,A[r],r,A);else{if(fA(A))return;let i=t?Object.getOwnPropertyNames(A):Object.keys(A),n=i.length,C;for(r=0;r<n;r++)C=i[r],e.call(null,A[C],C,A)}}function Ir(A,e){if(fA(A))return null;e=e.toLowerCase();let t=Object.keys(A),r=t.length,o;for(;r-- >0;)if(o=t[r],e===o.toLowerCase())return o;return null}var tA=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sr=A=>!aA(A)&&A!==tA;function fe(){let{caseless:A,skipUndefined:e}=sr(this)&&this||{},t={},r=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let n=A&&Ir(t,i)||i;HA(t[n])&&HA(o)?t[n]=fe(t[n],o):HA(o)?t[n]=fe({},o):nA(o)?t[n]=o.slice():(!e||!aA(o))&&(t[n]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&dA(arguments[o],r);return t}var zi=(A,e,t,{allOwnKeys:r}={})=>(dA(e,(o,i)=>{t&&P(o)?Object.defineProperty(A,i,{value:uA(o,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(A,i,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),A),_i=A=>(A.charCodeAt(0)===65279&&(A=A.slice(1)),A),Xi=(A,e,t,r)=>{A.prototype=Object.create(e.prototype,r),Object.defineProperty(A.prototype,"constructor",{value:A,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(A,"super",{value:e.prototype}),t&&Object.assign(A.prototype,t)},$i=(A,e,t,r)=>{let o,i,n,C={};if(e=e||{},A==null)return e;do{for(o=Object.getOwnPropertyNames(A),i=o.length;i-- >0;)n=o[i],(!r||r(n,A,e))&&!C[n]&&(e[n]=A[n],C[n]=!0);A=t!==!1&&ce(A)}while(A&&(!t||t(A,e))&&A!==Object.prototype);return e},Ao=(A,e,t)=>{A=String(A),(t===void 0||t>A.length)&&(t=A.length),t-=e.length;let r=A.indexOf(e,t);return r!==-1&&r===t},eo=A=>{if(!A)return null;if(nA(A))return A;let e=A.length;if(!nr(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=A[e];return t},to=(A=>e=>A&&e instanceof A)(typeof Uint8Array<"u"&&ce(Uint8Array)),ro=(A,e)=>{let r=(A&&A[YA]).call(A),o;for(;(o=r.next())&&!o.done;){let i=o.value;e.call(A,i[0],i[1])}},io=(A,e)=>{let t,r=[];for(;(t=A.exec(e))!==null;)r.push(t);return r},oo=H("HTMLFormElement"),ao=A=>A.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),ir=(({hasOwnProperty:A})=>(e,t)=>A.call(e,t))(Object.prototype),no=H("RegExp"),gr=(A,e)=>{let t=Object.getOwnPropertyDescriptors(A),r={};dA(t,(o,i)=>{let n;(n=e(o,i,A))!==!1&&(r[i]=n||o)}),Object.defineProperties(A,r)},Io=A=>{gr(A,(e,t)=>{if(P(A)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=A[t];if(P(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+"'")})}})},so=(A,e)=>{let t={},r=o=>{o.forEach(i=>{t[i]=!0})};return nA(A)?r(A):r(String(A).split(e)),t},go=()=>{},Bo=(A,e)=>A!=null&&Number.isFinite(A=+A)?A:e;function Co(A){return!!(A&&P(A.append)&&A[or]==="FormData"&&A[YA])}var lo=A=>{let e=new Array(10),t=(r,o)=>{if(cA(r)){if(e.indexOf(r)>=0)return;if(fA(r))return r;if(!("toJSON"in r)){e[o]=r;let i=nA(r)?[]:{};return dA(r,(n,C)=>{let p=t(n,o+1);!aA(p)&&(i[C]=p)}),e[o]=void 0,i}}return r};return t(A,0)},Qo=H("AsyncFunction"),Eo=A=>A&&(cA(A)||P(A))&&P(A.then)&&P(A.catch),Br=((A,e)=>A?setImmediate:e?((t,r)=>(tA.addEventListener("message",({source:o,data:i})=>{o===tA&&i===t&&r.length&&r.shift()()},!1),o=>{r.push(o),tA.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",P(tA.postMessage)),po=typeof queueMicrotask<"u"?queueMicrotask.bind(tA):typeof process<"u"&&process.nextTick||Br,mo=A=>A!=null&&P(A[YA]),E={isArray:nA,isArrayBuffer:ar,isBuffer:fA,isFormData:Yi,isArrayBufferView:Gi,isString:Oi,isNumber:nr,isBoolean:Li,isObject:cA,isPlainObject:HA,isEmptyObject:Ji,isReadableStream:Ki,isRequest:ji,isResponse:vi,isHeaders:Vi,isUndefined:aA,isDate:Pi,isFile:xi,isBlob:Mi,isRegExp:no,isFunction:P,isStream:Hi,isURLSearchParams:qi,isTypedArray:to,isFileList:Ti,forEach:dA,merge:fe,extend:zi,trim:Zi,stripBOM:_i,inherits:Xi,toFlatObject:$i,kindOf:qA,kindOfTest:H,endsWith:Ao,toArray:eo,forEachEntry:ro,matchAll:io,isHTMLForm:oo,hasOwnProperty:ir,hasOwnProp:ir,reduceDescriptors:gr,freezeMethods:Io,toObjectSet:so,toCamelCase:ao,noop:go,toFiniteNumber:Bo,findKey:Ir,global:tA,isContextDefined:sr,isSpecCompliantForm:Co,toJSONObject:lo,isAsyncFn:Qo,isThenable:Eo,setImmediate:Br,asap:po,isIterable:mo};var G=class A extends Error{static from(e,t,r,o,i,n){let C=new A(e.message,t||e.code,r,o,i);return C.cause=e,C.name=e.name,n&&Object.assign(C,n),C}constructor(e,t,r,o,i){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.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:E.toJSONObject(this.config),code:this.code,status:this.status}}};G.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";G.ERR_BAD_OPTION="ERR_BAD_OPTION";G.ECONNABORTED="ECONNABORTED";G.ETIMEDOUT="ETIMEDOUT";G.ERR_NETWORK="ERR_NETWORK";G.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";G.ERR_DEPRECATED="ERR_DEPRECATED";G.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";G.ERR_BAD_REQUEST="ERR_BAD_REQUEST";G.ERR_CANCELED="ERR_CANCELED";G.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";G.ERR_INVALID_URL="ERR_INVALID_URL";var h=G;var jA=null;function de(A){return E.isPlainObject(A)||E.isArray(A)}function lr(A){return E.endsWith(A,"[]")?A.slice(0,-2):A}function Cr(A,e,t){return A?A.concat(e).map(function(o,i){return o=lr(o),!t&&i?"["+o+"]":o}).join(t?".":""):e}function uo(A){return E.isArray(A)&&!A.some(de)}var fo=E.toFlatObject(E,{},null,function(e){return/^is[A-Z]/.test(e)});function co(A,e,t){if(!E.isObject(A))throw new TypeError("target must be an object");e=e||new(jA||FormData),t=E.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,m){return!E.isUndefined(m[u])});let r=t.metaTokens,o=t.visitor||a,i=t.dots,n=t.indexes,p=(t.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(e);if(!E.isFunction(o))throw new TypeError("visitor must be a function");function B(s){if(s===null)return"";if(E.isDate(s))return s.toISOString();if(E.isBoolean(s))return s.toString();if(!p&&E.isBlob(s))throw new h("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(s)||E.isTypedArray(s)?p&&typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function a(s,u,m){let D=s;if(s&&!m&&typeof s=="object"){if(E.endsWith(u,"{}"))u=r?u:u.slice(0,-2),s=JSON.stringify(s);else if(E.isArray(s)&&uo(s)||(E.isFileList(s)||E.endsWith(u,"[]"))&&(D=E.toArray(s)))return u=lr(u),D.forEach(function(k,O){!(E.isUndefined(k)||k===null)&&e.append(n===!0?Cr([u],O,i):n===null?u:u+"[]",B(k))}),!1}return de(s)?!0:(e.append(Cr(m,u,i),B(s)),!1)}let g=[],Q=Object.assign(fo,{defaultVisitor:a,convertValue:B,isVisitable:de});function I(s,u){if(!E.isUndefined(s)){if(g.indexOf(s)!==-1)throw Error("Circular reference detected in "+u.join("."));g.push(s),E.forEach(s,function(D,W){(!(E.isUndefined(D)||D===null)&&o.call(e,D,E.isString(W)?W.trim():W,u,Q))===!0&&I(D,u?u.concat(W):[W])}),g.pop()}}if(!E.isObject(A))throw new TypeError("data must be an object");return I(A),e}var z=co;function Qr(A){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(A).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Er(A,e){this._pairs=[],A&&z(A,this,e)}var pr=Er.prototype;pr.append=function(e,t){this._pairs.push([e,t])};pr.toString=function(e){let t=e?function(r){return e.call(this,r,Qr)}:Qr;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};var vA=Er;function yo(A){return encodeURIComponent(A).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yA(A,e,t){if(!e)return A;let r=t&&t.encode||yo,o=E.isFunction(t)?{serialize:t}:t,i=o&&o.serialize,n;if(i?n=i(e,o):n=E.isURLSearchParams(e)?e.toString():new vA(e,o).toString(r),n){let C=A.indexOf("#");C!==-1&&(A=A.slice(0,C)),A+=(A.indexOf("?")===-1?"?":"&")+n}return A}var ye=class{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){E.forEach(this.handlers,function(r){r!==null&&e(r)})}},he=ye;var IA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0};var mr=typeof URLSearchParams<"u"?URLSearchParams:vA;var ur=typeof FormData<"u"?FormData:null;var fr=typeof Blob<"u"?Blob:null;var cr={isBrowser:!0,classes:{URLSearchParams:mr,FormData:ur,Blob:fr},protocols:["http","https","file","blob","url","data"]};var Re={};Bi(Re,{hasBrowserEnv:()=>De,hasStandardBrowserEnv:()=>ho,hasStandardBrowserWebWorkerEnv:()=>wo,navigator:()=>we,origin:()=>Do});var De=typeof window<"u"&&typeof document<"u",we=typeof navigator=="object"&&navigator||void 0,ho=De&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),wo=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Do=De&&window.location.href||"http://localhost";var R={...Re,...cr};function ke(A,e){return z(A,new R.classes.URLSearchParams,{visitor:function(t,r,o,i){return R.isNode&&E.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Ro(A){return E.matchAll(/\w+|\[(\w*)]/g,A).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ko(A){let e={},t=Object.keys(A),r,o=t.length,i;for(r=0;r<o;r++)i=t[r],e[i]=A[i];return e}function Fo(A){function e(t,r,o,i){let n=t[i++];if(n==="__proto__")return!0;let C=Number.isFinite(+n),p=i>=t.length;return n=!n&&E.isArray(o)?o.length:n,p?(E.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!C):((!o[n]||!E.isObject(o[n]))&&(o[n]=[]),e(t,r,o[n],i)&&E.isArray(o[n])&&(o[n]=ko(o[n])),!C)}if(E.isFormData(A)&&E.isFunction(A.entries)){let t={};return E.forEachEntry(A,(r,o)=>{e(Ro(r),o,t,0)}),t}return null}var VA=Fo;function Uo(A,e,t){if(E.isString(A))try{return(e||JSON.parse)(A),E.trim(A)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(A)}var Fe={transitional:IA,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=E.isObject(e);if(i&&E.isHTMLForm(e)&&(e=new FormData(e)),E.isFormData(e))return o?JSON.stringify(VA(e)):e;if(E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)||E.isReadableStream(e))return e;if(E.isArrayBufferView(e))return e.buffer;if(E.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let C;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ke(e,this.formSerializer).toString();if((C=E.isFileList(e))||r.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return z(C?{"files[]":e}:e,p&&new p,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),Uo(e)):e}],transformResponse:[function(e){let t=this.transitional||Fe.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(E.isResponse(e)||E.isReadableStream(e))return e;if(e&&E.isString(e)&&(r&&!this.responseType||o)){let n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(C){if(n)throw C.name==="SyntaxError"?h.from(C,h.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:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],A=>{Fe.headers[A]={}});var sA=Fe;var No=E.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"]),dr=A=>{let e={},t,r,o;return A&&A.split(`
`).forEach(function(n){o=n.indexOf(":"),t=n.substring(0,o).trim().toLowerCase(),r=n.substring(o+1).trim(),!(!t||e[t]&&No[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e};var yr=Symbol("internals");function hA(A){return A&&String(A).trim().toLowerCase()}function ZA(A){return A===!1||A==null?A:E.isArray(A)?A.map(ZA):String(A)}function So(A){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(A);)e[r[1]]=r[2];return e}var bo=A=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(A.trim());function Ue(A,e,t,r,o){if(E.isFunction(r))return r.call(this,e,t);if(o&&(e=t),!!E.isString(e)){if(E.isString(r))return e.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(e)}}function Wo(A){return A.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Go(A,e){let t=E.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(A,r+t,{value:function(o,i,n){return this[r].call(this,e,o,i,n)},configurable:!0})})}var gA=class{constructor(e){e&&this.set(e)}set(e,t,r){let o=this;function i(C,p,B){let a=hA(p);if(!a)throw new Error("header name must be a non-empty string");let g=E.findKey(o,a);(!g||o[g]===void 0||B===!0||B===void 0&&o[g]!==!1)&&(o[g||p]=ZA(C))}let n=(C,p)=>E.forEach(C,(B,a)=>i(B,a,p));if(E.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(E.isString(e)&&(e=e.trim())&&!bo(e))n(dr(e),t);else if(E.isObject(e)&&E.isIterable(e)){let C={},p,B;for(let a of e){if(!E.isArray(a))throw TypeError("Object iterator must return a key-value pair");C[B=a[0]]=(p=C[B])?E.isArray(p)?[...p,a[1]]:[p,a[1]]:a[1]}n(C,t)}else e!=null&&i(t,e,r);return this}get(e,t){if(e=hA(e),e){let r=E.findKey(this,e);if(r){let o=this[r];if(!t)return o;if(t===!0)return So(o);if(E.isFunction(t))return t.call(this,o,r);if(E.isRegExp(t))return t.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=hA(e),e){let r=E.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||Ue(this,this[r],r,t)))}return!1}delete(e,t){let r=this,o=!1;function i(n){if(n=hA(n),n){let C=E.findKey(r,n);C&&(!t||Ue(r,r[C],C,t))&&(delete r[C],o=!0)}}return E.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),r=t.length,o=!1;for(;r--;){let i=t[r];(!e||Ue(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,r={};return E.forEach(this,(o,i)=>{let n=E.findKey(r,i);if(n){t[n]=ZA(o),delete t[i];return}let C=e?Wo(i):String(i).trim();C!==i&&delete t[i],t[C]=ZA(o),r[C]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return E.forEach(this,(r,o)=>{r!=null&&r!==!1&&(t[o]=e&&E.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){let r=new this(e);return t.forEach(o=>r.set(o)),r}static accessor(e){let r=(this[yr]=this[yr]={accessors:{}}).accessors,o=this.prototype;function i(n){let C=hA(n);r[C]||(Go(o,n),r[C]=!0)}return E.isArray(e)?e.forEach(i):i(e),this}};gA.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);E.reduceDescriptors(gA.prototype,({value:A},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>A,set(r){this[t]=r}}});E.freezeMethods(gA);var N=gA;function wA(A,e){let t=this||sA,r=e||t,o=N.from(r.headers),i=r.data;return E.forEach(A,function(C){i=C.call(t,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function DA(A){return!!(A&&A.__CANCEL__)}var Ne=class extends h{constructor(e,t,r){super(e??"canceled",h.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}},q=Ne;function RA(A,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?A(t):e(new h("Request failed with status code "+t.status,[h.ERR_BAD_REQUEST,h.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Se(A){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return e&&e[1]||""}function Oo(A,e){A=A||10;let t=new Array(A),r=new Array(A),o=0,i=0,n;return e=e!==void 0?e:1e3,function(p){let B=Date.now(),a=r[i];n||(n=B),t[o]=p,r[o]=B;let g=i,Q=0;for(;g!==o;)Q+=t[g++],g=g%A;if(o=(o+1)%A,o===i&&(i=(i+1)%A),B-n<e)return;let I=a&&B-a;return I?Math.round(Q*1e3/I):void 0}}var hr=Oo;function Lo(A,e){let t=0,r=1e3/e,o,i,n=(B,a=Date.now())=>{t=a,o=null,i&&(clearTimeout(i),i=null),A(...B)};return[(...B)=>{let a=Date.now(),g=a-t;g>=r?n(B,a):(o=B,i||(i=setTimeout(()=>{i=null,n(o)},r-g)))},()=>o&&n(o)]}var wr=Lo;var BA=(A,e,t=3)=>{let r=0,o=hr(50,250);return wr(i=>{let n=i.loaded,C=i.lengthComputable?i.total:void 0,p=n-r,B=o(p),a=n<=C;r=n;let g={loaded:n,total:C,progress:C?n/C:void 0,bytes:p,rate:B||void 0,estimated:B&&C&&a?(C-n)/B:void 0,event:i,lengthComputable:C!=null,[e?"download":"upload"]:!0};A(g)},t)},be=(A,e)=>{let t=A!=null;return[r=>e[0]({lengthComputable:t,total:A,loaded:r}),e[1]]},We=A=>(...e)=>E.asap(()=>A(...e));var Dr=R.hasStandardBrowserEnv?((A,e)=>t=>(t=new URL(t,R.origin),A.protocol===t.protocol&&A.host===t.host&&(e||A.port===t.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Rr=R.hasStandardBrowserEnv?{write(A,e,t,r,o,i,n){if(typeof document>"u")return;let C=[`${A}=${encodeURIComponent(e)}`];E.isNumber(t)&&C.push(`expires=${new Date(t).toUTCString()}`),E.isString(r)&&C.push(`path=${r}`),E.isString(o)&&C.push(`domain=${o}`),i===!0&&C.push("secure"),E.isString(n)&&C.push(`SameSite=${n}`),document.cookie=C.join("; ")},read(A){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+A+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(A){this.write(A,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ge(A){return typeof A!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function Oe(A,e){return e?A.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):A}function kA(A,e,t){let r=!Ge(e);return A&&(r||t==!1)?Oe(A,e):e}var kr=A=>A instanceof N?{...A}:A;function Y(A,e){e=e||{};let t={};function r(B,a,g,Q){return E.isPlainObject(B)&&E.isPlainObject(a)?E.merge.call({caseless:Q},B,a):E.isPlainObject(a)?E.merge({},a):E.isArray(a)?a.slice():a}function o(B,a,g,Q){if(E.isUndefined(a)){if(!E.isUndefined(B))return r(void 0,B,g,Q)}else return r(B,a,g,Q)}function i(B,a){if(!E.isUndefined(a))return r(void 0,a)}function n(B,a){if(E.isUndefined(a)){if(!E.isUndefined(B))return r(void 0,B)}else return r(void 0,a)}function C(B,a,g){if(g in e)return r(B,a);if(g in A)return r(void 0,B)}let p={url:i,method:i,data:i,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:C,headers:(B,a,g)=>o(kr(B),kr(a),g,!0)};return E.forEach(Object.keys({...A,...e}),function(a){if(a==="__proto__"||a==="constructor"||a==="prototype")return;let g=E.hasOwnProp(p,a)?p[a]:o,Q=g(A[a],e[a],a);E.isUndefined(Q)&&g!==C||(t[a]=Q)}),t}var zA=A=>{let e=Y({},A),{data:t,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:n,auth:C}=e;if(e.headers=n=N.from(n),e.url=yA(kA(e.baseURL,e.url,e.allowAbsoluteUrls),A.params,A.paramsSerializer),C&&n.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):""))),E.isFormData(t)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(E.isFunction(t.getHeaders)){let p=t.getHeaders(),B=["content-type","content-length"];Object.entries(p).forEach(([a,g])=>{B.includes(a.toLowerCase())&&n.set(a,g)})}}if(R.hasStandardBrowserEnv&&(r&&E.isFunction(r)&&(r=r(e)),r||r!==!1&&Dr(e.url))){let p=o&&i&&Rr.read(i);p&&n.set(o,p)}return e};var Jo=typeof XMLHttpRequest<"u",Fr=Jo&&function(A){return new Promise(function(t,r){let o=zA(A),i=o.data,n=N.from(o.headers).normalize(),{responseType:C,onUploadProgress:p,onDownloadProgress:B}=o,a,g,Q,I,s;function u(){I&&I(),s&&s(),o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function D(){if(!m)return;let k=N.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),T={data:!C||C==="text"||C==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:k,config:A,request:m};RA(function(x){t(x),u()},function(x){r(x),u()},T),m=null}"onloadend"in m?m.onloadend=D:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(D)},m.onabort=function(){m&&(r(new h("Request aborted",h.ECONNABORTED,A,m)),m=null)},m.onerror=function(O){let T=O&&O.message?O.message:"Network Error",X=new h(T,h.ERR_NETWORK,A,m);X.event=O||null,r(X),m=null},m.ontimeout=function(){let O=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",T=o.transitional||IA;o.timeoutErrorMessage&&(O=o.timeoutErrorMessage),r(new h(O,T.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,A,m)),m=null},i===void 0&&n.setContentType(null),"setRequestHeader"in m&&E.forEach(n.toJSON(),function(O,T){m.setRequestHeader(T,O)}),E.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),C&&C!=="json"&&(m.responseType=o.responseType),B&&([Q,s]=BA(B,!0),m.addEventListener("progress",Q)),p&&m.upload&&([g,I]=BA(p),m.upload.addEventListener("progress",g),m.upload.addEventListener("loadend",I)),(o.cancelToken||o.signal)&&(a=k=>{m&&(r(!k||k.type?new q(null,A,m):k),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));let W=Se(o.url);if(W&&R.protocols.indexOf(W)===-1){r(new h("Unsupported protocol "+W+":",h.ERR_BAD_REQUEST,A));return}m.send(i||null)})};var Po=(A,e)=>{let{length:t}=A=A?A.filter(Boolean):[];if(e||t){let r=new AbortController,o,i=function(B){if(!o){o=!0,C();let a=B instanceof Error?B:this.reason;r.abort(a instanceof h?a:new q(a instanceof Error?a.message:a))}},n=e&&setTimeout(()=>{n=null,i(new h(`timeout of ${e}ms exceeded`,h.ETIMEDOUT))},e),C=()=>{A&&(n&&clearTimeout(n),n=null,A.forEach(B=>{B.unsubscribe?B.unsubscribe(i):B.removeEventListener("abort",i)}),A=null)};A.forEach(B=>B.addEventListener("abort",i));let{signal:p}=r;return p.unsubscribe=()=>E.asap(C),p}},Ur=Po;var xo=function*(A,e){let t=A.byteLength;if(!e||t<e){yield A;return}let r=0,o;for(;r<t;)o=r+e,yield A.slice(r,o),r=o},Mo=async function*(A,e){for await(let t of To(A))yield*xo(t,e)},To=async function*(A){if(A[Symbol.asyncIterator]){yield*A;return}let e=A.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Le=(A,e,t,r)=>{let o=Mo(A,e),i=0,n,C=p=>{n||(n=!0,r&&r(p))};return new ReadableStream({async pull(p){try{let{done:B,value:a}=await o.next();if(B){C(),p.close();return}let g=a.byteLength;if(t){let Q=i+=g;t(Q)}p.enqueue(new Uint8Array(a))}catch(B){throw C(B),B}},cancel(p){return C(p),o.return()}},{highWaterMark:2})};var Nr=64*1024,{isFunction:_A}=E,Ho=(({Request:A,Response:e})=>({Request:A,Response:e}))(E.global),{ReadableStream:Sr,TextEncoder:br}=E.global,Wr=(A,...e)=>{try{return!!A(...e)}catch{return!1}},Yo=A=>{A=E.merge.call({skipUndefined:!0},Ho,A);let{fetch:e,Request:t,Response:r}=A,o=e?_A(e):typeof fetch=="function",i=_A(t),n=_A(r);if(!o)return!1;let C=o&&_A(Sr),p=o&&(typeof br=="function"?(s=>u=>s.encode(u))(new br):async s=>new Uint8Array(await new t(s).arrayBuffer())),B=i&&C&&Wr(()=>{let s=!1,u=new t(R.origin,{body:new Sr,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!u}),a=n&&C&&Wr(()=>E.isReadableStream(new r("").body)),g={stream:a&&(s=>s.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!g[s]&&(g[s]=(u,m)=>{let D=u&&u[s];if(D)return D.call(u);throw new h(`Response type '${s}' is not supported`,h.ERR_NOT_SUPPORT,m)})});let Q=async s=>{if(s==null)return 0;if(E.isBlob(s))return s.size;if(E.isSpecCompliantForm(s))return(await new t(R.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(E.isArrayBufferView(s)||E.isArrayBuffer(s))return s.byteLength;if(E.isURLSearchParams(s)&&(s=s+""),E.isString(s))return(await p(s)).byteLength},I=async(s,u)=>{let m=E.toFiniteNumber(s.getContentLength());return m??Q(u)};return async s=>{let{url:u,method:m,data:D,signal:W,cancelToken:k,timeout:O,onDownloadProgress:T,onUploadProgress:X,responseType:x,headers:ae,withCredentials:WA="same-origin",fetchOptions:Tt}=zA(s),Ht=e||fetch;x=x?(x+"").toLowerCase():"text";let GA=Ur([W,k&&k.toAbortSignal()],O),pA=null,$=GA&&GA.unsubscribe&&(()=>{GA.unsubscribe()}),Yt;try{if(X&&B&&m!=="get"&&m!=="head"&&(Yt=await I(ae,D))!==0){let V=new t(u,{method:"POST",body:D,duplex:"half"}),rA;if(E.isFormData(D)&&(rA=V.headers.get("content-type"))&&ae.setContentType(rA),V.body){let[ne,OA]=be(Yt,BA(We(X)));D=Le(V.body,Nr,ne,OA)}}E.isString(WA)||(WA=WA?"include":"omit");let L=i&&"credentials"in t.prototype,qt={...Tt,signal:GA,method:m.toUpperCase(),headers:ae.normalize().toJSON(),body:D,duplex:"half",credentials:L?WA:void 0};pA=i&&new t(u,qt);let v=await(i?Ht(pA,Tt):Ht(u,qt)),Kt=a&&(x==="stream"||x==="response");if(a&&(T||Kt&&$)){let V={};["status","statusText","headers"].forEach(jt=>{V[jt]=v[jt]});let rA=E.toFiniteNumber(v.headers.get("content-length")),[ne,OA]=T&&be(rA,BA(We(T),!0))||[];v=new r(Le(v.body,Nr,ne,()=>{OA&&OA(),$&&$()}),V)}x=x||"text";let si=await g[E.findKey(g,x)||"text"](v,s);return!Kt&&$&&$(),await new Promise((V,rA)=>{RA(V,rA,{data:si,headers:N.from(v.headers),status:v.status,statusText:v.statusText,config:s,request:pA})})}catch(L){throw $&&$(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new h("Network Error",h.ERR_NETWORK,s,pA,L&&L.response),{cause:L.cause||L}):h.from(L,L&&L.code,s,pA,L&&L.response)}}},qo=new Map,Je=A=>{let e=A&&A.env||{},{fetch:t,Request:r,Response:o}=e,i=[r,o,t],n=i.length,C=n,p,B,a=qo;for(;C--;)p=i[C],B=a.get(p),B===void 0&&a.set(p,B=C?new Map:Yo(e)),a=B;return B},Cg=Je();var Pe={http:jA,xhr:Fr,fetch:{get:Je}};E.forEach(Pe,(A,e)=>{if(A){try{Object.defineProperty(A,"name",{value:e})}catch{}Object.defineProperty(A,"adapterName",{value:e})}});var Gr=A=>`- ${A}`,jo=A=>E.isFunction(A)||A===null||A===!1;function vo(A,e){A=E.isArray(A)?A:[A];let{length:t}=A,r,o,i={};for(let n=0;n<t;n++){r=A[n];let C;if(o=r,!jo(r)&&(o=Pe[(C=String(r)).toLowerCase()],o===void 0))throw new h(`Unknown adapter '${C}'`);if(o&&(E.isFunction(o)||(o=o.get(e))))break;i[C||"#"+n]=o}if(!o){let n=Object.entries(i).map(([p,B])=>`adapter ${p} `+(B===!1?"is not supported by the environment":"is not available in the build")),C=t?n.length>1?`since :
`+n.map(Gr).join(`
`):" "+Gr(n[0]):"as no adapter specified";throw new h("There is no suitable adapter to dispatch the request "+C,"ERR_NOT_SUPPORT")}return o}var XA={getAdapter:vo,adapters:Pe};function xe(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new q(null,A)}function $A(A){return xe(A),A.headers=N.from(A.headers),A.data=wA.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),XA.getAdapter(A.adapter||sA.adapter,A)(A).then(function(r){return xe(A),r.data=wA.call(A,A.transformResponse,r),r.headers=N.from(r.headers),r},function(r){return DA(r)||(xe(A),r&&r.response&&(r.response.data=wA.call(A,A.transformResponse,r.response),r.response.headers=N.from(r.response.headers))),Promise.reject(r)})}var Ae="1.13.5";var ee={};["object","boolean","number","function","string","symbol"].forEach((A,e)=>{ee[A]=function(r){return typeof r===A||"a"+(e<1?"n ":" ")+A}});var Or={};ee.transitional=function(e,t,r){function o(i,n){return"[Axios v"+Ae+"] Transitional option '"+i+"'"+n+(r?". "+r:"")}return(i,n,C)=>{if(e===!1)throw new h(o(n," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!Or[n]&&(Or[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,n,C):!0}};ee.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vo(A,e,t){if(typeof A!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);let r=Object.keys(A),o=r.length;for(;o-- >0;){let i=r[o],n=e[i];if(n){let C=A[i],p=C===void 0||n(C,i,A);if(p!==!0)throw new h("option "+i+" must be "+p,h.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new h("Unknown option "+i,h.ERR_BAD_OPTION)}}var FA={assertOptions:Vo,validators:ee};var M=FA.validators,CA=class{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(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Y(this.defaults,t);let{transitional:r,paramsSerializer:o,headers:i}=t;r!==void 0&&FA.assertOptions(r,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean),legacyInterceptorReqResOrdering:M.transitional(M.boolean)},!1),o!=null&&(E.isFunction(o)?t.paramsSerializer={serialize:o}:FA.assertOptions(o,{encode:M.function,serialize:M.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),FA.assertOptions(t,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=i&&E.merge(i.common,i[t.method]);i&&E.forEach(["delete","get","head","post","put","patch","common"],s=>{delete i[s]}),t.headers=N.concat(n,i);let C=[],p=!0;this.interceptors.request.forEach(function(u){if(typeof u.runWhen=="function"&&u.runWhen(t)===!1)return;p=p&&u.synchronous;let m=t.transitional||IA;m&&m.legacyInterceptorReqResOrdering?C.unshift(u.fulfilled,u.rejected):C.push(u.fulfilled,u.rejected)});let B=[];this.interceptors.response.forEach(function(u){B.push(u.fulfilled,u.rejected)});let a,g=0,Q;if(!p){let s=[$A.bind(this),void 0];for(s.unshift(...C),s.push(...B),Q=s.length,a=Promise.resolve(t);g<Q;)a=a.then(s[g++],s[g++]);return a}Q=C.length;let I=t;for(;g<Q;){let s=C[g++],u=C[g++];try{I=s(I)}catch(m){u.call(this,m);break}}try{a=$A.call(this,I)}catch(s){return Promise.reject(s)}for(g=0,Q=B.length;g<Q;)a=a.then(B[g++],B[g++]);return a}getUri(e){e=Y(this.defaults,e);let t=kA(e.baseURL,e.url,e.allowAbsoluteUrls);return yA(t,e.params,e.paramsSerializer)}};E.forEach(["delete","get","head","options"],function(e){CA.prototype[e]=function(t,r){return this.request(Y(r||{},{method:e,url:t,data:(r||{}).data}))}});E.forEach(["post","put","patch"],function(e){function t(r){return function(i,n,C){return this.request(Y(C||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}CA.prototype[e]=t(),CA.prototype[e+"Form"]=t(!0)});var UA=CA;var Me=class A{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});let r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i,n=new Promise(C=>{r.subscribe(C),i=C}).then(o);return n.cancel=function(){r.unsubscribe(i)},n},e(function(i,n,C){r.reason||(r.reason=new q(i,n,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;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let 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 A(function(o){e=o}),cancel:e}}},Lr=Me;function Te(A){return function(t){return A.apply(null,t)}}function He(A){return E.isObject(A)&&A.isAxiosError===!0}var Ye={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,HttpV