-
Notifications
You must be signed in to change notification settings - Fork 6
/
deposit-withdraw.9fe9cbbef8f591c433bc.js
1 lines (1 loc) · 80.2 KB
/
deposit-withdraw.9fe9cbbef8f591c433bc.js
1
"use strict";(this.webpackChunkRuDEX3_light=this.webpackChunkRuDEX3_light||[]).push([[25],{68001:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Me});var i=s(67294),a=s(89449),n=s(36345),o=s(41737),r=s(13973),l=s(58074),c=s.n(l),d=s(23037),p=s(82267),m=s(21660),u=s(32793),h=s(39014),g=s(55294),y=s(30806),w=s(73935),_=s(45697),C=s.n(_);class M extends i.Component{static propTypes={disableCopy:C().bool,replaceCopyText:C().string};constructor(e){super(e),this._handleCopy=this._handleCopy.bind(this)}componentDidMount(){this.childRef&&(this.node=w.findDOMNode(this.childRef)),this.node&&this.node.addEventListener&&this.node.addEventListener("copy",this._handleCopy)}componentWillUnmount(){this.node&&this.node.removeEventListener&&this.node.removeEventListener("copy",this._handleCopy)}_handleCopy(e){!1!==this.props.disableCopy&&(this.props.replaceCopyText&&e.clipboardData.setData("text/plain",this.props.replaceCopyText),e.preventDefault())}render(){return i.createElement("span",{ref:e=>this.childRef=e},this.props.children)}}const b=M;var E=s(99111),L=s(44015),I=s(112),N=s.n(I),v=s(57351),A=s(82050),j=s(19602),f=s(21712);const x=(0,j.ZP)("");function S({walletType:e,inputCoinType:t,outputCoinType:s,outputAddress:i,url:a=f.Eu,stateCallback:n}){let o={walletType:e,inputCoinType:t,outputCoinType:s,outputAddress:i},r=JSON.stringify(o);console.log("walletType: "+e),"bsc-tokens"===e&&(a=f.qd),fetch(a.BASE+a.NEW_DEPOSIT_ADDRESS,{method:"post",headers:new Headers({Accept:"application/json","Content-Type":"application/json"}),body:r}).then((e=>{e.json().then((e=>{let t={address:e.inputAddress||"unknown",memo:e.inputMemo,error:e.error||null};n&&n(t)}),(e=>{n&&n({address:"unknown",memo:null})}))}),(e=>{n&&n({address:"unknown",memo:null})})).catch((e=>{console.log("fetch error:",e)}))}const D=function(e){return x.has(`history_address_${e}`)},T=function({wallet:e,addresses:t}){x.set(`history_address_${e}`,t)},k=function(e){return x.get(`history_address_${e}`,[])},z=function({wallet:e,address:t}){x.set(`history_address_last_${e}`,t)},O=function(e){return x.get(`history_address_last_${e}`,"")};var Z=s(81237),R=s(74366),P=s(76660),Y=s(48764).Buffer;class B extends i.Component{static propTypes={account:d.Z.ChainAccount.isRequired,issuer:d.Z.ChainAccount.isRequired,asset:d.Z.ChainAsset.isRequired,output_coin_name:C().string.isRequired,output_coin_symbol:C().string.isRequired,output_coin_type:C().string.isRequired,url:C().string,output_wallet_type:C().string,description:C().string,output_supports_memos:C().bool.isRequired,output_supportsPublicKey:C().bool.isRequired,amount_to_withdraw:C().string,balance:d.Z.ChainObject,min_amount:C().number,gateFee:C().number};constructor(e){super(e),this.state={isConfirmationModalVisible:!1,withdraw_amount:this.props.amount_to_withdraw,withdraw_address:O(e.output_wallet_type),withdraw_address_check_in_progress:!0,withdraw_address_is_valid:null,options_is_valid:!1,confirmation_is_valid:!1,withdraw_address_selected:O(e.output_wallet_type),withdraw_publicKey:"",withdraw_publicKey_not_empty:!this.props.output_supportsPublicKey,memo:"",withdraw_address_first:!0,empty_withdraw_value:!1,from_account:e.account,fee_asset_id:y.ChainStore.assets_by_symbol.get(e.fee_asset_symbol)||"1.3.0",feeStatus:{}},this._validateAddress(this.state.withdraw_address,e),this._checkBalance=this._checkBalance.bind(this),this._checkMinAmount=this._checkMinAmount.bind(this),this._updateFee=(0,E.Z)(this._updateFee.bind(this),250),this.showConfirmationModal=this.showConfirmationModal.bind(this),this.hideConfirmationModal=this.hideConfirmationModal.bind(this)}UNSAFE_componentWillMount(){this._updateFee(),this._checkFeeStatus()}componentWillUnmount(){this.unMounted=!0}UNSAFE_componentWillReceiveProps(e){e.account!==this.state.from_account&&e.account!==this.props.account&&this.setState({from_account:e.account,feeStatus:{},feeAmount:new R.xR({amount:0})},(()=>{this._updateFee(),this._checkFeeStatus()}))}showConfirmationModal(){this.setState({isConfirmationModalVisible:!0})}hideConfirmationModal(){this.setState({isConfirmationModalVisible:!1})}_updateFee(e=this.state){let{fee_asset_id:t,from_account:s}=e;const{fee_asset_types:i}=this._getAvailableAssets(e);if(1===i.length&&i[0]!==t&&(t=i[0]),!s)return null;(0,Z.rX)({accountID:s.get("id"),feeID:t,options:["price_per_kbyte"],data:{type:"memo",content:this.props.output_coin_type+":"+e.withdraw_address+(e.memo?":"+e.memo:"")}}).then((({fee:e,hasBalance:t,hasPoolBalance:s})=>{this.unMounted||this.setState({feeAmount:e,hasBalance:t,hasPoolBalance:s,error:!t||!s},this._checkBalance)}))}_checkFeeStatus(e=this.state){let t=e.from_account;if(!t)return;const{fee_asset_types:s}=this._getAvailableAssets(e);let i={},a=[];s.forEach((s=>{a.push((0,Z.rX)({accountID:t.get("id"),feeID:s,options:["price_per_kbyte"],data:{type:"memo",content:this.props.output_coin_type+":"+e.withdraw_address+(e.memo?":"+e.memo:"")}}))})),Promise.all(a).then((t=>{s.forEach(((e,s)=>{i[e]=t[s]})),r.Z.are_equal_shallow(e.feeStatus,i)||this.setState({feeStatus:i}),this._checkBalance()})).catch((e=>{console.error(e)}))}onMemoChanged(e){this.setState({memo:e.target.value},this._updateFee)}onWithdrawAmountChange({amount:e}){this.setState({withdraw_amount:e,empty_withdraw_value:void 0!==e&&!parseFloat(e)},(function(){this._checkBalance(),this._checkMinAmount()}))}onSelectChanged(e){let t=k(this.props.output_wallet_type)[e];z({wallet:this.props.output_wallet_type,address:t}),this.setState({withdraw_address_selected:t,options_is_valid:!1,withdraw_address:t,withdraw_address_check_in_progress:!0,withdraw_address_is_valid:null},this._updateFee),this._validateAddress(t)}onWithdrawAddressChanged(e){let t=e.target.value.trim();this.setState({withdraw_address:t,withdraw_address_check_in_progress:!0,withdraw_address_selected:t,withdraw_address_is_valid:null},this._updateFee),this._validateAddress(t)}onWithdrawPublicKeyChanged(e){let t=e.target.value.trim();this.setState({withdraw_publicKey:t,withdraw_publicKey_not_empty:""!=t})}_validateAddress(e,t=this.props){(function({url:e=f.Eu,walletType:t,newAddress:s}){return"bsc-tokens"===t&&(e=f.qd),s?fetch(e.BASE+"/wallets/"+t+"/check-address",{method:"post",headers:new Headers({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({address:s})}).then((e=>e.json().then((e=>e)))).catch((e=>{console.log("validate error:",e)})):new Promise((e=>e()))})({url:t.url,walletType:t.output_wallet_type,newAddress:e}).then((t=>{void 0===t&&(t={isValid:!1}),this.state.withdraw_address===e&&this.setState({withdraw_address_check_in_progress:!1,withdraw_address_is_valid:t.isValid,withdraw_publicKey:t.hasOwnProperty("publicKey")?t.publicKey:"",withdraw_publicKey_not_empty:!this.props.output_supportsPublicKey||!!t.hasOwnProperty("publicKey")})}))}_checkBalance(){const{feeAmount:e,withdraw_amount:t}=this.state,{asset:s,balance:i}=this.props;if(!i||!e)return;const a=(0,Z.cr)(t,s,e,i);return null!==a?(this.setState({balanceError:!a}),a):void 0}_checkMinAmount(){const{withdraw_amount:e}=this.state;if(null===e)return;const t=e<this.props.min_amount/r.Z.get_asset_precision(this.props.asset_precision);return this.setState({minAmountError:t}),t}onSubmit(){if(!this.state.withdraw_address_check_in_progress&&this.state.withdraw_address&&this.state.withdraw_address.length&&null!==this.state.withdraw_amount)if(this.state.withdraw_address_is_valid)if(parseFloat(this.state.withdraw_amount)>0){if(D(this.props.output_wallet_type)){let e=k(this.props.output_wallet_type);-1==e.indexOf(this.state.withdraw_address)&&(e.push(this.state.withdraw_address),T({wallet:this.props.output_wallet_type,addresses:e}))}else{let e=[];e.push(this.state.withdraw_address),T({wallet:this.props.output_wallet_type,addresses:e})}z({wallet:this.props.output_wallet_type,address:this.state.withdraw_address});let e=this.props.asset;const{feeAmount:t,fee_asset_id:s}=this.state;let i=parseFloat(String.prototype.replace.call(this.state.withdraw_amount,/,/g,"")),a=new R.xR({asset_id:e.get("id"),precision:e.get("precision"),real:i});A.Z.transfer(this.props.account.get("id"),this.props.issuer.get("id"),a.getAmount(),e.get("id"),this.props.output_coin_type+":"+this.state.withdraw_address+(this.props.output_supportsPublicKey?":"+this.state.withdraw_publicKey:"")+(this.state.memo?":"+new Y(this.state.memo,"utf-8"):""),null,t?t.asset_id:s),this.setState({empty_withdraw_value:!1})}else this.setState({empty_withdraw_value:!0});else this.showConfirmationModal()}onSubmitConfirmation(){if(this.hideConfirmationModal(),D(this.props.output_wallet_type)){let e=k(this.props.output_wallet_type);-1==e.indexOf(this.state.withdraw_address)&&(e.push(this.state.withdraw_address),T({wallet:this.props.output_wallet_type,addresses:e}))}else{let e=[];e.push(this.state.withdraw_address),T({wallet:this.props.output_wallet_type,addresses:e})}z({wallet:this.props.output_wallet_type,address:this.state.withdraw_address});let e=this.props.asset,t=r.Z.get_asset_precision(e.get("precision")),s=String.prototype.replace.call(this.state.withdraw_amount,/,/g,"");const{feeAmount:i,fee_asset_id:a}=this.state;A.Z.transfer(this.props.account.get("id"),this.props.issuer.get("id"),parseInt(s*t,10),e.get("id"),this.props.output_coin_type+":"+this.state.withdraw_address+(this.props.output_supportsPublicKey?":"+this.state.withdraw_publicKey:"")+(this.state.memo?":"+new Y(this.state.memo,"utf-8"):""),null,i?i.asset_id:a)}onDropDownList(){D(this.props.output_wallet_type)&&(!1===this.state.options_is_valid&&(this.setState({options_is_valid:!0}),this.setState({withdraw_address_first:!1})),!0===this.state.options_is_valid&&this.setState({options_is_valid:!1}))}getWithdrawModalId(){return"confirmation"}onAccountBalance(){const{feeAmount:e}=this.state;if(Object.keys(this.props.account.get("balances").toJS()).includes(this.props.asset.get("id"))){let t=new R.xR({amount:this.props.balance.get("balance"),asset_id:this.props.asset.get("id"),precision:this.props.asset.get("precision")});t.asset_id===e.asset_id&&t.minus(e),this.setState({withdraw_amount:t.getAmount({real:!0}),empty_withdraw_value:!1},this._checkBalance)}}setNestedRef(e){this.nestedRef=e}onFeeChanged({asset:e}){this.setState({fee_asset_id:e.get("id")},this._updateFee)}_getAvailableAssets(e=this.state){const{from_account:t,feeStatus:s}=e;let i=[];if(!t||!t.get("balances"))return{fee_asset_types:i};let a=e.from_account.get("balances").toJS();i=Object.keys(a).sort(r.Z.sortID);for(let e in a){let t=y.ChainStore.getObject(e),s=y.ChainStore.getObject(a[e]);if(s&&0===s.get("balance")&&-1!==i.indexOf(e)&&i.splice(i.indexOf(e),1),t){let s,a=!1;try{s=new R.tA({base:new R.xR(t.getIn(["options","core_exchange_rate","base"]).toJS()),quote:new R.xR(t.getIn(["options","core_exchange_rate","quote"]).toJS())}),a=s.isValid()}catch(e){a=!1}"1.3.0"===t.get("id")||a||i.splice(i.indexOf(e),1)}}return i=i.filter((e=>{return(void 0===s[t=e]||s[t]&&s[t].hasPoolBalance)&&function(e){return void 0===s[e]||s[e]&&s[e].hasBalance}(e);var t})),{fee_asset_types:i}}render(){let{withdraw_address_selected:e,withdraw_publicKey:t,memo:s}=this.state,a=k(this.props.output_wallet_type),n=null,o=this.props.account.get("balances").toJS(),l=Object.keys(o),d=(this.getWithdrawModalId(),null),p=null,m=null;this.state.options_is_valid&&(p=i.createElement("div",{className:a.length?"rudex-options":"rudex-disabled-options"},a.map((function(e,t){return i.createElement("a",{key:t,onClick:this.onSelectChanged.bind(this,t)},e)}),this))),!this.state.withdraw_address_check_in_progress&&this.state.withdraw_address&&this.state.withdraw_address.length&&(this.state.withdraw_address_is_valid||(d=i.createElement("div",{className:"has-error",style:{paddingTop:10}},i.createElement(c(),{content:"gateway.valid_address",coin_type:this.props.description})),m=i.createElement(P.Modal,{closable:!1,footer:[i.createElement(P.Button,{key:"submit",type:"primary",onClick:this.onSubmitConfirmation.bind(this)},N().translate("modal.confirmation.accept")),i.createElement(P.Button,{key:"cancel",style:{marginLeft:"8px"},onClick:this.hideConfirmationModal},N().translate("modal.confirmation.cancel"))],visible:this.state.isConfirmationModalVisible,onCancel:this.hideConfirmationModal},i.createElement("label",null,i.createElement(c(),{content:"modal.confirmation.title"})))));let u=1,h=null;this.props.output_supports_memos&&(h=i.createElement("div",{className:"content-block"},i.createElement("label",null,i.createElement(c(),{component:"span",content:"transfer.memo"})),i.createElement("textarea",{rows:"3",value:s,tabIndex:u++,onChange:this.onMemoChanged.bind(this)})));let{fee_asset_types:g}=this._getAvailableAssets();if(l.length>0){let e=this.props.asset.get("id");if(e){let t=o[e];n=i.createElement("span",{style:{borderBottom:"#A09F9F 1px dotted",cursor:"pointer"}},i.createElement(c(),{component:"span",content:"transfer.available"})," : ",i.createElement("span",{className:"set-cursor",onClick:this.onAccountBalance.bind(this)},t?i.createElement(L.Z,{balance:o[e]}):0))}else n="No funds"}else n="No funds";return i.createElement("form",{className:"grid-block vertical full-width-content",style:{paddingTop:"0px"}},i.createElement("div",{className:"grid-container"},i.createElement("div",{className:"content-block"},i.createElement(v.Z,{label:"modal.withdraw.amount",amount:this.state.withdraw_amount,asset:this.props.asset.get("id"),assets:[this.props.asset.get("id")],placeholder:"0.0",onChange:this.onWithdrawAmountChange.bind(this),display_balance:n}),this.state.empty_withdraw_value?i.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},i.createElement(c(),{content:"transfer.errors.valid"})):null,this.state.balanceError?i.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},i.createElement(c(),{content:"transfer.errors.insufficient"})):null,this.state.minAmountError?i.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},i.createElement(c(),{content:"gateway.rudex.min_amount_error"})):null,i.createElement("p",{className:"no-margin",style:{paddingTop:10}},i.createElement("b",null,i.createElement(c(),{content:"gateway.rudex.min_amount",minamount:r.Z.format_number(this.props.min_amount/r.Z.get_asset_precision(this.props.asset_precision),this.props.asset_precision,!1),symbol:this.props.output_coin_symbol})))),this.state.feeAmount?i.createElement("div",{className:"content-block gate_fee"},i.createElement(v.Z,{refCallback:this.setNestedRef.bind(this),disabled:!0,amount:this.state.feeAmount.getAmount({real:!0}),onChange:this.onFeeChanged.bind(this),asset:this.state.feeAmount.asset_id,assets:g,tabIndex:u++}),this.state.hasBalance?null:i.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},i.createElement(c(),{content:"transfer.errors.noFeeBalance"})),this.state.hasPoolBalance?null:i.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},i.createElement(c(),{content:"transfer.errors.noPoolBalance"}))):null,this.props.gateFee?i.createElement("div",{className:"amount-selector right-selector",style:{paddingBottom:20}},i.createElement("label",{className:"left-label"},i.createElement(c(),{content:"gateway.fee"})),i.createElement("div",{className:"inline-label input-wrapper"},i.createElement("input",{type:"text",disabled:!0,value:this.props.gateFee}),i.createElement("div",{className:"form-label select floating-dropdown"},i.createElement("div",{className:"dropdown-wrapper inactive"},i.createElement("div",null,this.props.output_coin_symbol))))):null,i.createElement("div",{className:"content-block"},i.createElement("label",{className:"left-label"},i.createElement(c(),{component:"span",content:"modal.withdraw.address",amount:r.Z.format_number((this.state.withdraw_amount-this.props.gateFee)*Math.pow(10,this.props.asset_precision)/r.Z.get_asset_precision(this.props.asset_precision),this.props.asset_precision,!1),asset:this.props.output_coin_symbol})),i.createElement("div",{className:"rudex-select-dropdown"},i.createElement("div",{className:"inline-label"},i.createElement("input",{type:"text",value:e,tabIndex:"4",onChange:this.onWithdrawAddressChanged.bind(this),autoComplete:"off"}),i.createElement("span",{onClick:this.onDropDownList.bind(this)},"▼"))),i.createElement("div",{className:"rudex-position-options"},p),d),this.props.output_supportsPublicKey?i.createElement("div",{className:"content-block"},i.createElement("label",{className:"left-label"},i.createElement(c(),{component:"span",content:"modal.withdraw.public_key"})),i.createElement("div",{className:"rudex-select-dropdown"},i.createElement("div",{className:"inline-label"},i.createElement("input",{type:"text",value:t,tabIndex:"5",onChange:this.onWithdrawPublicKeyChanged.bind(this),onInput:this.onWithdrawPublicKeyChanged.bind(this),autoComplete:"off"})))):null,h,i.createElement("div",null,i.createElement(P.Button,{disabled:this.state.error||this.state.balanceError||this.state.minAmountError||!this.state.withdraw_publicKey_not_empty,type:"primary",onClick:this.onSubmit.bind(this)},N().translate("modal.withdraw.submit")),i.createElement(P.Button,{onClick:this.props.hideModal,style:{marginLeft:"8px"}},N().translate("account.perm.cancel"))),m))}}B=(0,p.Z)(B);const U=(0,a.$)(B,{listenTo:()=>[h.Z],getProps:e=>({fee_asset_symbol:h.Z.getState().settings.get("fee_asset")})});var W=s(99349);class G extends i.Component{static propTypes={account:d.Z.ChainAccount.isRequired,asset:d.Z.ChainAsset.isRequired};static defaultProps={autosubscribe:!1};render(){let e=this.props.asset.get("id"),t=this.props.account.getIn(["balances",e]);return t?i.createElement(L.Z,{balance:t,replace:this.props.replace}):i.createElement("span",null,"0 ",i.createElement(W.Z,{name:this.props.asset.get("symbol"),replace:this.props.replace}))}}const Q=(0,p.Z)(G);var F=s(41928),K=s(3841),V=s(74855),H=s.n(V),J=s(23316),X=s(79361),q=s.n(X);class $ extends i.Component{static propTypes={gateway:C().string,deposit_coin_type:C().string,deposit_asset_name:C().string,deposit_account:C().string,receive_coin_type:C().string,account:d.Z.ChainAccount,issuer_account:d.Z.ChainAccount,deposit_asset:C().string,deposit_wallet_type:C().string,description:C().string,receive_asset:d.Z.ChainAsset,deprecated_in_favor_of:d.Z.ChainAsset,deprecated_message:C().string,action:C().string,supports_output_memos:C().bool.isRequired,supportsPublicKey:C().bool.isRequired,memoType:C().string,min_amount:C().number,gateFee:C().number,confirmations:C().object,asset_precision:C().number};constructor(e){super(e),this.deposit_address_cache=new F.Z,this.state={isQrModalVisible:!1,qrcode:"",isModalVisible:!1,receive_address:null,account_name:null},this.addDepositAddress=this.addDepositAddress.bind(this),this.showModal=this.showModal.bind(this),this.hideModal=this.hideModal.bind(this),this.showQrModal=this.showQrModal.bind(this),this.hideQrModal=this.hideQrModal.bind(this)}showModal(){this.setState({isModalVisible:!0})}hideModal(){this.setState({isModalVisible:!1})}onShowQrcode(e){this.setState({qrcode:e},(()=>{this.showQrModal()}))}showQrModal(){this.setState({isQrModalVisible:!0})}hideQrModal(){this.setState({isQrModalVisible:!1})}_getDepositObject(){return{walletType:this.props.deposit_wallet_type,inputCoinType:this.props.deposit_coin_type,outputCoinType:this.props.receive_coin_type,outputAddress:this.props.account.get("name"),stateCallback:this.addDepositAddress}}_notify(e){let t="copy_address";"memo"==e&&(t="copy_memo"),P.Notification.success({message:N().translate("account.notify."+t)})}addDepositAddress(e){let t=this.props.account.get("name");this.deposit_address_cache.cacheInputAddress(this.props.gateway,t,this.props.deposit_coin_type,this.props.receive_coin_type,e.address,e.memo),this.setState({account_name:t}),this.setState({receive_address:e})}getWithdrawModalId(){return"withdraw_asset_"+this.props.issuer_account.get("name")+"_"+this.props.receive_asset.get("symbol")}onWithdraw(){this.showModal()}render(){let e=i.createElement("div",{style:{display:"none",minHeight:150}});if(!this.props.account||!this.props.issuer_account||!this.props.receive_asset)return e;let t=this.props.account.get("balances");if(this.props.deprecated_in_favor_of){let s=!1,i=t.get(this.props.receive_asset.get("id"));if(i){let e=y.ChainStore.getObject(i);e&&0!=e.get("balance")&&(s=!0)}if(!s)return e}let s=this.state.receive_address;if(this.state.account_name===this.props.account.get("name")){let e=this.props.account.get("name"),t=this.deposit_address_cache.getCachedInputAddress(this.props.gateway,e,this.props.deposit_coin_type,this.props.receive_coin_type);void 0!==t&&(s=t)}else if(!this.props.supports_output_memos)return S(this._getDepositObject()),e;let a=this.state.qrcode,n=null;this.props.confirmations&&this.props.confirmations.type&&("irreversible"===this.props.confirmations.type?n=i.createElement(c(),{content:"gateway.gateway_deposit.confirmations.last_irreversible"}):"blocks"===this.props.confirmations.type&&this.props.confirmations.value&&(n=i.createElement(c(),{content:"gateway.gateway_deposit.confirmations.n_blocks",blocks:this.props.confirmations.value})));let o,l,d=this.getWithdrawModalId(),p=null,m=null,u="";if(J.bg.RUDEX.simpleAssetGateway&&this.props.deposit_account)p=i.createElement("span",null,this.props.deposit_account),u=this.props.deposit_account,o=this.props.memoType&&"btsid"===this.props.memoType?J.bg.RUDEX.fixedMemo.prepend_btsid+this.props.account.get("id").replace("1.2.","")+J.bg.RUDEX.fixedMemo.append:J.bg.RUDEX.fixedMemo.prepend_default+this.props.account.get("name")+J.bg.RUDEX.fixedMemo.append,m=i.createElement("span",null,o),l=this.props.deposit_coin_type+":";else{if(!(s&&s.address||this.props.supports_output_memos))return S(this._getDepositObject()),e;s.memo?(o=s.memo,u=s.address,p=i.createElement("span",null,s.address),m=i.createElement("span",null,s.memo)):(u=s.address,p=i.createElement("span",{style:{wordBreak:"break-word",lineHeight:"1.5em",marginTop:"15px",display:"block"}},s.address)),l=""}return"deposit"===this.props.action?i.createElement("div",{className:"rudex__gateway grid-block no-padding no-margin"},i.createElement("div",{className:"small-12 medium-5"},i.createElement(c(),{component:"h4",content:"gateway.deposit_summary"}),i.createElement("div",{className:"small-12 medium-10"},i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_deposit"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},this.props.deposit_asset)),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_receive"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(W.Z,{name:this.props.receive_asset.get("symbol"),replace:!1}))),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.intermediate"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(K.Z,{account:this.props.issuer_account.get("id")}))),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.your_account"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(K.Z,{account:this.props.account.get("id")}))),i.createElement("tr",null,i.createElement("td",null,i.createElement(c(),{content:"gateway.balance"}),":"),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(Q,{account:this.props.account.get("name"),asset:this.props.receive_asset.get("symbol"),replace:!1}))))))),1==this.props.depositAllowed?i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.deposit_inst"}),i.createElement("label",{className:"left-label"},i.createElement(c(),{content:"gateway.deposit_to",asset:this.props.description}),":"),i.createElement("label",{className:"left-label"},i.createElement("b",null,i.createElement(c(),{content:"gateway.rudex.min_amount",minamount:r.Z.format_number(this.props.min_amount/r.Z.get_asset_precision(this.props.asset_precision),this.props.asset_precision,!1),symbol:this.props.deposit_coin_type}))),i.createElement("label",{className:"left-label"},i.createElement("b",null,i.createElement(c(),{content:"gateway.rudex.min_amount_warn",minamount:r.Z.format_number(this.props.min_amount/r.Z.get_asset_precision(this.props.asset_precision),this.props.asset_precision,!1),symbol:this.props.deposit_coin_type}))),n?i.createElement("span",null,"(",i.createElement("i",null,n),")"):null,i.createElement("div",{style:{padding:"10px 0",fontSize:"1.1rem"}},i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement("td",null,"ADDRESS:"," ",i.createElement("b",null,i.createElement(b,{replaceCopyText:N().translate("gateway.use_copy_button")},p))),i.createElement("td",null,i.createElement("div",{className:"button",onClick:this.onShowQrcode.bind(this,u)},i.createElement(c(),{content:"modal.qrcode.label"})))),m?i.createElement("tr",null,i.createElement("td",null,i.createElement(b,{replaceCopyText:N().translate("gateway.use_copy_button")},"MEMO:"," ",i.createElement("b",null,m))),i.createElement("td",null,i.createElement("div",{className:"button",onClick:this.onShowQrcode.bind(this,o)},i.createElement(c(),{content:"modal.qrcode.label"})))):null),i.createElement(P.Modal,{footer:[i.createElement(P.Button,{key:"close",type:"primary",onClick:this.hideQrModal},N().translate("modal.close"))],visible:this.state.isQrModalVisible,onCancel:this.hideQrModal},i.createElement(ee,{text:a}))),i.createElement("div",{className:"button-group",style:{paddingTop:10}},p?i.createElement(H(),{text:u,onCopy:()=>this._notify("address")},i.createElement("div",{className:"button"},"Copy address")):null,o?i.createElement(H(),{text:o,onCopy:()=>this._notify("memo")},i.createElement("div",{className:"button"},"Copy memo")):null))):i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.rudex.under_construction"}))):i.createElement("div",{className:"rudex__gateway grid-block no-padding no-margin"},i.createElement("div",{className:"small-12 medium-5"},i.createElement(c(),{component:"h4",content:"gateway.withdraw_summary"}),i.createElement("div",{className:"small-12 medium-10"},i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_withdraw"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(W.Z,{name:this.props.receive_asset.get("symbol"),replace:!1}))),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_receive"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},this.props.deposit_asset)),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.intermediate"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(K.Z,{account:this.props.issuer_account.get("id")}))),i.createElement("tr",null,i.createElement("td",null,i.createElement(c(),{content:"gateway.balance"}),":"),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(Q,{account:this.props.account.get("name"),asset:this.props.receive_asset.get("symbol"),replace:!1}))))))),1==this.props.withdrawalAllowed?i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.withdraw_inst"}),i.createElement("label",{className:"left-label"},i.createElement(c(),{content:"gateway.withdraw_to",asset:this.props.description}),":"),i.createElement("div",{className:"button-group",style:{paddingTop:20}},i.createElement("button",{className:"button success",style:{fontSize:"1.3rem"},onClick:this.onWithdraw.bind(this)},i.createElement(c(),{content:"gateway.withdraw_now"})," "))):i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.rudex.under_construction"})),";",i.createElement(P.Modal,{onCancel:this.hideModal,title:N().translate("gateway.withdraw_coin",{coin:this.props.deposit_asset_name,symbol:this.props.deposit_asset}),footer:null,visible:this.state.isModalVisible},i.createElement(U,{hideModal:this.hideModal,showModal:this.showModal,account:this.props.account.get("name"),issuer:this.props.issuer_account.get("name"),asset:this.props.receive_asset.get("symbol"),output_coin_name:this.props.deposit_asset_name,output_coin_symbol:this.props.deposit_asset,output_coin_type:this.props.deposit_coin_type,output_wallet_type:this.props.deposit_wallet_type,description:this.props.description,output_supports_memos:this.props.supports_output_memos,output_supportsPublicKey:this.props.supportsPublicKey,memo_prefix:l,modal_id:d,min_amount:this.props.min_amount,gateFee:this.props.gateFee,asset_precision:this.props.asset_precision,balance:this.props.account.get("balances").toJS()[this.props.receive_asset.get("id")]})))}}class ee extends i.Component{constructor(e){super(e)}render(){let e=this.props.text;return i.createElement("div",{className:"small-12",style:{textAlign:"center"}},i.createElement(q(),{size:200,value:e}),i.createElement("br",null),i.createElement("br",null),i.createElement("label",{style:{textTransform:"none"}},e))}}const te=(0,p.Z)($);var se=s(3894),ie=s(32049),ae=s(43393),ne=s.n(ae),oe=(s(94184),s(52531)),re=s(43129);class le extends i.Component{constructor(e){super(e),this.state={activeCoin:this._getActiveCoin(e,{action:e.viewSettings.get("rudexAction")||"deposit"}),action:e.viewSettings.get("rudexAction")||"deposit"}}_getActiveCoin(e,t){let s,i,a;return s=e.viewSettings.get("activeCoin_rudex_"+e.network,null),i=e.coins[0].name,a=s||i,"withdraw"===t.action&&(a=this._findCoinByName(e,a).symbol),a}UNSAFE_componentWillReceiveProps(e){e.provider!==this.props.provider&&this.setState({activeCoin:this._getActiveCoin(e,this.state)}),e.network!==this.props.network&&this.setState({activeCoin:this._getActiveCoin(e,this.state)})}onSelectCoin(e){this.setState({activeCoin:e.value});let t={},s=e.value;"withdraw"===this.state.action&&(s=this._findCoinBySymbol(this.props,s).backingCoin),t["activeCoin_rudex_"+this.props.network]=s,g.Z.changeViewSetting(t)}_findCoinByName(e,t){for(let s=0;s<e.coins.length;s++){let i=e.coins[s];if(i.backingCoin.toUpperCase()===t)return i}return e.coins[0]}_findCoinBySymbol(e,t){for(let s=0;s<e.coins.length;s++){let i=e.coins[s];if(i.symbol.toUpperCase()===t)return i}return null}changeAction(e){let t=this._getActiveCoin(this.props,{action:e});this.setState({action:e,activeCoin:t}),g.Z.changeViewSetting({rudexAction:e})}render(){let{coins:e,account:t}=this.props,{activeCoin:s,action:a}=this.state;if(!e.length)return i.createElement(oe.Z,null);let n=e.filter((e=>!(!e||!e.symbol))),o=n.map((e=>{let t="deposit"===a?e.backingCoin.toUpperCase():e.symbol,s=t.replace("RUDEX.","");return{value:t,label:i.createElement("div",null,i.createElement(se.Z,{replaceNoneToBts:!1,maxWidth:30,name:"RUDEX."+s}),t.replace("RUDEX.",""))}})).filter((e=>null!==e)),r=n.filter((e=>"deposit"===a?e.backingCoin.toUpperCase()===s:e.symbol===s))[0];r||(r=n[0]);let l="deposit"===this.state.action,d="https://rudex.freshdesk.com";return i.createElement("div",{style:this.props.style},i.createElement("div",{className:"grid-block no-margin vertical medium-horizontal no-padding"},i.createElement("div",{className:"medium-4"},i.createElement("div",null,i.createElement("label",{style:{minHeight:"2rem"},className:"left-label"},i.createElement(c(),{content:"gateway.choose_"+a}),":"," "),i.createElement(re.ZP,{onChange:this.onSelectCoin.bind(this),clearable:!1,searchable:!1,value:s,options:o}))),i.createElement("div",{className:"medium-6 medium-offset-1"},i.createElement("label",{style:{minHeight:"2rem"},className:"left-label"},i.createElement(c(),{content:"gateway.gateway_text"}),":"),i.createElement("div",{style:{paddingBottom:15}},i.createElement("ul",{className:"button-group segmented no-margin"},i.createElement("li",{className:"deposit"===a?"is-active":""},i.createElement("a",{onClick:this.changeAction.bind(this,"deposit")},i.createElement(c(),{content:"gateway.deposit"}))),i.createElement("li",{className:"withdraw"===a?"is-active":""},i.createElement("a",{onClick:this.changeAction.bind(this,"withdraw")},i.createElement(c(),{content:"gateway.withdraw"}))))))),r?i.createElement("div",null,i.createElement("div",{style:{marginBottom:15}},i.createElement(te,{key:`${r.symbol}`,gateway:"rudex",issuer_account:r.issuer,account:t,deposit_asset:r.backingCoin.toUpperCase(),deposit_asset_name:r.name,deposit_coin_type:r.backingCoin.toLowerCase(),deposit_account:r.gatewayWallet,deposit_wallet_type:r.walletType,depositAllowed:r.depositAllowed,withdrawalAllowed:r.withdrawalAllowed,description:r.description,receive_asset:r.symbol,receive_coin_type:r.symbol.toLowerCase(),supports_output_memos:r.supportsMemos,supportsPublicKey:r.supportsPublicKey||!1,memoType:r.memoType,min_amount:r.minAmount,gateFee:r.gateFee,asset_precision:r.precision,confirmations:r.confirmations,action:this.state.action}),i.createElement("label",{className:"left-label"},"Support"),i.createElement("div",null,i.createElement(c(),{content:"gateway.rudex.support_block"}),i.createElement("br",null),i.createElement("br",null),i.createElement("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"external-link"},d))),r&&r.symbol?i.createElement(ie.k,{asset:r.symbol,fromAccount:l?r.issuerId:this.props.account.get("id"),to:l?this.props.account.get("id"):r.issuerId},(({asset:e,to:t,fromAccount:s})=>i.createElement(ie.t,{accountsList:ne().List([this.props.account.get("id")]),limit:10,compactView:!0,fullHeight:!0,filter:"transfer",title:i.createElement(c(),{content:"gateway.recent_"+this.state.action}),customFilter:{fields:["to","from","asset_id"],values:{to:t.get("id"),from:s.get("id"),asset_id:e.get("id")}}}))):null):null)}}const ce=(0,a.$)(le,{listenTo:()=>[h.Z],getProps:()=>({viewSettings:h.Z.getState().viewSettings})});class de extends i.Component{constructor(e){super()}render(){let{title:e,payment_id:t}=this.props,s="";return s=this.props.active.toLowerCase()==this.props.payment_id.toLowerCase()?"active":"",i.createElement("div",{className:"ant-col-8"},i.createElement("label",{className:"btn btn-sm btn-radio "+s},i.createElement("input",{name:"paymentmethod-"+t,type:"radio",onClick:this.props.onClick()}),e,i.createElement("img",{src:"images/raido-payment-"+t+".png"})))}}const pe=de;class me extends i.Component{static propTypes={gateway:C().string,deposit_coin_type:C().string,deposit_asset_name:C().string,deposit_account:C().string,receive_coin_type:C().string,account:d.Z.ChainAccount,issuer_account:d.Z.ChainAccount,deposit_asset:C().string,receive_asset:d.Z.ChainAsset,deprecated_in_favor_of:d.Z.ChainAsset,action:C().string,min_amount:C().number,confirmations:C().object};constructor(e){super(e),this.deposit_address_cache=new F.Z,this.state={account_name:null,receive_address:{address:null,memo:null},submitAllowed:!1,min_max_validate:{valid:!1,direct:"min"},getAmount:0,giveAmount:0,raido:{affiliate_id:10058,give_raw:this.props.activePaymentMethod,give:this.props.activePaymentMethod,give_decimal:5,get:this.props.deposit_asset_name,get_decimal:5,price:1,in:null,out:null,in_min_fee:0,withdraw_fee:0,in_fee:0,commission:0,min_deposit:0,max_deposit:1e6,direction:"buy",currencies:[],prices:[]}},this.addDepositAddress=this.addDepositAddress.bind(this),this._makeUriRaido=this._makeUriRaido.bind(this),this._setCoinsRaido=this._setCoinsRaido.bind(this),this._setPricesRaido=this._setPricesRaido.bind(this),this._initPrices=this._initPrices.bind(this),this.handleChange=this.handleChange.bind(this),this.handlePaymentMethod=this.handlePaymentMethod.bind(this),this.initCurrencies(this._setCoinsRaido)}initCurrencies(e){fetch("https://merchant-datacenter.raidofinance.eu:8095/currencies/",{method:"get",headers:new Headers({Accept:"application/json"})}).then((t=>{t.json().then((t=>{e&&e(t.data)}))})).catch((e=>{console.log("fetch error:",e)}))}_setCoinsRaido(e){e=e.rows;let t=this.props.deposit_asset_name,s=this.state.raido;for(let i=0;i<e.length;i++)e[i].code===t&&(console.log("withdraw_fee: "+1*e[i].withdraw_fee),s.give=this.state.raido.give,s.get=e[i].code,s.currencies=e,s.out=e[i].id,s.min_deposit=e[i].min_deposit,s.max_deposit=e[i].max_deposit,s.withdraw_fee=1*e[i].withdraw_fee,s.give_decimal=e[i].decimal,this.setState({raido:s}));this._initPrices(this._setPricesRaido)}_initPrices(e){fetch("https://merchant-datacenter.raidofinance.eu:8095/prices/",{method:"get",headers:new Headers({Accept:"application/json"})}).then((t=>{t.json().then((t=>{e&&e(t.data)}))})).catch((e=>{console.log("fetch error:",e)}))}_setPricesRaido(e){let t=this.state.raido,s=t.currencies;for(let e=0;e<s.length;e++)s[e].code===t.give_raw&&(t.commission=parseFloat(s[e].commission),t.in_fee=parseFloat(s[e].in_fee),t.in_min_fee=parseFloat(s[e].in_min_fee),t.get_decimal=s[e].decimal,t.give=s[e].cur,t.in=s[e].id,this.setState({raido:t}));let i=t.get+""+t.give,a=t.direction,n=e[i][a];console.log("price: "+n),n&&(t.price=1*n,t.prices=e,this.setState({raido:t})),this.handleChange("auto")}handleChange(e,t){let s,i;if("auto"!==e?(s=t.target.name,i=t.target.value):(s="getAmount",i=this.state.getAmount),""===i||0===i)return this.setState({getAmount:""}),void this.setState({giveAmount:""});i*=1;let a,n=this.state.raido;if("giveAmount"===s){a=i/(n.price/((100-(n.commission+n.in_fee))/100));let e=i;this.setState({getAmount:Math.ceil((a-n.withdraw_fee)*Math.pow(10,n.give_decimal))/Math.pow(10,n.give_decimal)}),this.setState({giveAmount:Math.ceil(e*Math.pow(10,n.get_decimal))/Math.pow(10,n.get_decimal)})}else if("getAmount"===s){a=i;let e=n.price*(i+n.withdraw_fee)/((100-(n.commission+n.in_fee))/100)+n.in_min_fee;this.setState({getAmount:Math.ceil(a*Math.pow(10,n.give_decimal))/Math.pow(10,n.give_decimal)}),this.setState({giveAmount:Math.ceil(e*Math.pow(10,n.get_decimal))/Math.pow(10,n.get_decimal)})}a>=n.min_deposit&&(0==n.max_deposit||a<=n.max_deposit)?(this.setState({min_max_validate:{valid:!0,direct:"min"}}),this.setState({submitAllowed:!0})):(a>=n.min_deposit?this.setState({min_max_validate:{valid:!1,direct:"max"}}):this.setState({min_max_validate:{valid:!1,direct:"min"}}),this.setState({submitAllowed:!1}))}shouldComponentUpdate(e,t){return t.raido!==this.state.raido||e.deposit_coin_type!==this.props.getAmount||t.getAmount!==this.state.getAmount||t.giveAmount!==this.state.giveAmount||e.receive_asset!==this.props.receive_asset||e.deposit_asset_name!==this.props.deposit_asset_name||e.action!==this.props.action||e.currentLocale!==this.props.currentLocale}handlePaymentMethod(e){let t=e.target.name,s="paymentmethod";t=t.substr(s.length+1,t.length-s.length).toUpperCase();let i=this.state.raido;i.give_raw=t,this.setState({raido:i}),this._setPricesRaido(this.state.raido.prices);let a=document.querySelectorAll("label.btn-radio");for(var n=0;n<a.length;n++)a[n].classList.remove("active");e.currentTarget.parentNode.classList.add("active"),this.props.setActiveRaidoCoin(t)}_getDepositObject(){return{inputCoinType:this.props.deposit_coin_type,outputCoinType:this.props.receive_coin_type,outputAddress:this.props.account.get("name"),stateCallback:this.addDepositAddress}}addDepositAddress(e){let t=this.props.account.get("name");this.deposit_address_cache.cacheInputAddress(this.props.gateway,t,this.props.deposit_coin_type,this.props.receive_coin_type,e.address,e.memo),this.setState({account_name:t}),this.setState({receive_address:e})}_makeUriRaido(){let e="",t=this.state.raido,s=this.state.receive_address,i={affiliate_id:t.affiliate_id,offer_id:3,volume:this.state.giveAmount,in:t.in,out:t.out,"out-p":s.address,direction:t.direction};for(let t in i)e+="&"+t+"="+i[t];return e}onSubmitRequest(e){e.preventDefault(),this.setState({error:null});let t="https://raidofinance.eu/buy-sell?"+this._makeUriRaido();window.open(t,"_blank")}render(){let e=i.createElement("div",{style:{display:"none",minHeight:150}});if(!this.props.account||!this.props.issuer_account||!this.props.receive_asset)return e;let t=this.props.account.get("balances");if(this.props.deprecated_in_favor_of){let s=!1,i=t.get(this.props.receive_asset.get("id"));if(i){let e=y.ChainStore.getObject(i);e&&0!=e.get("balance")&&(s=!0)}if(!s)return e}let s=this.state.receive_address;if(this.state.account_name===this.props.account.get("name")){let e=this.props.account.get("name"),t=this.deposit_address_cache.getCachedInputAddress(this.props.gateway,e,this.props.deposit_coin_type,this.props.receive_coin_type);void 0!==t&&(s=t)}else if(!this.props.supports_output_memos)return S(this._getDepositObject()),e;let a=null;this.props.confirmations&&this.props.confirmations.type&&("irreversible"===this.props.confirmations.type?a=i.createElement(c(),{content:"gateway.gateway_deposit.confirmations.last_irreversible"}):"blocks"===this.props.confirmations.type&&this.props.confirmations.value&&(a=i.createElement(c(),{content:"gateway.gateway_deposit.confirmations.n_blocks",blocks:this.props.confirmations.value})));let n=null;if(J.bg.RUDEX.simpleAssetGateway&&this.props.deposit_account)n=i.createElement("span",null,this.props.deposit_account);else{if(!(s&&s.address||this.props.supportsMemos))return S(this._getDepositObject()),e;s.memo,n=i.createElement("span",null,s.address)}return"deposit"===this.props.action?i.createElement("div",{className:"rudex__gateway grid-block no-padding no-margin"},i.createElement("div",{className:"small-12 medium-5"},i.createElement(c(),{component:"h4",content:"gateway.rudex.buy_crypto.deposit_summary"}),i.createElement("div",{className:"small-12 medium-10"},i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.your_account"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(K.Z,{account:this.props.account.get("id")}))),i.createElement("tr",null,i.createElement("td",null,i.createElement(c(),{content:"gateway.balance"}),":"),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(Q,{account:this.props.account.get("name"),asset:this.props.receive_asset.get("symbol"),replace:!1}))))))),i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.rudex.buy_crypto.buy_inst"}),i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement("td",null,"ADDRESS:"," ",i.createElement("b",null,n))),i.createElement("tr",null,i.createElement("td",null,a?i.createElement("span",null,"(",i.createElement("i",null,a),")"):null)))),i.createElement("div",{style:{padding:"10px 0",fontSize:"1.1rem"}},i.createElement("div",{className:"ant-col-24 raido"},i.createElement("div",{className:"ant-col-24",style:{margin:"20px 0"}},i.createElement(pe,{payment_id:"cardu",title:"Bank Card (USD)",active:this.state.raido.give_raw,onClick:()=>this.handlePaymentMethod}),i.createElement(pe,{payment_id:"carde",title:"Bank Card (EUR)",active:this.state.raido.give_raw,onClick:()=>this.handlePaymentMethod}),i.createElement(pe,{payment_id:"wiree",title:"Sepa (EUR)",active:this.state.raido.give_raw,onClick:()=>this.handlePaymentMethod})),i.createElement("div",{className:"ant-col-10 give"},i.createElement(c(),{content:"gateway.rudex.buy_crypto.you_give"}),i.createElement("input",{name:"giveAmount",type:"number",value:this.state.giveAmount,onChange:this.handleChange.bind(this,"giveAmount"),placeholder:N().translate("gateway.rudex.buy_crypto.you_give_placeholder"),style:{backgroundImage:`url(images/raido-payment-${this.state.raido.give_raw.toLowerCase()}.png)`}})),i.createElement("div",{className:"ant-col-10 get",style:{marginLeft:"10%"}},i.createElement(c(),{content:"gateway.rudex.buy_crypto.you_get"}),i.createElement("input",{name:"getAmount",type:"number",value:this.state.getAmount,onChange:this.handleChange.bind(this,"getAmount"),placeholder:N().translate("gateway.rudex.buy_crypto.you_get_placeholder"),style:{backgroundImage:`url(asset-symbols/rudex.${this.state.raido.get.toLowerCase()}.png)`}}),i.createElement("span",{className:this.state.min_max_validate.valid?"raido_min_max_validate":"raido_min_max_validate active"},i.createElement(c(),{content:"gateway.rudex.buy_crypto."+this.state.min_max_validate.direct+"_amount"}),1*this.state.raido[this.state.min_max_validate.direct+"_deposit"]," ",this.state.raido.get)),i.createElement("div",{className:"ant-col-24"},i.createElement("div",{className:"raido_text_block"},i.createElement(c(),{content:"gateway.rudex.buy_crypto.withdraw_fee_included",withdraw_fee:this.state.raido.withdraw_fee,asset:this.state.raido.get})),i.createElement("div",{className:"raido_text_block"},i.createElement(c(),{content:"gateway.rudex.buy_crypto.approximate_amount"})),i.createElement("div",{className:"raido_text_block"},i.createElement(c(),{content:"gateway.rudex.buy_crypto.final_text"}),i.createElement("b",null,this.props.account.get("name"))),i.createElement("div",{className:"ant-col-10 ant-col-offset-6"},i.createElement("button",{className:"button",disabled:!this.state.submitAllowed,onClick:this.state.submitAllowed?this.onSubmitRequest.bind(this):null,style:{marginTop:"15px",width:"100%"}},i.createElement(c(),{content:"gateway.rudex.buy_crypto.buy"})))))))):i.createElement("div",{className:"rudex__gateway grid-block no-padding no-margin"},i.createElement("div",{className:"small-12 medium-5"},i.createElement(c(),{component:"h4",content:"gateway.withdraw_summary"}),i.createElement("div",{className:"small-12 medium-10"},i.createElement("table",{className:"table"},i.createElement("tbody",null,i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_withdraw"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(W.Z,{name:this.props.receive_asset.get("symbol"),replace:!1}))),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.asset_to_receive"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},this.props.deposit_asset)),i.createElement("tr",null,i.createElement(c(),{component:"td",content:"gateway.intermediate"}),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(K.Z,{account:this.props.issuer_account.get("id")}))),i.createElement("tr",null,i.createElement("td",null,i.createElement(c(),{content:"gateway.balance"}),":"),i.createElement("td",{style:{fontWeight:"bold",color:"#049cce",textAlign:"right"}},i.createElement(Q,{account:this.props.account.get("name"),asset:this.props.receive_asset.get("symbol"),replace:!1}))))))),i.createElement("div",{className:"small-12 medium-7"},i.createElement(c(),{component:"h4",content:"gateway.withdraw_inst"}),i.createElement("label",{className:"left-label"},i.createElement(c(),{content:"gateway.withdraw_to",asset:this.props.deposit_asset}),":"),i.createElement("div",{className:"button-group",style:{paddingTop:20}})))}}const ue=(0,p.Z)(me);class he extends i.Component{constructor(e){super(),this.state={activeCoin:this._getActiveCoin(e,{action:"deposit"}),action:e.viewSettings.get("rudexActionRaido","deposit"),activePaymentMethod:"CARDE"},this._setActiveRaidoCoin=this._setActiveRaidoCoin.bind(this)}_setActiveRaidoCoin(e){this.setState({activePaymentMethod:e})}_getActiveCoin(e,t){let s,i,a;return s=e.viewSettings.get("activeCoin_Raido","deposit"),i=e.coins[0],a=s||i,a}UNSAFE_componentWillReceiveProps(e){e.provider!==this.props.provider&&this.setState({activeCoin:this._getActiveCoin(e,this.state)})}onSelectCoin(e){this.setState({activeCoin:e.value});let t={},s=e.value;"withdraw"===this.state.action&&(s=this._findCoinBySymbol(this.props,s).backingCoin),t.activeCoin_Raido=s,g.Z.changeViewSetting(t)}_findCoinByName(e,t){for(let s=0;s<e.coins.length;s++){let i=e.coins[s];if(i.backingCoin.toUpperCase()===t)return i}return e.coins[0]}_findCoinBySymbol(e,t){for(let s=0;s<e.coins.length;s++){let i=e.coins[s];if(i.symbol.toUpperCase()===t)return i}return null}changeAction(e){let t=this._getActiveCoin(this.props,{action:e});this.setState({action:e,activeCoin:t}),g.Z.changeViewSetting({rudexActionRaido:e})}render(){let{coins:e,account:t}=this.props,{activeCoin:s,action:a}=this.state;if(!e.length)return i.createElement(oe.Z,null);let n=e.filter((e=>!(!e||!e.symbol)&&("deposit"===a?e.depositAllowed:e.withdrawalAllowed))),o=n.map((e=>{let t="deposit"===a?e.backingCoin.toUpperCase():e.symbol,s=t.replace("RUDEX.",""),n="PPY"===s?"":"RUDEX.";return{value:t,label:i.createElement("div",null,i.createElement(se.Z,{replaceNoneToBts:!1,maxWidth:20,name:n+s}),t.replace("RUDEX.",""))}})).filter((e=>null!==e)),r=n.filter((e=>"deposit"===a?e.backingCoin.toUpperCase()===s:e.symbol===s))[0];r||(r=n[0]);let l="deposit"===this.state.action,d="https://rudex.freshdesk.com";return i.createElement("div",{style:this.props.style},i.createElement("div",{className:"grid-block no-margin vertical medium-horizontal no-padding"},i.createElement("div",{className:"medium-4"},i.createElement("div",null,i.createElement("label",{style:{minHeight:"2rem"},className:"left-label"},i.createElement(c(),{content:"gateway.rudex.buy_crypto.choose_"+a}),":"," "),i.createElement(re.ZP,{onChange:this.onSelectCoin.bind(this),clearable:!1,searchable:!1,value:s,options:o}))),i.createElement("div",{className:"medium-6 medium-offset-1"},i.createElement("label",{style:{minHeight:"2rem"},className:"left-label"}),i.createElement("div",{style:{paddingBottom:15}}))),r?i.createElement("div",null,i.createElement("div",{style:{marginBottom:15}},i.createElement(ue,{key:`${r.symbol}`,gateway:"rudex",issuer_account:r.issuer,account:t,deposit_asset:r.backingCoin.toUpperCase(),deposit_asset_name:r.name,deposit_coin_type:r.backingCoin.toLowerCase(),deposit_account:r.gatewayWallet,receive_asset:r.symbol,receive_coin_type:r.symbol.toLowerCase(),memoType:r.memoType,min_amount:r.minAmount,confirmations:r.confirmations,action:this.state.action,activePaymentMethod:this.state.activePaymentMethod,setActiveRaidoCoin:e=>this._setActiveRaidoCoin(e)}),i.createElement("label",{className:"left-label"},"Support"),i.createElement("div",null,i.createElement(c(),{content:"gateway.rudex.support_block"}),i.createElement("br",null),i.createElement("br",null),i.createElement("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"external-link"},d))),r&&r.symbol?i.createElement(ie.k,{asset:r.symbol,fromAccount:l?r.issuerId:this.props.account.get("id"),to:l?this.props.account.get("id"):r.issuerId},(({asset:e,to:t,fromAccount:s})=>i.createElement(ie.t,{accountsList:ne().List([this.props.account.get("id")]),limit:10,compactView:!0,fullHeight:!0,filter:"transfer",title:i.createElement(c(),{content:"gateway.recent_"+this.state.action}),customFilter:{fields:["to","from","asset_id"],values:{to:t.get("id"),from:s.get("id"),asset_id:e.get("id")}}}))):null):null)}}he.defaultProps={coins:[{name:"BTC",description:"Bitcoin - BTC",backingCoin:"BTC",symbol:"RUDEX.BTC",depositAllowed:!0,issuer:"rudex-bitcoin",issuerId:"1.2.955",confirmations:{type:"blocks",value:3}},{name:"ETH",description:"Ethereum - ETH",backingCoin:"ETH",symbol:"RUDEX.ETH",depositAllowed:!0,issuer:"rudex-ethereum",issuerId:"1.2.956",confirmations:{type:"blocks",value:30}}]};const ge=(0,a.$)(he,{listenTo:()=>[h.Z],getProps:()=>({viewSettings:h.Z.getState().viewSettings})});var ye=s(7437),we=s(50379);s(70637),s(64046),s(58466);class _e extends i.Component{static propTypes={account:d.Z.ChainAccount.isRequired,contained:C().bool};static defaultProps={contained:!1};constructor(e){super(),this.state={rudexService:e.viewSettings.get("rudexService","gateway"),rudexServiceBEP20:e.viewSettings.get("rudexServiceBEP20","gateway"),activeService:e.viewSettings.get("activeService",0),RudexNoticeInformed:!1,RudexNoticeInformed_BuyCrypto:!1}}shouldComponentUpdate(e,t){return e.account!==this.props.account||e.servicesDown!==this.props.servicesDown||!r.Z.are_equal_shallow(e.blockTradesBackedCoins,this.props.blockTradesBackedCoins)||!r.Z.are_equal_shallow(e.openLedgerBackedCoins,this.props.openLedgerBackedCoins)||!r.Z.are_equal_shallow(e.citadelBackedCoins,this.props.citadelBackedCoins)||t.rudexService!==this.state.rudexService||t.rudexServiceBEP20!==this.state.rudexServiceBEP20||t.activeService!==this.state.activeService||t.RudexNoticeInformed!==this.state.RudexNoticeInformed||t.RudexNoticeInformed_BuyCrypto!==this.state.RudexNoticeInformed_BuyCrypto||e.currentLocale!==this.props.currentLocale}UNSAFE_componentWillMount(){n.Z.getFinalFeeAsset(this.props.account,"transfer")}toggleOLService(e){this.setState({olService:e}),g.Z.changeViewSetting({olService:e})}onRudexNoticeInformed(){this.setState({RudexNoticeInformed:!this.state.RudexNoticeInformed})}onRudexNoticeInformed_BuyCrypto(){this.setState({RudexNoticeInformed_BuyCrypto:!this.state.RudexNoticeInformed_BuyCrypto})}toggleRuDEXService(e){this.setState({rudexService:e}),g.Z.changeViewSetting({rudexService:e})}toggleRuDEX_BEP20Service(e){this.setState({rudexServiceBEP20:e}),g.Z.changeViewSetting({rudexServiceBEP20:e})}onSetService(e){this.setState({activeService:parseInt(e.target.value)}),g.Z.changeViewSetting({activeService:parseInt(e.target.value)})}renderServices(e,t){let s=[],{account:a}=this.props,{rudexService:n,rudexServiceBEP20:o,RudexNoticeInformed:r,RudexNoticeInformed_BuyCrypto:l}=this.state,d="https://rudex.freshdesk.com/support/solutions/articles/35000138247-cоглашение-об-оказании-услуг-шлюза",p="https://rudex.freshdesk.com/support/solutions/articles/35000138245-gateway-service-agreement";return s.push({name:"COINS (Native Chains)",identifier:"RUDEX",template:i.createElement("div",{className:"content-block"},i.createElement("div",{className:"service-selector",style:{marginBottom:"2rem"}},i.createElement("ul",{className:"button-group segmented no-margin"},i.createElement("li",{onClick:this.toggleRuDEXService.bind(this,"gateway"),className:"gateway"===n?"is-active":""},i.createElement("a",null,i.createElement(c(),{content:"gateway.gateway"}))),i.createElement("li",{onClick:this.toggleRuDEXService.bind(this,"fiat"),className:"fiat"===n?"is-active":""},i.createElement("a",null,i.createElement(c(),{content:"gateway.rudex.buy_crypto.title"}),i.createElement("img",{style:{width:"30px"},src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnMTAzMDYiCiAgIHZpZXdCb3g9IjAgMCA1MDAuMDAwMDEgMTYyLjgxNTk0IgogICA+CiAgPGRlZnMKICAgICBpZD0iZGVmczEwMzA4Ij4KICAgIDxjbGlwUGF0aAogICAgICAgaWQ9ImNsaXBQYXRoMTAyNzEiCiAgICAgICBjbGlwUGF0aFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlkPSJwYXRoMTAyNzMiCiAgICAgICAgIGQ9Im0gNDEzLjc0Miw5MC40MzUgYyAtMC4wNTcsLTQuNDk0IDQuMDA1LC03LjAwMiA3LjA2NSwtOC40OTMgMy4xNDQsLTEuNTMgNC4yLC0yLjUxMSA0LjE4OCwtMy44NzkgLTAuMDI0LC0yLjA5NCAtMi41MDgsLTMuMDE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9yZGY6UkRGPgogIDwvbWV0YWRhdGE+CiAgPGcKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzMzLjcwMTU3LC01MzYuNDI0MzEpIgogICAgIGlkPSJsYXllcjEiPgogICAgPGcKICAgICAgIGlkPSJnMTAyNjciCiAgICAgICB0cmFuc2Zvcm09Im1hdHJpeCg0Ljk4NDY4NTYsMCwwLC00Ljk4NDY4NTYsLTE0NzAuMTE4NSwxMDM5LjYyNjQpIj4KICAgICAgPGcKICAgICAgICAgY2xpcC1wYXRoPSJ1cmwoI2NsaXBQYXRoMTAyNzEpIgogICAgICAgICBpZD0iZzEwMjY5Ij4KICAgICAgICA8ZwogICAgICAgICAgIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM1MS42MTEsOTYuODk2KSIKICAgICAgICAgICBpZD0iZzEwMjc1Ij4KICAgICAgICAgIDxwYXRoCiAgICAgICAgICAgICBpZD0icGF0aDEwMjgzIgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6dXJsKCNsaW5lYXJHcmFkaWVudDEwMjc3KTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIKICAgICAgICAgICAgIGQ9Ik0gMCwwIDk4LjQzNywzNi4yNTIgMTIwLjgzMSwtMjQuNTU3IDIyLjM5NSwtNjAuODA5IiAvPgogICAgICAgIDwvZz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg=="}),i.createElement("img",{style:{width:"20px",margin:"0 10px 0"},src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6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wzNjgsNjUuNgoJbDAuNi0xLjNIMjUzLjJsMC44LDEuM0MyNjYuOCw0My41LDI5MC41LDI5LjgsMzE2LjIsMjkuNyBNMjUzLjIsNjYuMWgxMTRsLTAuOC0xLjJsLTEzLjcsMjkuNGwwLjgtMC41SDI0Mi45bC0wLjEsMC44CgljLTAuMiwyLjUtMC40LDUtMC40LDcuNWMwLDMuNywwLjMsNy40LDAuOCwxMWwwLjEsMC44SDM0NWwtMC44LTEuM2wtMTMuNywyOS40bDAuOC0wLjVoLTc3LjdsMC45LDEuNGMyMi4yLDM0LDY3LjcsNDMuNiwxMDEuNywyMS40CgljNS42LTMuNywxMC43LTguMSwxNS4yLTEzLjJsLTEuNS0wLjZ2MzZsMC40LTAuN0MzNTMuMiwxOTcsMzMzLjEsMjAzLDMxMi42LDIwM2MtNDEuMiwwLTc4LjMtMjQtOTQuNC02MS4xbC0wLjItMC41aC0zNi45bDAuOCwxLjMKCWwxMy43LTI5LjRsLTAuOCwwLjVoMTZsLTAuMS0xYy0wLjMtMy4zLTAuNS02LjctMC41LTkuOWMwLTIuNSwwLjEtNS4yLDAuNC04LjJsMC4xLTFoLTMwLjhsMC44LDEuMmwxMy43LTI5LjNsLTAuOCwwLjVoMjMuOAoJbDAuMi0wLjVjNy42LTE4LjQsMjAuNS0zNC4xLDM3LjEtNDUuMmM0MC4zLTI3LDkzLjktMjIuNiwxMjkuMiwxMC41bC0wLjItMWwtMTEuOSwyNS41bDEuNS0wLjJjLTI1LjYtMzEuNS03MS44LTM2LjQtMTAzLjQtMTAuOAoJYy03LDUuNy0xMi45LDEyLjYtMTcuNCwyMC40bC0wLjgsMS4zTDI1My4yLDY2LjF6Ii8+Cjwvc3ZnPgo="}))))),"gateway"===n&&e.length?i.createElement("div",null,i.createElement("div",null,i.createElement(c(),{href:"ru"==this.props.currentLocale?d:p,content:"gateway.rudex.rudex_notice1",component:"a",target:"_blank"}),i.createElement("h5",null,i.createElement("input",{type:"checkbox",defaultChecked:this.state.RudexNoticeInformed,onChange:this.onRudexNoticeInformed.bind(this)})," ","-"," ",i.createElement(c(),{content:"gateway.rudex.rudex_notice1_informed"}))),i.createElement("hr",null),r?i.createElement(ce,{account:a,coins:e,network:"native",gateway:"rudex"}):null):null,"fiat"===n?i.createElement("div",null,i.createElement("div",null,i.createElement(c(),{href:"https://merchant.raidofinance.eu/media/83eef3d5a17bf300af9986e913c2c99d.pdf",content:"gateway.rudex.rudex_notice_third_party",component:"a",target:"_blank"}),i.createElement("h5",null,i.createElement("input",{type:"checkbox",defaultChecked:this.state.RudexNoticeInformed_BuyCrypto,onChange:this.onRudexNoticeInformed_BuyCrypto.bind(this)})," ","-"," ",i.createElement(c(),{content:"gateway.rudex.rudex_notice1_informed_third_party_service"}))),i.createElement("hr",null),l?i.createElement(ge,{account:a}):null):null)},{name:"Binance Smart Chain (BEP-20 tokens)",identifier:"RUDEX_BEP20",template:i.createElement("div",{className:"content-block"},i.createElement("div",{className:"service-selector",style:{marginBottom:"2rem"}},i.createElement("ul",{className:"button-group segmented no-margin"},i.createElement("li",{onClick:this.toggleRuDEX_BEP20Service.bind(this,"gateway"),className:"gateway"===o?"is-active":""},i.createElement("a",null,i.createElement(c(),{content:"gateway.gateway"}))))),"gateway"===o&&t.length?i.createElement("div",null,i.createElement("div",null,i.createElement(c(),{href:"ru"==this.props.currentLocale?d:p,content:"gateway.rudex.rudex_notice1",component:"a",target:"_blank"}),i.createElement("h5",null,i.createElement("input",{type:"checkbox",defaultChecked:this.state.RudexNoticeInformed,onChange:this.onRudexNoticeInformed.bind(this)})," ","-"," ",i.createElement(c(),{content:"gateway.rudex.rudex_notice1_informed"}))),i.createElement("hr",null),r?i.createElement(ce,{account:a,coins:t,network:"bsc-tokens",gateway:"rudex"}):null):null)}),s}render(){let{account:e,servicesDown:t}=this.props,{activeService:s}=this.state,a=this.props.rudexBackedCoins.map((e=>e)).sort(((e,t)=>e.symbol<t.symbol?-1:e.symbol>t.symbol?1:0)),n=this.props.rudexBackedCoinsBEP20.map((e=>e)).sort(((e,t)=>e.symbol<t.symbol?-1:e.symbol>t.symbol?1:0)),o=this.renderServices(a,n);const r=[];let l=o.map(((e,t)=>(r.push(e.identifier),i.createElement("option",{key:t,value:t},e.name))));const d=r[s],p=t.get(d);return i.createElement("div",{className:this.props.contained?"grid-content":"grid-container"},i.createElement("div",{className:this.props.contained?"":"grid-content",style:{paddingTop:"2rem"}},i.createElement(c(),{content:"gateway.title",component:"h2"}),i.createElement("div",{className:"grid-block vertical medium-horizontal no-margin no-padding"},i.createElement("div",{className:"medium-6 show-for-medium"},i.createElement(m.Z,{path:"components/DepositWithdraw",section:"deposit-short"})),i.createElement("div",{className:"medium-5 medium-offset-1"},i.createElement(m.Z,{account:e.get("name"),path:"components/DepositWithdraw",section:"receive"}))),i.createElement("div",null,i.createElement("div",{className:"grid-block vertical medium-horizontal no-margin no-padding"},i.createElement("div",{className:"medium-6 small-order-2 medium-order-1"},i.createElement(c(),{component:"label",className:"left-label",content:"gateway.service"}),i.createElement("select",{onChange:this.onSetService.bind(this),className:"bts-select",value:s},l),p?i.createElement(c(),{style:{color:"red",marginBottom:"1em",display:"block"},content:`gateway.unavailable_${d}`}):null),i.createElement("div",{className:"medium-5 medium-offset-1 small-order-1 medium-order-2",style:{paddingBottom:20}},i.createElement(c(),{component:"label",className:"left-label",content:"gateway.your_account"}),i.createElement("div",{className:"inline-label"},i.createElement(we.Z,{size:{height:40,width:40},account:e.get("name"),custom_image:null}),i.createElement("input",{type:"text",value:e.get("name"),placeholder:null,disabled:!0,onChange:()=>{},onKeyDown:()=>{},tabIndex:1}))))),i.createElement("div",{className:"grid-content no-padding",style:{paddingTop:15}},p?null:s&&o[s]?o[s].template:o[0].template)))}}_e=(0,p.Z)(_e);class Ce extends i.Component{UNSAFE_componentWillMount(){(0,o.xA)()}render(){return i.createElement(_e,this.props)}}const Me=(0,a.$)(Ce,{listenTo:()=>[u.Z,h.Z,ye.Z],getProps:()=>({currentAccount:u.Z.getState().currentAccount||u.Z.getState().passwordAccount,account:u.Z.getState().currentAccount,viewSettings:h.Z.getState().viewSettings,currentLocale:h.Z.getState().settings.get("locale"),backedCoins:ye.Z.getState().backedCoins,rudexBackedCoins:ye.Z.getState().backedCoins.get("RUDEX",[]),rudexBackedCoinsBEP20:ye.Z.getState().backedCoins.get("RUDEX_BEP20",[]),servicesDown:ye.Z.getState().down||{}})})},57351:(e,t,s)=>{s.d(t,{Z:()=>C});var i=s(67294),a=s(58074),n=s.n(a),o=s(21019),r=s(57906),l=s(43393),c=s.n(l),d=s(112),p=s.n(d),m=s(52521),u=s(13973),h=s(45697),g=s.n(h),y=s(34961);class w extends i.Component{static propTypes={value:g().string,onChange:g().func,scroll_length:g().number};shouldComponentUpdate(e){return!u.Z.are_equal_shallow(e.assets,this.props.assets)||e.value!==this.props.value||e.scroll_length!==this.props.scroll_length}render(){return this.props.assets.length?i.createElement(r.Z,{entries:this.props.assets.map((e=>e&&e.get("symbol"))).filter((e=>!!e)),values:this.props.assets.reduce(((e,t)=>(t&&t.get("symbol")&&(e[t.get("symbol")]=t),e)),{}),singleEntry:this.props.assets[0]?i.createElement(o.Z,{asset:this.props.assets[0].get("id"),amount:0,hide_amount:!0}):null,value:this.props.value,onChange:this.props.onChange,scroll_length:this.props.scroll_length}):null}}w=(0,m.Z)(w,{asList:!0});class _ extends y.C{static propTypes={label:g().string,assets:g().array,amount:g().any,placeholder:g().string,onChange:g().func,tabIndex:g().number,error:g().string,scroll_length:g().number};static defaultProps={disabled:!1,tabIndex:0};componentDidMount(){this.onAssetChange(this.props.asset)}formatAmount(e){return e||(e=""),"number"==typeof e&&(e=e.toString()),e.trim().replace(/,/g,"")}_onChange(e){this.props.onChange&&this.props.onChange({amount:this.getNumericEventValue(e),asset:this.props.asset})}onAssetChange(e){this.props.onChange&&this.props.onChange({amount:this.props.amount,asset:e})}render(){let e=this.props.error?p().translate(this.props.error):this.formatAmount(this.props.amount);return i.createElement("div",{className:"amount-selector",style:this.props.style},i.createElement("label",{className:"right-label"},this.props.display_balance),i.createElement(n(),{className:"left-label",component:"label",content:this.props.label}),i.createElement("div",{className:"inline-label input-wrapper"},i.createElement("input",{disabled:this.props.disabled,type:"text",value:e||"",placeholder:this.props.placeholder,onChange:this._onChange.bind(this),tabIndex:this.props.tabIndex,onPaste:this.props.onPaste||this.onPaste.bind(this),onKeyPress:this.onKeyPress.bind(this)}),i.createElement("div",{className:"form-label select floating-dropdown"},this.props.isPrice?i.createElement("div",{className:"dropdown-wrapper inactive"},i.createElement("div",null,this.props.asset.get("symbol"),"/",this.props.base)):i.createElement(w,{ref:this.props.refCallback,value:this.props.asset.get("symbol"),assets:c().List(this.props.assets),onChange:this.onAssetChange.bind(this),scroll_length:this.props.scroll_length}))))}}const C=_=(0,m.Z)(_)},3894:(e,t,s)=>{s.d(t,{Z:()=>h});var i=s(67294),a=s(13863),n=s(23037),o=s(82267),r=s(43393);class l extends i.Component{static propTypes={dos:n.Z.ChainObjectsList};static defaultProps={dos:(0,r.List)()};constructor(){super(),this.getDynamicObject=this.getDynamicObject.bind(this)}getDynamicObject(e){return this.props.dos.find((t=>t&&t.get("id")===e))}render(){return i.cloneElement(i.Children.only(this.props.children),{...this.props,getDynamicObject:this.getDynamicObject})}}l=(0,o.Z)(l);var c=s(45697),d=s.n(c),p=s(60567);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},m.apply(this,arguments)}class u extends i.Component{static propTypes={replaceNoneToBts:d().bool,maxWidth:d().number};static defaultProps={replaceNoneToBts:!0,maxWidth:20};constructor(e){super(e),this.state={imgError:!1}}shouldComponentUpdate(e,t){return this.props.asset!==e.asset||this.props.maxWidth!==e.maxWidth||this.props.whiteList!==e.whiteList||this.state.imgError!==t.imgError}_onError(e){this.state.imgError||(this.props.replaceNoneToBts?this.refs[e.toLowerCase()].src="asset-symbols/unknown.png":this.refs[e.toLowerCase()].remove(),this.setState({imgError:!0}))}render(){let{asset:e}=this.props;const t=function(e){if(null===e)return"unknown";let t=e.get("symbol");return(0,p.sA)(t)}(e);return i.createElement("img",{ref:t.toLowerCase(),className:"column-hide-small",onError:this._onError.bind(this,t),style:{maxWidth:this.props.maxWidth,marginRight:5,marginTop:"-3px"},src:`asset-symbols/${t.toLowerCase()}.png`})}}u=function(e,t={}){t.propNames=t.propNames||[t.asList?"assets":"asset"];const s=t.propNames.reduce(((e,s)=>(e[s]=t.asList?n.Z.ChainAssetsList:n.Z.ChainAsset.isRequired,e)),{});let c=Object.keys(s).reduce(((e,s)=>{let i=t.defaultProps&&t.defaultProps[s];return e[s]=t.asList?(0,r.List)(i||[]):i||"1.3.0",e}),{});t.defaultProps&&t.defaultProps.tempComponent&&(c.tempComponent=t.defaultProps.tempComponent);class d extends i.Component{static propTypes=s;static defaultProps=c;render(){let e={},s={},a=(0,r.List)();Object.keys(this.props).forEach((i=>{this.props[i]&&-1!==t.propNames.indexOf(i)?(t.withDynamic&&(t.asList?this.props[i].forEach((e=>{e&&(a=a.push(e.get("dynamic_asset_data_id")))})):a=a.push(this.props[i].get("dynamic_asset_data_id"))),e[i]=t.asList?this.props[i].filter((e=>!!e)):this.props[i]):s[i]=this.props[i]}));let n=i.cloneElement(i.Children.only(this.props.children),{...s,...e});return t.withDynamic?i.createElement(l,{dos:a},n):n}}d=(0,o.Z)(d);class p extends i.Component{render(){return i.createElement(d,this.props,i.createElement(e,{ref:"bound_component"}))}}return p.displayName=`Wrapper(${(0,a.G)(e)})`,p}(u);class h extends i.Component{render(){return i.createElement(u,m({},this.props,{asset:this.props.name}))}}},57906:(e,t,s)=>{s.d(t,{Z:()=>l});var i=s(67294),a=s(13973),n=s(45697),o=s.n(n);class r extends i.Component{static propTypes={scroll_length:o().number};static defaultProps={scroll_length:9};constructor(e){e.scroll_length,super(e),this.state={active:!1},this.listener=!1,this.onBodyClick=this.onBodyClick.bind(this)}componentDidMount(){this._setListener()}shouldComponentUpdate(e,t){return!a.Z.are_equal_shallow(e.entries,this.props.entries)||!a.Z.are_equal_shallow(t,this.state)||e.value!==this.props.value}_setListener(e=this.props){e.entries.length>1&&!this.listener&&(this.listener=!0,document.body.addEventListener("click",this.onBodyClick,{capture:!1,passive:!0}))}_removeListener(){document.body.removeEventListener("click",this.onBodyClick),this.listener=!1}UNSAFE_componentWillReceiveProps(e){1===e.entries.length?this._removeListener():e.entries.length>1&&this._setListener(e)}componentWillUnmount(){this._removeListener()}onBodyClick(e){let t=e.target,s=!1;do{if(t.classList&&t.classList.contains("dropdown")&&t.id===this.props.id){s=!0;break}}while(t=t.parentNode);s?e.stopPropagation():this.setState({active:!1})}onChange(e,t){t.preventDefault(),t.stopPropagation(),this.props.onChange(e),this.setState({active:!1})}_toggleDropdown(){this.setState({active:!this.state.active})}render(){const{entries:e,value:t}=this.props;let{active:s}=this.state;if(0===e.length)return null;if(1==e.length)return i.createElement("div",{className:"dropdown-wrapper inactive"+(this.props.upperCase?" upper-case":"")},i.createElement("div",null,this.props.singleEntry?this.props.singleEntry:e[0]));{let a=e.map((e=>i.createElement("li",{className:this.props.upperCase?"upper-case":"",key:e,onClick:this.onChange.bind(this,this.props.values[e])},i.createElement("span",null,e))));return i.createElement("div",{onClick:this._toggleDropdown.bind(this),className:"dropdown-wrapper"+(s?" active":"")+(this.props.upperCase?" upper-case":"")},i.createElement("div",{style:{paddingRight:15}},t||i.createElement("span",{className:"hidden"},"A")),i.createElement("ul",{className:"dropdown",style:{overflow:e.length>this.props.scroll_length?"auto":"hidden"}},a))}}}const l=r},74300:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var i=n(s(67294)),a=n(s(20640));function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?m(e):t}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var g=function(e){function t(){var e,s;l(this,t);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return h(m(s=d(this,(e=p(t)).call.apply(e,[this].concat(o)))),"onClick",(function(e){var t=s.props,n=t.text,o=t.onCopy,r=t.children,l=t.options,c=i.default.Children.only(r),d=(0,a.default)(n,l);o&&o(n,d),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(e)})),s}var s,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),s=t,n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),s=function(e,t){if(null==e)return{};var s,i,a=function(e,t){if(null==e)return{};var s,i,a={},n=Object.keys(e);for(i=0;i<n.length;i++)s=n[i],t.indexOf(s)>=0||(a[s]=e[s]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)s=n[i],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(a[s]=e[s])}return a}(e,["text","onCopy","options","children"]),a=i.default.Children.only(t);return i.default.cloneElement(a,function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?r(s,!0).forEach((function(t){h(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):r(s).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}({},s,{onClick:this.onClick}))}}],n&&c(s.prototype,n),t}(i.default.PureComponent);t.CopyToClipboard=g,h(g,"defaultProps",{onCopy:void 0,options:void 0})},74855:(e,t,s)=>{var i=s(74300).CopyToClipboard;i.CopyToClipboard=i,e.exports=i}}]);