best-unit 0.0.13 → 0.0.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.
@@ -1,6 +1,45 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ln(){console.log("npm package test!!!")}function cn(){console.log("Current time:",new Date().toISOString())}var te,w,gt,z,Ve,Et,xt,wt,je,Ae,Oe,Y={},vt=[],un=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_e=Array.isArray;function L(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function M(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?te.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return G(e,s,r,o,null)}function G(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++gt,__i:-1,__u:0};return o==null&&w.vnode!=null&&w.vnode(i),i}function ne(e){return e.children}function se(e,t){this.props=e,this.context=t}function W(e,t){if(t==null)return e.__?W(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?W(e):null}function St(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return St(e)}}function Ke(e){(!e.__d&&(e.__d=!0)&&z.push(e)&&!fe.__r++||Ve!=w.debounceRendering)&&((Ve=w.debounceRendering)||Et)(fe)}function fe(){for(var e,t,n,r,o,i,s,a=1;z.length;)z.length>a&&z.sort(xt),e=z.shift(),a=z.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,i=[],s=[],t.__P&&((n=L({},r)).__v=r.__v+1,w.vnode&&w.vnode(n),ze(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,o??W(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,kt(i,n,s),n.__e!=o&&St(n)));fe.__r=0}function Rt(e,t,n,r,o,i,s,a,u,c,f){var l,y,h,p,m,_,g=r&&r.__k||vt,E=t.length;for(u=fn(n,t,g,u,E),l=0;l<E;l++)(h=n.__k[l])!=null&&(y=h.__i==-1?Y:g[h.__i]||Y,h.__i=l,_=ze(e,h,y,o,i,s,a,u,c,f),p=h.__e,h.ref&&y.ref!=h.ref&&(y.ref&&He(y.ref,null,h),f.push(h.ref,h.__c||p,h)),m==null&&p!=null&&(m=p),4&h.__u||y.__k===h.__k?u=Ct(h,u,e):typeof h.type=="function"&&_!==void 0?u=_:p&&(u=p.nextSibling),h.__u&=-7);return n.__e=m,u}function fn(e,t,n,r,o){var i,s,a,u,c,f=n.length,l=f,y=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(u=i+y,(s=e.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?G(null,s,null,null,null):_e(s)?G(ne,{children:s},null,null,null):s.constructor==null&&s.__b>0?G(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(c=s.__i=dn(s,n,u,l))!=-1&&(l--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(o>f?y--:o<f&&y++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?y--:c==u+1?y++:(c>u?y--:y++,s.__u|=4))):e.__k[i]=null;if(l)for(i=0;i<f;i++)(a=n[i])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=W(a)),At(a,a));return r}function Ct(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Ct(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=W(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function dn(e,t,n,r){var o,i,s=e.key,a=e.type,u=t[n];if(u===null&&e.key==null||u&&s==u.key&&a==u.type&&(2&u.__u)==0)return n;if(r>(u!=null&&(2&u.__u)==0?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((u=t[o])&&(2&u.__u)==0&&s==u.key&&a==u.type)return o;o--}if(i<t.length){if((u=t[i])&&(2&u.__u)==0&&s==u.key&&a==u.type)return i;i++}}return-1}function Xe(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||un.test(t)?n:n+"px"}function ie(e,t,n,r,o){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Xe(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Xe(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(wt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=je,e.addEventListener(t,i?Oe:Ae,i)):e.removeEventListener(t,i?Oe:Ae,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ge(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=je++;else if(t.t<n.u)return;return n(w.event?w.event(t):t)}}}function ze(e,t,n,r,o,i,s,a,u,c){var f,l,y,h,p,m,_,g,E,v,T,k,O,N,j,I,Se,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[a=t.__e=n.__e]),(f=w.__b)&&f(t);e:if(typeof D=="function")try{if(g=t.props,E="prototype"in D&&D.prototype.render,v=(f=D.contextType)&&r[f.__c],T=f?v?v.props.value:f.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:(E?t.__c=l=new D(g,T):(t.__c=l=new se(g,T),l.constructor=D,l.render=hn),v&&v.sub(l),l.props=g,l.state||(l.state={}),l.context=T,l.__n=r,y=l.__d=!0,l.__h=[],l._sb=[]),E&&l.__s==null&&(l.__s=l.state),E&&D.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=L({},l.__s)),L(l.__s,D.getDerivedStateFromProps(g,l.__s))),h=l.props,p=l.state,l.__v=t,y)E&&D.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),E&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(E&&D.getDerivedStateFromProps==null&&g!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,T),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,T)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(K){K&&(K.__=t)}),k=0;k<l._sb.length;k++)l.__h.push(l._sb[k]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,T),E&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,p,m)})}if(l.context=T,l.props=g,l.__P=e,l.__e=!1,O=w.__r,N=0,E){for(l.state=l.__s,l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),j=0;j<l._sb.length;j++)l.__h.push(l._sb[j]);l._sb=[]}else do l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++N<25);l.state=l.__s,l.getChildContext!=null&&(r=L(L({},r),l.getChildContext())),E&&!y&&l.getSnapshotBeforeUpdate!=null&&(m=l.getSnapshotBeforeUpdate(h,p)),I=f,f!=null&&f.type===ne&&f.key==null&&(I=Tt(f.props.children)),a=Rt(e,_e(I)?I:[I],t,n,r,o,i,s,a,u,c),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),_&&(l.__E=l.__=null)}catch(K){if(t.__v=null,u||i!=null)if(K.then){for(t.__u|=u?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else for(Se=i.length;Se--;)Ie(i[Se]);else t.__e=n.__e,t.__k=n.__k;w.__e(K,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=pn(n.__e,t,n,r,o,i,s,u,c);return(f=w.diffed)&&f(t),128&t.__u?void 0:a}function kt(e,t,n){for(var r=0;r<n.length;r++)He(n[r],n[++r],n[++r]);w.__c&&w.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){w.__e(i,o.__v)}})}function Tt(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:_e(e)?e.map(Tt):L({},e)}function pn(e,t,n,r,o,i,s,a,u){var c,f,l,y,h,p,m,_=n.props,g=t.props,E=t.type;if(E=="svg"?o="http://www.w3.org/2000/svg":E=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!E&&(E?h.localName==E:h.nodeType==3)){e=h,i[c]=null;break}}if(e==null){if(E==null)return document.createTextNode(g);e=document.createElementNS(o,E,g.is&&g),a&&(w.__m&&w.__m(t,i),a=!1),i=null}if(E==null)_===g||a&&e.data==g||(e.data=g);else{if(i=i&&te.call(e.childNodes),_=n.props||Y,!a&&i!=null)for(_={},c=0;c<e.attributes.length;c++)_[(h=e.attributes[c]).name]=h.value;for(c in _)if(h=_[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=h;else if(!(c in g)){if(c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g)continue;ie(e,c,null,h,o)}}for(c in g)h=g[c],c=="children"?y=h:c=="dangerouslySetInnerHTML"?f=h:c=="value"?p=h:c=="checked"?m=h:a&&typeof h!="function"||_[c]===h||ie(e,c,h,_[c],o);if(f)a||l&&(f.__html==l.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(l&&(e.innerHTML=""),Rt(t.type=="template"?e.content:e,_e(y)?y:[y],t,n,r,E=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&W(n,0),a,u),i!=null)for(c=i.length;c--;)Ie(i[c]);a||(c="value",E=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[c]||E=="progress"&&!p||E=="option"&&p!=_[c])&&ie(e,c,p,_[c],o),c="checked",m!=null&&m!=e[c]&&ie(e,c,m,_[c],o))}return e}function He(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){w.__e(o,n)}}function At(e,t,n){var r,o;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||He(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){w.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&At(r[o],t,n||typeof e.type!="function");n||Ie(e.__e),e.__c=e.__=e.__e=void 0}function hn(e,t,n){return this.constructor(e,n)}function me(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),w.__&&w.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],ze(t,e=(!r&&n||t).__k=M(ne,null,[e]),o||Y,Y,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?te.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),kt(i,e,s)}function Ot(e,t){me(e,t,Ot)}function Ft(e,t,n){var r,o,i,s,a=L({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!=null?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?te.call(arguments,2):n),G(e.type,a,r||e.key,o||e.ref,null)}te=vt.slice,w={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},gt=0,se.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=L({},this.state),typeof e=="function"&&(e=e(L({},n),this.props)),e&&L(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ke(this))},se.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ke(this))},se.prototype.render=ne,z=[],Et=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xt=function(e,t){return e.__v.__b-t.__v.__b},fe.__r=0,wt=/(PointerCapture)$|Capture$/i,je=0,Ae=Ge(!1),Oe=Ge(!0);var _n=0;function b(e,t,n,r,o,i){t||(t={});var s,a,u=t;if("ref"in u)for(a in u={},t)a=="ref"?s=t[a]:u[a]=t[a];var c={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--_n,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)u[a]===void 0&&(u[a]=s[a]);return w.vnode&&w.vnode(c),c}var Z,S,Re,Qe,de=0,Bt=[],C=w,Ye=C.__b,Ze=C.__r,et=C.diffed,tt=C.__c,nt=C.unmount,rt=C.__;function $e(e,t){C.__h&&C.__h(S,e,de||t),de=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Q(e){return de=1,mn(Nt,e)}function mn(e,t,n){var r=$e(Z++,2);if(r.t=e,!r.__c&&(r.__=[Nt(void 0,t),function(a){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,a);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=S,!S.__f)){var o=function(a,u,c){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(y){return!!y.__c});if(f.every(function(y){return!y.__N}))return!i||i.call(this,a,u,c);var l=r.__c.props!==a;return f.forEach(function(y){if(y.__N){var h=y.__[0];y.__=y.__N,y.__N=void 0,h!==y.__[0]&&(l=!0)}}),i&&i.call(this,a,u,c)||l};S.__f=!0;var i=S.shouldComponentUpdate,s=S.componentWillUpdate;S.componentWillUpdate=function(a,u,c){if(this.__e){var f=i;i=void 0,o(a,u,c),i=f}s&&s.call(this,a,u,c)},S.shouldComponentUpdate=o}return r.__N||r.__}function bn(e,t){var n=$e(Z++,3);!C.__s&&Pt(n.__H,t)&&(n.__=e,n.u=t,S.__H.__h.push(n))}function yn(e){return de=5,gn(function(){return{current:e}},[])}function gn(e,t){var n=$e(Z++,7);return Pt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function En(){for(var e;e=Bt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ae),e.__H.__h.forEach(Fe),e.__H.__h=[]}catch(t){e.__H.__h=[],C.__e(t,e.__v)}}C.__b=function(e){S=null,Ye&&Ye(e)},C.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),rt&&rt(e,t)},C.__r=function(e){Ze&&Ze(e),Z=0;var t=(S=e.__c).__H;t&&(Re===S?(t.__h=[],S.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(ae),t.__h.forEach(Fe),t.__h=[],Z=0)),Re=S},C.diffed=function(e){et&&et(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Bt.push(t)!==1&&Qe===C.requestAnimationFrame||((Qe=C.requestAnimationFrame)||xn)(En)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Re=S=null},C.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ae),n.__h=n.__h.filter(function(r){return!r.__||Fe(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],C.__e(r,n.__v)}}),tt&&tt(e,t)},C.unmount=function(e){nt&&nt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ae(r)}catch(o){t=o}}),n.__H=void 0,t&&C.__e(t,n.__v))};var ot=typeof requestAnimationFrame=="function";function xn(e){var t,n=function(){clearTimeout(r),ot&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ot&&(t=requestAnimationFrame(n))}function ae(e){var t=S,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),S=t}function Fe(e){var t=S;e.__c=e.__(),S=t}function Pt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Nt(e,t){return typeof t=="function"?t(e):t}function Dt(e,t){return function(){return e.apply(t,arguments)}}const{toString:wn}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:be,toStringTag:Ut}=Symbol,ye=(e=>t=>{const n=wn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>ye(t)===e),ge=e=>t=>typeof t===e,{isArray:J}=Array,ee=ge("undefined");function vn(e){return e!==null&&!ee(e)&&e.constructor!==null&&!ee(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Lt=P("ArrayBuffer");function Sn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Lt(e.buffer),t}const Rn=ge("string"),F=ge("function"),jt=ge("number"),Ee=e=>e!==null&&typeof e=="object",Cn=e=>e===!0||e===!1,le=e=>{if(ye(e)!=="object")return!1;const t=qe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ut in e)&&!(be in e)},kn=P("Date"),Tn=P("File"),An=P("Blob"),On=P("FileList"),Fn=e=>Ee(e)&&F(e.pipe),Bn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||F(e.append)&&((t=ye(e))==="formdata"||t==="object"&&F(e.toString)&&e.toString()==="[object FormData]"))},Pn=P("URLSearchParams"),[Nn,Dn,Un,Ln]=["ReadableStream","Request","Response","Headers"].map(P),jn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),J(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function It(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zt=e=>!ee(e)&&e!==H;function Be(){const{caseless:e}=zt(this)&&this||{},t={},n=(r,o)=>{const i=e&&It(t,o)||o;le(t[i])&&le(r)?t[i]=Be(t[i],r):le(r)?t[i]=Be({},r):J(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&re(arguments[r],n);return t}const In=(e,t,n,{allOwnKeys:r}={})=>(re(t,(o,i)=>{n&&F(o)?e[i]=Dt(o,n):e[i]=o},{allOwnKeys:r}),e),zn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},$n=(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&qe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},qn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Mn=e=>{if(!e)return null;if(J(e))return e;let t=e.length;if(!jt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qe(Uint8Array)),Jn=(e,t)=>{const r=(e&&e[be]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Vn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kn=P("HTMLFormElement"),Xn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),it=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gn=P("RegExp"),Ht=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};re(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},Qn=e=>{Ht(e,(t,n)=>{if(F(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(F(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Yn=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return J(e)?r(e):r(String(e).split(t)),n},Zn=()=>{},er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function tr(e){return!!(e&&F(e.append)&&e[Ut]==="FormData"&&e[be])}const nr=e=>{const t=new Array(10),n=(r,o)=>{if(Ee(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=J(r)?[]:{};return re(r,(s,a)=>{const u=n(s,o+1);!ee(u)&&(i[a]=u)}),t[o]=void 0,i}}return r};return n(e,0)},rr=P("AsyncFunction"),or=e=>e&&(Ee(e)||F(e))&&F(e.then)&&F(e.catch),$t=((e,t)=>e?setImmediate:t?((n,r)=>(H.addEventListener("message",({source:o,data:i})=>{o===H&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),H.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",F(H.postMessage)),ir=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||$t,sr=e=>e!=null&&F(e[be]),d={isArray:J,isArrayBuffer:Lt,isBuffer:vn,isFormData:Bn,isArrayBufferView:Sn,isString:Rn,isNumber:jt,isBoolean:Cn,isObject:Ee,isPlainObject:le,isReadableStream:Nn,isRequest:Dn,isResponse:Un,isHeaders:Ln,isUndefined:ee,isDate:kn,isFile:Tn,isBlob:An,isRegExp:Gn,isFunction:F,isStream:Fn,isURLSearchParams:Pn,isTypedArray:Wn,isFileList:On,forEach:re,merge:Be,extend:In,trim:jn,stripBOM:zn,inherits:Hn,toFlatObject:$n,kindOf:ye,kindOfTest:P,endsWith:qn,toArray:Mn,forEachEntry:Jn,matchAll:Vn,isHTMLForm:Kn,hasOwnProperty:it,hasOwnProp:it,reduceDescriptors:Ht,freezeMethods:Qn,toObjectSet:Yn,toCamelCase:Xn,noop:Zn,toFiniteNumber:er,findKey:It,global:H,isContextDefined:zt,isSpecCompliantForm:tr,toJSONObject:nr,isAsyncFn:rr,isThenable:or,setImmediate:$t,asap:ir,isIterable:sr};function x(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}d.inherits(x,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:d.toJSONObject(this.config),code:this.code,status:this.status}}});const qt=x.prototype,Mt={};["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=>{Mt[e]={value:e}});Object.defineProperties(x,Mt);Object.defineProperty(qt,"isAxiosError",{value:!0});x.from=(e,t,n,r,o,i)=>{const s=Object.create(qt);return d.toFlatObject(e,s,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),x.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const ar=null;function Pe(e){return d.isPlainObject(e)||d.isArray(e)}function Wt(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function st(e,t,n){return e?e.concat(t).map(function(o,i){return o=Wt(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function lr(e){return d.isArray(e)&&!e.some(Pe)}const cr=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function xe(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!d.isUndefined(_[m])});const r=n.metaTokens,o=n.visitor||f,i=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(d.isDate(p))return p.toISOString();if(d.isBoolean(p))return p.toString();if(!u&&d.isBlob(p))throw new x("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(p)||d.isTypedArray(p)?u&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,m,_){let g=p;if(p&&!_&&typeof p=="object"){if(d.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(d.isArray(p)&&lr(p)||(d.isFileList(p)||d.endsWith(m,"[]"))&&(g=d.toArray(p)))return m=Wt(m),g.forEach(function(v,T){!(d.isUndefined(v)||v===null)&&t.append(s===!0?st([m],T,i):s===null?m:m+"[]",c(v))}),!1}return Pe(p)?!0:(t.append(st(_,m,i),c(p)),!1)}const l=[],y=Object.assign(cr,{defaultVisitor:f,convertValue:c,isVisitable:Pe});function h(p,m){if(!d.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));l.push(p),d.forEach(p,function(g,E){(!(d.isUndefined(g)||g===null)&&o.call(t,g,d.isString(E)?E.trim():E,m,y))===!0&&h(g,m?m.concat(E):[E])}),l.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}function at(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Me(e,t){this._pairs=[],e&&xe(e,this,t)}const Jt=Me.prototype;Jt.append=function(t,n){this._pairs.push([t,n])};Jt.toString=function(t){const n=t?function(r){return t.call(this,r,at)}:at;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function ur(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vt(e,t,n){if(!t)return e;const r=n&&n.encode||ur;d.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=d.isURLSearchParams(t)?t.toString():new Me(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class lt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fr=typeof URLSearchParams<"u"?URLSearchParams:Me,dr=typeof FormData<"u"?FormData:null,pr=typeof Blob<"u"?Blob:null,hr={isBrowser:!0,classes:{URLSearchParams:fr,FormData:dr,Blob:pr},protocols:["http","https","file","blob","url","data"]},We=typeof window<"u"&&typeof document<"u",Ne=typeof navigator=="object"&&navigator||void 0,_r=We&&(!Ne||["ReactNative","NativeScript","NS"].indexOf(Ne.product)<0),mr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",br=We&&window.location.href||"http://localhost",yr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:_r,hasStandardBrowserWebWorkerEnv:mr,navigator:Ne,origin:br},Symbol.toStringTag,{value:"Module"})),A={...yr,...hr};function gr(e,t){return xe(e,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return A.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Er(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function xr(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function Xt(e){function t(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=n.length;return s=!s&&d.isArray(o)?o.length:s,u?(d.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!d.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&d.isArray(o[s])&&(o[s]=xr(o[s])),!a)}if(d.isFormData(e)&&d.isFunction(e.entries)){const n={};return d.forEachEntry(e,(r,o)=>{t(Er(r),o,n,0)}),n}return null}function wr(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const oe={transitional:Kt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=d.isObject(t);if(i&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return o?JSON.stringify(Xt(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return gr(t,this.formSerializer).toString();if((a=d.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return xe(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),wr(t)):t}],transformResponse:[function(t){const n=this.transitional||oe.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?x.from(a,x.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{oe.headers[e]={}});const vr=d.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"]),Sr=e=>{const t={};let n,r,o;return e&&e.split(`
2
- `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&vr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ct=Symbol("internals");function X(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:d.isArray(e)?e.map(ce):String(e)}function Rr(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Cr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ce(e,t,n,r,o){if(d.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!d.isString(t)){if(d.isString(r))return t.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(t)}}function kr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Tr(e,t){const n=d.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}let B=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,u,c){const f=X(u);if(!f)throw new Error("header name must be a non-empty string");const l=d.findKey(o,f);(!l||o[l]===void 0||c===!0||c===void 0&&o[l]!==!1)&&(o[l||u]=ce(a))}const s=(a,u)=>d.forEach(a,(c,f)=>i(c,f,u));if(d.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(d.isString(t)&&(t=t.trim())&&!Cr(t))s(Sr(t),n);else if(d.isObject(t)&&d.isIterable(t)){let a={},u,c;for(const f of t){if(!d.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[c=f[0]]=(u=a[c])?d.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}s(a,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=X(t),t){const r=d.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Rr(o);if(d.isFunction(n))return n.call(this,o,r);if(d.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=X(t),t){const r=d.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ce(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=X(s),s){const a=d.findKey(r,s);a&&(!n||Ce(r,r[a],a,n))&&(delete r[a],o=!0)}}return d.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Ce(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return d.forEach(this,(o,i)=>{const s=d.findKey(r,i);if(s){n[s]=ce(o),delete n[i];return}const a=t?kr(i):String(i).trim();a!==i&&delete n[i],n[a]=ce(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return d.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).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,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[ct]=this[ct]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=X(s);r[a]||(Tr(o,s),r[a]=!0)}return d.isArray(t)?t.forEach(i):i(t),this}};B.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(B.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});d.freezeMethods(B);function ke(e,t){const n=this||oe,r=t||n,o=B.from(r.headers);let i=r.data;return d.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Gt(e){return!!(e&&e.__CANCEL__)}function V(e,t,n){x.call(this,e??"canceled",x.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(V,x,{__CANCEL__:!0});function Qt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new x("Request failed with status code "+n.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ar(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Or(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[i];s||(s=c),n[o]=u,r[o]=c;let l=i,y=0;for(;l!==o;)y+=n[l++],l=l%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const h=f&&c-f;return h?Math.round(y*1e3/h):void 0}}function Fr(e,t){let n=0,r=1e3/t,o,i;const s=(c,f=Date.now())=>{n=f,o=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),l=f-n;l>=r?s(c,f):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},r-l)))},()=>o&&s(o)]}const pe=(e,t,n=3)=>{let r=0;const o=Or(50,250);return Fr(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-r,c=o(u),f=s<=a;r=s;const l={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-s)/c:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(l)},n)},ut=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ft=e=>(...t)=>d.asap(()=>e(...t)),Br=A.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,A.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,Pr=A.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),d.isString(r)&&s.push("path="+r),d.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Nr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Dr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yt(e,t,n){let r=!Nr(t);return e&&(r||n==!1)?Dr(e,t):t}const dt=e=>e instanceof B?{...e}:e;function q(e,t){t=t||{};const n={};function r(c,f,l,y){return d.isPlainObject(c)&&d.isPlainObject(f)?d.merge.call({caseless:y},c,f):d.isPlainObject(f)?d.merge({},f):d.isArray(f)?f.slice():f}function o(c,f,l,y){if(d.isUndefined(f)){if(!d.isUndefined(c))return r(void 0,c,l,y)}else return r(c,f,l,y)}function i(c,f){if(!d.isUndefined(f))return r(void 0,f)}function s(c,f){if(d.isUndefined(f)){if(!d.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,l){if(l in t)return r(c,f);if(l in e)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,f,l)=>o(dt(c),dt(f),l,!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(f){const l=u[f]||o,y=l(e[f],t[f],f);d.isUndefined(y)&&l!==a||(n[f]=y)}),n}const Zt=e=>{const t=q({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;t.headers=s=B.from(s),t.url=Vt(Yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(d.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((u=s.getContentType())!==!1){const[c,...f]=u?u.split(";").map(l=>l.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...f].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&d.isFunction(r)&&(r=r(t)),r||r!==!1&&Br(t.url))){const c=o&&i&&Pr.read(i);c&&s.set(o,c)}return t},Ur=typeof XMLHttpRequest<"u",Lr=Ur&&function(e){return new Promise(function(n,r){const o=Zt(e);let i=o.data;const s=B.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,l,y,h,p;function m(){h&&h(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function g(){if(!_)return;const v=B.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:v,config:e,request:_};Qt(function(N){n(N),m()},function(N){r(N),m()},k),_=null}"onloadend"in _?_.onloadend=g:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(g)},_.onabort=function(){_&&(r(new x("Request aborted",x.ECONNABORTED,e,_)),_=null)},_.onerror=function(){r(new x("Network Error",x.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Kt;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),r(new x(T,k.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,e,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&d.forEach(s.toJSON(),function(T,k){_.setRequestHeader(k,T)}),d.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([y,p]=pe(c,!0),_.addEventListener("progress",y)),u&&_.upload&&([l,h]=pe(u),_.upload.addEventListener("progress",l),_.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(f=v=>{_&&(r(!v||v.type?new V(null,e,_):v),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=Ar(o.url);if(E&&A.protocols.indexOf(E)===-1){r(new x("Unsupported protocol "+E+":",x.ERR_BAD_REQUEST,e));return}_.send(i||null)})},jr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof x?f:new V(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new x(`timeout ${t} of ms exceeded`,x.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>d.asap(a),u}},Ir=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},zr=async function*(e,t){for await(const n of Hr(e))yield*Ir(n,t)},Hr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},pt=(e,t,n,r)=>{const o=zr(e,t);let i=0,s,a=u=>{s||(s=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let l=f.byteLength;if(n){let y=i+=l;n(y)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},we=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",en=we&&typeof ReadableStream=="function",$r=we&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),tn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qr=en&&tn(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ht=64*1024,De=en&&tn(()=>d.isReadableStream(new Response("").body)),he={stream:De&&(e=>e.body)};we&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!he[t]&&(he[t]=d.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new x(`Response type '${t}' is not supported`,x.ERR_NOT_SUPPORT,r)})})})(new Response);const Mr=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(A.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await $r(e)).byteLength},Wr=async(e,t)=>{const n=d.toFiniteNumber(e.getContentLength());return n??Mr(t)},Jr=we&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:l="same-origin",fetchOptions:y}=Zt(e);c=c?(c+"").toLowerCase():"text";let h=jr([o,i&&i.toAbortSignal()],s),p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let _;try{if(u&&qr&&n!=="get"&&n!=="head"&&(_=await Wr(f,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(d.isFormData(r)&&(O=k.headers.get("content-type"))&&f.setContentType(O),k.body){const[N,j]=ut(_,pe(ft(u)));r=pt(k.body,ht,N,j)}}d.isString(l)||(l=l?"include":"omit");const g="credentials"in Request.prototype;p=new Request(t,{...y,signal:h,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:g?l:void 0});let E=await fetch(p,y);const v=De&&(c==="stream"||c==="response");if(De&&(a||v&&m)){const k={};["status","statusText","headers"].forEach(I=>{k[I]=E[I]});const O=d.toFiniteNumber(E.headers.get("content-length")),[N,j]=a&&ut(O,pe(ft(a),!0))||[];E=new Response(pt(E.body,ht,N,()=>{j&&j(),m&&m()}),k)}c=c||"text";let T=await he[d.findKey(he,c)||"text"](E,e);return!v&&m&&m(),await new Promise((k,O)=>{Qt(k,O,{data:T,headers:B.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(g){throw m&&m(),g&&g.name==="TypeError"&&/Load failed|fetch/i.test(g.message)?Object.assign(new x("Network Error",x.ERR_NETWORK,e,p),{cause:g.cause||g}):x.from(g,g&&g.code,e,p)}}),Ue={http:ar,xhr:Lr,fetch:Jr};d.forEach(Ue,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _t=e=>`- ${e}`,Vr=e=>d.isFunction(e)||e===null||e===!1,nn={getAdapter:e=>{e=d.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!Vr(n)&&(r=Ue[(s=String(n)).toLowerCase()],r===void 0))throw new x(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
4
- `+i.map(_t).join(`
5
- `):" "+_t(i[0]):"as no adapter specified";throw new x("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Ue};function Te(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function mt(e){return Te(e),e.headers=B.from(e.headers),e.data=ke.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nn.getAdapter(e.adapter||oe.adapter)(e).then(function(r){return Te(e),r.data=ke.call(e,e.transformResponse,r),r.headers=B.from(r.headers),r},function(r){return Gt(r)||(Te(e),r&&r.response&&(r.response.data=ke.call(e,e.transformResponse,r.response),r.response.headers=B.from(r.response.headers))),Promise.reject(r)})}const rn="1.10.0",ve={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ve[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const bt={};ve.transitional=function(t,n,r){function o(i,s){return"[Axios v"+rn+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(t===!1)throw new x(o(s," has been removed"+(n?" in "+n:"")),x.ERR_DEPRECATED);return n&&!bt[s]&&(bt[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,a):!0}};ve.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Kr(e,t,n){if(typeof e!="object")throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new x("option "+i+" must be "+u,x.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new x("Unknown option "+i,x.ERR_BAD_OPTION)}}const ue={assertOptions:Kr,validators:ve},U=ue.validators;let $=class{constructor(t){this.defaults=t||{},this.interceptors={request:new lt,response:new lt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=q(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),o!=null&&(d.isFunction(o)?n.paramsSerializer={serialize:o}:ue.assertOptions(o,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ue.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&d.merge(i.common,i[n.method]);i&&d.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=B.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let f,l=0,y;if(!u){const p=[mt.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),y=p.length,f=Promise.resolve(n);l<y;)f=f.then(p[l++],p[l++]);return f}y=a.length;let h=n;for(l=0;l<y;){const p=a[l++],m=a[l++];try{h=p(h)}catch(_){m.call(this,_);break}}try{f=mt.call(this,h)}catch(p){return Promise.reject(p)}for(l=0,y=c.length;l<y;)f=f.then(c[l++],c[l++]);return f}getUri(t){t=q(this.defaults,t);const n=Yt(t.baseURL,t.url,t.allowAbsoluteUrls);return Vt(n,t.params,t.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(t){$.prototype[t]=function(n,r){return this.request(q(r||{},{method:t,url:n,data:(r||{}).data}))}});d.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,a){return this.request(q(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$.prototype[t]=n(),$.prototype[t+"Form"]=n(!0)});let Xr=class on{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new V(i,s,a),n(r.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;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new on(function(o){t=o}),cancel:t}}};function Gr(e){return function(n){return e.apply(null,n)}}function Qr(e){return d.isObject(e)&&e.isAxiosError===!0}const Le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Le).forEach(([e,t])=>{Le[t]=e});function sn(e){const t=new $(e),n=Dt($.prototype.request,t);return d.extend(n,$.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return sn(q(e,o))},n}const R=sn(oe);R.Axios=$;R.CanceledError=V;R.CancelToken=Xr;R.isCancel=Gt;R.VERSION=rn;R.toFormData=xe;R.AxiosError=x;R.Cancel=R.CanceledError;R.all=function(t){return Promise.all(t)};R.spread=Gr;R.isAxiosError=Qr;R.mergeConfig=q;R.AxiosHeaders=B;R.formToJSON=e=>Xt(d.isHTMLForm(e)?new FormData(e):e);R.getAdapter=nn.getAdapter;R.HttpStatusCode=Le;R.default=R;const{Axios:mo,AxiosError:bo,CanceledError:yo,isCancel:go,CancelToken:Eo,VERSION:xo,all:wo,Cancel:vo,isAxiosError:So,spread:Ro,toFormData:Co,AxiosHeaders:ko,HttpStatusCode:To,formToJSON:Ao,getAdapter:Oo,mergeConfig:Fo}=R;function Yr(e={}){const{baseURL:t="/api",timeout:n=1e4,getToken:r,getLocale:o,onError:i}=e,s=R.create({baseURL:t,timeout:n});return s.interceptors.request.use(a=>{if(r){const u=r();u&&(a.headers={...a.headers,Authorization:u})}if(o){const u=o();u&&(a.headers={...a.headers,"Accept-Language":u})}return a}),s.interceptors.response.use(a=>a.data&&a.data.code===0?a.data:(i&&i(a.data?.msg||a.data?.message||"未知错误",a),Promise.reject(a.data||{message:"未知错误"})),a=>(i&&i(a.message,a),Promise.reject(a))),s}const Zr=Yr();function eo(e){const{token:t,...n}=e;return Zr.get("/balance",{params:n,headers:t?{Authorization:t}:void 0})}function to({onClick:e,color:t,children:n,merchantId:r,bizType:o,token:i}){return r&&o&&eo({merchant_id:r,biz_type:o,token:i}).then(s=>console.log(s)),b("button",{style:{background:t||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:n})}const no=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=o?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}},s=o?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},a=o?{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return b(ne,{children:[b("div",{style:{marginBottom:18},children:[b("div",{style:i.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),b("select",{style:{...i.select},value:e.currency,onInput:u=>{const c=u.target.value;t(f=>({...f,currency:c}))},children:[b("option",{value:"USD",children:"USD - 美元"}),b("option",{value:"CNY",children:"CNY - 人民币"}),b("option",{value:"EUR",children:"EUR - 欧元"})]})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:i.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),b("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:u=>{const c=u.target.value;t(f=>({...f,amount:c,amountError:c.trim()?"":f.amountError}))},style:{...i.input,...e.amountError?i.inputError:{}}}),e.amountError&&b("div",{style:i.error,children:e.amountError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:i.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),b("select",{style:{...i.select,...e.rechargeChannelError?i.selectError:{}},value:e.rechargeChannel,onInput:u=>{const c=u.target.value;t(f=>({...f,rechargeChannel:c,rechargeChannelError:c?"":f.rechargeChannelError}))},children:[b("option",{value:"alipay",children:"支付宝"}),b("option",{value:"wechat",children:"微信"}),b("option",{value:"paypal",children:"PayPal"})]}),e.rechargeChannelError&&b("div",{style:i.error,children:e.rechargeChannelError})]}),e.error&&b("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:s,children:"取消"}),b("button",{type:"submit",disabled:r,style:a,children:r?"提交中...":"去支付"})]})]})},ro=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=yn(null),s=o?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #23262F",borderRadius:8,background:"#181A20",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#fff",justifyContent:"space-between"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}},a=h=>{const p=Array.from(h.target.files).slice(0,10);t(m=>({...m,files:p,filesError:""}))},u=h=>{h.preventDefault();const p=Array.from(h.dataTransfer.files).slice(0,10);t(m=>({...m,files:p,filesError:""}))},c=h=>{h.preventDefault()},f=h=>{t(p=>({...p,files:p.files.filter((m,_)=>_!==h)}))},l=h=>{h.preventDefault();let p=!0;t(m=>({...m,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(m=>({...m,platformError:"请选择支付平台"})),p=!1),e.transactionId.trim()||(t(m=>({...m,transactionIdError:"请输入转账交易ID"})),p=!1),(!e.files||e.files.length===0)&&(t(m=>({...m,filesError:"请上传转账凭证"})),p=!1),p&&console.log("OfflineTransferForm values:",e)},y=h=>h>1024*1024?(h/1024/1024).toFixed(2)+" MB":h>1024?(h/1024).toFixed(2)+" KB":h+" B";return b("form",{onSubmit:l,children:[b("div",{style:{marginBottom:18},children:[b("div",{style:s.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),b("select",{style:{...s.select,...e.platformError?s.selectError:{}},value:e.platform,onInput:h=>{const p=h.target.value;t(m=>({...m,platform:p,platformError:p?"":m.platformError}))},children:[b("option",{value:"paypal",children:"PayPal"}),b("option",{value:"alipay",children:"支付宝"}),b("option",{value:"wechat",children:"微信"})]}),e.platformError&&b("div",{style:s.error,children:e.platformError})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:s.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),b("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:h=>{const p=h.target.value;t(m=>({...m,transactionId:p,transactionIdError:p?"":m.transactionIdError}))},style:{...s.input,...e.transactionIdError?s.inputError:{}}}),e.transactionIdError&&b("div",{style:s.error,children:e.transactionIdError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:s.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),b("div",{style:{...s.upload,...e.filesError?s.uploadError:{}},onClick:()=>i.current?.click(),onDrop:u,onDragOver:c,children:[b("div",{style:{fontSize:48,marginBottom:12},children:b("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[b("rect",{x:"8",y:"8",width:"48",height:"48",rx:"12",fill:"#F4F6FA"}),b("rect",{x:"28",y:"20",width:"8",height:"24",rx:"4",fill:"#E5E6EB"})]})}),b("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),b("div",{style:{color:"#999",fontSize:13},children:"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件"}),b("input",{ref:i,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",style:{display:"none"},onChange:a})]}),e.files&&e.files.length>0&&b("div",{style:{marginTop:12},children:e.files.map((h,p)=>b("div",{style:s.fileItem,children:[b("div",{style:{display:"flex",alignItems:"center",flex:1},children:[b("span",{style:{fontWeight:500},children:h.name}),b("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["(",y(h.size),")"]})]}),b("button",{type:"button",onClick:m=>{m.stopPropagation(),f(p)},style:s.removeBtn,children:"移除"})]},p))}),e.filesError&&b("div",{style:s.error,children:e.filesError})]}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:s.buttonCancel,children:"取消"}),b("button",{type:"submit",disabled:r,style:s.buttonSubmit,children:"去支付"})]})]})};function oo({visible:e,onClose:t,onSubmit:n,color:r,whiteTheme:o=!0}){console.log(1111);const[i,s]=Q({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,u]=Q("online"),[c,f]=Q({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(bn(()=>{e||(u("online"),s({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),f({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const l=async p=>{p.preventDefault();let m=!0;if(s(_=>({..._,amountError:"",rechargeChannelError:""})),i.amount.trim()||(s(_=>({..._,amountError:"请输入充值金额"})),m=!1),i.rechargeChannel||(s(_=>({..._,rechargeChannelError:"请选择支付平台"})),m=!1),!!m){s(_=>({..._,loading:!0,error:""}));try{await n({amount:i.amount,rechargeChannel:i.rechargeChannel,currency:i.currency}),t()}catch{s(_=>({..._,error:"提交失败,请重试"}))}finally{s(_=>({..._,loading:!1}))}}},y=p=>{p.target===p.currentTarget&&t()},h=o?{modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.08)",mask:"rgba(0,0,0,0.3)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,m)=>({flex:1,background:p?"#fff":"#F7F8FA",color:p?"#155EEF":"#222",border:"none",borderRadius:m?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:m?"1px solid #F0F1F3":void 0,borderLeft:m?void 0:"1px solid #F0F1F3",transition:"all 0.2s"})}:{modalBg:"#181A20",modalColor:"#fff",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.5)",mask:"rgba(0,0,0,0.7)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#fff"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,m)=>({flex:1,background:p?"#23262F":"#181A20",color:p?"#00E8C6":"#fff",border:"none",borderRadius:m?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer",borderRight:m?"1px solid #23262F":void 0,borderLeft:m?void 0:"1px solid #23262F",transition:"all 0.2s"})};return b("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:h.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:y,children:b("form",{onSubmit:l,style:{background:h.modalBg,padding:32,borderRadius:12,minWidth:400,color:r||h.modalColor,boxShadow:h.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[b("button",{type:"button",onClick:t,style:h.closeBtn,"aria-label":"关闭",children:"×"}),b("div",{style:h.title,children:"充值 / 转账"}),b("div",{style:{display:"flex",marginBottom:28},children:[b("button",{type:"button",onClick:()=>u("online"),style:h.tabBtn(a==="online",!0),children:"在线充值"}),b("button",{type:"button",onClick:()=>u("offline"),style:h.tabBtn(a==="offline",!1),children:"线下转账"})]}),a==="online"?b(no,{formState:i,setFormState:s,onClose:t,loading:i.loading,whiteTheme:o}):b(ro,{formState:c,setFormState:f,onClose:t,loading:c.loading,whiteTheme:o})]})})}function Je(){return(Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var io=["context","children"];function so(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var i,s,a={},u=Object.keys(r);for(s=0;s<u.length;s++)o.indexOf(i=u[s])>=0||(a[i]=r[i]);return a}(e,io);return Ft(t,n)}function ao(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=M(so,Je({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],i={},s=0,a=n.attributes,u=n.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(i[a[s].name]=a[s].value,i[an(a[s].name)]=a[s].value);for(s=u.length;s--;){var c=t(u[s],null),f=u[s].slot;f?i[f]=M(yt,{name:f},c):o[s]=c}var l=r?M(yt,null,o):o;return M(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ot:me)(this._vdom,this._root)}function an(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function lo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[an(e)]=n,this._vdom=Ft(this._vdom,r),me(this._vdom,this._root)}}function co(){me(this._vdom=null,this._root)}function yt(e,t){var n=this;return M("slot",Je({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function uo(e,t,n,r){function o(){var i=Reflect.construct(HTMLElement,[],o);return i._vdomComponent=e,i._root=i,i}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=ao,o.prototype.attributeChangedCallback=lo,o.prototype.disconnectedCallback=co,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(i){Object.defineProperty(o.prototype,i,{get:function(){return this._vdom.props[i]},set:function(s){this._vdom?this.attributeChangedCallback(i,null,s):(this._props||(this._props={}),this._props[i]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(i,s)}})}),customElements.define(t,o)}function fo(e){const[t,n]=Q(!1),[r,o]=Q(!0),i=e.theme?.primaryColor,s=e.merchant_id,a=e.biz_type,u=e.token;return b("div",{children:[b(to,{color:i,onClick:()=>n(!0),merchantId:s,bizType:a,token:u,children:"打开表单"}),b("button",{style:{marginLeft:16,padding:"8px 16px",borderRadius:6,border:"1px solid #eee",cursor:"pointer"},onClick:()=>o(f=>!f),children:r?"切换为暗黑主题":"切换为白色主题"}),b(oo,{visible:t,onClose:()=>n(!1),onSubmit:async f=>{console.log("submit",f)},color:i,whiteTheme:r,merchantId:s,bizType:a,token:u})]})}uo(fo,"x-best-modal-form",["theme"]);const po=["x-greeting","x-best-modal-form"];exports.components=po;exports.npmTest=ln;exports.printCurrentTime=cn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function hn(){console.log("npm package test!!!")}function _n(){console.log("Current time:",new Date().toISOString())}function mn(e){const{merchant_id:t,biz_type:n,theme:r,user_id:o}=e,i="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,userId:o,token:i,theme:r})),{token:i,merchantId:t,bizType:n,theme:r,userId:o}}var ne,E,Et,H,Xe,St,vt,Rt,je,Oe,Fe,Y={},Ct=[],bn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,me=Array.isArray;function L(e,t){for(var n in t)e[n]=t[n];return e}function He(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function W(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?ne.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Z(e,s,r,o,null)}function Z(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Et,__i:-1,__u:0};return o==null&&E.vnode!=null&&E.vnode(i),i}function V(e){return e.children}function ae(e,t){this.props=e,this.context=t}function J(e,t){if(t==null)return e.__?J(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?J(e):null}function kt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return kt(e)}}function Ge(e){(!e.__d&&(e.__d=!0)&&H.push(e)&&!de.__r++||Xe!=E.debounceRendering)&&((Xe=E.debounceRendering)||St)(de)}function de(){for(var e,t,n,r,o,i,s,a=1;H.length;)H.length>a&&H.sort(vt),e=H.shift(),a=H.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,i=[],s=[],t.__P&&((n=L({},r)).__v=r.__v+1,E.vnode&&E.vnode(n),Me(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,o??J(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,Ot(i,n,s),n.__e!=o&&kt(n)));de.__r=0}function At(e,t,n,r,o,i,s,a,c,u,f){var l,b,h,p,g,_,y=r&&r.__k||Ct,w=t.length;for(c=gn(n,t,y,c,w),l=0;l<w;l++)(h=n.__k[l])!=null&&(b=h.__i==-1?Y:y[h.__i]||Y,h.__i=l,_=Me(e,h,b,o,i,s,a,c,u,f),p=h.__e,h.ref&&b.ref!=h.ref&&(b.ref&&$e(b.ref,null,h),f.push(h.ref,h.__c||p,h)),g==null&&p!=null&&(g=p),4&h.__u||b.__k===h.__k?c=Tt(h,c,e):typeof h.type=="function"&&_!==void 0?c=_:p&&(c=p.nextSibling),h.__u&=-7);return n.__e=g,c}function gn(e,t,n,r,o){var i,s,a,c,u,f=n.length,l=f,b=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=i+b,(s=e.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Z(null,s,null,null,null):me(s)?Z(V,{children:s},null,null,null):s.constructor==null&&s.__b>0?Z(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(u=s.__i=yn(s,n,c,l))!=-1&&(l--,(a=n[u])&&(a.__u|=2)),a==null||a.__v==null?(u==-1&&(o>f?b--:o<f&&b++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?b--:u==c+1?b++:(u>c?b--:b++,s.__u|=4))):e.__k[i]=null;if(l)for(i=0;i<f;i++)(a=n[i])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=J(a)),Bt(a,a));return r}function Tt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Tt(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=J(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function yn(e,t,n,r){var o,i,s=e.key,a=e.type,c=t[n];if(c===null&&e.key==null||c&&s==c.key&&a==c.type&&(2&c.__u)==0)return n;if(r>(c!=null&&(2&c.__u)==0?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((c=t[o])&&(2&c.__u)==0&&s==c.key&&a==c.type)return o;o--}if(i<t.length){if((c=t[i])&&(2&c.__u)==0&&s==c.key&&a==c.type)return i;i++}}return-1}function Qe(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||bn.test(t)?n:n+"px"}function se(e,t,n,r,o){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Qe(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Qe(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Rt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=je,e.addEventListener(t,i?Fe:Oe,i)):e.removeEventListener(t,i?Fe:Oe,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ze(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=je++;else if(t.t<n.u)return;return n(E.event?E.event(t):t)}}}function Me(e,t,n,r,o,i,s,a,c,u){var f,l,b,h,p,g,_,y,w,S,A,k,O,P,z,j,Re,U=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(f=E.__b)&&f(t);e:if(typeof U=="function")try{if(y=t.props,w="prototype"in U&&U.prototype.render,S=(f=U.contextType)&&r[f.__c],A=f?S?S.props.value:f.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:(w?t.__c=l=new U(y,A):(t.__c=l=new ae(y,A),l.constructor=U,l.render=xn),S&&S.sub(l),l.props=y,l.state||(l.state={}),l.context=A,l.__n=r,b=l.__d=!0,l.__h=[],l._sb=[]),w&&l.__s==null&&(l.__s=l.state),w&&U.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=L({},l.__s)),L(l.__s,U.getDerivedStateFromProps(y,l.__s))),h=l.props,p=l.state,l.__v=t,b)w&&U.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),w&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(w&&U.getDerivedStateFromProps==null&&y!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(y,A),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(y,l.__s,A)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(G){G&&(G.__=t)}),k=0;k<l._sb.length;k++)l.__h.push(l._sb[k]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(y,l.__s,A),w&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,p,g)})}if(l.context=A,l.props=y,l.__P=e,l.__e=!1,O=E.__r,P=0,w){for(l.state=l.__s,l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),z=0;z<l._sb.length;z++)l.__h.push(l._sb[z]);l._sb=[]}else do l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++P<25);l.state=l.__s,l.getChildContext!=null&&(r=L(L({},r),l.getChildContext())),w&&!b&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(h,p)),j=f,f!=null&&f.type===V&&f.key==null&&(j=Ft(f.props.children)),a=At(e,me(j)?j:[j],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),_&&(l.__E=l.__=null)}catch(G){if(t.__v=null,c||i!=null)if(G.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else for(Re=i.length;Re--;)He(i[Re]);else t.__e=n.__e,t.__k=n.__k;E.__e(G,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=wn(n.__e,t,n,r,o,i,s,c,u);return(f=E.diffed)&&f(t),128&t.__u?void 0:a}function Ot(e,t,n){for(var r=0;r<n.length;r++)$e(n[r],n[++r],n[++r]);E.__c&&E.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){E.__e(i,o.__v)}})}function Ft(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:me(e)?e.map(Ft):L({},e)}function wn(e,t,n,r,o,i,s,a,c){var u,f,l,b,h,p,g,_=n.props,y=t.props,w=t.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((h=i[u])&&"setAttribute"in h==!!w&&(w?h.localName==w:h.nodeType==3)){e=h,i[u]=null;break}}if(e==null){if(w==null)return document.createTextNode(y);e=document.createElementNS(o,w,y.is&&y),a&&(E.__m&&E.__m(t,i),a=!1),i=null}if(w==null)_===y||a&&e.data==y||(e.data=y);else{if(i=i&&ne.call(e.childNodes),_=n.props||Y,!a&&i!=null)for(_={},u=0;u<e.attributes.length;u++)_[(h=e.attributes[u]).name]=h.value;for(u in _)if(h=_[u],u!="children"){if(u=="dangerouslySetInnerHTML")l=h;else if(!(u in y)){if(u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y)continue;se(e,u,null,h,o)}}for(u in y)h=y[u],u=="children"?b=h:u=="dangerouslySetInnerHTML"?f=h:u=="value"?p=h:u=="checked"?g=h:a&&typeof h!="function"||_[u]===h||se(e,u,h,_[u],o);if(f)a||l&&(f.__html==l.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(l&&(e.innerHTML=""),At(t.type=="template"?e.content:e,me(b)?b:[b],t,n,r,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&J(n,0),a,c),i!=null)for(u=i.length;u--;)He(i[u]);a||(u="value",w=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[u]||w=="progress"&&!p||w=="option"&&p!=_[u])&&se(e,u,p,_[u],o),u="checked",g!=null&&g!=e[u]&&se(e,u,g,_[u],o))}return e}function $e(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){E.__e(o,n)}}function Bt(e,t,n){var r,o;if(E.unmount&&E.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||$e(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){E.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Bt(r[o],t,n||typeof e.type!="function");n||He(e.__e),e.__c=e.__=e.__e=void 0}function xn(e,t,n){return this.constructor(e,n)}function be(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),E.__&&E.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Me(t,e=(!r&&n||t).__k=W(V,null,[e]),o||Y,Y,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ne.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Ot(i,e,s)}function Nt(e,t){be(e,t,Nt)}function Pt(e,t,n){var r,o,i,s,a=L({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!=null?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?ne.call(arguments,2):n),Z(e.type,a,r||e.key,o||e.ref,null)}ne=Ct.slice,E={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Et=0,ae.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=L({},this.state),typeof e=="function"&&(e=e(L({},n),this.props)),e&&L(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ge(this))},ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ge(this))},ae.prototype.render=V,H=[],St=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vt=function(e,t){return e.__v.__b-t.__v.__b},de.__r=0,Rt=/(PointerCapture)$|Capture$/i,je=0,Oe=Ze(!1),Fe=Ze(!0);var En=0;function m(e,t,n,r,o,i){t||(t={});var s,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?s=t[a]:c[a]=t[a];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--En,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return E.vnode&&E.vnode(u),u}var ee,v,Ce,Ye,pe=0,Ut=[],C=E,et=C.__b,tt=C.__r,nt=C.diffed,rt=C.__c,ot=C.unmount,it=C.__;function qe(e,t){C.__h&&C.__h(v,e,pe||t),pe=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function I(e){return pe=1,Sn(zt,e)}function Sn(e,t,n){var r=qe(ee++,2);if(r.t=e,!r.__c&&(r.__=[zt(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.__f)){var o=function(a,c,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(b){return!!b.__c});if(f.every(function(b){return!b.__N}))return!i||i.call(this,a,c,u);var l=r.__c.props!==a;return f.forEach(function(b){if(b.__N){var h=b.__[0];b.__=b.__N,b.__N=void 0,h!==b.__[0]&&(l=!0)}}),i&&i.call(this,a,c,u)||l};v.__f=!0;var i=v.shouldComponentUpdate,s=v.componentWillUpdate;v.componentWillUpdate=function(a,c,u){if(this.__e){var f=i;i=void 0,o(a,c,u),i=f}s&&s.call(this,a,c,u)},v.shouldComponentUpdate=o}return r.__N||r.__}function Dt(e,t){var n=qe(ee++,3);!C.__s&&It(n.__H,t)&&(n.__=e,n.u=t,v.__H.__h.push(n))}function Lt(e){return pe=5,vn(function(){return{current:e}},[])}function vn(e,t){var n=qe(ee++,7);return It(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Rn(){for(var e;e=Ut.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(le),e.__H.__h.forEach(Be),e.__H.__h=[]}catch(t){e.__H.__h=[],C.__e(t,e.__v)}}C.__b=function(e){v=null,et&&et(e)},C.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),it&&it(e,t)},C.__r=function(e){tt&&tt(e),ee=0;var t=(v=e.__c).__H;t&&(Ce===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(le),t.__h.forEach(Be),t.__h=[],ee=0)),Ce=v},C.diffed=function(e){nt&&nt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ut.push(t)!==1&&Ye===C.requestAnimationFrame||((Ye=C.requestAnimationFrame)||Cn)(Rn)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Ce=v=null},C.__c=function(e,t){t.some(function(n){try{n.__h.forEach(le),n.__h=n.__h.filter(function(r){return!r.__||Be(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],C.__e(r,n.__v)}}),rt&&rt(e,t)},C.unmount=function(e){ot&&ot(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{le(r)}catch(o){t=o}}),n.__H=void 0,t&&C.__e(t,n.__v))};var st=typeof requestAnimationFrame=="function";function Cn(e){var t,n=function(){clearTimeout(r),st&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);st&&(t=requestAnimationFrame(n))}function le(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function Be(e){var t=v;e.__c=e.__(),v=t}function It(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function zt(e,t){return typeof t=="function"?t(e):t}function kn({onClick:e,color:t,children:n}){return m("button",{style:{background:t||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:n})}const An=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=JSON.parse(sessionStorage.getItem("all_dicts")||"{}"),s=i.currency,a=i.channel.filter(l=>l.payment_support),c=o?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}},u=o?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},f=o?{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return m(V,{children:[m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),m("select",{style:{...c.select},value:e.currency,onInput:l=>{const b=l.target.value;t(h=>({...h,currency:b}))},children:[m("option",{value:"",disabled:!0,hidden:!0,children:"请选择充值币种"}),s.map(l=>m("option",{value:l.value,children:l.label}))]})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),m("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:l=>{const b=l.target.value;t(h=>({...h,amount:b,amountError:b.trim()?"":h.amountError}))},style:{...c.input,...e.amountError?c.inputError:{}}}),e.amountError&&m("div",{style:c.error,children:e.amountError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),m("select",{style:{...c.select,...e.rechargeChannelError?c.selectError:{}},value:e.rechargeChannel,onInput:l=>{const b=l.target.value;t(h=>({...h,rechargeChannel:b,rechargeChannelError:b?"":h.rechargeChannelError}))},children:[m("option",{value:"",disabled:!0,hidden:!0,children:"请选择支付平台"}),a.map(l=>m("option",{value:l.value,children:l.label}))]}),e.rechargeChannelError&&m("div",{style:c.error,children:e.rechargeChannelError})]}),e.error&&m("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:u,children:"取消"}),m("button",{type:"submit",disabled:r,style:f,children:r?"提交中...":"去支付"})]})]})};function jt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Tn}=Object.prototype,{getPrototypeOf:We}=Object,{iterator:ge,toStringTag:Ht}=Symbol,ye=(e=>t=>{const n=Tn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),N=e=>(e=e.toLowerCase(),t=>ye(t)===e),we=e=>t=>typeof t===e,{isArray:K}=Array,te=we("undefined");function On(e){return e!==null&&!te(e)&&e.constructor!==null&&!te(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mt=N("ArrayBuffer");function Fn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mt(e.buffer),t}const Bn=we("string"),F=we("function"),$t=we("number"),xe=e=>e!==null&&typeof e=="object",Nn=e=>e===!0||e===!1,ce=e=>{if(ye(e)!=="object")return!1;const t=We(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ht in e)&&!(ge in e)},Pn=N("Date"),Un=N("File"),Dn=N("Blob"),Ln=N("FileList"),In=e=>xe(e)&&F(e.pipe),zn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||F(e.append)&&((t=ye(e))==="formdata"||t==="object"&&F(e.toString)&&e.toString()==="[object FormData]"))},jn=N("URLSearchParams"),[Hn,Mn,$n,qn]=["ReadableStream","Request","Response","Headers"].map(N),Wn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),K(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function qt(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const M=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wt=e=>!te(e)&&e!==M;function Ne(){const{caseless:e}=Wt(this)&&this||{},t={},n=(r,o)=>{const i=e&&qt(t,o)||o;ce(t[i])&&ce(r)?t[i]=Ne(t[i],r):ce(r)?t[i]=Ne({},r):K(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&re(arguments[r],n);return t}const Jn=(e,t,n,{allOwnKeys:r}={})=>(re(t,(o,i)=>{n&&F(o)?e[i]=jt(o,n):e[i]=o},{allOwnKeys:r}),e),Vn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Xn=(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&We(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Gn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Qn=e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!$t(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Zn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&We(Uint8Array)),Yn=(e,t)=>{const r=(e&&e[ge]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},er=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},tr=N("HTMLFormElement"),nr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),at=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),rr=N("RegExp"),Jt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};re(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},or=e=>{Jt(e,(t,n)=>{if(F(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(F(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ir=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return K(e)?r(e):r(String(e).split(t)),n},sr=()=>{},ar=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function lr(e){return!!(e&&F(e.append)&&e[Ht]==="FormData"&&e[ge])}const cr=e=>{const t=new Array(10),n=(r,o)=>{if(xe(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=K(r)?[]:{};return re(r,(s,a)=>{const c=n(s,o+1);!te(c)&&(i[a]=c)}),t[o]=void 0,i}}return r};return n(e,0)},ur=N("AsyncFunction"),fr=e=>e&&(xe(e)||F(e))&&F(e.then)&&F(e.catch),Vt=((e,t)=>e?setImmediate:t?((n,r)=>(M.addEventListener("message",({source:o,data:i})=>{o===M&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),M.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",F(M.postMessage)),dr=typeof queueMicrotask<"u"?queueMicrotask.bind(M):typeof process<"u"&&process.nextTick||Vt,pr=e=>e!=null&&F(e[ge]),d={isArray:K,isArrayBuffer:Mt,isBuffer:On,isFormData:zn,isArrayBufferView:Fn,isString:Bn,isNumber:$t,isBoolean:Nn,isObject:xe,isPlainObject:ce,isReadableStream:Hn,isRequest:Mn,isResponse:$n,isHeaders:qn,isUndefined:te,isDate:Pn,isFile:Un,isBlob:Dn,isRegExp:rr,isFunction:F,isStream:In,isURLSearchParams:jn,isTypedArray:Zn,isFileList:Ln,forEach:re,merge:Ne,extend:Jn,trim:Wn,stripBOM:Vn,inherits:Kn,toFlatObject:Xn,kindOf:ye,kindOfTest:N,endsWith:Gn,toArray:Qn,forEachEntry:Yn,matchAll:er,isHTMLForm:tr,hasOwnProperty:at,hasOwnProp:at,reduceDescriptors:Jt,freezeMethods:or,toObjectSet:ir,toCamelCase:nr,noop:sr,toFiniteNumber:ar,findKey:qt,global:M,isContextDefined:Wt,isSpecCompliantForm:lr,toJSONObject:cr,isAsyncFn:ur,isThenable:fr,setImmediate:Vt,asap:dr,isIterable:pr};function x(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}d.inherits(x,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:d.toJSONObject(this.config),code:this.code,status:this.status}}});const Kt=x.prototype,Xt={};["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=>{Xt[e]={value:e}});Object.defineProperties(x,Xt);Object.defineProperty(Kt,"isAxiosError",{value:!0});x.from=(e,t,n,r,o,i)=>{const s=Object.create(Kt);return d.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),x.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const hr=null;function Pe(e){return d.isPlainObject(e)||d.isArray(e)}function Gt(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function lt(e,t,n){return e?e.concat(t).map(function(o,i){return o=Gt(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function _r(e){return d.isArray(e)&&!e.some(Pe)}const mr=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function Ee(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,_){return!d.isUndefined(_[g])});const r=n.metaTokens,o=n.visitor||f,i=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(d.isDate(p))return p.toISOString();if(d.isBoolean(p))return p.toString();if(!c&&d.isBlob(p))throw new x("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(p)||d.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,_){let y=p;if(p&&!_&&typeof p=="object"){if(d.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(d.isArray(p)&&_r(p)||(d.isFileList(p)||d.endsWith(g,"[]"))&&(y=d.toArray(p)))return g=Gt(g),y.forEach(function(S,A){!(d.isUndefined(S)||S===null)&&t.append(s===!0?lt([g],A,i):s===null?g:g+"[]",u(S))}),!1}return Pe(p)?!0:(t.append(lt(_,g,i),u(p)),!1)}const l=[],b=Object.assign(mr,{defaultVisitor:f,convertValue:u,isVisitable:Pe});function h(p,g){if(!d.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));l.push(p),d.forEach(p,function(y,w){(!(d.isUndefined(y)||y===null)&&o.call(t,y,d.isString(w)?w.trim():w,g,b))===!0&&h(y,g?g.concat(w):[w])}),l.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}function ct(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Je(e,t){this._pairs=[],e&&Ee(e,this,t)}const Qt=Je.prototype;Qt.append=function(t,n){this._pairs.push([t,n])};Qt.toString=function(t){const n=t?function(r){return t.call(this,r,ct)}:ct;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function br(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Zt(e,t,n){if(!t)return e;const r=n&&n.encode||br;d.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=d.isURLSearchParams(t)?t.toString():new Je(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class ut{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gr=typeof URLSearchParams<"u"?URLSearchParams:Je,yr=typeof FormData<"u"?FormData:null,wr=typeof Blob<"u"?Blob:null,xr={isBrowser:!0,classes:{URLSearchParams:gr,FormData:yr,Blob:wr},protocols:["http","https","file","blob","url","data"]},Ve=typeof window<"u"&&typeof document<"u",Ue=typeof navigator=="object"&&navigator||void 0,Er=Ve&&(!Ue||["ReactNative","NativeScript","NS"].indexOf(Ue.product)<0),Sr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vr=Ve&&window.location.href||"http://localhost",Rr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ve,hasStandardBrowserEnv:Er,hasStandardBrowserWebWorkerEnv:Sr,navigator:Ue,origin:vr},Symbol.toStringTag,{value:"Module"})),T={...Rr,...xr};function Cr(e,t){return Ee(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return T.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function kr(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ar(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function en(e){function t(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=i>=n.length;return s=!s&&d.isArray(o)?o.length:s,c?(d.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!d.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&d.isArray(o[s])&&(o[s]=Ar(o[s])),!a)}if(d.isFormData(e)&&d.isFunction(e.entries)){const n={};return d.forEachEntry(e,(r,o)=>{t(kr(r),o,n,0)}),n}return null}function Tr(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const oe={transitional:Yt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=d.isObject(t);if(i&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return o?JSON.stringify(en(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Cr(t,this.formSerializer).toString();if((a=d.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ee(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),Tr(t)):t}],transformResponse:[function(t){const n=this.transitional||oe.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?x.from(a,x.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{oe.headers[e]={}});const Or=d.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"]),Fr=e=>{const t={};let n,r,o;return e&&e.split(`
2
+ `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&Or[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ft=Symbol("internals");function Q(e){return e&&String(e).trim().toLowerCase()}function ue(e){return e===!1||e==null?e:d.isArray(e)?e.map(ue):String(e)}function Br(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Nr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ke(e,t,n,r,o){if(d.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!d.isString(t)){if(d.isString(r))return t.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(t)}}function Pr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ur(e,t){const n=d.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}let B=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,c,u){const f=Q(c);if(!f)throw new Error("header name must be a non-empty string");const l=d.findKey(o,f);(!l||o[l]===void 0||u===!0||u===void 0&&o[l]!==!1)&&(o[l||c]=ue(a))}const s=(a,c)=>d.forEach(a,(u,f)=>i(u,f,c));if(d.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(d.isString(t)&&(t=t.trim())&&!Nr(t))s(Fr(t),n);else if(d.isObject(t)&&d.isIterable(t)){let a={},c,u;for(const f of t){if(!d.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[u=f[0]]=(c=a[u])?d.isArray(c)?[...c,f[1]]:[c,f[1]]:f[1]}s(a,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Q(t),t){const r=d.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Br(o);if(d.isFunction(n))return n.call(this,o,r);if(d.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Q(t),t){const r=d.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ke(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=Q(s),s){const a=d.findKey(r,s);a&&(!n||ke(r,r[a],a,n))&&(delete r[a],o=!0)}}return d.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||ke(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return d.forEach(this,(o,i)=>{const s=d.findKey(r,i);if(s){n[s]=ue(o),delete n[i];return}const a=t?Pr(i):String(i).trim();a!==i&&delete n[i],n[a]=ue(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return d.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).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,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[ft]=this[ft]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Q(s);r[a]||(Ur(o,s),r[a]=!0)}return d.isArray(t)?t.forEach(i):i(t),this}};B.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(B.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});d.freezeMethods(B);function Ae(e,t){const n=this||oe,r=t||n,o=B.from(r.headers);let i=r.data;return d.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function tn(e){return!!(e&&e.__CANCEL__)}function X(e,t,n){x.call(this,e??"canceled",x.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(X,x,{__CANCEL__:!0});function nn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new x("Request failed with status code "+n.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Dr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Lr(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),f=r[i];s||(s=u),n[o]=c,r[o]=u;let l=i,b=0;for(;l!==o;)b+=n[l++],l=l%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s<t)return;const h=f&&u-f;return h?Math.round(b*1e3/h):void 0}}function Ir(e,t){let n=0,r=1e3/t,o,i;const s=(u,f=Date.now())=>{n=f,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const f=Date.now(),l=f-n;l>=r?s(u,f):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-l)))},()=>o&&s(o)]}const he=(e,t,n=3)=>{let r=0;const o=Lr(50,250);return Ir(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-r,u=o(c),f=s<=a;r=s;const l={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&f?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(l)},n)},dt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},pt=e=>(...t)=>d.asap(()=>e(...t)),zr=T.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,T.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>!0,jr=T.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),d.isString(r)&&s.push("path="+r),d.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function rn(e,t,n){let r=!Hr(t);return e&&(r||n==!1)?Mr(e,t):t}const ht=e=>e instanceof B?{...e}:e;function q(e,t){t=t||{};const n={};function r(u,f,l,b){return d.isPlainObject(u)&&d.isPlainObject(f)?d.merge.call({caseless:b},u,f):d.isPlainObject(f)?d.merge({},f):d.isArray(f)?f.slice():f}function o(u,f,l,b){if(d.isUndefined(f)){if(!d.isUndefined(u))return r(void 0,u,l,b)}else return r(u,f,l,b)}function i(u,f){if(!d.isUndefined(f))return r(void 0,f)}function s(u,f){if(d.isUndefined(f)){if(!d.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function a(u,f,l){if(l in t)return r(u,f);if(l in e)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,f,l)=>o(ht(u),ht(f),l,!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(f){const l=c[f]||o,b=l(e[f],t[f],f);d.isUndefined(b)&&l!==a||(n[f]=b)}),n}const on=e=>{const t=q({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;t.headers=s=B.from(s),t.url=Zt(rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(d.isFormData(n)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...f]=c?c.split(";").map(l=>l.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...f].join("; "))}}if(T.hasStandardBrowserEnv&&(r&&d.isFunction(r)&&(r=r(t)),r||r!==!1&&zr(t.url))){const u=o&&i&&jr.read(i);u&&s.set(o,u)}return t},$r=typeof XMLHttpRequest<"u",qr=$r&&function(e){return new Promise(function(n,r){const o=on(e);let i=o.data;const s=B.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,f,l,b,h,p;function g(){h&&h(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function y(){if(!_)return;const S=B.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:S,config:e,request:_};nn(function(P){n(P),g()},function(P){r(P),g()},k),_=null}"onloadend"in _?_.onloadend=y:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(y)},_.onabort=function(){_&&(r(new x("Request aborted",x.ECONNABORTED,e,_)),_=null)},_.onerror=function(){r(new x("Network Error",x.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let A=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Yt;o.timeoutErrorMessage&&(A=o.timeoutErrorMessage),r(new x(A,k.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,e,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&d.forEach(s.toJSON(),function(A,k){_.setRequestHeader(k,A)}),d.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),u&&([b,p]=he(u,!0),_.addEventListener("progress",b)),c&&_.upload&&([l,h]=he(c),_.upload.addEventListener("progress",l),_.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(f=S=>{_&&(r(!S||S.type?new X(null,e,_):S),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const w=Dr(o.url);if(w&&T.protocols.indexOf(w)===-1){r(new x("Unsupported protocol "+w+":",x.ERR_BAD_REQUEST,e));return}_.send(i||null)})},Wr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,a();const f=u instanceof Error?u:this.reason;r.abort(f instanceof x?f:new X(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new x(`timeout ${t} of ms exceeded`,x.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>d.asap(a),c}},Jr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Vr=async function*(e,t){for await(const n of Kr(e))yield*Jr(n,t)},Kr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},_t=(e,t,n,r)=>{const o=Vr(e,t);let i=0,s,a=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await o.next();if(u){a(),c.close();return}let l=f.byteLength;if(n){let b=i+=l;n(b)}c.enqueue(new Uint8Array(f))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},Se=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sn=Se&&typeof ReadableStream=="function",Xr=Se&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),an=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Gr=sn&&an(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),mt=64*1024,De=sn&&an(()=>d.isReadableStream(new Response("").body)),_e={stream:De&&(e=>e.body)};Se&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_e[t]&&(_e[t]=d.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new x(`Response type '${t}' is not supported`,x.ERR_NOT_SUPPORT,r)})})})(new Response);const Qr=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await Xr(e)).byteLength},Zr=async(e,t)=>{const n=d.toFiniteNumber(e.getContentLength());return n??Qr(t)},Yr=Se&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:f,withCredentials:l="same-origin",fetchOptions:b}=on(e);u=u?(u+"").toLowerCase():"text";let h=Wr([o,i&&i.toAbortSignal()],s),p;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let _;try{if(c&&Gr&&n!=="get"&&n!=="head"&&(_=await Zr(f,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(d.isFormData(r)&&(O=k.headers.get("content-type"))&&f.setContentType(O),k.body){const[P,z]=dt(_,he(pt(c)));r=_t(k.body,mt,P,z)}}d.isString(l)||(l=l?"include":"omit");const y="credentials"in Request.prototype;p=new Request(t,{...b,signal:h,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:y?l:void 0});let w=await fetch(p,b);const S=De&&(u==="stream"||u==="response");if(De&&(a||S&&g)){const k={};["status","statusText","headers"].forEach(j=>{k[j]=w[j]});const O=d.toFiniteNumber(w.headers.get("content-length")),[P,z]=a&&dt(O,he(pt(a),!0))||[];w=new Response(_t(w.body,mt,P,()=>{z&&z(),g&&g()}),k)}u=u||"text";let A=await _e[d.findKey(_e,u)||"text"](w,e);return!S&&g&&g(),await new Promise((k,O)=>{nn(k,O,{data:A,headers:B.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:p})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new x("Network Error",x.ERR_NETWORK,e,p),{cause:y.cause||y}):x.from(y,y&&y.code,e,p)}}),Le={http:hr,xhr:qr,fetch:Yr};d.forEach(Le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const bt=e=>`- ${e}`,eo=e=>d.isFunction(e)||e===null||e===!1,ln={getAdapter:e=>{e=d.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!eo(n)&&(r=Le[(s=String(n)).toLowerCase()],r===void 0))throw new x(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
4
+ `+i.map(bt).join(`
5
+ `):" "+bt(i[0]):"as no adapter specified";throw new x("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Le};function Te(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new X(null,e)}function gt(e){return Te(e),e.headers=B.from(e.headers),e.data=Ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ln.getAdapter(e.adapter||oe.adapter)(e).then(function(r){return Te(e),r.data=Ae.call(e,e.transformResponse,r),r.headers=B.from(r.headers),r},function(r){return tn(r)||(Te(e),r&&r.response&&(r.response.data=Ae.call(e,e.transformResponse,r.response),r.response.headers=B.from(r.response.headers))),Promise.reject(r)})}const cn="1.10.0",ve={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ve[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yt={};ve.transitional=function(t,n,r){function o(i,s){return"[Axios v"+cn+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(t===!1)throw new x(o(s," has been removed"+(n?" in "+n:"")),x.ERR_DEPRECATED);return n&&!yt[s]&&(yt[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,a):!0}};ve.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function to(e,t,n){if(typeof e!="object")throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const a=e[i],c=a===void 0||s(a,i,e);if(c!==!0)throw new x("option "+i+" must be "+c,x.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new x("Unknown option "+i,x.ERR_BAD_OPTION)}}const fe={assertOptions:to,validators:ve},D=fe.validators;let $=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ut,response:new ut}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=q(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&fe.assertOptions(r,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1),o!=null&&(d.isFunction(o)?n.paramsSerializer={serialize:o}:fe.assertOptions(o,{encode:D.function,serialize:D.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),fe.assertOptions(n,{baseUrl:D.spelling("baseURL"),withXsrfToken:D.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&d.merge(i.common,i[n.method]);i&&d.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=B.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let f,l=0,b;if(!c){const p=[gt.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,u),b=p.length,f=Promise.resolve(n);l<b;)f=f.then(p[l++],p[l++]);return f}b=a.length;let h=n;for(l=0;l<b;){const p=a[l++],g=a[l++];try{h=p(h)}catch(_){g.call(this,_);break}}try{f=gt.call(this,h)}catch(p){return Promise.reject(p)}for(l=0,b=u.length;l<b;)f=f.then(u[l++],u[l++]);return f}getUri(t){t=q(this.defaults,t);const n=rn(t.baseURL,t.url,t.allowAbsoluteUrls);return Zt(n,t.params,t.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(t){$.prototype[t]=function(n,r){return this.request(q(r||{},{method:t,url:n,data:(r||{}).data}))}});d.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,a){return this.request(q(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$.prototype[t]=n(),$.prototype[t+"Form"]=n(!0)});let no=class un{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new X(i,s,a),n(r.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;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new un(function(o){t=o}),cancel:t}}};function ro(e){return function(n){return e.apply(null,n)}}function oo(e){return d.isObject(e)&&e.isAxiosError===!0}const Ie={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ie).forEach(([e,t])=>{Ie[t]=e});function fn(e){const t=new $(e),n=jt($.prototype.request,t);return d.extend(n,$.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return fn(q(e,o))},n}const R=fn(oe);R.Axios=$;R.CanceledError=X;R.CancelToken=no;R.isCancel=tn;R.VERSION=cn;R.toFormData=Ee;R.AxiosError=x;R.Cancel=R.CanceledError;R.all=function(t){return Promise.all(t)};R.spread=ro;R.isAxiosError=oo;R.mergeConfig=q;R.AxiosHeaders=B;R.formToJSON=e=>en(d.isHTMLForm(e)?new FormData(e):e);R.getAdapter=ln.getAdapter;R.HttpStatusCode=Ie;R.default=R;const{Axios:Ao,AxiosError:To,CanceledError:Oo,isCancel:Fo,CancelToken:Bo,VERSION:No,all:Po,Cancel:Uo,isAxiosError:Do,spread:Lo,toFormData:Io,AxiosHeaders:zo,HttpStatusCode:jo,formToJSON:Ho,getAdapter:Mo,mergeConfig:$o}=R;class io{parseArg(t){return typeof t=="string"?{content:t}:t}show(t,n){const{content:r,duration:o,closable:i}=this.parseArg(n),s=document.createElement("div");if(s.style.cssText=`
7
+ position: fixed;
8
+ top: 20px;
9
+ left: 50%;
10
+ transform: translateX(-50%);
11
+ z-index: 9999;
12
+ background: #fff;
13
+ border: 1px solid #fff;
14
+ border-radius: 12px;
15
+ padding: 8px 16px;
16
+ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
17
+ min-width: ${r.length<20?"auto":"300px"};
18
+ max-width: 500px;
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 8px;
22
+ font-size: 14px;
23
+ color: #222;
24
+ `,t==="error"){const c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width","16"),c.setAttribute("height","16"),c.setAttribute("viewBox","0 0 16 16"),c.innerHTML=`
25
+ <circle cx="8" cy="8" r="8" fill="#ff4d4f"/>
26
+ <path d="M10.5 5.5l-5 5m0-5l5 5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
27
+ `,s.appendChild(c)}if(t==="success"){const c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width","16"),c.setAttribute("height","16"),c.setAttribute("viewBox","0 0 16 16"),c.innerHTML=`
28
+ <circle cx="8" cy="8" r="8" fill="#52c41a"/>
29
+ <path d="M5 8.5l2.2 2.2 3.8-3.4" stroke="white" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
30
+ `,s.appendChild(c)}if(t==="warning"){const c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width","16"),c.setAttribute("height","16"),c.setAttribute("viewBox","0 0 16 16"),c.innerHTML=`
31
+ <circle cx="8" cy="8" r="8" fill="#faad14"/>
32
+ <path d="M8 4.5v5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
33
+ <circle cx="8" cy="12.5" r="1" fill="white"/>
34
+ `,s.appendChild(c)}if(t==="info"){const c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width","16"),c.setAttribute("height","16"),c.setAttribute("viewBox","0 0 16 16"),c.innerHTML=`
35
+ <circle cx="8" cy="8" r="8" fill="#1677ff"/>
36
+ <rect x="7.25" y="7" width="1.5" height="6" rx="0.75" fill="white"/>
37
+ <rect x="7.25" y="5" width="1.5" height="1.5" rx="0.75" fill="white"/>
38
+ `,s.appendChild(c)}const a=document.createElement("div");if(a.textContent=r,a.style.flex="1",s.appendChild(a),i){const c=document.createElement("button");c.textContent="✕",c.style.cssText=`
39
+ background: none;
40
+ border: none;
41
+ cursor: pointer;
42
+ padding: 4px;
43
+ color: #999;
44
+ font-size: 12px;
45
+ `,c.onclick=()=>{document.body.removeChild(s)},s.appendChild(c)}document.body.appendChild(s),o!==0&&setTimeout(()=>{document.body.contains(s)&&document.body.removeChild(s)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const ze=new io;function so(e={}){const{baseURL:t="/api",timeout:n=1e4,getLocale:r,onError:o}=e,i=R.create({baseURL:t,timeout:n});return i.interceptors.request.use(s=>{const a=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),{token:c}=a;if(s.headers={...s.headers,Authorization:c},r){const u=r();u&&(s.headers={...s.headers,"Accept-Language":u})}return s}),i.interceptors.response.use(s=>{if(s.data&&s.data.code===0)return s.data;const a=s.data?.msg||s.data?.message||"未知错误";return ze.error(a),o&&o(a,s),Promise.reject(s.data||{message:"未知错误"})},s=>{const a=s.response?.data?.msg||s.response?.data?.message||s.message||"网络请求失败";return ze.error(a),o&&o(a,s),Promise.reject(s)}),i}const ie=so();function ao(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return ie.get("/balance",{params:{merchant_id:e.merchant_id,biz_type:e.biz_type}}).then(t=>{const n=t.data;return{totalAmount:n.total_amount||0,availableAmount:n.available_amount||0,frozenAmount:n.frozen_amount||0}})}const lo=async()=>ie.get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),co=async(e,t)=>ie.post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),uo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return ie.post("/offline/recharge/create",n,{})},fo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log(t,"fundUnitParams");const n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return ie.post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},po=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:i=!1})=>{const s=Lt(null),[a,c]=I(!1),[u,f]=I(0),l=async h=>{const p=Array.from(h.target.files).slice(0,n);if(!p.length)return;c(!0);const g=[];for(let _=0;_<p.length;_++){f(0);const y=new FormData;y.append("file",p[_]);try{const w=await co(y,S=>f(S));w&&g.push(w)}catch{}}c(!1),f(0),t?.([...e,...g]),s.current&&(s.current.value="")},b=h=>{const p=e.filter((g,_)=>_!==h);t?.(p)};return m("div",{children:[m("div",{style:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:i?"not-allowed":"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15,opacity:i?.6:1},onClick:()=>!i&&s.current?.click(),children:[m("div",{style:{fontSize:48,marginBottom:12},children:"📁"}),m("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),m("div",{style:{color:"#999",fontSize:13},children:["支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 ",n," ","个文件"]}),m("input",{ref:s,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:l,disabled:i}),a&&m("div",{style:{marginTop:12,color:"#1677ff"},children:["正在上传... ",u,"%"]})]}),e&&e.length>0&&m("div",{style:{marginTop:12},children:e.map((h,p)=>m("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[m("div",{style:{display:"flex",alignItems:"center",flex:1},children:[m("span",{style:{fontWeight:500,wordBreak:"break-all"},children:h.split("/").pop()}),m("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:"[已上传]"})]}),m("button",{type:"button",onClick:g=>{g.stopPropagation(),b(p)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},disabled:i,children:"移除"})]},h))})]})},ho=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(i,"allDicts");const s=i.channel,a=o?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}};return m("form",{onSubmit:async u=>{u.preventDefault();let f=!0;t(l=>({...l,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(l=>({...l,platformError:"请选择支付平台"})),f=!1),e.transactionId.trim()||(t(l=>({...l,transactionIdError:"请输入转账交易ID"})),f=!1),(!e.files||e.files.length===0)&&(t(l=>({...l,filesError:"请上传转账凭证"})),f=!1),f&&(await uo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),ze.success("离线充值创建成功"))},children:[m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),m("select",{style:{...a.select,...e.platformError?a.selectError:{}},value:e.platform,onInput:u=>{const f=u.target.value;t(l=>({...l,platform:f,platformError:f?"":l.platformError}))},children:[m("option",{value:"",disabled:!0,hidden:!0,children:"请选择支付平台"}),s.map(u=>m("option",{value:u.value,children:u.label}))]}),e.platformError&&m("div",{style:a.error,children:e.platformError})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),m("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:u=>{const f=u.target.value;t(l=>({...l,transactionId:f,transactionIdError:f?"":l.transactionIdError}))},style:{...a.input,...e.transactionIdError?a.inputError:{}}}),e.transactionIdError&&m("div",{style:a.error,children:e.transactionIdError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),m(po,{value:e.files,onChange:u=>t(f=>({...f,files:u,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&m("div",{style:a.error,children:e.filesError})]}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:a.buttonCancel,children:"取消"}),m("button",{type:"submit",disabled:r,style:a.buttonSubmit,children:"去支付"})]})]})};function _o({visible:e,onClose:t,onSubmit:n,color:r,whiteTheme:o=!0}){const[i,s]=I({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,c]=I("online"),[u,f]=I({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(Dt(()=>{e||(c("online"),s({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),f({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const l=async p=>{p.preventDefault();let g=!0;if(s(_=>({..._,amountError:"",rechargeChannelError:""})),i.amount.trim()||(s(_=>({..._,amountError:"请输入充值金额"})),g=!1),i.rechargeChannel||(s(_=>({..._,rechargeChannelError:"请选择支付平台"})),g=!1),!!g){s(_=>({..._,loading:!0,error:""}));try{await n({amount:i.amount,rechargeChannel:i.rechargeChannel,currency:i.currency}),t()}catch{s(_=>({..._,error:"提交失败,请重试"}))}finally{s(_=>({..._,loading:!1}))}}},b=p=>{p.target===p.currentTarget&&t()},h=o?{modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.08)",mask:"rgba(0,0,0,0.3)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#fff":"#F7F8FA",color:p?"#155EEF":"#222",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #F0F1F3":void 0,borderLeft:g?void 0:"1px solid #F0F1F3",transition:"all 0.2s"})}:{modalBg:"#181A20",modalColor:"#fff",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.5)",mask:"rgba(0,0,0,0.7)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#fff"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#23262F":"#181A20",color:p?"#00E8C6":"#fff",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #23262F":void 0,borderLeft:g?void 0:"1px solid #23262F",transition:"all 0.2s"})};return m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:h.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:b,children:m("form",{onSubmit:l,style:{background:h.modalBg,padding:32,borderRadius:12,minWidth:400,maxWidth:400,color:r||h.modalColor,boxShadow:h.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[m("button",{type:"button",onClick:t,style:h.closeBtn,"aria-label":"关闭",children:"×"}),m("div",{style:h.title,children:"充值 / 转账"}),m("div",{style:{display:"flex",marginBottom:28},children:[m("button",{type:"button",onClick:()=>c("online"),style:h.tabBtn(a==="online",!0),children:"在线充值"}),m("button",{type:"button",onClick:()=>c("offline"),style:h.tabBtn(a==="offline",!1),children:"线下转账"})]}),a==="online"?m(An,{formState:i,setFormState:s,onClose:t,loading:i.loading,whiteTheme:o}):m(ho,{formState:u,setFormState:f,onClose:t,loading:u.loading,whiteTheme:o})]})})}function Ke(){return(Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var mo=["context","children"];function bo(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var i,s,a={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(i=c[s])>=0||(a[i]=r[i]);return a}(e,mo);return Pt(t,n)}function go(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=W(bo,Ke({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],i={},s=0,a=n.attributes,c=n.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(i[a[s].name]=a[s].value,i[dn(a[s].name)]=a[s].value);for(s=c.length;s--;){var u=t(c[s],null),f=c[s].slot;f?i[f]=W(wt,{name:f},u):o[s]=u}var l=r?W(wt,null,o):o;return W(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Nt:be)(this._vdom,this._root)}function dn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function yo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[dn(e)]=n,this._vdom=Pt(this._vdom,r),be(this._vdom,this._root)}}function wo(){be(this._vdom=null,this._root)}function wt(e,t){var n=this;return W("slot",Ke({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function pn(e,t,n,r){function o(){var i=Reflect.construct(HTMLElement,[],o);return i._vdomComponent=e,i._root=r&&r.shadow?i.attachShadow({mode:r.mode||"open"}):i,i}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=go,o.prototype.attributeChangedCallback=yo,o.prototype.disconnectedCallback=wo,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(i){Object.defineProperty(o.prototype,i,{get:function(){return this._vdom.props[i]},set:function(s){this._vdom?this.attributeChangedCallback(i,null,s):(this._props||(this._props={}),this._props[i]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(i,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}lo();function xo(e){const[t,n]=I(!1),[r,o]=I(!0),i=e.theme?.primaryColor;return m("div",{children:[m(kn,{color:i,onClick:()=>n(!0),children:"打开表单"}),m("button",{style:{marginLeft:16,padding:"8px 16px",borderRadius:6,border:"1px solid #eee",cursor:"pointer"},onClick:()=>o(a=>!a),children:r?"切换为暗黑主题":"切换为白色主题"}),m(_o,{visible:t,onClose:()=>n(!1),onSubmit:async a=>{const c=await fo({amount:a.amount,currency:a.currency,rechargeChannel:a.rechargeChannel});window.open(c,"_blank")},color:i,whiteTheme:r})]})}pn(xo,"x-best-modal-form",["theme"],{shadow:!1});const Eo=({popover:e,children:t,popoverWidth:n=300,popoverMinWidth:r=200,offsetY:o=16,offsetX:i=16,popoverPosition:s="top"})=>{const[a,c]=I(!1),[u,f]=I(s),l=Lt(null),b=()=>{if(s==="top"||s==="bottom")if(l.current){const g=l.current.getBoundingClientRect();s==="top"&&g.top<100?f("bottom"):s==="bottom"&&window.innerHeight-g.bottom<100?f("top"):f(s)}else f(s);else f(s);c(!0)};let h={position:"absolute",zIndex:10,background:"#fff",color:"#222",borderRadius:6,fontSize:15,minWidth:r,width:n,padding:"8px 14px",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",pointerEvents:"auto",textAlign:"center",border:"none",animation:"fadeInUp 0.3s"},p={position:"absolute",zIndex:11,width:0,height:0};return u==="top"?(h={...h,left:"50%",top:-48,transform:"translateX(-50%)"},p={...p,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:"8px solid #fff"}):u==="bottom"?(h={...h,left:"50%",top:"100%",marginTop:o,transform:"translateX(-50%)"},p={...p,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:"8px solid #fff"}):u==="leftTop"?(h={...h,right:"100%",top:0,marginRight:i,transform:"none"},p={...p,right:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:"8px solid #fff"}):u==="rightTop"&&(h={...h,left:"100%",top:0,marginLeft:i,transform:"translateY(0)"},p={...p,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:"8px solid #fff"}),m("div",{ref:l,style:{position:"relative",display:"inline-block"},onMouseEnter:b,onMouseLeave:()=>c(!1),children:[t,a&&m("div",{style:h,children:[e,m("div",{style:p})]})]})},So={available:0,currency:"USD",symbol:"$",details:[{label:"真实金额",value:0,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:0,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:0,color:"#155EEF",dot:"#15b36b"}]};function xt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function vo(){const[e,t]=I(So);return Dt(()=>{(async()=>{try{const r=await ao(),o={available:r.availableAmount,currency:"USD",symbol:"$",details:[{label:"真实金额",value:r.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:r.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:r.availableAmount,color:"#155EEF",dot:"#15b36b"}]};t(o)}catch(r){console.error("获取余额失败:",r)}})()},[]),m(Eo,{popover:m(V,{children:[m("div",{style:{fontSize:16,fontWeight:600,color:"#222",marginBottom:16,textAlign:"center"},children:"余额详情"}),e.details.map(n=>m("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:15},children:[m("span",{style:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},children:[m("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:n.dot,marginRight:8}}),n.label]}),m("span",{style:{color:n.color,fontWeight:600,fontSize:15},children:[e.symbol,xt(n.value)]})]},n.label))]}),popoverPosition:"rightTop",children:m("div",{style:{fontSize:24,fontWeight:800,color:"#111827",display:"inline-block"},children:[e.symbol,xt(e.available),m("span",{style:{fontSize:18,color:"#6b7280",marginLeft:8,fontWeight:600},children:e.currency})]})})}pn(vo,"best-statistical-balance");const Ro=["x-greeting","x-best-modal-form","best-statistical-balance"];exports.components=Ro;exports.initFundUnit=mn;exports.npmTest=hn;exports.printCurrentTime=_n;