!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.binanceFiatWidget=t():e.binanceFiatWidget=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}
return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)
for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){(function(r){var i;!function(r){"use strict";function o(e){var t=e&&e.Promise||r.Promise,n=e&&e.XMLHttpRequest||r.XMLHttpRequest,i=r;return function(){var e=Object.create(i,{fetch:{value:void 0,writable:!0}});return function(e){if(!e.fetch){var r="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,s="ArrayBuffer"in e;if(s)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=function(e){return e&&DataView.prototype.isPrototypeOf(e)},c=ArrayBuffer.isView||function(e){return e&&p.indexOf(Object.prototype.toString.call(e))>-1};x.prototype.append=function(e,t){e=d(e),t=f(t);var n=this.map[e];this.map[e]=n?n+","+t:t},x.prototype.delete=function(e){delete this.map[d(e)]},x.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},x.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},x.prototype.set=function(e,t){this.map[d(e)]=f(t)},x.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},x.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),b(e)},x.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),b(e)},x.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),b(e)},i&&(x.prototype[Symbol.iterator]=x.prototype.entries);var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];C.prototype.clone=function(){return new C(this,{body:this._bodyInit})},v.call(C.prototype),v.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},L.error=function(){var e=new L(null,{status:0,statusText:""});return e.type="error",e};var h=[301,302,303,307,308];L.redirect=function(e,t){if(-1===h.indexOf(t))throw new RangeError("Invalid status code");return new L(null,{status:t,headers:{location:e}})},e.Headers=x,e.Request=C,e.Response=L,e.fetch=function(e,r){return new t((function(t,i){var a=new C(e,r),s=new n;s.onload=function(){var e,n,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",n=new x,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var t=e.split(":"),r=t.shift().trim();if(r){var i=t.join(":").trim();n.append(r,i)}})),n)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;t(new L(i,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===a._bodyInit?null:a._bodyInit)}))},e.fetch.polyfill=!0}
function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}
function f(e){return "string"!=typeof e&&(e=String(e)),e}
function b(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}
function x(e){this.map={},e instanceof x?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}
function g(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}
function y(e){return new t((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}
function w(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}
function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}
function v(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)
if("string"==typeof e)this._bodyText=e;else if(o&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(a&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(r&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(s&&o&&u(e))this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(e)&&!c(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=m(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var e,n,r,i=g(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=new FileReader,r=y(n),n.readAsText(e),r;if(this._bodyArrayBuffer)return t.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(S)}),this.json=function(){return this.text().then(JSON.parse)},this}
function C(e,t){var n,r,i=(t=t||{}).body;if(e instanceof C){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new x(e.headers)),this.method=e.method,this.mode=e.mode,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new x(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),l.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}
function S(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}
function L(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new x(t.headers),this.url=t.url||"",this._initBody(e)}}(void 0!==e?e:this),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response}}()}
void 0===(i=function(){return o}.call(t,n,t,e))||(e.exports=i)}("undefined"!=typeof self?self:void 0!==r?r:this)}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}
e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"Widget",(function(){return S})),n.d(t,"unloadWidget",(function(){return L}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)
for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{p(r.next(e))}catch(e){o(e)}}
function s(e){try{p(r.throw(e))}catch(e){o(e)}}
function p(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}
p((r=r.apply(e,t||[])).next())}))}
function o(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}
if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}
if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}
if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}
i[2]&&a.ops.pop(),a.trys.pop();continue}
o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}
if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}
var a=function(){return p("div")};function s(e,t){Object.keys(t).map((function(n){e.style[n]=t[n]}))}
function p(e){var t=document.createElement(e);return s(t,{boxSizing:"border-box"}),t}
var u={dark:{bg:"#0B0E11",activeTabColor:"#F0B90B",tabBorder:"#848E9C",labelColor:"#FFFFFF",poweredBy:"#D8D8D8",placeholder:"#FFFFFF",inputBg:"#333333",inputBorder:"#333",coinColor:"#fff",breakColor:"#fff",boxShadow:"0px 6px 20px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#fff",dropDownbg:"#EAECEF"},light:{bg:"FFFFFF",activeTabColor:"#F0B90B",tabBorder:"rgba(132, 142, 156, 0.2)",labelColor:"#848E9C",poweredBy:"#848E9C",placeholder:"#848E9C",inputBg:"#ffffff",inputBorder:"rgba(132, 142, 156, 0.2)",coinColor:"#212833",breakColor:"#333",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.08), 0px 0px 4px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#212833",dropDownbg:"#EAECEF"}},c=n(0),l=n.n(c)()().fetch,h=console.log,d=["/api","/exchange-api/v1/public","/gateway-api/v1/public","/info-api/v1/public"],f=["/gateway-api/v1/public/authcenter/login","/gateway-api/v1/public/authcenter/auth"],b=function(e,t){return l(function(e){return "undefined"!=typeof window&&d.find((function(t){return e.startsWith(t)}))&&!f.find((function(t){return e.startsWith(t)}))?"https://i18n.bnbstatic.com"+e:e}(e),t)},x=function(e,t,n){return void 0===t&&(t=!1),i(void 0,void 0,void 0,(function(){var r,a,s,p,u,c;return o(this,(function(l){switch(l.label){case 0:n=n||{},l.label=1;case 1:return l.trys.push([1,5,,6]),r=Date.now(),[4,b(e,{})];case 2:return a=l.sent(),s=Date.now(),p=s-r,[4,(d=a,i(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:if(d.status>=200&&d.status<300)return[2,d];if(401===d.status)return[2,d];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,d.json()];case 2:throw e=n.sent(),new Error(e.message);case 3:throw n.sent(),(t=new Error(d.statusText||String(d.status))).name=String(d.status),t.response=d,t;case 4:return[2]}}))})))];case 3:return l.sent(),[4,a.json()];case 4:return u=l.sent(),t&&h("\n      Request url: {"+e+"},\n      duration time is "+p+",\n      "+(p>500?"more than 500ms, ":"")),[2,u];case 5:throw c=l.sent(),h("\n    BAD REQUEST:\n    Request url: {"+e+"},\n    parse ERROR is "+JSON.stringify(c)),c;case 6:return[2]}
var d}))}))},g=function(e){var t=e.locale;return i(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+("out/web2.0/"+t))];case 1:return e=n.sent(),0!==Object.keys(e).length?[3,3]:[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+"out/web2.0/en")];case 2:e=n.sent(),n.label=3;case 3:return[2,["exchange-home-wantSpend","exchange-home-wantBuy","exchange-home-SearchFiat","exchange-home-SearchCrypto","exchange-home-fiatTitle","exchange-home-cryptoTitle","exchange-buySell-buyType","exchange-home-enterAmount","exchange-buySell-sellType","exchange-creditcard-poweredBy","exchange-widget-buyCryptocurrency"].reduce((function(t,n){return t[n]=e[n],t}),{})]}}))}))},y=function(e,t){return void 0===e&&(e="en"),void 0===t&&(t="https://www.binance.com"),i(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:n=[],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(t+"/gateway-api/v1/public/fiat-channel-gateway/get-selector?lang="+e,!1,{headers:{lang:e}})];case 2:return r=i.sent(),n=r.data||[],[3,4];case 3:return i.sent(),n=[],[3,4];case 4:return[2,n]}}))}))},w=function(e){var t=e.locale,n=void 0===t?"en":t,r=e.api_host;return i(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,g({locale:n})];case 1:return e=i.sent(),[4,y(n,r)];case 2:return t=i.sent(),[2,{i18n:e,coinList:t}];case 3:return i.sent(),[2,{i18n:{},coinList:[]}];case 4:return[2]}}))}))},m=function(e,t,n){return void 0===t&&(t={}),t[e]||n||e},v=(Object.freeze({en:"en-us",cn:"zh-cn",tw:"zh-tw",kr:"ko",ru:"ru",vn:"vi",it:"it",es:"es",de:"de",fr:"fr"}),{space:{container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"2px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"15px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"15px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},size:{fontSize:"12px",coinFontSize:"14px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}}),C=0,S=function(e,t){var n=!1,c=!1;C++;var l=null,h={locale:"en",width:(l="string"==typeof e?document.querySelector(e):e).offsetWidth||l.clientWidth||200,theme:"light",urlParmas:{ref:"",utm_source:""},api_host:"https://www.binance.com",skeletonScreen:!0},d=h.width,f=h.locale,b=h.theme,x=h.urlParmas,g=h.api_host,y=h.skeletonScreen;t&&(d=t.width||d,f=t.locale||f,b=t.theme||b,x=t.urlParmas||x,g=t.api_host||g,y=void 0===t.skeletonScreen?y:t.skeletonScreen);var S,B,T,H=x.ref,F=x.utm_source;d<200&&(d=200),d>500&&(d=500);var E={subSelector:[],assetCode:""},A={assetCode:""};function _(){var e=u[b],t=function(e){var t=v;return e<=300?(t.space={container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"8px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"24px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"24px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},t.size={fontSize:"12px",coinFontSize:"14px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}):e>300&&e<=450?(t.space={container:{padding:"32px 16px 32px 16px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"79px",pl:"16px",pr:"16px",coinMl:"8px",height:60,labelLineHeight:"18px",space:"4px"},input2:{mt:"0px",pl:"16px",pr:"16px",labelLineHeight:"18px",height:"60px"},buySubmit:{mt:"20px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",coinFontSize:"14px",titleFontSize:"18px",tabBtn:{width:"56px",height:"60px"},buySubmit:{height:"60px"}}):(t.space={container:{padding:"32px 24px 32px 24px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"105px",pl:"16px",pr:"21px",coinMl:"27px",height:60,labelLineHeight:"18px",space:"4px"},input2:{mt:"0px",pl:"16px",pr:"21px",labelLineHeight:"18px",height:"60px"},buySubmit:{mt:"22px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",coinFontSize:"14px",titleFontSize:"24px",tabBtn:{width:"56px",height:"32px"},buySubmit:{height:"60px"}}),t}(d),h=t.size,x=t.space,L=p("style"),_=function(){var t=a();return t.className+="binance-fiat-widget",L.innerHTML+="\n        .binance-fiat-widget {\n          font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n        }\n        .binance-fiat-widget-modal {\n          font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n        }\n      ",s(t,{width:d+"px",position:"relative",left:0,right:0,borderRadius:"4px",background:e.bg,padding:x.container.padding,display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:e.boxShadow}),t}(),k=function(){var t=a();return t.className+="binance-fiat-widgetTitle",L.innerHTML+="\n        .binance-fiat-widget {\n          font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n        }\n        .binance-fiat-widget-modal {\n          font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n        }\n      ",s(t,{width:d+"px",position:"relative",left:0,right:0,borderRadius:"4px",background:e.bg,padding:x.container.padding,display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:e.boxShadow}),t}(),R=function(){var e=a(),t=a();return s(e,{marginTop:"0px",position:"relative"}),s(t,{marginTop:x.input2.mt,cursor:"pointer"}),{input1:e,input2:t}}(),z=R.input1,j=R.input2,I=function(){var t=a(),n=a(),r={color:e.labelColor,fontSize:"0px",display:"0px",flexDirection:"column",textAlign:"left",lineHeight:x.input1.labelLineHeight,height:x.input1.labelLineHeight};return s(t,r),s(n,r),{input1Label:t,input2Label:n}}(),M=I.input1Label,O=I.input2Label,P=function(){var t=a(),n=p("input"),i=ne(!0),o=ne();n.onkeypress=function(e){(46!=e.keyCode&&e.keyCode<48||e.keyCode>57)&&(e.returnValue=!1)},t.appendChild(n),t.appendChild(o),s(t,{display:"flex",alignItems:"center",justifyContent:"left"});var u={width:"calc(100% - "+x.input1.rightWidth+")",height:x.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",marginTop:x.input1.space,paddingLeft:x.input1.pl,fontFamily:"inherit",WebkitAppearance:"none",outline:"none"};return s(n,r(r({},u),{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"0 none",color:e.coinColor,fontWeight:500})),s(o,{boxSizing:"border-box",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderleft:"0 none",color:e.coinColor,fontSize:h.coinFontSize,height:x.input1.height+"px",lineHeight:x.input1.height+"px",textAlign:"left"}),s(i,r(r({},u),{width:"100%",color:e.coinColor,fontSize:h.coinFontSize,height:x.input1.height+"px",lineHeight:x.input1.height+"px",textAlign:"left"})),n.className="binance-fiat-widget-input-focus\n            binance-fiat-widget-input-active\n            binance-fiat-widget-input-placeholder",L.innerText+="\n                .binance-fiat-widget-input-focus:focus {\n                    outline: none;\n                }\n                .binance-fiat-widget-input-focus:active {\n                    outline: none;\n                }\n                .binance-fiat-widget-input-placeholder {\n                    padding: 0;\n                    color: "+e.placeholder+";\n                    font-size: "+h.fontSize+";\n                }\n                .binance-fiat-widget-input-coin-placeholder {\n                    padding: 0;\n                    color: #848E9C;\n                    font-size: 12px;\n                }\n            ",{input1Input:t,input2Input:i,select:o}}(),D=P.input1Input,V=P.input2Input,U=P.select,W=function(){var t=a();return s(t,{cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",outline:"none",fontWeight:700,fontSize:"24px",lineHeight:h.buySubmit.height,backgroundColor:"#ffc107",height:h.buySubmit.height,borderRadius:"4px",marginTop:x.buySubmit.mt,color:"#fff"}),t}(),N=function(){var e=a();return s(e,{marginTop:x.logo.mt,display:"none",justifyContent:"center"}),e}(),q=function(){var t=a();return s(t,{fontSize:h.fontSize,marginRight:x.logo.logoSpace,color:e.poweredBy,height:x.logo.height,lineHeight:x.logo.height}),t}(),Z=function(){var e=a();return s(e,{height:x.logo.height,lineHeight:x.logo.height,display:"flex",alignItems:"center"}),e.innerHTML='<svg width="70" height="14" viewBox="0 0 70 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n            <path d="M3.1582 7L1.58594 8.57227L0 7L1.58594 5.41406L3.1582 7ZM7 3.1582L9.70703 5.86523L11.293 4.2793L7 0L2.70703 4.29297L4.29297 5.87891L7 3.1582ZM12.4141 5.41406L10.8418 7L12.4277 8.58594L14.0137 7L12.4141 5.41406ZM7 10.8418L4.29297 8.12109L2.70703 9.70703L7 14L11.293 9.70703L9.70703 8.12109L7 10.8418ZM7 8.57227L8.58594 6.98633L7 5.41406L5.41406 7L7 8.57227ZM23.6797 8.73633V8.70898C23.6797 7.68359 23.1328 7.16406 22.2441 6.82227C22.791 6.52148 23.2559 6.0293 23.2559 5.16797V5.14062C23.2559 3.9375 22.2852 3.1582 20.7266 3.1582H17.1582V10.8281H20.8086C22.5449 10.8418 23.6797 10.1309 23.6797 8.73633ZM21.5742 5.45508C21.5742 6.0293 21.1094 6.26172 20.3574 6.26172H18.7988V4.63477H20.4668C21.1777 4.63477 21.5742 4.92188 21.5742 5.42773V5.45508ZM21.998 8.51758C21.998 9.0918 21.5469 9.35156 20.8086 9.35156H18.7988V7.66992H20.7539C21.6152 7.66992 21.998 7.98438 21.998 8.50391V8.51758ZM27.2207 10.8418V3.1582H25.5254V10.8281H27.2207V10.8418ZM36.2988 10.8418V3.1582H34.6309V7.88867L31.0352 3.1582H29.4766V10.8281H31.1445V5.96094L34.8633 10.8418H36.2988ZM45.6504 10.8418L42.3555 3.11719H40.7969L37.502 10.8418H39.2383L39.9355 9.11914H43.1758L43.873 10.8418H45.6504ZM42.5742 7.62891H40.5371L41.5625 5.14062L42.5742 7.62891ZM53.7031 10.8418V3.1582H52.0352V7.88867L48.4395 3.1582H46.8809V10.8281H48.5488V5.96094L52.2676 10.8418H53.7031ZM62.4121 9.59766L61.332 8.51758C60.7305 9.06445 60.1973 9.41992 59.3086 9.41992C57.9961 9.41992 57.0801 8.32617 57.0801 7.01367V6.97266C57.0801 5.66016 58.0098 4.58008 59.3086 4.58008C60.0742 4.58008 60.6758 4.9082 61.2773 5.44141L62.3574 4.19727C61.6465 3.5 60.7852 3.00781 59.3359 3.00781C56.9844 3.00781 55.3301 4.79883 55.3301 6.97266V7C55.3301 9.20117 57.0117 10.9512 59.2676 10.9512C60.7441 10.9648 61.6191 10.4453 62.4121 9.59766ZM69.6172 10.8418V9.33789H65.4473V7.72461H69.0703V6.2207H65.4473V4.66211H69.5625V3.1582H63.7793V10.8281H69.6172V10.8418Z" fill="#F0B90B" />\n        </svg>',e}();function G(){U.addEventListener("click",(function(e){return $(e)}),!0),V.addEventListener("click",(function(e){return ee(e)}),!0),W.onclick=re,window.addEventListener("click",(function(e){n&&$(e),c&&ee(e)}),!0)}
return N.appendChild(q),N.appendChild(Z),z.appendChild(M),z.appendChild(D),j.appendChild(O),j.appendChild(V),_.appendChild(L),_.appendChild(k),_.appendChild(z),_.appendChild(j),_.appendChild(W),_.appendChild(N),y?(null==l||l.append(_),Y().then((function(){return G()}))):Y().then((function(){G(),null==l||l.append(_)}));function Y(){return i(this,void 0,void 0,(function(){var e,t,n,r;return o(this,(function(i){switch(i.label){case 0:return[4,w({locale:f,api_host:g})];case 1:return e=i.sent(),t=e.i18n,n=e.coinList,B=t,T=n,r=function(e){return m(e,B)},M.innerText=r("exchange-home-wantSpend"),O.innerText=r("exchange-home-wantBuy"),D.children[0].placeholder=r("exchange-home-enterAmount"),q.innerText=r("exchange-creditcard-poweredBy"),k.innerText=r("exchange-widget-buyCryptocurrency"),S=T.buySelector,J(E=S[0]),A=E.subSelector[0],X(S,E.subSelector,E.assetCode,A.assetCode),K(A),[2]}}))}))}
function X(e,t,n,r){var i=U.children[1];i.innerHTML="",e.forEach((function(e){var t=te(e.assetCode);e.assetCode===n&&s(t,{color:"#F0B90B"}),i.appendChild(t)}));var o=V.children[1];o.innerHTML="",t.forEach((function(e){var t=te(e.assetCode);e.assetCode===r&&s(t,{color:"#F0B90B"}),o.appendChild(t)}))}
function J(e){U.children[2].innerHTML=e.assetCode}
function K(e){var t=(e||{assetCode:""}).assetCode;W.innerText=m("exchange-buySell-buyType",B)+" "+t,V.children[2].innerHTML=t}
function Q(e,t){return e.find((function(e){return e.assetCode===t}))}
function $(t){var r=t.target.className;if(/binance-fiat-widget-dropdown-item/.test(r)){var i=t.target.innerText;J(E=Q(S,i)),K(E.subSelector[0]),X(S,E.subSelector,E.assetCode,A.assetCode)}
n=!n,s(U.children[0],{borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(U.children[1],{display:n?"block":"none"}),t.stopPropagation()}
function ee(t){var n=t.target.className;if(/binance-fiat-widget-dropdown-item/.test(n)){var r=t.target.innerText;K(A=Q(E.subSelector,r)),X(S,E.subSelector,E.assetCode,A.assetCode)}
c=!c,s(V.children[0],{borderWidth:c?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:c?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(V.children[1],{display:c?"block":"none"}),t.stopPropagation()}
function te(t){var n=a();return n.innerText=t,s(n,{fontSize:h.coinFontSize,color:e.buySubmitColor,textAlign:"left",paddingLeft:x.dropDown.pl,height:"52px",lineHeight:"60px"}),n.className+="binance-fiat-widget-dropdown-item",L.innerText+="\n            .binance-fiat-widget-dropdown-item:hover {\n                background: #EAECEF;\n                font-weight: 500;\n            }\n        ",n}
function ne(t){var r,i=a(),o=a(),c=(s(r=p("i"),{width:0,height:0,borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderStyle:"solid",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent",borderRadius:"2px",position:"absolute",right:"12px",top:(x.input1.height-5)/2+"px"}),r),l=function(){var e=a();return s(e,{width:x.input1.rightWidth,minHeight:"60px",maxHeight:d<=300?"138px":"138px",background:"#fff",boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.1)",borderRadius:"4px",position:"absolute",zIndex:9,top:x.input1.height+2+"px",right:0,overflowY:"auto",display:"none",fontWeight:"normal",textTransform:"uppercase"}),e}();return s(i,{width:x.input1.rightWidth,height:x.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",borderLeft:"0 none",paddingLeft:x.input1.coinMl,marginTop:x.input1.space,position:"relative",cursor:"pointer",fontWeight:d>300?500:"normal"}),t||(i.className="binance-fiat-widget-select-before-"+C+" "+("dark"===b?"binance-fiat-widget-select-dark":"binance-fiat-widget-select-light"),L.innerText+="\n                .binance-fiat-widget-select-before-"+C+":before {\n                    content: '';\n                    height: 16px;\n                    display: inline-block;\n                    position: absolute;\n                    left: -1px;\n                    width: 1px;\n                    opacity: 0.2;\n                    top: "+(x.input1.height-16)/2+"px;\n                }\n                .binance-fiat-widget-select-dark:before {\n                    background: "+u.dark.breakColor+";\n                }\n                .binance-fiat-widget-select-light:before {\n                    background: "+u.light.breakColor+";\n                }\n            "),i.appendChild(c),i.appendChild(l),i.appendChild(o),i}
function re(){if(E&&E.assetCode&&A&&A.assetCode){if("CNY"===E.assetCode)window.open("https://c2c.binance.com/");else{var e=D.children[0].value,t="https://www.binance.com/"+f+"/buy-sell-crypto?fiat="+E.assetCode+"&crypto="+A.assetCode+"&amount="+e;H&&(t+="&ref="+H),F&&(t+="&utm_source="+F),window.open(t)}}}}
return _(),{setTheme:function(e){return b=e,this},setLocale:function(e){return f=e,this},render:function(){return L(),_()}}},L=function(){document.querySelectorAll(".binance-fiat-widget").forEach((function(e){return e.remove()})),document.querySelectorAll(".binance-fiat-widget-modal").forEach((function(e){return e.remove()}))}}])}));