((e,n)=>{"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)})(this,function(r,e){var a,c,n,i,t,s,d,o,l,u,p,f,m,g,h,S,I,y,v,_,k,w;if(!r.jWeixin)return a={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},c=(()=>{var e,n={};for(e in a)n[a[e]]=e;return n})(),i=(n=r.document).title,t=navigator.userAgent.toLowerCase(),f=navigator.platform.toLowerCase(),s=!(!f.match("mac")&&!f.match("win")),d=-1!=t.indexOf("wxdebugger"),o=-1!=t.indexOf("micromessenger"),l=-1!=t.indexOf("android"),u=-1!=t.indexOf("iphone")||-1!=t.indexOf("ipad"),p=(f=t.match(/micromessenger\/(\d+\.\d+\.\d+)/)||t.match(/micromessenger\/(\d+\.\d+)/))?f[1]:"",m={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},g={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:u?1:l?2:-1,clientVersion:p,url:encodeURIComponent(location.href)},h={},S={_completes:[]},I={state:0,data:{}},B(function(){m.initEndTime=L()}),y=!1,v=[],_={config:function(e){C("config",h=e);var o=!1!==h.check;B(function(){if(o)T(a.config,{verifyJsApiList:V(h.jsApiList)},(S._complete=function(e){m.preVerifyEndTime=L(),I.state=1,I.data=e},S.success=function(e){g.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):I.state=-1},(t=S._completes).push(function(){var n;s||d||h.debug||p<"6.0.2"||g.systemType<0||(n=new Image,g.appId=h.appId,g.initTime=m.initEndTime-m.initStartTime,g.preVerifyTime=m.preVerifyEndTime-m.preVerifyStartTime,_.getNetworkType({isInnerInvoke:!0,success:function(e){g.networkType=e.networkType,n.src="https://open.weixin.qq.com/sdk/report?v="+g.version+"&o="+g.isPreVerifyOk+"&s="+g.systemType+"&c="+g.clientVersion+"&a="+g.appId+"&n="+g.networkType+"&i="+g.initTime+"&p="+g.preVerifyTime+"&u="+g.url}}))}),S.complete=function(e){for(var n=0,i=t.length;n{var n;if("string"==typeof e&&0{var i,t=c[e];return t&&(e=t),t="ok",n&&(i=n.indexOf(":"),"access denied"!=(t=(t=(t=-1!=(t=-1!=(t="failed"==(t="confirm"==(t=n.substring(i+1))?"ok":t)?"fail":t).indexOf("failed_")?t.substring(7):t).indexOf("fail_")?t.substring(5):t).replace(/_/g," ")).toLowerCase())&&"no permission to execute"!=t||(t="permission denied"),""==(t="config"==e&&"function not exist"==t?"ok":t))&&(t="fail"),n=e+":"+t})(e,t),n.errMsg=t),(i=i||{})._complete&&(i._complete(n),delete i._complete),t=n.errMsg||"",h.debug&&!i.isInnerInvoke&&alert(JSON.stringify(n)),t.indexOf(":"));switch(t.substring(e+1)){case"ok":i.success&&i.success(n);break;case"cancel":i.cancel&&i.cancel(n);break;default:i.fail&&i.fail(n)}i.complete&&i.complete(n)}function V(e){if(e){for(var n=0,i=e.length;n