(function(e,t){"use strict";function u(e,t){e=String(e).split("."),t=String(t).split(".");try{for(var n=0,r=Math.max(e.length,t.length);n<r;n++){var i=isFinite(e[n])&&Number(e[n])||0,s=isFinite(t[n])&&Number(t[n])||0;if(i<s)return-1;if(i>s)return 1}}catch(o){return-1}return 0}function a(e){var t=e.split("."),n=window,r;for(var i in t)r=t[i],!n[r]&&(n[r]={}),n=n[r];return n}function f(e,t,n){var r=typeof e=="function"?e:window[e];if(!r)return null;var s=l(e),o="__MQQ_CALLBACK_"+s;return window[o]=function(){var e=i.call(arguments);c(s,e,t,n),t&&delete window[o]},o}function l(e){var t=s++;return e&&(o[t]=e),t}function c(e,t,n,r){var i=o[e];i&&(r?setTimeout(function(){i.apply(null,t)},0):i.apply(null,t)),n&&delete o[e]}function h(){var e=i.call(arguments),t=e.length&&e[e.length-1];return typeof t=="function"?t(null):null}function p(e,t){var r=null,i=e.lastIndexOf("."),s=a(e.substring(0,i));t.iOS&&n.iOS?r=t.iOS:t.android&&n.android&&(r=t.android),s[e.substring(i+1)]=r||h}function d(e,r){var i=document.createElement("iframe");i.style.cssText="display:none;width:0px;height:0px;";var s=function(){v(r,{r:-201,result:"error"})};n.iOS&&(i.onload=s,i.src=e);var o=document.body||document.documentElement;o.appendChild(i),n.android&&(i.onload=s,i.src=e);var u=n.__RETURN_VALUE;return n.__RETURN_VALUE=t,setTimeout(function(){i.parentNode.removeChild(i)},0),u}function v(e,t){var r;n.iOS?r=i.call(arguments,1):n.android&&(r=[t.result]),c(e,r)}function m(e,t,r,s){if(!e||!t)return null;var o,a,f,c;r=i.call(arguments,2),s=r.length&&r[r.length-1],s&&typeof s=="function"?r.pop():typeof s=="undefined"?r.pop():s=null;if(n.android&&u(n.QQVersion,"4.5")<0){if(window[e]&&window[e][t]){var h=window[e][t].apply(window[e],r);return s?s(h):h}s&&s(n.ERROR_NO_SUCH_METHOD)}else if(n.iOS||n.android&&u(n.QQVersion,"5.0")>-1){o="jsbridge://"+encodeURIComponent(e)+"/"+encodeURIComponent(t);for(a=0,f=r.length,c;a<f;a++)c=r[a],typeof c=="object"&&(c=JSON.stringify(c)),a===0?o+="?p=":o+="&p"+a+"=",o+=encodeURIComponent(String(c));n.android&&(o+="#"+l(s));var p=d(o);if(n.iOS)return p=p?p.result:null,typeof s=="function"?s(p):p}else if(n.android){var v=l(s);o="jsbridge://"+encodeURIComponent(e)+"/"+encodeURIComponent(t)+"/"+v;for(a=0,f=r.length,c;a<f;a++)c=r[a],typeof c=="object"&&(c=JSON.stringify(c)),o+="/"+encodeURIComponent(String(c));d(o,v)}return null}function g(e){var t,n,r,i=e.indexOf("?"),s=e.substring(i+1).split("&"),o={};for(t=0;t<s.length;t++)i=s[t].indexOf("="),n=s[t].substring(0,i),r=s[t].substring(i+1),o[n]=decodeURIComponent(r);return o}function y(e){var t=[];for(var n in e)t.push(encodeURIComponent(String(n))+"="+encodeURIComponent(String(e[n])));return t.join("&")}function b(e,t,n,r,i){i&&(r.callback_type="javascript",r.callback_name=f(function(e){i(g(e))})),r.src_type="web",r.version||(r.version=1);var s=e+"://"+encodeURIComponent(t)+"/"+encodeURIComponent(n)+"?"+y(r);d(s)}var n=window[e]=window[e]||{},r=navigator.userAgent,i=Array.prototype.slice,s=1,o={};n.iOS=/(iPad|iPhone|iPod).*?QQ/g.test(r),n.android=/\bV1_AND_SQ_/.test(r),n.version="20140326002",n.ERROR_NO_SUCH_METHOD="no such method",!n.android&&!n.iOS&&console.log("mqqapi: not android or ios"),n.compare=function(e){return u(n.QQVersion,e)},n.android&&(n.QQVersion=function(e){return e&&e[1]||0}(r.match(/\bV1_AND_SQ_([\d\.]+)/)),window.JsBridge||(window.JsBridge={}),window.JsBridge.callMethod=m,window.JsBridge.callback=v,window.JsBridge.compareVersion=n.compare),n.iOS&&(window.iOSQQApi=n,n.__RETURN_VALUE=t,n.QQVersion=function(){return m("device","qqVersion")||0}()),n.build=p,n.invoke=m,n.invokeSchema=b,n.callback=f})("mqq"),mqq.build("mqq.device.isMobileQQ",{iOS:function(e){var t=mqq.iOS;return e?e(t):t},android:function(e){var t=mqq.android;return e?e(t):t}}),mqq.build("mqq.ui.openUrl",{iOS:function(e){e||(e={});switch(e.target){case 0:window.open(e.url,"_self");break;case 1:e.styleCode=1;switch(e.style){case 1:e.styleCode=4;break;case 2:e.styleCode=2;break;case 3:e.styleCode=5;break;default:e.styleCode=1}mqq.invoke("nav","openLinkInNewWebView",{url:e.url,options:e});break;case 2:mqq.invoke("nav","openLinkInSafari",{url:e.url})}},android:function(e){e.target==2?mqq.compare("4.6")>=0?mqq.invoke("publicAccount","openInExternalBrowser",e.url):mqq.compare("4.5")>=0&&mqq.invoke("openUrlApi","openUrl",e.url):e.target==1?(e.style||(e.style=0),mqq.compare("4.6")>=0?mqq.invoke("qbizApi","openLinkInNewWebView",e.url,e.style):mqq.compare("4.5")>=0?mqq.invoke("publicAccount","openUrl",e.url):location.href=e.url):location.href=e.url}}),mqq.build("mqq.ui.popBack",{iOS:function(){mqq.invoke("nav","popBack")},android:function(){mqq.invoke("publicAccount","close")}}),mqq.build("mqq.data.setShareInfo",{iOS:function(e,t){return mqq.invoke("data","setShareInfo",{params:e},t)},android:function(e,t){mqq.invoke("QQApi","setShareInfo",e,t)}})