!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():t()}(this,function(){function app_js_bridge(){function e(e){n=e,_.isJSONString(n)&&(n=JSON.parse(n)),s&&(s(n),s=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=SensorsData_APP_JS_Bridge.sensorsdata_call_app(),_.isJSONString(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,s=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},sd.getAppStatus=function(e){return r(),t(),e?void(null===n?s=e:(e(n),n=null)):n}}try{var sd=window.sensorsDataAnalytic201505,has_declare;if(sd?(sd=window[sd],has_declare=!0):(sd={},has_declare=!1),"function"!=typeof sd&&"object"!=typeof sd||sd.has_load_sdk)return!1;sd._t=sd._t||1*new Date,sd.has_load_sdk=!0,"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var r,n,s,i,a,o=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,r=0;rsd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.callback_timeout>sd.para.queue_timeout&&(sd.para.queue_timeout=sd.para.callback_timeout),sd.para.queue_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.queue_timeout)};var ArrayProto=Array.prototype,FuncProto=Function.prototype,ObjProto=Object.prototype,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,LIB_VERSION="1.12.9";sd.lib_version=LIB_VERSION;var error_msg=[],is_first_visitor=!1,just_test_distinctid=0,just_test_distinctid_2=0,just_test_distinctid_detail=0,just_test_distinctid_detail2=0,source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",logger="object"==typeof logger?logger:{};logger.info=function(){if((_.sessionStorage.isSupport()&&"true"===sessionStorage.getItem("sensorsdata_jssdk_debug")||sd.para.show_log)&&(sd.para.show_log!==!0&&"string"!==sd.para.show_log&&sd.para.show_log!==!1||(arguments[0]=_.formatJsonString(arguments[0])),"object"==typeof console&&console.log))try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}},function(){var e=(FuncProto.bind,ArrayProto.forEach),t=(ArrayProto.indexOf,Array.isArray),r={},n=_.each=function(t,n,s){if(null==t)return!1;if(e&&t.forEach===e)t.forEach(n,s);else if(t.length===+t.length){for(var i=0,a=t.length;isd.para.max_string_length?(logger.info("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,sd.para.max_string_length)):e},_.searchObjString=function(e){_.isObject(e)&&_.each(e,function(t,r){_.isObject(t)?_.searchObjString(e[r]):_.isString(t)&&(e[r]=_.formatString(t))})},_.searchConfigData=function(e){if("object"==typeof e&&e.$option){var t=e.$option;return delete e.$option,t}return{}},_.unique=function(e){for(var t,r=[],n={},s=0;s127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==o&&(r>t&&(s+=e.substring(t,r)),s+=o,t=r=n+1)}return r>t&&(s+=e.substring(t,e.length)),s},_.base64Encode=function(e){var t,r,n,s,i,a,o,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,d=0,p="",f=[];if(!e)return e;e=_.utf8Encode(e);do t=e.charCodeAt(l++),r=e.charCodeAt(l++),n=e.charCodeAt(l++),c=t<<16|r<<8|n,s=c>>18&63,i=c>>12&63,a=c>>6&63,o=63&c,f[d++]=u.charAt(s)+u.charAt(i)+u.charAt(a)+u.charAt(o);while(l=4&&(a=t(a,i),i=[]);return i.length>0&&(a=t(a,i)),a.toString(16)};return function(){var n=String(screen.height*screen.width);n=n&&/\d{5,}/.test(n)?n.toString(16):String(31242*Math.random()).replace(".","").slice(0,8);var s=e()+"-"+t()+"-"+r()+"-"+n+"-"+e();return s?(just_test_distinctid_2=1,s):(just_test_distinctid_2=2,(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15))}}(),_.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=_.decodeURIComponent(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),s=n.exec(e);return null===s||s&&"string"!=typeof s[1]&&s[1].length?"":_.decodeURIComponent(s[1]).replace(/\+/g," ")},_.urlParse=function(e){var t=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,"undefined"!=typeof e&&this._parse(e)};return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!=typeof e)return!1;var t=this._values.QueryString||"";for(var r in e)t=new RegExp(r+"[^&]+").test(t)?t.replace(new RegExp(r+"[^&]+"),r+"="+e[r]):"&"===t.slice(-1)?t+r+"="+e[r]:""===t?r+"="+e[r]:t+"&"+r+"="+e[r];this._values.QueryString=t},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Port?":"+this._values.Port:"",e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:"",e+=this._values.Fragment?"#"+this._values.Fragment:""},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Port?":"+this._values.Port:"",e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:""},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);if(!t)throw"DPURLParser::_parse -> Invalid URL";for(var r in this._fields)"undefined"!=typeof t[this._fields[r]]&&(this._values[r]=t[this._fields[r]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new t(e)},_.addEvent=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,r,n){var s=function(s){if(s=s||e(window.event)){s.target=s.srcElement;var i,a,o=!0;return"function"==typeof n&&(i=n(s)),a=r.call(t,s),!1!==i&&!1!==a||(o=!1),o}};return s}e._getPath=function(){var e=this,t=function(){try{var t=e.target,r=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,r.unshift(t);return r}catch(n){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var r=function(r,n,s){if(r&&r.addEventListener)r.addEventListener(n,function(t){t._getPath=e._getPath,s.call(this,t)},!1);else{var i="on"+n,a=r[i];r[i]=t(r,s,a)}};r.apply(null,arguments)},_.addHashEvent=function(e){var t="pushState"in window.history?"popstate":"hashchange";_.addEvent(window,t,e)},_.cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=200&&r.status<300||304==r.status?e.success(t(r.responseText)):e.error(t(r.responseText),r.status),r.onreadystatechange=null,r.onload=null)}catch(n){r.onreadystatechange=null,r.onload=null}},r.open(e.type,e.url,!0);try{if(e.credentials&&(r.withCredentials=!0),_.isObject(e.header))for(var i in e.header)r.setRequestHeader(i,e.header[i]);e.data&&(e.cors||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(n){}r.send(e.data||null)},_.loadScript=function(e){e=_.extend({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.async="async",t.setAttribute("charset","UTF-8"),t.src=e.url,t.type="text/javascript"),t.onload=t.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(e.success(),t.onload=t.onreadystatechange=null)},t.onerror=function(){e.error(),t.onerror=null},e.appendCall(t)},_.url=function(){function e(){return new RegExp(/(.*?)\.?([^\.]*?)\.(com|net|org|biz|ws|in|me|co\.uk|co|org\.uk|ltd\.uk|plc\.uk|me\.uk|edu|mil|br\.com|cn\.com|eu\.com|hu\.com|no\.com|qc\.com|sa\.com|se\.com|se\.net|us\.com|uy\.com|ac|co\.ac|gv\.ac|or\.ac|ac\.ac|af|am|as|at|ac\.at|co\.at|gv\.at|or\.at|asn\.au|com\.au|edu\.au|org\.au|net\.au|id\.au|be|ac\.be|adm\.br|adv\.br|am\.br|arq\.br|art\.br|bio\.br|cng\.br|cnt\.br|com\.br|ecn\.br|eng\.br|esp\.br|etc\.br|eti\.br|fm\.br|fot\.br|fst\.br|g12\.br|gov\.br|ind\.br|inf\.br|jor\.br|lel\.br|med\.br|mil\.br|net\.br|nom\.br|ntr\.br|odo\.br|org\.br|ppg\.br|pro\.br|psc\.br|psi\.br|rec\.br|slg\.br|tmp\.br|tur\.br|tv\.br|vet\.br|zlg\.br|br|ab\.ca|bc\.ca|mb\.ca|nb\.ca|nf\.ca|ns\.ca|nt\.ca|on\.ca|pe\.ca|qc\.ca|sk\.ca|yk\.ca|ca|cc|ac\.cn|net\.cn|com\.cn|edu\.cn|gov\.cn|org\.cn|bj\.cn|sh\.cn|tj\.cn|cq\.cn|he\.cn|nm\.cn|ln\.cn|jl\.cn|hl\.cn|js\.cn|zj\.cn|ah\.cn|gd\.cn|gx\.cn|hi\.cn|sc\.cn|gz\.cn|yn\.cn|xz\.cn|sn\.cn|gs\.cn|qh\.cn|nx\.cn|xj\.cn|tw\.cn|hk\.cn|mo\.cn|cn|cx|cz|de|dk|fo|com\.ec|tm\.fr|com\.fr|asso\.fr|presse\.fr|fr|gf|gs|co\.il|net\.il|ac\.il|k12\.il|gov\.il|muni\.il|ac\.in|co\.in|org\.in|ernet\.in|gov\.in|net\.in|res\.in|is|it|ac\.jp|co\.jp|go\.jp|or\.jp|ne\.jp|ac\.kr|co\.kr|go\.kr|ne\.kr|nm\.kr|or\.kr|li|lt|lu|asso\.mc|tm\.mc|com\.mm|org\.mm|net\.mm|edu\.mm|gov\.mm|ms|nl|no|nu|pl|ro|org\.ro|store\.ro|tm\.ro|firm\.ro|www\.ro|arts\.ro|rec\.ro|info\.ro|nom\.ro|nt\.ro|se|si|com\.sg|org\.sg|net\.sg|gov\.sg|sk|st|tf|ac\.th|co\.th|go\.th|mi\.th|net\.th|or\.th|tm|to|com\.tr|edu\.tr|gov\.tr|k12\.tr|net\.tr|org\.tr|com\.tw|org\.tw|net\.tw|ac\.uk|uk\.com|uk\.net|gb\.com|gb\.net|vg|sh|kz|ch|info|ua|gov|name|pro|ie|hk|com\.hk|org\.hk|net\.hk|edu\.hk|us|tk|cd|by|ad|lv|eu\.lv|bz|es|jp|cl|ag|mobi|eu|co\.nz|org\.nz|net\.nz|maori\.nz|iwi\.nz|io|la|md|sc|sg|vc|tw|travel|my|se|tv|pt|com\.pt|edu\.pt|asia|fi|com\.ve|net\.ve|fi|org\.ve|web\.ve|info\.ve|co\.ve|tel|im|gr|ru|net\.ru|org\.ru|hr|com\.hr|ly|xyz)$/)}function t(e){return _.decodeURIComponent(e.replace(/\+/g," "))}function r(e,t){var r=e.charAt(0),n=t.split(r);return r===e?n:(e=parseInt(e.substring(1),10),n[e<0?n.length+e:e-1])}function n(e,r){for(var n=e.charAt(0),s=r.split("&"),i=[],a={},o=[],c=e.substring(1),u=0,l=s.length;u=0;n--){var s=r[n];if(t=s.style.getPropertyValue(e))return t}},sibling:function(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e},next:function(){return this.sibling(this.ele,"nextSibling")},prev:function(e){return this.sibling(this.ele,"previousSibling")},siblings:function(e){return this.siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(e){return this.siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,_.ry(e)}},_.jssdkDebug=function(e,t){if(sd.para.is_debug)if(_.isString(e))sd.registerPage({_jssdk_debug_info:e});else{var r=store.getCookieName(),n=document.cookie.match(new RegExp(r+"[^;]+"));r=n&&n[0]?n[0]:"",e._jssdk_debug_info="("+r+")"+navigator.userAgent}},_.strToUnicode=function(e){if("string"!=typeof e)return logger.info("\u8f6c\u6362unicode\u9519\u8bef",e),e;for(var t="",r=0;r0&&(e=e.concat(sd.para.source_channel),e=_.unique(e)),_.each(e,function(e){t=_.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=_.info.campaignParams(),n={},s={};for(var i in r)(" "+source_channel_standard+" ").indexOf(" "+i+" ")!==-1?n[e+i]=r[i]:s[t+i]=r[i];return{$utms:n,otherUtms:s}},properties:function(){return{$screen_height:Number(screen.height)||0,$screen_width:Number(screen.width)||0,$lib:"js",$lib_version:String(LIB_VERSION)}},currentProps:{},register:function(e){_.extend(_.info.currentProps,e)}},_.autoExeQueue=function(){var e={items:[],enqueue:function(e){this.items.push(e),this.start()},dequeue:function(){return this.items.shift()},getCurrentItem:function(){return this.items[0]},isRun:!1,start:function(){this.items.length>0&&!this.isRun&&(this.isRun=!0,this.getCurrentItem().start())},close:function(){this.dequeue(),this.isRun=!1,this.start()}};return e};var dataSend={};dataSend.getSendUrl=function(e,t){var r=_.base64Encode(t),n="crc="+_.hashCode(r);return e.indexOf("?")!==-1?e+"&data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n):e+"?data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)},dataSend.getSendData=function(e){var t=_.base64Encode(e),r="crc="+_.hashCode(t);return"data="+encodeURIComponent(t)+"&ext="+encodeURIComponent(r)}, dataSend.getInstance=function(e){var t={};t=!e.config||"image"!==e.config.send_type&&"ajax"!==e.config.send_type&&"beacon"!==e.config.send_type?new this[sd.para.send_type](e):new this[e.config.send_type](e);var r=t.start;return t.start=function(){var e=this;r.apply(this,arguments),setTimeout(function(){e.isEnd(!0)},sd.para.callback_timeout)},t.end=function(){this.callback&&this.callback();var e=this;setTimeout(function(){e.lastClear&&e.lastClear()},sd.para.datasend_timeout-sd.para.callback_timeout)},t.isEnd=function(e){if(!this.received){this.received=!0,this.end();var t=this;e?sd.para.queue_timeout-sd.para.callback_timeout<=0?t.close():setTimeout(function(){t.close()},sd.para.queue_timeout-sd.para.callback_timeout):t.close()}},t},dataSend.image=function(e){this.callback=e.callback,this.img=document.createElement("img"),this.img.width=1,this.img.height=1,this.data=e.data,this.server_url=dataSend.getSendUrl(e.server_url,e.data)},dataSend.image.prototype.start=function(){var e=this;sd.para.ignore_oom&&(this.img.onload=function(){this.onload=null,this.onerror=null,this.onabort=null,e.isEnd()},this.img.onerror=function(){this.onload=null,this.onerror=null,this.onabort=null,e.isEnd()},this.img.onabort=function(){this.onload=null,this.onerror=null,this.onabort=null,e.isEnd()}),this.img.src=this.server_url},dataSend.image.prototype.lastClear=function(){this.img.src=""},dataSend.ajax=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=dataSend.getSendData(e.data)},dataSend.ajax.prototype.start=function(){var e=this;_.ajax({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sd.para.datasend_timeout,cors:!0,success:function(){e.isEnd()},error:function(){e.isEnd()}})},dataSend.beacon=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=dataSend.getSendData(e.data)},dataSend.beacon.prototype.start=function(){var e=this;"object"==typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.server_url,this.data),setTimeout(function(){e.isEnd()},40)};var sendState={};sd.sendState=sendState,sendState.queue=_.autoExeQueue(),sendState.requestData=null,sendState.getSendCall=function(e,t,r){if(sd.is_heatmap_render_mode)return!1;e._track_id=Number(String(Math.random()).slice(2,5)+String(Math.random()).slice(2,4)+String((new Date).getTime()).slice(-4)),sd.para.use_client_time&&(e._flush_time=(new Date).getTime());var n=e;if(e=JSON.stringify(e),logger.info(n),this.requestData={data:e,config:t,callback:r},sd.para.use_app_track===!0||"only"===sd.para.use_app_track)if("object"==typeof SensorsData_APP_JS_Bridge&&(SensorsData_APP_JS_Bridge.sensorsdata_verify||SensorsData_APP_JS_Bridge.sensorsdata_track))SensorsData_APP_JS_Bridge.sensorsdata_verify?SensorsData_APP_JS_Bridge.sensorsdata_verify(JSON.stringify(_.extend({server_url:sd.para.server_url},n)))?"function"==typeof r&&r():this.prepareServerUrl():(SensorsData_APP_JS_Bridge.sensorsdata_track(JSON.stringify(_.extend({server_url:sd.para.server_url},n))),"function"==typeof r&&r());else if(!/sensors-verify/.test(navigator.userAgent)&&!/sa-sdk-ios/.test(navigator.userAgent)||window.MSStream)sd.para.use_app_track===!0&&this.prepareServerUrl();else{var s=null;if(/sensors-verify/.test(navigator.userAgent)){var i=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(i&&i[0]&&"string"==typeof i[1]&&2===i[1].split("?").length){i=i[1].split("?");var a=null,o=null;try{a=_.url("hostname",sd.para.server_url),o=_.url("?project",sd.para.server_url)||"default"}catch(c){}a&&a===i[0]&&o&&o===i[1]?(s=document.createElement("iframe"),s.setAttribute("src","sensorsanalytics://trackEvent?event="+encodeURIComponent(JSON.stringify(_.extend({server_url:sd.para.server_url},n)))),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,"function"==typeof r&&r()):this.prepareServerUrl()}}else s=document.createElement("iframe"),s.setAttribute("src","sensorsanalytics://trackEvent?event="+encodeURIComponent(JSON.stringify(_.extend({server_url:sd.para.server_url},n)))),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,"function"==typeof r&&r()}else"mui"===sd.para.use_app_track?_.isObject(window.plus)&&window.plus.SDAnalytics&&window.plus.SDAnalytics.trackH5Event&&window.plus.SDAnalytics.trackH5Event(e):this.prepareServerUrl()},sendState.prepareServerUrl=function(){if("object"==typeof this.requestData.config&&this.requestData.config.server_url)this.sendCall(this.requestData.config.server_url,this.requestData.callback);else if(_.isArray(sd.para.server_url))for(var e=0;e0&&(r.jssdk_error=error_msg.join("--")),_.isObject(e.properties)&&!_.isEmptyObject(e.properties)&&_.extend(r.properties,e.properties),_.isObject(t)&&_.extend(r.lib,t),e.type&&"profile"===e.type.slice(0,7)||(r.properties=_.extend({},_.info.properties(),store.getProps(),store.getSessionProps(),_.info.currentProps,r.properties),_.isString(r.properties.$latest_referrer)||(r.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38",_.jssdkDebug(r.properties,store.getProps())),_.isString(r.properties.$latest_referrer_host)||(r.properties.$latest_referrer_host="\u53d6\u503c\u5f02\u5e38"),_.isString(r.properties.$latest_search_keyword)||(r.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38"),_.isString(r.properties.$latest_traffic_source_type)||(r.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38")),r.properties.$time&&_.isDate(r.properties.$time)?(r.time=1*r.properties.$time,delete r.properties.$time):sd.para.use_client_time&&(r.time=1*new Date),_.searchObjDate(r),_.searchObjString(r),_.searchZZAppStyle(r);var s=_.searchConfigData(r.properties);saNewUser.checkIsAddSign(r),saNewUser.checkIsFirstTime(r),sd.para.debug_mode===!0?(logger.info(r),this.debugPath(JSON.stringify(r),t)):sd.sendState.getSendCall(r,s,t)},saEvent.debugPath=function(e,t){var r=e,n="";n=sd.para.debug_mode_url.indexOf("?")!==-1?sd.para.debug_mode_url+"&data="+encodeURIComponent(_.base64Encode(e)):sd.para.debug_mode_url+"?data="+encodeURIComponent(_.base64Encode(e)),_.ajax({url:n,type:"GET",cors:!0,header:{"Dry-Run":String(sd.para.debug_mode_upload)},success:function(e){_.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})};var store=sd.store={_sessionState:{},_state:{},getProps:function(){return this._state.props||{}},getSessionProps:function(){return this._sessionState},getDistinctId:function(){return this._state.distinct_id},getFirstId:function(){return this._state.first_id},toState:function(e){var t=null;if(null!=e&&_.isJSONString(e))if(t=JSON.parse(e),this._state=_.extend(t),t.distinct_id){if("object"==typeof t.props){for(var r in t.props)"string"==typeof t.props[r]&&(t.props[r]=t.props[r].slice(0,sd.para.max_referrer_string_length));this.save()}}else this.set("distinct_id",_.UUID()),error_msg.push("toStateParseDistinctError");else this.set("distinct_id",_.UUID()),error_msg.push("toStateParseError")},initSessionState:function(){var e=_.cookie.get("sensorsdata2015session"),t=null;null!==e&&"object"==typeof(t=JSON.parse(e))&&(this._sessionState=t||{})},setOnce:function(e,t){e in this._state||this.set(e,t)},set:function(e,t){this._state=this._state||{},this._state[e]=t,this.save()},change:function(e,t){this._state[e]=t},setSessionProps:function(e){var t=this._sessionState;_.extend(t,e),this.sessionSave(t)},setSessionPropsOnce:function(e){var t=this._sessionState;_.coverExtend(t,e),this.sessionSave(t)},setProps:function(e,t){var r=this._state.props||{};t?this.set("props",e):(_.extend(r,e),this.set("props",r))},removeProps:function(e){if(!_.isArray(e))return!1;for(var t=this._state.props||{},r=0;r "):this.getDomSelector(e.parentNode,t)):(t.unshift("body"),t.join(" > "))},na:function(){var e=document.documentElement.scrollLeft||window.pageXOffset;return parseInt(isNaN(e)?0:e,10)},i:function(){var e=0;try{e=o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,10)},getBrowserWidth:function(){var e=window.innerWidth||document.body.clientWidth;return isNaN(e)?0:parseInt(e,10)},getBrowserHeight:function(){var e=window.innerHeight||document.body.clientHeight;return isNaN(e)?0:parseInt(e,10)},getScrollWidth:function(){var e=parseInt(document.body.scrollWidth,10);return isNaN(e)?0:e},W:function(e){var t=parseInt(+e.clientX+ +this.na(),10),e=parseInt(+e.clientY+ +this.i(),10);return{x:isNaN(t)?0:t,y:isNaN(e)?0:e}},start:function(e,t,r){if(sd.para.heatmap&&sd.para.heatmap.collect_element&&!sd.para.heatmap.collect_element(t))return!1;var n=this.getDomSelector(t),s=_.getEleInfo({target:t});if(s.$element_selector=n?n:"",sd.para.heatmap&&sd.para.heatmap.custom_property){var i=sd.para.heatmap.custom_property(t);_.isObject(i)&&(s=_.extend(s,i))}"a"===r&&sd.para.heatmap&&sd.para.heatmap.isTrackLink===!0?_.trackLink({event:e,target:t},"$WebClick",s):sd.track("$WebClick",s)},hasElement:function(e){var t=e._getPath();if(_.isArray(t)&&t.length>0)for(var r=0;rsd.para.heatmap.scroll_delay_time&&t-e.$viewport_position!==0&&(e.$url=location.href,e.$title=document.title,e.$url_path=location.pathname,e.event_duration=parseInt(n)/1e3,sd.track("$WebStay",e)),this.current_time=r}});t.current_time=new Date,_.addEvent(window,"scroll",function(){t.go()}),_.addEvent(window,"unload",function(){t.go("notime")})},initHeatmap:function(){var e=this;return!(!_.isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)&&(!(_.isFunction(sd.para.heatmap.collect_url)&&!sd.para.heatmap.collect_url())&&("all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact",void("all"===sd.para.heatmap.collect_elements?_.addEvent(document,"click",function(t){var r=t||window.event;if(!r)return!1;var n=r.target||r.srcElement;if("object"!=typeof n)return!1;if("string"!=typeof n.tagName)return!1;var s=n.tagName.toLowerCase();if("body"===s.toLowerCase()||"html"===s.toLowerCase())return!1;if(!n||!n.parentNode||!n.parentNode.children)return!1;var i=n.parentNode.tagName.toLowerCase();"a"===i||"button"===i?e.start(r,n.parentNode,n.parentNode.tagName.toLowerCase()):e.start(r,n,s)}):_.addEvent(document,"click",function(t){var r=t||window.event;if(!r)return!1;var n=r.target||r.srcElement;if("object"!=typeof n)return!1;if("string"!=typeof n.tagName)return!1;var s=n.tagName.toLowerCase();if("body"===s.toLowerCase()||"html"===s.toLowerCase())return!1;if(!n||!n.parentNode||!n.parentNode.children)return!1;var i=n.parentNode;if("a"===s||"button"===s||"input"===s||"textarea"===s)e.start(r,n,s);else if("button"===i.tagName.toLowerCase()||"a"===i.tagName.toLowerCase())e.start(r,i,n.parentNode.tagName.toLowerCase());else if("area"===s&&"map"===i.tagName.toLowerCase()&&_.ry(i).prev().tagName&&"img"===_.ry(i).prev().tagName.toLowerCase())e.start(r,_.ry(i).prev(),_.ry(i).prev().tagName.toLowerCase());else{var a=e.hasElement(t);a&&e.start(r,a,a.tagName.toLowerCase())}}))))},prepare:function(e){function t(e,t,r){sd.para.heatmap_url?_.loadScript({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(sd,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(sd.heatmap_version&&sd.heatmap_version===sd.lib_version||console.log("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:sd.para.heatmap_url}):logger.info("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")}var r=location.search.match(/sa-request-id=([^&#]+)/),n=location.search.match(/sa-request-type=([^&#]+)/),s=location.search.match(/sa-request-url=([^&#]+)/);r&&r[0]&&r[1]?(sd.is_heatmap_render_mode=!0,_.sessionStorage.isSupport()&&(s&&s[0]&&s[1]&&sessionStorage.setItem("sensors_heatmap_url",decodeURIComponent(s[1])),sessionStorage.setItem("sensors_heatmap_id",r[1]),n&&n[0]&&n[1]?"1"===n[1]||"2"===n[1]||"3"===n[1]?(n=n[1],sessionStorage.setItem("sensors_heatmap_type",n)):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),t(r[1],n)):_.sessionStorage.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")?(sd.is_heatmap_render_mode=!0,t(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)):(e(),_.isObject(sd.para.heatmap)&&(this.initHeatmap(),this.initScrollmap()))}};return sd.init=function(e){return!(sd.readyState&&sd.readyState>=2)&&void((!e&&has_declare||e&&!has_declare)&&(sd.readyState=2,sd.initPara(e),sd._init()))},sd._init=function(){heatmap.prepare(function(){app_js_bridge(),_.info.initPage(),store.init(),sd._q&&_.isArray(sd._q)&&sd._q.length>0&&_.each(sd._q,function(e){sd[e[0]].apply(sd,slice.call(e[1]))})})},sd.init(),sd}catch(err){if("object"==typeof console&&console.log)try{console.log(err)}catch(e){}}});