-
Notifications
You must be signed in to change notification settings - Fork 85
/
graphhopper-client.js
1 lines (1 loc) · 46.8 KB
/
graphhopper-client.js
1
(()=>{var t={864:t=>{GHInput=function(t,e){this.set(t,e)},GHInput.prototype.round=function(t,e){return void 0===e&&(e=1e6),Math.round(t*e)/e},GHInput.prototype.setCoord=function(t,e){this.lat=this.round(t),this.lng=this.round(e),this.input=this.toString()},GHInput.isObject=function(t){return"[object object]"===Object.prototype.toString.call(t).toLowerCase()},GHInput.isString=function(t){return"[object string]"===Object.prototype.toString.call(t).toLowerCase()},GHInput.prototype.set=function(t,e){if(e)this.setCoord(t,e);else if(this.input=t,GHInput.isObject(t))this.setCoord(t.lat,t.lng);else if(GHInput.isString(t)){var n=t.indexOf(",");n>=0&&(this.lat=this.round(parseFloat(t.substr(0,n))),this.lng=this.round(parseFloat(t.substr(n+1))))}},GHInput.prototype.toString=function(){if(void 0!==this.lat&&void 0!==this.lng)return this.lat+","+this.lng},t.exports=GHInput},234:t=>{var e=function(){};e.prototype.clone=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},e.prototype.decodePath=function(t,e){for(var n=t.length,r=0,o=[],i=0,s=0,a=0;r<n;){var c=void 0,u=0,l=0;do{l|=(31&(c=t.charCodeAt(r++)-63))<<u,u+=5}while(c>=32);i+=1&l?~(l>>1):l>>1,u=0,l=0;do{l|=(31&(c=t.charCodeAt(r++)-63))<<u,u+=5}while(c>=32);if(s+=1&l?~(l>>1):l>>1,e){u=0,l=0;do{l|=(31&(c=t.charCodeAt(r++)-63))<<u,u+=5}while(c>=32);a+=1&l?~(l>>1):l>>1,o.push([1e-5*s,1e-5*i,a/100])}else o.push([1e-5*s,1e-5*i])}return o},e.prototype.extractError=function(t,e){var n;return t&&t.data?(n=t.data).hints&&n.hints[0]&&n.hints[0].message?n=n.hints[0].message:n.message&&(n=n.message):n=t,new Error(n+" - for url "+e)},e.prototype.isArray=function(t){return"[object array]"===Object.prototype.toString.call(t).toLowerCase()},e.prototype.isObject=function(t){return"[object object]"===Object.prototype.toString.call(t).toLowerCase()},e.prototype.isString=function(t){return"string"==typeof t},t.exports=e},380:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperGeocoding=function(t,e){var n=this;this.defaults={debug:!1,locale:"en"},e&&Object.keys(e).forEach((function(t){n.defaults[t]=e[t]})),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/geocode",this.timeout=t.timeout?t.timeout:1e4},GraphHopperGeocoding.prototype.getParametersAsQueryString=function(t){var e="locale="+t.locale;return t.query?(e+="&q="+encodeURIComponent(t.query),t.location_bias?e+="&point="+encodeURIComponent(t.location_bias.toString()):t.point&&(e+="&point="+encodeURIComponent(t.point.toString()))):(e+="&reverse=true",t.point&&(e+="&point="+encodeURIComponent(t.point.toString()))),t.debug&&(e+="&debug=true"),t.limit&&(e+="&limit="+t.limit),e},GraphHopperGeocoding.prototype.doRequest=function(t){var e=this;t||(t={}),Object.keys(this.defaults).forEach((function(n){t[n]||(t[n]=e.defaults[n])}));var n=this.host+this.endpoint+"?"+this.getParametersAsQueryString(t)+"&key="+this.key,i=this;return new Promise((function(t,e){r.get(n,{timeout:i.timeout}).then((function(r){200!==r.status?e(o.extractError(r,n)):r&&t(r.data)})).catch((function(t){e(o.extractError(t.response,n))}))}))},t.exports=GraphHopperGeocoding},15:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperIsochrone=function(t,e){var n=this;this.defaults={time_limit:600,distance_limit:0,buckets:3,profile:"car",debug:!1,reverse_flow:!1},e&&Object.keys(e).forEach((function(t){n.defaults[t]=e[t]})),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/isochrone",this.timeout=t.timeout?t.timeout:3e4},GraphHopperIsochrone.prototype.getParametersAsQueryString=function(t){var e="point="+t.point;return e+="&time_limit="+t.time_limit,e+="&distance_limit="+t.distance_limit,e+="&buckets="+t.buckets,e+="&profile="+t.profile,e+="&reverse_flow="+t.reverse_flow,t.debug&&(e+="&debug=true"),e},GraphHopperIsochrone.prototype.doRequest=function(t){var e=this;Object.keys(this.defaults).forEach((function(n){t[n]||(t[n]=e.defaults[n])}));var n=this.host+this.endpoint+"?"+this.getParametersAsQueryString(t)+"&key="+this.key,i=this;return new Promise((function(t,e){r.get(n,{timeout:i.timeout}).then((function(r){200!==r.status?e(o.extractError(r,n)):r&&t(r.data)})).catch((function(t){e(o.extractError(t.response,n))}))}))},t.exports=GraphHopperIsochrone},690:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperMapMatching=function(t,e){var n=this;this.defaults={profile:"car",gps_accuracy:20,debug:!1,max_visited_nodes:3e3,locale:"en",points_encoded:!0,instructions:!0,elevation:!0,data_type:"json"},e&&Object.keys(e).forEach((function(t){n.defaults[t]=e[t]})),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/match",this.timeout=t.timeout?t.timeout:1e5},GraphHopperMapMatching.prototype.getParametersAsQueryString=function(t){var e="locale="+t.locale;return e+="&vehicle="+t.profile,e+="&gps_accuracy="+t.gps_accuracy,e+="&max_visited_nodes="+t.max_visited_nodes,e+="&type="+t.data_type,e+="&instructions="+t.instructions,e+="&points_encoded="+t.points_encoded,e+="&elevation="+t.elevation,t.debug&&(e+="&debug=true"),e},GraphHopperMapMatching.prototype.doRequest=function(t,e){var n=this;e||(e={}),Object.keys(this.defaults).forEach((function(t){e[t]||(e[t]=n.defaults[t])}));var i=this.host+this.endpoint+"?"+this.getParametersAsQueryString(e)+"&key="+this.key,s=this.timeout;return new Promise((function(n,a){r.post(i,t,{timeout:s,headers:{"Content-Type":"application/xml"}}).then((function(t){if(200!==t.status)a(o.extractError(t,i));else if(t){if(t.data.paths)for(var r=0;r<t.data.paths.length;r++){var s=t.data.paths[r];if(s.points_encoded){var c=o.decodePath(s.points,e.elevation);s.points={type:"LineString",coordinates:c},delete s.snapped_waypoints}}n(t.data)}})).catch((function(t){a(o.extractError(t.response,i))}))}))},t.exports=GraphHopperMapMatching},642:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperMatrix=function(t,e){var n=this;this.defaults={profile:"car",debug:!1,out_arrays:["times"]},e&&Object.keys(e).forEach((function(t){n.defaults[t]=e[t]})),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/matrix",this.timeout=t.timeout?t.timeout:3e4},GraphHopperMatrix.prototype.doRequest=function(t){var e=this;Object.keys(this.defaults).forEach((function(n){t[n]||(t[n]=e.defaults[n])})),t.from_points||t.to_points||(t.from_points=t.points,t.to_points=t.points,delete t.points);var n=this.host+this.endpoint+"?key="+this.key,i=this;return new Promise((function(e,s){r.post(n,t,{timeout:i.timeout,headers:{"Content-Type":"application/json"}}).then((function(t){200!==t.status?s(o.extractError(t,n)):t&&e(t.data)})).catch((function(t){s(o.extractError(t.response,n))}))}))},GraphHopperMatrix.prototype.toHtmlTable=function(t,e){var n=t.to_points,r=t.from_points,o="<table border='1' cellpadding='10'>";for(var i in o+="<tr>",o+="<td>↓ from \ to →</td>",n)o+="<td><b>"+n[i][1]+","+n[i][0]+"</b></td>";for(var s in o+="</tr>",e){o+="<tr>",o+="<td><b>"+r[s][1]+","+r[s][0]+"</b></td>";var a=e[s];for(var c in a)o+="<td> <a href='https://graphhopper.com/maps?point="+encodeURIComponent(r[s][1]+","+r[s][0])+"&point="+encodeURIComponent(n[c][1]+","+n[c][0])+"&profile="+t.profile+"'>"+a[c]+"</a> </td>";o+="</tr>\n"}return o+"</table>"},t.exports=GraphHopperMatrix},382:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperOptimization=function(t){this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/vrp",this.timeout=t.timeout?t.timeout:1e4,this.waitInMillis=t.waitInMillis?t.waitInMillis:1e3,this.postTimeout=t.postTimeout?t.postTimeout:1e4},GraphHopperOptimization.prototype.doVRPRequest=function(t,e){var n=t[0],r=[];for(var o in t)if(!(o<1)){var i=t[o],s={id:"_"+o,type:"pickup",name:"maintenance "+o,address:{location_id:"_location_"+o,lon:i[0],lat:i[1]}};r.push(s)}for(var a=[],c=0;c<e;c++)a.push({vehicle_id:"_vehicle_"+c,start_address:{location_id:"_start_location",lon:n[0],lat:n[1]},type_id:"_vtype_1"});var u={algorithm:{problem_type:"min-max"},vehicles:a,vehicle_types:[{type_id:"_vtype_1",profile:"car"}],services:r};return this.doRequest(u)},GraphHopperOptimization.prototype.doRawRequest=function(t){var e=this;return new Promise((function(n,i){var s=e.host+e.endpoint+"/optimize?key="+e.key;r.post(s,t,{timeout:e.postTimeout,headers:{"Content-Type":"application/json"}}).then((function(t){if(200!==t.status)i(o.extractError(t,s));else if(t){var a,c=e.host+e.endpoint+"/solution/"+t.data.job_id+"?key="+e.key,u=function(){r.get(c,{timeout:e.timeout}).then((function(t){200!==t.status||void 0===t.data?(clearInterval(a),i(o.extractError(t,c))):t&&("finished"===t.data.status||t.data.message)&&(clearInterval(a),n(t.data))}))};e.waitInMillis>0?a=setInterval(u,e.waitInMillis):u()}})).catch((function(t){i(o.extractError(t.response,s))}))}))},GraphHopperOptimization.prototype.doRequest=function(t){var e={},n={},r={},o={},i={},s={},a=!1,c=!1;if(t.cost_matrices&&t.cost_matrices.length>0&&(c=!0),t.configuration&&!c&&!0===t.configuration.routing.calc_points&&(a=!0),a||t.configuration||c||(t.configuration={routing:{calc_points:!0}}),t.vehicle_types)for(var u=0;u<t.vehicle_types.length;u++){var l=t.vehicle_types[u];e[l.type_id]=l.profile,n[l.type_id]=l}if(t.services)for(var p=0;p<t.services.length;p++){var d=t.services[p];s[d.address.location_id]=d.address,o[d.id]=d}if(t.shipments)for(var f=0;f<t.shipments.length;f++){var h=t.shipments[f];s[h.pickup.address.location_id]=h.pickup.address,s[h.delivery.address.location_id]=h.delivery.address,i[h.id]=h}var m={},y={};if(t.vehicles)for(var g=0;g<t.vehicles.length;g++){var b=t.vehicles[g];y[b.vehicle_id]=b;var v=null;if(null!==b.type_id?(v=e[b.type_id],r[b.vehicle_id]=null!==v?v:"car"):r[b.vehicle_id]="car",b.start_address&&(s[b.start_address.location_id]=b.start_address),b.end_address&&(s[b.end_address.location_id]=b.end_address),b.break){var w=b.vehicle_id+"_break";m[w]=b.break}}var E=this.doRawRequest(t);return E.then((function(t){if(t.solution){var e=t.solution;t.raw_solution=JSON.parse(JSON.stringify(e)),e.calc_points=a;for(var c=0;c<e.routes.length;c++){var u=e.routes[c],l=u.vehicle_id,p=r[l];u.profile=p;for(var d=0;d<u.activities.length;d++){var f=u.activities[d];if(f.address=s[f.location_id],f.id)m[f.id]?f.break=m[f.id]:o[f.id]?f.service=o[f.id]:i[f.id]&&(f.shipment=i[f.id]);else{var h=y[l];f.vehicle=h,f.vehicle_type=n[h.type_id]}}}for(var g=new Array,b=0;b<e.unassigned.services.length;b++){var v=e.unassigned.services[b];g.push(o[v]),g.push(o[v])}e.unassigned_services=g;for(var w=new Array,E=0;E<e.unassigned.shipments.length;E++){var O=e.unassigned.shipments[E];w.push(i[O])}e.unassigned_shipments=w}return t})),E},t.exports=GraphHopperOptimization},553:(t,e,n)=>{var r=n(425),o=new(n(234));GraphHopperRouting=function(t,e){var n=this;this.defaults={profile:"car",debug:!1,locale:"en",points_encoded:!0,instructions:!0,elevation:!0,optimize:"false"},e&&Object.keys(e).forEach((function(t){n.defaults[t]=e[t]})),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/route",this.timeout=t.timeout?t.timeout:1e4,this.turn_sign_map=t.turn_sign_map?t.turn_sign_map:{"-6":"leave roundabout","-3":"turn sharp left","-2":"turn left","-1":"turn slight left",0:"continue",1:"turn slight right",2:"turn right",3:"turn sharp right",4:"finish",5:"reached via point",6:"enter roundabout"}},GraphHopperRouting.prototype.doRequest=function(t){var e=this;Object.keys(this.defaults).forEach((function(n){t[n]||(t[n]=e.defaults[n])}));var n=this.host+this.endpoint+"?key="+this.key,i=this;return new Promise((function(e,s){r.post(n,t,{timeout:i.timeout,headers:{"Content-Type":"application/json"}}).then((function(r){if(200===r.status){if(r.data.paths)for(var i=0;i<r.data.paths.length;i++){var a=r.data.paths[i];if(a.points_encoded){var c=o.decodePath(a.points,t.elevation);a.points={type:"LineString",coordinates:c};var u=o.decodePath(a.snapped_waypoints,t.elevation);a.snapped_waypoints={type:"LineString",coordinates:u}}if(a.instructions)for(var l=0;l<a.instructions.length;l++){var p=a.instructions[l].interval;a.instructions[l].points=a.points.coordinates.slice(p[0],p[1]+1)}}e(r.data)}else s(o.extractError(r,n))})).catch((function(t){s(o.extractError(t.response,n))}))}))},GraphHopperRouting.prototype.info=function(){var t=this;return new Promise((function(e,n){var i=t.host+"/info?key="+t.key;r.get(i,{timeout:t.timeout,headers:{"Content-Type":"application/json"}}).then((function(t){200===t.status?e(t.data):n(o.extractError(t,i))})).catch((function(t){console.log(t),n(o.extractError(t.response,i))}))}))},GraphHopperRouting.prototype.i18n=function(t){var e=t&&t.locale?t.locale:this.defaults.locale,n=this;return new Promise((function(t,i){var s=n.host+"/i18n/"+e+"?key="+n.key;r.get(s,{timeout:n.timeout,headers:{"Content-Type":"application/json"}}).then((function(e){200===e.status?t(e.data):i(o.extractError(e,s))})).catch((function(t){i(o.extractError(t.response,s))}))}))},GraphHopperRouting.prototype.getTurnText=function(t){return this.turn_sign_map[t]},t.exports=GraphHopperRouting},979:(t,e,n)=>{var r,o;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}t=n.nmd(t);var s=n(234),a=n(864),c=n(380),u=n(15),l=n(690),p=n(642),d={Util:s,Input:a,Geocoding:c,Isochrone:u,MapMatching:l,Optimization:n(382),Routing:n(553),Matrix:p};"object"===i(t)&&"object"===i(t.exports)?t.exports.GraphHopper=d:void 0===(o="function"==typeof(r=d)?r.call(e,n,e,t):r)||(t.exports=o),"undefined"!=typeof window&&(window.GraphHopper=d)},425:(t,e,n)=>{"use strict";function r(t,e){return function(){return t.apply(e,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),t=>{const e=o.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const c=t=>(t=t.toLowerCase(),e=>s(e)===t),u=t=>e=>typeof e===t,{isArray:l}=Array,p=u("undefined"),d=c("ArrayBuffer"),f=u("string"),h=u("function"),m=u("number"),y=t=>null!==t&&"object"==typeof t,g=t=>{if("object"!==s(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},b=c("Date"),v=c("File"),w=c("Blob"),E=c("FileList"),O=c("URLSearchParams"),[R,_,S,T]=["ReadableStream","Request","Response","Headers"].map(c);function x(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),l(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(r=0;r<i;r++)s=o[r],e.call(null,t[s],s,t)}}function A(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,C=t=>!p(t)&&t!==j,k=(P="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>P&&t instanceof P);var P;const N=c("HTMLFormElement"),L=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),U=c("RegExp"),F=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};x(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},B="abcdefghijklmnopqrstuvwxyz",D="0123456789",H={DIGIT:D,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+D},I=c("AsyncFunction");var q={isArray:l,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!p(t)&&null!==t.constructor&&!p(t.constructor)&&h(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||h(t.append)&&("formdata"===(e=s(t))||"object"===e&&h(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:f,isNumber:m,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:g,isReadableStream:R,isRequest:_,isResponse:S,isHeaders:T,isUndefined:p,isDate:b,isFile:v,isBlob:w,isRegExp:U,isFunction:h,isStream:t=>y(t)&&h(t.pipe),isURLSearchParams:O,isTypedArray:k,isFileList:E,forEach:x,merge:function t(){const{caseless:e}=C(this)&&this||{},n={},r=(r,o)=>{const i=e&&A(n,o)||o;g(n[i])&&g(r)?n[i]=t(n[i],r):g(r)?n[i]=t({},r):l(r)?n[i]=r.slice():n[i]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&x(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:o}={})=>(x(e,((e,o)=>{n&&h(e)?t[o]=r(e,n):t[o]=e}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,s,a;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==n&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:c,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!m(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:N,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:F,freezeMethods:t=>{F(t,((e,n)=>{if(h(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];h(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return l(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:A,global:j,isContextDefined:C,ALPHABET:H,generateString:(t=16,e=H.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&h(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=l(t)?[]:{};return x(t,((t,e)=>{const i=n(t,r+1);!p(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:I,isThenable:t=>t&&(y(t)||h(t))&&h(t.then)&&h(t.catch)};function G(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}q.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=G.prototype,z={};function J(t){return q.isPlainObject(t)||q.isArray(t)}function W(t){return q.endsWith(t,"[]")?t.slice(0,-2):t}function V(t,e,n){return t?t.concat(e).map((function(t,e){return t=W(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{z[t]={value:t}})),Object.defineProperties(G,z),Object.defineProperty(M,"isAxiosError",{value:!0}),G.from=(t,e,n,r,o,i)=>{const s=Object.create(M);return q.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),G.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const K=q.toFlatObject(q,{},null,(function(t){return/^is[A-Z]/.test(t)}));function $(t,e,n){if(!q.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!q.isUndefined(e[t])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&q.isSpecCompliantForm(e);if(!q.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(q.isDate(t))return t.toISOString();if(!a&&q.isBlob(t))throw new G("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(t)||q.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,o){let a=t;if(t&&!o&&"object"==typeof t)if(q.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(q.isArray(t)&&function(t){return q.isArray(t)&&!t.some(J)}(t)||(q.isFileList(t)||q.endsWith(n,"[]"))&&(a=q.toArray(t)))return n=W(n),a.forEach((function(t,r){!q.isUndefined(t)&&null!==t&&e.append(!0===s?V([n],r,i):null===s?n:n+"[]",c(t))})),!1;return!!J(t)||(e.append(V(o,n,i),c(t)),!1)}const l=[],p=Object.assign(K,{defaultVisitor:u,convertValue:c,isVisitable:J});if(!q.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!q.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),q.forEach(n,(function(n,i){!0===(!(q.isUndefined(n)||null===n)&&o.call(e,n,q.isString(i)?i.trim():i,r,p))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e}function Q(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function X(t,e){this._pairs=[],t&&$(t,this,e)}const Z=X.prototype;function Y(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tt(t,e,n){if(!e)return t;const r=n&&n.encode||Y,o=n&&n.serialize;let i;if(i=o?o(e,n):q.isURLSearchParams(e)?e.toString():new X(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}Z.append=function(t,e){this._pairs.push([t,e])},Z.toString=function(t){const e=t?function(e){return t.call(this,e,Q)}:Q;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var et=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){q.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ot="undefined"!=typeof window&&"undefined"!=typeof document,it=(st="undefined"!=typeof navigator&&navigator.product,ot&&["ReactNative","NativeScript","NS"].indexOf(st)<0);var st;const at="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ct=ot&&window.location.href||"http://localhost";var ut={...Object.freeze({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserWebWorkerEnv:at,hasStandardBrowserEnv:it,origin:ct}),...rt};function lt(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;return i=!i&&q.isArray(r)?r.length:i,a?(q.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&q.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&q.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!s)}if(q.isFormData(t)&&q.isFunction(t.entries)){const n={};return q.forEachEntry(t,((t,r)=>{e(function(t){return q.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const pt={transitional:nt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=q.isObject(t);if(o&&q.isHTMLForm(t)&&(t=new FormData(t)),q.isFormData(t))return r?JSON.stringify(lt(t)):t;if(q.isArrayBuffer(t)||q.isBuffer(t)||q.isStream(t)||q.isFile(t)||q.isBlob(t)||q.isReadableStream(t))return t;if(q.isArrayBufferView(t))return t.buffer;if(q.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return $(t,new ut.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return ut.isNode&&q.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=q.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return $(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(q.isString(t))try{return(0,JSON.parse)(t),q.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||pt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(q.isResponse(t)||q.isReadableStream(t))return t;if(t&&q.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw G.from(t,G.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ut.classes.FormData,Blob:ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],(t=>{pt.headers[t]={}}));var dt=pt;const ft=q.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"]),ht=Symbol("internals");function mt(t){return t&&String(t).trim().toLowerCase()}function yt(t){return!1===t||null==t?t:q.isArray(t)?t.map(yt):String(t)}function gt(t,e,n,r,o){return q.isFunction(r)?r.call(this,e,n):(o&&(e=n),q.isString(e)?q.isString(r)?-1!==e.indexOf(r):q.isRegExp(r)?r.test(e):void 0:void 0)}class bt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=mt(e);if(!o)throw new Error("header name must be a non-empty string");const i=q.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=yt(t))}const i=(t,e)=>q.forEach(t,((t,n)=>o(t,n,e)));if(q.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(q.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&ft[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(q.isHeaders(t))for(const[e,r]of t.entries())o(r,e,n);else null!=t&&o(e,t,n);return this}get(t,e){if(t=mt(t)){const n=q.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(q.isFunction(e))return e.call(this,t,n);if(q.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=mt(t)){const n=q.findKey(this,t);return!(!n||void 0===this[n]||e&&!gt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=mt(t)){const o=q.findKey(n,t);!o||e&&!gt(0,n[o],o,e)||(delete n[o],r=!0)}}return q.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!gt(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return q.forEach(this,((r,o)=>{const i=q.findKey(n,o);if(i)return e[i]=yt(r),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete e[o],e[s]=yt(r),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return q.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&q.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[ht]=this[ht]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=mt(t);e[r]||(function(t,e){const n=q.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return q.isArray(t)?t.forEach(r):r(t),this}}bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),q.reduceDescriptors(bt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),q.freezeMethods(bt);var vt=bt;function wt(t,e){const n=this||dt,r=e||n,o=vt.from(r.headers);let i=r.data;return q.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Et(t){return!(!t||!t.__CANCEL__)}function Ot(t,e,n){G.call(this,null==t?"canceled":t,G.ERR_CANCELED,e,n),this.name="CanceledError"}function Rt(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}q.inherits(Ot,G,{__CANCEL__:!0});var _t=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,p=0;for(;l!==i;)p+=n[l++],l%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(1e3*p/d):void 0}}(50,250);return function(t,e){let n=0;const r=1e3/e;let o=null;return function(){const e=!0===this,i=Date.now();if(e||i-n>r)return o&&(clearTimeout(o),o=null),n=i,t.apply(null,arguments);o||(o=setTimeout((()=>(o=null,n=Date.now(),t.apply(null,arguments))),r-(i-n)))}}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s};u[e?"download":"upload"]=!0,t(u)}),n)},St=ut.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=q.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},Tt=ut.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];q.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),q.isString(r)&&s.push("path="+r),q.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function xt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const At=t=>t instanceof vt?{...t}:t;function jt(t,e){e=e||{};const n={};function r(t,e,n){return q.isPlainObject(t)&&q.isPlainObject(e)?q.merge.call({caseless:n},t,e):q.isPlainObject(e)?q.merge({},e):q.isArray(e)?e.slice():e}function o(t,e,n){return q.isUndefined(e)?q.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function i(t,e){if(!q.isUndefined(e))return r(void 0,e)}function s(t,e){return q.isUndefined(e)?q.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e)=>o(At(t),At(e),!0)};return q.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=c[r]||o,s=i(t[r],e[r],r);q.isUndefined(s)&&i!==a||(n[r]=s)})),n}var Ct=t=>{const e=jt({},t);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;if(e.headers=a=vt.from(a),e.url=tt(xt(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),q.isFormData(r))if(ut.hasStandardBrowserEnv||ut.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(ut.hasStandardBrowserEnv&&(o&&q.isFunction(o)&&(o=o(e)),o||!1!==o&&St(e.url))){const t=i&&s&&Tt.read(s);t&&a.set(i,t)}return e},kt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Ct(t);let o=r.data;const i=vt.from(r.headers).normalize();let s,{responseType:a}=r;function c(){r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let u=new XMLHttpRequest;function l(){if(!u)return;const r=vt.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());Rt((function(t){e(t),c()}),(function(t){n(t),c()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:t,request:u}),u=null}u.open(r.method.toUpperCase(),r.url,!0),u.timeout=r.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(n(new G("Request aborted",G.ECONNABORTED,r,u)),u=null)},u.onerror=function(){n(new G("Network Error",G.ERR_NETWORK,r,u)),u=null},u.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const e=r.transitional||nt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new G(t,e.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,r,u)),u=null},void 0===o&&i.setContentType(null),"setRequestHeader"in u&&q.forEach(i.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),q.isUndefined(r.withCredentials)||(u.withCredentials=!!r.withCredentials),a&&"json"!==a&&(u.responseType=r.responseType),"function"==typeof r.onDownloadProgress&&u.addEventListener("progress",_t(r.onDownloadProgress,!0)),"function"==typeof r.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",_t(r.onUploadProgress)),(r.cancelToken||r.signal)&&(s=e=>{u&&(n(!e||e.type?new Ot(null,t,u):e),u.abort(),u=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const p=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);p&&-1===ut.protocols.indexOf(p)?n(new G("Unsupported protocol "+p+":",G.ERR_BAD_REQUEST,t)):u.send(o||null)}))},Pt=(t,e)=>{let n,r=new AbortController;const o=function(t){if(!n){n=!0,s();const e=t instanceof Error?t:this.reason;r.abort(e instanceof G?e:new Ot(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{o(new G(`timeout ${e} of ms exceeded`,G.ETIMEDOUT))}),e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t&&(t.removeEventListener?t.removeEventListener("abort",o):t.unsubscribe(o))})),t=null)};t.forEach((t=>t&&t.addEventListener&&t.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=s,[a,()=>{i&&clearTimeout(i),i=null}]};const Nt=function*(t,e){let n=t.byteLength;if(!e||n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},Lt=(t,e,n,r,o)=>{const i=async function*(t,e,n){for await(const r of t)yield*Nt(ArrayBuffer.isView(r)?r:await n(String(r)),e)}(t,e,o);let s=0;return new ReadableStream({type:"bytes",async pull(t){const{done:e,value:o}=await i.next();if(e)return t.close(),void r();let a=o.byteLength;n&&n(s+=a),t.enqueue(new Uint8Array(o))},cancel:t=>(r(t),i.return())},{highWaterMark:2})},Ut=(t,e)=>{const n=null!=t;return r=>setTimeout((()=>e({lengthComputable:n,total:t,loaded:r})))},Ft="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Bt=Ft&&"function"==typeof ReadableStream,Dt=Ft&&("function"==typeof TextEncoder?(Ht=new TextEncoder,t=>Ht.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Ht;const It=Bt&&(()=>{let t=!1;const e=new Request(ut.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),qt=Bt&&!!(()=>{try{return q.isReadableStream(new Response("").body)}catch(t){}})(),Gt={stream:qt&&(t=>t.body)};var Mt;Ft&&(Mt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!Gt[t]&&(Gt[t]=q.isFunction(Mt[t])?e=>e[t]():(e,n)=>{throw new G(`Response type '${t}' is not supported`,G.ERR_NOT_SUPPORT,n)})})));const zt={http:null,xhr:kt,fetch:Ft&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:p="same-origin",fetchOptions:d}=Ct(t);u=u?(u+"").toLowerCase():"text";let f,h,[m,y]=o||i||s?Pt([o,i],s):[];const g=()=>{!f&&setTimeout((()=>{m&&m.unsubscribe()})),f=!0};let b;try{if(c&&It&&"get"!==n&&"head"!==n&&0!==(b=await(async(t,e)=>{const n=q.toFiniteNumber(t.getContentLength());return null==n?(async t=>null==t?0:q.isBlob(t)?t.size:q.isSpecCompliantForm(t)?(await new Request(t).arrayBuffer()).byteLength:q.isArrayBufferView(t)?t.byteLength:(q.isURLSearchParams(t)&&(t+=""),q.isString(t)?(await Dt(t)).byteLength:void 0))(e):n})(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});q.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body&&(r=Lt(n.body,65536,Ut(b,_t(c)),null,Dt))}q.isString(p)||(p=p?"cors":"omit"),h=new Request(e,{...d,signal:m,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",withCredentials:p});let o=await fetch(h);const i=qt&&("stream"===u||"response"===u);if(qt&&(a||i)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=o[e]}));const e=q.toFiniteNumber(o.headers.get("content-length"));o=new Response(Lt(o.body,65536,a&&Ut(e,_t(a,!0)),i&&g,Dt),t)}u=u||"text";let s=await Gt[q.findKey(Gt,u)||"text"](o,t);return!i&&g(),y&&y(),await new Promise(((e,n)=>{Rt(e,n,{data:s,headers:vt.from(o.headers),status:o.status,statusText:o.statusText,config:t,request:h})}))}catch(e){if(g(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,t,h),{cause:e.cause||e});throw G.from(e,e&&e.code,t,h)}})};q.forEach(zt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Jt=t=>`- ${t}`,Wt=t=>q.isFunction(t)||null===t||!1===t;var Vt=t=>{t=q.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){let e;if(n=t[i],r=n,!Wt(n)&&(r=zt[(e=String(n)).toLowerCase()],void 0===r))throw new G(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+i]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new G("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Jt).join("\n"):" "+Jt(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Kt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ot(null,t)}function $t(t){return Kt(t),t.headers=vt.from(t.headers),t.data=wt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Vt(t.adapter||dt.adapter)(t).then((function(e){return Kt(t),e.data=wt.call(t,t.transformResponse,e),e.headers=vt.from(e.headers),e}),(function(e){return Et(e)||(Kt(t),e&&e.response&&(e.response.data=wt.call(t,t.transformResponse,e.response),e.response.headers=vt.from(e.response.headers))),Promise.reject(e)}))}const Qt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Qt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Xt={};Qt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.2] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new G(r(o," has been removed"+(e?" in "+e:"")),G.ERR_DEPRECATED);return e&&!Xt[o]&&(Xt[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}};var Zt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const e=t[i],n=void 0===e||s(e,i,t);if(!0!==n)throw new G("option "+i+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:Qt};const Yt=Zt.validators;class te{constructor(t){this.defaults=t,this.interceptors={request:new et,response:new et}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=jt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&Zt.assertOptions(n,{silentJSONParsing:Yt.transitional(Yt.boolean),forcedJSONParsing:Yt.transitional(Yt.boolean),clarifyTimeoutError:Yt.transitional(Yt.boolean)},!1),null!=r&&(q.isFunction(r)?e.paramsSerializer={serialize:r}:Zt.assertOptions(r,{encode:Yt.function,serialize:Yt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&q.merge(o.common,o[e.method]);o&&q.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=vt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,p=0;if(!a){const t=[$t.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);p<l;)u=u.then(t[p++],t[p++]);return u}l=s.length;let d=e;for(p=0;p<l;){const t=s[p++],e=s[p++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=$t.call(this,d)}catch(t){return Promise.reject(t)}for(p=0,l=c.length;p<l;)u=u.then(c[p++],c[p++]);return u}getUri(t){return tt(xt((t=jt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}q.forEach(["delete","get","head","options"],(function(t){te.prototype[t]=function(e,n){return this.request(jt(n||{},{method:t,url:e,data:(n||{}).data}))}})),q.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(jt(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}te.prototype[t]=e(),te.prototype[t+"Form"]=e(!0)}));var ee=te;class ne{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Ot(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new ne((function(e){t=e})),cancel:t}}}var re=ne;const oe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(oe).forEach((([t,e])=>{oe[e]=t}));var ie=oe;const se=function t(e){const n=new ee(e),o=r(ee.prototype.request,n);return q.extend(o,ee.prototype,n,{allOwnKeys:!0}),q.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(jt(e,n))},o}(dt);se.Axios=ee,se.CanceledError=Ot,se.CancelToken=re,se.isCancel=Et,se.VERSION="1.7.2",se.toFormData=$,se.AxiosError=G,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=function(t){return function(e){return t.apply(null,e)}},se.isAxiosError=function(t){return q.isObject(t)&&!0===t.isAxiosError},se.mergeConfig=jt,se.AxiosHeaders=vt,se.formToJSON=t=>lt(q.isHTMLForm(t)?new FormData(t):t),se.getAdapter=Vt,se.HttpStatusCode=ie,se.default=se,t.exports=se}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n(979)})();