best-unit 0.0.10 → 0.0.11

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function He(){console.log("npm package test!!!")}function Ae(){console.log("Current time:",new Date().toISOString())}var H,g,me,w,le,be,xe,Ee,Z,K,Q,D={},ke=[],Ne=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,G=Array.isArray;function C(e,n){for(var r in n)e[r]=n[r];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,n,r){var t,l,o,_={};for(o in n)o=="key"?t=n[o]:o=="ref"?l=n[o]:_[o]=n[o];if(arguments.length>2&&(_.children=arguments.length>3?H.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,t,l,null)}function I(e,n,r,t,l){var o={type:e,props:n,key:r,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++me,__i:-1,__u:0};return l==null&&g.vnode!=null&&g.vnode(o),o}function A(e){return e.children}function O(e,n){this.props=e,this.context=n}function B(e,n){if(n==null)return e.__?B(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?B(e):null}function Ce(e){var n,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ce(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&w.push(e)&&!W.__r++||le!=g.debounceRendering)&&((le=g.debounceRendering)||be)(W)}function W(){for(var e,n,r,t,l,o,_,a=1;w.length;)w.length>a&&w.sort(xe),e=w.shift(),a=w.length,e.__d&&(r=void 0,l=(t=(n=e).__v).__e,o=[],_=[],n.__P&&((r=C({},t)).__v=t.__v+1,g.vnode&&g.vnode(r),ne(n.__P,r,t,n.__n,n.__P.namespaceURI,32&t.__u?[l]:null,o,l??B(t),!!(32&t.__u),_),r.__v=t.__v,r.__.__k[r.__i]=r,Se(o,r,_),r.__e!=l&&Ce(r)));W.__r=0}function Fe(e,n,r,t,l,o,_,a,f,s,p){var i,d,c,h,E,x,y=t&&t.__k||ke,v=n.length;for(f=Ue(r,n,y,f,v),i=0;i<v;i++)(c=r.__k[i])!=null&&(d=c.__i==-1?D:y[c.__i]||D,c.__i=i,x=ne(e,c,d,l,o,_,a,f,s,p),h=c.__e,c.ref&&d.ref!=c.ref&&(d.ref&&re(d.ref,null,c),p.push(c.ref,c.__c||h,c)),E==null&&h!=null&&(E=h),4&c.__u||d.__k===c.__k?f=we(c,f,e):typeof c.type=="function"&&x!==void 0?f=x:h&&(f=h.nextSibling),c.__u&=-7);return r.__e=E,f}function Ue(e,n,r,t,l){var o,_,a,f,s,p=r.length,i=p,d=0;for(e.__k=new Array(l),o=0;o<l;o++)(_=n[o])!=null&&typeof _!="boolean"&&typeof _!="function"?(f=o+d,(_=e.__k[o]=typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?I(null,_,null,null,null):G(_)?I(A,{children:_},null,null,null):_.constructor==null&&_.__b>0?I(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=e,_.__b=e.__b+1,a=null,(s=_.__i=Me(_,r,f,i))!=-1&&(i--,(a=r[s])&&(a.__u|=2)),a==null||a.__v==null?(s==-1&&(l>p?d--:l<p&&d++),typeof _.type!="function"&&(_.__u|=4)):s!=f&&(s==f-1?d--:s==f+1?d++:(s>f?d--:d++,_.__u|=4))):e.__k[o]=null;if(i)for(o=0;o<p;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==t&&(t=B(a)),$e(a,a));return t}function we(e,n,r){var t,l;if(typeof e.type=="function"){for(t=e.__k,l=0;t&&l<t.length;l++)t[l]&&(t[l].__=e,n=we(t[l],n,r));return n}e.__e!=n&&(n&&e.type&&!r.contains(n)&&(n=B(e)),r.insertBefore(e.__e,n||null),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Me(e,n,r,t){var l,o,_=e.key,a=e.type,f=n[r];if(f===null&&e.key==null||f&&_==f.key&&a==f.type&&(2&f.__u)==0)return r;if(t>(f!=null&&(2&f.__u)==0?1:0))for(l=r-1,o=r+1;l>=0||o<n.length;){if(l>=0){if((f=n[l])&&(2&f.__u)==0&&_==f.key&&a==f.type)return l;l--}if(o<n.length){if((f=n[o])&&(2&f.__u)==0&&_==f.key&&a==f.type)return o;o++}}return-1}function ae(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Ne.test(n)?r:r+"px"}function M(e,n,r,t,l){var o,_;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(n in t)r&&n in r||ae(e.style,n,"");if(r)for(n in r)t&&r[n]==t[n]||ae(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Ee,"$1")),_=n.toLowerCase(),n=_ in e||n=="onFocusOut"||n=="onFocusIn"?_.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=r,r?t?r.u=t.u:(r.u=Z,e.addEventListener(n,o?Q:K,o)):e.removeEventListener(n,o?Q:K,o);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function ce(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Z++;else if(n.t<r.u)return;return r(g.event?g.event(n):n)}}}function ne(e,n,r,t,l,o,_,a,f,s){var p,i,d,c,h,E,x,y,v,$,F,N,z,ie,U,P,J,k=n.type;if(n.constructor!=null)return null;128&r.__u&&(f=!!(32&r.__u),o=[a=n.__e=r.__e]),(p=g.__b)&&p(n);e:if(typeof k=="function")try{if(y=n.props,v="prototype"in k&&k.prototype.render,$=(p=k.contextType)&&t[p.__c],F=p?$?$.props.value:p.__:t,r.__c?x=(i=n.__c=r.__c).__=i.__E:(v?n.__c=i=new k(y,F):(n.__c=i=new O(y,F),i.constructor=k,i.render=je),$&&$.sub(i),i.props=y,i.state||(i.state={}),i.context=F,i.__n=t,d=i.__d=!0,i.__h=[],i._sb=[]),v&&i.__s==null&&(i.__s=i.state),v&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(y,i.__s))),c=i.props,h=i.state,i.__v=n,d)v&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),v&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(v&&k.getDerivedStateFromProps==null&&y!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(y,F),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(y,i.__s,F)===!1||n.__v==r.__v){for(n.__v!=r.__v&&(i.props=y,i.state=i.__s,i.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(T){T&&(T.__=n)}),N=0;N<i._sb.length;N++)i.__h.push(i._sb[N]);i._sb=[],i.__h.length&&_.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(y,i.__s,F),v&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,h,E)})}if(i.context=F,i.props=y,i.__P=e,i.__e=!1,z=g.__r,ie=0,v){for(i.state=i.__s,i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[]}else do i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ie<25);i.state=i.__s,i.getChildContext!=null&&(t=C(C({},t),i.getChildContext())),v&&!d&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(c,h)),P=p,p!=null&&p.type===A&&p.key==null&&(P=Be(p.props.children)),a=Fe(e,G(P)?P:[P],n,r,t,l,o,_,a,f,s),i.base=n.__e,n.__u&=-161,i.__h.length&&_.push(i),x&&(i.__E=i.__=null)}catch(T){if(n.__v=null,f||o!=null)if(T.then){for(n.__u|=f?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,n.__e=a}else for(J=o.length;J--;)ee(o[J]);else n.__e=r.__e,n.__k=r.__k;g.__e(T,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):a=n.__e=Oe(r.__e,n,r,t,l,o,_,f,s);return(p=g.diffed)&&p(n),128&n.__u?void 0:a}function Se(e,n,r){for(var t=0;t<r.length;t++)re(r[t],r[++t],r[++t]);g.__c&&g.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(o){o.call(l)})}catch(o){g.__e(o,l.__v)}})}function Be(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:G(e)?e.map(Be):C({},e)}function Oe(e,n,r,t,l,o,_,a,f){var s,p,i,d,c,h,E,x=r.props,y=n.props,v=n.type;if(v=="svg"?l="http://www.w3.org/2000/svg":v=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!v&&(v?c.localName==v:c.nodeType==3)){e=c,o[s]=null;break}}if(e==null){if(v==null)return document.createTextNode(y);e=document.createElementNS(l,v,y.is&&y),a&&(g.__m&&g.__m(n,o),a=!1),o=null}if(v==null)x===y||a&&e.data==y||(e.data=y);else{if(o=o&&H.call(e.childNodes),x=r.props||D,!a&&o!=null)for(x={},s=0;s<e.attributes.length;s++)x[(c=e.attributes[s]).name]=c.value;for(s in x)if(c=x[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in y)){if(s=="value"&&"defaultValue"in y||s=="checked"&&"defaultChecked"in y)continue;M(e,s,null,c,l)}}for(s in y)c=y[s],s=="children"?d=c:s=="dangerouslySetInnerHTML"?p=c:s=="value"?h=c:s=="checked"?E=c:a&&typeof c!="function"||x[s]===c||M(e,s,c,x[s],l);if(p)a||i&&(p.__html==i.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(i&&(e.innerHTML=""),Fe(n.type=="template"?e.content:e,G(d)?d:[d],n,r,t,v=="foreignObject"?"http://www.w3.org/1999/xhtml":l,o,_,o?o[0]:r.__k&&B(r,0),a,f),o!=null)for(s=o.length;s--;)ee(o[s]);a||(s="value",v=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[s]||v=="progress"&&!h||v=="option"&&h!=x[s])&&M(e,s,h,x[s],l),s="checked",E!=null&&E!=e[s]&&M(e,s,E,x[s],l))}return e}function re(e,n,r){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&n==null||(e.__u=e(n))}else e.current=n}catch(l){g.__e(l,r)}}function $e(e,n,r){var t,l;if(g.unmount&&g.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||re(t,null,n)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){g.__e(o,n)}t.base=t.__P=null}if(t=e.__k)for(l=0;l<t.length;l++)t[l]&&$e(t[l],n,r||typeof e.type!="function");r||ee(e.__e),e.__c=e.__=e.__e=void 0}function je(e,n,r){return this.constructor(e,r)}function V(e,n,r){var t,l,o,_;n==document&&(n=document.documentElement),g.__&&g.__(e,n),l=(t=typeof r=="function")?null:r&&r.__k||n.__k,o=[],_=[],ne(n,e=(!t&&r||n).__k=S(A,null,[e]),l||D,D,n.namespaceURI,!t&&r?[r]:l?null:n.firstChild?H.call(n.childNodes):null,o,!t&&r?r:l?l.__e:n.firstChild,t,_),Se(o,e,_)}function ze(e,n){V(e,n,ze)}function Pe(e,n,r){var t,l,o,_,a=C({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),n)o=="key"?t=n[o]:o=="ref"?l=n[o]:a[o]=n[o]===void 0&&_!=null?_[o]:n[o];return arguments.length>2&&(a.children=arguments.length>3?H.call(arguments,2):r),I(e.type,a,t||e.key,l||e.ref,null)}H=ke.slice,g={__e:function(e,n,r,t){for(var l,o,_;n=n.__;)if((l=n.__c)&&!l.__)try{if((o=l.constructor)&&o.getDerivedStateFromError!=null&&(l.setState(o.getDerivedStateFromError(e)),_=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,t||{}),_=l.__d),_)return l.__E=l}catch(a){e=a}throw e}},me=0,O.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof e=="function"&&(e=e(C({},r),this.props)),e&&C(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),_e(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},O.prototype.render=A,w=[],be=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe=function(e,n){return e.__v.__b-n.__v.__b},W.__r=0,Ee=/(PointerCapture)$|Capture$/i,Z=0,K=ce(!1),Q=ce(!0);var Le=0;function u(e,n,r,t,l,o){n||(n={});var _,a,f=n;if("ref"in f)for(a in f={},n)a=="ref"?_=n[a]:f[a]=n[a];var s={type:e,props:f,key:r,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Le,__i:-1,__u:0,__source:l,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(a in _)f[a]===void 0&&(f[a]=_[a]);return g.vnode&&g.vnode(s),s}var R,m,Y,se,q=0,Te=[],b=g,ue=b.__b,fe=b.__r,de=b.diffed,pe=b.__c,he=b.unmount,ge=b.__;function te(e,n){b.__h&&b.__h(m,e,q||n),q=0;var r=m.__H||(m.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function j(e){return q=1,We(De,e)}function We(e,n,r){var t=te(R++,2);if(t.t=e,!t.__c&&(t.__=[De(void 0,n),function(a){var f=t.__N?t.__N[0]:t.__[0],s=t.t(f,a);f!==s&&(t.__N=[s,t.__[1]],t.__c.setState({}))}],t.__c=m,!m.__f)){var l=function(a,f,s){if(!t.__c.__H)return!0;var p=t.__c.__H.__.filter(function(d){return!!d.__c});if(p.every(function(d){return!d.__N}))return!o||o.call(this,a,f,s);var i=t.__c.props!==a;return p.forEach(function(d){if(d.__N){var c=d.__[0];d.__=d.__N,d.__N=void 0,c!==d.__[0]&&(i=!0)}}),o&&o.call(this,a,f,s)||i};m.__f=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(a,f,s){if(this.__e){var p=o;o=void 0,l(a,f,s),o=p}_&&_.call(this,a,f,s)},m.shouldComponentUpdate=l}return t.__N||t.__}function qe(e,n){var r=te(R++,3);!b.__s&&Ie(r.__H,n)&&(r.__=e,r.u=n,m.__H.__h.push(r))}function Ge(e){return q=5,Ve(function(){return{current:e}},[])}function Ve(e,n){var r=te(R++,7);return Ie(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function Je(){for(var e;e=Te.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(L),e.__H.__h.forEach(X),e.__H.__h=[]}catch(n){e.__H.__h=[],b.__e(n,e.__v)}}b.__b=function(e){m=null,ue&&ue(e)},b.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ge&&ge(e,n)},b.__r=function(e){fe&&fe(e),R=0;var n=(m=e.__c).__H;n&&(Y===m?(n.__h=[],m.__h=[],n.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.forEach(L),n.__h.forEach(X),n.__h=[],R=0)),Y=m},b.diffed=function(e){de&&de(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Te.push(n)!==1&&se===b.requestAnimationFrame||((se=b.requestAnimationFrame)||Ye)(Je)),n.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Y=m=null},b.__c=function(e,n){n.some(function(r){try{r.__h.forEach(L),r.__h=r.__h.filter(function(t){return!t.__||X(t)})}catch(t){n.some(function(l){l.__h&&(l.__h=[])}),n=[],b.__e(t,r.__v)}}),pe&&pe(e,n)},b.unmount=function(e){he&&he(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(t){try{L(t)}catch(l){n=l}}),r.__H=void 0,n&&b.__e(n,r.__v))};var ye=typeof requestAnimationFrame=="function";function Ye(e){var n,r=function(){clearTimeout(t),ye&&cancelAnimationFrame(n),setTimeout(e)},t=setTimeout(r,35);ye&&(n=requestAnimationFrame(r))}function L(e){var n=m,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),m=n}function X(e){var n=m;e.__c=e.__(),m=n}function Ie(e,n){return!e||e.length!==n.length||n.some(function(r,t){return r!==e[t]})}function De(e,n){return typeof n=="function"?n(e):n}function Ke({onClick:e,color:n,children:r}){return u("button",{style:{background:n||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:r})}const Qe=({formState:e,setFormState:n,onClose:r,loading:t,whiteTheme:l=!1})=>{const o=l?{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},_=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},a=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},f=l?{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"}:{marginBottom:8,fontSize:14,textAlign:"left",display:"block"},s={color:"#ff4d4f",fontSize:13,marginTop:4},p=l?{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"},i=l?{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 u(A,{children:[u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),u("select",{style:a,value:e.currency,onInput:d=>{const c=d.target.value;n(h=>({...h,currency:c}))},children:[u("option",{value:"USD",children:"USD - 美元"}),u("option",{value:"CNY",children:"CNY - 人民币"}),u("option",{value:"EUR",children:"EUR - 欧元"})]})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),u("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:d=>{const c=d.target.value;n(h=>({...h,amount:c,amountError:c.trim()?"":h.amountError}))},style:o}),e.amountError&&u("div",{style:s,children:e.amountError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),u("select",{style:_,value:e.rechargeChannel,onInput:d=>{const c=d.target.value;n(h=>({...h,rechargeChannel:c,rechargeChannelError:c?"":h.rechargeChannelError}))},children:[u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"}),u("option",{value:"paypal",children:"PayPal"})]}),e.rechargeChannelError&&u("div",{style:s,children:e.rechargeChannelError})]}),e.error&&u("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:p,children:"取消"}),u("button",{type:"submit",disabled:t,style:i,children:t?"提交中...":"去支付"})]})]})},Xe=({formState:e,setFormState:n,onClose:r,loading:t})=>{const l=Ge(null),o=i=>{const d=Array.from(i.target.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},_=i=>{i.preventDefault();const d=Array.from(i.dataTransfer.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},a=i=>{i.preventDefault()},f=i=>{n(d=>({...d,files:d.files.filter((c,h)=>h!==i)}))},s=i=>{i.preventDefault();let d=!0;n(c=>({...c,platformError:"",transactionIdError:"",filesError:""})),e.platform||(n(c=>({...c,platformError:"请选择支付平台"})),d=!1),e.transactionId.trim()||(n(c=>({...c,transactionIdError:"请输入转账交易ID"})),d=!1),(!e.files||e.files.length===0)&&(n(c=>({...c,filesError:"请上传转账凭证"})),d=!1),d&&console.log("OfflineTransferForm values:",e)},p=i=>i>1024*1024?(i/1024/1024).toFixed(2)+" MB":i>1024?(i/1024).toFixed(2)+" KB":i+" B";return u("form",{onSubmit:s,children:[u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),u("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.platformError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},value:e.platform,onInput:i=>{const d=i.target.value;n(c=>({...c,platform:d,platformError:d?"":c.platformError}))},children:[u("option",{value:"paypal",children:"PayPal"}),u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"})]}),e.platformError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.platformError})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),u("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:i=>{const d=i.target.value;n(c=>({...c,transactionId:d,transactionIdError:d?"":c.transactionIdError}))},style:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.transactionIdError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}}),e.transactionIdError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.transactionIdError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),u("div",{style:{border:e.filesError?"1px dashed #ff4d4f":"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},onClick:()=>l.current?.click(),onDrop:_,onDragOver:a,children:[u("div",{style:{fontSize:48,marginBottom:12},children:u("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[u("rect",{x:"8",y:"8",width:"48",height:"48",rx:"12",fill:"#F4F6FA"}),u("rect",{x:"28",y:"20",width:"8",height:"24",rx:"4",fill:"#E5E6EB"})]})}),u("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),u("div",{style:{color:"#999",fontSize:13},children:"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件"}),u("input",{ref:l,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",style:{display:"none"},onChange:o})]}),e.files&&e.files.length>0&&u("div",{style:{marginTop:12},children:e.files.map((i,d)=>u("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[u("div",{style:{display:"flex",alignItems:"center",flex:1},children:[u("span",{style:{fontWeight:500},children:i.name}),u("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["(",p(i.size),")"]})]}),u("button",{type:"button",onClick:c=>{c.stopPropagation(),f(d)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},children:"移除"})]},d))}),e.filesError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.filesError})]}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},children:"取消"}),u("button",{type:"submit",disabled:t,style:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},children:"去支付"})]})]})};function Ze({visible:e,onClose:n,onSubmit:r,color:t}){console.log(1111);const[l,o]=j({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[_,a]=j("online"),[f,s]=j({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});return qe(()=>{e||(a("online"),o({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),s({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),e?u("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:d=>{d.target===d.currentTarget&&n()},children:u("form",{onSubmit:async d=>{d.preventDefault();let c=!0;if(o(h=>({...h,amountError:"",rechargeChannelError:""})),l.amount.trim()||(o(h=>({...h,amountError:"请输入充值金额"})),c=!1),l.rechargeChannel||(o(h=>({...h,rechargeChannelError:"请选择支付平台"})),c=!1),!!c){o(h=>({...h,loading:!0,error:""}));try{await r({amount:l.amount,rechargeChannel:l.rechargeChannel,currency:l.currency}),n()}catch{o(h=>({...h,error:"提交失败,请重试"}))}finally{o(h=>({...h,loading:!1}))}}},style:{background:"#fff",padding:32,borderRadius:12,minWidth:400,color:t||"#222",boxShadow:"0 4px 24px rgba(0,0,0,0.08)",position:"relative"},onClick:d=>d.stopPropagation(),children:[u("button",{type:"button",onClick:n,style:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},"aria-label":"关闭",children:"×"}),u("div",{style:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},children:"充值 / 转账"}),u("div",{style:{display:"flex",marginBottom:28},children:[u("button",{type:"button",onClick:()=>a("online"),style:{flex:1,background:_==="online"?"#fff":"#F7F8FA",color:_==="online"?"#155EEF":"#222",border:"none",borderRadius:"8px 0 0 8px",fontWeight:_==="online"?600:400,fontSize:16,height:48,boxShadow:_==="online"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:"1px solid #F0F1F3",transition:"all 0.2s"},children:"在线充值"}),u("button",{type:"button",onClick:()=>a("offline"),style:{flex:1,background:_==="offline"?"#fff":"#F7F8FA",color:_==="offline"?"#155EEF":"#222",border:"none",borderRadius:"0 8px 8px 0",fontWeight:_==="offline"?600:400,fontSize:16,height:48,boxShadow:_==="offline"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderLeft:"1px solid #F0F1F3",transition:"all 0.2s"},children:"线下转账"})]}),_==="online"?u(Qe,{formState:l,setFormState:o,onClose:n,loading:l.loading,whiteTheme:!0}):u(Xe,{formState:f,setFormState:s,onClose:n,loading:f.loading})]})}):null}function oe(){return(oe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}var en=["context","children"];function nn(e){this.getChildContext=function(){return e.context};var n=e.children,r=function(t,l){if(t==null)return{};var o,_,a={},f=Object.keys(t);for(_=0;_<f.length;_++)l.indexOf(o=f[_])>=0||(a[o]=t[o]);return a}(e,en);return Pe(n,r)}function rn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=S(nn,oe({},this._props,{context:e.detail.context}),function n(r,t){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var l=[],o={},_=0,a=r.attributes,f=r.childNodes;for(_=a.length;_--;)a[_].name!=="slot"&&(o[a[_].name]=a[_].value,o[Re(a[_].name)]=a[_].value);for(_=f.length;_--;){var s=n(f[_],null),p=f[_].slot;p?o[p]=S(ve,{name:p},s):l[_]=s}var i=t?S(ve,null,l):l;return S(t||r.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ze:V)(this._vdom,this._root)}function Re(e){return e.replace(/-(\w)/g,function(n,r){return r?r.toUpperCase():""})}function tn(e,n,r){if(this._vdom){var t={};t[e]=r=r??void 0,t[Re(e)]=r,this._vdom=Pe(this._vdom,t),V(this._vdom,this._root)}}function on(){V(this._vdom=null,this._root)}function ve(e,n){var r=this;return S("slot",oe({},e,{ref:function(t){t?(r.ref=t,r._listener||(r._listener=function(l){l.stopPropagation(),l.detail.context=n},t.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function ln(e,n,r,t){function l(){var o=Reflect.construct(HTMLElement,[],l);return o._vdomComponent=e,o._root=o,o}return(l.prototype=Object.create(HTMLElement.prototype)).constructor=l,l.prototype.connectedCallback=rn,l.prototype.attributeChangedCallback=tn,l.prototype.disconnectedCallback=on,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),l.observedAttributes=r,r.forEach(function(o){Object.defineProperty(l.prototype,o,{get:function(){return this._vdom.props[o]},set:function(_){this._vdom?this.attributeChangedCallback(o,null,_):(this._props||(this._props={}),this._props[o]=_,this.connectedCallback());var a=typeof _;_!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,_)}})}),customElements.define(n,l)}function _n(e){const[n,r]=j(!1),t=e.theme?.primaryColor;return u("div",{children:[u(Ke,{color:t,onClick:()=>r(!0),children:"打开表单"}),u(Ze,{visible:n,onClose:()=>r(!1),onSubmit:async o=>{console.log("submit",o)},color:t})]})}ln(_n,"x-best-modal-form",["theme"]);const an=["x-greeting","x-best-modal-form"];exports.components=an;exports.npmTest=He;exports.printCurrentTime=Ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function De(){console.log("npm package test!!!")}function He(){console.log("Current time:",new Date().toISOString())}var H,m,ye,S,le,ve,xe,Ee,Z,K,Q,A={},ke=[],Ne=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,G=Array.isArray;function C(e,r){for(var n in r)e[n]=r[n];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,r,n){var t,l,o,i={};for(o in r)o=="key"?t=r[o]:o=="ref"?l=r[o]:i[o]=r[o];if(arguments.length>2&&(i.children=arguments.length>3?H.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)i[o]===void 0&&(i[o]=e.defaultProps[o]);return T(e,i,t,l,null)}function T(e,r,n,t,l){var o={type:e,props:r,key:n,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++ye,__i:-1,__u:0};return l==null&&m.vnode!=null&&m.vnode(o),o}function N(e){return e.children}function M(e,r){this.props=e,this.context=r}function B(e,r){if(r==null)return e.__?B(e.__,e.__i+1):null;for(var n;r<e.__k.length;r++)if((n=e.__k[r])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?B(e):null}function Ce(e){var r,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,r=0;r<e.__k.length;r++)if((n=e.__k[r])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Ce(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&S.push(e)&&!W.__r++||le!=m.debounceRendering)&&((le=m.debounceRendering)||ve)(W)}function W(){for(var e,r,n,t,l,o,i,a=1;S.length;)S.length>a&&S.sort(xe),e=S.shift(),a=S.length,e.__d&&(n=void 0,l=(t=(r=e).__v).__e,o=[],i=[],r.__P&&((n=C({},t)).__v=t.__v+1,m.vnode&&m.vnode(n),re(r.__P,n,t,r.__n,r.__P.namespaceURI,32&t.__u?[l]:null,o,l??B(t),!!(32&t.__u),i),n.__v=t.__v,n.__.__k[n.__i]=n,we(o,n,i),n.__e!=l&&Ce(n)));W.__r=0}function Fe(e,r,n,t,l,o,i,a,s,c,p){var _,g,d,u,h,b,y=t&&t.__k||ke,v=r.length;for(s=Ue(n,r,y,s,v),_=0;_<v;_++)(d=n.__k[_])!=null&&(g=d.__i==-1?A:y[d.__i]||A,d.__i=_,b=re(e,d,g,l,o,i,a,s,c,p),u=d.__e,d.ref&&g.ref!=d.ref&&(g.ref&&ne(g.ref,null,d),p.push(d.ref,d.__c||u,d)),h==null&&u!=null&&(h=u),4&d.__u||g.__k===d.__k?s=Se(d,s,e):typeof d.type=="function"&&b!==void 0?s=b:u&&(s=u.nextSibling),d.__u&=-7);return n.__e=h,s}function Ue(e,r,n,t,l){var o,i,a,s,c,p=n.length,_=p,g=0;for(e.__k=new Array(l),o=0;o<l;o++)(i=r[o])!=null&&typeof i!="boolean"&&typeof i!="function"?(s=o+g,(i=e.__k[o]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?T(null,i,null,null,null):G(i)?T(N,{children:i},null,null,null):i.constructor==null&&i.__b>0?T(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,a=null,(c=i.__i=je(i,n,s,_))!=-1&&(_--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(l>p?g--:l<p&&g++),typeof i.type!="function"&&(i.__u|=4)):c!=s&&(c==s-1?g--:c==s+1?g++:(c>s?g--:g++,i.__u|=4))):e.__k[o]=null;if(_)for(o=0;o<p;o++)(a=n[o])!=null&&(2&a.__u)==0&&(a.__e==t&&(t=B(a)),ze(a,a));return t}function Se(e,r,n){var t,l;if(typeof e.type=="function"){for(t=e.__k,l=0;t&&l<t.length;l++)t[l]&&(t[l].__=e,r=Se(t[l],r,n));return r}e.__e!=r&&(r&&e.type&&!n.contains(r)&&(r=B(e)),n.insertBefore(e.__e,r||null),r=e.__e);do r=r&&r.nextSibling;while(r!=null&&r.nodeType==8);return r}function je(e,r,n,t){var l,o,i=e.key,a=e.type,s=r[n];if(s===null&&e.key==null||s&&i==s.key&&a==s.type&&(2&s.__u)==0)return n;if(t>(s!=null&&(2&s.__u)==0?1:0))for(l=n-1,o=n+1;l>=0||o<r.length;){if(l>=0){if((s=r[l])&&(2&s.__u)==0&&i==s.key&&a==s.type)return l;l--}if(o<r.length){if((s=r[o])&&(2&s.__u)==0&&i==s.key&&a==s.type)return o;o++}}return-1}function ae(e,r,n){r[0]=="-"?e.setProperty(r,n??""):e[r]=n==null?"":typeof n!="number"||Ne.test(r)?n:n+"px"}function L(e,r,n,t,l){var o,i;e:if(r=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(r in t)n&&r in n||ae(e.style,r,"");if(n)for(r in n)t&&n[r]==t[r]||ae(e.style,r,n[r])}else if(r[0]=="o"&&r[1]=="n")o=r!=(r=r.replace(Ee,"$1")),i=r.toLowerCase(),r=i in e||r=="onFocusOut"||r=="onFocusIn"?i.slice(2):r.slice(2),e.l||(e.l={}),e.l[r+o]=n,n?t?n.u=t.u:(n.u=Z,e.addEventListener(r,o?Q:K,o)):e.removeEventListener(r,o?Q:K,o);else{if(l=="http://www.w3.org/2000/svg")r=r.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(r!="width"&&r!="height"&&r!="href"&&r!="list"&&r!="form"&&r!="tabIndex"&&r!="download"&&r!="rowSpan"&&r!="colSpan"&&r!="role"&&r!="popover"&&r in e)try{e[r]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&r[4]!="-"?e.removeAttribute(r):e.setAttribute(r,r=="popover"&&n==1?"":n))}}function ce(e){return function(r){if(this.l){var n=this.l[r.type+e];if(r.t==null)r.t=Z++;else if(r.t<n.u)return;return n(m.event?m.event(r):r)}}}function re(e,r,n,t,l,o,i,a,s,c){var p,_,g,d,u,h,b,y,v,z,F,U,I,ie,j,R,J,k=r.type;if(r.constructor!=null)return null;128&n.__u&&(s=!!(32&n.__u),o=[a=r.__e=n.__e]),(p=m.__b)&&p(r);e:if(typeof k=="function")try{if(y=r.props,v="prototype"in k&&k.prototype.render,z=(p=k.contextType)&&t[p.__c],F=p?z?z.props.value:p.__:t,n.__c?b=(_=r.__c=n.__c).__=_.__E:(v?r.__c=_=new k(y,F):(r.__c=_=new M(y,F),_.constructor=k,_.render=Me),z&&z.sub(_),_.props=y,_.state||(_.state={}),_.context=F,_.__n=t,g=_.__d=!0,_.__h=[],_._sb=[]),v&&_.__s==null&&(_.__s=_.state),v&&k.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=C({},_.__s)),C(_.__s,k.getDerivedStateFromProps(y,_.__s))),d=_.props,u=_.state,_.__v=r,g)v&&k.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),v&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(v&&k.getDerivedStateFromProps==null&&y!==d&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(y,F),!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(y,_.__s,F)===!1||r.__v==n.__v){for(r.__v!=n.__v&&(_.props=y,_.state=_.__s,_.__d=!1),r.__e=n.__e,r.__k=n.__k,r.__k.some(function($){$&&($.__=r)}),U=0;U<_._sb.length;U++)_.__h.push(_._sb[U]);_._sb=[],_.__h.length&&i.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(y,_.__s,F),v&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(d,u,h)})}if(_.context=F,_.props=y,_.__P=e,_.__e=!1,I=m.__r,ie=0,v){for(_.state=_.__s,_.__d=!1,I&&I(r),p=_.render(_.props,_.state,_.context),j=0;j<_._sb.length;j++)_.__h.push(_._sb[j]);_._sb=[]}else do _.__d=!1,I&&I(r),p=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++ie<25);_.state=_.__s,_.getChildContext!=null&&(t=C(C({},t),_.getChildContext())),v&&!g&&_.getSnapshotBeforeUpdate!=null&&(h=_.getSnapshotBeforeUpdate(d,u)),R=p,p!=null&&p.type===N&&p.key==null&&(R=Be(p.props.children)),a=Fe(e,G(R)?R:[R],r,n,t,l,o,i,a,s,c),_.base=r.__e,r.__u&=-161,_.__h.length&&i.push(_),b&&(_.__E=_.__=null)}catch($){if(r.__v=null,s||o!=null)if($.then){for(r.__u|=s?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,r.__e=a}else for(J=o.length;J--;)ee(o[J]);else r.__e=n.__e,r.__k=n.__k;m.__e($,r,n)}else o==null&&r.__v==n.__v?(r.__k=n.__k,r.__e=n.__e):a=r.__e=Le(n.__e,r,n,t,l,o,i,s,c);return(p=m.diffed)&&p(r),128&r.__u?void 0:a}function we(e,r,n){for(var t=0;t<n.length;t++)ne(n[t],n[++t],n[++t]);m.__c&&m.__c(r,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(o){o.call(l)})}catch(o){m.__e(o,l.__v)}})}function Be(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:G(e)?e.map(Be):C({},e)}function Le(e,r,n,t,l,o,i,a,s){var c,p,_,g,d,u,h,b=n.props,y=r.props,v=r.type;if(v=="svg"?l="http://www.w3.org/2000/svg":v=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((d=o[c])&&"setAttribute"in d==!!v&&(v?d.localName==v:d.nodeType==3)){e=d,o[c]=null;break}}if(e==null){if(v==null)return document.createTextNode(y);e=document.createElementNS(l,v,y.is&&y),a&&(m.__m&&m.__m(r,o),a=!1),o=null}if(v==null)b===y||a&&e.data==y||(e.data=y);else{if(o=o&&H.call(e.childNodes),b=n.props||A,!a&&o!=null)for(b={},c=0;c<e.attributes.length;c++)b[(d=e.attributes[c]).name]=d.value;for(c in b)if(d=b[c],c!="children"){if(c=="dangerouslySetInnerHTML")_=d;else if(!(c in y)){if(c=="value"&&"defaultValue"in y||c=="checked"&&"defaultChecked"in y)continue;L(e,c,null,d,l)}}for(c in y)d=y[c],c=="children"?g=d:c=="dangerouslySetInnerHTML"?p=d:c=="value"?u=d:c=="checked"?h=d:a&&typeof d!="function"||b[c]===d||L(e,c,d,b[c],l);if(p)a||_&&(p.__html==_.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),r.__k=[];else if(_&&(e.innerHTML=""),Fe(r.type=="template"?e.content:e,G(g)?g:[g],r,n,t,v=="foreignObject"?"http://www.w3.org/1999/xhtml":l,o,i,o?o[0]:n.__k&&B(n,0),a,s),o!=null)for(c=o.length;c--;)ee(o[c]);a||(c="value",v=="progress"&&u==null?e.removeAttribute("value"):u!=null&&(u!==e[c]||v=="progress"&&!u||v=="option"&&u!=b[c])&&L(e,c,u,b[c],l),c="checked",h!=null&&h!=e[c]&&L(e,c,h,b[c],l))}return e}function ne(e,r,n){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&r==null||(e.__u=e(r))}else e.current=r}catch(l){m.__e(l,n)}}function ze(e,r,n){var t,l;if(m.unmount&&m.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||ne(t,null,r)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){m.__e(o,r)}t.base=t.__P=null}if(t=e.__k)for(l=0;l<t.length;l++)t[l]&&ze(t[l],r,n||typeof e.type!="function");n||ee(e.__e),e.__c=e.__=e.__e=void 0}function Me(e,r,n){return this.constructor(e,n)}function V(e,r,n){var t,l,o,i;r==document&&(r=document.documentElement),m.__&&m.__(e,r),l=(t=typeof n=="function")?null:n&&n.__k||r.__k,o=[],i=[],re(r,e=(!t&&n||r).__k=w(N,null,[e]),l||A,A,r.namespaceURI,!t&&n?[n]:l?null:r.firstChild?H.call(r.childNodes):null,o,!t&&n?n:l?l.__e:r.firstChild,t,i),we(o,e,i)}function Ie(e,r){V(e,r,Ie)}function Re(e,r,n){var t,l,o,i,a=C({},e.props);for(o in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),r)o=="key"?t=r[o]:o=="ref"?l=r[o]:a[o]=r[o]===void 0&&i!=null?i[o]:r[o];return arguments.length>2&&(a.children=arguments.length>3?H.call(arguments,2):n),T(e.type,a,t||e.key,l||e.ref,null)}H=ke.slice,m={__e:function(e,r,n,t){for(var l,o,i;r=r.__;)if((l=r.__c)&&!l.__)try{if((o=l.constructor)&&o.getDerivedStateFromError!=null&&(l.setState(o.getDerivedStateFromError(e)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,t||{}),i=l.__d),i)return l.__E=l}catch(a){e=a}throw e}},ye=0,M.prototype.setState=function(e,r){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof e=="function"&&(e=e(C({},n),this.props)),e&&C(n,e),e!=null&&this.__v&&(r&&this._sb.push(r),_e(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},M.prototype.render=N,S=[],ve=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe=function(e,r){return e.__v.__b-r.__v.__b},W.__r=0,Ee=/(PointerCapture)$|Capture$/i,Z=0,K=ce(!1),Q=ce(!0);var Oe=0;function f(e,r,n,t,l,o){r||(r={});var i,a,s=r;if("ref"in s)for(a in s={},r)a=="ref"?i=r[a]:s[a]=r[a];var c={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oe,__i:-1,__u:0,__source:l,__self:o};if(typeof e=="function"&&(i=e.defaultProps))for(a in i)s[a]===void 0&&(s[a]=i[a]);return m.vnode&&m.vnode(c),c}var D,x,Y,de,q=0,$e=[],E=m,se=E.__b,fe=E.__r,ue=E.diffed,pe=E.__c,he=E.unmount,ge=E.__;function oe(e,r){E.__h&&E.__h(x,e,q||r),q=0;var n=x.__H||(x.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return q=1,We(Pe,e)}function We(e,r,n){var t=oe(D++,2);if(t.t=e,!t.__c&&(t.__=[Pe(void 0,r),function(a){var s=t.__N?t.__N[0]:t.__[0],c=t.t(s,a);s!==c&&(t.__N=[c,t.__[1]],t.__c.setState({}))}],t.__c=x,!x.__f)){var l=function(a,s,c){if(!t.__c.__H)return!0;var p=t.__c.__H.__.filter(function(g){return!!g.__c});if(p.every(function(g){return!g.__N}))return!o||o.call(this,a,s,c);var _=t.__c.props!==a;return p.forEach(function(g){if(g.__N){var d=g.__[0];g.__=g.__N,g.__N=void 0,d!==g.__[0]&&(_=!0)}}),o&&o.call(this,a,s,c)||_};x.__f=!0;var o=x.shouldComponentUpdate,i=x.componentWillUpdate;x.componentWillUpdate=function(a,s,c){if(this.__e){var p=o;o=void 0,l(a,s,c),o=p}i&&i.call(this,a,s,c)},x.shouldComponentUpdate=l}return t.__N||t.__}function qe(e,r){var n=oe(D++,3);!E.__s&&Te(n.__H,r)&&(n.__=e,n.u=r,x.__H.__h.push(n))}function Ge(e){return q=5,Ve(function(){return{current:e}},[])}function Ve(e,r){var n=oe(D++,7);return Te(n.__H,r)&&(n.__=e(),n.__H=r,n.__h=e),n.__}function Je(){for(var e;e=$e.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(r){e.__H.__h=[],E.__e(r,e.__v)}}E.__b=function(e){x=null,se&&se(e)},E.__=function(e,r){e&&r.__k&&r.__k.__m&&(e.__m=r.__k.__m),ge&&ge(e,r)},E.__r=function(e){fe&&fe(e),D=0;var r=(x=e.__c).__H;r&&(Y===x?(r.__h=[],x.__h=[],r.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(r.__h.forEach(O),r.__h.forEach(X),r.__h=[],D=0)),Y=x},E.diffed=function(e){ue&&ue(e);var r=e.__c;r&&r.__H&&(r.__H.__h.length&&($e.push(r)!==1&&de===E.requestAnimationFrame||((de=E.requestAnimationFrame)||Ye)(Je)),r.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Y=x=null},E.__c=function(e,r){r.some(function(n){try{n.__h.forEach(O),n.__h=n.__h.filter(function(t){return!t.__||X(t)})}catch(t){r.some(function(l){l.__h&&(l.__h=[])}),r=[],E.__e(t,n.__v)}}),pe&&pe(e,r)},E.unmount=function(e){he&&he(e);var r,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(t){try{O(t)}catch(l){r=l}}),n.__H=void 0,r&&E.__e(r,n.__v))};var be=typeof requestAnimationFrame=="function";function Ye(e){var r,n=function(){clearTimeout(t),be&&cancelAnimationFrame(r),setTimeout(e)},t=setTimeout(n,35);be&&(r=requestAnimationFrame(n))}function O(e){var r=x,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),x=r}function X(e){var r=x;e.__c=e.__(),x=r}function Te(e,r){return!e||e.length!==r.length||r.some(function(n,t){return n!==e[t]})}function Pe(e,r){return typeof r=="function"?r(e):r}function Ke({onClick:e,color:r,children:n}){return f("button",{style:{background:r||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:n})}const Qe=({formState:e,setFormState:r,onClose:n,loading:t,whiteTheme:l=!1})=>{const o=l?{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}}:{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}},i=l?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},a=l?{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 f(N,{children:[f("div",{style:{marginBottom:18},children:[f("div",{style:o.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),f("select",{style:{...o.select},value:e.currency,onInput:s=>{const c=s.target.value;r(p=>({...p,currency:c}))},children:[f("option",{value:"USD",children:"USD - 美元"}),f("option",{value:"CNY",children:"CNY - 人民币"}),f("option",{value:"EUR",children:"EUR - 欧元"})]})]}),f("div",{style:{marginBottom:18},children:[f("div",{style:o.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),f("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:s=>{const c=s.target.value;r(p=>({...p,amount:c,amountError:c.trim()?"":p.amountError}))},style:{...o.input,...e.amountError?o.inputError:{}}}),e.amountError&&f("div",{style:o.error,children:e.amountError})]}),f("div",{style:{marginBottom:24},children:[f("div",{style:o.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),f("select",{style:{...o.select,...e.rechargeChannelError?o.selectError:{}},value:e.rechargeChannel,onInput:s=>{const c=s.target.value;r(p=>({...p,rechargeChannel:c,rechargeChannelError:c?"":p.rechargeChannelError}))},children:[f("option",{value:"alipay",children:"支付宝"}),f("option",{value:"wechat",children:"微信"}),f("option",{value:"paypal",children:"PayPal"})]}),e.rechargeChannelError&&f("div",{style:o.error,children:e.rechargeChannelError})]}),e.error&&f("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),f("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[f("button",{type:"button",onClick:n,style:i,children:"取消"}),f("button",{type:"submit",disabled:t,style:a,children:t?"提交中...":"去支付"})]})]})},Xe=({formState:e,setFormState:r,onClose:n,loading:t,whiteTheme:l=!1})=>{const o=Ge(null),i=l?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:13,marginTop:4}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #23262F",borderRadius:8,background:"#181A20",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#fff",justifyContent:"space-between"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:13,marginTop:4}},a=d=>{const u=Array.from(d.target.files).slice(0,10);r(h=>({...h,files:u,filesError:""}))},s=d=>{d.preventDefault();const u=Array.from(d.dataTransfer.files).slice(0,10);r(h=>({...h,files:u,filesError:""}))},c=d=>{d.preventDefault()},p=d=>{r(u=>({...u,files:u.files.filter((h,b)=>b!==d)}))},_=d=>{d.preventDefault();let u=!0;r(h=>({...h,platformError:"",transactionIdError:"",filesError:""})),e.platform||(r(h=>({...h,platformError:"请选择支付平台"})),u=!1),e.transactionId.trim()||(r(h=>({...h,transactionIdError:"请输入转账交易ID"})),u=!1),(!e.files||e.files.length===0)&&(r(h=>({...h,filesError:"请上传转账凭证"})),u=!1),u&&console.log("OfflineTransferForm values:",e)},g=d=>d>1024*1024?(d/1024/1024).toFixed(2)+" MB":d>1024?(d/1024).toFixed(2)+" KB":d+" B";return f("form",{onSubmit:_,children:[f("div",{style:{marginBottom:18},children:[f("div",{style:i.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),f("select",{style:{...i.select,...e.platformError?i.selectError:{}},value:e.platform,onInput:d=>{const u=d.target.value;r(h=>({...h,platform:u,platformError:u?"":h.platformError}))},children:[f("option",{value:"paypal",children:"PayPal"}),f("option",{value:"alipay",children:"支付宝"}),f("option",{value:"wechat",children:"微信"})]}),e.platformError&&f("div",{style:i.error,children:e.platformError})]}),f("div",{style:{marginBottom:18},children:[f("div",{style:i.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),f("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:d=>{const u=d.target.value;r(h=>({...h,transactionId:u,transactionIdError:u?"":h.transactionIdError}))},style:{...i.input,...e.transactionIdError?i.inputError:{}}}),e.transactionIdError&&f("div",{style:i.error,children:e.transactionIdError})]}),f("div",{style:{marginBottom:24},children:[f("div",{style:i.label,children:[f("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),f("div",{style:{...i.upload,...e.filesError?i.uploadError:{}},onClick:()=>o.current?.click(),onDrop:s,onDragOver:c,children:[f("div",{style:{fontSize:48,marginBottom:12},children:f("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[f("rect",{x:"8",y:"8",width:"48",height:"48",rx:"12",fill:"#F4F6FA"}),f("rect",{x:"28",y:"20",width:"8",height:"24",rx:"4",fill:"#E5E6EB"})]})}),f("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),f("div",{style:{color:"#999",fontSize:13},children:"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件"}),f("input",{ref:o,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",style:{display:"none"},onChange:a})]}),e.files&&e.files.length>0&&f("div",{style:{marginTop:12},children:e.files.map((d,u)=>f("div",{style:i.fileItem,children:[f("div",{style:{display:"flex",alignItems:"center",flex:1},children:[f("span",{style:{fontWeight:500},children:d.name}),f("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["(",g(d.size),")"]})]}),f("button",{type:"button",onClick:h=>{h.stopPropagation(),p(u)},style:i.removeBtn,children:"移除"})]},u))}),e.filesError&&f("div",{style:i.error,children:e.filesError})]}),f("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[f("button",{type:"button",onClick:n,style:i.buttonCancel,children:"取消"}),f("button",{type:"submit",disabled:t,style:i.buttonSubmit,children:"去支付"})]})]})};function Ze({visible:e,onClose:r,onSubmit:n,color:t,whiteTheme:l=!0}){console.log(1111);const[o,i]=P({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,s]=P("online"),[c,p]=P({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(qe(()=>{e||(s("online"),i({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),p({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const _=async u=>{u.preventDefault();let h=!0;if(i(b=>({...b,amountError:"",rechargeChannelError:""})),o.amount.trim()||(i(b=>({...b,amountError:"请输入充值金额"})),h=!1),o.rechargeChannel||(i(b=>({...b,rechargeChannelError:"请选择支付平台"})),h=!1),!!h){i(b=>({...b,loading:!0,error:""}));try{await n({amount:o.amount,rechargeChannel:o.rechargeChannel,currency:o.currency}),r()}catch{i(b=>({...b,error:"提交失败,请重试"}))}finally{i(b=>({...b,loading:!1}))}}},g=u=>{u.target===u.currentTarget&&r()},d=l?{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:(u,h)=>({flex:1,background:u?"#fff":"#F7F8FA",color:u?"#155EEF":"#222",border:"none",borderRadius:h?"8px 0 0 8px":"0 8px 8px 0",fontWeight:u?600:400,fontSize:16,height:48,boxShadow:u?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:h?"1px solid #F0F1F3":void 0,borderLeft:h?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:(u,h)=>({flex:1,background:u?"#23262F":"#181A20",color:u?"#00E8C6":"#fff",border:"none",borderRadius:h?"8px 0 0 8px":"0 8px 8px 0",fontWeight:u?600:400,fontSize:16,height:48,boxShadow:u?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer",borderRight:h?"1px solid #23262F":void 0,borderLeft:h?void 0:"1px solid #23262F",transition:"all 0.2s"})};return f("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:d.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:g,children:f("form",{onSubmit:_,style:{background:d.modalBg,padding:32,borderRadius:12,minWidth:400,color:t||d.modalColor,boxShadow:d.modalBoxShadow,position:"relative"},onClick:u=>u.stopPropagation(),children:[f("button",{type:"button",onClick:r,style:d.closeBtn,"aria-label":"关闭",children:"×"}),f("div",{style:d.title,children:"充值 / 转账"}),f("div",{style:{display:"flex",marginBottom:28},children:[f("button",{type:"button",onClick:()=>s("online"),style:d.tabBtn(a==="online",!0),children:"在线充值"}),f("button",{type:"button",onClick:()=>s("offline"),style:d.tabBtn(a==="offline",!1),children:"线下转账"})]}),a==="online"?f(Qe,{formState:o,setFormState:i,onClose:r,loading:o.loading,whiteTheme:l}):f(Xe,{formState:c,setFormState:p,onClose:r,loading:c.loading,whiteTheme:l})]})})}function te(){return(te=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}var er=["context","children"];function rr(e){this.getChildContext=function(){return e.context};var r=e.children,n=function(t,l){if(t==null)return{};var o,i,a={},s=Object.keys(t);for(i=0;i<s.length;i++)l.indexOf(o=s[i])>=0||(a[o]=t[o]);return a}(e,er);return Re(r,n)}function nr(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=w(rr,te({},this._props,{context:e.detail.context}),function r(n,t){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var l=[],o={},i=0,a=n.attributes,s=n.childNodes;for(i=a.length;i--;)a[i].name!=="slot"&&(o[a[i].name]=a[i].value,o[Ae(a[i].name)]=a[i].value);for(i=s.length;i--;){var c=r(s[i],null),p=s[i].slot;p?o[p]=w(me,{name:p},c):l[i]=c}var _=t?w(me,null,l):l;return w(t||n.nodeName.toLowerCase(),o,_)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ie:V)(this._vdom,this._root)}function Ae(e){return e.replace(/-(\w)/g,function(r,n){return n?n.toUpperCase():""})}function or(e,r,n){if(this._vdom){var t={};t[e]=n=n??void 0,t[Ae(e)]=n,this._vdom=Re(this._vdom,t),V(this._vdom,this._root)}}function tr(){V(this._vdom=null,this._root)}function me(e,r){var n=this;return w("slot",te({},e,{ref:function(t){t?(n.ref=t,n._listener||(n._listener=function(l){l.stopPropagation(),l.detail.context=r},t.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function ir(e,r,n,t){function l(){var o=Reflect.construct(HTMLElement,[],l);return o._vdomComponent=e,o._root=o,o}return(l.prototype=Object.create(HTMLElement.prototype)).constructor=l,l.prototype.connectedCallback=nr,l.prototype.attributeChangedCallback=or,l.prototype.disconnectedCallback=tr,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),l.observedAttributes=n,n.forEach(function(o){Object.defineProperty(l.prototype,o,{get:function(){return this._vdom.props[o]},set:function(i){this._vdom?this.attributeChangedCallback(o,null,i):(this._props||(this._props={}),this._props[o]=i,this.connectedCallback());var a=typeof i;i!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,i)}})}),customElements.define(r,l)}function lr(e){const[r,n]=P(!1),[t,l]=P(!0),o=e.theme?.primaryColor;return f("div",{children:[f(Ke,{color:o,onClick:()=>n(!0),children:"打开表单"}),f("button",{style:{marginLeft:16,padding:"8px 16px",borderRadius:6,border:"1px solid #eee",cursor:"pointer"},onClick:()=>l(a=>!a),children:t?"切换为暗黑主题":"切换为白色主题"}),f(Ze,{visible:r,onClose:()=>n(!1),onSubmit:async a=>{console.log("submit",a)},color:o,whiteTheme:t})]})}ir(lr,"x-best-modal-form",["theme"]);const _r=["x-greeting","x-best-modal-form"];exports.components=_r;exports.npmTest=De;exports.printCurrentTime=He;