!function(e,t){e.WxLogin=function(o){var n="default";!0===o.self_redirect?n="true":!1===o.self_redirect&&(n="false");var r=t.createElement("iframe"),s=(new Date).getTime(),a="https://open.weixin.qq.com/connect/qrconnect?appid="+o.appid+"&scope="+o.scope+"&redirect_uri="+o.redirect_uri+"&state="+o.state+"&login_type=jssdk&self_redirect="+n+"&styletype="+(o.styletype||"")+"&sizetype="+(o.sizetype||"")+"&bgcolor="+(o.bgcolor||"")+"&rst="+(o.rst||"")+"&ts="+s;a+=o.style?"&style="+o.style:"",a+=o.href?"&href="+o.href:"",a+="en"===o.lang?"&lang=en":"",a+=1===o.stylelite?"&stylelite=1":"",a+=0===o.fast_login?"&fast_login=0":"","auto"===o.color_scheme?a+="&color_scheme=auto":"dark"===o.color_scheme?a+="&color_scheme=dark":"light"===o.color_scheme&&(a+="&color_scheme=light"),r.src=a,r.frameBorder="0",r.allowTransparency="true",r.scrolling="no",r.width="300px",r.height="400px";var i=t.getElementById(o.id);if(i.innerHTML="",i.appendChild(r),e.addEventListener&&e.JSON){var c=function(t){if("https://open.weixin.qq.com"===t.origin)try{var n=JSON.parse(t.data);if(n&&"status"===n.type){var r="wxReady"===n.status;r&&o.onReady&&"function"==typeof o.onReady&&o.onReady(r),"wxQRcodeReady"===n.status&&o.onQRcodeReady&&"function"==typeof o.onQRcodeReady&&o.onQRcodeReady()}}catch(t){e.console&&"function"==typeof e.console.log&&e.console.log("wxLogin postMessage error",t)}};e.addEventListener("message",c,!1);var l=!1;o.onCleanup=function(){!l&&e.removeEventListener&&(e.removeEventListener("message",c,!1),l=!0)}}}}(window,document);