@assembled-brands/frontend 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pages/account-recovery-initiate/index.js +6 -6
- package/dist/pages/account-recovery-initiate/index.js.map +2 -2
- package/dist/pages/claim-account/index.js +6 -6
- package/dist/pages/claim-account/index.js.map +2 -2
- package/dist/pages/cold-lead-register/index.js +6 -6
- package/dist/pages/cold-lead-register/index.js.map +2 -2
- package/dist/pages/finance-docs-accounts-inventory/index.js +5 -5
- package/dist/pages/finance-docs-accounts-inventory/index.js.map +3 -3
- package/dist/pages/finance-docs-ecommerce-performance/index.js +5 -5
- package/dist/pages/finance-docs-ecommerce-performance/index.js.map +3 -3
- package/dist/pages/finance-docs-financial-reports/index.js +5 -5
- package/dist/pages/finance-docs-financial-reports/index.js.map +3 -3
- package/dist/pages/finance-docs-team-ownership/index.js +5 -5
- package/dist/pages/finance-docs-team-ownership/index.js.map +3 -3
- package/dist/pages/financial-company-profile/index.js +5 -5
- package/dist/pages/financial-company-profile/index.js.map +3 -3
- package/dist/pages/financial-financial-overview/index.js +5 -5
- package/dist/pages/financial-financial-overview/index.js.map +3 -3
- package/dist/pages/invite-team-members/index.js +6 -6
- package/dist/pages/invite-team-members/index.js.map +3 -3
- package/dist/pages/login/index.js +6 -6
- package/dist/pages/login/index.js.map +2 -2
- package/dist/pages/onboarding-not-fit/index.js +1 -0
- package/dist/pages/onboarding-not-fit/index.js.map +7 -0
- package/dist/pages/onboarding-wizard/index.js +6 -6
- package/dist/pages/onboarding-wizard/index.js.map +3 -3
- package/dist/pages/team-members/index.js +6 -6
- package/dist/pages/team-members/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var dr=Object.defineProperty;var pr=(e,t)=>{for(var r in t)dr(e,r,{get:t[r],enumerable:!0})};function oe(e,t){return function(){return e.apply(t,arguments)}}var{toString:mr}=Object.prototype,{getPrototypeOf:Be}=Object,{iterator:xe,toStringTag:dt}=Symbol,Ee=(e=>t=>{let r=mr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_=e=>(e=e.toLowerCase(),t=>Ee(t)===e),ve=e=>t=>typeof t===e,{isArray:X}=Array,K=ve("undefined");function se(e){return e!==null&&!K(e)&&e.constructor!==null&&!K(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var pt=_("ArrayBuffer");function hr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pt(e.buffer),t}var gr=ve("string"),O=ve("function"),mt=ve("number"),ie=e=>e!==null&&typeof e=="object",yr=e=>e===!0||e===!1,ye=e=>{if(Ee(e)!=="object")return!1;let t=Be(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(dt in e)&&!(xe in e)},xr=e=>{if(!ie(e)||se(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Er=_("Date"),vr=_("File"),br=_("Blob"),Rr=_("FileList"),Ar=e=>ie(e)&&O(e.pipe),wr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Ee(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Tr=_("URLSearchParams"),[Sr,Cr,Lr,Dr]=["ReadableStream","Request","Response","Headers"].map(_),Or=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ae(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),X(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(se(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length,c;for(n=0;n<i;n++)c=s[n],t.call(null,e[c],c,e)}}function ht(e,t){if(se(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}var $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gt=e=>!K(e)&&e!==$;function Fe(){let{caseless:e,skipUndefined:t}=gt(this)&&this||{},r={},n=(o,s)=>{let i=e&&ht(r,s)||s;ye(r[i])&&ye(o)?r[i]=Fe(r[i],o):ye(o)?r[i]=Fe({},o):X(o)?r[i]=o.slice():(!t||!K(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ae(arguments[o],n);return r}var Pr=(e,t,r,{allOwnKeys:n}={})=>(ae(t,(o,s)=>{r&&O(o)?e[s]=oe(o,r):e[s]=o},{allOwnKeys:n}),e),_r=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ur=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Fr=(e,t,r,n)=>{let o,s,i,c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Be(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Br=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},Nr=e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!mt(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},kr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Be(Uint8Array)),Ir=(e,t)=>{let n=(e&&e[xe]).call(e),o;for(;(o=n.next())&&!o.done;){let s=o.value;t.call(e,s[0],s[1])}},Mr=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Hr=_("HTMLFormElement"),Wr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),ft=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),qr=_("RegExp"),yt=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};ae(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},jr=e=>{yt(e,(t,r)=>{if(O(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(O(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},zr=(e,t)=>{let r={},n=o=>{o.forEach(s=>{r[s]=!0})};return X(e)?n(e):n(String(e).split(t)),r},$r=()=>{},Gr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Vr(e){return!!(e&&O(e.append)&&e[dt]==="FormData"&&e[xe])}var Jr=e=>{let t=new Array(10),r=(n,o)=>{if(ie(n)){if(t.indexOf(n)>=0)return;if(se(n))return n;if(!("toJSON"in n)){t[o]=n;let s=X(n)?[]:{};return ae(n,(i,c)=>{let d=r(i,o+1);!K(d)&&(s[c]=d)}),t[o]=void 0,s}}return n};return r(e,0)},Kr=_("AsyncFunction"),Xr=e=>e&&(ie(e)||O(e))&&O(e.then)&&O(e.catch),xt=((e,t)=>e?setImmediate:t?((r,n)=>($.addEventListener("message",({source:o,data:s})=>{o===$&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),$.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",O($.postMessage)),Qr=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof process<"u"&&process.nextTick||xt,Yr=e=>e!=null&&O(e[xe]),a={isArray:X,isArrayBuffer:pt,isBuffer:se,isFormData:wr,isArrayBufferView:hr,isString:gr,isNumber:mt,isBoolean:yr,isObject:ie,isPlainObject:ye,isEmptyObject:xr,isReadableStream:Sr,isRequest:Cr,isResponse:Lr,isHeaders:Dr,isUndefined:K,isDate:Er,isFile:vr,isBlob:br,isRegExp:qr,isFunction:O,isStream:Ar,isURLSearchParams:Tr,isTypedArray:kr,isFileList:Rr,forEach:ae,merge:Fe,extend:Pr,trim:Or,stripBOM:_r,inherits:Ur,toFlatObject:Fr,kindOf:Ee,kindOfTest:_,endsWith:Br,toArray:Nr,forEachEntry:Ir,matchAll:Mr,isHTMLForm:Hr,hasOwnProperty:ft,hasOwnProp:ft,reduceDescriptors:yt,freezeMethods:jr,toObjectSet:zr,toCamelCase:Wr,noop:$r,toFiniteNumber:Gr,findKey:ht,global:$,isContextDefined:gt,isSpecCompliantForm:Vr,toJSONObject:Jr,isAsyncFn:Kr,isThenable:Xr,setImmediate:xt,asap:Qr,isIterable:Yr};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(Q,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});var Et=Q.prototype,vt={};["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(e=>{vt[e]={value:e}});Object.defineProperties(Q,vt);Object.defineProperty(Et,"isAxiosError",{value:!0});Q.from=(e,t,r,n,o,s)=>{let i=Object.create(Et);a.toFlatObject(e,i,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Q.call(i,c,d,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};var y=Q;var be=null;function Ne(e){return a.isPlainObject(e)||a.isArray(e)}function Rt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function bt(e,t,r){return e?e.concat(t).map(function(o,s){return o=Rt(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Zr(e){return a.isArray(e)&&!e.some(Ne)}var en=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function tn(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(be||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});let n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,g,h){let m=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(g,"{}"))g=n?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Zr(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(m=a.toArray(f)))return g=Rt(g),m.forEach(function(x,A){!(a.isUndefined(x)||x===null)&&t.append(i===!0?bt([g],A,s):i===null?g:g+"[]",l(x))}),!1}return Ne(f)?!0:(t.append(bt(h,g,s),l(f)),!1)}let p=[],b=Object.assign(en,{defaultVisitor:u,convertValue:l,isVisitable:Ne});function S(f,g){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(f),a.forEach(f,function(m,v){(!(a.isUndefined(m)||m===null)&&o.call(t,m,a.isString(v)?v.trim():v,g,b))===!0&&S(m,g?g.concat(v):[v])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}var q=tn;function At(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function wt(e,t){this._pairs=[],e&&q(e,this,t)}var Tt=wt.prototype;Tt.append=function(t,r){this._pairs.push([t,r])};Tt.toString=function(t){let r=t?function(n){return t.call(this,n,At)}:At;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Re=wt;function rn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(e,t,r){if(!t)return e;let n=r&&r.encode||rn;a.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,s;if(o?s=o(t,r):s=a.isURLSearchParams(t)?t.toString():new Re(t,r).toString(n),s){let i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var ke=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,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){a.forEach(this.handlers,function(n){n!==null&&t(n)})}},Ie=ke;var Ae={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var St=typeof URLSearchParams<"u"?URLSearchParams:Re;var Ct=typeof FormData<"u"?FormData:null;var Lt=typeof Blob<"u"?Blob:null;var Dt={isBrowser:!0,classes:{URLSearchParams:St,FormData:Ct,Blob:Lt},protocols:["http","https","file","blob","url","data"]};var We={};pr(We,{hasBrowserEnv:()=>He,hasStandardBrowserEnv:()=>nn,hasStandardBrowserWebWorkerEnv:()=>on,navigator:()=>Me,origin:()=>sn});var He=typeof window<"u"&&typeof document<"u",Me=typeof navigator=="object"&&navigator||void 0,nn=He&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),on=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",sn=He&&window.location.href||"http://localhost";var R={...We,...Dt};function qe(e,t){return q(e,new R.classes.URLSearchParams,{visitor:function(r,n,o,s){return R.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function an(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cn(e){let t={},r=Object.keys(e),n,o=r.length,s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function ln(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;let c=Number.isFinite(+i),d=s>=r.length;return i=!i&&a.isArray(o)?o.length:i,d?(a.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!c):((!o[i]||!a.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&a.isArray(o[i])&&(o[i]=cn(o[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){let r={};return a.forEachEntry(e,(n,o)=>{t(an(n),o,r,0)}),r}return null}var we=ln;function un(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var je={transitional:Ae,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return o?JSON.stringify(we(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qe(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return q(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),un(t)):t}],transformResponse:[function(t){let r=this.transitional||je.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||o)){let i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{je.headers[e]={}});var Y=je;var fn=a.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"]),Ot=e=>{let t={},r,n,o;return e&&e.split(`
|
|
2
|
-
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){let n=(this[Pt]=this[Pt]={accessors:{}}).accessors,o=this.prototype;function s(i){let c=le(i);n[c]||(hn(o,i),n[c]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(Z.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});a.freezeMethods(Z);var C=Z;function ue(e,t){let r=this||Y,n=t||r,o=C.from(n.headers),s=n.data;return a.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function fe(e){return!!(e&&e.__CANCEL__)}function _t(e,t,r){y.call(this,e??"canceled",y.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(_t,y,{__CANCEL__:!0});var N=_t;function de(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new y("Request failed with status code "+r.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $e(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gn(e,t){e=e||10;let r=new Array(e),n=new Array(e),o=0,s=0,i;return t=t!==void 0?t:1e3,function(d){let l=Date.now(),u=n[s];i||(i=l),r[o]=d,n[o]=l;let p=s,b=0;for(;p!==o;)b+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-i<t)return;let S=u&&l-u;return S?Math.round(b*1e3/S):void 0}}var Ut=gn;function yn(e,t){let r=0,n=1e3/t,o,s,i=(l,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{let u=Date.now(),p=u-r;p>=n?i(l,u):(o=l,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}var Ft=yn;var ee=(e,t,r=3)=>{let n=0,o=Ut(50,250);return Ft(s=>{let i=s.loaded,c=s.lengthComputable?s.total:void 0,d=i-n,l=o(d),u=i<=c;n=i;let p={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:l||void 0,estimated:l&&c&&u?(c-i)/l:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},r)},Ge=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ve=e=>(...t)=>a.asap(()=>e(...t));var Bt=R.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,R.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Nt=R.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;let c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Je(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ke(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function pe(e,t,r){let n=!Je(t);return e&&(n||r==!1)?Ke(e,t):t}var kt=e=>e instanceof C?{...e}:e;function U(e,t){t=t||{};let r={};function n(l,u,p,b){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:b},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(l,u,p,b){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,p,b)}else return n(l,u,p,b)}function s(l,u){if(!a.isUndefined(u))return n(void 0,u)}function i(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,p){if(p in t)return n(l,u);if(p in e)return n(void 0,l)}let d={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(l,u,p)=>o(kt(l),kt(u),p,!0)};return a.forEach(Object.keys({...e,...t}),function(u){let p=d[u]||o,b=p(e[u],t[u],u);a.isUndefined(b)&&p!==c||(r[u]=b)}),r}var Se=e=>{let t=U({},e),{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=t;if(t.headers=i=C.from(i),t.url=ce(pe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let d=r.getHeaders(),l=["content-type","content-length"];Object.entries(d).forEach(([u,p])=>{l.includes(u.toLowerCase())&&i.set(u,p)})}}if(R.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Bt(t.url))){let d=o&&s&&Nt.read(s);d&&i.set(o,d)}return t};var xn=typeof XMLHttpRequest<"u",It=xn&&function(e){return new Promise(function(r,n){let o=Se(e),s=o.data,i=C.from(o.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:l}=o,u,p,b,S,f;function g(){S&&S(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function m(){if(!h)return;let x=C.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),E={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};de(function(D){r(D),g()},function(D){n(D),g()},E),h=null}"onloadend"in h?h.onloadend=m:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(m)},h.onabort=function(){h&&(n(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){let E=A&&A.message?A.message:"Network Error",L=new y(E,y.ERR_NETWORK,e,h);L.event=A||null,n(L),h=null},h.ontimeout=function(){let A=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",E=o.transitional||Ae;o.timeoutErrorMessage&&(A=o.timeoutErrorMessage),n(new y(A,E.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(A,E){h.setRequestHeader(E,A)}),a.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),c&&c!=="json"&&(h.responseType=o.responseType),l&&([b,f]=ee(l,!0),h.addEventListener("progress",b)),d&&h.upload&&([p,S]=ee(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(u=x=>{h&&(n(!x||x.type?new N(null,e,h):x),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));let v=$e(o.url);if(v&&R.protocols.indexOf(v)===-1){n(new y("Unsupported protocol "+v+":",y.ERR_BAD_REQUEST,e));return}h.send(s||null)})};var En=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o,s=function(l){if(!o){o=!0,c();let u=l instanceof Error?l:this.reason;n.abort(u instanceof y?u:new N(u instanceof Error?u.message:u))}},i=t&&setTimeout(()=>{i=null,s(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t),c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));let{signal:d}=n;return d.unsubscribe=()=>a.asap(c),d}},Mt=En;var vn=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},bn=async function*(e,t){for await(let r of Rn(e))yield*vn(r,t)},Rn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Xe=(e,t,r,n)=>{let o=bn(e,t),s=0,i,c=d=>{i||(i=!0,n&&n(d))};return new ReadableStream({async pull(d){try{let{done:l,value:u}=await o.next();if(l){c(),d.close();return}let p=u.byteLength;if(r){let b=s+=p;r(b)}d.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(d){return c(d),o.return()}},{highWaterMark:2})};var Ht=64*1024,{isFunction:Ce}=a,An=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Wt,TextEncoder:qt}=a.global,jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wn=e=>{e=a.merge.call({skipUndefined:!0},An,e);let{fetch:t,Request:r,Response:n}=e,o=t?Ce(t):typeof fetch=="function",s=Ce(r),i=Ce(n);if(!o)return!1;let c=o&&Ce(Wt),d=o&&(typeof qt=="function"?(f=>g=>f.encode(g))(new qt):async f=>new Uint8Array(await new r(f).arrayBuffer())),l=s&&c&&jt(()=>{let f=!1,g=new r(R.origin,{body:new Wt,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),u=i&&c&&jt(()=>a.isReadableStream(new n("").body)),p={stream:u&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(g,h)=>{let m=g&&g[f];if(m)return m.call(g);throw new y(`Response type '${f}' is not supported`,y.ERR_NOT_SUPPORT,h)})});let b=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new r(R.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await d(f)).byteLength},S=async(f,g)=>{let h=a.toFiniteNumber(f.getContentLength());return h??b(g)};return async f=>{let{url:g,method:h,data:m,signal:v,cancelToken:x,timeout:A,onDownloadProgress:E,onUploadProgress:L,responseType:D,headers:re,withCredentials:V="same-origin",fetchOptions:ne}=Se(f),P=t||fetch;D=D?(D+"").toLowerCase():"text";let F=Mt([v,x&&x.toAbortSignal()],A),j=null,z=F&&F.unsubscribe&&(()=>{F.unsubscribe()}),at;try{if(L&&l&&h!=="get"&&h!=="head"&&(at=await S(re,m))!==0){let W=new r(g,{method:"POST",body:m,duplex:"half"}),J;if(a.isFormData(m)&&(J=W.headers.get("content-type"))&&re.setContentType(J),W.body){let[Ue,ge]=Ge(at,ee(Ve(L)));m=Xe(W.body,Ht,Ue,ge)}}a.isString(V)||(V=V?"include":"omit");let B=s&&"credentials"in r.prototype,ct={...ne,signal:F,method:h.toUpperCase(),headers:re.normalize().toJSON(),body:m,duplex:"half",credentials:B?V:void 0};j=s&&new r(g,ct);let H=await(s?P(j,ne):P(g,ct)),lt=u&&(D==="stream"||D==="response");if(u&&(E||lt&&z)){let W={};["status","statusText","headers"].forEach(ut=>{W[ut]=H[ut]});let J=a.toFiniteNumber(H.headers.get("content-length")),[Ue,ge]=E&&Ge(J,ee(Ve(E),!0))||[];H=new n(Xe(H.body,Ht,Ue,()=>{ge&&ge(),z&&z()}),W)}D=D||"text";let fr=await p[a.findKey(p,D)||"text"](H,f);return!lt&&z&&z(),await new Promise((W,J)=>{de(W,J,{data:fr,headers:C.from(H.headers),status:H.status,statusText:H.statusText,config:f,request:j})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,f,j),{cause:B.cause||B}):y.from(B,B&&B.code,f,j)}}},Tn=new Map,Qe=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:o}=t,s=[n,o,r],i=s.length,c=i,d,l,u=Tn;for(;c--;)d=s[c],l=u.get(d),l===void 0&&u.set(d,l=c?new Map:wn(t)),u=l;return l},$s=Qe();var Ye={http:be,xhr:It,fetch:{get:Qe}};a.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var zt=e=>`- ${e}`,Cn=e=>a.isFunction(e)||e===null||e===!1;function Ln(e,t){e=a.isArray(e)?e:[e];let{length:r}=e,n,o,s={};for(let i=0;i<r;i++){n=e[i];let c;if(o=n,!Cn(n)&&(o=Ye[(c=String(n)).toLowerCase()],o===void 0))throw new y(`Unknown adapter '${c}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;s[c||"#"+i]=o}if(!o){let i=Object.entries(s).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build")),c=r?i.length>1?`since :
|
|
1
|
+
var hr=Object.defineProperty;var gr=(e,t)=>{for(var r in t)hr(e,r,{get:t[r],enumerable:!0})};function oe(e,t){return function(){return e.apply(t,arguments)}}var{toString:yr}=Object.prototype,{getPrototypeOf:Be}=Object,{iterator:xe,toStringTag:pt}=Symbol,be=(e=>t=>{let r=yr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>be(t)===e),Ee=e=>t=>typeof t===e,{isArray:X}=Array,K=Ee("undefined");function se(e){return e!==null&&!K(e)&&e.constructor!==null&&!K(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ft=U("ArrayBuffer");function xr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ft(e.buffer),t}var br=Ee("string"),D=Ee("function"),mt=Ee("number"),ie=e=>e!==null&&typeof e=="object",Er=e=>e===!0||e===!1,ye=e=>{if(be(e)!=="object")return!1;let t=Be(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pt in e)&&!(xe in e)},vr=e=>{if(!ie(e)||se(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Rr=U("Date"),Ar=U("File"),wr=U("Blob"),Sr=U("FileList"),Tr=e=>ie(e)&&D(e.pipe),Cr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=be(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},Lr=U("URLSearchParams"),[Or,Dr,Pr,_r]=["ReadableStream","Request","Response","Headers"].map(U),Ur=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ae(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),X(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(se(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length,c;for(n=0;n<i;n++)c=s[n],t.call(null,e[c],c,e)}}function ht(e,t){if(se(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}var $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gt=e=>!K(e)&&e!==$;function Fe(){let{caseless:e,skipUndefined:t}=gt(this)&&this||{},r={},n=(o,s)=>{let i=e&&ht(r,s)||s;ye(r[i])&&ye(o)?r[i]=Fe(r[i],o):ye(o)?r[i]=Fe({},o):X(o)?r[i]=o.slice():(!t||!K(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ae(arguments[o],n);return r}var Fr=(e,t,r,{allOwnKeys:n}={})=>(ae(t,(o,s)=>{r&&D(o)?e[s]=oe(o,r):e[s]=o},{allOwnKeys:n}),e),Br=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},kr=(e,t,r,n)=>{let o,s,i,c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Be(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Ir=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},Mr=e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!mt(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Hr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Be(Uint8Array)),Wr=(e,t)=>{let n=(e&&e[xe]).call(e),o;for(;(o=n.next())&&!o.done;){let s=o.value;t.call(e,s[0],s[1])}},qr=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},jr=U("HTMLFormElement"),zr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),dt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$r=U("RegExp"),yt=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};ae(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Gr=e=>{yt(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Vr=(e,t)=>{let r={},n=o=>{o.forEach(s=>{r[s]=!0})};return X(e)?n(e):n(String(e).split(t)),r},Jr=()=>{},Kr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Xr(e){return!!(e&&D(e.append)&&e[pt]==="FormData"&&e[xe])}var Qr=e=>{let t=new Array(10),r=(n,o)=>{if(ie(n)){if(t.indexOf(n)>=0)return;if(se(n))return n;if(!("toJSON"in n)){t[o]=n;let s=X(n)?[]:{};return ae(n,(i,c)=>{let p=r(i,o+1);!K(p)&&(s[c]=p)}),t[o]=void 0,s}}return n};return r(e,0)},Yr=U("AsyncFunction"),Zr=e=>e&&(ie(e)||D(e))&&D(e.then)&&D(e.catch),xt=((e,t)=>e?setImmediate:t?((r,n)=>($.addEventListener("message",({source:o,data:s})=>{o===$&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),$.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D($.postMessage)),en=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof process<"u"&&process.nextTick||xt,tn=e=>e!=null&&D(e[xe]),a={isArray:X,isArrayBuffer:ft,isBuffer:se,isFormData:Cr,isArrayBufferView:xr,isString:br,isNumber:mt,isBoolean:Er,isObject:ie,isPlainObject:ye,isEmptyObject:vr,isReadableStream:Or,isRequest:Dr,isResponse:Pr,isHeaders:_r,isUndefined:K,isDate:Rr,isFile:Ar,isBlob:wr,isRegExp:$r,isFunction:D,isStream:Tr,isURLSearchParams:Lr,isTypedArray:Hr,isFileList:Sr,forEach:ae,merge:Fe,extend:Fr,trim:Ur,stripBOM:Br,inherits:Nr,toFlatObject:kr,kindOf:be,kindOfTest:U,endsWith:Ir,toArray:Mr,forEachEntry:Wr,matchAll:qr,isHTMLForm:jr,hasOwnProperty:dt,hasOwnProp:dt,reduceDescriptors:yt,freezeMethods:Gr,toObjectSet:Vr,toCamelCase:zr,noop:Jr,toFiniteNumber:Kr,findKey:ht,global:$,isContextDefined:gt,isSpecCompliantForm:Xr,toJSONObject:Qr,isAsyncFn:Yr,isThenable:Zr,setImmediate:xt,asap:en,isIterable:tn};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(Q,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});var bt=Q.prototype,Et={};["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(e=>{Et[e]={value:e}});Object.defineProperties(Q,Et);Object.defineProperty(bt,"isAxiosError",{value:!0});Q.from=(e,t,r,n,o,s)=>{let i=Object.create(bt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");let c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return Q.call(i,c,p,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};var y=Q;var ve=null;function Ne(e){return a.isPlainObject(e)||a.isArray(e)}function Rt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function vt(e,t,r){return e?e.concat(t).map(function(o,s){return o=Rt(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function rn(e){return a.isArray(e)&&!e.some(Ne)}var nn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function on(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(ve||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});let n=r.metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!p&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,g,h){let m=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(g,"{}"))g=n?g:g.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&rn(d)||(a.isFileList(d)||a.endsWith(g,"[]"))&&(m=a.toArray(d)))return g=Rt(g),m.forEach(function(b,w){!(a.isUndefined(b)||b===null)&&t.append(i===!0?vt([g],w,s):i===null?g:g+"[]",u(b))}),!1}return Ne(d)?!0:(t.append(vt(h,g,s),u(d)),!1)}let f=[],x=Object.assign(nn,{defaultVisitor:l,convertValue:u,isVisitable:Ne});function T(d,g){if(!a.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(d),a.forEach(d,function(m,v){(!(a.isUndefined(m)||m===null)&&o.call(t,m,a.isString(v)?v.trim():v,g,x))===!0&&T(m,g?g.concat(v):[v])}),f.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return T(e),t}var q=on;function At(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function wt(e,t){this._pairs=[],e&&q(e,this,t)}var St=wt.prototype;St.append=function(t,r){this._pairs.push([t,r])};St.toString=function(t){let r=t?function(n){return t.call(this,n,At)}:At;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Re=wt;function sn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(e,t,r){if(!t)return e;let n=r&&r.encode||sn;a.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,s;if(o?s=o(t,r):s=a.isURLSearchParams(t)?t.toString():new Re(t,r).toString(n),s){let i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var ke=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,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){a.forEach(this.handlers,function(n){n!==null&&t(n)})}},Ie=ke;var Ae={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Tt=typeof URLSearchParams<"u"?URLSearchParams:Re;var Ct=typeof FormData<"u"?FormData:null;var Lt=typeof Blob<"u"?Blob:null;var Ot={isBrowser:!0,classes:{URLSearchParams:Tt,FormData:Ct,Blob:Lt},protocols:["http","https","file","blob","url","data"]};var We={};gr(We,{hasBrowserEnv:()=>He,hasStandardBrowserEnv:()=>an,hasStandardBrowserWebWorkerEnv:()=>cn,navigator:()=>Me,origin:()=>ln});var He=typeof window<"u"&&typeof document<"u",Me=typeof navigator=="object"&&navigator||void 0,an=He&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),cn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ln=He&&window.location.href||"http://localhost";var R={...We,...Ot};function qe(e,t){return q(e,new R.classes.URLSearchParams,{visitor:function(r,n,o,s){return R.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function un(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function dn(e){let t={},r=Object.keys(e),n,o=r.length,s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function pn(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;let c=Number.isFinite(+i),p=s>=r.length;return i=!i&&a.isArray(o)?o.length:i,p?(a.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!c):((!o[i]||!a.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&a.isArray(o[i])&&(o[i]=dn(o[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){let r={};return a.forEachEntry(e,(n,o)=>{t(un(n),o,r,0)}),r}return null}var we=pn;function fn(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var je={transitional:Ae,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return o?JSON.stringify(we(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qe(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return q(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),fn(t)):t}],transformResponse:[function(t){let r=this.transitional||je.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||o)){let i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{je.headers[e]={}});var Y=je;var mn=a.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"]),Dt=e=>{let t={},r,n,o;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&mn[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var Pt=Symbol("internals");function le(e){return e&&String(e).trim().toLowerCase()}function Se(e){return e===!1||e==null?e:a.isArray(e)?e.map(Se):String(e)}function hn(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var gn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ze(e,t,r,n,o){if(a.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function yn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function xn(e,t){let r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}var Z=class{constructor(t){t&&this.set(t)}set(t,r,n){let o=this;function s(c,p,u){let l=le(p);if(!l)throw new Error("header name must be a non-empty string");let f=a.findKey(o,l);(!f||o[f]===void 0||u===!0||u===void 0&&o[f]!==!1)&&(o[f||p]=Se(c))}let i=(c,p)=>a.forEach(c,(u,l)=>s(u,l,p));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(a.isString(t)&&(t=t.trim())&&!gn(t))i(Dt(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,u;for(let l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(p=c[u])?a.isArray(p)?[...p,l[1]]:[p,l[1]]:l[1]}i(c,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=le(t),t){let n=a.findKey(this,t);if(n){let o=this[n];if(!r)return o;if(r===!0)return hn(o);if(a.isFunction(r))return r.call(this,o,n);if(a.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=le(t),t){let n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ze(this,this[n],n,r)))}return!1}delete(t,r){let n=this,o=!1;function s(i){if(i=le(i),i){let c=a.findKey(n,i);c&&(!r||ze(n,n[c],c,r))&&(delete n[c],o=!0)}}return a.isArray(t)?t.forEach(s):s(t),o}clear(t){let r=Object.keys(this),n=r.length,o=!1;for(;n--;){let s=r[n];(!t||ze(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){let r=this,n={};return a.forEach(this,(o,s)=>{let i=a.findKey(n,s);if(i){r[i]=Se(o),delete r[s];return}let c=t?yn(s):String(s).trim();c!==s&&delete r[s],r[c]=Se(o),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return a.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){let n=(this[Pt]=this[Pt]={accessors:{}}).accessors,o=this.prototype;function s(i){let c=le(i);n[c]||(xn(o,i),n[c]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(Z.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});a.freezeMethods(Z);var C=Z;function ue(e,t){let r=this||Y,n=t||r,o=C.from(n.headers),s=n.data;return a.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function de(e){return!!(e&&e.__CANCEL__)}function _t(e,t,r){y.call(this,e??"canceled",y.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(_t,y,{__CANCEL__:!0});var k=_t;function pe(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new y("Request failed with status code "+r.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $e(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bn(e,t){e=e||10;let r=new Array(e),n=new Array(e),o=0,s=0,i;return t=t!==void 0?t:1e3,function(p){let u=Date.now(),l=n[s];i||(i=u),r[o]=p,n[o]=u;let f=s,x=0;for(;f!==o;)x+=r[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;let T=l&&u-l;return T?Math.round(x*1e3/T):void 0}}var Ut=bn;function En(e,t){let r=0,n=1e3/t,o,s,i=(u,l=Date.now())=>{r=l,o=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{let l=Date.now(),f=l-r;f>=n?i(u,l):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},n-f)))},()=>o&&i(o)]}var Ft=En;var ee=(e,t,r=3)=>{let n=0,o=Ut(50,250);return Ft(s=>{let i=s.loaded,c=s.lengthComputable?s.total:void 0,p=i-n,u=o(p),l=i<=c;n=i;let f={loaded:i,total:c,progress:c?i/c:void 0,bytes:p,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(f)},r)},Ge=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ve=e=>(...t)=>a.asap(()=>e(...t));var Bt=R.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,R.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Nt=R.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;let c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Je(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ke(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function fe(e,t,r){let n=!Je(t);return e&&(n||r==!1)?Ke(e,t):t}var kt=e=>e instanceof C?{...e}:e;function F(e,t){t=t||{};let r={};function n(u,l,f,x){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:x},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function o(u,l,f,x){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,f,x)}else return n(u,l,f,x)}function s(u,l){if(!a.isUndefined(l))return n(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,f){if(f in t)return n(u,l);if(f in e)return n(void 0,u)}let p={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,f)=>o(kt(u),kt(l),f,!0)};return a.forEach(Object.keys({...e,...t}),function(l){let f=p[l]||o,x=f(e[l],t[l],l);a.isUndefined(x)&&f!==c||(r[l]=x)}),r}var Te=e=>{let t=F({},e),{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=t;if(t.headers=i=C.from(i),t.url=ce(fe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let p=r.getHeaders(),u=["content-type","content-length"];Object.entries(p).forEach(([l,f])=>{u.includes(l.toLowerCase())&&i.set(l,f)})}}if(R.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Bt(t.url))){let p=o&&s&&Nt.read(s);p&&i.set(o,p)}return t};var vn=typeof XMLHttpRequest<"u",It=vn&&function(e){return new Promise(function(r,n){let o=Te(e),s=o.data,i=C.from(o.headers).normalize(),{responseType:c,onUploadProgress:p,onDownloadProgress:u}=o,l,f,x,T,d;function g(){T&&T(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function m(){if(!h)return;let b=C.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),E={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};pe(function(O){r(O),g()},function(O){n(O),g()},E),h=null}"onloadend"in h?h.onloadend=m:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(m)},h.onabort=function(){h&&(n(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(w){let E=w&&w.message?w.message:"Network Error",L=new y(E,y.ERR_NETWORK,e,h);L.event=w||null,n(L),h=null},h.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",E=o.transitional||Ae;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),n(new y(w,E.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(w,E){h.setRequestHeader(E,w)}),a.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),c&&c!=="json"&&(h.responseType=o.responseType),u&&([x,d]=ee(u,!0),h.addEventListener("progress",x)),p&&h.upload&&([f,T]=ee(p),h.upload.addEventListener("progress",f),h.upload.addEventListener("loadend",T)),(o.cancelToken||o.signal)&&(l=b=>{h&&(n(!b||b.type?new k(null,e,h):b),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));let v=$e(o.url);if(v&&R.protocols.indexOf(v)===-1){n(new y("Unsupported protocol "+v+":",y.ERR_BAD_REQUEST,e));return}h.send(s||null)})};var Rn=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o,s=function(u){if(!o){o=!0,c();let l=u instanceof Error?u:this.reason;n.abort(l instanceof y?l:new k(l instanceof Error?l.message:l))}},i=t&&setTimeout(()=>{i=null,s(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t),c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));let{signal:p}=n;return p.unsubscribe=()=>a.asap(c),p}},Mt=Rn;var An=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},wn=async function*(e,t){for await(let r of Sn(e))yield*An(r,t)},Sn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Xe=(e,t,r,n)=>{let o=wn(e,t),s=0,i,c=p=>{i||(i=!0,n&&n(p))};return new ReadableStream({async pull(p){try{let{done:u,value:l}=await o.next();if(u){c(),p.close();return}let f=l.byteLength;if(r){let x=s+=f;r(x)}p.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(p){return c(p),o.return()}},{highWaterMark:2})};var Ht=64*1024,{isFunction:Ce}=a,Tn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Wt,TextEncoder:qt}=a.global,jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Cn=e=>{e=a.merge.call({skipUndefined:!0},Tn,e);let{fetch:t,Request:r,Response:n}=e,o=t?Ce(t):typeof fetch=="function",s=Ce(r),i=Ce(n);if(!o)return!1;let c=o&&Ce(Wt),p=o&&(typeof qt=="function"?(d=>g=>d.encode(g))(new qt):async d=>new Uint8Array(await new r(d).arrayBuffer())),u=s&&c&&jt(()=>{let d=!1,g=new r(R.origin,{body:new Wt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!g}),l=i&&c&&jt(()=>a.isReadableStream(new n("").body)),f={stream:l&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(g,h)=>{let m=g&&g[d];if(m)return m.call(g);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});let x=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await p(d)).byteLength},T=async(d,g)=>{let h=a.toFiniteNumber(d.getContentLength());return h??x(g)};return async d=>{let{url:g,method:h,data:m,signal:v,cancelToken:b,timeout:w,onDownloadProgress:E,onUploadProgress:L,responseType:O,headers:re,withCredentials:V="same-origin",fetchOptions:ne}=Te(d),_=t||fetch;O=O?(O+"").toLowerCase():"text";let B=Mt([v,b&&b.toAbortSignal()],w),j=null,z=B&&B.unsubscribe&&(()=>{B.unsubscribe()}),at;try{if(L&&u&&h!=="get"&&h!=="head"&&(at=await T(re,m))!==0){let W=new r(g,{method:"POST",body:m,duplex:"half"}),J;if(a.isFormData(m)&&(J=W.headers.get("content-type"))&&re.setContentType(J),W.body){let[Ue,ge]=Ge(at,ee(Ve(L)));m=Xe(W.body,Ht,Ue,ge)}}a.isString(V)||(V=V?"include":"omit");let N=s&&"credentials"in r.prototype,ct={...ne,signal:B,method:h.toUpperCase(),headers:re.normalize().toJSON(),body:m,duplex:"half",credentials:N?V:void 0};j=s&&new r(g,ct);let H=await(s?_(j,ne):_(g,ct)),lt=l&&(O==="stream"||O==="response");if(l&&(E||lt&&z)){let W={};["status","statusText","headers"].forEach(ut=>{W[ut]=H[ut]});let J=a.toFiniteNumber(H.headers.get("content-length")),[Ue,ge]=E&&Ge(J,ee(Ve(E),!0))||[];H=new n(Xe(H.body,Ht,Ue,()=>{ge&&ge(),z&&z()}),W)}O=O||"text";let mr=await f[a.findKey(f,O)||"text"](H,d);return!lt&&z&&z(),await new Promise((W,J)=>{pe(W,J,{data:mr,headers:C.from(H.headers),status:H.status,statusText:H.statusText,config:d,request:j})})}catch(N){throw z&&z(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,j),{cause:N.cause||N}):y.from(N,N&&N.code,d,j)}}},Ln=new Map,Qe=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:o}=t,s=[n,o,r],i=s.length,c=i,p,u,l=Ln;for(;c--;)p=s[c],u=l.get(p),u===void 0&&l.set(p,u=c?new Map:Cn(t)),l=u;return u},Ks=Qe();var Ye={http:ve,xhr:It,fetch:{get:Qe}};a.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var zt=e=>`- ${e}`,Dn=e=>a.isFunction(e)||e===null||e===!1;function Pn(e,t){e=a.isArray(e)?e:[e];let{length:r}=e,n,o,s={};for(let i=0;i<r;i++){n=e[i];let c;if(o=n,!Dn(n)&&(o=Ye[(c=String(n)).toLowerCase()],o===void 0))throw new y(`Unknown adapter '${c}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;s[c||"#"+i]=o}if(!o){let i=Object.entries(s).map(([p,u])=>`adapter ${p} `+(u===!1?"is not supported by the environment":"is not available in the build")),c=r?i.length>1?`since :
|
|
4
4
|
`+i.map(zt).join(`
|
|
5
|
-
`):" "+zt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}var Le={getAdapter:
|
|
6
|
-
`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=U(this.defaults,r);let{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&me.assertOptions(n,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),o!=null&&(a.isFunction(o)?r.paramsSerializer={serialize:o}:me.assertOptions(o,{encode:k.function,serialize:k.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),me.assertOptions(r,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&a.merge(s.common,s[r.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),r.headers=C.concat(i,s);let c=[],d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(d=d&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});let l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,p=0,b;if(!d){let f=[De.bind(this),void 0];for(f.unshift(...c),f.push(...l),b=f.length,u=Promise.resolve(r);p<b;)u=u.then(f[p++],f[p++]);return u}b=c.length;let S=r;for(;p<b;){let f=c[p++],g=c[p++];try{S=f(S)}catch(h){g.call(this,h);break}}try{u=De.call(this,S)}catch(f){return Promise.reject(f)}for(p=0,b=l.length;p<b;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=U(this.defaults,t);let r=pe(t.baseURL,t.url,t.allowAbsoluteUrls);return ce(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(r,n){return this.request(U(n||{},{method:t,url:r,data:(n||{}).data}))}});a.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request(U(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}te.prototype[t]=r(),te.prototype[t+"Form"]=r(!0)});var he=te;var et=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s,i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new N(s,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},Gt=et;function tt(e){return function(r){return e.apply(null,r)}}function rt(e){return a.isObject(e)&&e.isAxiosError===!0}var nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nt).forEach(([e,t])=>{nt[t]=e});var Vt=nt;function Jt(e){let t=new he(e),r=oe(he.prototype.request,t);return a.extend(r,he.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Jt(U(e,o))},r}var T=Jt(Y);T.Axios=he;T.CanceledError=N;T.CancelToken=Gt;T.isCancel=fe;T.VERSION=Oe;T.toFormData=q;T.AxiosError=y;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=tt;T.isAxiosError=rt;T.mergeConfig=U;T.AxiosHeaders=C;T.formToJSON=e=>we(a.isHTMLForm(e)?new FormData(e):e);T.getAdapter=Le.getAdapter;T.HttpStatusCode=Vt;T.default=T;var _e=T;var{Axios:qi,AxiosError:ji,CanceledError:zi,isCancel:$i,CancelToken:Gi,VERSION:Vi,all:Ji,Cancel:Ki,isAxiosError:Xi,spread:Qi,toFormData:Yi,AxiosHeaders:Zi,HttpStatusCode:ea,formToJSON:ta,getAdapter:ra,mergeConfig:na}=_e;var On=localStorage.getItem("api-mode"),Pn="http://127.0.0.1:8787",_n="https://assembled-brands-dev.crystal-e8a.workers.dev",I={apiBaseUrl:On==="local"?Pn:_n,apiVersion:"/api/v1",accessTokenPersistStrategy:"cookie",TOKEN_NAME_IN_STORAGE:"accessToken",TOKEN_TYPE:"Bearer",REQUEST_HEADER_AUTH_KEY:"Authorization"},G=e=>{if(!e){console.error("navigateToPath: path is empty or undefined");return}let t=e.replace(/^\/+/,""),r=t;r=`dev/${t}`;let n=`${window.location.origin}/${r}`;window.location.assign(n)};var Un=(e,t,r)=>{let n=new Date;n.setTime(n.getTime()+r*24*60*60*1e3);let o="expires="+n.toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; ${o}; path=/`},ot=e=>{let t=document.cookie.split("; ");for(let r of t){let[n,o]=r.split("=");if(n===e)return decodeURIComponent(o)}return null},st=e=>{Un(e,"",-1)},Kt=()=>{let e=ot("accessToken");return e||G("/login?error=unauthorized"),e},Xt=()=>{st("accessToken"),localStorage.removeItem("x-team-id"),G("/login?error=logged-out")},Fn=()=>{let e=localStorage.getItem("user"),t=e&&JSON.parse(e);return t&&t?.role},Qt=()=>Fn()==="admin";var Bn=e=>{let t=I.accessTokenPersistStrategy;if(t==="localStorage"||t==="sessionStorage"||t==="cookie"){let n="";t==="localStorage"&&(n=localStorage.getItem(I.TOKEN_NAME_IN_STORAGE)||""),t==="sessionStorage"&&(n=sessionStorage.getItem(I.TOKEN_NAME_IN_STORAGE)||""),t==="cookie"&&(n=ot(I.TOKEN_NAME_IN_STORAGE)||""),n&&(e.headers[I.REQUEST_HEADER_AUTH_KEY]=`${I.TOKEN_TYPE} ${n}`)}let r=localStorage.getItem("x-team-id");return r&&(e.headers["X-Team-Id"]=r),e},Yt=Bn;var Nn=[401,419,440],kn=e=>{let{response:t}=e;if(window.location.pathname.includes("/login"))return Promise.reject(e);t&&Nn.includes(t.status)&&(st("accessToken"),G("/login?error=unauthorized"))},Zt=kn;var it=_e.create({timeout:6e4,baseURL:I.apiBaseUrl+I.apiVersion});it.interceptors.request.use(e=>Yt(e),e=>Promise.reject(e));it.interceptors.response.use(e=>e,e=>(Zt(e),Promise.reject(e)));var er=it;var In={fetchDataWithAxios(e){return new Promise((t,r)=>{er(e).then(n=>{t(n.data)}).catch(n=>{let o="An unknown error occurred";if(n.response&&n.response.data){let s=n.response.data;typeof s.message=="string"?o=s.message:typeof s.error=="string"?o=s.error:o=JSON.stringify(s)}else n.message&&(o=n.message);r({...n,message:o})})})}},M=In;var tr=e=>M.fetchDataWithAxios({url:"/asset",method:"post",data:e});var rr=e=>M.fetchDataWithAxios({url:"/financial-wizard/document",method:"post",data:e}),nr=e=>M.fetchDataWithAxios({url:"/financial-wizard/progress",method:"get",params:e?{user_id:e}:void 0});var or=()=>M.fetchDataWithAxios({url:"/financial-wizard/applications",method:"get"});async function sr(){return M.fetchDataWithAxios({url:"/user/me",method:"get"})}var ir=()=>M.fetchDataWithAxios({url:"/team/my-teams",method:"get"});var w=(e,t=document)=>t.querySelector(e);var ar=async e=>{try{let[t,r,n]=await Promise.all([nr(e),sr(),ir()]),o=t?.percentage||0,s=w('[dev-target="progress-percentage-fill"]'),i=w('[dev-target="progress-percentage-label"]'),c=w('[dev-target="user-name"]'),d=w('[dev-target="user-email"]'),l=w('[dev-target="logout"]');if(!s||!i||!l||!c||!d){console.error('Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], [dev-target="user-name"], [dev-target="user-email"], and [dev-target="logout"] are present.');return}return s.style.width=`${o}%`,i.textContent=`Progress ${o}%`,l.addEventListener("click",()=>{Xt()}),c.innerText=t.business?.legal_name||(r.first_name||"Full")+" "+(r.last_name||"Name"),d.innerText=t.business?.email||r.email||"hello@company.com",{financialProgress:t,user:r,teams:n}}catch(t){console.error("Failed to load financial wizard progress:",t)}},cr=()=>{if(!w('[dev-target="sidebar-menu"]')){console.error('Ensure [dev-target="sidebar-menu"] is present.');return}let t=window.location.pathname,n={"/dev/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/dev/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/dev/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/dev/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/dev/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/dev/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/team-members":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"}}[t],o=document.querySelectorAll('[dev-attr="nav"]');if(n){o.forEach(i=>{i.classList.remove("is-active"),i.classList.remove("is-active-financial")});let s=w(`[dev-target="${n.nav_attr}"]`);s&&s.classList.add(n.nav_class)}else o.forEach(s=>{s.classList.remove("is-active"),s.classList.remove("is-active-financial")})},lr=async e=>{if(Qt()){let r=w('[dev-target="admin-select-wrapper"]'),n=w('[dev-target="admin-select"]');if(r?.classList.remove("hide"),!r||!n){console.error('Ensure [dev-target="admin-select"] and [dev-target="admin-select-wrapper"] is present.');return}let o=await or();n.innerHTML="",o.forEach(s=>{let i=s.first_name||""+s.last_name||"",c=document.createElement("option");c.value=s.id.toString(),c.textContent=`${i||s.email}`,n.appendChild(c)}),n.addEventListener("change",async s=>{let i=s.target,{value:c}=i;console.log(c),e&&await e(c)})}},ur=e=>new Promise((t,r)=>{let n=new FileReader;n.onload=()=>{let s=n.result.split(",");t(s.length>1?s[1]:s[0])},n.onerror=()=>r(new Error("Failed to read file as base64")),n.readAsDataURL(e)});var Mn=async()=>{cr(),Kt();let e=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],t=document.querySelector('[dev-target="accounts-inventory-reports-form"]');if(!t){console.error('Accounts & Inventory form not found. Element: [dev-target="accounts-inventory-reports-form"] not found');return}let r=w('[dev-target="monthly-inventory-upload-box"]',t),n=w('[dev-target="monthly-inventory-input"]',t),o=w('[dev-target="balance-sheet-helper"]',t),s=w('[dev-target="accounts-receivable-upload-box"]',t),i=w('[dev-target="accounts-receivable-input"]',t),c=w('[dev-target="income-statement-helper"]',t),d=w('[dev-target="accounts-payable-upload-box"]',t),l=w('[dev-target="accounts-payable-input"]',t),u=w('[dev-target="income-forecast-helper"]',t),p=w('[dev-target="submit-button"]',t);if(!r||!n||!o){console.error('Ensure [dev-target="monthly-inventory-upload-box"] and [dev-target="monthly-inventory-input"] and [dev-target="balance-sheet-helper"] are present.');return}if(!s||!i||!c){console.error('Ensure [dev-target="accounts-receivable-upload-box"] and [dev-target="accounts-receivable-input"] and [dev-target="income-statement-helper"] are present.');return}if(!d||!l||!u){console.error('Ensure [dev-target="accounts-payable-upload-box"] and [dev-target="accounts-payable-input"] and [dev-target="income-forecast-helper"] are present.');return}if(!p){console.error('Ensure [dev-target="submit-button"] is present.');return}let b=m=>{if(m?.accounts_inventory){let v=m.accounts_inventory.find(E=>E.document_type==="monthly_inventory_report");v?o.textContent=v.asset_name||"":o.textContent="";let x=m.accounts_inventory.find(E=>E.document_type==="accounts_receivable_aging");x?c.textContent=x.asset_name||"":c.textContent="";let A=m.accounts_inventory.find(E=>E.document_type==="accounts_payable_aging");A?u.textContent=A.asset_name||"":u.textContent=""}else o.textContent="",c.textContent="",u.textContent=""},S,f=async m=>{S=(await ar(m))?.financialProgress,b(S)};await f(),lr(f);let g=(m,v)=>{if(m.files&&m.files.length>0){let x=m.files[0];if(!e.includes(x.type)){m.value="",v.textContent="Invalid file type. Please upload Excel (.xls or .xlsx) files only",v.classList.add("is-error");return}v.textContent=x.name,v.classList.remove("is-error")}else v.textContent="",v.classList.remove("is-error")};r&&n&&o&&(r.addEventListener("click",()=>n.click()),r.addEventListener("dragover",m=>{m.preventDefault(),r.classList.add("drag")}),r.addEventListener("dragleave",()=>{r.classList.remove("drag")}),r.addEventListener("drop",m=>{m.preventDefault(),r.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(n.files=m.dataTransfer.files,g(n,o),n.dispatchEvent(new Event("change",{bubbles:!0})))}),n.addEventListener("change",()=>{g(n,o)})),s&&i&&c&&(s.addEventListener("click",()=>i.click()),s.addEventListener("dragover",m=>{m.preventDefault(),s.classList.add("drag")}),s.addEventListener("dragleave",()=>{s.classList.remove("drag")}),s.addEventListener("drop",m=>{m.preventDefault(),s.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(i.files=m.dataTransfer.files,g(i,c),i.dispatchEvent(new Event("change",{bubbles:!0})))}),i.addEventListener("change",()=>{g(i,c)})),d&&l&&u&&(d.addEventListener("click",()=>l.click()),d.addEventListener("dragover",m=>{m.preventDefault(),d.classList.add("drag")}),d.addEventListener("dragleave",()=>{d.classList.remove("drag")}),d.addEventListener("drop",m=>{m.preventDefault(),d.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(l.files=m.dataTransfer.files,g(l,u),l.dispatchEvent(new Event("change",{bubbles:!0})))}),l.addEventListener("change",()=>{g(l,u)}));let h=async(m,v)=>{if(!e.includes(m.type))throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");let x={fileName:m.name,contentType:m.type,assetType:"document",fileSize:m.size,duration:0},A=await tr(x),E=A.asset.id,{presignedUrl:L}=A;if(!L)throw new Error("Presigned URL not received from server");await new Promise((V,ne)=>{let P=new XMLHttpRequest;P.upload.addEventListener("progress",F=>{if(F.lengthComputable){let j=Math.round(F.loaded/F.total*100);console.log(`Upload progress: ${j}%`)}}),P.addEventListener("load",()=>{P.status>=200&&P.status<300?V():ne(new Error("Failed to upload file to S3"))}),P.addEventListener("error",F=>{console.error(F),ne(new Error("Network error during upload"))}),P.open("PUT",L),P.setRequestHeader("Content-Type",m.type),P.send(m)});let D=await ur(m),re={page:"accounts-inventory",document_type:v,asset_id:E,file_data:D,file_name:m.name,file_mime_type:m.type};await rr(re)};t.addEventListener("submit",async m=>{m.preventDefault(),m.stopPropagation();let v=()=>{r?.classList.remove("is-error"),s?.classList.remove("is-error"),d?.classList.remove("is-error"),o?.classList.remove("is-error"),c?.classList.remove("is-error"),u?.classList.remove("is-error"),p.classList.remove("is-error"),p.value="UPLOAD DOCUMENTS"};n?.addEventListener("change",v,{once:!0}),i?.addEventListener("change",v,{once:!0}),l?.addEventListener("change",v,{once:!0});let x=[];if(n?.files&&n.files[0]){let E=n.files[0];e.includes(E.type)?x.push({file:E,documentType:"monthly_inventory_report"}):o?.classList.add("is-error")}if(i?.files&&i.files[0]){let E=i.files[0];e.includes(E.type)?x.push({file:E,documentType:"accounts_receivable_aging"}):c?.classList.add("is-error")}if(l?.files&&l.files[0]){let E=l.files[0];e.includes(E.type)?x.push({file:E,documentType:"accounts_payable_aging"}):u?.classList.add("is-error")}if(n?.files&&n.files[0]&&!e.includes(n.files[0].type)||i?.files&&i.files[0]&&!e.includes(i.files[0].type)||l?.files&&l.files[0]&&!e.includes(l.files[0].type)){p.classList.add("is-error"),p.value="Please upload only Excel (.xls or .xlsx) files";return}if(x.length===0){p.classList.add("is-error"),p.value="Please select at least one file to upload";return}try{p.disabled=!0,p.value="Uploading...",await Promise.all(x.map(({file:E,documentType:L})=>h(E,L))),p.classList.add("is-success"),p.value="Documents uploaded successfully!",n&&(n.value=""),i&&(i.value=""),l&&(l.value=""),o&&(o.textContent="",o.classList.remove("is-error")),c&&(c.textContent="",c.classList.remove("is-error")),u&&(u.textContent="",u.classList.remove("is-error")),setTimeout(()=>{p.classList.remove("is-success"),p.value="UPLOAD DOCUMENTS",p.disabled=!1,G("/finance-docs-ecommerce-performance")},900)}catch(E){let{message:L}=E;console.error(L),p.classList.add("is-error"),p.value=L||"There was a problem uploading the documents",p.disabled=!1}})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{try{Mn()}catch(e){console.error(e)}});
|
|
5
|
+
`):" "+zt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}var Le={getAdapter:Pn,adapters:Ye};function Ze(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new k(null,e)}function Oe(e){return Ze(e),e.headers=C.from(e.headers),e.data=ue.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Le.getAdapter(e.adapter||Y.adapter,e)(e).then(function(n){return Ze(e),n.data=ue.call(e,e.transformResponse,n),n.headers=C.from(n.headers),n},function(n){return de(n)||(Ze(e),n&&n.response&&(n.response.data=ue.call(e,e.transformResponse,n.response),n.response.headers=C.from(n.response.headers))),Promise.reject(n)})}var De="1.13.2";var Pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pe[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var $t={};Pe.transitional=function(t,r,n){function o(s,i){return"[Axios v"+De+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,c)=>{if(t===!1)throw new y(o(i," has been removed"+(r?" in "+r:"")),y.ERR_DEPRECATED);return r&&!$t[i]&&($t[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,c):!0}};Pe.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function _n(e,t,r){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),o=n.length;for(;o-- >0;){let s=n[o],i=t[s];if(i){let c=e[s],p=c===void 0||i(c,s,e);if(p!==!0)throw new y("option "+s+" must be "+p,y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new y("Unknown option "+s,y.ERR_BAD_OPTION)}}var me={assertOptions:_n,validators:Pe};var I=me.validators,te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ie,response:new Ie}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=F(this.defaults,r);let{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&me.assertOptions(n,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),o!=null&&(a.isFunction(o)?r.paramsSerializer={serialize:o}:me.assertOptions(o,{encode:I.function,serialize:I.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),me.assertOptions(r,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&a.merge(s.common,s[r.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),r.headers=C.concat(i,s);let c=[],p=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(p=p&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,f=0,x;if(!p){let d=[Oe.bind(this),void 0];for(d.unshift(...c),d.push(...u),x=d.length,l=Promise.resolve(r);f<x;)l=l.then(d[f++],d[f++]);return l}x=c.length;let T=r;for(;f<x;){let d=c[f++],g=c[f++];try{T=d(T)}catch(h){g.call(this,h);break}}try{l=Oe.call(this,T)}catch(d){return Promise.reject(d)}for(f=0,x=u.length;f<x;)l=l.then(u[f++],u[f++]);return l}getUri(t){t=F(this.defaults,t);let r=fe(t.baseURL,t.url,t.allowAbsoluteUrls);return ce(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(r,n){return this.request(F(n||{},{method:t,url:r,data:(n||{}).data}))}});a.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request(F(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}te.prototype[t]=r(),te.prototype[t+"Form"]=r(!0)});var he=te;var et=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s,i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new k(s,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},Gt=et;function tt(e){return function(r){return e.apply(null,r)}}function rt(e){return a.isObject(e)&&e.isAxiosError===!0}var nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nt).forEach(([e,t])=>{nt[t]=e});var Vt=nt;function Jt(e){let t=new he(e),r=oe(he.prototype.request,t);return a.extend(r,he.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Jt(F(e,o))},r}var S=Jt(Y);S.Axios=he;S.CanceledError=k;S.CancelToken=Gt;S.isCancel=de;S.VERSION=De;S.toFormData=q;S.AxiosError=y;S.Cancel=S.CanceledError;S.all=function(t){return Promise.all(t)};S.spread=tt;S.isAxiosError=rt;S.mergeConfig=F;S.AxiosHeaders=C;S.formToJSON=e=>we(a.isHTMLForm(e)?new FormData(e):e);S.getAdapter=Le.getAdapter;S.HttpStatusCode=Vt;S.default=S;var _e=S;var{Axios:Gi,AxiosError:Vi,CanceledError:Ji,isCancel:Ki,CancelToken:Xi,VERSION:Qi,all:Yi,Cancel:Zi,isAxiosError:ea,spread:ta,toFormData:ra,AxiosHeaders:na,HttpStatusCode:oa,formToJSON:sa,getAdapter:ia,mergeConfig:aa}=_e;var Un=localStorage.getItem("api-mode"),Fn="http://127.0.0.1:8787",Bn="https://assembled-brands-dev.crystal-e8a.workers.dev",M={apiBaseUrl:Un==="local"?Fn:Bn,apiVersion:"/api/v1",accessTokenPersistStrategy:"cookie",TOKEN_NAME_IN_STORAGE:"accessToken",TOKEN_TYPE:"Bearer",REQUEST_HEADER_AUTH_KEY:"Authorization"},G=e=>{if(!e){console.error("navigateToPath: path is empty or undefined");return}let t=e.replace(/^\/+/,""),r=t;r=`dev/${t}`;let n=`${window.location.origin}/${r}`;window.location.assign(n)};var Nn=(e,t,r)=>{let n=new Date;n.setTime(n.getTime()+r*24*60*60*1e3);let o="expires="+n.toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; ${o}; path=/`},ot=e=>{let t=document.cookie.split("; ");for(let r of t){let[n,o]=r.split("=");if(n===e)return decodeURIComponent(o)}return null},st=e=>{Nn(e,"",-1)},Kt=()=>{let e=ot("accessToken");return e||G("/login?error=unauthorized"),e},Xt=()=>{st("accessToken"),localStorage.removeItem("x-team-id"),G("/login?error=logged-out")},kn=()=>{let e=localStorage.getItem("user"),t=e&&JSON.parse(e);return t&&t?.role},Qt=()=>kn()==="admin";var In=e=>{let t=M.accessTokenPersistStrategy;if(t==="localStorage"||t==="sessionStorage"||t==="cookie"){let n="";t==="localStorage"&&(n=localStorage.getItem(M.TOKEN_NAME_IN_STORAGE)||""),t==="sessionStorage"&&(n=sessionStorage.getItem(M.TOKEN_NAME_IN_STORAGE)||""),t==="cookie"&&(n=ot(M.TOKEN_NAME_IN_STORAGE)||""),n&&(e.headers[M.REQUEST_HEADER_AUTH_KEY]=`${M.TOKEN_TYPE} ${n}`)}let r=localStorage.getItem("x-team-id");return r&&(e.headers["X-Team-Id"]=r),e},Yt=In;var Mn=[401,419,440],Hn=e=>{let{response:t}=e;if(window.location.pathname.includes("/login"))return Promise.reject(e);t&&Mn.includes(t.status)&&(st("accessToken"),G("/login?error=unauthorized"))},Zt=Hn;var it=_e.create({timeout:6e4,baseURL:M.apiBaseUrl+M.apiVersion});it.interceptors.request.use(e=>Yt(e),e=>Promise.reject(e));it.interceptors.response.use(e=>e,e=>(Zt(e),Promise.reject(e)));var er=it;var Wn={fetchDataWithAxios(e){return new Promise((t,r)=>{er(e).then(n=>{t(n.data)}).catch(n=>{let o="An unknown error occurred";if(n.response&&n.response.data){let s=n.response.data;typeof s.message=="string"?o=s.message:typeof s.error=="string"?o=s.error:o=JSON.stringify(s)}else n.message&&(o=n.message);r({...n,message:o})})})}},P=Wn;var tr=e=>P.fetchDataWithAxios({url:"/asset",method:"post",data:e});var rr=e=>P.fetchDataWithAxios({url:"/financial-wizard/document",method:"post",data:e}),nr=e=>P.fetchDataWithAxios({url:"/financial-wizard/progress",method:"get",params:e?{user_id:e}:void 0});var or=()=>P.fetchDataWithAxios({url:"/financial-wizard/applications",method:"get"});async function sr(){return P.fetchDataWithAxios({url:"/user/me",method:"get"})}var ir=()=>P.fetchDataWithAxios({url:"/onboarding-wizard/progress",method:"get"});var ar=()=>P.fetchDataWithAxios({url:"/team/my-teams",method:"get"});var A=(e,t=document)=>t.querySelector(e),cr=(e,t=document)=>{let r=t.querySelectorAll(e);return[...Array.from(r)]};var qn=async e=>{let[t,r,n,o]=await Promise.all([nr(e),sr(),ar(),ir()]);return{financialProgress:t,user:r,teams:n,onboardingProgress:o}},lr=async e=>{try{let{financialProgress:t,user:r,teams:n,onboardingProgress:o}=await qn(e),s=t?.percentage||0,i=A('[dev-target="progress-percentage-fill"]'),c=cr('[dev-target="progress-percentage-label"]'),p=A('[dev-target="user-name"]'),u=A('[dev-target="user-email"]'),l=A('[dev-target="logout"]');if(!i||!c||!l||!p||!u){console.error('Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], [dev-target="user-name"], [dev-target="user-email"], and [dev-target="logout"] are present.');return}return i.style.width=`${s}%`,c[0].textContent=`Progress ${s}%`,c[1].textContent=`${s}%`,l.addEventListener("click",()=>{Xt()}),p.innerText=t.business?.legal_name||(r.first_name||"Full")+" "+(r.last_name||"Name"),u.innerText=t.business?.email||r.email||"hello@company.com",{financialProgress:t,user:r,teams:n,onboardingProgress:o}}catch(t){console.error("Failed to load financial wizard progress:",t)}},ur=()=>{if(!A('[dev-target="sidebar-menu"]')){console.error('Ensure [dev-target="sidebar-menu"] is present.');return}let t=window.location.pathname,n={"/dev/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/dev/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/dev/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/dev/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/dev/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/dev/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/team-members":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"}}[t],o=document.querySelectorAll('[dev-attr="nav"]');if(n){o.forEach(i=>{i.classList.remove("is-active"),i.classList.remove("is-active-financial")});let s=A(`[dev-target="${n.nav_attr}"]`);s&&s.classList.add(n.nav_class)}else o.forEach(s=>{s.classList.remove("is-active"),s.classList.remove("is-active-financial")})},dr=async e=>{if(Qt()){let r=A('[dev-target="admin-select-wrapper"]'),n=A('[dev-target="admin-select"]');if(r?.classList.remove("hide"),!r||!n){console.error('Ensure [dev-target="admin-select"] and [dev-target="admin-select-wrapper"] is present.');return}let o=await or();n.innerHTML="",o.forEach(s=>{let i=s.first_name||""+s.last_name||"",c=document.createElement("option");c.value=s.id.toString(),c.textContent=`${i||s.email}`,n.appendChild(c)}),n.addEventListener("change",async s=>{let i=s.target,{value:c}=i;e&&await e(c)})}},pr=e=>new Promise((t,r)=>{let n=new FileReader;n.onload=()=>{let s=n.result.split(",");t(s.length>1?s[1]:s[0])},n.onerror=()=>r(new Error("Failed to read file as base64")),n.readAsDataURL(e)}),fr=()=>{let e=A('[dev-target="sidebar-menu"]'),t=e?.querySelector(".sidebar"),r=A('[dev-target="collapsible-trigger"]');if(!e||!t||!r){console.error('Ensure [dev-target="sidebar-menu"] and [dev-target="collapsible-trigger"] and [dev-target="sidebar-inner"] are present.');return}let n=!1,o=()=>{n=!n;let s=document.querySelectorAll('[sidebar="collapsible-content"], [dev-target="collapsible-content"]'),i=A('[dev-target="sidebar-logo-text-wrapper"]'),c=e.querySelector('[dev-target="sidebar-bottom-collapsed"]'),p=e.querySelector('[dev-target="sidenav-close"]'),u=e.querySelector('[dev-target="sidebar-bottom"]'),l=e.querySelector(".user-profile_wrapper"),f=l?.querySelector(".flex-horizontal_auth.gap-15");n?(e.classList.add("collapsed"),t?.classList.add("mobile"),i?.classList.add("hide"),l?.classList.add("image-overlay"),f?.classList.add("overlay"),u?.classList.add("hide"),c?.classList.remove("hide"),p?.classList.add("is-collapsed"),s.forEach(x=>{x.style.opacity="0",x.style.transition="opacity 0.2s ease",setTimeout(()=>{x.classList.add("hide")},200)}),e.style.width="80px",e.style.width="auto"):(e.classList.remove("collapsed"),t?.classList.remove("mobile"),i?.classList.remove("hide"),l?.classList.remove("image-overlay"),f?.classList.remove("overlay"),u?.classList.remove("hide"),c?.classList.add("hide"),p?.classList.remove("is-collapsed"),s.forEach(x=>{x.classList.remove("hide"),setTimeout(()=>{x.style.opacity="1"},10)}))};r.addEventListener("click",o),e.style.transition="width 0.3s ease"};var jn=async()=>{ur(),Kt(),fr();let e=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],t=document.querySelector('[dev-target="accounts-inventory-reports-form"]');if(!t){console.error('Accounts & Inventory form not found. Element: [dev-target="accounts-inventory-reports-form"] not found');return}let r=A('[dev-target="monthly-inventory-upload-box"]',t),n=A('[dev-target="monthly-inventory-input"]',t),o=A('[dev-target="balance-sheet-helper"]',t),s=A('[dev-target="accounts-receivable-upload-box"]',t),i=A('[dev-target="accounts-receivable-input"]',t),c=A('[dev-target="income-statement-helper"]',t),p=A('[dev-target="accounts-payable-upload-box"]',t),u=A('[dev-target="accounts-payable-input"]',t),l=A('[dev-target="income-forecast-helper"]',t),f=A('[dev-target="submit-button"]',t);if(!r||!n||!o){console.error('Ensure [dev-target="monthly-inventory-upload-box"] and [dev-target="monthly-inventory-input"] and [dev-target="balance-sheet-helper"] are present.');return}if(!s||!i||!c){console.error('Ensure [dev-target="accounts-receivable-upload-box"] and [dev-target="accounts-receivable-input"] and [dev-target="income-statement-helper"] are present.');return}if(!p||!u||!l){console.error('Ensure [dev-target="accounts-payable-upload-box"] and [dev-target="accounts-payable-input"] and [dev-target="income-forecast-helper"] are present.');return}if(!f){console.error('Ensure [dev-target="submit-button"] is present.');return}let x=m=>{if(m?.accounts_inventory){let v=m.accounts_inventory.find(E=>E.document_type==="monthly_inventory_report");v?o.textContent=v.asset_name||"":o.textContent="";let b=m.accounts_inventory.find(E=>E.document_type==="accounts_receivable_aging");b?c.textContent=b.asset_name||"":c.textContent="";let w=m.accounts_inventory.find(E=>E.document_type==="accounts_payable_aging");w?l.textContent=w.asset_name||"":l.textContent=""}else o.textContent="",c.textContent="",l.textContent=""},T,d=async m=>{T=(await lr(m))?.financialProgress,x(T)};await d(),dr(d);let g=(m,v)=>{if(m.files&&m.files.length>0){let b=m.files[0];if(!e.includes(b.type)){m.value="",v.textContent="Invalid file type. Please upload Excel (.xls or .xlsx) files only",v.classList.add("is-error");return}v.textContent=b.name,v.classList.remove("is-error")}else v.textContent="",v.classList.remove("is-error")};r&&n&&o&&(r.addEventListener("click",()=>n.click()),r.addEventListener("dragover",m=>{m.preventDefault(),r.classList.add("drag")}),r.addEventListener("dragleave",()=>{r.classList.remove("drag")}),r.addEventListener("drop",m=>{m.preventDefault(),r.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(n.files=m.dataTransfer.files,g(n,o),n.dispatchEvent(new Event("change",{bubbles:!0})))}),n.addEventListener("change",()=>{g(n,o)})),s&&i&&c&&(s.addEventListener("click",()=>i.click()),s.addEventListener("dragover",m=>{m.preventDefault(),s.classList.add("drag")}),s.addEventListener("dragleave",()=>{s.classList.remove("drag")}),s.addEventListener("drop",m=>{m.preventDefault(),s.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(i.files=m.dataTransfer.files,g(i,c),i.dispatchEvent(new Event("change",{bubbles:!0})))}),i.addEventListener("change",()=>{g(i,c)})),p&&u&&l&&(p.addEventListener("click",()=>u.click()),p.addEventListener("dragover",m=>{m.preventDefault(),p.classList.add("drag")}),p.addEventListener("dragleave",()=>{p.classList.remove("drag")}),p.addEventListener("drop",m=>{m.preventDefault(),p.classList.remove("drag"),m.dataTransfer&&m.dataTransfer.files.length>0&&(u.files=m.dataTransfer.files,g(u,l),u.dispatchEvent(new Event("change",{bubbles:!0})))}),u.addEventListener("change",()=>{g(u,l)}));let h=async(m,v)=>{if(!e.includes(m.type))throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");let b={fileName:m.name,contentType:m.type,assetType:"document",fileSize:m.size,duration:0},w=await tr(b),E=w.asset.id,{presignedUrl:L}=w;if(!L)throw new Error("Presigned URL not received from server");await new Promise((V,ne)=>{let _=new XMLHttpRequest;_.upload.addEventListener("progress",B=>{if(B.lengthComputable){let j=Math.round(B.loaded/B.total*100);console.log(`Upload progress: ${j}%`)}}),_.addEventListener("load",()=>{_.status>=200&&_.status<300?V():ne(new Error("Failed to upload file to S3"))}),_.addEventListener("error",B=>{console.error(B),ne(new Error("Network error during upload"))}),_.open("PUT",L),_.setRequestHeader("Content-Type",m.type),_.send(m)});let O=await pr(m),re={page:"accounts-inventory",document_type:v,asset_id:E,file_data:O,file_name:m.name,file_mime_type:m.type};await rr(re)};t.addEventListener("submit",async m=>{m.preventDefault(),m.stopPropagation();let v=()=>{r?.classList.remove("is-error"),s?.classList.remove("is-error"),p?.classList.remove("is-error"),o?.classList.remove("is-error"),c?.classList.remove("is-error"),l?.classList.remove("is-error"),f.classList.remove("is-error"),f.value="UPLOAD DOCUMENTS"};n?.addEventListener("change",v,{once:!0}),i?.addEventListener("change",v,{once:!0}),u?.addEventListener("change",v,{once:!0});let b=[];if(n?.files&&n.files[0]){let E=n.files[0];e.includes(E.type)?b.push({file:E,documentType:"monthly_inventory_report"}):o?.classList.add("is-error")}if(i?.files&&i.files[0]){let E=i.files[0];e.includes(E.type)?b.push({file:E,documentType:"accounts_receivable_aging"}):c?.classList.add("is-error")}if(u?.files&&u.files[0]){let E=u.files[0];e.includes(E.type)?b.push({file:E,documentType:"accounts_payable_aging"}):l?.classList.add("is-error")}if(n?.files&&n.files[0]&&!e.includes(n.files[0].type)||i?.files&&i.files[0]&&!e.includes(i.files[0].type)||u?.files&&u.files[0]&&!e.includes(u.files[0].type)){f.classList.add("is-error"),f.value="Please upload only Excel (.xls or .xlsx) files";return}if(b.length===0){f.classList.add("is-error"),f.value="Please select at least one file to upload";return}try{f.disabled=!0,f.value="Uploading...",await Promise.all(b.map(({file:E,documentType:L})=>h(E,L))),f.classList.add("is-success"),f.value="Documents uploaded successfully!",n&&(n.value=""),i&&(i.value=""),u&&(u.value=""),o&&(o.textContent="",o.classList.remove("is-error")),c&&(c.textContent="",c.classList.remove("is-error")),l&&(l.textContent="",l.classList.remove("is-error")),setTimeout(()=>{f.classList.remove("is-success"),f.value="UPLOAD DOCUMENTS",f.disabled=!1,G("/finance-docs-ecommerce-performance")},900)}catch(E){let{message:L}=E;console.error(L),f.classList.add("is-error"),f.value=L||"There was a problem uploading the documents",f.disabled=!1}})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{try{jn()}catch(e){console.error(e)}});
|