best-unit 0.0.14 → 0.0.16

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,4 +1,4 @@
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(`
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
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
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
4
  `+i.map(bt).join(`
@@ -42,4 +42,4 @@
42
42
  padding: 4px;
43
43
  color: #999;
44
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;
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;
package/dist/best-unit.js CHANGED
@@ -424,9 +424,7 @@ function vn({ onClick: e, color: t, children: n }) {
424
424
  );
425
425
  }
426
426
  const Rn = ({ formState: e, setFormState: t, onClose: n, loading: r, whiteTheme: o = !1 }) => {
427
- const i = JSON.parse(sessionStorage.getItem("all_dicts") || "{}"), s = i.currency, a = i.channel.filter(
428
- (l) => l.payment_support
429
- ), c = o ? {
427
+ const i = JSON.parse(sessionStorage.getItem("all_dicts") || "{}"), s = i?.currency || [], a = i?.channel?.filter((l) => l.payment_support) || [], c = o ? {
430
428
  label: {
431
429
  marginBottom: 8,
432
430
  fontSize: 14,
@@ -2652,7 +2650,7 @@ const io = async () => ie.get("/all-dicts", {}).then((e) => (sessionStorage.setI
2652
2650
  }, uo = ({ formState: e, setFormState: t, onClose: n, loading: r, whiteTheme: o = !1 }) => {
2653
2651
  const i = JSON.parse(sessionStorage.getItem("all_dicts") || "{}");
2654
2652
  console.log(i, "allDicts");
2655
- const s = i.channel, a = o ? {
2653
+ const s = i?.channel || [], a = o ? {
2656
2654
  label: {
2657
2655
  marginBottom: 8,
2658
2656
  fontSize: 14,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -24,7 +24,7 @@ export const OfflineTransferForm: FunctionalComponent<
24
24
  > = ({ formState, setFormState, onClose, loading, whiteTheme = false }) => {
25
25
  const allDicts = JSON.parse(sessionStorage.getItem("all_dicts") || "{}");
26
26
  console.log(allDicts, "allDicts");
27
- const channelDict = allDicts.channel;
27
+ const channelDict = allDicts?.channel || [];
28
28
 
29
29
  // 样式对象
30
30
  const theme = whiteTheme
@@ -21,10 +21,9 @@ export const OnlineRechargeForm: FunctionalComponent<
21
21
  OnlineRechargeFormProps
22
22
  > = ({ formState, setFormState, onClose, loading, whiteTheme = false }) => {
23
23
  const allDicts = JSON.parse(sessionStorage.getItem("all_dicts") || "{}");
24
- const currencyDict = allDicts.currency;
25
- const channelDict = allDicts.channel.filter(
26
- (item: any) => item.payment_support
27
- );
24
+ const currencyDict = allDicts?.currency || [];
25
+ const channelDict =
26
+ allDicts?.channel?.filter((item: any) => item.payment_support) || [];
28
27
 
29
28
  const theme = whiteTheme
30
29
  ? {