frappe-react-sdk
Version:
React hooks for Frappe Framework
5 lines • 132 kB
JavaScript
(function(B,we){typeof exports=="object"&&typeof module<"u"?we(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],we):(B=typeof globalThis<"u"?globalThis:B||self,we(B["Frappe React"]={},B.jsxRuntime,B.React))})(this,function(B,we,S){"use strict";var Ja=Object.defineProperty;var Ka=(B,we,S)=>we in B?Ja(B,we,{enumerable:!0,configurable:!0,writable:!0,value:S}):B[we]=S;var it=(B,we,S)=>Ka(B,typeof we!="symbol"?we+"":we,S);var pn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ot={},St={},Ne={},ws;function bs(){if(ws)return Ne;ws=1;var t=Ne&&Ne.__assign||function(){return t=Object.assign||function(a){for(var l,o=1,d=arguments.length;o<d;o++){l=arguments[o];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},t.apply(this,arguments)},e=Ne&&Ne.__awaiter||function(a,l,o,d){function h(f){return f instanceof o?f:new o(function(y){y(f)})}return new(o||(o=Promise))(function(f,y){function _(E){try{m(d.next(E))}catch(R){y(R)}}function O(E){try{m(d.throw(E))}catch(R){y(R)}}function m(E){E.done?f(E.value):h(E.value).then(_,O)}m((d=d.apply(a,l||[])).next())})},n=Ne&&Ne.__generator||function(a,l){var o={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},d,h,f,y;return y={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function _(m){return function(E){return O([m,E])}}function O(m){if(d)throw new TypeError("Generator is already executing.");for(;y&&(y=0,m[0]&&(o=0)),o;)try{if(d=1,h&&(f=m[0]&2?h.return:m[0]?h.throw||((f=h.return)&&f.call(h),0):h.next)&&!(f=f.call(h,m[1])).done)return f;switch(h=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,h=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(f=o.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){o=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){o.label=m[1];break}if(m[0]===6&&o.label<f[1]){o.label=f[1],f=m;break}if(f&&o.label<f[2]){o.label=f[2],o.ops.push(m);break}f[2]&&o.ops.pop(),o.trys.pop();continue}m=l.call(a,o)}catch(E){m=[6,E],h=0}finally{d=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.FrappeCall=void 0;var r=function(){function a(l,o,d,h,f){this.appURL=l,this.axios=o,this.useToken=d??!1,this.token=h,this.tokenType=f}return a.prototype.get=function(l,o){return e(this,void 0,void 0,function(){var d;return n(this,function(h){return d=new URLSearchParams,o&&Object.entries(o).forEach(function(f){var y=f[0],_=f[1];if(_!=null){var O=typeof _=="object"?JSON.stringify(_):_;d.set(y,O)}}),[2,this.axios.get("/api/method/".concat(l),{params:d}).then(function(f){return f.data}).catch(function(f){var y,_;throw t(t({},f.response.data),{httpStatus:f.response.status,httpStatusText:f.response.statusText,message:(y=f.response.data.message)!==null&&y!==void 0?y:"There was an error.",exception:(_=f.response.data.exception)!==null&&_!==void 0?_:""})})]})})},a.prototype.post=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.post("/api/method/".concat(l),t({},o)).then(function(h){return h.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:(f=h.response.data.message)!==null&&f!==void 0?f:"There was an error.",exception:(y=h.response.data.exception)!==null&&y!==void 0?y:""})})]})})},a.prototype.put=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.put("/api/method/".concat(l),t({},o)).then(function(h){return h.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:(f=h.response.data.message)!==null&&f!==void 0?f:"There was an error.",exception:(y=h.response.data.exception)!==null&&y!==void 0?y:""})})]})})},a.prototype.delete=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.delete("/api/method/".concat(l),{params:o}).then(function(h){return h.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:(f=h.response.data.message)!==null&&f!==void 0?f:"There was an error.",exception:(y=h.response.data.exception)!==null&&y!==void 0?y:""})})]})})},a}();return Ne.FrappeCall=r,Ne}var ke={},_s;function vs(){if(_s)return ke;_s=1;var t=ke&&ke.__assign||function(){return t=Object.assign||function(a){for(var l,o=1,d=arguments.length;o<d;o++){l=arguments[o];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},t.apply(this,arguments)},e=ke&&ke.__awaiter||function(a,l,o,d){function h(f){return f instanceof o?f:new o(function(y){y(f)})}return new(o||(o=Promise))(function(f,y){function _(E){try{m(d.next(E))}catch(R){y(R)}}function O(E){try{m(d.throw(E))}catch(R){y(R)}}function m(E){E.done?f(E.value):h(E.value).then(_,O)}m((d=d.apply(a,l||[])).next())})},n=ke&&ke.__generator||function(a,l){var o={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},d,h,f,y;return y={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function _(m){return function(E){return O([m,E])}}function O(m){if(d)throw new TypeError("Generator is already executing.");for(;y&&(y=0,m[0]&&(o=0)),o;)try{if(d=1,h&&(f=m[0]&2?h.return:m[0]?h.throw||((f=h.return)&&f.call(h),0):h.next)&&!(f=f.call(h,m[1])).done)return f;switch(h=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,h=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(f=o.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){o=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){o.label=m[1];break}if(m[0]===6&&o.label<f[1]){o.label=f[1],f=m;break}if(f&&o.label<f[2]){o.label=f[2],o.ops.push(m);break}f[2]&&o.ops.pop(),o.trys.pop();continue}m=l.call(a,o)}catch(E){m=[6,E],h=0}finally{d=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(ke,"__esModule",{value:!0}),ke.FrappeDB=void 0;var r=function(){function a(l,o,d,h,f){this.appURL=l,this.axios=o,this.useToken=d??!1,this.token=h,this.tokenType=f}return a.prototype.getDoc=function(l,o){return o===void 0&&(o=""),e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.get("/api/resource/".concat(l,"/").concat(encodeURIComponent(o))).then(function(h){return h.data.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:"There was an error while fetching the document.",exception:(y=(f=h.response.data.exception)!==null&&f!==void 0?f:h.response.data.exc_type)!==null&&y!==void 0?y:""})})]})})},a.prototype.getDocList=function(l,o){var d;return e(this,void 0,void 0,function(){var h,f,y,_,O,m,E,R,U,J,L;return n(this,function(Z){return h={},o&&(f=o.fields,y=o.filters,_=o.orFilters,O=o.orderBy,m=o.limit,E=o.limit_start,R=o.groupBy,U=o.asDict,J=U===void 0?!0:U,L=O?"".concat(String(O==null?void 0:O.field)," ").concat((d=O==null?void 0:O.order)!==null&&d!==void 0?d:"asc"):"",h={fields:f?JSON.stringify(f):void 0,filters:y?JSON.stringify(y):void 0,or_filters:_?JSON.stringify(_):void 0,order_by:L,group_by:R,limit:m,limit_start:E,as_dict:J}),[2,this.axios.get("/api/resource/".concat(l),{params:h}).then(function(Y){return Y.data.data}).catch(function(Y){var M,oe;throw t(t({},Y.response.data),{httpStatus:Y.response.status,httpStatusText:Y.response.statusText,message:"There was an error while fetching the documents.",exception:(oe=(M=Y.response.data.exception)!==null&&M!==void 0?M:Y.response.data.exc_type)!==null&&oe!==void 0?oe:""})})]})})},a.prototype.createDoc=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.post("/api/resource/".concat(l),t({},o)).then(function(h){return h.data.data}).catch(function(h){var f,y,_;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:(f=h.response.data.message)!==null&&f!==void 0?f:"There was an error while creating the document.",exception:(_=(y=h.response.data.exception)!==null&&y!==void 0?y:h.response.data.exc_type)!==null&&_!==void 0?_:""})})]})})},a.prototype.updateDoc=function(l,o,d){return e(this,void 0,void 0,function(){return n(this,function(h){return[2,this.axios.put("/api/resource/".concat(l,"/").concat(o&&encodeURIComponent(o)),t({},d)).then(function(f){return f.data.data}).catch(function(f){var y,_,O;throw t(t({},f.response.data),{httpStatus:f.response.status,httpStatusText:f.response.statusText,message:(y=f.response.data.message)!==null&&y!==void 0?y:"There was an error while updating the document.",exception:(O=(_=f.response.data.exception)!==null&&_!==void 0?_:f.response.data.exc_type)!==null&&O!==void 0?O:""})})]})})},a.prototype.deleteDoc=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.delete("/api/resource/".concat(l,"/").concat(o&&encodeURIComponent(o))).then(function(h){return h.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:"There was an error while deleting the document.",exception:(y=(f=h.response.data.exception)!==null&&f!==void 0?f:h.response.data.exc_type)!==null&&y!==void 0?y:""})})]})})},a.prototype.getCount=function(l,o,d){return d===void 0&&(d=!1),e(this,void 0,void 0,function(){var h;return n(this,function(f){return h={doctype:l,filters:[]},d&&(h.debug=d),o&&(h.filters=o?JSON.stringify(o):void 0),[2,this.axios.get("/api/method/frappe.client.get_count",{params:h}).then(function(y){return y.data.message}).catch(function(y){var _,O;throw t(t({},y.response.data),{httpStatus:y.response.status,httpStatusText:y.response.statusText,message:"There was an error while getting the count.",exception:(O=(_=y.response.data.exception)!==null&&_!==void 0?_:y.response.data.exc_type)!==null&&O!==void 0?O:""})})]})})},a.prototype.getLastDoc=function(l,o){return e(this,void 0,void 0,function(){var d,h;return n(this,function(f){switch(f.label){case 0:return d={orderBy:{field:"creation",order:"desc"}},o&&(d=t(t({},d),o)),[4,this.getDocList(l,t(t({},d),{limit:1,fields:["name"]}))];case 1:return h=f.sent(),h.length>0?[2,this.getDoc(l,h[0].name)]:[2,{}]}})})},a.prototype.renameDoc=function(l,o,d,h){return h===void 0&&(h=!1),e(this,void 0,void 0,function(){return n(this,function(f){return[2,this.axios.post("/api/method/frappe.client.rename_doc",{doctype:l,old_name:o,new_name:d,merge:h}).then(function(y){return y.data}).catch(function(y){var _,O,m;throw t(t({},y.response.data),{httpStatus:y.response.status,httpStatusText:y.response.statusText,message:(_=y.response.data.message)!==null&&_!==void 0?_:"There was an error while renaming the document.",exception:(m=(O=y.response.data.exception)!==null&&O!==void 0?O:y.response.data.exc_type)!==null&&m!==void 0?m:""})})]})})},a.prototype.getValue=function(l,o,d,h,f,y){return h===void 0&&(h=!0),f===void 0&&(f=!1),y===void 0&&(y=null),e(this,void 0,void 0,function(){var _;return n(this,function(O){return _={doctype:l,fieldname:"[]",filters:[],as_dict:h,debug:f,parent:null},o&&(_.fieldname=typeof o=="object"?JSON.stringify(o):o),d&&(_.filters=d?JSON.stringify(d):void 0),y&&(_.parent=y),[2,this.axios.get("/api/method/frappe.client.get_value",{params:_}).then(function(m){return m.data}).catch(function(m){var E,R;throw t(t({},m.response.data),{httpStatus:m.response.status,httpStatusText:m.response.statusText,message:"There was an error while getting the value.",exception:(R=(E=m.response.data.exception)!==null&&E!==void 0?E:m.response.data.exc_type)!==null&&R!==void 0?R:""})})]})})},a.prototype.setValue=function(l,o,d,h){return e(this,void 0,void 0,function(){return n(this,function(f){return d!==null&&typeof d=="object"&&!Array.isArray(d)&&(h=void 0),[2,this.axios.post("/api/method/frappe.client.set_value",{doctype:l,name:o,fieldname:d,value:h}).then(function(y){return y.data}).catch(function(y){var _,O;throw t(t({},y.response.data),{httpStatus:y.response.status,httpStatusText:y.response.statusText,message:"There was an error while setting the value.",exception:(O=(_=y.response.data.exception)!==null&&_!==void 0?_:y.response.data.exc_type)!==null&&O!==void 0?O:""})})]})})},a.prototype.getSingleValue=function(l,o){return e(this,void 0,void 0,function(){var d;return n(this,function(h){return d={doctype:l,field:o},[2,this.axios.get("/api/method/frappe.client.get_single_value",{params:d}).then(function(f){return f.data}).catch(function(f){var y,_;throw t(t({},f.response.data),{httpStatus:f.response.status,httpStatusText:f.response.statusText,message:"There was an error while getting the value of single doctype.",exception:(_=(y=f.response.data.exception)!==null&&y!==void 0?y:f.response.data.exc_type)!==null&&_!==void 0?_:""})})]})})},a.prototype.submit=function(l){return e(this,void 0,void 0,function(){return n(this,function(o){return[2,this.axios.post("/api/method/frappe.client.submit",{doc:l}).then(function(d){return d.data.message}).catch(function(d){var h,f;throw t(t({},d.response.data),{httpStatus:d.response.status,httpStatusText:d.response.statusText,message:"There was an error while submitting the document.",exception:(f=(h=d.response.data.exception)!==null&&h!==void 0?h:d.response.data.exc_type)!==null&&f!==void 0?f:""})})]})})},a.prototype.cancel=function(l,o){return e(this,void 0,void 0,function(){return n(this,function(d){return[2,this.axios.post("/api/method/frappe.client.cancel",{doctype:l,name:o}).then(function(h){return h.data}).catch(function(h){var f,y;throw t(t({},h.response.data),{httpStatus:h.response.status,httpStatusText:h.response.statusText,message:"There was an error while cancelling the document.",exception:(y=(f=h.response.data.exception)!==null&&f!==void 0?f:h.response.data.exc_type)!==null&&y!==void 0?y:""})})]})})},a}();return ke.FrappeDB=r,ke}var Fe={},ze={};/*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */var yn,Es;function Zr(){if(Es)return yn;Es=1;function t(s,i){return function(){return s.apply(i,arguments)}}const{toString:e}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:a}=Symbol,l=(s=>i=>{const c=e.call(i);return s[c]||(s[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),o=s=>(s=s.toLowerCase(),i=>l(i)===s),d=s=>i=>typeof i===s,{isArray:h}=Array,f=d("undefined");function y(s){return s!==null&&!f(s)&&s.constructor!==null&&!f(s.constructor)&&E(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const _=o("ArrayBuffer");function O(s){let i;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?i=ArrayBuffer.isView(s):i=s&&s.buffer&&_(s.buffer),i}const m=d("string"),E=d("function"),R=d("number"),U=s=>s!==null&&typeof s=="object",J=s=>s===!0||s===!1,L=s=>{if(l(s)!=="object")return!1;const i=n(s);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(a in s)&&!(r in s)},Z=s=>{if(!U(s)||y(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},Y=o("Date"),M=o("File"),oe=s=>!!(s&&typeof s.uri<"u"),be=s=>s&&typeof s.getParts<"u",X=o("Blob"),$=o("FileList"),ee=s=>U(s)&&E(s.pipe);function se(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof pn<"u"?pn:{}}const Se=se(),me=typeof Se.FormData<"u"?Se.FormData:void 0,re=s=>{if(!s)return!1;if(me&&s instanceof me)return!0;const i=n(s);if(!i||i===Object.prototype||!E(s.append))return!1;const c=l(s);return c==="formdata"||c==="object"&&E(s.toString)&&s.toString()==="[object FormData]"},_e=o("URLSearchParams"),[Oe,fe,qe,Ze]=["ReadableStream","Request","Response","Headers"].map(o),Me=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ge(s,i,{allOwnKeys:c=!1}={}){if(s===null||typeof s>"u")return;let u,p;if(typeof s!="object"&&(s=[s]),h(s))for(u=0,p=s.length;u<p;u++)i.call(null,s[u],u,s);else{if(y(s))return;const g=c?Object.getOwnPropertyNames(s):Object.keys(s),w=g.length;let v;for(u=0;u<w;u++)v=g[u],i.call(null,s[v],v,s)}}function he(s,i){if(y(s))return null;i=i.toLowerCase();const c=Object.keys(s);let u=c.length,p;for(;u-- >0;)if(p=c[u],i===p.toLowerCase())return p;return null}const de=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:pn,Ve=s=>!f(s)&&s!==de;function et(...s){const{caseless:i,skipUndefined:c}=Ve(this)&&this||{},u={},p=(g,w)=>{if(w==="__proto__"||w==="constructor"||w==="prototype")return;const v=i&&he(u,w)||w,x=W(u,v)?u[v]:void 0;L(x)&&L(g)?u[v]=et(x,g):L(g)?u[v]=et({},g):h(g)?u[v]=g.slice():(!c||!f(g))&&(u[v]=g)};for(let g=0,w=s.length;g<w;g++)s[g]&&Ge(s[g],p);return u}const tt=(s,i,c,{allOwnKeys:u}={})=>(Ge(i,(p,g)=>{c&&E(p)?Object.defineProperty(s,g,{__proto__:null,value:t(p,c),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,g,{__proto__:null,value:p,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:u}),s),Xe=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),ut=(s,i,c,u)=>{s.prototype=Object.create(i.prototype,u),Object.defineProperty(s.prototype,"constructor",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(s,"super",{__proto__:null,value:i.prototype}),c&&Object.assign(s.prototype,c)},Qn=(s,i,c,u)=>{let p,g,w;const v={};if(i=i||{},s==null)return i;do{for(p=Object.getOwnPropertyNames(s),g=p.length;g-- >0;)w=p[g],(!u||u(w,s,i))&&!v[w]&&(i[w]=s[w],v[w]=!0);s=c!==!1&&n(s)}while(s&&(!c||c(s,i))&&s!==Object.prototype);return i},en=(s,i,c)=>{s=String(s),(c===void 0||c>s.length)&&(c=s.length),c-=i.length;const u=s.indexOf(i,c);return u!==-1&&u===c},tn=s=>{if(!s)return null;if(h(s))return s;let i=s.length;if(!R(i))return null;const c=new Array(i);for(;i-- >0;)c[i]=s[i];return c},Zn=(s=>i=>s&&i instanceof s)(typeof Uint8Array<"u"&&n(Uint8Array)),es=(s,i)=>{const u=(s&&s[r]).call(s);let p;for(;(p=u.next())&&!p.done;){const g=p.value;i.call(s,g[0],g[1])}},lt=(s,i)=>{let c;const u=[];for(;(c=s.exec(i))!==null;)u.push(c);return u},nn=o("HTMLFormElement"),Or=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(c,u,p){return u.toUpperCase()+p}),W=(({hasOwnProperty:s})=>(i,c)=>s.call(i,c))(Object.prototype),te=o("RegExp"),Q=(s,i)=>{const c=Object.getOwnPropertyDescriptors(s),u={};Ge(c,(p,g)=>{let w;(w=i(p,g,s))!==!1&&(u[g]=w||p)}),Object.defineProperties(s,u)},ne=s=>{Q(s,(i,c)=>{if(E(s)&&["arguments","caller","callee"].includes(c))return!1;const u=s[c];if(E(u)){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+c+"'")})}})},Re=(s,i)=>{const c={},u=p=>{p.forEach(g=>{c[g]=!0})};return h(s)?u(s):u(String(s).split(i)),c},ve=()=>{},ae=(s,i)=>s!=null&&Number.isFinite(s=+s)?s:i;function Te(s){return!!(s&&E(s.append)&&s[a]==="FormData"&&s[r])}const ft=s=>{const i=new Array(10),c=(u,p)=>{if(U(u)){if(i.indexOf(u)>=0)return;if(y(u))return u;if(!("toJSON"in u)){i[p]=u;const g=h(u)?[]:{};return Ge(u,(w,v)=>{const x=c(w,p+1);!f(x)&&(g[v]=x)}),i[p]=void 0,g}}return u};return c(s,0)},ht=o("AsyncFunction"),sn=s=>s&&(U(s)||E(s))&&E(s.then)&&E(s.catch),Lt=((s,i)=>s?setImmediate:i?((c,u)=>(de.addEventListener("message",({source:p,data:g})=>{p===de&&g===c&&u.length&&u.shift()()},!1),p=>{u.push(p),de.postMessage(c,"*")}))(`axios@${Math.random()}`,[]):c=>setTimeout(c))(typeof setImmediate=="function",E(de.postMessage)),Ee=typeof queueMicrotask<"u"?queueMicrotask.bind(de):typeof process<"u"&&process.nextTick||Lt;var b={isArray:h,isArrayBuffer:_,isBuffer:y,isFormData:re,isArrayBufferView:O,isString:m,isNumber:R,isBoolean:J,isObject:U,isPlainObject:L,isEmptyObject:Z,isReadableStream:Oe,isRequest:fe,isResponse:qe,isHeaders:Ze,isUndefined:f,isDate:Y,isFile:M,isReactNativeBlob:oe,isReactNative:be,isBlob:X,isRegExp:te,isFunction:E,isStream:ee,isURLSearchParams:_e,isTypedArray:Zn,isFileList:$,forEach:Ge,merge:et,extend:tt,trim:Me,stripBOM:Xe,inherits:ut,toFlatObject:Qn,kindOf:l,kindOfTest:o,endsWith:en,toArray:tn,forEachEntry:es,matchAll:lt,isHTMLForm:nn,hasOwnProperty:W,hasOwnProp:W,reduceDescriptors:Q,freezeMethods:ne,toObjectSet:Re,toCamelCase:Or,noop:ve,toFiniteNumber:ae,findKey:he,global:de,isContextDefined:Ve,isSpecCompliantForm:Te,toJSONObject:ft,isAsyncFn:ht,isThenable:sn,setImmediate:Lt,asap:Ee,isIterable:s=>s!=null&&E(s[r])};const ts=b.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"]);var Nt=s=>{const i={};let c,u,p;return s&&s.split(`
`).forEach(function(w){p=w.indexOf(":"),c=w.substring(0,p).trim().toLowerCase(),u=w.substring(p+1).trim(),!(!c||i[c]&&ts[c])&&(c==="set-cookie"?i[c]?i[c].push(u):i[c]=[u]:i[c]=i[c]?i[c]+", "+u:u)}),i};const Tr=Symbol("internals"),Xo=/[^\x09\x20-\x7E\x80-\xFF]/g;function Yo(s){let i=0,c=s.length;for(;i<c;){const u=s.charCodeAt(i);if(u!==9&&u!==32)break;i+=1}for(;c>i;){const u=s.charCodeAt(c-1);if(u!==9&&u!==32)break;c-=1}return i===0&&c===s.length?s:s.slice(i,c)}function kt(s){return s&&String(s).trim().toLowerCase()}function Qo(s){return Yo(s.replace(Xo,""))}function rn(s){return s===!1||s==null?s:b.isArray(s)?s.map(rn):Qo(String(s))}function Zo(s){const i=Object.create(null),c=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=c.exec(s);)i[u[1]]=u[2];return i}const ea=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ns(s,i,c,u,p){if(b.isFunction(u))return u.call(this,i,c);if(p&&(i=c),!!b.isString(i)){if(b.isString(u))return i.indexOf(u)!==-1;if(b.isRegExp(u))return u.test(i)}}function ta(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(i,c,u)=>c.toUpperCase()+u)}function na(s,i){const c=b.toCamelCase(" "+i);["get","set","has"].forEach(u=>{Object.defineProperty(s,u+c,{__proto__:null,value:function(p,g,w){return this[u].call(this,i,p,g,w)},configurable:!0})})}class ge{constructor(i){i&&this.set(i)}set(i,c,u){const p=this;function g(v,x,C){const T=kt(x);if(!T)throw new Error("header name must be a non-empty string");const F=b.findKey(p,T);(!F||p[F]===void 0||C===!0||C===void 0&&p[F]!==!1)&&(p[F||x]=rn(v))}const w=(v,x)=>b.forEach(v,(C,T)=>g(C,T,x));if(b.isPlainObject(i)||i instanceof this.constructor)w(i,c);else if(b.isString(i)&&(i=i.trim())&&!ea(i))w(Nt(i),c);else if(b.isObject(i)&&b.isIterable(i)){let v={},x,C;for(const T of i){if(!b.isArray(T))throw TypeError("Object iterator must return a key-value pair");v[C=T[0]]=(x=v[C])?b.isArray(x)?[...x,T[1]]:[x,T[1]]:T[1]}w(v,c)}else i!=null&&g(c,i,u);return this}get(i,c){if(i=kt(i),i){const u=b.findKey(this,i);if(u){const p=this[u];if(!c)return p;if(c===!0)return Zo(p);if(b.isFunction(c))return c.call(this,p,u);if(b.isRegExp(c))return c.exec(p);throw new TypeError("parser must be boolean|regexp|function")}}}has(i,c){if(i=kt(i),i){const u=b.findKey(this,i);return!!(u&&this[u]!==void 0&&(!c||ns(this,this[u],u,c)))}return!1}delete(i,c){const u=this;let p=!1;function g(w){if(w=kt(w),w){const v=b.findKey(u,w);v&&(!c||ns(u,u[v],v,c))&&(delete u[v],p=!0)}}return b.isArray(i)?i.forEach(g):g(i),p}clear(i){const c=Object.keys(this);let u=c.length,p=!1;for(;u--;){const g=c[u];(!i||ns(this,this[g],g,i,!0))&&(delete this[g],p=!0)}return p}normalize(i){const c=this,u={};return b.forEach(this,(p,g)=>{const w=b.findKey(u,g);if(w){c[w]=rn(p),delete c[g];return}const v=i?ta(g):String(g).trim();v!==g&&delete c[g],c[v]=rn(p),u[v]=!0}),this}concat(...i){return this.constructor.concat(this,...i)}toJSON(i){const c=Object.create(null);return b.forEach(this,(u,p)=>{u!=null&&u!==!1&&(c[p]=i&&b.isArray(u)?u.join(", "):u)}),c}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([i,c])=>i+": "+c).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...c){const u=new this(i);return c.forEach(p=>u.set(p)),u}static accessor(i){const u=(this[Tr]=this[Tr]={accessors:{}}).accessors,p=this.prototype;function g(w){const v=kt(w);u[v]||(na(p,w),u[v]=!0)}return b.isArray(i)?i.forEach(g):g(i),this}}ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),b.reduceDescriptors(ge.prototype,({value:s},i)=>{let c=i[0].toUpperCase()+i.slice(1);return{get:()=>s,set(u){this[c]=u}}}),b.freezeMethods(ge);const sa="[REDACTED ****]";function ra(s){if(b.hasOwnProp(s,"toJSON"))return!0;let i=Object.getPrototypeOf(s);for(;i&&i!==Object.prototype;){if(b.hasOwnProp(i,"toJSON"))return!0;i=Object.getPrototypeOf(i)}return!1}function ia(s,i){const c=new Set(i.map(g=>String(g).toLowerCase())),u=[],p=g=>{if(g===null||typeof g!="object"||b.isBuffer(g))return g;if(u.indexOf(g)!==-1)return;g instanceof ge&&(g=g.toJSON()),u.push(g);let w;if(b.isArray(g))w=[],g.forEach((v,x)=>{const C=p(v);b.isUndefined(C)||(w[x]=C)});else{if(!b.isPlainObject(g)&&ra(g))return u.pop(),g;w=Object.create(null);for(const[v,x]of Object.entries(g)){const C=c.has(v.toLowerCase())?sa:p(x);b.isUndefined(C)||(w[v]=C)}}return u.pop(),w};return p(s)}class D extends Error{static from(i,c,u,p,g,w){const v=new D(i.message,c||i.code,u,p,g);return v.cause=i,v.name=i.name,i.status!=null&&v.status==null&&(v.status=i.status),w&&Object.assign(v,w),v}constructor(i,c,u,p,g){super(i),Object.defineProperty(this,"message",{__proto__:null,value:i,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,c&&(this.code=c),u&&(this.config=u),p&&(this.request=p),g&&(this.response=g,this.status=g.status)}toJSON(){const i=this.config,c=i&&b.hasOwnProp(i,"redact")?i.redact:void 0,u=b.isArray(c)&&c.length>0?ia(i,c):b.toJSONObject(i);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:u,code:this.code,status:this.status}}}D.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",D.ERR_BAD_OPTION="ERR_BAD_OPTION",D.ECONNABORTED="ECONNABORTED",D.ETIMEDOUT="ETIMEDOUT",D.ECONNREFUSED="ECONNREFUSED",D.ERR_NETWORK="ERR_NETWORK",D.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",D.ERR_DEPRECATED="ERR_DEPRECATED",D.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",D.ERR_BAD_REQUEST="ERR_BAD_REQUEST",D.ERR_CANCELED="ERR_CANCELED",D.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",D.ERR_INVALID_URL="ERR_INVALID_URL",D.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var oa=null;function ss(s){return b.isPlainObject(s)||b.isArray(s)}function Cr(s){return b.endsWith(s,"[]")?s.slice(0,-2):s}function rs(s,i,c){return s?s.concat(i).map(function(p,g){return p=Cr(p),!c&&g?"["+p+"]":p}).join(c?".":""):i}function aa(s){return b.isArray(s)&&!s.some(ss)}const ca=b.toFlatObject(b,{},null,function(i){return/^is[A-Z]/.test(i)});function on(s,i,c){if(!b.isObject(s))throw new TypeError("target must be an object");i=i||new FormData,c=b.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,k){return!b.isUndefined(k[A])});const u=c.metaTokens,p=c.visitor||F,g=c.dots,w=c.indexes,v=c.Blob||typeof Blob<"u"&&Blob,x=c.maxDepth===void 0?100:c.maxDepth,C=v&&b.isSpecCompliantForm(i);if(!b.isFunction(p))throw new TypeError("visitor must be a function");function T(N){if(N===null)return"";if(b.isDate(N))return N.toISOString();if(b.isBoolean(N))return N.toString();if(!C&&b.isBlob(N))throw new D("Blob is not supported. Use a Buffer instead.");return b.isArrayBuffer(N)||b.isTypedArray(N)?C&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function F(N,A,k){let K=N;if(b.isReactNative(i)&&b.isReactNativeBlob(N))return i.append(rs(k,A,g),T(N)),!1;if(N&&!k&&typeof N=="object"){if(b.endsWith(A,"{}"))A=u?A:A.slice(0,-2),N=JSON.stringify(N);else if(b.isArray(N)&&aa(N)||(b.isFileList(N)||b.endsWith(A,"[]"))&&(K=b.toArray(N)))return A=Cr(A),K.forEach(function(H,De){!(b.isUndefined(H)||H===null)&&i.append(w===!0?rs([A],De,g):w===null?A:A+"[]",T(H))}),!1}return ss(N)?!0:(i.append(rs(k,A,g),T(N)),!1)}const V=[],q=Object.assign(ca,{defaultVisitor:F,convertValue:T,isVisitable:ss});function j(N,A,k=0){if(!b.isUndefined(N)){if(k>x)throw new D("Object is too deeply nested ("+k+" levels). Max depth: "+x,D.ERR_FORM_DATA_DEPTH_EXCEEDED);if(V.indexOf(N)!==-1)throw Error("Circular reference detected in "+A.join("."));V.push(N),b.forEach(N,function(z,H){(!(b.isUndefined(z)||z===null)&&p.call(i,z,b.isString(H)?H.trim():H,A,q))===!0&&j(z,A?A.concat(H):[H],k+1)}),V.pop()}}if(!b.isObject(s))throw new TypeError("data must be an object");return j(s),i}function xr(s){const i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(s).replace(/[!'()~]|%20/g,function(u){return i[u]})}function is(s,i){this._pairs=[],s&&on(s,this,i)}const Rr=is.prototype;Rr.append=function(i,c){this._pairs.push([i,c])},Rr.toString=function(i){const c=i?function(u){return i.call(this,u,xr)}:xr;return this._pairs.map(function(p){return c(p[0])+"="+c(p[1])},"").join("&")};function ua(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ar(s,i,c){if(!i)return s;const u=c&&c.encode||ua,p=b.isFunction(c)?{serialize:c}:c,g=p&&p.serialize;let w;if(g?w=g(i,p):w=b.isURLSearchParams(i)?i.toString():new is(i,p).toString(u),w){const v=s.indexOf("#");v!==-1&&(s=s.slice(0,v)),s+=(s.indexOf("?")===-1?"?":"&")+w}return s}class Dr{constructor(){this.handlers=[]}use(i,c,u){return this.handlers.push({fulfilled:i,rejected:c,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(i){this.handlers[i]&&(this.handlers[i]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(i){b.forEach(this.handlers,function(u){u!==null&&i(u)})}}var os={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},la=typeof URLSearchParams<"u"?URLSearchParams:is,fa=typeof FormData<"u"?FormData:null,ha=typeof Blob<"u"?Blob:null,da={isBrowser:!0,classes:{URLSearchParams:la,FormData:fa,Blob:ha},protocols:["http","https","file","blob","url","data"]};const as=typeof window<"u"&&typeof document<"u",cs=typeof navigator=="object"&&navigator||void 0,pa=as&&(!cs||["ReactNative","NativeScript","NS"].indexOf(cs.product)<0),ya=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ma=as&&window.location.href||"http://localhost";var ga=Object.freeze({__proto__:null,hasBrowserEnv:as,hasStandardBrowserEnv:pa,hasStandardBrowserWebWorkerEnv:ya,navigator:cs,origin:ma}),pe={...ga,...da};function wa(s,i){return on(s,new pe.classes.URLSearchParams,{visitor:function(c,u,p,g){return pe.isNode&&b.isBuffer(c)?(this.append(u,c.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...i})}function ba(s){return b.matchAll(/\w+|\[(\w*)]/g,s).map(i=>i[0]==="[]"?"":i[1]||i[0])}function _a(s){const i={},c=Object.keys(s);let u;const p=c.length;let g;for(u=0;u<p;u++)g=c[u],i[g]=s[g];return i}function Lr(s){function i(c,u,p,g){let w=c[g++];if(w==="__proto__")return!0;const v=Number.isFinite(+w),x=g>=c.length;return w=!w&&b.isArray(p)?p.length:w,x?(b.hasOwnProp(p,w)?p[w]=b.isArray(p[w])?p[w].concat(u):[p[w],u]:p[w]=u,!v):((!p[w]||!b.isObject(p[w]))&&(p[w]=[]),i(c,u,p[w],g)&&b.isArray(p[w])&&(p[w]=_a(p[w])),!v)}if(b.isFormData(s)&&b.isFunction(s.entries)){const c={};return b.forEachEntry(s,(u,p)=>{i(ba(u),p,c,0)}),c}return null}const _t=(s,i)=>s!=null&&b.hasOwnProp(s,i)?s[i]:void 0;function va(s,i,c){if(b.isString(s))try{return(i||JSON.parse)(s),b.trim(s)}catch(u){if(u.name!=="SyntaxError")throw u}return(c||JSON.stringify)(s)}const Ft={transitional:os,adapter:["xhr","http","fetch"],transformRequest:[function(i,c){const u=c.getContentType()||"",p=u.indexOf("application/json")>-1,g=b.isObject(i);if(g&&b.isHTMLForm(i)&&(i=new FormData(i)),b.isFormData(i))return p?JSON.stringify(Lr(i)):i;if(b.isArrayBuffer(i)||b.isBuffer(i)||b.isStream(i)||b.isFile(i)||b.isBlob(i)||b.isReadableStream(i))return i;if(b.isArrayBufferView(i))return i.buffer;if(b.isURLSearchParams(i))return c.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let v;if(g){const x=_t(this,"formSerializer");if(u.indexOf("application/x-www-form-urlencoded")>-1)return wa(i,x).toString();if((v=b.isFileList(i))||u.indexOf("multipart/form-data")>-1){const C=_t(this,"env"),T=C&&C.FormData;return on(v?{"files[]":i}:i,T&&new T,x)}}return g||p?(c.setContentType("application/json",!1),va(i)):i}],transformResponse:[function(i){const c=_t(this,"transitional")||Ft.transitional,u=c&&c.forcedJSONParsing,p=_t(this,"responseType"),g=p==="json";if(b.isResponse(i)||b.isReadableStream(i))return i;if(i&&b.isString(i)&&(u&&!p||g)){const v=!(c&&c.silentJSONParsing)&&g;try{return JSON.parse(i,_t(this,"parseReviver"))}catch(x){if(v)throw x.name==="SyntaxError"?D.from(x,D.ERR_BAD_RESPONSE,this,null,_t(this,"response")):x}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};b.forEach(["delete","get","head","post","put","patch","query"],s=>{Ft.headers[s]={}});function us(s,i){const c=this||Ft,u=i||c,p=ge.from(u.headers);let g=u.data;return b.forEach(s,function(v){g=v.call(c,g,p.normalize(),i?i.status:void 0)}),p.normalize(),g}function Nr(s){return!!(s&&s.__CANCEL__)}class Pt extends D{constructor(i,c,u){super(i??"canceled",D.ERR_CANCELED,c,u),this.name="CanceledError",this.__CANCEL__=!0}}function kr(s,i,c){const u=c.config.validateStatus;!c.status||!u||u(c.status)?s(c):i(new D("Request failed with status code "+c.status,c.status>=400&&c.status<500?D.ERR_BAD_REQUEST:D.ERR_BAD_RESPONSE,c.config,c.request,c))}function Ea(s){const i=/^([-+\w]{1,25}):(?:\/\/)?/.exec(s);return i&&i[1]||""}function Sa(s,i){s=s||10;const c=new Array(s),u=new Array(s);let p=0,g=0,w;return i=i!==void 0?i:1e3,function(x){const C=Date.now(),T=u[g];w||(w=C),c[p]=x,u[p]=C;let F=g,V=0;for(;F!==p;)V+=c[F++],F=F%s;if(p=(p+1)%s,p===g&&(g=(g+1)%s),C-w<i)return;const q=T&&C-T;return q?Math.round(V*1e3/q):void 0}}function Oa(s,i){let c=0,u=1e3/i,p,g;const w=(C,T=Date.now())=>{c=T,p=null,g&&(clearTimeout(g),g=null),s(...C)};return[(...C)=>{const T=Date.now(),F=T-c;F>=u?w(C,T):(p=C,g||(g=setTimeout(()=>{g=null,w(p)},u-F)))},()=>p&&w(p)]}const an=(s,i,c=3)=>{let u=0;const p=Sa(50,250);return Oa(g=>{const w=g.loaded,v=g.lengthComputable?g.total:void 0,x=v!=null?Math.min(w,v):w,C=Math.max(0,x-u),T=p(C);u=Math.max(u,x);const F={loaded:x,total:v,progress:v?x/v:void 0,bytes:C,rate:T||void 0,estimated:T&&v?(v-x)/T:void 0,event:g,lengthComputable:v!=null,[i?"download":"upload"]:!0};s(F)},c)},Fr=(s,i)=>{const c=s!=null;return[u=>i[0]({lengthComputable:c,total:s,loaded:u}),i[1]]},Pr=s=>(...i)=>b.asap(()=>s(...i));var Ta=pe.hasStandardBrowserEnv?((s,i)=>c=>(c=new URL(c,pe.origin),s.protocol===c.protocol&&s.host===c.host&&(i||s.port===c.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Ca=pe.hasStandardBrowserEnv?{write(s,i,c,u,p,g,w){if(typeof document>"u")return;const v=[`${s}=${encodeURIComponent(i)}`];b.isNumber(c)&&v.push(`expires=${new Date(c).toUTCString()}`),b.isString(u)&&v.push(`path=${u}`),b.isString(p)&&v.push(`domain=${p}`),g===!0&&v.push("secure"),b.isString(w)&&v.push(`SameSite=${w}`),document.cookie=v.join("; ")},read(s){if(typeof document>"u")return null;const i=document.cookie.split(";");for(let c=0;c<i.length;c++){const u=i[c].replace(/^\s+/,""),p=u.indexOf("=");if(p!==-1&&u.slice(0,p)===s)return decodeURIComponent(u.slice(p+1))}return null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function xa(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Ra(s,i){return i?s.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):s}function Br(s,i,c){let u=!xa(i);return s&&(u||c===!1)?Ra(s,i):i}const Ur=s=>s instanceof ge?{...s}:s;function dt(s,i){i=i||{};const c=Object.create(null);Object.defineProperty(c,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function u(C,T,F,V){return b.isPlainObject(C)&&b.isPlainObject(T)?b.merge.call({caseless:V},C,T):b.isPlainObject(T)?b.merge({},T):b.isArray(T)?T.slice():T}function p(C,T,F,V){if(b.isUndefined(T)){if(!b.isUndefined(C))return u(void 0,C,F,V)}else return u(C,T,F,V)}function g(C,T){if(!b.isUndefined(T))return u(void 0,T)}function w(C,T){if(b.isUndefined(T)){if(!b.isUndefined(C))return u(void 0,C)}else return u(void 0,T)}function v(C,T,F){if(b.hasOwnProp(i,F))return u(C,T);if(b.hasOwnProp(s,F))return u(void 0,C)}const x={url:g,method:g,data:g,baseURL:w,transformRequest:w,transformResponse:w,paramsSerializer:w,timeout:w,timeoutMessage:w,withCredentials:w,withXSRFToken:w,adapter:w,responseType:w,xsrfCookieName:w,xsrfHeaderName:w,onUploadProgress:w,onDownloadProgress:w,decompress:w,maxContentLength:w,maxBodyLength:w,beforeRedirect:w,transport:w,httpAgent:w,httpsAgent:w,cancelToken:w,socketPath:w,allowedSocketPaths:w,responseEncoding:w,validateStatus:v,headers:(C,T,F)=>p(Ur(C),Ur(T),F,!0)};return b.forEach(Object.keys({...s,...i}),function(T){if(T==="__proto__"||T==="constructor"||T==="prototype")return;const F=b.hasOwnProp(x,T)?x[T]:p,V=b.hasOwnProp(s,T)?s[T]:void 0,q=b.hasOwnProp(i,T)?i[T]:void 0,j=F(V,q,T);b.isUndefined(j)&&F!==v||(c[T]=j)}),c}const Aa=["content-type","content-length"];function Da(s,i,c){if(c!=="content-only"){s.set(i);return}Object.entries(i).forEach(([u,p])=>{Aa.includes(u.toLowerCase())&&s.set(u,p)})}const La=s=>encodeURIComponent(s).replace(/%([0-9A-F]{2})/gi,(i,c)=>String.fromCharCode(parseInt(c,16)));var qr=s=>{const i=dt({},s),c=V=>b.hasOwnProp(i,V)?i[V]:void 0,u=c("data");let p=c("withXSRFToken");const g=c("xsrfHeaderName"),w=c("xsrfCookieName");let v=c("headers");const x=c("auth"),C=c("baseURL"),T=c("allowAbsoluteUrls"),F=c("url");if(i.headers=v=ge.from(v),i.url=Ar(Br(C,F,T),s.params,s.paramsSerializer),x&&v.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?La(x.password):""))),b.isFormData(u)&&(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv?v.setContentType(void 0):b.isFunction(u.getHeaders)&&Da(v,u.getHeaders(),c("formDataHeaderPolicy"))),pe.hasStandardBrowserEnv&&(b.isFunction(p)&&(p=p(i)),p===!0||p==null&&Ta(i.url))){const q=g&&w&&Ca.read(w);q&&v.set(g,q)}return i},Na=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(c,u){const p=qr(s);let g=p.data;const w=ge.from(p.headers).normalize();let{responseType:v,onUploadProgress:x,onDownloadProgress:C}=p,T,F,V,q,j;function N(){q&&q(),j&&j(),p.cancelToken&&p.cancelToken.unsubscribe(T),p.signal&&p.signal.removeEventListener("abort",T)}let A=new XMLHttpRequest;A.open(p.method.toUpperCase(),p.url,!0),A.timeout=p.timeout;function k(){if(!A)return;const z=ge.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),De={data:!v||v==="text"||v==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:z,config:s,request:A};kr(function(Bt){c(Bt),N()},function(Bt){u(Bt),N()},De),A=null}"onloadend"in A?A.onloadend=k:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.startsWith("file:"))||setTimeout(k)},A.onabort=function(){A&&(u(new D("Request aborted",D.ECONNABORTED,s,A)),N(),A=null)},A.onerror=function(H){const De=H&&H.message?H.message:"Network Error",yt=new D(De,D.ERR_NETWORK,s,A);yt.event=H||null,u(yt),N(),A=null},A.ontimeout=function(){let H=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const De=p.transitional||os;p.timeoutErrorMessage&&(H=p.timeoutErrorMessage),u(new D(H,De.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,s,A)),N(),A=null},g===void 0&&w.setContentType(null),"setRequestHeader"in A&&b.forEach(w.toJSON(),function(H,De){A.setRequestHeader(De,H)}),b.isUndefined(p.withCredentials)||(A.withCredentials=!!p.withCredentials),v&&v!=="json"&&(A.responseType=p.responseType),C&&([V,j]=an(C,!0),A.addEventListener("progress",V)),x&&A.upload&&([F,q]=an(x),A.upload.addEventListener("progress",F),A.upload.addEventListener("loadend",q)),(p.cancelToken||p.signal)&&(T=z=>{A&&(u(!z||z.type?new Pt(null,s,A):z),A.abort(),N(),A=null)},p.cancelToken&&p.cancelToken.subscribe(T),p.signal&&(p.signal.aborted?T():p.signal.addEventListener("abort",T)));const K=Ea(p.url);if(K&&!pe.protocols.includes(K)){u(new D("Unsupported protocol "+K+":",D.ERR_BAD_REQUEST,s));return}A.send(g||null)})};const ka=(s,i)=>{const{length:c}=s=s?s.filter(Boolean):[];if(i||c){let u=new AbortController,p;const g=function(C){if(!p){p=!0,v();const T=C instanceof Error?C:this.reason;u.abort(T instanceof D?T:new Pt(T instanceof Error?T.message:T))}};let w=i&&setTimeout(()=>{w=null,g(new D(`timeout of ${i}ms exceeded`,D.ETIMEDOUT))},i);const v=()=>{s&&(w&&clearTimeout(w),w=null,s.forEach(C=>{C.unsubscribe?C.unsubscribe(g):C.removeEventListener("abort",g)}),s=null)};s.forEach(C=>C.addEventListener("abort",g));const{signal:x}=u;return x.unsubscribe=()=>b.asap(v),x}},Fa=function*(s,i){let c=s.byteLength;if(c<i){yield s;return}let u=0,p;for(;u<c;)p=u+i,yield s.slice(u,p),u=p},Pa=async function*(s,i){for await(const c of Ba(s))yield*Fa(c,i)},Ba=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const i=s.getReader();try{for(;;){const{done:c,value:u}=await i.read();if(c)break;yield u}}finally{await i.cancel()}},Ir=(s,i,c,u)=>{const p=Pa(s,i);let g=0,w,v=x=>{w||(w=!0,u&&u(x))};return new ReadableStream({async pull(x){try{const{done:C,value:T}=await p.next();if(C){v(),x.close();return}let F=T.byteLength;if(c){let V=g+=F;c(V)}x.enqueue(new Uint8Array(T))}catch(C){throw v(C),C}},cancel(x){return v(x),p.return()}},{highWaterMark:2})};function Ua(s){if(!s||typeof s!="string"||!s.startsWith("data:"))return 0;const i=s.indexOf(",");if(i<0)return 0;const c=s.slice(5,i),u=s.slice(i+1);if(/;base64/i.test(c)){let w=u.length;const v=u.length;for(let q=0;q<v;q++)if(u.charCodeAt(q)===37&&q+2<v){const j=u.charCodeAt(q+1),N=u.charCodeAt(q+2);(j>=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102)&&(N>=48&&N<=57||N>=65&&N<=70||N>=97&&N<=102)&&(w-=2,q+=2)}let x=0,C=v-1;const T=q=>q>=2&&u.charCodeAt(q-2)===37&&u.charCodeAt(q-1)===51&&(u.charCodeAt(q)===68||u.charCodeAt(q)===100);C>=0&&(u.charCodeAt(C)===61?(x++,C--):T(C)&&(x++,C-=3)),x===1&&C>=0&&(u.charCodeAt(C)===61||T(C))&&x++;const V=Math.floor(w/4)*3-(x||0);return V>0?V:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(u,"utf8");let g=0;for(let w=0,v=u.length;w<v;w++){const x=u.charCodeAt(w);if(x<128)g+=1;else if(x<2048)g+=2;else if(x>=55296&&x<=56319&&w+1<v){const C=u.charCodeAt(w+1);C>=56320&&C<=57343?(g+=4,w++):g+=3}else g+=3}return g}const ls="1.16.0",jr=64*1024,{isFunction:cn}=b,Mr=(s,...i)=>{try{return!!s(...i)}catch{return!1}},qa=s=>{const i=b.global??globalThis,{ReadableStream:c,TextEncoder:u}=i;s=b.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},s);const{fetch:p,Request:g,Response:w}=s,v=p?cn(p):typeof fetch=="function",x=cn(g),C=cn(w);if(!v)return!1;const T=v&&cn(c),F=v&&(typeof u=="function"?(k=>K=>k.encode(K))(new u):async k=>new Uint8Array(await new g(k).arrayBuffer())),V=x&&T&&Mr(()=>{let k=!1;const K=new g(pe.origin,{body:new c,method:"POST",get duplex(){return k=!0,"half"}}),z=K.headers.has("Content-Type");return K.body!=null&&K.body.cancel(),k&&!z}),q=C&&T&&Mr(()=>b.isReadableStream(new w("").body)),j={stream:q&&(k=>k.body)};v&&["text","arrayBuffer","blob","formData","stream"].forEach(k=>{!j[k]&&(j[k]=(K,z)=>{let H=K&&K[k];if(H)return H.call(K);throw new D(`Response type '${k}' is not supported`,D.ERR_NOT_SUPPORT,z)})});const N=async k=>{if(k==null)return 0;if(b.isBlob(k))return k.size;if(b.isSpecCompliantForm(k))return(await new g(pe.origin,{method:"POST",body:k}).arrayBuffer()).byteLength;if(b.isArrayBufferView(k)||b.isArrayBuffer(k))return k.byteLength;if(b.isURLSearchParams(k)&&(k=k+""),b.isString(k))return(await F(k)).byteLength},A=async(k,K)=>{const z=b.toFiniteNumber(k.getContentLength());return z??N(K)};return async k=>{let{url:K,method:z,data:H,signal:De,cancelToken:yt,timeout:Bt,onDownloadProgress:ys,onUploadProgress:Kr,responseType:nt,headers:mt,withCredentials:fn="same-origin",fetchOptions:Gr,maxContentLength:He,maxBodyLength:ms}=qr(k);const Ut=b.isNumber(He)&&He>-1,Wa=b.isNumber(ms)&&ms>-1;let Xr=p||fetch;nt=nt?(nt+"").toLowerCase():"text";let st=ka([De,yt&&yt.toAbortSignal()],Bt),Le=null;const gt=st&&st.unsubscribe&&(()=>{st.unsubscribe()});let Yr;try{if(Ut&&typeof K=="string"&&K.startsWith("data:")&&Ua(K)>He)throw new D("maxContentLength size of "+He+" exceeded",D.ERR_BAD_RESPONSE,k,Le);if(Wa&&z!=="get"&&z!=="head"){const G=await A(mt,H);if(typeof G=="number"&&isFinite(G)&&G>ms)throw new D("Request body larger than maxBodyLength limit",D.ERR_BAD_REQUEST,k,Le)}if(Kr&&V&&z!=="get"&&z!=="head"&&(Yr=await A(mt,H))!==0){let G=new g(K,{method:"POST",body:H,duplex:"half"}),vt;if(b.isFormData(H)&&(vt=G.headers.get("content-type"))&&mt.setContentType(vt),G.body){const[hn,dn]=Fr(Yr,an(Pr(Kr)));H=Ir(G.body,jr,hn,dn)}}b.isString(fn)||(fn=fn?"include":"omit");const ye=x&&"credentials"in g.prototype;if(b.isFormData(H)){const G=mt.getContentType();G&&/^multipart\/form-data/i.test(G)&&!/boundary=/i.test(G)&&mt.delete("content-type")}mt.set("User-Agent","axios/"+ls,!1);const rt={...Gr,signal:st,method:z.toUpperCase(),headers:mt.normalize().toJSON(),body:H,duplex:"half",credentials:ye?fn:void 0};Le=x&&new g(K,rt);let We=await(x?Xr(Le,Gr):Xr(K,rt));if(Ut){const G=b.toFiniteNumber(We.headers.get("content-length"));if(G!=null&&G>He)throw new D("maxContentLength size of "+He+" exceeded",D.ERR_BAD_RESPONSE,k,Le)}const gs=q&&(nt==="stream"||nt==="response");if(q&&We.body&&(ys||Ut||gs&>)){const G={};["status","statusText","headers"].forEach(qt=>{G[qt]=We[qt]});const vt=b.toFiniteNumber(We.headers.get("content-length")),[hn,dn]=ys&&Fr(vt,an(Pr(ys),!0))||[];let Qr=0;const za=qt=>{if(Ut&&(Qr=qt,Qr>He))throw new D("maxContentLength size of "+He+" exceeded",D.ERR_BAD_RESPONSE,k,Le);hn&&hn(qt)};We=new w(Ir(We.body,jr,za,()=>{dn&&dn(),gt&>()}),G)}nt=nt||"text";let Ye=await j[b.findKey(j,nt)||"text"](We,k);if(Ut&&!q&&!gs){let G;if(Ye!=null&&(typeof Ye.byteLength=="number"?G=Ye.byteLength:typeof Ye.size=="number"?G=Ye.size:typeof Ye=="string"&&(G=typeof u=="function"?new u().encode(Ye).byteLength:Ye.length)),typeof G=="number"&&G>He)throw new D("maxContentLength size of "+He+" exceeded",D.ERR_BAD_RESPONSE,k,Le)}return!gs&>&>(),await new Promise((G,vt)=>{kr(G,vt,{data:Ye,headers:ge.from(We.headers),status:We.status,statusText:We.statusText,config:k,request:Le})})}catch(ye){if(gt&>(),st&&st.aborted&&st.reason instanceof D){const rt=st.reason;throw rt.config=k,Le&&(rt.request=Le),ye!==rt&&(rt.cause=ye),rt}throw ye&&ye.name==="TypeError"&&/Load failed|fetch/i.test(ye.message)?Object.assign(new D("Network Error",D.ERR_NETWORK,k,Le,ye&&ye.response),{cause:ye.cause||ye}):D.from(ye,ye&&ye.code,k,Le,ye&&ye.response)}}},Ia=new Map,Vr=s=>{let i=s&&s.env||{};const{fetch:c,Request:u,Response:p}=i,g=[u,p,c];let w=g.length,v=w,x,C,T=Ia;for(;v--;)x=g[v],C=T.get(x),C===void 0&&T.set(x,C=v?new Map:qa(i)),T=C;return C};Vr();const fs={http:oa,xhr:Na,fetch:{get:Vr}};b.forEach(fs,(s,i)=>{if(s){try{Object.defineProperty(s,"name",{__proto__:null,value:i})}catch{}Object.defineProperty(s,"adapterName",{__proto__:null,value:i})}});const $r=s=>`- ${s}`,ja=s=>b.isFunction(s)||s===null||s===!1;function Ma(s,i){s=b.isArray(s)?s:[s];const{length:c}=s;let u,p;const g={};for(let w=0;w<c;w++){u=s[w];let v;if(p=u,!ja(u)&&(p=fs[(v=String(u)).toLowerCase()],p===void 0))throw new D(`Unknown adapter '${v}'`);if(p&&(b.isFunction(p)||(p=p.get(i))))break;g[v||"#"+w]=p}if(!p){const w=Object.entries(g).map(([x,C])=>`adapter ${x} `+(C===!1?"is not supported by the environment":"is not available in the build"));let v=c?w.length>1?`since :
`+w.map($r).join(`
`):" "+$r(w[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return p}var Hr={getAdapter:Ma,adapters:fs};function hs(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Pt(null,s)}function Wr(s){return hs(s),s.headers=ge.from(s.headers),s.data=us.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Hr.getAdapter(s.adapter||Ft.adapter,s)(s).then(function(u){hs(s),s.response=u;try{u.data=us.call(s,s.transformResponse,u)}finally{delete s.response}return u.headers=ge.from(u.headers),u},function(u){if(!Nr(u)&&(hs(s),u&&u.response)){s.response=u.response;try{u.response.data=us.call(s,s.transformResponse,u.response)}finally{delete s.response}u.response.headers=ge.from(u.response.headers)}return Promise.reject(u)})}const un={};["object","boolean","number","function","string","symbol"].forEach((s,i)=>{un[s]=function(u){return typeof u===s||"a"+(i<1?"n ":" ")+s}});const zr={};un.transitional=function(i,c,u){function p(g,w){return"[Axios v"+ls+"] Transitional option '"+g+"'"+w+(u?". "+u:"")}return(g,w,v)=>{if(i===!1)throw new D(p(w," has been removed"+(c?" in "+c:"")),D.ERR_DEPRECATED);return c&&!zr[w]&&(zr[w]=!0,console.warn(p(w," has been deprecated since v"+c+" and will be removed in the near future"))),i?i(g,w,v):!0}},un.spelling=function(i){return(c,u)=>(console.warn(`${u} is likely a misspelling of ${i}`),!0)};function Va(s,i,c){if(typeof s!="object")throw new D("