From 23b822d0a38be2f287855a09d4ff699fbbafbeb5 Mon Sep 17 00:00:00 2001 From: shengyonggen Date: Wed, 12 Jul 2023 18:35:18 +0800 Subject: [PATCH] Release 1.25.10 --- CHANGELOG.md | 4 + core/sensorsdata.amd.min.js | 8 +- core/sensorsdata.es6.min.js | 2 +- core/sensorsdata.min.js | 8 +- dist/sat/sensorsdata-sat.amd.js | 8 +- dist/sat/sensorsdata-sat.es6.js | 2 +- dist/sat/sensorsdata-sat.js | 8 +- .../abtesting-sdk-web/abtest.amd.min.js | 2 +- .../abtesting-sdk-web/abtest.esm.min.js | 2 +- .../plugin/abtesting-sdk-web/abtest.min.js | 2 +- .../plugin/abtesting-sdk-web/vabtest.min.js | 2 +- .../plugin/aes-encryption/index.closure.js | 2 +- dist/web/plugin/aes-encryption/index.es6.js | 2 +- dist/web/plugin/aes-encryption/index.js | 2 +- dist/web/plugin/ajax-sender/index.closure.js | 2 +- dist/web/plugin/ajax-sender/index.es6.js | 2 +- dist/web/plugin/ajax-sender/index.js | 2 +- dist/web/plugin/amp/index.closure.js | 2 +- dist/web/plugin/amp/index.es6.js | 2 +- dist/web/plugin/amp/index.js | 2 +- .../plugin/android-bridge/index.closure.js | 2 +- dist/web/plugin/android-bridge/index.es6.js | 2 +- dist/web/plugin/android-bridge/index.js | 2 +- .../android-obsolete-bridge/index.closure.js | 2 +- .../android-obsolete-bridge/index.es6.js | 2 +- .../plugin/android-obsolete-bridge/index.js | 2 +- dist/web/plugin/batch-sender/index.closure.js | 2 +- dist/web/plugin/batch-sender/index.es6.js | 2 +- dist/web/plugin/batch-sender/index.js | 2 +- .../web/plugin/beacon-sender/index.closure.js | 2 +- dist/web/plugin/beacon-sender/index.es6.js | 2 +- dist/web/plugin/beacon-sender/index.js | 2 +- dist/web/plugin/channel-utm/index.closure.js | 2 +- dist/web/plugin/channel-utm/index.es6.js | 2 +- dist/web/plugin/channel-utm/index.js | 2 +- dist/web/plugin/channel/index.closure.js | 2 +- dist/web/plugin/channel/index.es6.js | 2 +- dist/web/plugin/channel/index.js | 2 +- .../plugin/console-logger/index.closure.js | 2 +- dist/web/plugin/console-logger/index.es6.js | 2 +- .../custom-events-sender/index.closure.js | 2 +- .../plugin/custom-events-sender/index.es6.js | 2 +- dist/web/plugin/custom-events-sender/index.js | 2 +- dist/web/plugin/debug-sender/index.closure.js | 2 +- dist/web/plugin/debug-sender/index.es6.js | 2 +- dist/web/plugin/debug-sender/index.js | 2 +- dist/web/plugin/deeplink/index.closure.js | 2 +- dist/web/plugin/deeplink/index.es6.js | 2 +- dist/web/plugin/deeplink/index.js | 2 +- dist/web/plugin/disable-sdk/index.closure.js | 2 +- dist/web/plugin/disable-sdk/index.es6.js | 2 +- dist/web/plugin/disable-sdk/index.js | 2 +- dist/web/plugin/exposure/index.closure.js | 2 +- dist/web/plugin/exposure/index.es6.js | 2 +- dist/web/plugin/exposure/index.js | 2 +- .../general-encryption/index.closure.js | 2 +- .../plugin/general-encryption/index.es6.js | 2 +- dist/web/plugin/general-encryption/index.js | 2 +- dist/web/plugin/image-sender/index.closure.js | 2 +- dist/web/plugin/image-sender/index.es6.js | 2 +- dist/web/plugin/image-sender/index.js | 2 +- dist/web/plugin/ios-bridge/index.closure.js | 2 +- dist/web/plugin/ios-bridge/index.es6.js | 2 +- dist/web/plugin/ios-bridge/index.js | 2 +- .../ios-obsolete-bridge/index.closure.js | 2 +- .../plugin/ios-obsolete-bridge/index.es6.js | 2 +- dist/web/plugin/ios-obsolete-bridge/index.js | 2 +- dist/web/plugin/jsapp-sender/index.closure.js | 2 +- dist/web/plugin/jsapp-sender/index.es6.js | 2 +- dist/web/plugin/jsapp-sender/index.js | 2 +- dist/web/plugin/pageleave/index.closure.js | 2 +- dist/web/plugin/pageleave/index.es6.js | 2 +- dist/web/plugin/pageleave/index.js | 2 +- dist/web/plugin/pageload/index.closure.js | 2 +- dist/web/plugin/pageload/index.es6.js | 2 +- dist/web/plugin/pageload/index.js | 2 +- .../register-properties/index.closure.js | 2 +- .../plugin/register-properties/index.es6.js | 2 +- dist/web/plugin/register-properties/index.js | 2 +- .../index.closure.js | 2 +- .../index.es6.js | 2 +- .../register-property-page-height/index.js | 2 +- .../plugin/sat-props-patch/index.closure.js | 2 +- dist/web/plugin/sat-props-patch/index.es6.js | 2 +- dist/web/plugin/sat-props-patch/index.js | 2 +- .../web/plugin/session-event/index.closure.js | 2 +- dist/web/plugin/session-event/index.es6.js | 2 +- dist/web/plugin/session-event/index.js | 2 +- .../plugin/sf-instant-event/index.closure.js | 2 +- dist/web/plugin/sf-instant-event/index.es6.js | 2 +- dist/web/plugin/sf-instant-event/index.js | 2 +- dist/web/plugin/sf-sdk-web/popup.amd.min.js | 2 +- dist/web/plugin/sf-sdk-web/popup.esm.min.js | 2 +- dist/web/plugin/sf-sdk-web/popup.min.js | 2 +- .../web/plugin/sf-sdk-web/webPopup.amd.min.js | 2 +- .../web/plugin/sf-sdk-web/webPopup.esm.min.js | 2 +- dist/web/plugin/sf-sdk-web/webPopup.min.js | 2 +- .../site-linker-concat-utm/index.closure.js | 2 +- .../site-linker-concat-utm/index.es6.js | 2 +- .../plugin/site-linker-concat-utm/index.js | 2 +- dist/web/plugin/site-linker/index.closure.js | 2 +- dist/web/plugin/site-linker/index.es6.js | 2 +- dist/web/plugin/site-linker/index.js | 2 +- .../user-encrypt-default/index.closure.js | 2 +- .../plugin/user-encrypt-default/index.es6.js | 2 +- dist/web/plugin/utm/index.closure.js | 2 +- dist/web/plugin/utm/index.es6.js | 2 +- dist/web/plugin/utm/index.js | 2 +- .../wechat-webview-channel/index.closure.js | 2 +- .../wechat-webview-channel/index.es6.js | 2 +- .../plugin/wechat-webview-channel/index.js | 2 +- dist/web/sensorsdata.amd.js | 8 +- dist/web/sensorsdata.es6.js | 2 +- dist/web/sensorsdata.js | 8 +- heatmap.min.js | 2 +- package.json | 2 +- product/heatmap.full.js | 2 +- product/sensorsdata.amd.full.js | 87 ++++++++++++------- product/sensorsdata.es6.full.js | 87 ++++++++++++------- product/sensorsdata.full.js | 87 ++++++++++++------- sensorsdata.amd.min.js | 8 +- sensorsdata.es6.min.js | 2 +- sensorsdata.min.js | 8 +- version.js | 2 +- vtrack.min.js | 2 +- 125 files changed, 323 insertions(+), 232 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 202fb02d..99555736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.25.10 (2023-7-12) +1. 修复 + - 修复自定义埋点 `track` 方法参数 `option` 失效的问题 + ## 1.25.9 (2023-6-27) 1. 修复 - 修复数据接收地址配置成数组且发送方式为 `img` 时数据发送异常的问题 diff --git a/core/sensorsdata.amd.min.js b/core/sensorsdata.amd.min.js index ad5fcfd7..a5a84ead 100644 --- a/core/sensorsdata.amd.min.js +++ b/core/sensorsdata.amd.min.js @@ -1,6 +1,6 @@ !function(e,t){"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define(t)}(this,function(){function e(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function t(){return Date.now&&e(Date.now)?Date.now():(new Date).getTime()}function r(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}function n(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),r(e)&&e.getRandomValues){var t=new Uint32Array(1),n=e.getRandomValues(t)[0],i=Math.pow(2,32);return n/i}}return Xi(1e19)/1e19}function i(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function a(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function s(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&s(e.listener)}function l(){this._events={}}function u(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function c(e){e=e||"";for(var t={},r=e.substring(1),n=r.split("&"),i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Wi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Gi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Wi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(Yi&&e.forEach===Yi)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Wi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Wi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Wi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Wi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Wi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Wi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Wi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Wi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:pa.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,$a._state.identities);var a={identities:i,distinct_id:$a.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,$a.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ba.properties(),$a.getProps(),$a.getSessionProps(),ba.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ua.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Ba.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Sa.checkIsAddSign(a),Sa.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Ma.stage.process("basicProps",e)}function dt(e){return Ma.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Ka.stage.process("webClickEvent",e)}function ht(e){return Ka.stage.process("webStayEvent",e)}function mt(){var e=ba.campaignParams(),t={};return k(e,function(e,r,n){(" "+Fi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(Fi.is_first_visitor&&r){var n={};Fi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=va.id(),n.$search_keyword_id_type=va.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),Fi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Za.EVENT_LIST&&(r=Za.EVENT_LIST[e],Za[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=$a.getFirstId(),s=$a.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===$a.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(a)&&n===$a._state.first_id)return!1;var l=$a._state.history_login_id.name!==a||n!==$a._state.history_login_id.value;if(l){$a._state.identities[a]=n,$a.set("history_login_id",{name:a,value:n}), o||$a.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:$a._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];$a._state.identities=t,$a.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(e)&&$a._state.identities[e]===t){var n=$a.getUnionId().login_id;n&&e+"+"+t===n&&($a._state.distinct_id=$a._state.first_id,$a._state.first_id="",$a.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete $a._state.identities[e],$a.save())}var i={};return i[e]=t,i}function Pt(){Fi._t=Fi._t||1*new Date,Fi.is_first_visitor=!1,Fi.source_channel_standard=fa}function Ct(e){P(pa,e||Fi.para||{}),Fi.para=pa;var t={};if(r(Fi.para.is_track_latest))for(var n in Fi.para.is_track_latest)t["latest_"+n]=Fi.para.is_track_latest[n];Fi.para.preset_properties=P({},da.preset_properties,t,Fi.para.preset_properties||{});var i;for(i in da)void 0===Fi.para[i]&&(Fi.para[i]=da[i]);"string"!=typeof Fi.para.web_url||"://"!==Fi.para.web_url.slice(0,3)&&"//"!==Fi.para.web_url.slice(0,2)||("://"===Fi.para.web_url.slice(0,3)?Fi.para.web_url=location.protocol.slice(0,-1)+Fi.para.web_url:Fi.para.web_url=location.protocol+Fi.para.web_url),ya.protocol.serverUrl(),Fi.bridge&&Fi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Fi.para.source_type&&(Fi.para.source_type.utm=v(Fi.para.source_type.utm)?Fi.para.source_type.utm.concat(a):a,Fi.para.source_type.search=v(Fi.para.source_type.search)?Fi.para.source_type.search.concat(o):o,Fi.para.source_type.social=v(Fi.para.source_type.social)?Fi.para.source_type.social.concat(s):s,Fi.para.source_type.keyword=r(Fi.para.source_type.keyword)?P(l,Fi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Fi.para.heatmap&&!r(Fi.para.heatmap)&&(Fi.para.heatmap={}),r(Fi.para.heatmap)){Fi.para.heatmap.clickmap=Fi.para.heatmap.clickmap||"default",Fi.para.heatmap.scroll_notice_map=Fi.para.heatmap.scroll_notice_map||"default",Fi.para.heatmap.scroll_delay_time=Fi.para.heatmap.scroll_delay_time||4e3,Fi.para.heatmap.scroll_event_duration=Fi.para.heatmap.scroll_event_duration||18e3,Fi.para.heatmap.renderRefreshTime=Fi.para.heatmap.renderRefreshTime||1e3,Fi.para.heatmap.loadTimeout=Fi.para.heatmap.loadTimeout||1e3,Fi.para.heatmap.get_vtrack_config!==!0&&(Fi.para.heatmap.get_vtrack_config=!1);var p=v(Fi.para.heatmap.track_attr)?U(Fi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),Fi.para.heatmap.track_attr=p,r(Fi.para.heatmap.collect_tags))if(Fi.para.heatmap.collect_tags.div===!0)Fi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Fi.para.heatmap.collect_tags.div)){if(Fi.para.heatmap.collect_tags.div.ignore_tags?v(Fi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Fi.para.heatmap.collect_tags.div.ignore_tags=c):Fi.para.heatmap.collect_tags.div.ignore_tags=c,Fi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,Fi.para.heatmap.collect_tags.div.max_level)===-1&&(Fi.para.heatmap.collect_tags.div.max_level=1)}}else Fi.para.heatmap.collect_tags.div=!1;else Fi.para.heatmap.collect_tags=u}Fi.para.server_url=Ge(Fi.para.server_url),Fi.para.noCache===!0?Fi.para.noCache="?"+(new Date).getTime():Fi.para.noCache="",Fi.para.callback_timeout>Fi.para.datasend_timeout&&(Fi.para.datasend_timeout=Fi.para.callback_timeout),Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&r(Fi.para.heatmap.collect_tags)&&k(Fi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Fi.heatmap.otherTags.push(t)}),Fi.para.heatmap&&"default"===Fi.para.heatmap.clickmap&&Fi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Wa[t]?Wa[t].apply(Wa,r):void("function"==typeof t?t.apply(Fi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Fi,n),a.plugin_is_init=!0,Fi.modules=Fi.modules||{},Fi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Fi.modules&&Fi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(Fi.modules)&&r(Fi.modules[t])?a=Fi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Fi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&qa.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&($a._state.identities[e]=t,$a.save(),void qa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&qa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,Fi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,Fi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Fi.track(t,r,i)})}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&qa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&qa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||qa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?qa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){qa.send({type:"profile_delete"},e),$a.set("distinct_id",Zi()),$a.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),qa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=$a.getFirstId();if("undefined"==typeof e){var n=Zi();r?$a.set("first_id",n):$a.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?$a.set("first_id",e):$a.set("distinct_id",e):r?$a.change("first_id",e):$a.change("distinct_id",e))}function Mt(e,t,r,n){var i=$a.getFirstId()||$a.getDistinctId();$a.set("distinct_id",e),qa.send({original_id:i,distinct_id:$a.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ba.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){$a.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Fi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){Fi.para.is_track_single_page&&za.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ba.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Fi.quick&&Fi.quick("autoTrack",i)}};if("boolean"==typeof Fi.para.is_track_single_page)i();else if("function"==typeof Fi.para.is_track_single_page){var a=Fi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){Fi._q&&v(Fi._q)&&Fi._q.length>0&&k(Fi._q,function(e){Fi[e[0]].apply(Fi,Array.prototype.slice.call(e[1]))}),r(Fi.para.heatmap)&&(Va.initHeatmap(),Va.initScrollmap())}function pr(){Fi.readyState.setState(3),new Fi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode)}),lr(!1),Fi.bridge.app_js_bridge_v1(),ba.initPage(),ur(),$a.init(),or(),fr(),Fi.readyState.setState(4),cr()}function dr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function fr(){Ba.init(),"success"===Fi.bridge.bridge_info.verify_success&&Ua.init()}function gr(){k(io,function(t){var r=Fi[t];Fi[t]=function(){return Fi.readyState.state<3?(v(Fi._q)||(Fi._q=[]),Ne("calling sdk api before init is deprecated."),Fi._q.push([t,arguments]),!1):e(Fi.getDisabled)&&Fi.getDisabled()?void 0:Fi.readyState.getState()?r.apply(Fi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function yr(e,t){_o[e]&&_o[e](t)}function br(){return ho.stage&&ho.stage.process("getUtmData")}function wr(e){return mo.stage.process("send",e)}function Sr(e){e.kit=vo,e.saEvent=qa,this.buildDataStage=Ma,this.sendDataStage=mo,this.businessStage=ho}function kr(e){e.heatmap=Va,this.viewStage=Ka}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(Fi.events=Ia,Fi.bridge=to,Fi.SDKJSBridge=rr,Fi.JSBridge=ar,Fi.store=$a,Fi.unlimitedDiv=Ra,Fi.customProp=Ha,Fi.vtrackcollect=Ba,Fi.vapph5collect=Ua,Fi.detectMode=dr,Fi.registerFeature=vr,Fi.registerInterceptor=yr,Fi.commonWays=Wa,vr(new Sr(Fi)),vr(new kr(Fi)),yr("viewStage",yo));var t=e?Ya:ao;for(var r in t)Fi[r]=t[r];Fi.logger=ca,Fi.log=Oe,Fi._=eo,Fi.on=bt,Fi.ee=Za,Fi.use=Nt,Fi.lib_version=ga,Fi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=Bo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function Ar(e){return zo&&zo.call(Vo,JSON.stringify(e))}function Dr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=Go,e}function Rr(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),Co&&!Co.bridge.activeBridge&&Po){if(Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},!Co.para.app_js_bridge)return void No("app_js_bridge is not configured, data will not be sent by android bridge.");Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),No("Android bridge inits succeed.")}}function Hr(e,t){if(Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return rs&&rs.call(es,JSON.stringify(e))}function Mr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=as,e}function Wr(){if(jo=window.SensorsData_APP_JS_Bridge,To=jo&&jo.sensorsdata_track,Io=jo&&jo.sensorsdata_verify,$o=jo&&jo.sensorsdata_visual_verify,Ao&&!Ao.bridge.activeBridge&&(Io||To||$o)){Ao.bridge.activeBridge=os;var e=Io||To;if($o&&(e=!!$o.call(jo,JSON.stringify({server_url:Ao.para.server_url}))),Ao.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Ao.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Ao.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),xo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Ao.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Io){var n=Io&&Io.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data)));return n?(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Ao.para.app_js_bridge.is_send?(Ao.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return To&&To.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data))),Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in is.commands?is.commands[t](e,jo):jo&&Do.isFunction(jo.sensorsdata_js_call_app)?jo.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ls,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=ps,e}function rn(){return"undefined"!=typeof Ho&&document[Ho]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=As,e}function sn(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=Ds,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),ms("IOS bridge inits succeed.")}}function ln(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Es,e}function fn(){if(vs&&!vs.bridge.activeBridge&&gn()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),bs("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Rs,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=Bs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=qs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); -}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===pl.para.send_type){var r=e.server_url;e.data=pl.kit.encodeTrackData(e.data),dl.isArray(r)&&r.length?dl.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof pl.para.server_url&&""!==pl.para.server_url?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===fl.para.send_type){var r=e.server_url;e.data=fl.kit.encodeTrackData(e.data),gl.isArray(r)&&r.length?gl.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof fl.para.server_url&&""!==fl.para.server_url?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;hl.isArray(r)&&r.length?hl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Ri(){return!!Ki()||Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Ki()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1; -return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.9",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.9",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.9",Ls={ -init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.9",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.9",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.9",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;dl.isObject(e.config)&&(r=e.config.send_type,n=dl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===pl.para.send_type;if(i&&dl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=pl.kit.encodeTrackData(e.data),dl.isArray(a)&&a.length?dl.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Ri(){return!!Ki()||Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Ki()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n); +if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.10",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.10",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.10",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.10",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.10",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){ +this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.10",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.10",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.10",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.10",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.10",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.10",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.10",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.10",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.10",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.10",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.10",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.10",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.10",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0);return $[t]||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,d,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){for(var t,r,i,a,s="",o=0,l=(e=String(e)).length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{if(isString(e)||(e=String(e)),e=trim(e),!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e()||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}.apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--)if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;i&&(n=getQueryParamsFromUrl(i)[t]||"")}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl&&new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return!(t&&t.name&&t.name===e||indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||isFunction(checkLog[r])&&checkLog[r]("Property Value"),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t}),check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){"item_type"in e&&check({item_type:e.item_type},function(t){return t||delete e.item_type,!0}),"item_id"in e&&check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){return!e.element_path||"div"===trim(e.element_path.split(">").pop()).slice(0,3)},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);return r?getDomBySelector(r+t)||null:(sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null)},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&"li"===e.tagName.toLowerCase())return e;return null}(e)},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags)?!0===sd.para.heatmap.collect_tags.div?sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1}:isObject(sd.para.heatmap.collect_tags.div)?(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level&&-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)):sd.para.heatmap.collect_tags.div=!1:sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)})}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?saEvent.send({type:"profile_increment",properties:e},t):sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};return this.getPartHash(e)?(a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d):(a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l),t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return e=source_channel_standard$1.split(" "),t="",r={},sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e)),sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r;var e,t,r}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t,r=e;t=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:t,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback,debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){if("beacon"===sd$b.para.send_type){var r=e.server_url;e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(r)&&r.length?_$9.each(r,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof sd$b.para.server_url&&""!==sd$b.para.server_url?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){if("ajax"===sd$c.para.send_type){var r=e.server_url;e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(r)&&r.length?_$a.each(r,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof sd$c.para.server_url&&""!==sd$c.para.server_url?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=e.server_url,n=e.data;_$b.isArray(r)&&r.length?_$b.each(r,function(t){t&&(e.data=getSendUrl(t,n),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof r&&""!==r?(e.data=getSendUrl(r,n),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level}function canWarn(){return!!isLocalLogEnabled()||canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level}function canError(){return!!isLocalLogEnabled()||!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0);return $[t]||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,d,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){for(var t,r,i,a,s="",o=0,l=(e=String(e)).length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{if(isString(e)||(e=String(e)),e=trim(e),!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e()||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}.apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--)if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;i&&(n=getQueryParamsFromUrl(i)[t]||"")}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl&&new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return!(t&&t.name&&t.name===e||indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||isFunction(checkLog[r])&&checkLog[r]("Property Value"),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t}),check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){"item_type"in e&&check({item_type:e.item_type},function(t){return t||delete e.item_type,!0}),"item_id"in e&&check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){return!e.element_path||"div"===trim(e.element_path.split(">").pop()).slice(0,3)},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);return r?getDomBySelector(r+t)||null:(sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null)},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&"li"===e.tagName.toLowerCase())return e;return null}(e)},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags)?!0===sd.para.heatmap.collect_tags.div?sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1}:isObject(sd.para.heatmap.collect_tags.div)?(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level&&-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)):sd.para.heatmap.collect_tags.div=!1:sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)})}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?saEvent.send({type:"profile_increment",properties:e},t):sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.10";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.10";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.10";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.10";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.10";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.10";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.10";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.10";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.10";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.10";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.10";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.10";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};return this.getPartHash(e)?(a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d):(a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l),t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return e=source_channel_standard$1.split(" "),t="",r={},sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e)),sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r;var e,t,r}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.10";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.10";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t,r=e;t=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:t,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback,debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.10";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.10";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.10";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.10";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level}function canWarn(){return!!isLocalLogEnabled()||canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level}function canError(){return!!isLocalLogEnabled()||!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Wi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Gi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Wi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(Yi&&e.forEach===Yi)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Wi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Wi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Wi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Wi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Wi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Wi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Wi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Wi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:pa.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,$a._state.identities);var a={identities:i,distinct_id:$a.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,$a.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ba.properties(),$a.getProps(),$a.getSessionProps(),ba.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ua.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Ba.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Sa.checkIsAddSign(a),Sa.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Ma.stage.process("basicProps",e)}function dt(e){return Ma.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Ka.stage.process("webClickEvent",e)}function ht(e){return Ka.stage.process("webStayEvent",e)}function mt(){var e=ba.campaignParams(),t={};return k(e,function(e,r,n){(" "+Fi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(Fi.is_first_visitor&&r){var n={};Fi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=va.id(),n.$search_keyword_id_type=va.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),Fi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Za.EVENT_LIST&&(r=Za.EVENT_LIST[e],Za[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=$a.getFirstId(),s=$a.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===$a.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(a)&&n===$a._state.first_id)return!1;var l=$a._state.history_login_id.name!==a||n!==$a._state.history_login_id.value;if(l){$a._state.identities[a]=n,$a.set("history_login_id",{name:a,value:n}),o||$a.set("first_id",s), t(n,"$SignUp",{},i);var u={$identity_cookie_id:$a._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];$a._state.identities=t,$a.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(e)&&$a._state.identities[e]===t){var n=$a.getUnionId().login_id;n&&e+"+"+t===n&&($a._state.distinct_id=$a._state.first_id,$a._state.first_id="",$a.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete $a._state.identities[e],$a.save())}var i={};return i[e]=t,i}function Pt(){Fi._t=Fi._t||1*new Date,Fi.is_first_visitor=!1,Fi.source_channel_standard=fa}function Ct(e){P(pa,e||Fi.para||{}),Fi.para=pa;var t={};if(r(Fi.para.is_track_latest))for(var n in Fi.para.is_track_latest)t["latest_"+n]=Fi.para.is_track_latest[n];Fi.para.preset_properties=P({},da.preset_properties,t,Fi.para.preset_properties||{});var i;for(i in da)void 0===Fi.para[i]&&(Fi.para[i]=da[i]);"string"!=typeof Fi.para.web_url||"://"!==Fi.para.web_url.slice(0,3)&&"//"!==Fi.para.web_url.slice(0,2)||("://"===Fi.para.web_url.slice(0,3)?Fi.para.web_url=location.protocol.slice(0,-1)+Fi.para.web_url:Fi.para.web_url=location.protocol+Fi.para.web_url),ya.protocol.serverUrl(),Fi.bridge&&Fi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Fi.para.source_type&&(Fi.para.source_type.utm=v(Fi.para.source_type.utm)?Fi.para.source_type.utm.concat(a):a,Fi.para.source_type.search=v(Fi.para.source_type.search)?Fi.para.source_type.search.concat(o):o,Fi.para.source_type.social=v(Fi.para.source_type.social)?Fi.para.source_type.social.concat(s):s,Fi.para.source_type.keyword=r(Fi.para.source_type.keyword)?P(l,Fi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Fi.para.heatmap&&!r(Fi.para.heatmap)&&(Fi.para.heatmap={}),r(Fi.para.heatmap)){Fi.para.heatmap.clickmap=Fi.para.heatmap.clickmap||"default",Fi.para.heatmap.scroll_notice_map=Fi.para.heatmap.scroll_notice_map||"default",Fi.para.heatmap.scroll_delay_time=Fi.para.heatmap.scroll_delay_time||4e3,Fi.para.heatmap.scroll_event_duration=Fi.para.heatmap.scroll_event_duration||18e3,Fi.para.heatmap.renderRefreshTime=Fi.para.heatmap.renderRefreshTime||1e3,Fi.para.heatmap.loadTimeout=Fi.para.heatmap.loadTimeout||1e3,Fi.para.heatmap.get_vtrack_config!==!0&&(Fi.para.heatmap.get_vtrack_config=!1);var p=v(Fi.para.heatmap.track_attr)?U(Fi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),Fi.para.heatmap.track_attr=p,r(Fi.para.heatmap.collect_tags))if(Fi.para.heatmap.collect_tags.div===!0)Fi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Fi.para.heatmap.collect_tags.div)){if(Fi.para.heatmap.collect_tags.div.ignore_tags?v(Fi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Fi.para.heatmap.collect_tags.div.ignore_tags=c):Fi.para.heatmap.collect_tags.div.ignore_tags=c,Fi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,Fi.para.heatmap.collect_tags.div.max_level)===-1&&(Fi.para.heatmap.collect_tags.div.max_level=1)}}else Fi.para.heatmap.collect_tags.div=!1;else Fi.para.heatmap.collect_tags=u}Fi.para.server_url=Ge(Fi.para.server_url),Fi.para.noCache===!0?Fi.para.noCache="?"+(new Date).getTime():Fi.para.noCache="",Fi.para.callback_timeout>Fi.para.datasend_timeout&&(Fi.para.datasend_timeout=Fi.para.callback_timeout),Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&r(Fi.para.heatmap.collect_tags)&&k(Fi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Fi.heatmap.otherTags.push(t)}),Fi.para.heatmap&&"default"===Fi.para.heatmap.clickmap&&Fi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Wa[t]?Wa[t].apply(Wa,r):void("function"==typeof t?t.apply(Fi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Fi,n),a.plugin_is_init=!0,Fi.modules=Fi.modules||{},Fi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Fi.modules&&Fi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(Fi.modules)&&r(Fi.modules[t])?a=Fi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Fi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&qa.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&($a._state.identities[e]=t,$a.save(),void qa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&qa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,Fi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,Fi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Fi.track(t,r,i)})}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&qa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&qa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||qa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?qa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){qa.send({type:"profile_delete"},e),$a.set("distinct_id",Zi()),$a.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),qa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=$a.getFirstId();if("undefined"==typeof e){var n=Zi();r?$a.set("first_id",n):$a.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?$a.set("first_id",e):$a.set("distinct_id",e):r?$a.change("first_id",e):$a.change("distinct_id",e))}function Mt(e,t,r,n){var i=$a.getFirstId()||$a.getDistinctId();$a.set("distinct_id",e),qa.send({original_id:i,distinct_id:$a.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ba.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){$a.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Fi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){Fi.para.is_track_single_page&&za.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ba.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Fi.quick&&Fi.quick("autoTrack",i)}};if("boolean"==typeof Fi.para.is_track_single_page)i();else if("function"==typeof Fi.para.is_track_single_page){var a=Fi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){Fi._q&&v(Fi._q)&&Fi._q.length>0&&k(Fi._q,function(e){Fi[e[0]].apply(Fi,Array.prototype.slice.call(e[1]))}),r(Fi.para.heatmap)&&(Va.initHeatmap(),Va.initScrollmap())}function pr(){Fi.readyState.setState(3),new Fi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode)}),lr(!1),Fi.bridge.app_js_bridge_v1(),ba.initPage(),ur(),$a.init(),or(),fr(),Fi.readyState.setState(4),cr()}function dr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function fr(){Ba.init(),"success"===Fi.bridge.bridge_info.verify_success&&Ua.init()}function gr(){k(io,function(t){var r=Fi[t];Fi[t]=function(){return Fi.readyState.state<3?(v(Fi._q)||(Fi._q=[]),Ne("calling sdk api before init is deprecated."),Fi._q.push([t,arguments]),!1):e(Fi.getDisabled)&&Fi.getDisabled()?void 0:Fi.readyState.getState()?r.apply(Fi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function yr(e,t){_o[e]&&_o[e](t)}function br(){return ho.stage&&ho.stage.process("getUtmData")}function wr(e){return mo.stage.process("send",e)}function Sr(e){e.kit=vo,e.saEvent=qa,this.buildDataStage=Ma,this.sendDataStage=mo,this.businessStage=ho}function kr(e){e.heatmap=Va,this.viewStage=Ka}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(Fi.events=Ia,Fi.bridge=to,Fi.SDKJSBridge=rr,Fi.JSBridge=ar,Fi.store=$a,Fi.unlimitedDiv=Ra,Fi.customProp=Ha,Fi.vtrackcollect=Ba,Fi.vapph5collect=Ua,Fi.detectMode=dr,Fi.registerFeature=vr,Fi.registerInterceptor=yr,Fi.commonWays=Wa,vr(new Sr(Fi)),vr(new kr(Fi)),yr("viewStage",yo));var t=e?Ya:ao;for(var r in t)Fi[r]=t[r];Fi.logger=ca,Fi.log=Oe,Fi._=eo,Fi.on=bt,Fi.ee=Za,Fi.use=Nt,Fi.lib_version=ga,Fi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=Bo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function Ar(e){return zo&&zo.call(Vo,JSON.stringify(e))}function Dr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=Go,e}function Rr(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),Co&&!Co.bridge.activeBridge&&Po){if(Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},!Co.para.app_js_bridge)return void No("app_js_bridge is not configured, data will not be sent by android bridge.");Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),No("Android bridge inits succeed.")}}function Hr(e,t){if(Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return rs&&rs.call(es,JSON.stringify(e))}function Mr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=as,e}function Wr(){if(jo=window.SensorsData_APP_JS_Bridge,To=jo&&jo.sensorsdata_track,Io=jo&&jo.sensorsdata_verify,$o=jo&&jo.sensorsdata_visual_verify,Ao&&!Ao.bridge.activeBridge&&(Io||To||$o)){Ao.bridge.activeBridge=os;var e=Io||To;if($o&&(e=!!$o.call(jo,JSON.stringify({server_url:Ao.para.server_url}))),Ao.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Ao.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Ao.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),xo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Ao.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Io){var n=Io&&Io.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data)));return n?(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Ao.para.app_js_bridge.is_send?(Ao.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return To&&To.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data))),Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in is.commands?is.commands[t](e,jo):jo&&Do.isFunction(jo.sensorsdata_js_call_app)?jo.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ls,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=ps,e}function rn(){return"undefined"!=typeof Ho&&document[Ho]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=As,e}function sn(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=Ds,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),ms("IOS bridge inits succeed.")}}function ln(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Es,e}function fn(){if(vs&&!vs.bridge.activeBridge&&gn()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),bs("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Rs,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=Bs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=qs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){ -n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===pl.para.send_type){var r=e.server_url;e.data=pl.kit.encodeTrackData(e.data),dl.isArray(r)&&r.length?dl.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof pl.para.server_url&&""!==pl.para.server_url?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===fl.para.send_type){var r=e.server_url;e.data=fl.kit.encodeTrackData(e.data),gl.isArray(r)&&r.length?gl.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof fl.para.server_url&&""!==fl.para.server_url?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;hl.isArray(r)&&r.length?hl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Ri(){return!!Ki()||Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Ki()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1; -return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.9",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.9",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.9",Ls={ -init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.9",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.9",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.9",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;dl.isObject(e.config)&&(r=e.config.send_type,n=dl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===pl.para.send_type;if(i&&dl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=pl.kit.encodeTrackData(e.data),dl.isArray(a)&&a.length?dl.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Ri(){return!!Ki()||Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Ki()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&(!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l; +}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.10",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.10",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.10",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.10",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.10",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){ +var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.10",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.10",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.10",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.10",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.10",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.10",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.10",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.10",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.10",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.10",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.10",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.10",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.10",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ea(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ra&&e.forEach===ra)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Zi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Zi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:ga.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa._state.identities);var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ka.properties(),xa.getProps(),xa.getSessionProps(),ka.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ba.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Ca.checkIsAddSign(a),Ca.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Fa.stage.process("basicProps",e)}function dt(e){return Fa.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Wa.stage.process("webClickEvent",e)}function ht(e){return Wa.stage.process("webStayEvent",e)}function mt(){var e=ka.campaignParams(),t={};return k(e,function(e,r,n){(" "+zi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(zi.is_first_visitor&&r){var n={};zi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=wa.id(),n.$search_keyword_id_type=wa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),zi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Ya.EVENT_LIST&&(r=Ya.EVENT_LIST[e],Ya[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}), o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){zi._t=zi._t||1*new Date,zi.is_first_visitor=!1,zi.source_channel_standard=ha}function Ct(e){P(ga,e||zi.para||{}),zi.para=ga;var t={};if(r(zi.para.is_track_latest))for(var n in zi.para.is_track_latest)t["latest_"+n]=zi.para.is_track_latest[n];zi.para.preset_properties=P({},_a.preset_properties,t,zi.para.preset_properties||{});var i;for(i in _a)void 0===zi.para[i]&&(zi.para[i]=_a[i]);"string"!=typeof zi.para.web_url||"://"!==zi.para.web_url.slice(0,3)&&"//"!==zi.para.web_url.slice(0,2)||("://"===zi.para.web_url.slice(0,3)?zi.para.web_url=location.protocol.slice(0,-1)+zi.para.web_url:zi.para.web_url=location.protocol+zi.para.web_url),Sa.protocol.serverUrl(),zi.bridge&&zi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof zi.para.source_type&&(zi.para.source_type.utm=v(zi.para.source_type.utm)?zi.para.source_type.utm.concat(a):a,zi.para.source_type.search=v(zi.para.source_type.search)?zi.para.source_type.search.concat(o):o,zi.para.source_type.social=v(zi.para.source_type.social)?zi.para.source_type.social.concat(s):s,zi.para.source_type.keyword=r(zi.para.source_type.keyword)?P(l,zi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(zi.para.heatmap&&!r(zi.para.heatmap)&&(zi.para.heatmap={}),r(zi.para.heatmap)){zi.para.heatmap.clickmap=zi.para.heatmap.clickmap||"default",zi.para.heatmap.scroll_notice_map=zi.para.heatmap.scroll_notice_map||"default",zi.para.heatmap.scroll_delay_time=zi.para.heatmap.scroll_delay_time||4e3,zi.para.heatmap.scroll_event_duration=zi.para.heatmap.scroll_event_duration||18e3,zi.para.heatmap.renderRefreshTime=zi.para.heatmap.renderRefreshTime||1e3,zi.para.heatmap.loadTimeout=zi.para.heatmap.loadTimeout||1e3,zi.para.heatmap.get_vtrack_config!==!0&&(zi.para.heatmap.get_vtrack_config=!1);var p=v(zi.para.heatmap.track_attr)?U(zi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),zi.para.heatmap.track_attr=p,r(zi.para.heatmap.collect_tags))if(zi.para.heatmap.collect_tags.div===!0)zi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(zi.para.heatmap.collect_tags.div)){if(zi.para.heatmap.collect_tags.div.ignore_tags?v(zi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),zi.para.heatmap.collect_tags.div.ignore_tags=c):zi.para.heatmap.collect_tags.div.ignore_tags=c,zi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,zi.para.heatmap.collect_tags.div.max_level)===-1&&(zi.para.heatmap.collect_tags.div.max_level=1)}}else zi.para.heatmap.collect_tags.div=!1;else zi.para.heatmap.collect_tags=u}zi.para.server_url=Ge(zi.para.server_url),zi.para.noCache===!0?zi.para.noCache="?"+(new Date).getTime():zi.para.noCache="",zi.para.callback_timeout>zi.para.datasend_timeout&&(zi.para.datasend_timeout=zi.para.callback_timeout),zi.para.heatmap&&zi.para.heatmap.collect_tags&&r(zi.para.heatmap.collect_tags)&&k(zi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&zi.heatmap.otherTags.push(t)}),zi.para.heatmap&&"default"===zi.para.heatmap.clickmap&&zi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(zi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(zi,n),a.plugin_is_init=!0,zi.modules=zi.modules||{},zi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=zi.modules&&zi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(zi.modules)&&r(zi.modules[t])?a=zi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==zi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,zi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,zi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),zi.track(t,r,i)}))}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Yi()),xa.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=xa.getFirstId();if("undefined"==typeof e){var n=Yi();r?xa.set("first_id",n):xa.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?xa.set("first_id",e):xa.set("distinct_id",e):r?xa.change("first_id",e):xa.change("distinct_id",e))}function Mt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ka.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){xa.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(zi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){zi.para.is_track_single_page&&Ga.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ka.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):zi.quick&&zi.quick("autoTrack",i)}};if("boolean"==typeof zi.para.is_track_single_page)i();else if("function"==typeof zi.para.is_track_single_page){var a=zi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){zi._q&&v(zi._q)&&zi._q.length>0&&k(zi._q,function(e){zi[e[0]].apply(zi,Array.prototype.slice.call(e[1]))}),r(zi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){zi.readyState.setState(3),new zi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),lr(!1),zi.bridge.app_js_bridge_v1(),ka.initPage(),ur(),xa.init(),or(),fr(),zi.readyState.setState(4),cr()}function dr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function fr(){qa.init(),"success"===zi.bridge.bridge_info.verify_success&&Ba.init()}function gr(){k(so,function(t){var r=zi[t];zi[t]=function(){if(zi.readyState.state<3)return v(zi._q)||(zi._q=[]),Ne("calling sdk api before init is deprecated."),zi._q.push([t,arguments]),!1;if(!e(zi.getDisabled)||!zi.getDisabled())return zi.readyState.getState()?r.apply(zi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function yr(e,t){vo[e]&&vo[e](t)}function br(){return yo.stage&&yo.stage.process("getUtmData")}function wr(e){return bo.stage.process("send",e)}function Sr(e){e.kit=wo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=bo,this.businessStage=yo}function kr(e){e.heatmap=Xa,this.viewStage=Wa}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(zi.events=Da,zi.bridge=io,zi.SDKJSBridge=rr,zi.JSBridge=ar,zi.store=xa,zi.unlimitedDiv=Ja,zi.customProp=Ma,zi.vtrackcollect=qa,zi.vapph5collect=Ba,zi.detectMode=dr,zi.registerFeature=vr,zi.registerInterceptor=yr,zi.commonWays=Za,vr(new Sr(zi)),vr(new kr(zi)),yr("viewStage",So));var t=e?ro:lo;for(var r in t)zi[r]=t[r];zi.logger=fa,zi.log=Oe,zi._=no,zi.on=bt,zi.ee=Ya,zi.use=Nt,zi.lib_version=ma,zi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function Ar(e){return Go&&Go.call(Xo,JSON.stringify(e))}function Dr(e){return Zo.call(Xo)&&Qo&&Qo.call(Xo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=es,e}function Rr(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),jo&&!jo.bridge.activeBridge&&No){if(jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},!jo.para.app_js_bridge)return void Io("app_js_bridge is not configured, data will not be sent by android bridge.");jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),Io("Android bridge inits succeed.")}}function Hr(e,t){if(jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(Oo&&Oo.call(Co,JSON.stringify(To.extend({server_url:jo.para.server_url},e.data))),To.isFunction(r)&&r(),t.cancellationToken.cancel(),e):jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(To.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&To.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return as&&as.call(ns,JSON.stringify(e))}function Mr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=ls,e}function Wr(){if($o=window.SensorsData_APP_JS_Bridge,Ao=$o&&$o.sensorsdata_track,Do=$o&&$o.sensorsdata_verify,xo=$o&&$o.sensorsdata_visual_verify,Eo&&!Eo.bridge.activeBridge&&(Do||Ao||xo)){Eo.bridge.activeBridge=us;var e=Do||Ao;if(xo&&(e=!!xo.call($o,JSON.stringify({server_url:Eo.para.server_url}))),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),Uo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Do){var n=Do&&Do.call($o,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Ao&&Ao.call($o,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in ss.commands?ss.commands[t](e,$o):$o&&Lo.isFunction($o.sensorsdata_js_call_app)?$o.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ps,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=gs,e}function rn(){return"undefined"!=typeof Mo&&document[Mo]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=Es,e}function sn(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),bs("IOS bridge inits succeed.")}}function ln(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Rs,e}function fn(){if(ws&&!ws.bridge.activeBridge&&gn()){if(ws.bridge.activeBridge=Hs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),ks("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Js,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=qs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=Vs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); -}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=al,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function Mn(){Ol=!0}function qn(){Ol=!1}function Kn(){return Ol}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Il,e}function zn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Zn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Dl,e}function ti(e,t){if(pl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){cl.on("sdkAfterInitAPI",function(){pl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ni),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&pl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();pl.isArray(t)&&t.length>0&&pl.each(t,function(e){pl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Ll,e}function si(e,t){return!dl.para.app_js_bridge&&dl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Bl,e}function fi(e){var t=new _l.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===gl.para.send_type){var r=e.server_url;e.data=gl.kit.encodeTrackData(e.data),_l.isArray(r)&&r.length?_l.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof gl.para.server_url&&""!==gl.para.server_url?fi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function hi(){gl.on("sdkInitPara",function(){_i()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=ql,e}function bi(e){var t=new ml.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===hl.para.send_type){var r=e.server_url;e.data=hl.kit.encodeTrackData(e.data),ml.isArray(r)&&r.length?ml.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof hl.para.server_url&&""!==hl.para.server_url?bi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function ki(){hl.on("sdkInitPara",function(){Si()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=Vl,e}function Ni(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;yl.isArray(r)&&r.length?yl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function $i(){vl.on("sdkInitPara",function(){Ii()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ma,e}function Ei(e){return null===Gl?void Li(e):void Gl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Ki()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Bi(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Ki(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Fi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wi(e,t,r){return Fi(e,t,r),e.plugin_version=uu,e}var zi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Xi,Zi={setup:function(e){Xi=e},log:function(){(Xi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Qi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ea=function(e){this.ele=e},ta=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ea.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return ta((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ta(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+ga.sdk_id+e}},Ca={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ba.get("sensorsdata2015jssdkcross"+zi.para.sdk_id);n=zi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,zi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),zi.para.encrypt_cookie&&(i=zi.kit.userEncrypt(i)),ba.set("sensorsdata2015jssdkcross"+zi.para.sdk_id,i,null,!0)),zi.para.is_track_device_id&&(ka.currentProps.$device_id=r)},storeInitCheck:function(){if(zi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ba.isSupport()?ba.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Pa.set(Pa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},Oa=function(){this._events=[],this.pendingEvents=[]};Oa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Na.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:ga.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ta="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},ga.batch_send.send_interval)},getServerUrl:function(){return p(ga.server_url)&&""!==ga.server_url||v(ga.server_url)&&ga.server_url.length?void(this.serverUrl=v(ga.server_url)?ga.server_url[0]:ga.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Ta+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*ga.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),zi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ta+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*ga.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(Gi.get(s))||{expireTime:0};t()-d.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;tga.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>ga.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>ga.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};et({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ra.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=zi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=zi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ha={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),zi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new zi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=zi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ba={events:[],customProp:Ha,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new zi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new zi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=zi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(zi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(zi.para.heatmap)||!zi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&zi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1; -if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&zi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=zi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){zi.is_heatmap_render_mode=!0,zi.para.heatmap||(zi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(zi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),zi.para.heatmap_url||(zi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=zi.heatmap.getElementPath(e,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);var n=zi.heatmap.getElementPosition(e,r.$element_path,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(zi.para.heatmap)&&e(zi.para.heatmap.collect_element)&&!zi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(zi.para.heatmap&&zi.para.heatmap.custom_property){var c=zi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div?!!(r(zi.para.heatmap)&&r(zi.para.heatmap.collect_tags)&&r(zi.para.heatmap.collect_tags.div)&&v(zi.para.heatmap.collect_tags.div.ignore_tags)&&re(zi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=zi.para&&zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),zi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.scroll_notice_map)return!1;var t=!0;zi.para.scrollmap&&e(zi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!zi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>zi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(zi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.clickmap)&&(e(zi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!zi.para.heatmap.collect_url()}),"all"===zi.para.heatmap.collect_elements?zi.para.heatmap.collect_elements="all":zi.para.heatmap.collect_elements="interact",void("all"===zi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=zi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(zi.para.heatmap)&&zi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void zi.log("error: isReady callback must be function")},getUtm:function(){return ka.campaignParams()},getStayTime:function(){return(new Date-zi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return zi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),zi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),zi.setProfile(e)},setInitReferrer:function(){var e=De();zi.setOnceProfile({_init_referrer:e,_init_referrer_host:ka.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ka.pageProp.referrer_host})},setDefaultAttr:function(){ka.register({_current_url:location.href,_referrer:De(),_referring_host:ka.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=zi.para.heatmap&&zi.para.heatmap.track_attr?zi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){zi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ka.pageProp.url:ka.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(zi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;zi.para.is_single_page&&w(function(){var r=De(a,!0);zi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),zi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(zi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa._state._first_id||xa._state.first_id||xa._state._distinct_id||xa._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(zi.modules)&&zi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){zi.use.apply(zi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga=new l,Qa=new l,Ya={};Ya.spa=Ga,Ya.sdk=Qa,Ya.initSystemEvent=function(){yt(function(e){Ga.emit("switch",e)})},Ya.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:eo,debug:Sa,on:bt,log:Oe};Zi.setup(Oe);var no=P({},pa,Aa),io={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:zi.para.use_app_track_is_send!==!1&&"only"!==zi.para.use_app_track,white_list:[],is_mui:"mui"===zi.para.use_app_track};"object"==typeof zi.para.app_js_bridge?zi.para.app_js_bridge=P({},e,zi.para.app_js_bridge):zi.para.use_app_track!==!0&&zi.para.app_js_bridge!==!0&&"only"!==zi.para.use_app_track&&"mui"!==zi.para.use_app_track||(zi.para.app_js_bridge=P({},e)),zi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},zi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return zi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),sa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){zi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(zi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(zi.heatmap_version&&zi.heatmap_version===zi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:zi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),sa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:zi.para.vtrack_url?zi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(sa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ma}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,zi),a=0;a=2)&&(Po&&(Cr(!0),gr()),Ya.initSystemEvent(),zi.setInitVar(),zi.readyState.setState(2),zi.initPara(e),Ya.sdk.emit("initPara"),Ya.sdk.emit("afterInitPara"),Ya.sdk.emit("initAPI"),Ya.sdk.emit("afterInitAPI"),zi.detectMode(),tr(),Ya.sdk.emit("afterInit"),void Ya.sdk.emit("ready"))},Po?Cr(!1):(Cr(!0),gr());var Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo,Jo,Mo,qo="1.25.9",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=jr(Ko),Vo="1.25.9",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=$r(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},es="1.25.9",ts={init:function(e){jo=e,To=jo&&jo._,Io=jo&&jo.log||console&&console.log||function(){},Rr()},handleCommand:Br},rs=Ur(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},ls="1.25.9",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},Wr()},handleCommand:Xr},cs=Vr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ps="1.25.9",ds={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Ho._,Bo=Ho.store,!!Ro.localStorage.isSupport()&&(Ho.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Ho||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Ho=e;var n=this;r()},addIsChannelCallbackEvent:function(){Ho.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ds.eventList.hasEvent(e.event)&&(ds.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ds.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Ho.registerPage(t):Ho.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Ho.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Ho.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Ho.para.encrypt_cookie&&(r=Ho.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Ho.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Is(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Ts(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ds.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ds.data=e,Ds.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ds.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),As(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"), -$s(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=_s().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},xs=tn(Ds,"Deeplink","sdkReady"),Es="1.25.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},sn()},handleCommand:un},Us=on(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.25.9",Hs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},fn()}},Bs=dn(Hs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.25.9",Ms=5e3,qs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new bn,Fs=yn(Ks,"PageLeave","sdkReady"),Vs="1.25.9",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=kn(zs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new Cn,el=jn(Ys),tl="1.25.9",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=An,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=$n(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.25.9",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml,vl,yl,bl=En(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.25.9",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Rn(kl,"Utm","sdkAfterInitPara"),Cl="1.25.9",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=Mn,Nl.enableSDK=qn,Nl.getDisabled=Kn}},Tl=Jn(jl,"DisableSDK","sdkInitAPI"),Il="1.25.9",$l={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Al=Wn($l),Dl="1.25.9",xl={plugin_name:"JsappSender",init:function(e){cl=e,pl=cl._,ri()}},El=ei(xl),Ll="1.25.9",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){dl=e,fl=dl._,ui()}},Hl=oi(Rl),Bl="1.25.9",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,hi()}},Ml=di(Jl),ql="1.25.9",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,ki()}},Fl=yi(Kl),Vl="1.25.9",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,$i()}},zl=Oi(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Ei),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=al,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function Mn(){Ol=!0}function qn(){Ol=!1}function Kn(){return Ol}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Il,e}function zn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Zn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Dl,e}function ti(e,t){if(pl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){cl.on("sdkAfterInitAPI",function(){pl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ni),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&pl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();pl.isArray(t)&&t.length>0&&pl.each(t,function(e){pl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Ll,e}function si(e,t){return!dl.para.app_js_bridge&&dl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Bl,e}function fi(e){var t=new _l.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function hi(){gl.on("sdkInitPara",function(){_i()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=ql,e}function bi(e){var t=new ml.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function ki(){hl.on("sdkInitPara",function(){Si()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=Vl,e}function Ni(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function $i(){vl.on("sdkInitPara",function(){Ii()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ma,e}function Ei(e){return null===Gl?void Li(e):void Gl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Ki()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Bi(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Ki(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Fi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wi(e,t,r){return Fi(e,t,r),e.plugin_version=uu,e}var zi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Xi,Zi={setup:function(e){Xi=e},log:function(){(Xi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Qi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ea=function(e){this.ele=e},ta=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ea.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return ta((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ta(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+ga.sdk_id+e}},Ca={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ba.get("sensorsdata2015jssdkcross"+zi.para.sdk_id);n=zi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,zi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),zi.para.encrypt_cookie&&(i=zi.kit.userEncrypt(i)),ba.set("sensorsdata2015jssdkcross"+zi.para.sdk_id,i,null,!0)),zi.para.is_track_device_id&&(ka.currentProps.$device_id=r)},storeInitCheck:function(){if(zi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ba.isSupport()?ba.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Pa.set(Pa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},Oa=function(){this._events=[],this.pendingEvents=[]};Oa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Na.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:ga.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ta="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},ga.batch_send.send_interval)},getServerUrl:function(){return p(ga.server_url)&&""!==ga.server_url||v(ga.server_url)&&ga.server_url.length?void(this.serverUrl=v(ga.server_url)?ga.server_url[0]:ga.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Ta+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*ga.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),zi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ta+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*ga.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(Gi.get(s))||{expireTime:0};t()-d.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;tga.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>ga.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>ga.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};et({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ra.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=zi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=zi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ha={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),zi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new zi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=zi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ba={events:[],customProp:Ha,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new zi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new zi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=zi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(zi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(zi.para.heatmap)||!zi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&zi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&zi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=zi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){zi.is_heatmap_render_mode=!0,zi.para.heatmap||(zi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(zi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),zi.para.heatmap_url||(zi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=zi.heatmap.getElementPath(e,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);var n=zi.heatmap.getElementPosition(e,r.$element_path,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(zi.para.heatmap)&&e(zi.para.heatmap.collect_element)&&!zi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(zi.para.heatmap&&zi.para.heatmap.custom_property){var c=zi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div?!!(r(zi.para.heatmap)&&r(zi.para.heatmap.collect_tags)&&r(zi.para.heatmap.collect_tags.div)&&v(zi.para.heatmap.collect_tags.div.ignore_tags)&&re(zi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=zi.para&&zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),zi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.scroll_notice_map)return!1;var t=!0;zi.para.scrollmap&&e(zi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!zi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>zi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(zi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.clickmap)&&(e(zi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!zi.para.heatmap.collect_url()}),"all"===zi.para.heatmap.collect_elements?zi.para.heatmap.collect_elements="all":zi.para.heatmap.collect_elements="interact",void("all"===zi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=zi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(zi.para.heatmap)&&zi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void zi.log("error: isReady callback must be function")},getUtm:function(){return ka.campaignParams()},getStayTime:function(){return(new Date-zi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return zi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),zi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),zi.setProfile(e)},setInitReferrer:function(){var e=De();zi.setOnceProfile({_init_referrer:e,_init_referrer_host:ka.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ka.pageProp.referrer_host})},setDefaultAttr:function(){ka.register({_current_url:location.href,_referrer:De(),_referring_host:ka.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=zi.para.heatmap&&zi.para.heatmap.track_attr?zi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){zi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ka.pageProp.url:ka.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(zi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;zi.para.is_single_page&&w(function(){var r=De(a,!0);zi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),zi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(zi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa._state._first_id||xa._state.first_id||xa._state._distinct_id||xa._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(zi.modules)&&zi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){zi.use.apply(zi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga=new l,Qa=new l,Ya={};Ya.spa=Ga,Ya.sdk=Qa,Ya.initSystemEvent=function(){yt(function(e){Ga.emit("switch",e)})},Ya.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:eo,debug:Sa,on:bt,log:Oe};Zi.setup(Oe);var no=P({},pa,Aa),io={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:zi.para.use_app_track_is_send!==!1&&"only"!==zi.para.use_app_track,white_list:[],is_mui:"mui"===zi.para.use_app_track};"object"==typeof zi.para.app_js_bridge?zi.para.app_js_bridge=P({},e,zi.para.app_js_bridge):zi.para.use_app_track!==!0&&zi.para.app_js_bridge!==!0&&"only"!==zi.para.use_app_track&&"mui"!==zi.para.use_app_track||(zi.para.app_js_bridge=P({},e)),zi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},zi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return zi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),sa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){zi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(zi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(zi.heatmap_version&&zi.heatmap_version===zi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:zi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),sa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:zi.para.vtrack_url?zi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(sa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ma}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,zi),a=0;a=2)&&(Po&&(Cr(!0),gr()),Ya.initSystemEvent(),zi.setInitVar(),zi.readyState.setState(2),zi.initPara(e),Ya.sdk.emit("initPara"),Ya.sdk.emit("afterInitPara"),Ya.sdk.emit("initAPI"),Ya.sdk.emit("afterInitAPI"),zi.detectMode(),tr(),Ya.sdk.emit("afterInit"),void Ya.sdk.emit("ready"))},Po?Cr(!1):(Cr(!0),gr());var Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo,Jo,Mo,qo="1.25.10",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=jr(Ko),Vo="1.25.10",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=$r(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},es="1.25.10",ts={init:function(e){jo=e,To=jo&&jo._,Io=jo&&jo.log||console&&console.log||function(){},Rr()},handleCommand:Br},rs=Ur(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},ls="1.25.10",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},Wr()},handleCommand:Xr},cs=Vr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ps="1.25.10",ds={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Ho._,Bo=Ho.store,!!Ro.localStorage.isSupport()&&(Ho.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Ho||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Ho=e;var n=this;r()},addIsChannelCallbackEvent:function(){Ho.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ds.eventList.hasEvent(e.event)&&(ds.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ds.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Ho.registerPage(t):Ho.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Ho.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Ho.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Ho.para.encrypt_cookie&&(r=Ho.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Ho.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Is(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Ts(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ds.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ds.data=e,Ds.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ds.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1); +},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),As(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),$s(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=_s().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},xs=tn(Ds,"Deeplink","sdkReady"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},sn()},handleCommand:un},Us=on(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.25.10",Hs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},fn()}},Bs=dn(Hs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.25.10",Ms=5e3,qs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new bn,Fs=yn(Ks,"PageLeave","sdkReady"),Vs="1.25.10",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=kn(zs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new Cn,el=jn(Ys),tl="1.25.10",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=An,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=$n(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.25.10",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml,vl,yl,bl=En(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.25.10",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Rn(kl,"Utm","sdkAfterInitPara"),Cl="1.25.10",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=Mn,Nl.enableSDK=qn,Nl.getDisabled=Kn}},Tl=Jn(jl,"DisableSDK","sdkInitAPI"),Il="1.25.10",$l={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Al=Wn($l),Dl="1.25.10",xl={plugin_name:"JsappSender",init:function(e){cl=e,pl=cl._,ri()}},El=ei(xl),Ll="1.25.10",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){dl=e,fl=dl._,ui()}},Hl=oi(Rl),Bl="1.25.10",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,hi()}},Ml=di(Jl),ql="1.25.10",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,ki()}},Fl=yi(Kl),Vl="1.25.10",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,$i()}},zl=Oi(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Ei),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,d,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};(function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}).apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--){if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){if(e.element_path&&"div"!==trim(e.element_path.split(">").pop()).slice(0,3))return!1;return!0},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t)))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):saEvent.send({type:"profile_increment",properties:e},t))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r}()}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t=e,r="";r=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){if("beacon"===sd$b.para.send_type){var r=e.server_url;e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(r)&&r.length?_$9.each(r,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof sd$b.para.server_url&&""!==sd$b.para.server_url?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){if("ajax"===sd$c.para.send_type){var r=e.server_url;e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(r)&&r.length?_$a.each(r,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof sd$c.para.server_url&&""!==sd$c.para.server_url?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=e.server_url,n=e.data;_$b.isArray(r)&&r.length?_$b.each(r,function(t){t&&(e.data=getSendUrl(t,n),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof r&&""!==r?(e.data=getSendUrl(r,n),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$m(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$m(e,t,r){return wrapPluginInitFn$m(e,t,r),e.plugin_version=sdkversion_placeholder$m,e}var sd$f,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(e){e&&!sd$f&&((sd$f=e)._.each(utmKeys,function(e){sd$f.source_channel_standard=sd$f.source_channel_standard+" "+e,sd$f.para.source_type.utm.push(e)}),sd$f.registerInterceptor("businessStage",{getUtmData:{entry:function(e){var t=!1,r=e||{};return sd$f._.each(utmKeys,function(e){var n=sd$f._.getQueryParam(location.href,e);n.length&&(t=!0,r[e.slice(8)]=n)}),t&&sd$f.register&&sd$f.register({link_v:"1"}),r}}}))}},index$l=createPlugin$m(ChannelUtm,"ChannelUtm","sdkAfterInitPara");sd$e.use(index$4),sd$e.use(index$l);export default sd$e; \ No newline at end of file +var logFn,sd={};function isFunction(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function now(){return Date.now&&isFunction(Date.now)?Date.now():(new Date).getTime()}(function(){var e={"function":!0,object:!0},t=e[typeof window]&&window||this;var r=t.JSON,n=t.JSON3,i=!1,a=function s(r,n){r||(r=t.Object()),n||(n=t.Object());var i=r.Number||t.Number,a=r.String||t.String,o=r.Object||t.Object,l=r.Date||t.Date,c=r.SyntaxError||t.SyntaxError,d=r.TypeError||t.TypeError,u=r.Math||t.Math,p=r.JSON||t.JSON;if("object"==typeof p&&p)return n.stringify=p.stringify,n.parse=p.parse,n.runInContext=s,n;var g,f=o.prototype,_=f.toString,h=f.hasOwnProperty;function m(e,t){try{e()}catch(r){t&&t()}}var v=new l(-0xc782b5b800cec);function y(e){if(null!=y[e])return y[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=y("json-stringify")&&y("date-serialization")&&y("json-parse");else if("date-serialization"==e){if(t=y("json-stringify")&&v){var r=n.stringify;m(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new l(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==r(new l(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new l(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==r(new l(-1))})}}else{var s,o='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var c="function"==typeof(r=n.stringify);c&&((s=function(){return 1}).toJSON=s,m(function(){c="0"===r(0)&&"0"===r(new i)&&'""'==r(new a)&&r(_)===g&&r(g)===g&&r()===g&&"1"===r(s)&&"[1]"==r([s])&&"[null]"==r([g])&&"null"==r(null)&&"[null,null,null]"==r([g,_,null])&&r({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==o&&"1"===r(null,s)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,u=n.parse;"function"==typeof u&&m(function(){0!==u("0")||u(!1)||(s=u(o),(d=5==s.a.length&&1===s.a[0])&&(m(function(){d=!u('"\t"')}),d&&m(function(){d=1!==u("01")}),d&&m(function(){d=1!==u("1.")})))},function(){d=!1}),t=d}}return y[e]=!!t}if(m(function(){v=-109252==v.getUTCFullYear()&&0===v.getUTCMonth()&&1===v.getUTCDate()&&10==v.getUTCHours()&&37==v.getUTCMinutes()&&6==v.getUTCSeconds()&&708==v.getUTCMilliseconds()}),y["bug-string-char-index"]=y["date-serialization"]=y.json=y["json-stringify"]=y["json-parse"]=null,!y("json")){var b=y("bug-string-char-index"),S=function(t,r){var n,i,a,s=0;for(a in(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n)h.call(i,a)&&s++;return n=i=null,s?S=function(e,t){var r,n,i="[object Function]"==_.call(e);for(r in e)i&&"prototype"==r||!h.call(e,r)||(n="constructor"===r)||t(r);(n||h.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],S=function(t,r){var n,a,s="[object Function]"==_.call(t),o=!s&&"function"!=typeof t.constructor&&e[typeof t.hasOwnProperty]&&t.hasOwnProperty||h;for(n in t)s&&"prototype"==n||!o.call(t,n)||r(n);for(a=i.length;n=i[--a];)o.call(t,n)&&r(n)}),S(t,r)};if(!y("json-stringify")&&!y("date-serialization")){var $={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},w=function(e,t){return("000000"+(t||0)).slice(-e)},k=function(e){var t,r,n,i,a,s,o,l,c;if(v)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),s=e.getUTCHours(),o=e.getUTCMinutes(),l=e.getUTCSeconds(),c=e.getUTCMilliseconds()};else{var d=u.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],g=function(e,t){return p[t]+365*(e-1970)+d((e-1969+(t=+(t>1)))/4)-d((e-1901+t)/100)+d((e-1601+t)/400)};t=function(e){for(i=d(e/864e5),r=d(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=d((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=d((a=(e%864e5+864e5)%864e5)/36e5)%24,o=d(a/6e4)%60,l=d(a/1e3)%60,c=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,c)+"Z",r=n=i=s=o=l=c=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,c,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(c=typeof o)&&(u=_.call(o)),u||c){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw d();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};(function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}).apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--){if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",c=s?"":"on",d=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](c+n.type,d,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}d("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](c+"DOMContentLoaded",d,!1),i[o](c+"readystatechange",d,!1),t[o](c+"load",d,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=c,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,d)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){if(e.element_path&&"div"!==trim(e.element_path.split(">").pop()).slice(0,3))return!1;return!0},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t)))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(c){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var c=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(c.push("data-sensors-click"),sd.para.heatmap.track_attr=c,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):saEvent.send({type:"profile_increment",properties:e},t))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.10";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.10";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.10";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.10";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.10";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.10";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.10";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.10";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.10";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,c={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(c=n.extend(c,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(c=n.extend(c,t))}}),e.properties=n.extend(o,c),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.10";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.10";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.10";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+d(l.substring(a,l.length)):s+o+l+"&"+c:s+o+"#"+l.substring(1)+"?"+c;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+d(o.substring(1))+l:s+o+"&"+c+l:s+"?"+c+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r}()}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.10";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.10";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t=e,r="";r=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.10";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.10";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.10";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.10";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$m(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$m(e,t,r){return wrapPluginInitFn$m(e,t,r),e.plugin_version=sdkversion_placeholder$m,e}var sd$f,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(e){e&&!sd$f&&((sd$f=e)._.each(utmKeys,function(e){sd$f.source_channel_standard=sd$f.source_channel_standard+" "+e,sd$f.para.source_type.utm.push(e)}),sd$f.registerInterceptor("businessStage",{getUtmData:{entry:function(e){var t=!1,r=e||{};return sd$f._.each(utmKeys,function(e){var n=sd$f._.getQueryParam(location.href,e);n.length&&(t=!0,r[e.slice(8)]=n)}),t&&sd$f.register&&sd$f.register({link_v:"1"}),r}}}))}},index$l=createPlugin$m(ChannelUtm,"ChannelUtm","sdkAfterInitPara");sd$e.use(index$4),sd$e.use(index$l);export default sd$e; \ No newline at end of file diff --git a/dist/sat/sensorsdata-sat.js b/dist/sat/sensorsdata-sat.js index 7be38532..67a86350 100644 --- a/dist/sat/sensorsdata-sat.js +++ b/dist/sat/sensorsdata-sat.js @@ -1,6 +1,6 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():t()}(this,function(){function e(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function t(){return Date.now&&e(Date.now)?Date.now():(new Date).getTime()}function r(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}function n(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),r(e)&&e.getRandomValues){var t=new Uint32Array(1),n=e.getRandomValues(t)[0],i=Math.pow(2,32);return n/i}}return Qi(1e19)/1e19}function i(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function a(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function s(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&s(e.listener)}function l(){this._events={}}function u(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function c(e){e=e||"";for(var t={},r=e.substring(1),n=r.split("&"),i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ea(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ra&&e.forEach===ra)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Zi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Zi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:ga.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa._state.identities);var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ka.properties(),xa.getProps(),xa.getSessionProps(),ka.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ba.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Ca.checkIsAddSign(a),Ca.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Fa.stage.process("basicProps",e)}function dt(e){return Fa.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Wa.stage.process("webClickEvent",e)}function ht(e){return Wa.stage.process("webStayEvent",e)}function mt(){var e=ka.campaignParams(),t={};return k(e,function(e,r,n){(" "+zi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(zi.is_first_visitor&&r){var n={};zi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=wa.id(),n.$search_keyword_id_type=wa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),zi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Ya.EVENT_LIST&&(r=Ya.EVENT_LIST[e],Ya[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s), t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){zi._t=zi._t||1*new Date,zi.is_first_visitor=!1,zi.source_channel_standard=ha}function Ct(e){P(ga,e||zi.para||{}),zi.para=ga;var t={};if(r(zi.para.is_track_latest))for(var n in zi.para.is_track_latest)t["latest_"+n]=zi.para.is_track_latest[n];zi.para.preset_properties=P({},_a.preset_properties,t,zi.para.preset_properties||{});var i;for(i in _a)void 0===zi.para[i]&&(zi.para[i]=_a[i]);"string"!=typeof zi.para.web_url||"://"!==zi.para.web_url.slice(0,3)&&"//"!==zi.para.web_url.slice(0,2)||("://"===zi.para.web_url.slice(0,3)?zi.para.web_url=location.protocol.slice(0,-1)+zi.para.web_url:zi.para.web_url=location.protocol+zi.para.web_url),Sa.protocol.serverUrl(),zi.bridge&&zi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof zi.para.source_type&&(zi.para.source_type.utm=v(zi.para.source_type.utm)?zi.para.source_type.utm.concat(a):a,zi.para.source_type.search=v(zi.para.source_type.search)?zi.para.source_type.search.concat(o):o,zi.para.source_type.social=v(zi.para.source_type.social)?zi.para.source_type.social.concat(s):s,zi.para.source_type.keyword=r(zi.para.source_type.keyword)?P(l,zi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(zi.para.heatmap&&!r(zi.para.heatmap)&&(zi.para.heatmap={}),r(zi.para.heatmap)){zi.para.heatmap.clickmap=zi.para.heatmap.clickmap||"default",zi.para.heatmap.scroll_notice_map=zi.para.heatmap.scroll_notice_map||"default",zi.para.heatmap.scroll_delay_time=zi.para.heatmap.scroll_delay_time||4e3,zi.para.heatmap.scroll_event_duration=zi.para.heatmap.scroll_event_duration||18e3,zi.para.heatmap.renderRefreshTime=zi.para.heatmap.renderRefreshTime||1e3,zi.para.heatmap.loadTimeout=zi.para.heatmap.loadTimeout||1e3,zi.para.heatmap.get_vtrack_config!==!0&&(zi.para.heatmap.get_vtrack_config=!1);var p=v(zi.para.heatmap.track_attr)?U(zi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),zi.para.heatmap.track_attr=p,r(zi.para.heatmap.collect_tags))if(zi.para.heatmap.collect_tags.div===!0)zi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(zi.para.heatmap.collect_tags.div)){if(zi.para.heatmap.collect_tags.div.ignore_tags?v(zi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),zi.para.heatmap.collect_tags.div.ignore_tags=c):zi.para.heatmap.collect_tags.div.ignore_tags=c,zi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,zi.para.heatmap.collect_tags.div.max_level)===-1&&(zi.para.heatmap.collect_tags.div.max_level=1)}}else zi.para.heatmap.collect_tags.div=!1;else zi.para.heatmap.collect_tags=u}zi.para.server_url=Ge(zi.para.server_url),zi.para.noCache===!0?zi.para.noCache="?"+(new Date).getTime():zi.para.noCache="",zi.para.callback_timeout>zi.para.datasend_timeout&&(zi.para.datasend_timeout=zi.para.callback_timeout),zi.para.heatmap&&zi.para.heatmap.collect_tags&&r(zi.para.heatmap.collect_tags)&&k(zi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&zi.heatmap.otherTags.push(t)}),zi.para.heatmap&&"default"===zi.para.heatmap.clickmap&&zi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(zi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(zi,n),a.plugin_is_init=!0,zi.modules=zi.modules||{},zi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=zi.modules&&zi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(zi.modules)&&r(zi.modules[t])?a=zi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==zi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,zi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,zi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),zi.track(t,r,i)}))}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Yi()),xa.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=xa.getFirstId();if("undefined"==typeof e){var n=Yi();r?xa.set("first_id",n):xa.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?xa.set("first_id",e):xa.set("distinct_id",e):r?xa.change("first_id",e):xa.change("distinct_id",e))}function Mt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ka.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){xa.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(zi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){zi.para.is_track_single_page&&Ga.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ka.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):zi.quick&&zi.quick("autoTrack",i)}};if("boolean"==typeof zi.para.is_track_single_page)i();else if("function"==typeof zi.para.is_track_single_page){var a=zi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){zi._q&&v(zi._q)&&zi._q.length>0&&k(zi._q,function(e){zi[e[0]].apply(zi,Array.prototype.slice.call(e[1]))}),r(zi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){zi.readyState.setState(3),new zi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),lr(!1),zi.bridge.app_js_bridge_v1(),ka.initPage(),ur(),xa.init(),or(),fr(),zi.readyState.setState(4),cr()}function dr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function fr(){qa.init(),"success"===zi.bridge.bridge_info.verify_success&&Ba.init()}function gr(){k(so,function(t){var r=zi[t];zi[t]=function(){if(zi.readyState.state<3)return v(zi._q)||(zi._q=[]),Ne("calling sdk api before init is deprecated."),zi._q.push([t,arguments]),!1;if(!e(zi.getDisabled)||!zi.getDisabled())return zi.readyState.getState()?r.apply(zi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function yr(e,t){vo[e]&&vo[e](t)}function br(){return yo.stage&&yo.stage.process("getUtmData")}function wr(e){return bo.stage.process("send",e)}function Sr(e){e.kit=wo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=bo,this.businessStage=yo}function kr(e){e.heatmap=Xa,this.viewStage=Wa}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(zi.events=Da,zi.bridge=io,zi.SDKJSBridge=rr,zi.JSBridge=ar,zi.store=xa,zi.unlimitedDiv=Ja,zi.customProp=Ma,zi.vtrackcollect=qa,zi.vapph5collect=Ba,zi.detectMode=dr,zi.registerFeature=vr,zi.registerInterceptor=yr,zi.commonWays=Za,vr(new Sr(zi)),vr(new kr(zi)),yr("viewStage",So));var t=e?ro:lo;for(var r in t)zi[r]=t[r];zi.logger=fa,zi.log=Oe,zi._=no,zi.on=bt,zi.ee=Ya,zi.use=Nt,zi.lib_version=ma,zi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function Ar(e){return Go&&Go.call(Xo,JSON.stringify(e))}function Dr(e){return Zo.call(Xo)&&Qo&&Qo.call(Xo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=es,e}function Rr(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),jo&&!jo.bridge.activeBridge&&No){if(jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},!jo.para.app_js_bridge)return void Io("app_js_bridge is not configured, data will not be sent by android bridge.");jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),Io("Android bridge inits succeed.")}}function Hr(e,t){if(jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(Oo&&Oo.call(Co,JSON.stringify(To.extend({server_url:jo.para.server_url},e.data))),To.isFunction(r)&&r(),t.cancellationToken.cancel(),e):jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(To.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&To.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return as&&as.call(ns,JSON.stringify(e))}function Mr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=ls,e}function Wr(){if($o=window.SensorsData_APP_JS_Bridge,Ao=$o&&$o.sensorsdata_track,Do=$o&&$o.sensorsdata_verify,xo=$o&&$o.sensorsdata_visual_verify,Eo&&!Eo.bridge.activeBridge&&(Do||Ao||xo)){Eo.bridge.activeBridge=us;var e=Do||Ao;if(xo&&(e=!!xo.call($o,JSON.stringify({server_url:Eo.para.server_url}))),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),Uo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Do){var n=Do&&Do.call($o,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Ao&&Ao.call($o,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in ss.commands?ss.commands[t](e,$o):$o&&Lo.isFunction($o.sensorsdata_js_call_app)?$o.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ps,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=gs,e}function rn(){return"undefined"!=typeof Mo&&document[Mo]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=Es,e}function sn(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),bs("IOS bridge inits succeed.")}}function ln(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Rs,e}function fn(){if(ws&&!ws.bridge.activeBridge&&gn()){if(ws.bridge.activeBridge=Hs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),ks("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Js,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=qs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=Vs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); -}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=al,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function Mn(){Ol=!0}function qn(){Ol=!1}function Kn(){return Ol}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Il,e}function zn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Zn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Dl,e}function ti(e,t){if(pl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){cl.on("sdkAfterInitAPI",function(){pl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ni),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&pl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();pl.isArray(t)&&t.length>0&&pl.each(t,function(e){pl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Ll,e}function si(e,t){return!dl.para.app_js_bridge&&dl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Bl,e}function fi(e){var t=new _l.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===gl.para.send_type){var r=e.server_url;e.data=gl.kit.encodeTrackData(e.data),_l.isArray(r)&&r.length?_l.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof gl.para.server_url&&""!==gl.para.server_url?fi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function hi(){gl.on("sdkInitPara",function(){_i()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=ql,e}function bi(e){var t=new ml.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===hl.para.send_type){var r=e.server_url;e.data=hl.kit.encodeTrackData(e.data),ml.isArray(r)&&r.length?ml.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof hl.para.server_url&&""!==hl.para.server_url?bi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function ki(){hl.on("sdkInitPara",function(){Si()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=Vl,e}function Ni(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;yl.isArray(r)&&r.length?yl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function $i(){vl.on("sdkInitPara",function(){Ii()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ma,e}function Ei(e){return null===Gl?void Li(e):void Gl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Ki()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Bi(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Ki(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Fi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wi(e,t,r){return Fi(e,t,r),e.plugin_version=uu,e}var zi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Xi,Zi={setup:function(e){Xi=e},log:function(){(Xi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Qi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ea=function(e){this.ele=e},ta=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ea.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return ta((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ta(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+ga.sdk_id+e}},Ca={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ba.get("sensorsdata2015jssdkcross"+zi.para.sdk_id);n=zi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,zi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),zi.para.encrypt_cookie&&(i=zi.kit.userEncrypt(i)),ba.set("sensorsdata2015jssdkcross"+zi.para.sdk_id,i,null,!0)),zi.para.is_track_device_id&&(ka.currentProps.$device_id=r)},storeInitCheck:function(){if(zi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ba.isSupport()?ba.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Pa.set(Pa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},Oa=function(){this._events=[],this.pendingEvents=[]};Oa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Na.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:ga.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ta="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},ga.batch_send.send_interval)},getServerUrl:function(){return p(ga.server_url)&&""!==ga.server_url||v(ga.server_url)&&ga.server_url.length?void(this.serverUrl=v(ga.server_url)?ga.server_url[0]:ga.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Ta+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*ga.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),zi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ta+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*ga.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(Gi.get(s))||{expireTime:0};t()-d.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;tga.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>ga.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>ga.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};et({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ra.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=zi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=zi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ha={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),zi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new zi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=zi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ba={events:[],customProp:Ha,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new zi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new zi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=zi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(zi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(zi.para.heatmap)||!zi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&zi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1; -if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&zi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=zi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){zi.is_heatmap_render_mode=!0,zi.para.heatmap||(zi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(zi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),zi.para.heatmap_url||(zi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=zi.heatmap.getElementPath(e,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);var n=zi.heatmap.getElementPosition(e,r.$element_path,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(zi.para.heatmap)&&e(zi.para.heatmap.collect_element)&&!zi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(zi.para.heatmap&&zi.para.heatmap.custom_property){var c=zi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div?!!(r(zi.para.heatmap)&&r(zi.para.heatmap.collect_tags)&&r(zi.para.heatmap.collect_tags.div)&&v(zi.para.heatmap.collect_tags.div.ignore_tags)&&re(zi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=zi.para&&zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),zi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.scroll_notice_map)return!1;var t=!0;zi.para.scrollmap&&e(zi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!zi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>zi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(zi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.clickmap)&&(e(zi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!zi.para.heatmap.collect_url()}),"all"===zi.para.heatmap.collect_elements?zi.para.heatmap.collect_elements="all":zi.para.heatmap.collect_elements="interact",void("all"===zi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=zi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(zi.para.heatmap)&&zi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void zi.log("error: isReady callback must be function")},getUtm:function(){return ka.campaignParams()},getStayTime:function(){return(new Date-zi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return zi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),zi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),zi.setProfile(e)},setInitReferrer:function(){var e=De();zi.setOnceProfile({_init_referrer:e,_init_referrer_host:ka.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ka.pageProp.referrer_host})},setDefaultAttr:function(){ka.register({_current_url:location.href,_referrer:De(),_referring_host:ka.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=zi.para.heatmap&&zi.para.heatmap.track_attr?zi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){zi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ka.pageProp.url:ka.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(zi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;zi.para.is_single_page&&w(function(){var r=De(a,!0);zi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),zi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(zi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa._state._first_id||xa._state.first_id||xa._state._distinct_id||xa._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(zi.modules)&&zi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){zi.use.apply(zi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga=new l,Qa=new l,Ya={};Ya.spa=Ga,Ya.sdk=Qa,Ya.initSystemEvent=function(){yt(function(e){Ga.emit("switch",e)})},Ya.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:eo,debug:Sa,on:bt,log:Oe};Zi.setup(Oe);var no=P({},pa,Aa),io={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:zi.para.use_app_track_is_send!==!1&&"only"!==zi.para.use_app_track,white_list:[],is_mui:"mui"===zi.para.use_app_track};"object"==typeof zi.para.app_js_bridge?zi.para.app_js_bridge=P({},e,zi.para.app_js_bridge):zi.para.use_app_track!==!0&&zi.para.app_js_bridge!==!0&&"only"!==zi.para.use_app_track&&"mui"!==zi.para.use_app_track||(zi.para.app_js_bridge=P({},e)),zi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},zi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return zi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),sa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){zi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(zi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(zi.heatmap_version&&zi.heatmap_version===zi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:zi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),sa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:zi.para.vtrack_url?zi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(sa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ma}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,zi),a=0;a=2)&&(Po&&(Cr(!0),gr()),Ya.initSystemEvent(),zi.setInitVar(),zi.readyState.setState(2),zi.initPara(e),Ya.sdk.emit("initPara"),Ya.sdk.emit("afterInitPara"),Ya.sdk.emit("initAPI"),Ya.sdk.emit("afterInitAPI"),zi.detectMode(),tr(),Ya.sdk.emit("afterInit"),void Ya.sdk.emit("ready"))},Po?Cr(!1):(Cr(!0),gr());var Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo,Jo,Mo,qo="1.25.9",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=jr(Ko),Vo="1.25.9",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=$r(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},es="1.25.9",ts={init:function(e){jo=e,To=jo&&jo._,Io=jo&&jo.log||console&&console.log||function(){},Rr()},handleCommand:Br},rs=Ur(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},ls="1.25.9",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},Wr()},handleCommand:Xr},cs=Vr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ps="1.25.9",ds={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Ho._,Bo=Ho.store,!!Ro.localStorage.isSupport()&&(Ho.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Ho||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Ho=e;var n=this;r()},addIsChannelCallbackEvent:function(){Ho.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ds.eventList.hasEvent(e.event)&&(ds.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ds.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Ho.registerPage(t):Ho.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Ho.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Ho.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Ho.para.encrypt_cookie&&(r=Ho.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Ho.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Is(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Ts(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ds.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ds.data=e,Ds.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ds.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),As(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"), -$s(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=_s().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},xs=tn(Ds,"Deeplink","sdkReady"),Es="1.25.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},sn()},handleCommand:un},Us=on(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.25.9",Hs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},fn()}},Bs=dn(Hs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.25.9",Ms=5e3,qs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new bn,Fs=yn(Ks,"PageLeave","sdkReady"),Vs="1.25.9",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=kn(zs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new Cn,el=jn(Ys),tl="1.25.9",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=An,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=$n(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.25.9",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml,vl,yl,bl=En(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.25.9",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Rn(kl,"Utm","sdkAfterInitPara"),Cl="1.25.9",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=Mn,Nl.enableSDK=qn,Nl.getDisabled=Kn}},Tl=Jn(jl,"DisableSDK","sdkInitAPI"),Il="1.25.9",$l={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Al=Wn($l),Dl="1.25.9",xl={plugin_name:"JsappSender",init:function(e){cl=e,pl=cl._,ri()}},El=ei(xl),Ll="1.25.9",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){dl=e,fl=dl._,ui()}},Hl=oi(Rl),Bl="1.25.9",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,hi()}},Ml=di(Jl),ql="1.25.9",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,ki()}},Fl=yi(Kl),Vl="1.25.9",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,$i()}},zl=Oi(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Ei),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=al,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function Mn(){Ol=!0}function qn(){Ol=!1}function Kn(){return Ol}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Il,e}function zn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Zn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Dl,e}function ti(e,t){if(pl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){cl.on("sdkAfterInitAPI",function(){pl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ni),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&pl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();pl.isArray(t)&&t.length>0&&pl.each(t,function(e){pl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Ll,e}function si(e,t){return!dl.para.app_js_bridge&&dl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Bl,e}function fi(e){var t=new _l.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function hi(){gl.on("sdkInitPara",function(){_i()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=ql,e}function bi(e){var t=new ml.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function ki(){hl.on("sdkInitPara",function(){Si()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=Vl,e}function Ni(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function $i(){vl.on("sdkInitPara",function(){Ii()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ma,e}function Ei(e){return null===Gl?void Li(e):void Gl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Ki()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Bi(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Ki(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Fi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wi(e,t,r){return Fi(e,t,r),e.plugin_version=uu,e}var zi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Xi,Zi={setup:function(e){Xi=e},log:function(){(Xi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Qi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ea=function(e){this.ele=e},ta=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ea.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return ta((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ta(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+ga.sdk_id+e}},Ca={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ba.get("sensorsdata2015jssdkcross"+zi.para.sdk_id);n=zi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,zi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),zi.para.encrypt_cookie&&(i=zi.kit.userEncrypt(i)),ba.set("sensorsdata2015jssdkcross"+zi.para.sdk_id,i,null,!0)),zi.para.is_track_device_id&&(ka.currentProps.$device_id=r)},storeInitCheck:function(){if(zi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ba.isSupport()?ba.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Pa.set(Pa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},Oa=function(){this._events=[],this.pendingEvents=[]};Oa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Na.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:ga.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ta="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},ga.batch_send.send_interval)},getServerUrl:function(){return p(ga.server_url)&&""!==ga.server_url||v(ga.server_url)&&ga.server_url.length?void(this.serverUrl=v(ga.server_url)?ga.server_url[0]:ga.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Ta+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*ga.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),zi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ta+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*ga.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(Gi.get(s))||{expireTime:0};t()-d.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;tga.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>ga.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>ga.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};et({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ra.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=zi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=zi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ha={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),zi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new zi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=zi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ba={events:[],customProp:Ha,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new zi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new zi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=zi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(zi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(zi.para.heatmap)||!zi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&zi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&zi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=zi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){zi.is_heatmap_render_mode=!0,zi.para.heatmap||(zi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(zi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),zi.para.heatmap_url||(zi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=zi.heatmap.getElementPath(e,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);var n=zi.heatmap.getElementPosition(e,r.$element_path,zi.para.heatmap&&"not_use_id"===zi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(zi.para.heatmap)&&e(zi.para.heatmap.collect_element)&&!zi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(zi.para.heatmap&&zi.para.heatmap.custom_property){var c=zi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div?!!(r(zi.para.heatmap)&&r(zi.para.heatmap.collect_tags)&&r(zi.para.heatmap.collect_tags.div)&&v(zi.para.heatmap.collect_tags.div.ignore_tags)&&re(zi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=zi.para&&zi.para.heatmap&&zi.para.heatmap.collect_tags&&zi.para.heatmap.collect_tags.div&&zi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),zi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.scroll_notice_map)return!1;var t=!0;zi.para.scrollmap&&e(zi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!zi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>zi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(zi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(zi.para.heatmap)||"default"!==zi.para.heatmap.clickmap)&&(e(zi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!zi.para.heatmap.collect_url()}),"all"===zi.para.heatmap.collect_elements?zi.para.heatmap.collect_elements="all":zi.para.heatmap.collect_elements="interact",void("all"===zi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=zi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(zi.para.heatmap)&&zi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void zi.log("error: isReady callback must be function")},getUtm:function(){return ka.campaignParams()},getStayTime:function(){return(new Date-zi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return zi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),zi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),zi.setProfile(e)},setInitReferrer:function(){var e=De();zi.setOnceProfile({_init_referrer:e,_init_referrer_host:ka.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ka.pageProp.referrer_host})},setDefaultAttr:function(){ka.register({_current_url:location.href,_referrer:De(),_referring_host:ka.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=zi.para.heatmap&&zi.para.heatmap.track_attr?zi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){zi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ka.pageProp.url:ka.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(zi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;zi.para.is_single_page&&w(function(){var r=De(a,!0);zi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),zi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(zi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa._state._first_id||xa._state.first_id||xa._state._distinct_id||xa._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(zi.modules)&&zi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){zi.use.apply(zi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga=new l,Qa=new l,Ya={};Ya.spa=Ga,Ya.sdk=Qa,Ya.initSystemEvent=function(){yt(function(e){Ga.emit("switch",e)})},Ya.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:eo,debug:Sa,on:bt,log:Oe};Zi.setup(Oe);var no=P({},pa,Aa),io={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:zi.para.use_app_track_is_send!==!1&&"only"!==zi.para.use_app_track,white_list:[],is_mui:"mui"===zi.para.use_app_track};"object"==typeof zi.para.app_js_bridge?zi.para.app_js_bridge=P({},e,zi.para.app_js_bridge):zi.para.use_app_track!==!0&&zi.para.app_js_bridge!==!0&&"only"!==zi.para.use_app_track&&"mui"!==zi.para.use_app_track||(zi.para.app_js_bridge=P({},e)),zi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},zi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return zi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),sa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){zi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(zi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(zi.heatmap_version&&zi.heatmap_version===zi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:zi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),sa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return sa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:zi.para.vtrack_url?zi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+zi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(sa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ma}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,zi),a=0;a=2)&&(Po&&(Cr(!0),gr()),Ya.initSystemEvent(),zi.setInitVar(),zi.readyState.setState(2),zi.initPara(e),Ya.sdk.emit("initPara"),Ya.sdk.emit("afterInitPara"),Ya.sdk.emit("initAPI"),Ya.sdk.emit("afterInitAPI"),zi.detectMode(),tr(),Ya.sdk.emit("afterInit"),void Ya.sdk.emit("ready"))},Po?Cr(!1):(Cr(!0),gr());var Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo,Jo,Mo,qo="1.25.10",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=jr(Ko),Vo="1.25.10",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=$r(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},es="1.25.10",ts={init:function(e){jo=e,To=jo&&jo._,Io=jo&&jo.log||console&&console.log||function(){},Rr()},handleCommand:Br},rs=Ur(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},ls="1.25.10",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},Wr()},handleCommand:Xr},cs=Vr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ps="1.25.10",ds={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Ho._,Bo=Ho.store,!!Ro.localStorage.isSupport()&&(Ho.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Ho||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Ho=e;var n=this;r()},addIsChannelCallbackEvent:function(){Ho.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ds.eventList.hasEvent(e.event)&&(ds.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ds.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Ho.registerPage(t):Ho.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Ho.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Ho.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Ho.para.encrypt_cookie&&(r=Ho.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Ho.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Is(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Ts(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ds.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ds.data=e,Ds.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ds.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1); +},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),As(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),$s(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=_s().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},xs=tn(Ds,"Deeplink","sdkReady"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},sn()},handleCommand:un},Us=on(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.25.10",Hs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},fn()}},Bs=dn(Hs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.25.10",Ms=5e3,qs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new bn,Fs=yn(Ks,"PageLeave","sdkReady"),Vs="1.25.10",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=kn(zs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new Cn,el=jn(Ys),tl="1.25.10",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=An,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=$n(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.25.10",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml,vl,yl,bl=En(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.25.10",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Rn(kl,"Utm","sdkAfterInitPara"),Cl="1.25.10",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=Mn,Nl.enableSDK=qn,Nl.getDisabled=Kn}},Tl=Jn(jl,"DisableSDK","sdkInitAPI"),Il="1.25.10",$l={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Al=Wn($l),Dl="1.25.10",xl={plugin_name:"JsappSender",init:function(e){cl=e,pl=cl._,ri()}},El=ei(xl),Ll="1.25.10",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){dl=e,fl=dl._,ui()}},Hl=oi(Rl),Bl="1.25.10",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,hi()}},Ml=di(Jl),ql="1.25.10",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,ki()}},Fl=yi(Kl),Vl="1.25.10",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,$i()}},zl=Oi(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Ei),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e=3?t:null}function o(t){var e={visibleHandle:H.isFunction(t.visible)?t.visible:function(){},hiddenHandler:H.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()}function c(t){var e=H.storage.get(t);H.isString(e)&&(e=r(e));try{e=JSON.parse(e)}catch(s){H.log(s)}return e}function l(t,e,s){t=JSON.stringify(t),s&&(t=i(t)),H.storage.set(t,e)}function u(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function h(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function p(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function d(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(e!==!0||!H.checkUrlIsMatch(s,r))||(H.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function f(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}}function g(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):m(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function v(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function y(t,e){var s={};return H.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=v(t,r)}),s}function S(t){var e=t.childNodes,s="",r=!1;return H.each(e,function(t){r===!1&&3===t.nodeType&&(H.isString(t.textContent)||H.isString(t.innerText)||H.isString(t.nodeValue))&&(s=H.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function b(t){function e(t,e){t=H.trim(t);var s;if("body"===t)return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(H.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,c=0;c0)return null}return s?s:null}function s(t){var i,n=r.shift();if(!n)return t;try{i=e(n,t)}catch(a){i=null}return i&&H.isElement(i)?s(i):null}if(!H.isString(t))return null;var r=t.split(">"),i=null;return i=s(),i&&H.isElement(i)?i:null}function T(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,r,i;return s=e[0],r=e[1],i=e[2],"rgb("+s+","+r+","+i+")"}return""}function A(t,e){function s(t,e){var s=t.length-e.length;return s>=0&&t.indexOf(e,s)==s}var r=p(),i=r.ie&&r.ie<9,n="";if(H.each(e,function(t,e){i&&t.indexOf("rgba")>-1&&(t=T(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=";"+s+": "+t}),""!==n){var a=t.style,o=a.cssText||"";o&&!s(o,";")&&(o+=";"),a.cssText=o+n}}function B(t,e){var s=t.childNodes,r=!1;H.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function k(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&H.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function x(t,e,s){t.setAttribute(e,s)}function w(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return H.each(i.style||{},function(e,s){r.attributes.style[s]=v(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=S(t)),H.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function D(t,e,s){s||(s=w(t,e));var r=k(e,s);if(r){var i=e.props;H.isObject(i)&&O(t,i)}return r}function O(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&A(t,s.style),H.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&x(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&B(t,e.text)}function E(t){t=H.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&(e=document.createElement("link"),e.rel="stylesheet",e.href=t.url),"js"===t.type&&(e=document.createElement("script"),e.async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function j(t,e){E(H.extend({success:function(){},error:function(){},type:"js",url:t},e))}function P(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,r=new s(t);r.observe(document.body,e)}function L(t,e){var s=t.tagName.toLowerCase(),r=y(t,e),i={selector:m(t),originProps:{attributes:{style:r},text:S(t)},type:"text",tagName:s};"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img");var n=t.getAttribute("style");return{originStyle:n,eleInfo:i,ele:t}}function N(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;O(s,e.originProps),r?s.style.cssText=r:s.style.cssText=""}}function R(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function F(){this.lib_version="1.25.9",this.plugin_version="1.25.9",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new h(this),this.vabtest=new R(this),this.normalStore=new t(this),this.bridgeStore=new e(this),this.verifyStore=new n(this)}function C(t,e){var s=[];H.isArray(t)&&H.each(t,function(e,s){H.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(H.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&H.isArray(t)){var n=!1;H.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function U(t){this.SensorsABTest=t}function I(t){this.SensorsABTest=t}function M(t,e){return a(t)?(this.sd=t,H.isObject(e)?(H.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new U(this),this.store=new I(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}var H={},V=Array.prototype,z=Object.prototype,K=V.slice,$=z.toString,J=z.hasOwnProperty,Q=V.forEach,Z=Array.isArray,G={};H.each=function(t,e,s){if(null==t)return!1;if(Q&&t.forEach===Q)t.forEach(e,s);else if(H.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL");for(var s in this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},H.URL=function(t){var e={},s=function(){var t;try{return t=new URL("http://modernizr.com/"),"http://modernizr.com/"===t.href}catch(e){return!1}};if("function"==typeof window.URL&&s())e=new URL(t),e.searchParams||(e.searchParams=function(){var t=H.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}());else{var r=/^https?:\/\/.+/;r.test(t)===!1&&H.log("Invalid URL");var i=H.urlParse(t);e.hash="",e.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",e.href=i._values.URL,e.password=i._values.Password,e.pathname=i._values.Path,e.port=i._values.Port,e.search=i._values.QueryString?"?"+i._values.QueryString:"",e.username=i._values.Username,e.hostname=i._values.Hostname,e.protocol=i._values.Protocol?i._values.Protocol+":":"",e.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",e.searchParams=function(){var t=H.getURLSearchParams("?"+i._values.QueryString);return{get:function(e){return t[e]}}}()}return e},H.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=H.decodeURIComponent(t);var s="[\\?&]"+e+"=([^&#]*)",r=new RegExp(s),i=r.exec(t);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":H.decodeURIComponent(i[1])},H.isEmptyObject=function(t){if(H.isObject(t)){for(var e in t)if(J.call(t,e))return!1;return!0}return!1},H.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}},H.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;var e=/^https?:\/\/.+/;return e.test(t)!==!1||(H.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},H.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,s,r){var i=function(i){if(i=i||t(window.event)){i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}};return i}t._getPath=function(){var t=this,e=function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var s=function(s,r,i){var n=!0;if(s&&s.addEventListener)s.addEventListener(r,function(e){e._getPath=t._getPath,i.call(this,e)},n);else{var a="on"+r,o=s[a];s[a]=e(s,i,o)}};s.apply(null,arguments)},H.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";H.addEvent(window,i,function(){t(e),e=location.href})},H.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},H.checkUrlIsMatch=function(t,e){var s,r,i=H.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=H.URL(location.href)}catch(n){return H.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=H.URL(t)}catch(n){return H.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return H.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},H.checkUrlIsRegexp=function(t,e){var s;try{s=H.URL(location.href)}catch(r){return H.log("url \u89e3\u6790\u5931\u8d25",r),!1}try{var i=e?new RegExp(t,e):new RegExp(t),n=i.exec(s.href),a=!0;return!!n&&(H.each(n,function(t){t||(a=!1)}),a)}catch(r){return H.log("control_link\u5b57\u6bb5\u5f02\u5e38",r),!1}},H.log=function(){if("object"==typeof console&&console.log){H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},H.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},H.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},H.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},H.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},t.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!H.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=H.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,s.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(H.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";H.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return H.isObject(t.properties)&&(s.properties=H.extend({},s.properties,t.properties)),H.isObject(t.custom_properties)&&(s.custom_properties=H.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){function e(){var t=s.SensorsABTest.sd.store.getDistinctId();s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){s.SensorsABTest.dealResponseData(e,t),i&&i(e),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()}},t.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},e.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=H.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),H.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":H.isObject(window.SensorsData_APP_New_H5_Bridge)&&H.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,e.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:r.properties,timeout:a,request_body:o},callback:function(t){H.isObject(t)&&H.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),i&&i(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=r.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};H.isObject(r.custom_properties)&&(o=H.extend(o,{custom_properties:r.custom_properties,param_name:r.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(H.isObject(s.properties)&&(t.properties=H.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},e.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);if(t=i.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}};var W="dfm-enc-";n.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(H.isNumber(t))return!0;break;case"String":if(H.isString(t))return!0;break;case"Object":if(H.isObject(t))return!0;break;case"Boolean":if(t===!0||t===!1)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return H.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":H.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":H.isString(e.value_type)&&H.indexOf(r.value_type_list,e.value_type)!==-1||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":H.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!H.isNumber(e.timeout_milliseconds)||H.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=H.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!H.isObject(r)||H.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(H.each(r,function(t,r){if((!H.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(H.isString(t)||H.isNumber(t)||H.isBoolean(t)||H.isArray(t)||H.isDate(t))&&!(H.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),H.isArray(t)){var i=!0;H.each(t,function(t){i!==!1&&(H.isString(t)||(i=!1))}),i||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+r+" ] of value "+JSON.stringify(t)+" is not invalid"), +define(function(){"use strict";function t(t){this.SensorsABTest=t,this.para=t.para}function e(t){this.SensorsABTest=t,this.para=t.para}function s(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",s=e.length-1,r={},i=0;for(i=0;i=3?t:null}function o(t){var e={visibleHandle:H.isFunction(t.visible)?t.visible:function(){},hiddenHandler:H.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()}function c(t){var e=H.storage.get(t);H.isString(e)&&(e=r(e));try{e=JSON.parse(e)}catch(s){H.log(s)}return e}function l(t,e,s){t=JSON.stringify(t),s&&(t=i(t)),H.storage.set(t,e)}function u(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function h(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function p(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function d(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(e!==!0||!H.checkUrlIsMatch(s,r))||(H.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function f(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}}function g(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):m(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function v(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function y(t,e){var s={};return H.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=v(t,r)}),s}function S(t){var e=t.childNodes,s="",r=!1;return H.each(e,function(t){r===!1&&3===t.nodeType&&(H.isString(t.textContent)||H.isString(t.innerText)||H.isString(t.nodeValue))&&(s=H.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function b(t){function e(t,e){t=H.trim(t);var s;if("body"===t)return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(H.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,c=0;c0)return null}return s?s:null}function s(t){var i,n=r.shift();if(!n)return t;try{i=e(n,t)}catch(a){i=null}return i&&H.isElement(i)?s(i):null}if(!H.isString(t))return null;var r=t.split(">"),i=null;return i=s(),i&&H.isElement(i)?i:null}function T(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,r,i;return s=e[0],r=e[1],i=e[2],"rgb("+s+","+r+","+i+")"}return""}function A(t,e){function s(t,e){var s=t.length-e.length;return s>=0&&t.indexOf(e,s)==s}var r=p(),i=r.ie&&r.ie<9,n="";if(H.each(e,function(t,e){i&&t.indexOf("rgba")>-1&&(t=T(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=";"+s+": "+t}),""!==n){var a=t.style,o=a.cssText||"";o&&!s(o,";")&&(o+=";"),a.cssText=o+n}}function B(t,e){var s=t.childNodes,r=!1;H.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function k(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&H.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function x(t,e,s){t.setAttribute(e,s)}function w(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return H.each(i.style||{},function(e,s){r.attributes.style[s]=v(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=S(t)),H.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function D(t,e,s){s||(s=w(t,e));var r=k(e,s);if(r){var i=e.props;H.isObject(i)&&O(t,i)}return r}function O(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&A(t,s.style),H.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&x(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&B(t,e.text)}function E(t){t=H.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&(e=document.createElement("link"),e.rel="stylesheet",e.href=t.url),"js"===t.type&&(e=document.createElement("script"),e.async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function j(t,e){E(H.extend({success:function(){},error:function(){},type:"js",url:t},e))}function P(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,r=new s(t);r.observe(document.body,e)}function L(t,e){var s=t.tagName.toLowerCase(),r=y(t,e),i={selector:m(t),originProps:{attributes:{style:r},text:S(t)},type:"text",tagName:s};"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img");var n=t.getAttribute("style");return{originStyle:n,eleInfo:i,ele:t}}function N(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;O(s,e.originProps),r?s.style.cssText=r:s.style.cssText=""}}function R(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function F(){this.lib_version="1.25.10",this.plugin_version="1.25.10",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new h(this),this.vabtest=new R(this),this.normalStore=new t(this),this.bridgeStore=new e(this),this.verifyStore=new n(this)}function C(t,e){var s=[];H.isArray(t)&&H.each(t,function(e,s){H.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(H.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&H.isArray(t)){var n=!1;H.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function U(t){this.SensorsABTest=t}function I(t){this.SensorsABTest=t}function M(t,e){return a(t)?(this.sd=t,H.isObject(e)?(H.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new U(this),this.store=new I(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}var H={},V=Array.prototype,z=Object.prototype,K=V.slice,$=z.toString,J=z.hasOwnProperty,Q=V.forEach,Z=Array.isArray,G={};H.each=function(t,e,s){if(null==t)return!1;if(Q&&t.forEach===Q)t.forEach(e,s);else if(H.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL");for(var s in this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},H.URL=function(t){var e={},s=function(){var t;try{return t=new URL("http://modernizr.com/"),"http://modernizr.com/"===t.href}catch(e){return!1}};if("function"==typeof window.URL&&s())e=new URL(t),e.searchParams||(e.searchParams=function(){var t=H.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}());else{var r=/^https?:\/\/.+/;r.test(t)===!1&&H.log("Invalid URL");var i=H.urlParse(t);e.hash="",e.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",e.href=i._values.URL,e.password=i._values.Password,e.pathname=i._values.Path,e.port=i._values.Port,e.search=i._values.QueryString?"?"+i._values.QueryString:"",e.username=i._values.Username,e.hostname=i._values.Hostname,e.protocol=i._values.Protocol?i._values.Protocol+":":"",e.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",e.searchParams=function(){var t=H.getURLSearchParams("?"+i._values.QueryString);return{get:function(e){return t[e]}}}()}return e},H.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=H.decodeURIComponent(t);var s="[\\?&]"+e+"=([^&#]*)",r=new RegExp(s),i=r.exec(t);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":H.decodeURIComponent(i[1])},H.isEmptyObject=function(t){if(H.isObject(t)){for(var e in t)if(J.call(t,e))return!1;return!0}return!1},H.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}},H.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;var e=/^https?:\/\/.+/;return e.test(t)!==!1||(H.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},H.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,s,r){var i=function(i){if(i=i||t(window.event)){i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}};return i}t._getPath=function(){var t=this,e=function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var s=function(s,r,i){var n=!0;if(s&&s.addEventListener)s.addEventListener(r,function(e){e._getPath=t._getPath,i.call(this,e)},n);else{var a="on"+r,o=s[a];s[a]=e(s,i,o)}};s.apply(null,arguments)},H.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";H.addEvent(window,i,function(){t(e),e=location.href})},H.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},H.checkUrlIsMatch=function(t,e){var s,r,i=H.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=H.URL(location.href)}catch(n){return H.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=H.URL(t)}catch(n){return H.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return H.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},H.checkUrlIsRegexp=function(t,e){var s;try{s=H.URL(location.href)}catch(r){return H.log("url \u89e3\u6790\u5931\u8d25",r),!1}try{var i=e?new RegExp(t,e):new RegExp(t),n=i.exec(s.href),a=!0;return!!n&&(H.each(n,function(t){t||(a=!1)}),a)}catch(r){return H.log("control_link\u5b57\u6bb5\u5f02\u5e38",r),!1}},H.log=function(){if("object"==typeof console&&console.log){H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},H.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},H.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},H.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},H.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},t.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!H.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=H.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,s.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(H.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";H.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return H.isObject(t.properties)&&(s.properties=H.extend({},s.properties,t.properties)),H.isObject(t.custom_properties)&&(s.custom_properties=H.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){function e(){var t=s.SensorsABTest.sd.store.getDistinctId();s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){s.SensorsABTest.dealResponseData(e,t),i&&i(e),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()}},t.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},e.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=H.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),H.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":H.isObject(window.SensorsData_APP_New_H5_Bridge)&&H.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,e.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:r.properties,timeout:a,request_body:o},callback:function(t){H.isObject(t)&&H.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),i&&i(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=r.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};H.isObject(r.custom_properties)&&(o=H.extend(o,{custom_properties:r.custom_properties,param_name:r.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(H.isObject(s.properties)&&(t.properties=H.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},e.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);if(t=i.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}};var W="dfm-enc-";n.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(H.isNumber(t))return!0;break;case"String":if(H.isString(t))return!0;break;case"Object":if(H.isObject(t))return!0;break;case"Boolean":if(t===!0||t===!1)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return H.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":H.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":H.isString(e.value_type)&&H.indexOf(r.value_type_list,e.value_type)!==-1||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":H.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!H.isNumber(e.timeout_milliseconds)||H.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=H.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!H.isObject(r)||H.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(H.each(r,function(t,r){if((!H.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(H.isString(t)||H.isNumber(t)||H.isBoolean(t)||H.isArray(t)||H.isDate(t))&&!(H.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),H.isArray(t)){var i=!0;H.each(t,function(t){i!==!1&&(H.isString(t)||(i=!1))}),i||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+r+" ] of value "+JSON.stringify(t)+" is not invalid"), s.verify_success=!1)}}),s.verify_success===!0){var i={};H.each(r,function(t,e){H.isDate(t)?i[e]=H.formatDate(t):H.isString(t)?i[e]=t:i[e]=JSON.stringify(t)}),t.custom_properties=i}return s.para=t,s}},u.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){H.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!H.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,H.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(r){H.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!H.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){H.log("error when remove calls")}}},h.prototype.init=function(t){return this.initPara(t),this.para?H.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener()):(this.SensorsABTest.log("multilink is closed"),!1)},h.prototype.addSinglePageListener=function(){var t=this;H.addSinglePageEvent(function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),H.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},h.prototype.initMask=function(){this.mask_instance=new u("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},h.prototype.initPara=function(t){if(H.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:H.isObject(t)&&(this.para.timeout=H.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=H.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=H.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=H.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!H.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=H.isFunction(t.onRedirect)?t.onRedirect:null)},h.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para)return!1;if(!H.isArray(t))return!1;if(this.is_filtered_out)return!1;if(!this.isFirst)return!1;if(this.isFirst=!1,0===this.para.timeout)return!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),!1;var s=!1;H.each(t,function(t){return!!H.isObject(t)&&(!s&&("LINK"===t.experiment_type&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},h.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},h.prototype.isTriggerLinkExp=function(t){return H.isString(t.control_link)&&H.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!H.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!H.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},h.prototype.redirectUrl=function(t){function e(t){return H.secCheck.isHttpUrl(t)?H.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!H.isString(t.experiment_link))return void this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id);if(t.is_control_group===!0&&("STRICT"===t.link_match_type||"REGEXP"===t.link_match_type))return void this.SensorsABTest.triggerHandle(t);var s=location.href,r=t.experiment_link,i=/\$\d+/;if("REGEXP"===t.link_match_type&&i.test(r)){var n=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);r=s.replace(n,r)}var a,o;if(this.para.pass_params?(o=this.getMergedUrl(t.is_control_group,r,s),a=e(o)):(o=this.getMergedUrl(t.is_control_group,r),a=e(o)),a){var c=this.SensorsABTest.triggerHandle(t),l=c?80:0;this.para.onRedirect?(this.para.onRedirect(a),this.mask_instance.remove()):this.redirect(a,l),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},h.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},h.prototype.getMergedUrl=function(t,e,s){function r(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/,s=e.exec(t);if(s){var r=s[1]||"",i=s[2]||"",n=s[3]||"";return{host:r,search:i,hash:n}}}function i(t){var e={hash:"",search:""};if(!H.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}var n="",a="",o="",c={parse_url:null,search:""},l={parse_url:null,search:"",hash:""};return s&&(c.parse_url=r(s),!c.parse_url)?void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s):(l.parse_url=r(e),l.parse_url?(s&&("after_hash"===this.para.control_link_search?c.search=i(c.parse_url.hash).search:c.search=c.parse_url.search),t?"after_hash"===this.para.control_link_search?(l.search=i(l.parse_url.hash).search,l.hash=i(l.parse_url.hash).hash):l.search=l.parse_url.search:"after_hash"===this.para.experiment_link_search?(l.search=i(l.parse_url.hash).search,l.hash=i(l.parse_url.hash).hash):l.search=l.parse_url.search,a=s?this.getSearchStr(c.search,l.search):this.getSearchStr(l.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?n=l.hash.length>0?l.parse_url.host+l.parse_url.search+l.hash+a:l.parse_url.search.length>0?l.parse_url.host+l.parse_url.search+"&"+a.substring(1):l.parse_url.host+a:(o="after_hash"===this.para.control_link_search?l.parse_url.hash:s?l.parse_url.hash||c.parse_url.hash:l.parse_url.hash,n=l.parse_url.host+a+o),n):void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e))},h.prototype.getSearchStr=function(t,e){function s(t){var e={};if(!t||!t.length||0!==t.indexOf("?"))return e;if(t=t.slice(1),!t.length)return e;for(var s=t.split("&"),r=0;r=d&&(e.push(r({type:"childList",target:s,addedNodes:[u],removedNodes:[u],nextSibling:u.nextSibling,previousSibling:u.previousSibling})),f--),n.attr&&h.attr&&o(e,u,h.attr,n.afilter),n.charData&&3===u.nodeType&&u.nodeValue!==h.charData&&e.push(r({type:"characterData",target:u,oldValue:h.charData})),n.descendents&&c(u,h)}function c(s,i){for(var p,d,g,_,m,v,y,S=s.childNodes,b=i.kids,T=S.length,A=b?b.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var s=H.isString(t.vabtest_url)?t.vabtest_url:"";s&&("https:"===location.protocol?"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===s.slice(0,5)||"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))},R.prototype.resolve=function(){var t=this.SensorsABTest.results;if(this.enable_visualize!==!1&&this.is_editor!==!0&&this.isFirst!==!1){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;H.each(t,function(t){if(!H.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var r=t.experiment_value;if(!H.isArray(r))try{r=JSON.parse(t.experiment_value),t.experiment_value=r}catch(i){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},R.prototype.initMask=function(){this.mask_instance=new u("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},R.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},R.prototype.prepareResource=function(t,e){var s=this,r=t.experiment_value;H.isArray(r)&&(H.each(r,function(r){function i(){var r=s.imgLoadingList.indexOf(o);s.loadedImages.push(o),r>-1&&s.imgLoadingList.splice(r,1),0===s.imgLoadingList.length&&e(t)}var n=r.tagName,a=r.props;if("img"===n&&a&&a.attributes&&H.isString(a.attributes.src)){var o=a.attributes.src;if(s.imgLoadingList.push(o),s.loadedImages.indexOf(o)>-1){var c=s.imgLoadingList.indexOf(o);return c>-1&&s.imgLoadingList.splice(c,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=i,l.onerror=i,l.onabort=i,l.src=a.attributes.src}}),0===this.imgLoadingList.length&&e(t))},R.prototype.render=function(t){var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&e.mask_instance.is_timeout===!0)return void e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),H.isArray(e.originData)&&(H.each(e.originData,function(t){N(t)}),e.originData=[]);var s=t.experiment_value;H.isArray(s)&&H.each(s,function(t){var s=t.selector,r=b(s);if(r)try{var i=L(r,[]),n=i.eleInfo,a=D(r,t,n);a&&e.originData.push(i)}catch(o){}}),e.use_mask&&e.destroyMask()};this.isDomReady?s():f(window,s)},R.prototype.restoreElements=function(){H.each(this.originData,function(t){N(t)}),this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1},R.prototype.addDomReadyListener=function(){var t=this;f(window,function(){t.isDomReady=!0,P(t.observerCallback.bind(t))})},R.prototype.addSinglePageListener=function(){var t=this;H.addSinglePageEvent(function(e){return e!==location.href&&(t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),void t.resolve())})},R.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},R.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},R.prototype.isTriggerVisualExp=function(t){return H.isString(t.control_link)&&H.isString(t.link_match_type)?!!H.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},F.prototype.asyncFetchABTest=function(){H.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.fastFetchABTest=function(){H.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.fetchCacheABTest=function(){H.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},F.prototype.getExpResult=function(t,e){var s=t.default_value,r=e?e:this.searchLocalExp(t.param_name);return H.isObject(r)?H.isObject(r.js_config)&&(r.js_config.type===t.value_type?(s=r.js_config.value,this.triggerHandle(r,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+r.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},F.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;H.each(e,function(e){H.isObject(e)&&e.variables&&H.isArray(e.variables)&&H.each(e.variables,function(s){H.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=H.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},F.prototype.getRelativeValue=function(t,e){var s=this,r={},i={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(r.value=e,r.type="Number")},STRING:function(t){H.isString(t)?(r.value=t,r.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);H.isObject(e)?(r.value=e,r.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(r.value=!0,r.type="Boolean"):"false"===t?(r.value=!1,r.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{i[e]?i[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return r},F.prototype.dealResponseData=function(t,e){H.isObject(t)?"SUCCESS"===t.status?H.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},F.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},F.prototype.updateStorage=function(t){var e=(new Date).getTime(),s={results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},r=this.state.storage.name,i=this.para.encrypt_cookie;l(s,r,i),this.updateTime=e},F.prototype.analyzeData=function(){var t=this.results;return H.isArray(t)?(this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},F.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,r=this,i=!1,n={};if(H.isArray(s)&&s.length>0&&(H.each(s,function(s){H.isObject(s)&&!i&&("CODE"===t?H.isObject(s)&&s.variables&&H.isArray(s.variables)&&H.each(s.variables,function(t){var a=r.getRelativeValue(t.value,t.type);!i&&a&&H.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(i=!0,n=s)}):"LINK"===t?H.isString(s.control_link)&&H.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?H.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(i=!0,n=s):H.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s)):"VISUAL"===t&&H.isString(s.control_link)&&H.isString(s.link_match_type)&&H.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s))}),i)){var a=r.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),r.sendTriggerEvent("outTriggerList",a,n,{})}},F.prototype.registerProperty=function(){var t=this.track_config.property_set_switch;if(t){var e=this.sd.store.getUnionId(),s=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],r=this.sd.bridge.is_verify_success?this.getLatestSubject():[],i=[],n=[];H.each(this.triggerList,function(t,e){s.indexOf(e)<0&&r.indexOf(e)<0||H.isArray(t)&&H.each(t,function(t){t.result_id&&i.push(t.result_id)})}),H.isArray(this.results)&&H.each(this.results,function(t){t.abtest_experiment_result_id&&n.push(t.abtest_experiment_result_id)}),i.length>0&&this.sd.registerPage({abtest_result:i}),n.length>0&&this.sd.registerPage({abtest_dispatch_result:n})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},F.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t);var s=this.state.storage.latest_name,r=this.para.encrypt_cookie;l(e,s,r)},F.prototype.getLatestSubject=function(){var t=this.state.storage.latest_name;return c(t)||[]},F.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s);var r=this.trackTestTrigger(s,t,e);return r},F.prototype.getTriggerProps=function(t,e){var s={},r=H.isObject(e)&&H.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var i="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[i]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return H.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=H.extend(n,s,r)},F.prototype.sendTriggerEvent=function(t,e,s,r){var i=this.track_config.trigger_switch,n=!0,a=this[t];a&&H.isObject(a)&&a[e]&&H.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=C(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,r);return n&&i&&this.sd.track("$ABTestTrigger",o),n},F.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var r=this.sendTriggerEvent("triggerList",t,e,s),i=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",i),r},F.prototype.checkSADebug=function(){var t=this,e=H.getQueryParam(location.href,"sensors_abtest_url"),s=H.getQueryParam(location.href,"feature_code"),r=+H.getQueryParam(location.href,"account_id");if(e.length&&s.length&&H.isNumber(r)&&0!==r){var i={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:r};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(i),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},F.prototype.initMethods=function(t){var e=this,s=["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"];H.each(s,function(s){e[s]=t.methods[s].bind(t)})},U.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),H.isObject(s)&&"SUCCESS"===s.status&&H.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,r=t.outTriggerList;H.isArray(s)&&(this.SensorsABTest.out_list=s),H.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),H.isObject(r)&&(this.SensorsABTest.outTriggerList=r),H.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),r=c(this.SensorsABTest.state.storage.name),i=this.SensorsABTest.sd.store.getDistinctId();if(r&&H.isObject(r)&&r.distinct_id===i)if(e=r.updateTime,t&&this.updateExpsCache(r),e&&H.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)M.call(this,t,e);else{var s=this;t.on("sdkReady",function(){M.call(s,t,e)})}},F.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},F.prototype.log=function(){return H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var q=new F;return q.__constructor__=F,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||q:window.SensorsDataWebJSSDKPlugin={SensorsABTest:q},F}); \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js b/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js index a2a72f59..e8b24f21 100644 --- a/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js +++ b/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js @@ -1 +1 @@ -var _={},ArrayProto=Array.prototype,ObjProto=Object.prototype,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,nativeForEach=ArrayProto.forEach,nativeIsArray=Array.isArray,breaker={};function NormalStore(t){this.SensorsABTest=t,this.para=t.para}function BridgeStore(t){this.SensorsABTest=t,this.para=t.para}_.each=function(t,e,s){if(null==t)return!1;if(nativeForEach&&t.forEach===nativeForEach)t.forEach(e,s);else if(_.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL"),this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},_.URL=function(t){var e,s={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(t){return!1}}())(s=new URL(t)).searchParams||(s.searchParams=(e=_.getURLSearchParams(s.search),{get:function(t){return e[t]}}));else{!1===/^https?:\/\/.+/.test(t)&&_.log("Invalid URL");var r=_.urlParse(t);s.hash="",s.host=r._values.Host?r._values.Host+(r._values.Port?":"+r._values.Port:""):"",s.href=r._values.URL,s.password=r._values.Password,s.pathname=r._values.Path,s.port=r._values.Port,s.search=r._values.QueryString?"?"+r._values.QueryString:"",s.username=r._values.Username,s.hostname=r._values.Hostname,s.protocol=r._values.Protocol?r._values.Protocol+":":"",s.origin=r._values.Origin?r._values.Origin+(r._values.Port?":"+r._values.Port:""):"",s.searchParams=function(){var t=_.getURLSearchParams("?"+r._values.QueryString);return{get:function(e){return t[e]}}}()}return s},_.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=_.decodeURIComponent(t);var s=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===s||s&&"string"!=typeof s[1]&&s[1].length?"":_.decodeURIComponent(s[1])},_.isEmptyObject=function(t){if(_.isObject(t)){for(var e in t)if(hasOwnProperty.call(t,e))return!1;return!0}return!1},_.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",l=a?"removeEventListener":"detachEvent",c=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[l](c+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(_){}r&&h()}i[o](c+"DOMContentLoaded",u,!1),i[o](c+"readystatechange",u,!1),t[o](c+"load",u,!1)}},_.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;return!1!==/^https?:\/\/.+/.test(t)||(_.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},_.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,s,r){if(e&&e.addEventListener)e.addEventListener(s,function(e){e._getPath=t._getPath,r.call(this,e)},!0);else{var i="on"+s,n=e[i];e[i]=function(e,s,r){return function(i){if(!(i=i||t(window.event)))return undefined;i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}}(e,r,n)}}).apply(null,arguments)},_.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";_.addEvent(window,i,function(){t(e),e=location.href})},_.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},_.checkUrlIsMatch=function(t,e){var s,r,i=_.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=_.URL(location.href)}catch(n){return _.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=_.URL(t)}catch(n){return _.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return _.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},_.checkUrlIsRegexp=function(t,e){var s;try{s=_.URL(location.href)}catch(n){return _.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{var r=(e?new RegExp(t,e):new RegExp(t)).exec(s.href),i=!0;return!!r&&(_.each(r,function(t){t||(i=!1)}),i)}catch(n){return _.log("control_link\u5b57\u6bb5\u5f02\u5e38",n),!1}},_.log=function(){if("object"==typeof console&&console.log){_.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},_.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},_.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},_.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},_.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},NormalStore.prototype={init:function(t){if(!this.setPara(t))return!1;this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),this.SensorsABTest.store.init(this.getResultFromServer,this)},setPara:function(t){if(!_.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=_.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,s.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(_.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";_.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return _.isObject(t.properties)&&(s.properties=_.extend({},s.properties,t.properties)),_.isObject(t.custom_properties)&&(s.custom_properties=_.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){var e,s=this,r=(t=_.isObject(t)?t:{}).para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e=s.SensorsABTest.sd.store.getDistinctId(),s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(t){s.SensorsABTest.dealResponseData(t,e),i&&i(t),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}},NormalStore.prototype.methods={asyncFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);s.verify_success?(t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)):t.callback(t.default_value)}},fastFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(_.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);t.callback(r)}else{var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);i.verify_success?(t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)):t.callback(t.default_value)}}},fetchCacheABTest:function(t){if(_.isObject(t)){var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},BridgeStore.prototype={init:function(t){var e=this;if(this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!this.setPara(t))return!1;this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=_.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{(t=JSON.parse(t)).message_id&&this.double(t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),_.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":_.isObject(window.SensorsData_APP_New_H5_Bridge)&&_.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",this.SensorsABTest.store.init(this.getResultFromApp,this)},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,e.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){var e=this,s=(t=_.isObject(t)?t:{}).para||{},r=t.suc,i=t.err,n=s.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,a={origin_platform:"H5"};_.isObject(s.custom_properties)&&(a=_.extend(a,{custom_properties:s.custom_properties,param_name:s.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),"ab_bridge_ok"===e.SensorsABTest.bridgeState?e.abBridge.requestToApp({data:{properties:s.properties,timeout:n,request_body:a},callback:function(t){_.isObject(t)&&_.isObject(t.data)?(e.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),e.SensorsABTest.dealResponseData(t.data),r&&r(t)):(e.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),i&&i()),e.SensorsABTest.fetchData.setNextFetch()},timeout:{time:n,callback:function(){e.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),i&&i(),e.SensorsABTest.fetchData.setNextFetch()}}}):i&&(e.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",e.SensorsABTest.bridgeState),i())},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(_.isObject(s.properties)&&(t.properties=_.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},BridgeStore.prototype.methods={asyncFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);s.verify_success?(t=s.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?this.SensorsABTest.bridgeStore.asyncFetch(t):t.callback(t.default_value)):t.callback(t.default_value)}},fastFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(_.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);t.callback(r)}else{var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);i.verify_success?(t=i.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?(this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)):t.callback(t.default_value)):t.callback(t.default_value)}}},fetchCacheABTest:function(t){if(_.isObject(t)){var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}};var flag_dfm="dfm-enc-";function dfmapping(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",s=e.length-1,r={},i=0;for(i=0;i=3?t:null}function listenPageState(t){({visibleHandle:_.isFunction(t.visible)?t.visible:function(){},hiddenHandler:_.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()}function getStorageData(t){var e=_.storage.get(t);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(s){_.log(s)}return e}function setStorageData(t,e,s){t=JSON.stringify(t),s&&(t=encrypt(t)),_.storage.set(t,e)}function Mask(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function Link(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function getUA(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function validateProject(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(!0!==e||!_.checkUrlIsMatch(s,r))||(_.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function bindReady(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",l=a?"removeEventListener":"detachEvent",c=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[l](c+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(_){}r&&h()}i[o](c+"DOMContentLoaded",u,!1),i[o](c+"readystatechange",u,!1),t[o](c+"load",u,!1)}}function getDomIndex(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):getDomSelector(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function getStyle(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function getElementStyles(t,e){var s={};return _.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=getStyle(t,r)}),s}function getElementText(t){var e=t.childNodes,s="",r=!1;return _.each(e,function(t){!1===r&&3===t.nodeType&&(_.isString(t.textContent)||_.isString(t.innerText)||_.isString(t.nodeValue))&&(s=_.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function getDomBySelector(t){if(!_.isString(t))return null;var e,s=t.split(">");return(e=function r(t){var e,i=s.shift();if(!i)return t;try{e=function(t,e){var s;if("body"===(t=_.trim(t)))return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(_.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,l=0;l0)return null}return s||null}(i,t)}catch(n){e=null}return e&&_.isElement(e)?r(e):null}())&&_.isElement(e)?e:null}function rgbaToRgb(t){var e=t.match(/[\d.]+/g);return e.length>=3?"rgb("+e[0]+","+e[1]+","+e[2]+")":""}function changeStyle(t,e){var s=getUA(),r=s.ie&&s.ie<9,i="";if(_.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=rgbaToRgb(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});i+=";"+s+": "+t}),""!==i){var n,a,o,l=t.style,c=l.cssText||"";!c||(a=";",(o=(n=c).length-a.length)>=0&&n.indexOf(a,o)==o)||(c+=";"),l.cssText=c+i}}function changeText(t,e){var s=t.childNodes,r=!1;_.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function propsFilter(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&_.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function changeAttribute(t,e,s){t.setAttribute(e,s)}function getElementPropsByAttr(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return _.each(i.style||{},function(e,s){r.attributes.style[s]=getStyle(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=getElementText(t)),_.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function changeAttributes(t,e,s){s||(s=getElementPropsByAttr(t,e));var r=propsFilter(e,s);if(r){var i=e.props;_.isObject(i)&&setAttributes(t,i)}return r}function setAttributes(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&changeStyle(t,s.style),_.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&changeAttribute(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&changeText(t,e.text)}function loadScript(t){t=_.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&((e=document.createElement("link")).rel="stylesheet",e.href=t.url),"js"===t.type&&((e=document.createElement("script")).async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function loadVtesting(t,e){loadScript(_.extend({success:function(){},error:function(){},type:"js",url:t},e))}function addMutationObserver(t){new(0,window.MutationObserver)(t).observe(document.body,{childList:!0,subtree:!0})}function getInfoByElement(t,e){var s=t.tagName.toLowerCase(),r=getElementStyles(t,e),i={selector:getDomSelector(t),originProps:{attributes:{style:r},text:getElementText(t)},type:"text",tagName:s};return"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img"),{originStyle:t.getAttribute("style"),eleInfo:i,ele:t}}function restoreElement(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;setAttributes(s,e.originProps),s.style.cssText=r||""}}function Vabtesting(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function SensorsABTest(){this.lib_version="1.25.9",this.plugin_version="1.25.9",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new Link(this),this.vabtest=new Vabtesting(this),this.normalStore=new NormalStore(this),this.bridgeStore=new BridgeStore(this),this.verifyStore=new VerifyStore(this)}function updateTriggerData(t,e){var s=[];_.isArray(t)&&_.each(t,function(e,s){_.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(_.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&_.isArray(t)){var n=!1;_.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function FetchData(t){this.SensorsABTest=t}function Store(t){this.SensorsABTest=t}function initSensorsABTest(t,e){return getSA(t)?(this.sd=t,_.isObject(e)?(_.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new FetchData(this),this.store=new Store(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}VerifyStore.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(_.isNumber(t))return!0;break;case"String":if(_.isString(t))return!0;break;case"Object":if(_.isObject(t))return!0;break;case"Boolean":if(!0===t||!1===t)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return _.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":_.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":_.isString(e.value_type)&&-1!==_.indexOf(r.value_type_list,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":_.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!_.isNumber(e.timeout_milliseconds)||_.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=_.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!_.isObject(r)||_.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(_.each(r,function(t,r){if((!_.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(_.isString(t)||_.isNumber(t)||_.isBoolean(t)||_.isArray(t)||_.isDate(t))&&!(_.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),_.isArray(t)){var i=!0;_.each(t,function(t){!1!==i&&(_.isString(t)||(i=!1))}),i||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+r+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),!0===s.verify_success){var i={};_.each(r,function(t,e){_.isDate(t)?i[e]=_.formatDate(t):_.isString(t)?i[e]=t:i[e]=JSON.stringify(t)}),t.custom_properties=i}return s.para=t,s}},Mask.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){_.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!_.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,_.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(r){_.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!_.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){_.log("error when remove calls")}}},Link.prototype.init=function(t){return this.initPara(t),this.para?_.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener()):(this.SensorsABTest.log("multilink is closed"),!1)},Link.prototype.addSinglePageListener=function(){var t=this;_.addSinglePageEvent(function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),_.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},Link.prototype.initMask=function(){this.mask_instance=new Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},Link.prototype.initPara=function(t){if(_.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}!1===t?this.para=!1:_.isObject(t)&&(this.para.timeout=_.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=_.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=_.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=_.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!_.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=_.isFunction(t.onRedirect)?t.onRedirect:null)},Link.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para)return!1;if(!_.isArray(t))return!1;if(this.is_filtered_out)return!1;if(!this.isFirst)return!1;if(this.isFirst=!1,0===this.para.timeout)return!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),!1;var s=!1;_.each(t,function(t){return!!_.isObject(t)&&(!s&&("LINK"===t.experiment_type&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},Link.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},Link.prototype.isTriggerLinkExp=function(t){return _.isString(t.control_link)&&_.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!_.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!_.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},Link.prototype.redirectUrl=function(t){if(t.experiment_link&&_.isString(t.experiment_link))if(!0!==t.is_control_group||"STRICT"!==t.link_match_type&&"REGEXP"!==t.link_match_type){var e,s=location.href,r=t.experiment_link;if("REGEXP"===t.link_match_type&&/\$\d+/.test(r)){var i=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);r=s.replace(i,r)}if(e=this.para.pass_params?a(this.getMergedUrl(t.is_control_group,r,s)):a(this.getMergedUrl(t.is_control_group,r))){var n=this.SensorsABTest.triggerHandle(t)?80:0;this.para.onRedirect?(this.para.onRedirect(e),this.mask_instance.remove()):this.redirect(e,n),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}}else this.SensorsABTest.triggerHandle(t);else this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id);function a(t){return _.secCheck.isHttpUrl(t)?_.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}},Link.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},Link.prototype.getMergedUrl=function(t,e,s){var r="",i="",n="",a={parse_url:null,search:""},o={parse_url:null,search:"",hash:""};function l(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t);if(e)return{host:e[1]||"",search:e[2]||"",hash:e[3]||""}}if(!s||(a.parse_url=l(s),a.parse_url)){if(o.parse_url=l(e),o.parse_url)return s&&("after_hash"===this.para.control_link_search?a.search=c(a.parse_url.hash).search:a.search=a.parse_url.search),t?"after_hash"===this.para.control_link_search?(o.search=c(o.parse_url.hash).search,o.hash=c(o.parse_url.hash).hash):o.search=o.parse_url.search:"after_hash"===this.para.experiment_link_search?(o.search=c(o.parse_url.hash).search,o.hash=c(o.parse_url.hash).hash):o.search=o.parse_url.search,i=s?this.getSearchStr(a.search,o.search):this.getSearchStr(o.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?r=o.hash.length>0?o.parse_url.host+o.parse_url.search+o.hash+i:o.parse_url.search.length>0?o.parse_url.host+o.parse_url.search+"&"+i.substring(1):o.parse_url.host+i:(n="after_hash"===this.para.control_link_search?o.parse_url.hash:s?o.parse_url.hash||a.parse_url.hash:o.parse_url.hash,r=o.parse_url.host+i+n),r;this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e)}else this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s);function c(t){var e={hash:"",search:""};if(!_.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}},Link.prototype.getSearchStr=function(t,e){function s(t){var e={};if(!t||!t.length||0!==t.indexOf("?"))return e;if(!(t=t.slice(1)).length)return e;for(var s=t.split("&"),r=0;r=p&&(e.push(s({type:"childList",target:r,addedNodes:[c],removedNodes:[c],nextSibling:c.nextSibling,previousSibling:c.previousSibling})),d--),n.attr&&h.attr&&a(e,c,h.attr,n.afilter),n.charData&&3===c.nodeType&&c.nodeValue!==h.charData&&e.push(s({type:"characterData",target:c,oldValue:h.charData})),n.descendents&&u(c,h)}function u(r,i){for(var _,d,g,f,m,v,S,y=r.childNodes,b=i.kids,T=y.length,A=b?b.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var e=_.isString(t.vabtest_url)?t.vabtest_url:"";e&&("https:"===location.protocol?"https:"===e.slice(0,6)?this.vabtest_url=e:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===e.slice(0,5)||"https:"===e.slice(0,6)?this.vabtest_url=e:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))}else this.para=!1},Vabtesting.prototype.resolve=function(){var t=this.SensorsABTest.results;if(!1!==this.enable_visualize&&!0!==this.is_editor&&!1!==this.isFirst){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;_.each(t,function(t){if(!_.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var r=t.experiment_value;if(!_.isArray(r))try{r=JSON.parse(t.experiment_value),t.experiment_value=r}catch(i){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},Vabtesting.prototype.initMask=function(){this.mask_instance=new Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},Vabtesting.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},Vabtesting.prototype.prepareResource=function(t,e){var s=this,r=t.experiment_value;_.isArray(r)&&(_.each(r,function(r){var i=r.tagName,n=r.props;if("img"===i&&n&&n.attributes&&_.isString(n.attributes.src)){var a=n.attributes.src;if(s.imgLoadingList.push(a),s.loadedImages.indexOf(a)>-1){var o=s.imgLoadingList.indexOf(a);return o>-1&&s.imgLoadingList.splice(o,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=c,l.onerror=c,l.onabort=c,l.src=n.attributes.src}function c(){var r=s.imgLoadingList.indexOf(a);s.loadedImages.push(a),r>-1&&s.imgLoadingList.splice(r,1),0===s.imgLoadingList.length&&e(t)}}),0===this.imgLoadingList.length&&e(t))},Vabtesting.prototype.render=function(t){var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&!0===e.mask_instance.is_timeout)e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");else{e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),_.isArray(e.originData)&&(_.each(e.originData,function(t){restoreElement(t)}),e.originData=[]);var s=t.experiment_value;_.isArray(s)&&_.each(s,function(t){var s=getDomBySelector(t.selector);if(s)try{var r=getInfoByElement(s,[]);changeAttributes(s,t,r.eleInfo)&&e.originData.push(r)}catch(i){}}),e.use_mask&&e.destroyMask()}};this.isDomReady?s():bindReady(window,s)},Vabtesting.prototype.restoreElements=function(){_.each(this.originData,function(t){restoreElement(t)}),this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1},Vabtesting.prototype.addDomReadyListener=function(){var t=this;bindReady(window,function(){t.isDomReady=!0,addMutationObserver(t.observerCallback.bind(t))})},Vabtesting.prototype.addSinglePageListener=function(){var t=this;_.addSinglePageEvent(function(e){if(e===location.href)return!1;t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),t.resolve()})},Vabtesting.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},Vabtesting.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},Vabtesting.prototype.isTriggerVisualExp=function(t){return _.isString(t.control_link)&&_.isString(t.link_match_type)?!!_.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},SensorsABTest.prototype.asyncFetchABTest=function(){_.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fastFetchABTest=function(){_.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fetchCacheABTest=function(){_.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},SensorsABTest.prototype.getExpResult=function(t,e){var s=t.default_value,r=e||this.searchLocalExp(t.param_name);return _.isObject(r)?_.isObject(r.js_config)&&(r.js_config.type===t.value_type?(s=r.js_config.value,this.triggerHandle(r,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+r.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},SensorsABTest.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;_.each(e,function(e){_.isObject(e)&&e.variables&&_.isArray(e.variables)&&_.each(e.variables,function(s){_.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=_.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},SensorsABTest.prototype.getRelativeValue=function(t,e){var s=this,r={},i={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(r.value=e,r.type="Number")},STRING:function(t){_.isString(t)?(r.value=t,r.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);_.isObject(e)?(r.value=e,r.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(r.value=!0,r.type="Boolean"):"false"===t?(r.value=!1,r.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{i[e]?i[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return r},SensorsABTest.prototype.dealResponseData=function(t,e){_.isObject(t)?"SUCCESS"===t.status?_.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},SensorsABTest.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.updateStorage=function(t){var e=(new Date).getTime();setStorageData({results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},this.state.storage.name,this.para.encrypt_cookie),this.updateTime=e},SensorsABTest.prototype.analyzeData=function(){var t=this.results;if(!_.isArray(t))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1;this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,r=this,i=!1,n={};if(_.isArray(s)&&s.length>0&&(_.each(s,function(s){_.isObject(s)&&!i&&("CODE"===t?_.isObject(s)&&s.variables&&_.isArray(s.variables)&&_.each(s.variables,function(t){var a=r.getRelativeValue(t.value,t.type);!i&&a&&_.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(i=!0,n=s)}):"LINK"===t?_.isString(s.control_link)&&_.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?_.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(i=!0,n=s):_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s)):"VISUAL"===t&&_.isString(s.control_link)&&_.isString(s.link_match_type)&&_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s))}),i)){var a=r.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),r.sendTriggerEvent("outTriggerList",a,n,{})}},SensorsABTest.prototype.registerProperty=function(){if(this.track_config.property_set_switch){var t=this.sd.store.getUnionId(),e=["USER"+(t.login_id||t.anonymous_id),"DEVICE"+t.anonymous_id],s=this.sd.bridge.is_verify_success?this.getLatestSubject():[],r=[],i=[];_.each(this.triggerList,function(t,i){e.indexOf(i)<0&&s.indexOf(i)<0||_.isArray(t)&&_.each(t,function(t){t.result_id&&r.push(t.result_id)})}),_.isArray(this.results)&&_.each(this.results,function(t){t.abtest_experiment_result_id&&i.push(t.abtest_experiment_result_id)}),r.length>0&&this.sd.registerPage({abtest_result:r}),i.length>0&&this.sd.registerPage({abtest_dispatch_result:i})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},SensorsABTest.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t),setStorageData(e,this.state.storage.latest_name,this.para.encrypt_cookie)},SensorsABTest.prototype.getLatestSubject=function(){return getStorageData(this.state.storage.latest_name)||[]},SensorsABTest.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();return t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s),this.trackTestTrigger(s,t,e)},SensorsABTest.prototype.getTriggerProps=function(t,e){var s={},r=_.isObject(e)&&_.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var i="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[i]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return _.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=_.extend(n,s,r)},SensorsABTest.prototype.sendTriggerEvent=function(t,e,s,r){var i=this.track_config.trigger_switch,n=!0,a=this[t];a&&_.isObject(a)&&a[e]&&_.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=updateTriggerData(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,r);return n&&i&&this.sd.track("$ABTestTrigger",o),n},SensorsABTest.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var r=this.sendTriggerEvent("triggerList",t,e,s),i=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",i),r},SensorsABTest.prototype.checkSADebug=function(){var t=this,e=_.getQueryParam(location.href,"sensors_abtest_url"),s=_.getQueryParam(location.href,"feature_code"),r=+_.getQueryParam(location.href,"account_id");if(e.length&&s.length&&_.isNumber(r)&&0!==r){var i={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:r};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(i),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},SensorsABTest.prototype.initMethods=function(t){var e=this;_.each(["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"],function(s){e[s]=t.methods[s].bind(t)})},FetchData.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),_.isObject(s)&&"SUCCESS"===s.status&&_.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,r=t.outTriggerList;_.isArray(s)&&(this.SensorsABTest.out_list=s),_.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),_.isObject(r)&&(this.SensorsABTest.outTriggerList=r),_.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),r=getStorageData(this.SensorsABTest.state.storage.name),i=this.SensorsABTest.sd.store.getDistinctId();if(r&&_.isObject(r)&&r.distinct_id===i)if(e=r.updateTime,t&&this.updateExpsCache(r),e&&_.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)initSensorsABTest.call(this,t,e);else{var s=this;t.on("sdkReady",function(){initSensorsABTest.call(s,t,e)})}},SensorsABTest.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},SensorsABTest.prototype.log=function(){return _.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var instance=new SensorsABTest;instance.__constructor__=SensorsABTest,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||instance:window.SensorsDataWebJSSDKPlugin={SensorsABTest:instance};export default SensorsABTest; \ No newline at end of file +var _={},ArrayProto=Array.prototype,ObjProto=Object.prototype,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,nativeForEach=ArrayProto.forEach,nativeIsArray=Array.isArray,breaker={};function NormalStore(t){this.SensorsABTest=t,this.para=t.para}function BridgeStore(t){this.SensorsABTest=t,this.para=t.para}_.each=function(t,e,s){if(null==t)return!1;if(nativeForEach&&t.forEach===nativeForEach)t.forEach(e,s);else if(_.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL"),this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},_.URL=function(t){var e,s={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(t){return!1}}())(s=new URL(t)).searchParams||(s.searchParams=(e=_.getURLSearchParams(s.search),{get:function(t){return e[t]}}));else{!1===/^https?:\/\/.+/.test(t)&&_.log("Invalid URL");var r=_.urlParse(t);s.hash="",s.host=r._values.Host?r._values.Host+(r._values.Port?":"+r._values.Port:""):"",s.href=r._values.URL,s.password=r._values.Password,s.pathname=r._values.Path,s.port=r._values.Port,s.search=r._values.QueryString?"?"+r._values.QueryString:"",s.username=r._values.Username,s.hostname=r._values.Hostname,s.protocol=r._values.Protocol?r._values.Protocol+":":"",s.origin=r._values.Origin?r._values.Origin+(r._values.Port?":"+r._values.Port:""):"",s.searchParams=function(){var t=_.getURLSearchParams("?"+r._values.QueryString);return{get:function(e){return t[e]}}}()}return s},_.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=_.decodeURIComponent(t);var s=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===s||s&&"string"!=typeof s[1]&&s[1].length?"":_.decodeURIComponent(s[1])},_.isEmptyObject=function(t){if(_.isObject(t)){for(var e in t)if(hasOwnProperty.call(t,e))return!1;return!0}return!1},_.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",l=a?"removeEventListener":"detachEvent",c=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[l](c+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(_){}r&&h()}i[o](c+"DOMContentLoaded",u,!1),i[o](c+"readystatechange",u,!1),t[o](c+"load",u,!1)}},_.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;return!1!==/^https?:\/\/.+/.test(t)||(_.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},_.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,s,r){if(e&&e.addEventListener)e.addEventListener(s,function(e){e._getPath=t._getPath,r.call(this,e)},!0);else{var i="on"+s,n=e[i];e[i]=function(e,s,r){return function(i){if(!(i=i||t(window.event)))return undefined;i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}}(e,r,n)}}).apply(null,arguments)},_.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";_.addEvent(window,i,function(){t(e),e=location.href})},_.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},_.checkUrlIsMatch=function(t,e){var s,r,i=_.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=_.URL(location.href)}catch(n){return _.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=_.URL(t)}catch(n){return _.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return _.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},_.checkUrlIsRegexp=function(t,e){var s;try{s=_.URL(location.href)}catch(n){return _.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{var r=(e?new RegExp(t,e):new RegExp(t)).exec(s.href),i=!0;return!!r&&(_.each(r,function(t){t||(i=!1)}),i)}catch(n){return _.log("control_link\u5b57\u6bb5\u5f02\u5e38",n),!1}},_.log=function(){if("object"==typeof console&&console.log){_.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},_.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},_.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},_.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},_.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},NormalStore.prototype={init:function(t){if(!this.setPara(t))return!1;this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),this.SensorsABTest.store.init(this.getResultFromServer,this)},setPara:function(t){if(!_.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=_.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,s.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(_.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";_.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return _.isObject(t.properties)&&(s.properties=_.extend({},s.properties,t.properties)),_.isObject(t.custom_properties)&&(s.custom_properties=_.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){var e,s=this,r=(t=_.isObject(t)?t:{}).para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e=s.SensorsABTest.sd.store.getDistinctId(),s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(t){s.SensorsABTest.dealResponseData(t,e),i&&i(t),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}},NormalStore.prototype.methods={asyncFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);s.verify_success?(t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)):t.callback(t.default_value)}},fastFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(_.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);t.callback(r)}else{var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);i.verify_success?(t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)):t.callback(t.default_value)}}},fetchCacheABTest:function(t){if(_.isObject(t)){var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},BridgeStore.prototype={init:function(t){var e=this;if(this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!this.setPara(t))return!1;this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=_.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{(t=JSON.parse(t)).message_id&&this.double(t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),_.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":_.isObject(window.SensorsData_APP_New_H5_Bridge)&&_.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",this.SensorsABTest.store.init(this.getResultFromApp,this)},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,e.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){var e=this,s=(t=_.isObject(t)?t:{}).para||{},r=t.suc,i=t.err,n=s.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,a={origin_platform:"H5"};_.isObject(s.custom_properties)&&(a=_.extend(a,{custom_properties:s.custom_properties,param_name:s.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),"ab_bridge_ok"===e.SensorsABTest.bridgeState?e.abBridge.requestToApp({data:{properties:s.properties,timeout:n,request_body:a},callback:function(t){_.isObject(t)&&_.isObject(t.data)?(e.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),e.SensorsABTest.dealResponseData(t.data),r&&r(t)):(e.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),i&&i()),e.SensorsABTest.fetchData.setNextFetch()},timeout:{time:n,callback:function(){e.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),i&&i(),e.SensorsABTest.fetchData.setNextFetch()}}}):i&&(e.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",e.SensorsABTest.bridgeState),i())},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(_.isObject(s.properties)&&(t.properties=_.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},BridgeStore.prototype.methods={asyncFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);s.verify_success?(t=s.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?this.SensorsABTest.bridgeStore.asyncFetch(t):t.callback(t.default_value)):t.callback(t.default_value)}},fastFetchABTest:function(t){if(!_.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(_.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);t.callback(r)}else{var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);i.verify_success?(t=i.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?(this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)):t.callback(t.default_value)):t.callback(t.default_value)}}},fetchCacheABTest:function(t){if(_.isObject(t)){var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}};var flag_dfm="dfm-enc-";function dfmapping(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",s=e.length-1,r={},i=0;for(i=0;i=3?t:null}function listenPageState(t){({visibleHandle:_.isFunction(t.visible)?t.visible:function(){},hiddenHandler:_.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()}function getStorageData(t){var e=_.storage.get(t);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(s){_.log(s)}return e}function setStorageData(t,e,s){t=JSON.stringify(t),s&&(t=encrypt(t)),_.storage.set(t,e)}function Mask(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function Link(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function getUA(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function validateProject(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(!0!==e||!_.checkUrlIsMatch(s,r))||(_.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function bindReady(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",l=a?"removeEventListener":"detachEvent",c=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[l](c+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(_){}r&&h()}i[o](c+"DOMContentLoaded",u,!1),i[o](c+"readystatechange",u,!1),t[o](c+"load",u,!1)}}function getDomIndex(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):getDomSelector(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function getStyle(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function getElementStyles(t,e){var s={};return _.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=getStyle(t,r)}),s}function getElementText(t){var e=t.childNodes,s="",r=!1;return _.each(e,function(t){!1===r&&3===t.nodeType&&(_.isString(t.textContent)||_.isString(t.innerText)||_.isString(t.nodeValue))&&(s=_.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function getDomBySelector(t){if(!_.isString(t))return null;var e,s=t.split(">");return(e=function r(t){var e,i=s.shift();if(!i)return t;try{e=function(t,e){var s;if("body"===(t=_.trim(t)))return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(_.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,l=0;l0)return null}return s||null}(i,t)}catch(n){e=null}return e&&_.isElement(e)?r(e):null}())&&_.isElement(e)?e:null}function rgbaToRgb(t){var e=t.match(/[\d.]+/g);return e.length>=3?"rgb("+e[0]+","+e[1]+","+e[2]+")":""}function changeStyle(t,e){var s=getUA(),r=s.ie&&s.ie<9,i="";if(_.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=rgbaToRgb(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});i+=";"+s+": "+t}),""!==i){var n,a,o,l=t.style,c=l.cssText||"";!c||(a=";",(o=(n=c).length-a.length)>=0&&n.indexOf(a,o)==o)||(c+=";"),l.cssText=c+i}}function changeText(t,e){var s=t.childNodes,r=!1;_.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function propsFilter(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&_.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function changeAttribute(t,e,s){t.setAttribute(e,s)}function getElementPropsByAttr(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return _.each(i.style||{},function(e,s){r.attributes.style[s]=getStyle(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=getElementText(t)),_.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function changeAttributes(t,e,s){s||(s=getElementPropsByAttr(t,e));var r=propsFilter(e,s);if(r){var i=e.props;_.isObject(i)&&setAttributes(t,i)}return r}function setAttributes(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&changeStyle(t,s.style),_.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&changeAttribute(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&changeText(t,e.text)}function loadScript(t){t=_.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&((e=document.createElement("link")).rel="stylesheet",e.href=t.url),"js"===t.type&&((e=document.createElement("script")).async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function loadVtesting(t,e){loadScript(_.extend({success:function(){},error:function(){},type:"js",url:t},e))}function addMutationObserver(t){new(0,window.MutationObserver)(t).observe(document.body,{childList:!0,subtree:!0})}function getInfoByElement(t,e){var s=t.tagName.toLowerCase(),r=getElementStyles(t,e),i={selector:getDomSelector(t),originProps:{attributes:{style:r},text:getElementText(t)},type:"text",tagName:s};return"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img"),{originStyle:t.getAttribute("style"),eleInfo:i,ele:t}}function restoreElement(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;setAttributes(s,e.originProps),s.style.cssText=r||""}}function Vabtesting(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function SensorsABTest(){this.lib_version="1.25.10",this.plugin_version="1.25.10",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new Link(this),this.vabtest=new Vabtesting(this),this.normalStore=new NormalStore(this),this.bridgeStore=new BridgeStore(this),this.verifyStore=new VerifyStore(this)}function updateTriggerData(t,e){var s=[];_.isArray(t)&&_.each(t,function(e,s){_.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(_.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&_.isArray(t)){var n=!1;_.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function FetchData(t){this.SensorsABTest=t}function Store(t){this.SensorsABTest=t}function initSensorsABTest(t,e){return getSA(t)?(this.sd=t,_.isObject(e)?(_.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new FetchData(this),this.store=new Store(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}VerifyStore.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(_.isNumber(t))return!0;break;case"String":if(_.isString(t))return!0;break;case"Object":if(_.isObject(t))return!0;break;case"Boolean":if(!0===t||!1===t)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return _.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":_.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":_.isString(e.value_type)&&-1!==_.indexOf(r.value_type_list,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":_.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!_.isNumber(e.timeout_milliseconds)||_.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=_.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!_.isObject(r)||_.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(_.each(r,function(t,r){if((!_.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(_.isString(t)||_.isNumber(t)||_.isBoolean(t)||_.isArray(t)||_.isDate(t))&&!(_.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),_.isArray(t)){var i=!0;_.each(t,function(t){!1!==i&&(_.isString(t)||(i=!1))}),i||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+r+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),!0===s.verify_success){var i={};_.each(r,function(t,e){_.isDate(t)?i[e]=_.formatDate(t):_.isString(t)?i[e]=t:i[e]=JSON.stringify(t)}),t.custom_properties=i}return s.para=t,s}},Mask.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){_.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!_.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,_.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(r){_.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!_.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){_.log("error when remove calls")}}},Link.prototype.init=function(t){return this.initPara(t),this.para?_.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener()):(this.SensorsABTest.log("multilink is closed"),!1)},Link.prototype.addSinglePageListener=function(){var t=this;_.addSinglePageEvent(function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),_.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},Link.prototype.initMask=function(){this.mask_instance=new Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},Link.prototype.initPara=function(t){if(_.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}!1===t?this.para=!1:_.isObject(t)&&(this.para.timeout=_.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=_.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=_.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=_.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!_.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=_.isFunction(t.onRedirect)?t.onRedirect:null)},Link.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para)return!1;if(!_.isArray(t))return!1;if(this.is_filtered_out)return!1;if(!this.isFirst)return!1;if(this.isFirst=!1,0===this.para.timeout)return!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),!1;var s=!1;_.each(t,function(t){return!!_.isObject(t)&&(!s&&("LINK"===t.experiment_type&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},Link.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},Link.prototype.isTriggerLinkExp=function(t){return _.isString(t.control_link)&&_.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!_.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!_.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},Link.prototype.redirectUrl=function(t){if(t.experiment_link&&_.isString(t.experiment_link))if(!0!==t.is_control_group||"STRICT"!==t.link_match_type&&"REGEXP"!==t.link_match_type){var e,s=location.href,r=t.experiment_link;if("REGEXP"===t.link_match_type&&/\$\d+/.test(r)){var i=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);r=s.replace(i,r)}if(e=this.para.pass_params?a(this.getMergedUrl(t.is_control_group,r,s)):a(this.getMergedUrl(t.is_control_group,r))){var n=this.SensorsABTest.triggerHandle(t)?80:0;this.para.onRedirect?(this.para.onRedirect(e),this.mask_instance.remove()):this.redirect(e,n),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}}else this.SensorsABTest.triggerHandle(t);else this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id);function a(t){return _.secCheck.isHttpUrl(t)?_.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}},Link.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},Link.prototype.getMergedUrl=function(t,e,s){var r="",i="",n="",a={parse_url:null,search:""},o={parse_url:null,search:"",hash:""};function l(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t);if(e)return{host:e[1]||"",search:e[2]||"",hash:e[3]||""}}if(!s||(a.parse_url=l(s),a.parse_url)){if(o.parse_url=l(e),o.parse_url)return s&&("after_hash"===this.para.control_link_search?a.search=c(a.parse_url.hash).search:a.search=a.parse_url.search),t?"after_hash"===this.para.control_link_search?(o.search=c(o.parse_url.hash).search,o.hash=c(o.parse_url.hash).hash):o.search=o.parse_url.search:"after_hash"===this.para.experiment_link_search?(o.search=c(o.parse_url.hash).search,o.hash=c(o.parse_url.hash).hash):o.search=o.parse_url.search,i=s?this.getSearchStr(a.search,o.search):this.getSearchStr(o.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?r=o.hash.length>0?o.parse_url.host+o.parse_url.search+o.hash+i:o.parse_url.search.length>0?o.parse_url.host+o.parse_url.search+"&"+i.substring(1):o.parse_url.host+i:(n="after_hash"===this.para.control_link_search?o.parse_url.hash:s?o.parse_url.hash||a.parse_url.hash:o.parse_url.hash,r=o.parse_url.host+i+n),r;this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e)}else this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s);function c(t){var e={hash:"",search:""};if(!_.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}},Link.prototype.getSearchStr=function(t,e){function s(t){var e={};if(!t||!t.length||0!==t.indexOf("?"))return e;if(!(t=t.slice(1)).length)return e;for(var s=t.split("&"),r=0;r=p&&(e.push(s({type:"childList",target:r,addedNodes:[c],removedNodes:[c],nextSibling:c.nextSibling,previousSibling:c.previousSibling})),d--),n.attr&&h.attr&&a(e,c,h.attr,n.afilter),n.charData&&3===c.nodeType&&c.nodeValue!==h.charData&&e.push(s({type:"characterData",target:c,oldValue:h.charData})),n.descendents&&u(c,h)}function u(r,i){for(var _,d,g,f,m,v,S,y=r.childNodes,b=i.kids,T=y.length,A=b?b.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var e=_.isString(t.vabtest_url)?t.vabtest_url:"";e&&("https:"===location.protocol?"https:"===e.slice(0,6)?this.vabtest_url=e:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===e.slice(0,5)||"https:"===e.slice(0,6)?this.vabtest_url=e:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))}else this.para=!1},Vabtesting.prototype.resolve=function(){var t=this.SensorsABTest.results;if(!1!==this.enable_visualize&&!0!==this.is_editor&&!1!==this.isFirst){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;_.each(t,function(t){if(!_.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var r=t.experiment_value;if(!_.isArray(r))try{r=JSON.parse(t.experiment_value),t.experiment_value=r}catch(i){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},Vabtesting.prototype.initMask=function(){this.mask_instance=new Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},Vabtesting.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},Vabtesting.prototype.prepareResource=function(t,e){var s=this,r=t.experiment_value;_.isArray(r)&&(_.each(r,function(r){var i=r.tagName,n=r.props;if("img"===i&&n&&n.attributes&&_.isString(n.attributes.src)){var a=n.attributes.src;if(s.imgLoadingList.push(a),s.loadedImages.indexOf(a)>-1){var o=s.imgLoadingList.indexOf(a);return o>-1&&s.imgLoadingList.splice(o,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=c,l.onerror=c,l.onabort=c,l.src=n.attributes.src}function c(){var r=s.imgLoadingList.indexOf(a);s.loadedImages.push(a),r>-1&&s.imgLoadingList.splice(r,1),0===s.imgLoadingList.length&&e(t)}}),0===this.imgLoadingList.length&&e(t))},Vabtesting.prototype.render=function(t){var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&!0===e.mask_instance.is_timeout)e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");else{e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),_.isArray(e.originData)&&(_.each(e.originData,function(t){restoreElement(t)}),e.originData=[]);var s=t.experiment_value;_.isArray(s)&&_.each(s,function(t){var s=getDomBySelector(t.selector);if(s)try{var r=getInfoByElement(s,[]);changeAttributes(s,t,r.eleInfo)&&e.originData.push(r)}catch(i){}}),e.use_mask&&e.destroyMask()}};this.isDomReady?s():bindReady(window,s)},Vabtesting.prototype.restoreElements=function(){_.each(this.originData,function(t){restoreElement(t)}),this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1},Vabtesting.prototype.addDomReadyListener=function(){var t=this;bindReady(window,function(){t.isDomReady=!0,addMutationObserver(t.observerCallback.bind(t))})},Vabtesting.prototype.addSinglePageListener=function(){var t=this;_.addSinglePageEvent(function(e){if(e===location.href)return!1;t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),t.resolve()})},Vabtesting.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},Vabtesting.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},Vabtesting.prototype.isTriggerVisualExp=function(t){return _.isString(t.control_link)&&_.isString(t.link_match_type)?!!_.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},SensorsABTest.prototype.asyncFetchABTest=function(){_.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fastFetchABTest=function(){_.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fetchCacheABTest=function(){_.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},SensorsABTest.prototype.getExpResult=function(t,e){var s=t.default_value,r=e||this.searchLocalExp(t.param_name);return _.isObject(r)?_.isObject(r.js_config)&&(r.js_config.type===t.value_type?(s=r.js_config.value,this.triggerHandle(r,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+r.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},SensorsABTest.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;_.each(e,function(e){_.isObject(e)&&e.variables&&_.isArray(e.variables)&&_.each(e.variables,function(s){_.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=_.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},SensorsABTest.prototype.getRelativeValue=function(t,e){var s=this,r={},i={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(r.value=e,r.type="Number")},STRING:function(t){_.isString(t)?(r.value=t,r.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);_.isObject(e)?(r.value=e,r.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(r.value=!0,r.type="Boolean"):"false"===t?(r.value=!1,r.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{i[e]?i[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return r},SensorsABTest.prototype.dealResponseData=function(t,e){_.isObject(t)?"SUCCESS"===t.status?_.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},SensorsABTest.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.updateStorage=function(t){var e=(new Date).getTime();setStorageData({results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},this.state.storage.name,this.para.encrypt_cookie),this.updateTime=e},SensorsABTest.prototype.analyzeData=function(){var t=this.results;if(!_.isArray(t))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1;this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,r=this,i=!1,n={};if(_.isArray(s)&&s.length>0&&(_.each(s,function(s){_.isObject(s)&&!i&&("CODE"===t?_.isObject(s)&&s.variables&&_.isArray(s.variables)&&_.each(s.variables,function(t){var a=r.getRelativeValue(t.value,t.type);!i&&a&&_.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(i=!0,n=s)}):"LINK"===t?_.isString(s.control_link)&&_.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?_.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(i=!0,n=s):_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s)):"VISUAL"===t&&_.isString(s.control_link)&&_.isString(s.link_match_type)&&_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s))}),i)){var a=r.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),r.sendTriggerEvent("outTriggerList",a,n,{})}},SensorsABTest.prototype.registerProperty=function(){if(this.track_config.property_set_switch){var t=this.sd.store.getUnionId(),e=["USER"+(t.login_id||t.anonymous_id),"DEVICE"+t.anonymous_id],s=this.sd.bridge.is_verify_success?this.getLatestSubject():[],r=[],i=[];_.each(this.triggerList,function(t,i){e.indexOf(i)<0&&s.indexOf(i)<0||_.isArray(t)&&_.each(t,function(t){t.result_id&&r.push(t.result_id)})}),_.isArray(this.results)&&_.each(this.results,function(t){t.abtest_experiment_result_id&&i.push(t.abtest_experiment_result_id)}),r.length>0&&this.sd.registerPage({abtest_result:r}),i.length>0&&this.sd.registerPage({abtest_dispatch_result:i})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},SensorsABTest.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t),setStorageData(e,this.state.storage.latest_name,this.para.encrypt_cookie)},SensorsABTest.prototype.getLatestSubject=function(){return getStorageData(this.state.storage.latest_name)||[]},SensorsABTest.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();return t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s),this.trackTestTrigger(s,t,e)},SensorsABTest.prototype.getTriggerProps=function(t,e){var s={},r=_.isObject(e)&&_.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var i="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[i]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return _.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=_.extend(n,s,r)},SensorsABTest.prototype.sendTriggerEvent=function(t,e,s,r){var i=this.track_config.trigger_switch,n=!0,a=this[t];a&&_.isObject(a)&&a[e]&&_.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=updateTriggerData(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,r);return n&&i&&this.sd.track("$ABTestTrigger",o),n},SensorsABTest.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var r=this.sendTriggerEvent("triggerList",t,e,s),i=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",i),r},SensorsABTest.prototype.checkSADebug=function(){var t=this,e=_.getQueryParam(location.href,"sensors_abtest_url"),s=_.getQueryParam(location.href,"feature_code"),r=+_.getQueryParam(location.href,"account_id");if(e.length&&s.length&&_.isNumber(r)&&0!==r){var i={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:r};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(i),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},SensorsABTest.prototype.initMethods=function(t){var e=this;_.each(["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"],function(s){e[s]=t.methods[s].bind(t)})},FetchData.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),_.isObject(s)&&"SUCCESS"===s.status&&_.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,r=t.outTriggerList;_.isArray(s)&&(this.SensorsABTest.out_list=s),_.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),_.isObject(r)&&(this.SensorsABTest.outTriggerList=r),_.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),r=getStorageData(this.SensorsABTest.state.storage.name),i=this.SensorsABTest.sd.store.getDistinctId();if(r&&_.isObject(r)&&r.distinct_id===i)if(e=r.updateTime,t&&this.updateExpsCache(r),e&&_.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)initSensorsABTest.call(this,t,e);else{var s=this;t.on("sdkReady",function(){initSensorsABTest.call(s,t,e)})}},SensorsABTest.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},SensorsABTest.prototype.log=function(){return _.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var instance=new SensorsABTest;instance.__constructor__=SensorsABTest,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||instance:window.SensorsDataWebJSSDKPlugin={SensorsABTest:instance};export default SensorsABTest; \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/abtest.min.js b/dist/web/plugin/abtesting-sdk-web/abtest.min.js index 9e954f87..b3844a5e 100644 --- a/dist/web/plugin/abtesting-sdk-web/abtest.min.js +++ b/dist/web/plugin/abtesting-sdk-web/abtest.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){this.SensorsABTest=t,this.para=t.para}function e(t){this.SensorsABTest=t,this.para=t.para}function s(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",s=e.length-1,r={},i=0;for(i=0;i=3?t:null}function o(t){var e={visibleHandle:H.isFunction(t.visible)?t.visible:function(){},hiddenHandler:H.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()}function c(t){var e=H.storage.get(t);H.isString(e)&&(e=r(e));try{e=JSON.parse(e)}catch(s){H.log(s)}return e}function l(t,e,s){t=JSON.stringify(t),s&&(t=i(t)),H.storage.set(t,e)}function u(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function h(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function p(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function d(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(e!==!0||!H.checkUrlIsMatch(s,r))||(H.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function f(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}}function g(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):m(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function v(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function y(t,e){var s={};return H.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=v(t,r)}),s}function S(t){var e=t.childNodes,s="",r=!1;return H.each(e,function(t){r===!1&&3===t.nodeType&&(H.isString(t.textContent)||H.isString(t.innerText)||H.isString(t.nodeValue))&&(s=H.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function b(t){function e(t,e){t=H.trim(t);var s;if("body"===t)return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(H.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,c=0;c0)return null}return s?s:null}function s(t){var i,n=r.shift();if(!n)return t;try{i=e(n,t)}catch(a){i=null}return i&&H.isElement(i)?s(i):null}if(!H.isString(t))return null;var r=t.split(">"),i=null;return i=s(),i&&H.isElement(i)?i:null}function T(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,r,i;return s=e[0],r=e[1],i=e[2],"rgb("+s+","+r+","+i+")"}return""}function A(t,e){function s(t,e){var s=t.length-e.length;return s>=0&&t.indexOf(e,s)==s}var r=p(),i=r.ie&&r.ie<9,n="";if(H.each(e,function(t,e){i&&t.indexOf("rgba")>-1&&(t=T(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=";"+s+": "+t}),""!==n){var a=t.style,o=a.cssText||"";o&&!s(o,";")&&(o+=";"),a.cssText=o+n}}function B(t,e){var s=t.childNodes,r=!1;H.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function k(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&H.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function x(t,e,s){t.setAttribute(e,s)}function w(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return H.each(i.style||{},function(e,s){r.attributes.style[s]=v(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=S(t)),H.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function D(t,e,s){s||(s=w(t,e));var r=k(e,s);if(r){var i=e.props;H.isObject(i)&&O(t,i)}return r}function O(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&A(t,s.style),H.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&x(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&B(t,e.text)}function E(t){t=H.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&(e=document.createElement("link"),e.rel="stylesheet",e.href=t.url),"js"===t.type&&(e=document.createElement("script"),e.async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function j(t,e){E(H.extend({success:function(){},error:function(){},type:"js",url:t},e))}function P(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,r=new s(t);r.observe(document.body,e)}function L(t,e){var s=t.tagName.toLowerCase(),r=y(t,e),i={selector:m(t),originProps:{attributes:{style:r},text:S(t)},type:"text",tagName:s};"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img");var n=t.getAttribute("style");return{originStyle:n,eleInfo:i,ele:t}}function N(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;O(s,e.originProps),r?s.style.cssText=r:s.style.cssText=""}}function R(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function F(){this.lib_version="1.25.9",this.plugin_version="1.25.9",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new h(this),this.vabtest=new R(this),this.normalStore=new t(this),this.bridgeStore=new e(this),this.verifyStore=new n(this)}function C(t,e){var s=[];H.isArray(t)&&H.each(t,function(e,s){H.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(H.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&H.isArray(t)){var n=!1;H.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function U(t){this.SensorsABTest=t}function I(t){this.SensorsABTest=t}function M(t,e){return a(t)?(this.sd=t,H.isObject(e)?(H.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new U(this),this.store=new I(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}var H={},V=Array.prototype,z=Object.prototype,K=V.slice,$=z.toString,J=z.hasOwnProperty,Q=V.forEach,Z=Array.isArray,G={};H.each=function(t,e,s){if(null==t)return!1;if(Q&&t.forEach===Q)t.forEach(e,s);else if(H.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL");for(var s in this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},H.URL=function(t){var e={},s=function(){var t;try{return t=new URL("http://modernizr.com/"),"http://modernizr.com/"===t.href}catch(e){return!1}};if("function"==typeof window.URL&&s())e=new URL(t),e.searchParams||(e.searchParams=function(){var t=H.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}());else{var r=/^https?:\/\/.+/;r.test(t)===!1&&H.log("Invalid URL");var i=H.urlParse(t);e.hash="",e.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",e.href=i._values.URL,e.password=i._values.Password,e.pathname=i._values.Path,e.port=i._values.Port,e.search=i._values.QueryString?"?"+i._values.QueryString:"",e.username=i._values.Username,e.hostname=i._values.Hostname,e.protocol=i._values.Protocol?i._values.Protocol+":":"",e.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",e.searchParams=function(){var t=H.getURLSearchParams("?"+i._values.QueryString);return{get:function(e){return t[e]}}}()}return e},H.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=H.decodeURIComponent(t);var s="[\\?&]"+e+"=([^&#]*)",r=new RegExp(s),i=r.exec(t);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":H.decodeURIComponent(i[1])},H.isEmptyObject=function(t){if(H.isObject(t)){for(var e in t)if(J.call(t,e))return!1;return!0}return!1},H.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}},H.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;var e=/^https?:\/\/.+/;return e.test(t)!==!1||(H.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},H.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,s,r){var i=function(i){if(i=i||t(window.event)){i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}};return i}t._getPath=function(){var t=this,e=function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var s=function(s,r,i){var n=!0;if(s&&s.addEventListener)s.addEventListener(r,function(e){e._getPath=t._getPath,i.call(this,e)},n);else{var a="on"+r,o=s[a];s[a]=e(s,i,o)}};s.apply(null,arguments)},H.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";H.addEvent(window,i,function(){t(e),e=location.href})},H.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},H.checkUrlIsMatch=function(t,e){var s,r,i=H.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=H.URL(location.href)}catch(n){return H.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=H.URL(t)}catch(n){return H.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return H.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},H.checkUrlIsRegexp=function(t,e){var s;try{s=H.URL(location.href)}catch(r){return H.log("url \u89e3\u6790\u5931\u8d25",r),!1}try{var i=e?new RegExp(t,e):new RegExp(t),n=i.exec(s.href),a=!0;return!!n&&(H.each(n,function(t){t||(a=!1)}),a)}catch(r){return H.log("control_link\u5b57\u6bb5\u5f02\u5e38",r),!1}},H.log=function(){if("object"==typeof console&&console.log){H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},H.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},H.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},H.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},H.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},t.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!H.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=H.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,s.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(H.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";H.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return H.isObject(t.properties)&&(s.properties=H.extend({},s.properties,t.properties)),H.isObject(t.custom_properties)&&(s.custom_properties=H.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){function e(){var t=s.SensorsABTest.sd.store.getDistinctId();s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){s.SensorsABTest.dealResponseData(e,t),i&&i(e),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()}},t.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},e.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=H.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),H.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":H.isObject(window.SensorsData_APP_New_H5_Bridge)&&H.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,e.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:r.properties,timeout:a,request_body:o},callback:function(t){H.isObject(t)&&H.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),i&&i(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=r.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};H.isObject(r.custom_properties)&&(o=H.extend(o,{custom_properties:r.custom_properties,param_name:r.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(H.isObject(s.properties)&&(t.properties=H.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},e.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);if(t=i.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}};var W="dfm-enc-";n.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(H.isNumber(t))return!0;break;case"String":if(H.isString(t))return!0;break;case"Object":if(H.isObject(t))return!0;break;case"Boolean":if(t===!0||t===!1)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return H.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":H.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":H.isString(e.value_type)&&H.indexOf(r.value_type_list,e.value_type)!==-1||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":H.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!H.isNumber(e.timeout_milliseconds)||H.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=H.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!H.isObject(r)||H.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(H.each(r,function(t,r){if((!H.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(H.isString(t)||H.isNumber(t)||H.isBoolean(t)||H.isArray(t)||H.isDate(t))&&!(H.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1), +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){this.SensorsABTest=t,this.para=t.para}function e(t){this.SensorsABTest=t,this.para=t.para}function s(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",s=e.length-1,r={},i=0;for(i=0;i=3?t:null}function o(t){var e={visibleHandle:H.isFunction(t.visible)?t.visible:function(){},hiddenHandler:H.isFunction(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()}function c(t){var e=H.storage.get(t);H.isString(e)&&(e=r(e));try{e=JSON.parse(e)}catch(s){H.log(s)}return e}function l(t,e,s){t=JSON.stringify(t),s&&(t=i(t)),H.storage.set(t,e)}function u(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function h(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default"}}function p(){var t,e={},s=navigator.userAgent.toLowerCase();return(t=s.match(/opera.([\d.]+)/))?e.opera=Number(t[1].split(".")[0]):(t=s.match(/msie ([\d.]+)/))?e.ie=Number(t[1].split(".")[0]):(t=s.match(/edge.([\d.]+)/))?e.edge=Number(t[1].split(".")[0]):(t=s.match(/firefox\/([\d.]+)/))?e.firefox=Number(t[1].split(".")[0]):(t=s.match(/chrome\/([\d.]+)/))?e.chrome=Number(t[1].split(".")[0]):(t=s.match(/version\/([\d.]+).*safari/))?e.safari=Number(t[1].match(/^\d*.\d*/)):(t=s.match(/trident\/([\d.]+)/))&&(e.ie=11),e}function d(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,r=t.link_match_type;return!(e!==!0||!H.checkUrlIsMatch(s,r))||(H.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(i){return!1}}function f(t,e){t=t||window;var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}}function g(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,r=t.parentNode.children,i=0;i "):m(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function v(t,e){return t.currentStyle?t.currentStyle[e]:t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function y(t,e){var s={};return H.each(e||[],function(e){var r=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=v(t,r)}),s}function S(t){var e=t.childNodes,s="",r=!1;return H.each(e,function(t){r===!1&&3===t.nodeType&&(H.isString(t.textContent)||H.isString(t.innerText)||H.isString(t.nodeValue))&&(s=H.trim(t.textContent||t.innerText||t.nodeValue||""),r=!0)}),s}function b(t){function e(t,e){t=H.trim(t);var s;if("body"===t)return document.getElementsByTagName("body")[0];if(0===t.indexOf("#"))t=t.slice(1),s=document.getElementById(t);else if(t.indexOf(":nth-of-type")>-1){var r=t.split(":nth-of-type");if(!r[0]||!r[1])return null;var i=r[0],n=r[1].match(/\(([0-9]+)\)/);if(!n||!n[1])return null;var a=Number(n[1]);if(!(H.isElement(e)&&e.children&&e.children.length>0))return null;for(var o=e.children,c=0;c0)return null}return s?s:null}function s(t){var i,n=r.shift();if(!n)return t;try{i=e(n,t)}catch(a){i=null}return i&&H.isElement(i)?s(i):null}if(!H.isString(t))return null;var r=t.split(">"),i=null;return i=s(),i&&H.isElement(i)?i:null}function T(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,r,i;return s=e[0],r=e[1],i=e[2],"rgb("+s+","+r+","+i+")"}return""}function A(t,e){function s(t,e){var s=t.length-e.length;return s>=0&&t.indexOf(e,s)==s}var r=p(),i=r.ie&&r.ie<9,n="";if(H.each(e,function(t,e){i&&t.indexOf("rgba")>-1&&(t=T(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=";"+s+": "+t}),""!==n){var a=t.style,o=a.cssText||"";o&&!s(o,";")&&(o+=";"),a.cssText=o+n}}function B(t,e){var s=t.childNodes,r=!1;H.each(s,function(t){3===t.nodeType&&(r||(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.nodeValue=e,r=!0))})}function k(t,e){var s=t.originProps,r=e.originProps,i=s.attributes,n=r.attributes,a=!0;return s.text&&s.text!==r.text&&(a=!1),i&&H.each(["src","href","target"],function(t){i[t]&&i[t]!==n[t]&&(a=!1)}),a}function x(t,e,s){t.setAttribute(e,s)}function w(t,e){var s=e.originProps,r={attributes:{}},i=s.attributes;return H.each(i.style||{},function(e,s){r.attributes.style[s]=v(t,s)}),Object.hasOwnProperty.call(s,"text")&&(r.attributes.text=S(t)),H.each(["src","href"],function(e){Object.hasOwnProperty.call(i,e)&&(r.attributes[e]=t[e])}),Object.hasOwnProperty.call(i,"target")&&(r.attributes.target=t.getAttribute("target")),r}function D(t,e,s){s||(s=w(t,e));var r=k(e,s);if(r){var i=e.props;H.isObject(i)&&O(t,i)}return r}function O(t,e){if(Object.hasOwnProperty.call(e,"attributes")){var s=e.attributes;Object.hasOwnProperty.call(s,"style")&&A(t,s.style),H.each(["href","target","src"],function(e){s[e]&&t.getAttribute(e)!==s[e]&&x(t,e,s[e])})}Object.hasOwnProperty.call(e,"text")&&B(t,e.text)}function E(t){t=H.extend({success:function(){},error:function(){},appendCall:function(t){document.getElementsByTagName("head")[0].appendChild(t)}},t);var e=null;"css"===t.type&&(e=document.createElement("link"),e.rel="stylesheet",e.href=t.url),"js"===t.type&&(e=document.createElement("script"),e.async="async",e.setAttribute("charset","UTF-8"),e.src=t.url,e.type="text/javascript"),t.id&&(e.id=t.id),e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(t.success(),e.onload=e.onreadystatechange=null)},e.onerror=function(){t.error(),e.onerror=null},t.appendCall(e)}function j(t,e){E(H.extend({success:function(){},error:function(){},type:"js",url:t},e))}function P(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,r=new s(t);r.observe(document.body,e)}function L(t,e){var s=t.tagName.toLowerCase(),r=y(t,e),i={selector:m(t),originProps:{attributes:{style:r},text:S(t)},type:"text",tagName:s};"a"===s&&(i.originProps.attributes.href=t.href,t.getAttribute("target")&&(i.originProps.attributes.target=t.getAttribute("target")),i.type="link"),"img"===s&&(i.originProps.attributes.src=t.src,i.type="img");var n=t.getAttribute("style");return{originStyle:n,eleInfo:i,ele:t}}function N(t){var e=t.eleInfo,s=t.ele;if(s){var r=t.originStyle;O(s,e.originProps),r?s.style.cssText=r:s.style.cssText=""}}function R(t){this.SensorsABTest=t,this.enable_visualize=!1,this.vabtest_url=location.protocol+"//static.sensorsdata.cn/sdk/plugin/vabtest/"+this.SensorsABTest.lib_version+"/vabtest.min.js",this.timeout=500,this.is_editor=!1,this.use_mask=!0,this.originData=[],this.visualExp=null,this.isFirst=!0,this.start_time=null,this.is_have_observer=!1,this.imgLoadingList=[],this.isTrigger=!1,this.isDomReady=!1,this.loadedImages=[]}function F(){this.lib_version="1.25.10",this.plugin_version="1.25.10",this.plugin_name="SensorsABTest",this.para={},this.default_para={url:"",path:"",project_key:"",timeout_milliseconds:3e3,update_interval:6e5,collect_bridge_status:!0,encrypt_cookie:!1},this.state={platform:"",storage:{name:"sawebjssdkabtest",latest_name:"sawebjssdkabtestlatest"}},this.bridgeState="",this.codeExpData={},this.results=[],this.out_list=[],this.triggerList={},this.outTriggerList={},this.default_track_config={trigger_switch:!0,property_set_switch:!1,trigger_content_ext:["abtest_experiment_version","abtest_experiment_result_id"]},this.track_config={},this.updateTime=null,this.sd=null,this.link=new h(this),this.vabtest=new R(this),this.normalStore=new t(this),this.bridgeStore=new e(this),this.verifyStore=new n(this)}function C(t,e){var s=[];H.isArray(t)&&H.each(t,function(e,s){H.isString(e)&&t.splice(s,1,{experiment_id:e})});var r=e.abtest_experiment_id;if(H.isString(r)){var i={experiment_id:r,group_id:e.abtest_experiment_group_id,result_id:e.abtest_experiment_result_id};if(t&&H.isArray(t)){var n=!1;H.each(t,function(e,s){e.experiment_id===r&&(t.splice(s,1,i),n=!0)}),n||t.push(i)}else t=[i];s=t}return s}function U(t){this.SensorsABTest=t}function I(t){this.SensorsABTest=t}function M(t,e){return a(t)?(this.sd=t,H.isObject(e)?(H.storage.isSupport()||this.log("localstorage\u5f02\u5e38"),this.abtestingPara=e,this.fetchData=new U(this),this.store=new I(this),void this.initTest()):(this.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f20\u5165\u6b63\u786e\u7684\u521d\u59cb\u5316\u53c2\u6570!para:",e),!1)):(this.log("A/B Testing \u521d\u59cb\u5316\u5931\u8d25,Web JS SDK \u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)}var H={},V=Array.prototype,z=Object.prototype,K=V.slice,$=z.toString,J=z.hasOwnProperty,Q=V.forEach,Z=Array.isArray,G={};H.each=function(t,e,s){if(null==t)return!1;if(Q&&t.forEach===Q)t.forEach(e,s);else if(H.isArray(t)&&t.length===+t.length){for(var r=0,i=t.length;r Invalid URL");for(var s in this._fields)"undefined"!=typeof e[this._fields[s]]&&(this._values[s]=e[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new e(t)},H.URL=function(t){var e={},s=function(){var t;try{return t=new URL("http://modernizr.com/"),"http://modernizr.com/"===t.href}catch(e){return!1}};if("function"==typeof window.URL&&s())e=new URL(t),e.searchParams||(e.searchParams=function(){var t=H.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}());else{var r=/^https?:\/\/.+/;r.test(t)===!1&&H.log("Invalid URL");var i=H.urlParse(t);e.hash="",e.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",e.href=i._values.URL,e.password=i._values.Password,e.pathname=i._values.Path,e.port=i._values.Port,e.search=i._values.QueryString?"?"+i._values.QueryString:"",e.username=i._values.Username,e.hostname=i._values.Hostname,e.protocol=i._values.Protocol?i._values.Protocol+":":"",e.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",e.searchParams=function(){var t=H.getURLSearchParams("?"+i._values.QueryString);return{get:function(e){return t[e]}}}()}return e},H.getQueryParam=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=H.decodeURIComponent(t);var s="[\\?&]"+e+"=([^&#]*)",r=new RegExp(s),i=r.exec(t);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":H.decodeURIComponent(i[1])},H.isEmptyObject=function(t){if(H.isObject(t)){for(var e in t)if(J.call(t,e))return!1;return!0}return!1},H.contentLoaded=function(t,e){var s=!1,r=!0,i=t.document,n=i.documentElement,a=i.addEventListener,o=a?"addEventListener":"attachEvent",c=a?"removeEventListener":"detachEvent",l=a?"":"on",u=function(r){"readystatechange"==r.type&&"complete"!=i.readyState||(("load"==r.type?t:i)[c](l+r.type,u,!1),!s&&(s=!0)&&e.call(t,r.type||r))},h=function(){try{n.doScroll("left")}catch(t){return void setTimeout(h,50)}u("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!a&&n.doScroll){try{r=!t.frameElement}catch(p){}r&&h()}i[o](l+"DOMContentLoaded",u,!1),i[o](l+"readystatechange",u,!1),t[o](l+"load",u,!1)}},H.secCheck={isHttpUrl:function(t){if("string"!=typeof t)return!1;var e=/^https?:\/\/.+/;return e.test(t)!==!1||(H.log("Invalid URL"),!1)},removeScriptProtocol:function(t){if("string"!=typeof t)return"";for(var e=/^\s*javascript/i;e.test(t);)t=t.replace(e,"");return t}},H.addEvent=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,s,r){var i=function(i){if(i=i||t(window.event)){i.target=i.srcElement;var n,a,o=!0;return"function"==typeof r&&(n=r(i)),a=s.call(e,i),!1!==n&&!1!==a||(o=!1),o}};return i}t._getPath=function(){var t=this,e=function(){try{var e=t.target,s=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,s.unshift(e);return s}catch(r){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var s=function(s,r,i){var n=!0;if(s&&s.addEventListener)s.addEventListener(r,function(e){e._getPath=t._getPath,i.call(this,e)},n);else{var a="on"+r,o=s[a];s[a]=e(s,i,o)}};s.apply(null,arguments)},H.addSinglePageEvent=function(t){var e=location.href,s=window.history.pushState,r=window.history.replaceState;window.history.pushState=function(){s.apply(window.history,arguments),t(e),e=location.href},window.history.replaceState=function(){r.apply(window.history,arguments),t(e),e=location.href};var i=s?"popstate":"hashchange";H.addEvent(window,i,function(){t(e),e=location.href})},H.trim=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},H.checkUrlIsMatch=function(t,e){var s,r,i=H.URL(t);if("STRICT"===e)return location.href===i.href;if("FUZZY"===e){try{s=H.URL(location.href)}catch(n){return H.log("url \u89e3\u6790\u5931\u8d25",n),!1}try{r=H.URL(t)}catch(n){return H.log("control_url \u89e3\u6790\u5931\u8d25",n),!1}return s.host===r.host&&s.pathname===r.pathname}return H.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",e),!1},H.checkUrlIsRegexp=function(t,e){var s;try{s=H.URL(location.href)}catch(r){return H.log("url \u89e3\u6790\u5931\u8d25",r),!1}try{var i=e?new RegExp(t,e):new RegExp(t),n=i.exec(s.href),a=!0;return!!n&&(H.each(n,function(t){t||(a=!1)}),a)}catch(r){return H.log("control_link\u5b57\u6bb5\u5f02\u5e38",r),!1}},H.log=function(){if("object"==typeof console&&console.log){H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}},H.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(t){console.error(arguments[0])}},H.storage={isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",s="testIsSupportStorage";window.localStorage.setItem(e,s),window.localStorage.getItem(e)!==s&&(t=!1),window.localStorage.removeItem(e)}catch(r){t=!1}return t},set:function(t,e){this.isSupport()&&window.localStorage.setItem(e,t)},get:function(t){var e=null;return this.isSupport()&&(e=window.localStorage.getItem(t)),e}},H.formatDate=function(t){function e(t){return t<10?"0"+t:t}return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())},H.isDate=function(t){return"[object Date]"==Object.prototype.toString.call(t)},t.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!H.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=H.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,s.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getResultFromServer({para:t,suc:function(s){if(H.isObject(s)&&"SUCCESS"===s.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";H.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return H.isObject(t.properties)&&(s.properties=H.extend({},s.properties,t.properties)),H.isObject(t.custom_properties)&&(s.custom_properties=H.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getResultFromServer:function(t){function e(){var t=s.SensorsABTest.sd.store.getDistinctId();s.SensorsABTest.sd._.ajax({url:s.SensorsABTest.para.url,type:"POST",data:JSON.stringify(a),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||s.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){s.SensorsABTest.dealResponseData(e,t),i&&i(e),s.SensorsABTest.fetchData.setNextFetch()},error:function(t){s.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}})}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()}},t.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);t=i.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},e.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=H.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),H.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":H.isObject(window.SensorsData_APP_New_H5_Bridge)&&H.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=H.extend({},this.SensorsABTest.default_para,e.para),H.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),H.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:r.properties,timeout:a,request_body:o},callback:function(t){H.isObject(t)&&H.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),i&&i(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=H.isObject(t)?t:{};var r=t.para||{},i=t.suc,n=t.err,a=r.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};H.isObject(r.custom_properties)&&(o=H.extend(o,{custom_properties:r.custom_properties,param_name:r.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(H.isObject(s.properties)&&(t.properties=H.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var r=e.SensorsABTest.getExpResult(t);t.callback(r)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},e.prototype.methods={asyncFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!H.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(H.isObject(s)){var r=this.SensorsABTest.getExpResult(t,s);return void t.callback(r)}var i=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!i.verify_success)return void t.callback(t.default_value);if(t=i.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!H.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}};var W="dfm-enc-";n.prototype={value_type_list:["Number","String","Object","Boolean"],regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_][a-zA-Z\d_]*)$/i,valueType:function(t,e){switch(e){case"Number":if(H.isNumber(t))return!0;break;case"String":if(H.isString(t))return!0;break;case"Object":if(H.isObject(t))return!0;break;case"Boolean":if(t===!0||t===!1)return!0;break;default:return!1}return!1},para:function(t,e,s){var r=this,i={verify_success:!0,para:null};return H.each(s,function(s,n){if("essential"===s)switch(n){case"param_name":H.isString(e.param_name)&&e.param_name.length>0||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),i.verify_success=!1);break;case"value_type":H.isString(e.value_type)&&H.indexOf(r.value_type_list,e.value_type)!==-1||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),i.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),i.verify_success=!1):r.valueType(e.default_value,e.value_type)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),i.verify_success=!1);break;case"callback":H.isFunction(e.callback)||(r.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),i.verify_success=!1);break;default:i.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||r.SensorsABTest.para.timeout_milliseconds||r.SensorsABTest.default_para.timeout_milliseconds,(!H.isNumber(e.timeout_milliseconds)||H.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(r.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=r.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=H.isObject(e.properties)?e.properties:{}}}),i.para=e,i},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},r=t.custom_properties;if(!H.isObject(r)||H.isEmptyObject(r))return delete t.custom_properties,s.para=t,s;if(H.each(r,function(t,r){if((!H.isString(r)||!e.regName.test(r)||r.length>100)&&(e.SensorsABTest.log(" property name [ "+r+" ] is not invalid "),s.verify_success=!1),(H.isString(t)||H.isNumber(t)||H.isBoolean(t)||H.isArray(t)||H.isDate(t))&&!(H.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+r+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1), H.isArray(t)){var i=!0;H.each(t,function(t){i!==!1&&(H.isString(t)||(i=!1))}),i||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+r+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),s.verify_success===!0){var i={};H.each(r,function(t,e){H.isDate(t)?i[e]=H.formatDate(t):H.isString(t)?i[e]=t:i[e]=JSON.stringify(t)}),t.custom_properties=i}return s.para=t,s}},u.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){H.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!H.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,H.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(r){H.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!H.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){H.log("error when remove calls")}}},h.prototype.init=function(t){return this.initPara(t),this.para?H.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener()):(this.SensorsABTest.log("multilink is closed"),!1)},h.prototype.addSinglePageListener=function(){var t=this;H.addSinglePageEvent(function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),H.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},h.prototype.initMask=function(){this.mask_instance=new u("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},h.prototype.initPara=function(t){if(H.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:H.isObject(t)&&(this.para.timeout=H.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=H.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=H.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=H.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!H.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=H.isFunction(t.onRedirect)?t.onRedirect:null)},h.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para)return!1;if(!H.isArray(t))return!1;if(this.is_filtered_out)return!1;if(!this.isFirst)return!1;if(this.isFirst=!1,0===this.para.timeout)return!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),!1;var s=!1;H.each(t,function(t){return!!H.isObject(t)&&(!s&&("LINK"===t.experiment_type&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},h.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()},h.prototype.isTriggerLinkExp=function(t){return H.isString(t.control_link)&&H.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!H.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!H.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},h.prototype.redirectUrl=function(t){function e(t){return H.secCheck.isHttpUrl(t)?H.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!H.isString(t.experiment_link))return void this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id);if(t.is_control_group===!0&&("STRICT"===t.link_match_type||"REGEXP"===t.link_match_type))return void this.SensorsABTest.triggerHandle(t);var s=location.href,r=t.experiment_link,i=/\$\d+/;if("REGEXP"===t.link_match_type&&i.test(r)){var n=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);r=s.replace(n,r)}var a,o;if(this.para.pass_params?(o=this.getMergedUrl(t.is_control_group,r,s),a=e(o)):(o=this.getMergedUrl(t.is_control_group,r),a=e(o)),a){var c=this.SensorsABTest.triggerHandle(t),l=c?80:0;this.para.onRedirect?(this.para.onRedirect(a),this.mask_instance.remove()):this.redirect(a,l),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},h.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},h.prototype.getMergedUrl=function(t,e,s){function r(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/,s=e.exec(t);if(s){var r=s[1]||"",i=s[2]||"",n=s[3]||"";return{host:r,search:i,hash:n}}}function i(t){var e={hash:"",search:""};if(!H.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}var n="",a="",o="",c={parse_url:null,search:""},l={parse_url:null,search:"",hash:""};return s&&(c.parse_url=r(s),!c.parse_url)?void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s):(l.parse_url=r(e),l.parse_url?(s&&("after_hash"===this.para.control_link_search?c.search=i(c.parse_url.hash).search:c.search=c.parse_url.search),t?"after_hash"===this.para.control_link_search?(l.search=i(l.parse_url.hash).search,l.hash=i(l.parse_url.hash).hash):l.search=l.parse_url.search:"after_hash"===this.para.experiment_link_search?(l.search=i(l.parse_url.hash).search,l.hash=i(l.parse_url.hash).hash):l.search=l.parse_url.search,a=s?this.getSearchStr(c.search,l.search):this.getSearchStr(l.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?n=l.hash.length>0?l.parse_url.host+l.parse_url.search+l.hash+a:l.parse_url.search.length>0?l.parse_url.host+l.parse_url.search+"&"+a.substring(1):l.parse_url.host+a:(o="after_hash"===this.para.control_link_search?l.parse_url.hash:s?l.parse_url.hash||c.parse_url.hash:l.parse_url.hash,n=l.parse_url.host+a+o),n):void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e))},h.prototype.getSearchStr=function(t,e){function s(t){var e={};if(!t||!t.length||0!==t.indexOf("?"))return e;if(t=t.slice(1),!t.length)return e;for(var s=t.split("&"),r=0;r=d&&(e.push(r({type:"childList",target:s,addedNodes:[u],removedNodes:[u],nextSibling:u.nextSibling,previousSibling:u.previousSibling})),f--),n.attr&&h.attr&&o(e,u,h.attr,n.afilter),n.charData&&3===u.nodeType&&u.nodeValue!==h.charData&&e.push(r({type:"characterData",target:u,oldValue:h.charData})),n.descendents&&c(u,h)}function c(s,i){for(var p,d,g,_,m,v,y,S=s.childNodes,b=i.kids,T=S.length,A=b?b.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var s=H.isString(t.vabtest_url)?t.vabtest_url:"";s&&("https:"===location.protocol?"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===s.slice(0,5)||"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))},R.prototype.resolve=function(){var t=this.SensorsABTest.results;if(this.enable_visualize!==!1&&this.is_editor!==!0&&this.isFirst!==!1){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;H.each(t,function(t){if(!H.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var r=t.experiment_value;if(!H.isArray(r))try{r=JSON.parse(t.experiment_value),t.experiment_value=r}catch(i){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},R.prototype.initMask=function(){this.mask_instance=new u("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},R.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},R.prototype.prepareResource=function(t,e){var s=this,r=t.experiment_value;H.isArray(r)&&(H.each(r,function(r){function i(){var r=s.imgLoadingList.indexOf(o);s.loadedImages.push(o),r>-1&&s.imgLoadingList.splice(r,1),0===s.imgLoadingList.length&&e(t)}var n=r.tagName,a=r.props;if("img"===n&&a&&a.attributes&&H.isString(a.attributes.src)){var o=a.attributes.src;if(s.imgLoadingList.push(o),s.loadedImages.indexOf(o)>-1){var c=s.imgLoadingList.indexOf(o);return c>-1&&s.imgLoadingList.splice(c,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=i,l.onerror=i,l.onabort=i,l.src=a.attributes.src}}),0===this.imgLoadingList.length&&e(t))},R.prototype.render=function(t){var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&e.mask_instance.is_timeout===!0)return void e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),H.isArray(e.originData)&&(H.each(e.originData,function(t){N(t)}),e.originData=[]);var s=t.experiment_value;H.isArray(s)&&H.each(s,function(t){var s=t.selector,r=b(s);if(r)try{var i=L(r,[]),n=i.eleInfo,a=D(r,t,n);a&&e.originData.push(i)}catch(o){}}),e.use_mask&&e.destroyMask()};this.isDomReady?s():f(window,s)},R.prototype.restoreElements=function(){H.each(this.originData,function(t){N(t)}),this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1},R.prototype.addDomReadyListener=function(){var t=this;f(window,function(){t.isDomReady=!0,P(t.observerCallback.bind(t))})},R.prototype.addSinglePageListener=function(){var t=this;H.addSinglePageEvent(function(e){return e!==location.href&&(t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),void t.resolve())})},R.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},R.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},R.prototype.isTriggerVisualExp=function(t){return H.isString(t.control_link)&&H.isString(t.link_match_type)?!!H.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},F.prototype.asyncFetchABTest=function(){H.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.fastFetchABTest=function(){H.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.fetchCacheABTest=function(){H.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},F.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},F.prototype.getExpResult=function(t,e){var s=t.default_value,r=e?e:this.searchLocalExp(t.param_name);return H.isObject(r)?H.isObject(r.js_config)&&(r.js_config.type===t.value_type?(s=r.js_config.value,this.triggerHandle(r,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+r.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},F.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;H.each(e,function(e){H.isObject(e)&&e.variables&&H.isArray(e.variables)&&H.each(e.variables,function(s){H.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=H.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},F.prototype.getRelativeValue=function(t,e){var s=this,r={},i={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(r.value=e,r.type="Number")},STRING:function(t){H.isString(t)?(r.value=t,r.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);H.isObject(e)?(r.value=e,r.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(r.value=!0,r.type="Boolean"):"false"===t?(r.value=!1,r.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{i[e]?i[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return r},F.prototype.dealResponseData=function(t,e){H.isObject(t)?"SUCCESS"===t.status?H.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},F.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},F.prototype.updateStorage=function(t){var e=(new Date).getTime(),s={results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},r=this.state.storage.name,i=this.para.encrypt_cookie;l(s,r,i),this.updateTime=e},F.prototype.analyzeData=function(){var t=this.results;return H.isArray(t)?(this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},F.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,r=this,i=!1,n={};if(H.isArray(s)&&s.length>0&&(H.each(s,function(s){H.isObject(s)&&!i&&("CODE"===t?H.isObject(s)&&s.variables&&H.isArray(s.variables)&&H.each(s.variables,function(t){var a=r.getRelativeValue(t.value,t.type);!i&&a&&H.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(i=!0,n=s)}):"LINK"===t?H.isString(s.control_link)&&H.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?H.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(i=!0,n=s):H.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s)):"VISUAL"===t&&H.isString(s.control_link)&&H.isString(s.link_match_type)&&H.checkUrlIsMatch(s.control_link,s.link_match_type)&&(i=!0,n=s))}),i)){var a=r.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),r.sendTriggerEvent("outTriggerList",a,n,{})}},F.prototype.registerProperty=function(){var t=this.track_config.property_set_switch;if(t){var e=this.sd.store.getUnionId(),s=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],r=this.sd.bridge.is_verify_success?this.getLatestSubject():[],i=[],n=[];H.each(this.triggerList,function(t,e){s.indexOf(e)<0&&r.indexOf(e)<0||H.isArray(t)&&H.each(t,function(t){t.result_id&&i.push(t.result_id)})}),H.isArray(this.results)&&H.each(this.results,function(t){t.abtest_experiment_result_id&&n.push(t.abtest_experiment_result_id)}),i.length>0&&this.sd.registerPage({abtest_result:i}),n.length>0&&this.sd.registerPage({abtest_dispatch_result:n})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},F.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t);var s=this.state.storage.latest_name,r=this.para.encrypt_cookie;l(e,s,r)},F.prototype.getLatestSubject=function(){var t=this.state.storage.latest_name;return c(t)||[]},F.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s);var r=this.trackTestTrigger(s,t,e);return r},F.prototype.getTriggerProps=function(t,e){var s={},r=H.isObject(e)&&H.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var i="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[i]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return H.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=H.extend(n,s,r)},F.prototype.sendTriggerEvent=function(t,e,s,r){var i=this.track_config.trigger_switch,n=!0,a=this[t];a&&H.isObject(a)&&a[e]&&H.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=C(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,r);return n&&i&&this.sd.track("$ABTestTrigger",o),n},F.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var r=this.sendTriggerEvent("triggerList",t,e,s),i=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",i),r},F.prototype.checkSADebug=function(){var t=this,e=H.getQueryParam(location.href,"sensors_abtest_url"),s=H.getQueryParam(location.href,"feature_code"),r=+H.getQueryParam(location.href,"account_id");if(e.length&&s.length&&H.isNumber(r)&&0!==r){var i={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:r};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(i),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},F.prototype.initMethods=function(t){var e=this,s=["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"];H.each(s,function(s){e[s]=t.methods[s].bind(t)})},U.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),H.isObject(s)&&"SUCCESS"===s.status&&H.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,r=t.outTriggerList;H.isArray(s)&&(this.SensorsABTest.out_list=s),H.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),H.isObject(r)&&(this.SensorsABTest.outTriggerList=r),H.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),r=c(this.SensorsABTest.state.storage.name),i=this.SensorsABTest.sd.store.getDistinctId();if(r&&H.isObject(r)&&r.distinct_id===i)if(e=r.updateTime,t&&this.updateExpsCache(r),e&&H.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)M.call(this,t,e);else{var s=this;t.on("sdkReady",function(){M.call(s,t,e)})}},F.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},F.prototype.log=function(){return H.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var q=new F;return q.__constructor__=F,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||q:window.SensorsDataWebJSSDKPlugin={SensorsABTest:q},F}); \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/vabtest.min.js b/dist/web/plugin/abtesting-sdk-web/vabtest.min.js index 38312b3d..549a5496 100644 --- a/dist/web/plugin/abtesting-sdk-web/vabtest.min.js +++ b/dist/web/plugin/abtesting-sdk-web/vabtest.min.js @@ -1 +1 @@ -!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o",r),null!=r&&r.$id){var s=r.$id,a=void 0===s?"":s,l=r.type,c=void 0===l?"":l;if(r.source===i.config.frameSource){var u=i.messagePool.has(a),d=i.messagePool.has(c);u&&i.messagePool.emit(a,{status:n.SUCCESS,payload:r}),d&&i.messagePool.emit(c,e({},r,{status:n.SUCCESS}))}}},this.iframeLoadHandle=function(){var e;(null==(e=i.iframe)?void 0:e.contentWindow)&&console.log("load success")},this.config=r,this.init()}t.MessageEncode=function(e,t){void 0===e&&(e={}),void 0===t&&(t=JSON.stringify({}));var n=t;try{n=encodeURIComponent(JSON.stringify(e))}catch(o){console.error("[@FrameBridge:error] MessageDecode error",o)}return n},t.MessageDecode=function(e,t){void 0===t&&(t=null);var n=t;try{n=JSON.parse(decodeURIComponent(e||""))}catch(o){n=t,console.warn("@FrameBridge MessageDecode error",o)}return n};var r=t.prototype;return r.emit=function(e,o,r){var i,s,a=this,l=(r||{}).timeout,c=void 0===l?51e3:l,d=this.config.source,h=function(e){return void 0===e&&(e=""),e+"@"+Date.now()+"@"+u(0,10)}(this.ENV),m={$id:h,type:e,status:n.PENDING,payload:o,source:d};"IFRAME"===this.ENV?this.context=null==(i=window)?void 0:i.parent:this.context=null==(s=this.iframe)?void 0:s.contentWindow;return this.context?new Promise(function(e){var o,r;a.messagePool.on(h,function(t){e(t),a.messagePool.remove(h)}),c&&setTimeout(function(){a.messagePool.has(h)&&a.messagePool.emit(h,{status:n.TIMEOUT})},c),a.config.debug&&console.log("[@FrameBridge:"+a.ENV+" emit] => ",m),null==(o=a.context)||o.postMessage(t.MessageEncode(m),(null==(r=a.config)?void 0:r.origin)||"*")}):Promise.resolve({status:n.ERROR,message:"No communication environment,Please check config!"})},r.on=function(e,t){var n=this;this.messagePool.on(e,function(e){var o=e.$id;return t({reply:function(e){n.emit(o,e)}},e,n.config)})},r.destroy=function(){var e;window.removeEventListener("message",this.receiveMessageHandle),null==this||null==(e=this.iframe)||null==e.removeEventListener||e.removeEventListener("load",this.iframeLoadHandle)},r.init=function(){var e,t=this.config.container;if(t){this.ENV="CONTAINER";var n="string"===((e=t)===undefined?"undefined":null===e?"null":e.constructor.name.toLowerCase())?document.querySelector(t):t;if(this.iframe=n,!(n&&n instanceof HTMLIFrameElement))return console.error("[@FrameBridge:error]container is not IFRAME element!"),this;n.addEventListener("load",this.iframeLoadHandle)}else this.ENV="IFRAME";window.addEventListener("message",this.receiveMessageHandle,!1)},t}();!function(e){e.address="address",e.article="article",e.aside="aside",e.footer="footer",e.header="header",e.h1="h1",e.h2="h2",e.h3="h3",e.h4="h4",e.h5="h5",e.h6="h6",e.main="main",e.nav="nav",e.section="section",e.blockquote="blockquote",e.dd="dd",e.div="div",e.dl="dl",e.dt="dt",e.figcaption="figcaption",e.figure="figure",e.hr="hr",e.li="li",e.ol="ol",e.p="p",e.pre="pre",e.ul="ul",e.a="a",e.abbr="abbr",e.b="b",e.bdi="bdi",e.bdo="bdo",e.br="br",e.cite="cite",e.code="code",e.data="data",e.dfn="dfn",e.em="em",e.i="i",e.kbd="kbd",e.mark="mark",e.q="q",e.rp="rp",e.rt="rt",e.ruby="ruby",e.s="s",e.samp="samp",e.small="small",e.span="span",e.strong="strong",e.sub="sub",e.sup="sup",e.time="time",e.u="u",e["var"]="var",e.wbr="wbr",e.img="img",e.area="area",e.audio="audio",e.base="base",e.body="body",e.button="button",e.canvas="canvas",e.caption="caption",e.col="col",e.colgroup="colgroup",e.datalist="datalist",e.del="del",e.details="details",e.dialog="dialog",e.embed="embed",e.fieldset="fieldset",e.form="form",e.head="head",e.hgroup="hgroup",e.html="html",e.iframe="iframe",e.input="input",e.ins="ins",e.label="label",e.legend="legend",e.link="link",e.map="map",e.math="math",e.menu="menu",e.menuitem="menuitem",e.meta="meta",e.meter="meter",e.noscript="noscript",e.object="object",e.optgroup="optgroup",e.option="option",e.output="output",e.param="param",e.picture="picture",e.progress="progress",e.rb="rb",e.rtc="rtc",e.script="script",e.select="select",e.slot="slot",e.source="source",e.style="style",e.summary="summary",e.svg="svg",e.table="table",e.tbody="tbody",e.td="td",e.template="template",e.textarea="textarea",e.tfoot="tfoot",e.th="th",e.thead="thead",e.title="title",e.tr="tr",e.track="track",e.video="video"}(s||(s={})),function(e){e.connect="CONNECT",e.dispose="DISPOSE",e.setDevice="SET_DEVICE",e.setMode="SET_MODE",e.markElement="MARK_ELEMENT",e.cancelMarkElement="CANCEL_MARK_ELEMENT",e.selectElement="SELECT_ELEMENT",e.cancelSelectElement="CANCEL_SELECT_ELEMENT",e.addElementSnapshot="ADD_ELEMENT_SNAPSHOT",e.resetElementSnapshot="RESET_ELEMENT_SNAPSHOT",e.deleteElementSnapshot="DELETE_ELEMENT_SNAPSHOT",e.updateElementSnapshot="UPDATE_ELEMENT_SNAPSHOT",e.getElementSnapshot="GET_ELEMENT_SNAPSHOT",e.keydownEvent="KEY_DOWN",e.mouseupEvent="MOUSE_UP",e.mousemoveEvent="MOUSE_MOVE",e.wheelEvent="WHEEL_EVENT",e.getHtml="GET_HTML",e.checkUrl="CHECK_URL"}(a||(a={})),function(e){e.VIEW="VIEW",e.EDIT="EDIT"}(l||(l={}));var h=[s.img,s.a,s.h1,s.h2,s.h3,s.h4,s.h5,s.h6,s.span,s.div,s.li,s.ol,s.p,s.pre,s.ul,s.dd,s.i,s.dt,s.dl,s.b,s.dl,s.cite,s.em,s.mark,s.small,s.strong,s.sub,s.sup,s.u,s.button,s.td,s.title,s.label];(i={})[a.keydownEvent]={eventValues:["key","keyCode","ctrlKey","metaKey"],preventDefault:!0},i[a.mouseupEvent]={eventValues:[]},i[a.wheelEvent]={eventValues:["ctrlKey","metaKey","deltaY"],preventDefault:!0},i[a.mousemoveEvent]={eventValues:["clientX","clientY"]};var m={},f=Array.prototype,p=Object.prototype,g=f.slice,v=p.toString,E=p.hasOwnProperty,y=f.forEach,b=Array.isArray,S={};function _(){if(!window.name)return!1;try{var e=JSON.parse(decodeURIComponent(window.name||"")),t=e.is_vabtesting,n=e.source_url,o=e.link_match_type;return!(!0!==t||!m.checkUrlIsMatch(n,o))||(m.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function w(e,t){if(!e||!e.parentNode||!e.parentNode.children)return!1;t=t&&t.join?t:[];var n=e.nodeName.toLowerCase();return e&&"body"!==n&&1==e.nodeType?(t.unshift(function(e){var t=e.parentNode&&9==e.parentNode.nodeType?-1:function(e){if(!e.parentNode)return-1;for(var t=0,n=e.tagName,o=e.parentNode.children,r=0;r "):w(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function D(e,t){return e.currentStyle?e.currentStyle[t]:e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function P(e){var t=e.getBoundingClientRect(),n=t.top+(document.body.scrollTop||document.documentElement.scrollTop),o=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft);return{width:t.width,height:t.height,top:n,left:o,x:t.top,y:t.left}}function O(e){var t=e.childNodes,n="",o=!1;return m.each(t,function(e){!1===o&&3===e.nodeType&&(m.isString(e.textContent)||m.isString(e.innerText)||m.isString(e.nodeValue))&&(n=m.trim(e.textContent||e.innerText||e.nodeValue||""),o=!0)}),n}function N(e){if(!m.isString(e))return null;var t,n=e.split(">");return(t=function o(e){var t,r=n.shift();if(!r)return e;try{t=function(e,t){var n;if("body"===(e=m.trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),n=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var o=e.split(":nth-of-type");if(!o[0]||!o[1])return null;var r=o[0],i=o[1].match(/\(([0-9]+)\)/);if(!i||!i[1])return null;var s=Number(i[1]);if(!(m.isElement(t)&&t.children&&t.children.length>0))return null;for(var a=t.children,l=0;l0)return null}return n||null}(r,e)}catch(i){t=null}return t&&m.isElement(t)?o(t):null}())&&m.isElement(t)?t:null}function C(e,t){var n=function(){var e,t={},n=navigator.userAgent.toLowerCase();return(e=n.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=n.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=n.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=n.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=n.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=n.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=n.match(/trident\/([\d.]+)/))&&(t.ie=11),t}(),o=n.ie&&n.ie<9,r="";if(m.each(t,function(e,t){var n;o&&e.indexOf("rgba")>-1&&(e=(n=e.match(/[\d.]+/g)).length>=3?"rgb("+n[0]+","+n[1]+","+n[2]+")":"");var i=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});r+=";"+i+": "+e}),""!==r){var i,s,a,l=e.style,c=l.cssText||"";!c||(s=";",(a=(i=c).length-s.length)>=0&&i.indexOf(s,a)==a)||(c+=";"),l.cssText=c+r}}function T(e,t,n){n||(n=function(e,t){var n=t.originProps,o={attributes:{}},r=n.attributes;return m.each(r.style||{},function(t,n){o.attributes.style[n]=D(e,n)}),Object.hasOwnProperty.call(n,"text")&&(o.attributes.text=O(e)),m.each(["src","href"],function(t){Object.hasOwnProperty.call(r,t)&&(o.attributes[t]=e[t])}),Object.hasOwnProperty.call(r,"target")&&(o.attributes.target=e.getAttribute("target")),o}(e,t));var o=function(e,t){var n=e.originProps,o=t.originProps,r=n.attributes,i=o.attributes,s=!0;return n.text&&n.text!==o.text&&(s=!1),r&&m.each(["src","href","target"],function(e){r[e]&&r[e]!==i[e]&&(s=!1)}),s}(t,n);if(o){var r=t.props;m.isObject(r)&&U(e,r)}return o}function U(e,t){if(Object.hasOwnProperty.call(t,"attributes")){var n=t.attributes;Object.hasOwnProperty.call(n,"style")&&C(e,n.style),m.each(["href","target","src"],function(t){n[t]&&e.getAttribute(t)!==n[t]&&function(e,t,n){e.setAttribute(t,n)}(e,t,n[t])})}Object.hasOwnProperty.call(t,"text")&&function(e,t){var n=e.childNodes,o=!1;m.each(n,function(e){3===e.nodeType&&(o||(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.nodeValue=t,o=!0))})}(e,t.text)}function M(e){var t=e.getBoundingClientRect(),n=window.innerWidth?{w:window.innerWidth,h:window.innerHeight}:(document.compatMode="BackCompat")?{w:document.body.clientWidth,h:document.body.clientHeigth}:{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight},o=document.documentElement.scrollTop||document.body.scrollTop,r=document.documentElement.scrollLeft||document.body.scrollLeft,i=t.width,s=t.height,a=t.left+n.w/2-i/2+r,l=t.top-n.h/2+s/2+o;window.scrollTo(a,l)}function L(e,t){var n=e.tagName.toLowerCase(),o=function(e,t){var n={};return m.each(t||[],function(t){var o=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});n[t]=D(e,o)}),n}(e,t),r={selector:w(e),originProps:{attributes:{style:o},text:O(e)},type:"text",tagName:n};return"a"===n&&(r.originProps.attributes.href=e.href,e.getAttribute("target")&&(r.originProps.attributes.target=e.getAttribute("target")),r.type="link"),"img"===n&&(r.originProps.attributes.src=e.src,r.type="img"),{originStyle:e.getAttribute("style"),eleInfo:r,ele:e}}function R(e){var t=e.eleInfo,n=e.ele;if(n){var o=e.originStyle;U(n,t.originProps),n.style.cssText=o||""}}m.each=function(e,t,n){if(null==e)return!1;if(y&&e.forEach===y)e.forEach(t,n);else if(m.isArray(e)&&e.length===+e.length){for(var o=0,r=e.length;o Invalid URL"),this._fields)"undefined"!=typeof t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new t(e)},m.URL=function(e){var t,n={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(e){return!1}}())(n=new URL(e)).searchParams||(n.searchParams=(t=m.getURLSearchParams(n.search),{get:function(e){return t[e]}}));else{!1===/^https?:\/\/.+/.test(e)&&m.log("Invalid URL");var o=m.urlParse(e);n.hash="",n.host=o._values.Host?o._values.Host+(o._values.Port?":"+o._values.Port:""):"",n.href=o._values.URL,n.password=o._values.Password,n.pathname=o._values.Path,n.port=o._values.Port,n.search=o._values.QueryString?"?"+o._values.QueryString:"",n.username=o._values.Username,n.hostname=o._values.Hostname,n.protocol=o._values.Protocol?o._values.Protocol+":":"",n.origin=o._values.Origin?o._values.Origin+(o._values.Port?":"+o._values.Port:""):"",n.searchParams=function(){var e=m.getURLSearchParams("?"+o._values.QueryString);return{get:function(t){return e[t]}}}()}return n},m.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=m.decodeURIComponent(e);var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===n||n&&"string"!=typeof n[1]&&n[1].length?"":m.decodeURIComponent(n[1])},m.isEmptyObject=function(e){if(m.isObject(e)){for(var t in e)if(E.call(e,t))return!1;return!0}return!1},m.contentLoaded=function(e,t){var n=!1,o=!0,r=e.document,i=r.documentElement,s=r.addEventListener,a=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",c=s?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=r.readyState||(("load"==o.type?e:r)[l](c+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{i.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==r.readyState)t.call(e,"lazy");else{if(!s&&i.doScroll){try{o=!e.frameElement}catch(h){}o&&d()}r[a](c+"DOMContentLoaded",u,!1),r[a](c+"readystatechange",u,!1),e[a](c+"load",u,!1)}},m.secCheck={isHttpUrl:function(e){if("string"!=typeof e)return!1;return!1!==/^https?:\/\/.+/.test(e)||(m.log("Invalid URL"),!1)},removeScriptProtocol:function(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}},m.addEvent=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(o){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,o){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,o.call(this,t)},!0);else{var r="on"+n,i=t[r];t[r]=function(t,n,o){return function(r){if(!(r=r||e(window.event)))return undefined;r.target=r.srcElement;var i,s,a=!0;return"function"==typeof o&&(i=o(r)),s=n.call(t,r),!1!==i&&!1!==s||(a=!1),a}}(t,o,i)}}).apply(null,arguments)},m.addSinglePageEvent=function(e){var t=location.href,n=window.history.pushState,o=window.history.replaceState;window.history.pushState=function(){n.apply(window.history,arguments),e(t),t=location.href},window.history.replaceState=function(){o.apply(window.history,arguments),e(t),t=location.href};var r=n?"popstate":"hashchange";m.addEvent(window,r,function(){e(t),t=location.href})},m.trim=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},m.checkUrlIsMatch=function(e,t){var n,o,r=m.URL(e);if("STRICT"===t)return location.href===r.href;if("FUZZY"===t){try{n=m.URL(location.href)}catch(i){return m.log("url \u89e3\u6790\u5931\u8d25",i),!1}try{o=m.URL(e)}catch(i){return m.log("control_url \u89e3\u6790\u5931\u8d25",i),!1}return n.host===o.host&&n.pathname===o.pathname}return m.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",t),!1},m.checkUrlIsRegexp=function(e,t){var n;try{n=m.URL(location.href)}catch(i){return m.log("url \u89e3\u6790\u5931\u8d25",i),!1}try{var o=(t?new RegExp(e,t):new RegExp(e)).exec(n.href),r=!0;return!!o&&(m.each(o,function(e){e||(r=!1)}),r)}catch(i){return m.log("control_link\u5b57\u6bb5\u5f02\u5e38",i),!1}},m.log=function(){if("object"==typeof console&&console.log){m.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}},m.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(e){console.error(arguments[0])}},m.storage={isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";window.localStorage.setItem(t,n),window.localStorage.getItem(t)!==n&&(e=!1),window.localStorage.removeItem(t)}catch(o){e=!1}return e},set:function(e,t){this.isSupport()&&window.localStorage.setItem(t,e)},get:function(e){var t=null;return this.isSupport()&&(t=window.localStorage.getItem(e)),t}},m.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds())},m.isDate=function(e){return"[object Date]"==Object.prototype.toString.call(e)};class x{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor;for(let e in a)m.isFunction(this[e])&&this.bridge.on(a[e],this[e].bind(this))}updateElementSnapshot(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector),r=o.ele;if(this.domEditor.updataServerData(n.selector,n),r){R(o),this.domEditor.editEleProps(n,o);let t=P(r);this.domEditor.setSelectElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}setMode(e,t){let n=t.payload.type,o=!0;this.domEditor.setMode(n),_()||(o=!1,this.domEditor.mode_type="VIEW"),e.reply({status:"SUCCESS",check_url:o})}resetElementSnapshot(e,t){let n=this,o=t.payload,r=[];this.domEditor.saveServerData(o),this.domEditor.restoreElements(),m.each(o,function(e){let t=n.domEditor.getOriginDataBySelector(e.selector);t.ele?n.domEditor.editEleProps(e,t):r.push(e)}),this.domEditor.resetSelectDivPostion(),this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS",no_found_list:r})}markElement(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector).ele;if(o){let t=P(o);this.domEditor.setHoverElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}selectElement(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector).ele;if(o){let t=P(o);this.domEditor.setSelectElePostion(t),M(o),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}addElementSnapshot(e,t){this.updateElementSnapshot(e,t)}deleteElementSnapshot(e,t){this.updateElementSnapshot(e,t)}getHtml(e){let t=document.getElementsByTagName("html")[0].outerHTML;t=t.replace(/class="sa-vabtest-mark"/g,'class="sa-vabtest-mark-hidden"'),e.reply({status:"SUCCESS",visual_dom:t,origin_url:location.href,dom_width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),dom_height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)})}cancelSelectElement(e){this.domEditor.resetSelectDivPostion(),e.reply({status:"SUCCESS"})}cancelMarkElement(e){this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS"})}checkUrl(e){let t=!0;_()||(t=!1,this.domEditor.mode_type="VIEW"),e.reply({status:t?"SUCCESS":"ERROR"})}}class k{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.tagNames=h}init(e){this.config=e,this.addLisenter()}addLisenter(){let e=this.config.action;var t;e.KEY_DOWN&&m.addEvent(document.body,"keydown",this.keydownHandler.bind(this)),e.MOUSE_UP&&m.addEvent(document.body,"mouseup",this.mouseupHandler.bind(this)),e.WHEEL_EVENT&&m.addEvent(document.body,"wheel",this.wheelHandler.bind(this)),m.addEvent(document,"mousemove",this.moveHandler.bind(this)),m.addEvent(document,"click",this.clickHandler.bind(this),!0),m.addSinglePageEvent(this.singlePage.bind(this)),t=this.mutationObserver.bind(this),new(0,window.MutationObserver)(t).observe(document.body,{childList:!0,subtree:!0})}elementFilter(e){if(e){let t=e.tagName.toLowerCase();if(this.tagNames.indexOf(t)>-1){if("a"===t||"img"===t)return e;return this.domEditor.getOriginDataByElement(e).eleInfo.originProps.text?e:null}}return null}getMouseElement(e){let t=null;return m.each(e,function(e){!t&&m.isString(e.className)&&-1===e.className.indexOf("sa-vabtest-mark")&&(t=e)}),t}moveHandler(e){let t=this.config.action;if(t.MOUSE_MOVE&&t.MOUSE_MOVE&&t.MOUSE_MOVE.eventValues&&m.isArray(t.MOUSE_MOVE.eventValues)){let n={};m.each(t.MOUSE_MOVE.eventValues,function(t){n[t]=e[t]}),this.bridge.emit(a.mousemoveEvent,n)}if("EDIT"!==this.domEditor.mode_type)return;let n=document.elementsFromPoint(e.clientX,e.clientY),o=this.getMouseElement(n),r=this.elementFilter(o);if(r){let e=P(r);this.domEditor.setHoverElePostion(e)}else this.domEditor.resetHoverDivPostion()}clickHandler(e){if("EDIT"!==this.domEditor.mode_type)return;e.stopPropagation(),e.preventDefault();let t=document.elementsFromPoint(e.clientX,e.clientY),n=this.getMouseElement(t),o=this.elementFilter(n);if(o){let e=this.domEditor.getOriginDataByElement(o).eleInfo,t=e.selector,n=this.domEditor.getServerDataBySelector(t),r=m.extend(n||{isModify:!1},e),i=P(o);this.domEditor.setSelectElePostion(i),this.bridge.emit(a.selectElement,r)}else this.domEditor.resetSelectDivPostion(),this.bridge.emit(a.cancelSelectElement,{status:!0})}keydownHandler(e){let t={},n=this.config.action,o=(e.ctrlKey||e.metaKey?"cmd+":"")+e.key;"cmd+-"!==o&&"cmd+="!==o&&"Escape"!==o||(!0===n.KEY_DOWN.preventDefault&&e.preventDefault(),n.KEY_DOWN.eventValues&&m.isArray(n.KEY_DOWN.eventValues)&&m.each(n.KEY_DOWN.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.keydownEvent,t))}mouseupHandler(e){let t={},n=this.config.action;n.MOUSE_UP&&(!0===n.MOUSE_UP.preventDefault&&e.preventDefault(),n.MOUSE_UP.eventValues&&m.isArray(n.MOUSE_UP.eventValues)&&m.each(n.MOUSE_UP.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.mouseupEvent,t))}wheelHandler(e){let t={},n=this.config.action;n.WHEEL_EVENT&&(!0===n.WHEEL_EVENT.preventDefault&&e.preventDefault(),n.WHEEL_EVENT.eventValues&&m.isArray(n.WHEEL_EVENT.eventValues)&&m.each(n.WHEEL_EVENT.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.wheelEvent,t))}singlePage(e){if(e===location.href)return!1;let t=!0;_()||(t=!1,this.domEditor.mode_type="VIEW"),this.bridge.emit(a.checkUrl,{status:t?"SUCCESS":"ERROR"})}mutationObserver(){let e=this;m.each(e.domEditor.serverData,function(t){let n=e.domEditor.getOriginDataBySelector(t.selector);n.ele&&e.domEditor.editEleProps(t,n)})}}class A{constructor(e){this.config=e.config,this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null,this.mode_type="EDIT",this.serverData=[],this.originData=[],this.buildMarkDom()}setDomPostion(e,t){m.each(["width","height","left","top"],function(n){e.style[n]=t[n]+"px"})}setHoverElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,e)}setSelectElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,e)}restoreElements(){m.each(this.originData,function(e){R(e)}),this.originData=[]}editEleProps(e,t){let n=t.eleInfo;T(t.ele,e,n)}setMode(e){var t;this.mode_type=e,"VIEW"===e&&((t=this.maskDiv)&&t.parentNode.removeChild(t),this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null)}resetMarkDom(e){e&&this.setDomPostion(e,{width:0,height:0,top:0,left:0})}resetSelectDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,{width:0,height:0,top:0,left:0})}resetHoverDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,{width:0,height:0,top:0,left:0})}buildMarkDom(){var e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div"),o=document.createElement("style");e.className="sa-vabtest-mark",t.className="sa-vabtest-hover",n.className="sa-vabtest-clickable";var r=e.attachShadow({mode:"open"});o.innerText=".sa-vabtest-clickable { background: rgba(44, 123, 242, 0.2) !important; outline: 2px solid #2C7BF2 !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}.sa-vabtest-hover { outline: 2px solid #2C7BF2 !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}",r.appendChild(o),r.appendChild(t),r.appendChild(n),document.body.appendChild(e),function(e){var t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(n){t.styleSheet.cssText=e}document.getElementsByTagName("head")[0].appendChild(t)}(".sa-vabtest-mark { pointer-events: none;}.sa-vabtest-mark-hidden { display: none;}"),this.hoverDiv=t,this.selectDiv=n,this.maskDiv=e}saveServerData(e){this.serverData=e}updataServerData(e,t){let n=!1,o=this;m.each(this.serverData,function(r,i){r.selector===e&&(o.serverData[i]=t,n=!0)}),n||this.serverData.push(t)}getServerDataBySelector(e){let t=null;return m.each(this.serverData,function(n){n.selector===e&&(t=n)}),t}setOriginData(e,t){let n=!1,o=this;m.each(this.originData,function(t,r){e===t.selector&&(o.originData[r]=t,n=!0)}),n||this.originData.push(t)}getOriginDataBySelector(e){let t=null;if(m.each(this.originData,function(n){e===n.eleInfo.selector&&(t=n)}),!t){let n=N(e);n?(t=L(n,this.config.styles),this.setOriginData(t.eleInfo.selector,t)):t={}}return t}getOriginDataByElement(e){let t=null;return m.each(this.originData,function(n){e===n.ele&&(t=n)}),t||(t=L(e,this.config.styles),this.setOriginData(t.eleInfo.selector,t)),t}}class H{constructor(){this.plugin_name="VABTest",this.plugin_version="1.25.9",this.abTestingSDK=null,this.bridge=new d({source:"sa-web-abtesting-sdk",frameSource:"sa-fe-abtesting-mode",version:"abtest_version"})}init(e,t){this.abTestingSDK=t.SensorsABTest;let n=this;if(e&&this.abTestingSDK){m.log=e.log,this.bridge.emit(a.connect,{status:!0}).then(function(e){if("SUCCESS"===e.status){let t=e.payload.support;n.domEditor=new A({config:t}),n.sender=new k({bridge:n.bridge,domEditor:n.domEditor}),new x({bridge:n.bridge,domEditor:n.domEditor}),n.sender.init(t)}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")})}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")}}let I=new H;I.__constructor__=H,window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.VABTest=window.SensorsDataWebJSSDKPlugin.VABTest||I:window.SensorsDataWebJSSDKPlugin={VABTest:I}}); \ No newline at end of file +!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o",r),null!=r&&r.$id){var s=r.$id,a=void 0===s?"":s,l=r.type,c=void 0===l?"":l;if(r.source===i.config.frameSource){var u=i.messagePool.has(a),d=i.messagePool.has(c);u&&i.messagePool.emit(a,{status:n.SUCCESS,payload:r}),d&&i.messagePool.emit(c,e({},r,{status:n.SUCCESS}))}}},this.iframeLoadHandle=function(){var e;(null==(e=i.iframe)?void 0:e.contentWindow)&&console.log("load success")},this.config=r,this.init()}t.MessageEncode=function(e,t){void 0===e&&(e={}),void 0===t&&(t=JSON.stringify({}));var n=t;try{n=encodeURIComponent(JSON.stringify(e))}catch(o){console.error("[@FrameBridge:error] MessageDecode error",o)}return n},t.MessageDecode=function(e,t){void 0===t&&(t=null);var n=t;try{n=JSON.parse(decodeURIComponent(e||""))}catch(o){n=t,console.warn("@FrameBridge MessageDecode error",o)}return n};var r=t.prototype;return r.emit=function(e,o,r){var i,s,a=this,l=(r||{}).timeout,c=void 0===l?51e3:l,d=this.config.source,h=function(e){return void 0===e&&(e=""),e+"@"+Date.now()+"@"+u(0,10)}(this.ENV),m={$id:h,type:e,status:n.PENDING,payload:o,source:d};"IFRAME"===this.ENV?this.context=null==(i=window)?void 0:i.parent:this.context=null==(s=this.iframe)?void 0:s.contentWindow;return this.context?new Promise(function(e){var o,r;a.messagePool.on(h,function(t){e(t),a.messagePool.remove(h)}),c&&setTimeout(function(){a.messagePool.has(h)&&a.messagePool.emit(h,{status:n.TIMEOUT})},c),a.config.debug&&console.log("[@FrameBridge:"+a.ENV+" emit] => ",m),null==(o=a.context)||o.postMessage(t.MessageEncode(m),(null==(r=a.config)?void 0:r.origin)||"*")}):Promise.resolve({status:n.ERROR,message:"No communication environment,Please check config!"})},r.on=function(e,t){var n=this;this.messagePool.on(e,function(e){var o=e.$id;return t({reply:function(e){n.emit(o,e)}},e,n.config)})},r.destroy=function(){var e;window.removeEventListener("message",this.receiveMessageHandle),null==this||null==(e=this.iframe)||null==e.removeEventListener||e.removeEventListener("load",this.iframeLoadHandle)},r.init=function(){var e,t=this.config.container;if(t){this.ENV="CONTAINER";var n="string"===((e=t)===undefined?"undefined":null===e?"null":e.constructor.name.toLowerCase())?document.querySelector(t):t;if(this.iframe=n,!(n&&n instanceof HTMLIFrameElement))return console.error("[@FrameBridge:error]container is not IFRAME element!"),this;n.addEventListener("load",this.iframeLoadHandle)}else this.ENV="IFRAME";window.addEventListener("message",this.receiveMessageHandle,!1)},t}();!function(e){e.address="address",e.article="article",e.aside="aside",e.footer="footer",e.header="header",e.h1="h1",e.h2="h2",e.h3="h3",e.h4="h4",e.h5="h5",e.h6="h6",e.main="main",e.nav="nav",e.section="section",e.blockquote="blockquote",e.dd="dd",e.div="div",e.dl="dl",e.dt="dt",e.figcaption="figcaption",e.figure="figure",e.hr="hr",e.li="li",e.ol="ol",e.p="p",e.pre="pre",e.ul="ul",e.a="a",e.abbr="abbr",e.b="b",e.bdi="bdi",e.bdo="bdo",e.br="br",e.cite="cite",e.code="code",e.data="data",e.dfn="dfn",e.em="em",e.i="i",e.kbd="kbd",e.mark="mark",e.q="q",e.rp="rp",e.rt="rt",e.ruby="ruby",e.s="s",e.samp="samp",e.small="small",e.span="span",e.strong="strong",e.sub="sub",e.sup="sup",e.time="time",e.u="u",e["var"]="var",e.wbr="wbr",e.img="img",e.area="area",e.audio="audio",e.base="base",e.body="body",e.button="button",e.canvas="canvas",e.caption="caption",e.col="col",e.colgroup="colgroup",e.datalist="datalist",e.del="del",e.details="details",e.dialog="dialog",e.embed="embed",e.fieldset="fieldset",e.form="form",e.head="head",e.hgroup="hgroup",e.html="html",e.iframe="iframe",e.input="input",e.ins="ins",e.label="label",e.legend="legend",e.link="link",e.map="map",e.math="math",e.menu="menu",e.menuitem="menuitem",e.meta="meta",e.meter="meter",e.noscript="noscript",e.object="object",e.optgroup="optgroup",e.option="option",e.output="output",e.param="param",e.picture="picture",e.progress="progress",e.rb="rb",e.rtc="rtc",e.script="script",e.select="select",e.slot="slot",e.source="source",e.style="style",e.summary="summary",e.svg="svg",e.table="table",e.tbody="tbody",e.td="td",e.template="template",e.textarea="textarea",e.tfoot="tfoot",e.th="th",e.thead="thead",e.title="title",e.tr="tr",e.track="track",e.video="video"}(s||(s={})),function(e){e.connect="CONNECT",e.dispose="DISPOSE",e.setDevice="SET_DEVICE",e.setMode="SET_MODE",e.markElement="MARK_ELEMENT",e.cancelMarkElement="CANCEL_MARK_ELEMENT",e.selectElement="SELECT_ELEMENT",e.cancelSelectElement="CANCEL_SELECT_ELEMENT",e.addElementSnapshot="ADD_ELEMENT_SNAPSHOT",e.resetElementSnapshot="RESET_ELEMENT_SNAPSHOT",e.deleteElementSnapshot="DELETE_ELEMENT_SNAPSHOT",e.updateElementSnapshot="UPDATE_ELEMENT_SNAPSHOT",e.getElementSnapshot="GET_ELEMENT_SNAPSHOT",e.keydownEvent="KEY_DOWN",e.mouseupEvent="MOUSE_UP",e.mousemoveEvent="MOUSE_MOVE",e.wheelEvent="WHEEL_EVENT",e.getHtml="GET_HTML",e.checkUrl="CHECK_URL"}(a||(a={})),function(e){e.VIEW="VIEW",e.EDIT="EDIT"}(l||(l={}));var h=[s.img,s.a,s.h1,s.h2,s.h3,s.h4,s.h5,s.h6,s.span,s.div,s.li,s.ol,s.p,s.pre,s.ul,s.dd,s.i,s.dt,s.dl,s.b,s.dl,s.cite,s.em,s.mark,s.small,s.strong,s.sub,s.sup,s.u,s.button,s.td,s.title,s.label];(i={})[a.keydownEvent]={eventValues:["key","keyCode","ctrlKey","metaKey"],preventDefault:!0},i[a.mouseupEvent]={eventValues:[]},i[a.wheelEvent]={eventValues:["ctrlKey","metaKey","deltaY"],preventDefault:!0},i[a.mousemoveEvent]={eventValues:["clientX","clientY"]};var m={},f=Array.prototype,p=Object.prototype,g=f.slice,v=p.toString,E=p.hasOwnProperty,y=f.forEach,b=Array.isArray,S={};function _(){if(!window.name)return!1;try{var e=JSON.parse(decodeURIComponent(window.name||"")),t=e.is_vabtesting,n=e.source_url,o=e.link_match_type;return!(!0!==t||!m.checkUrlIsMatch(n,o))||(m.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function w(e,t){if(!e||!e.parentNode||!e.parentNode.children)return!1;t=t&&t.join?t:[];var n=e.nodeName.toLowerCase();return e&&"body"!==n&&1==e.nodeType?(t.unshift(function(e){var t=e.parentNode&&9==e.parentNode.nodeType?-1:function(e){if(!e.parentNode)return-1;for(var t=0,n=e.tagName,o=e.parentNode.children,r=0;r "):w(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function D(e,t){return e.currentStyle?e.currentStyle[t]:e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function P(e){var t=e.getBoundingClientRect(),n=t.top+(document.body.scrollTop||document.documentElement.scrollTop),o=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft);return{width:t.width,height:t.height,top:n,left:o,x:t.top,y:t.left}}function O(e){var t=e.childNodes,n="",o=!1;return m.each(t,function(e){!1===o&&3===e.nodeType&&(m.isString(e.textContent)||m.isString(e.innerText)||m.isString(e.nodeValue))&&(n=m.trim(e.textContent||e.innerText||e.nodeValue||""),o=!0)}),n}function N(e){if(!m.isString(e))return null;var t,n=e.split(">");return(t=function o(e){var t,r=n.shift();if(!r)return e;try{t=function(e,t){var n;if("body"===(e=m.trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),n=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var o=e.split(":nth-of-type");if(!o[0]||!o[1])return null;var r=o[0],i=o[1].match(/\(([0-9]+)\)/);if(!i||!i[1])return null;var s=Number(i[1]);if(!(m.isElement(t)&&t.children&&t.children.length>0))return null;for(var a=t.children,l=0;l0)return null}return n||null}(r,e)}catch(i){t=null}return t&&m.isElement(t)?o(t):null}())&&m.isElement(t)?t:null}function C(e,t){var n=function(){var e,t={},n=navigator.userAgent.toLowerCase();return(e=n.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=n.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=n.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=n.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=n.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=n.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=n.match(/trident\/([\d.]+)/))&&(t.ie=11),t}(),o=n.ie&&n.ie<9,r="";if(m.each(t,function(e,t){var n;o&&e.indexOf("rgba")>-1&&(e=(n=e.match(/[\d.]+/g)).length>=3?"rgb("+n[0]+","+n[1]+","+n[2]+")":"");var i=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});r+=";"+i+": "+e}),""!==r){var i,s,a,l=e.style,c=l.cssText||"";!c||(s=";",(a=(i=c).length-s.length)>=0&&i.indexOf(s,a)==a)||(c+=";"),l.cssText=c+r}}function T(e,t,n){n||(n=function(e,t){var n=t.originProps,o={attributes:{}},r=n.attributes;return m.each(r.style||{},function(t,n){o.attributes.style[n]=D(e,n)}),Object.hasOwnProperty.call(n,"text")&&(o.attributes.text=O(e)),m.each(["src","href"],function(t){Object.hasOwnProperty.call(r,t)&&(o.attributes[t]=e[t])}),Object.hasOwnProperty.call(r,"target")&&(o.attributes.target=e.getAttribute("target")),o}(e,t));var o=function(e,t){var n=e.originProps,o=t.originProps,r=n.attributes,i=o.attributes,s=!0;return n.text&&n.text!==o.text&&(s=!1),r&&m.each(["src","href","target"],function(e){r[e]&&r[e]!==i[e]&&(s=!1)}),s}(t,n);if(o){var r=t.props;m.isObject(r)&&U(e,r)}return o}function U(e,t){if(Object.hasOwnProperty.call(t,"attributes")){var n=t.attributes;Object.hasOwnProperty.call(n,"style")&&C(e,n.style),m.each(["href","target","src"],function(t){n[t]&&e.getAttribute(t)!==n[t]&&function(e,t,n){e.setAttribute(t,n)}(e,t,n[t])})}Object.hasOwnProperty.call(t,"text")&&function(e,t){var n=e.childNodes,o=!1;m.each(n,function(e){3===e.nodeType&&(o||(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.nodeValue=t,o=!0))})}(e,t.text)}function M(e){var t=e.getBoundingClientRect(),n=window.innerWidth?{w:window.innerWidth,h:window.innerHeight}:(document.compatMode="BackCompat")?{w:document.body.clientWidth,h:document.body.clientHeigth}:{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight},o=document.documentElement.scrollTop||document.body.scrollTop,r=document.documentElement.scrollLeft||document.body.scrollLeft,i=t.width,s=t.height,a=t.left+n.w/2-i/2+r,l=t.top-n.h/2+s/2+o;window.scrollTo(a,l)}function L(e,t){var n=e.tagName.toLowerCase(),o=function(e,t){var n={};return m.each(t||[],function(t){var o=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});n[t]=D(e,o)}),n}(e,t),r={selector:w(e),originProps:{attributes:{style:o},text:O(e)},type:"text",tagName:n};return"a"===n&&(r.originProps.attributes.href=e.href,e.getAttribute("target")&&(r.originProps.attributes.target=e.getAttribute("target")),r.type="link"),"img"===n&&(r.originProps.attributes.src=e.src,r.type="img"),{originStyle:e.getAttribute("style"),eleInfo:r,ele:e}}function R(e){var t=e.eleInfo,n=e.ele;if(n){var o=e.originStyle;U(n,t.originProps),n.style.cssText=o||""}}m.each=function(e,t,n){if(null==e)return!1;if(y&&e.forEach===y)e.forEach(t,n);else if(m.isArray(e)&&e.length===+e.length){for(var o=0,r=e.length;o Invalid URL"),this._fields)"undefined"!=typeof t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new t(e)},m.URL=function(e){var t,n={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(e){return!1}}())(n=new URL(e)).searchParams||(n.searchParams=(t=m.getURLSearchParams(n.search),{get:function(e){return t[e]}}));else{!1===/^https?:\/\/.+/.test(e)&&m.log("Invalid URL");var o=m.urlParse(e);n.hash="",n.host=o._values.Host?o._values.Host+(o._values.Port?":"+o._values.Port:""):"",n.href=o._values.URL,n.password=o._values.Password,n.pathname=o._values.Path,n.port=o._values.Port,n.search=o._values.QueryString?"?"+o._values.QueryString:"",n.username=o._values.Username,n.hostname=o._values.Hostname,n.protocol=o._values.Protocol?o._values.Protocol+":":"",n.origin=o._values.Origin?o._values.Origin+(o._values.Port?":"+o._values.Port:""):"",n.searchParams=function(){var e=m.getURLSearchParams("?"+o._values.QueryString);return{get:function(t){return e[t]}}}()}return n},m.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=m.decodeURIComponent(e);var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===n||n&&"string"!=typeof n[1]&&n[1].length?"":m.decodeURIComponent(n[1])},m.isEmptyObject=function(e){if(m.isObject(e)){for(var t in e)if(E.call(e,t))return!1;return!0}return!1},m.contentLoaded=function(e,t){var n=!1,o=!0,r=e.document,i=r.documentElement,s=r.addEventListener,a=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",c=s?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=r.readyState||(("load"==o.type?e:r)[l](c+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{i.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==r.readyState)t.call(e,"lazy");else{if(!s&&i.doScroll){try{o=!e.frameElement}catch(h){}o&&d()}r[a](c+"DOMContentLoaded",u,!1),r[a](c+"readystatechange",u,!1),e[a](c+"load",u,!1)}},m.secCheck={isHttpUrl:function(e){if("string"!=typeof e)return!1;return!1!==/^https?:\/\/.+/.test(e)||(m.log("Invalid URL"),!1)},removeScriptProtocol:function(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}},m.addEvent=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(o){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,o){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,o.call(this,t)},!0);else{var r="on"+n,i=t[r];t[r]=function(t,n,o){return function(r){if(!(r=r||e(window.event)))return undefined;r.target=r.srcElement;var i,s,a=!0;return"function"==typeof o&&(i=o(r)),s=n.call(t,r),!1!==i&&!1!==s||(a=!1),a}}(t,o,i)}}).apply(null,arguments)},m.addSinglePageEvent=function(e){var t=location.href,n=window.history.pushState,o=window.history.replaceState;window.history.pushState=function(){n.apply(window.history,arguments),e(t),t=location.href},window.history.replaceState=function(){o.apply(window.history,arguments),e(t),t=location.href};var r=n?"popstate":"hashchange";m.addEvent(window,r,function(){e(t),t=location.href})},m.trim=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},m.checkUrlIsMatch=function(e,t){var n,o,r=m.URL(e);if("STRICT"===t)return location.href===r.href;if("FUZZY"===t){try{n=m.URL(location.href)}catch(i){return m.log("url \u89e3\u6790\u5931\u8d25",i),!1}try{o=m.URL(e)}catch(i){return m.log("control_url \u89e3\u6790\u5931\u8d25",i),!1}return n.host===o.host&&n.pathname===o.pathname}return m.log("link_match_type\u5b57\u6bb5\u5f02\u5e38",t),!1},m.checkUrlIsRegexp=function(e,t){var n;try{n=m.URL(location.href)}catch(i){return m.log("url \u89e3\u6790\u5931\u8d25",i),!1}try{var o=(t?new RegExp(e,t):new RegExp(e)).exec(n.href),r=!0;return!!o&&(m.each(o,function(e){e||(r=!1)}),r)}catch(i){return m.log("control_link\u5b57\u6bb5\u5f02\u5e38",i),!1}},m.log=function(){if("object"==typeof console&&console.log){m.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]);try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}},m.error=function(){if("object"==typeof console&&console.error)try{return console.error.apply(console,arguments)}catch(e){console.error(arguments[0])}},m.storage={isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";window.localStorage.setItem(t,n),window.localStorage.getItem(t)!==n&&(e=!1),window.localStorage.removeItem(t)}catch(o){e=!1}return e},set:function(e,t){this.isSupport()&&window.localStorage.setItem(t,e)},get:function(e){var t=null;return this.isSupport()&&(t=window.localStorage.getItem(e)),t}},m.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds())},m.isDate=function(e){return"[object Date]"==Object.prototype.toString.call(e)};class x{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor;for(let e in a)m.isFunction(this[e])&&this.bridge.on(a[e],this[e].bind(this))}updateElementSnapshot(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector),r=o.ele;if(this.domEditor.updataServerData(n.selector,n),r){R(o),this.domEditor.editEleProps(n,o);let t=P(r);this.domEditor.setSelectElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}setMode(e,t){let n=t.payload.type,o=!0;this.domEditor.setMode(n),_()||(o=!1,this.domEditor.mode_type="VIEW"),e.reply({status:"SUCCESS",check_url:o})}resetElementSnapshot(e,t){let n=this,o=t.payload,r=[];this.domEditor.saveServerData(o),this.domEditor.restoreElements(),m.each(o,function(e){let t=n.domEditor.getOriginDataBySelector(e.selector);t.ele?n.domEditor.editEleProps(e,t):r.push(e)}),this.domEditor.resetSelectDivPostion(),this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS",no_found_list:r})}markElement(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector).ele;if(o){let t=P(o);this.domEditor.setHoverElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}selectElement(e,t){let n=t.payload,o=this.domEditor.getOriginDataBySelector(n.selector).ele;if(o){let t=P(o);this.domEditor.setSelectElePostion(t),M(o),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}addElementSnapshot(e,t){this.updateElementSnapshot(e,t)}deleteElementSnapshot(e,t){this.updateElementSnapshot(e,t)}getHtml(e){let t=document.getElementsByTagName("html")[0].outerHTML;t=t.replace(/class="sa-vabtest-mark"/g,'class="sa-vabtest-mark-hidden"'),e.reply({status:"SUCCESS",visual_dom:t,origin_url:location.href,dom_width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),dom_height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)})}cancelSelectElement(e){this.domEditor.resetSelectDivPostion(),e.reply({status:"SUCCESS"})}cancelMarkElement(e){this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS"})}checkUrl(e){let t=!0;_()||(t=!1,this.domEditor.mode_type="VIEW"),e.reply({status:t?"SUCCESS":"ERROR"})}}class k{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.tagNames=h}init(e){this.config=e,this.addLisenter()}addLisenter(){let e=this.config.action;var t;e.KEY_DOWN&&m.addEvent(document.body,"keydown",this.keydownHandler.bind(this)),e.MOUSE_UP&&m.addEvent(document.body,"mouseup",this.mouseupHandler.bind(this)),e.WHEEL_EVENT&&m.addEvent(document.body,"wheel",this.wheelHandler.bind(this)),m.addEvent(document,"mousemove",this.moveHandler.bind(this)),m.addEvent(document,"click",this.clickHandler.bind(this),!0),m.addSinglePageEvent(this.singlePage.bind(this)),t=this.mutationObserver.bind(this),new(0,window.MutationObserver)(t).observe(document.body,{childList:!0,subtree:!0})}elementFilter(e){if(e){let t=e.tagName.toLowerCase();if(this.tagNames.indexOf(t)>-1){if("a"===t||"img"===t)return e;return this.domEditor.getOriginDataByElement(e).eleInfo.originProps.text?e:null}}return null}getMouseElement(e){let t=null;return m.each(e,function(e){!t&&m.isString(e.className)&&-1===e.className.indexOf("sa-vabtest-mark")&&(t=e)}),t}moveHandler(e){let t=this.config.action;if(t.MOUSE_MOVE&&t.MOUSE_MOVE&&t.MOUSE_MOVE.eventValues&&m.isArray(t.MOUSE_MOVE.eventValues)){let n={};m.each(t.MOUSE_MOVE.eventValues,function(t){n[t]=e[t]}),this.bridge.emit(a.mousemoveEvent,n)}if("EDIT"!==this.domEditor.mode_type)return;let n=document.elementsFromPoint(e.clientX,e.clientY),o=this.getMouseElement(n),r=this.elementFilter(o);if(r){let e=P(r);this.domEditor.setHoverElePostion(e)}else this.domEditor.resetHoverDivPostion()}clickHandler(e){if("EDIT"!==this.domEditor.mode_type)return;e.stopPropagation(),e.preventDefault();let t=document.elementsFromPoint(e.clientX,e.clientY),n=this.getMouseElement(t),o=this.elementFilter(n);if(o){let e=this.domEditor.getOriginDataByElement(o).eleInfo,t=e.selector,n=this.domEditor.getServerDataBySelector(t),r=m.extend(n||{isModify:!1},e),i=P(o);this.domEditor.setSelectElePostion(i),this.bridge.emit(a.selectElement,r)}else this.domEditor.resetSelectDivPostion(),this.bridge.emit(a.cancelSelectElement,{status:!0})}keydownHandler(e){let t={},n=this.config.action,o=(e.ctrlKey||e.metaKey?"cmd+":"")+e.key;"cmd+-"!==o&&"cmd+="!==o&&"Escape"!==o||(!0===n.KEY_DOWN.preventDefault&&e.preventDefault(),n.KEY_DOWN.eventValues&&m.isArray(n.KEY_DOWN.eventValues)&&m.each(n.KEY_DOWN.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.keydownEvent,t))}mouseupHandler(e){let t={},n=this.config.action;n.MOUSE_UP&&(!0===n.MOUSE_UP.preventDefault&&e.preventDefault(),n.MOUSE_UP.eventValues&&m.isArray(n.MOUSE_UP.eventValues)&&m.each(n.MOUSE_UP.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.mouseupEvent,t))}wheelHandler(e){let t={},n=this.config.action;n.WHEEL_EVENT&&(!0===n.WHEEL_EVENT.preventDefault&&e.preventDefault(),n.WHEEL_EVENT.eventValues&&m.isArray(n.WHEEL_EVENT.eventValues)&&m.each(n.WHEEL_EVENT.eventValues,function(n){t[n]=e[n]}),this.bridge.emit(a.wheelEvent,t))}singlePage(e){if(e===location.href)return!1;let t=!0;_()||(t=!1,this.domEditor.mode_type="VIEW"),this.bridge.emit(a.checkUrl,{status:t?"SUCCESS":"ERROR"})}mutationObserver(){let e=this;m.each(e.domEditor.serverData,function(t){let n=e.domEditor.getOriginDataBySelector(t.selector);n.ele&&e.domEditor.editEleProps(t,n)})}}class A{constructor(e){this.config=e.config,this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null,this.mode_type="EDIT",this.serverData=[],this.originData=[],this.buildMarkDom()}setDomPostion(e,t){m.each(["width","height","left","top"],function(n){e.style[n]=t[n]+"px"})}setHoverElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,e)}setSelectElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,e)}restoreElements(){m.each(this.originData,function(e){R(e)}),this.originData=[]}editEleProps(e,t){let n=t.eleInfo;T(t.ele,e,n)}setMode(e){var t;this.mode_type=e,"VIEW"===e&&((t=this.maskDiv)&&t.parentNode.removeChild(t),this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null)}resetMarkDom(e){e&&this.setDomPostion(e,{width:0,height:0,top:0,left:0})}resetSelectDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,{width:0,height:0,top:0,left:0})}resetHoverDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,{width:0,height:0,top:0,left:0})}buildMarkDom(){var e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div"),o=document.createElement("style");e.className="sa-vabtest-mark",t.className="sa-vabtest-hover",n.className="sa-vabtest-clickable";var r=e.attachShadow({mode:"open"});o.innerText=".sa-vabtest-clickable { background: rgba(44, 123, 242, 0.2) !important; outline: 2px solid #2C7BF2 !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}.sa-vabtest-hover { outline: 2px solid #2C7BF2 !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}",r.appendChild(o),r.appendChild(t),r.appendChild(n),document.body.appendChild(e),function(e){var t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(n){t.styleSheet.cssText=e}document.getElementsByTagName("head")[0].appendChild(t)}(".sa-vabtest-mark { pointer-events: none;}.sa-vabtest-mark-hidden { display: none;}"),this.hoverDiv=t,this.selectDiv=n,this.maskDiv=e}saveServerData(e){this.serverData=e}updataServerData(e,t){let n=!1,o=this;m.each(this.serverData,function(r,i){r.selector===e&&(o.serverData[i]=t,n=!0)}),n||this.serverData.push(t)}getServerDataBySelector(e){let t=null;return m.each(this.serverData,function(n){n.selector===e&&(t=n)}),t}setOriginData(e,t){let n=!1,o=this;m.each(this.originData,function(t,r){e===t.selector&&(o.originData[r]=t,n=!0)}),n||this.originData.push(t)}getOriginDataBySelector(e){let t=null;if(m.each(this.originData,function(n){e===n.eleInfo.selector&&(t=n)}),!t){let n=N(e);n?(t=L(n,this.config.styles),this.setOriginData(t.eleInfo.selector,t)):t={}}return t}getOriginDataByElement(e){let t=null;return m.each(this.originData,function(n){e===n.ele&&(t=n)}),t||(t=L(e,this.config.styles),this.setOriginData(t.eleInfo.selector,t)),t}}class H{constructor(){this.plugin_name="VABTest",this.plugin_version="1.25.10",this.abTestingSDK=null,this.bridge=new d({source:"sa-web-abtesting-sdk",frameSource:"sa-fe-abtesting-mode",version:"abtest_version"})}init(e,t){this.abTestingSDK=t.SensorsABTest;let n=this;if(e&&this.abTestingSDK){m.log=e.log,this.bridge.emit(a.connect,{status:!0}).then(function(e){if("SUCCESS"===e.status){let t=e.payload.support;n.domEditor=new A({config:t}),n.sender=new k({bridge:n.bridge,domEditor:n.domEditor}),new x({bridge:n.bridge,domEditor:n.domEditor}),n.sender.init(t)}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")})}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")}}let I=new H;I.__constructor__=H,window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.VABTest=window.SensorsDataWebJSSDKPlugin.VABTest||I:window.SensorsDataWebJSSDKPlugin={VABTest:I}}); \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.closure.js b/dist/web/plugin/aes-encryption/index.closure.js index 748d367b..a2ae1450 100644 --- a/dist/web/plugin/aes-encryption/index.closure.js +++ b/dist/web/plugin/aes-encryption/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.25.9",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],E=u[0],b=u[1],D=u[2],M=u[3];E=r(E,b,D,M,f,7,h[0]),M=r(M,E,b,D,d,12,h[1]),D=r(D,M,E,b,p,17,h[2]),b=r(b,D,M,E,l,22,h[3]),E=r(E,b,D,M,y,7,h[4]),M=r(M,E,b,D,v,12,h[5]),D=r(D,M,E,b,g,17,h[6]),b=r(b,D,M,E,_,22,h[7]),E=r(E,b,D,M,k,7,h[8]),M=r(M,E,b,D,m,12,h[9]),D=r(D,M,E,b,S,17,h[10]),b=r(b,D,M,E,B,22,h[11]),E=r(E,b,D,M,w,7,h[12]),M=r(M,E,b,D,x,12,h[13]),D=r(D,M,E,b,C,17,h[14]),b=r(b,D,M,E,z,22,h[15]),E=n(E,b,D,M,d,5,h[16]),M=n(M,E,b,D,g,9,h[17]),D=n(D,M,E,b,B,14,h[18]),b=n(b,D,M,E,f,20,h[19]),E=n(E,b,D,M,v,5,h[20]),M=n(M,E,b,D,S,9,h[21]),D=n(D,M,E,b,z,14,h[22]),b=n(b,D,M,E,y,20,h[23]),E=n(E,b,D,M,m,5,h[24]),M=n(M,E,b,D,C,9,h[25]),D=n(D,M,E,b,l,14,h[26]),b=n(b,D,M,E,k,20,h[27]),E=n(E,b,D,M,x,5,h[28]),M=n(M,E,b,D,p,9,h[29]),D=n(D,M,E,b,_,14,h[30]),b=n(b,D,M,E,w,20,h[31]),E=i(E,b,D,M,v,4,h[32]),M=i(M,E,b,D,k,11,h[33]),D=i(D,M,E,b,B,16,h[34]),b=i(b,D,M,E,C,23,h[35]),E=i(E,b,D,M,d,4,h[36]),M=i(M,E,b,D,y,11,h[37]),D=i(D,M,E,b,_,16,h[38]),b=i(b,D,M,E,S,23,h[39]),E=i(E,b,D,M,x,4,h[40]),M=i(M,E,b,D,f,11,h[41]),D=i(D,M,E,b,l,16,h[42]),b=i(b,D,M,E,g,23,h[43]),E=i(E,b,D,M,m,4,h[44]),M=i(M,E,b,D,w,11,h[45]),D=i(D,M,E,b,z,16,h[46]),b=i(b,D,M,E,p,23,h[47]),E=o(E,b,D,M,f,6,h[48]),M=o(M,E,b,D,_,10,h[49]),D=o(D,M,E,b,C,15,h[50]),b=o(b,D,M,E,v,21,h[51]),E=o(E,b,D,M,w,6,h[52]),M=o(M,E,b,D,l,10,h[53]),D=o(D,M,E,b,S,15,h[54]),b=o(b,D,M,E,d,21,h[55]),E=o(E,b,D,M,k,6,h[56]),M=o(M,E,b,D,z,10,h[57]),D=o(D,M,E,b,g,15,h[58]),b=o(b,D,M,E,x,21,h[59]),E=o(E,b,D,M,y,6,h[60]),M=o(M,E,b,D,B,10,h[61]),D=o(D,M,E,b,p,15,h[62]),b=o(b,D,M,E,m,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+b|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file +!function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.25.10",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],E=u[0],b=u[1],D=u[2],M=u[3];E=r(E,b,D,M,f,7,h[0]),M=r(M,E,b,D,d,12,h[1]),D=r(D,M,E,b,p,17,h[2]),b=r(b,D,M,E,l,22,h[3]),E=r(E,b,D,M,y,7,h[4]),M=r(M,E,b,D,v,12,h[5]),D=r(D,M,E,b,g,17,h[6]),b=r(b,D,M,E,_,22,h[7]),E=r(E,b,D,M,k,7,h[8]),M=r(M,E,b,D,m,12,h[9]),D=r(D,M,E,b,S,17,h[10]),b=r(b,D,M,E,B,22,h[11]),E=r(E,b,D,M,w,7,h[12]),M=r(M,E,b,D,x,12,h[13]),D=r(D,M,E,b,C,17,h[14]),b=r(b,D,M,E,z,22,h[15]),E=n(E,b,D,M,d,5,h[16]),M=n(M,E,b,D,g,9,h[17]),D=n(D,M,E,b,B,14,h[18]),b=n(b,D,M,E,f,20,h[19]),E=n(E,b,D,M,v,5,h[20]),M=n(M,E,b,D,S,9,h[21]),D=n(D,M,E,b,z,14,h[22]),b=n(b,D,M,E,y,20,h[23]),E=n(E,b,D,M,m,5,h[24]),M=n(M,E,b,D,C,9,h[25]),D=n(D,M,E,b,l,14,h[26]),b=n(b,D,M,E,k,20,h[27]),E=n(E,b,D,M,x,5,h[28]),M=n(M,E,b,D,p,9,h[29]),D=n(D,M,E,b,_,14,h[30]),b=n(b,D,M,E,w,20,h[31]),E=i(E,b,D,M,v,4,h[32]),M=i(M,E,b,D,k,11,h[33]),D=i(D,M,E,b,B,16,h[34]),b=i(b,D,M,E,C,23,h[35]),E=i(E,b,D,M,d,4,h[36]),M=i(M,E,b,D,y,11,h[37]),D=i(D,M,E,b,_,16,h[38]),b=i(b,D,M,E,S,23,h[39]),E=i(E,b,D,M,x,4,h[40]),M=i(M,E,b,D,f,11,h[41]),D=i(D,M,E,b,l,16,h[42]),b=i(b,D,M,E,g,23,h[43]),E=i(E,b,D,M,m,4,h[44]),M=i(M,E,b,D,w,11,h[45]),D=i(D,M,E,b,z,16,h[46]),b=i(b,D,M,E,p,23,h[47]),E=o(E,b,D,M,f,6,h[48]),M=o(M,E,b,D,_,10,h[49]),D=o(D,M,E,b,C,15,h[50]),b=o(b,D,M,E,v,21,h[51]),E=o(E,b,D,M,w,6,h[52]),M=o(M,E,b,D,l,10,h[53]),D=o(D,M,E,b,S,15,h[54]),b=o(b,D,M,E,d,21,h[55]),E=o(E,b,D,M,k,6,h[56]),M=o(M,E,b,D,z,10,h[57]),D=o(D,M,E,b,g,15,h[58]),b=o(b,D,M,E,x,21,h[59]),E=o(E,b,D,M,y,6,h[60]),M=o(M,E,b,D,B,10,h[61]),D=o(D,M,E,b,p,15,h[62]),b=o(b,D,M,E,m,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+b|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.es6.js b/dist/web/plugin/aes-encryption/index.es6.js index c2e6826a..ab42df1e 100644 --- a/dist/web/plugin/aes-encryption/index.es6.js +++ b/dist/web/plugin/aes-encryption/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var n=t.init;t.init=function(i,o){if(wrapLogFn(i,t,e),i.readyState&&i.readyState.state>=3||!i.on)return c();function c(){n.call(t,i,o)}i.on(r,c)}}return t}function wrapLogFn(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}var root={};function isObject(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}!function(t,e){var r;t.CryptoJS=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(y){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(y){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},c=o.lib={},a=c.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},p=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},h=c.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,u=o/a,f=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*c,p=t.min(4*f,o);if(f){for(var d=0;d>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,c=t[e+0],s=t[e+1],h=t[e+2],l=t[e+3],y=t[e+4],g=t[e+5],_=t[e+6],v=t[e+7],k=t[e+8],S=t[e+9],m=t[e+10],B=t[e+11],w=t[e+12],C=t[e+13],x=t[e+14],E=t[e+15],D=o[0],b=o[1],z=o[2],A=o[3];D=u(D,b,z,A,c,7,a[0]),A=u(A,D,b,z,s,12,a[1]),z=u(z,A,D,b,h,17,a[2]),b=u(b,z,A,D,l,22,a[3]),D=u(D,b,z,A,y,7,a[4]),A=u(A,D,b,z,g,12,a[5]),z=u(z,A,D,b,_,17,a[6]),b=u(b,z,A,D,v,22,a[7]),D=u(D,b,z,A,k,7,a[8]),A=u(A,D,b,z,S,12,a[9]),z=u(z,A,D,b,m,17,a[10]),b=u(b,z,A,D,B,22,a[11]),D=u(D,b,z,A,w,7,a[12]),A=u(A,D,b,z,C,12,a[13]),z=u(z,A,D,b,x,17,a[14]),D=f(D,b=u(b,z,A,D,E,22,a[15]),z,A,s,5,a[16]),A=f(A,D,b,z,_,9,a[17]),z=f(z,A,D,b,B,14,a[18]),b=f(b,z,A,D,c,20,a[19]),D=f(D,b,z,A,g,5,a[20]),A=f(A,D,b,z,m,9,a[21]),z=f(z,A,D,b,E,14,a[22]),b=f(b,z,A,D,y,20,a[23]),D=f(D,b,z,A,S,5,a[24]),A=f(A,D,b,z,x,9,a[25]),z=f(z,A,D,b,l,14,a[26]),b=f(b,z,A,D,k,20,a[27]),D=f(D,b,z,A,C,5,a[28]),A=f(A,D,b,z,h,9,a[29]),z=f(z,A,D,b,v,14,a[30]),D=p(D,b=f(b,z,A,D,w,20,a[31]),z,A,g,4,a[32]),A=p(A,D,b,z,k,11,a[33]),z=p(z,A,D,b,B,16,a[34]),b=p(b,z,A,D,x,23,a[35]),D=p(D,b,z,A,s,4,a[36]),A=p(A,D,b,z,y,11,a[37]),z=p(z,A,D,b,v,16,a[38]),b=p(b,z,A,D,m,23,a[39]),D=p(D,b,z,A,C,4,a[40]),A=p(A,D,b,z,c,11,a[41]),z=p(z,A,D,b,l,16,a[42]),b=p(b,z,A,D,_,23,a[43]),D=p(D,b,z,A,S,4,a[44]),A=p(A,D,b,z,w,11,a[45]),z=p(z,A,D,b,E,16,a[46]),D=d(D,b=p(b,z,A,D,h,23,a[47]),z,A,c,6,a[48]),A=d(A,D,b,z,v,10,a[49]),z=d(z,A,D,b,x,15,a[50]),b=d(b,z,A,D,g,21,a[51]),D=d(D,b,z,A,w,6,a[52]),A=d(A,D,b,z,l,10,a[53]),z=d(z,A,D,b,m,15,a[54]),b=d(b,z,A,D,s,21,a[55]),D=d(D,b,z,A,k,6,a[56]),A=d(A,D,b,z,E,10,a[57]),z=d(z,A,D,b,_,15,a[58]),b=d(b,z,A,D,C,21,a[59]),D=d(D,b,z,A,y,6,a[60]),A=d(A,D,b,z,B,10,a[61]),z=d(z,A,D,b,h,15,a[62]),b=d(b,z,A,D,S,21,a[63]),o[0]=o[0]+D|0,o[1]=o[1]+b|0,o[2]=o[2]+z|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),c=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,i,o,c){var a=t+(e&r|~e&n)+i+c;return(a<>>32-o)+e}function f(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function p(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function d(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s)}(Math),r.MD5}(root),function(t,e,r){var n,i,o,c,a,s,u,f;n=t.CryptoJS,o=(i=n).lib,c=o.Base,a=o.WordArray,s=i.algo,u=s.MD5,f=s.EvpKDF=c.extend({cfg:c.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,s=n.keySize,u=n.iterations;c.length>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var s=n.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64}(root),function(t,e,r){var n,i,o,c,a,s,u,f,p,d,h,l,y,g,_,v,k,S,m,B,w,C,x,E;(n=t.CryptoJS).lib.Cipher||(c=(o=n).lib,a=c.Base,s=c.WordArray,u=c.BufferedBlockAlgorithm,(f=o.enc).Utf8,p=f.Base64,d=o.algo,h=d.EvpKDF,l=c.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:w}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),c.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),y=o.mode={},g=c.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),_=y.CBC=function(){var t=g.extend();function e(t,e,r){var n,o=this._iv;o?(n=o,this._iv=i):n=this._prevBlock;for(var c=0;c>>2];t.sigBytes-=e}},c.BlockCipher=l.extend({cfg:l.cfg.extend({mode:_,padding:k}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),S=c.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=o.format={},B=m.OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(e):e).toString(p)},parse:function(t){var e,r=p.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),S.create({ciphertext:r,salt:e})}},w=c.SerializableCipher=a.extend({cfg:a.extend({format:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return S.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),C=o.kdf={},x=C.OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=h.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,S.create({key:i,iv:o,salt:n})}},E=c.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:x}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=w.decrypt.call(this,t,e,i.key,n);return o}}))}(root),function(t,e,r){var n;n=t.CryptoJS,function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],o=[],c=[],a=[],s=[],u=[],f=[],p=[],d=[],h=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var l=n^n<<1^n<<2^n<<3^n<<4;l=l>>>8^255&l^99,i[r]=l,o[l]=r;var y=t[r],g=t[y],_=t[g],v=257*t[l]^16843008*l;c[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,s[r]=v<<8|v>>>24,u[r]=v,v=16843009*_^65537*g^257*y^16843008*r,f[l]=v<<24|v>>>8,p[l]=v<<16|v>>>16,d[l]=v<<8|v>>>24,h[l]=v,r?(r=y^t[t[t[_^y]]],n^=t[t[n]]):r=n=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],y=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],c=0;c6&&c%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=l[c/r|0]<<24),o[c]=o[c-r]^u);for(var a=this._invKeySchedule=[],s=0;s>>24]]^p[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,s,u,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,p,d,h,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],p=t[e+2]^r[2],d=t[e+3]^r[3],h=4,l=1;l>>24]^i[f>>>16&255]^o[p>>>8&255]^c[255&d]^r[h++],g=n[f>>>24]^i[p>>>16&255]^o[d>>>8&255]^c[255&u]^r[h++],_=n[p>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[h++],v=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&p]^r[h++];u=y,f=g,p=_,d=v}y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[f>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&p])^r[h++],t[e]=y,t[e+1]=g,t[e+2]=_,t[e+3]=v},keySize:8});t.AES=e._createHelper(y)}(),n.AES}(root);var getRandomBasic=function(){var t=(new Date).getTime();return function(e){return Math.ceil((t=(9301*t+49297)%233280)/233280*e)}}();function getRandom(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),isObject(t)&&t.getRandomValues){var e=new Uint32Array(1);return t.getRandomValues(e)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}var CryptoJS=root.CryptoJS;function buildAESOption(t){return{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:t||generateIVData()}}function encryptData(t,e,r,n){var i=buildAESOption(r),o=t;"string"!=typeof t&&(o=JSON.stringify(t)),n||(e=CryptoJS.enc.Base64.parse(e));var c=CryptoJS.enc.Utf8.parse(o),a=CryptoJS.AES.encrypt(c,e,i).toString();return i.iv.clone().concat(CryptoJS.enc.Base64.parse(a)).toString(CryptoJS.enc.Base64)}function decryptData(t,e,r){var n=CryptoJS.enc.Base64.parse(t).toString(),i=n.substr(0,32),o=CryptoJS.enc.Hex.parse(n.substr(32)).toString(CryptoJS.enc.Base64),c=buildAESOption(CryptoJS.enc.Hex.parse(i));return r||(e=CryptoJS.enc.Base64.parse(e)),CryptoJS.AES.decrypt(o,e,c).toString(CryptoJS.enc.Utf8)}function generateIVData(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*getRandom()).toString(16);e+=2===r.length?r:"0"+r}return CryptoJS.enc.Hex.parse(e)}var _iv,_sd,_config,_oldEncoder,_log=window.console&&window.console.log||function(){};function AesEncrypt(t){var e=encryptData(t,_config.k,_iv);return{key_id:_config.kid,key_hash:_config.khash,nc:1,payload:e}}function encodeTrackData(t){try{var e=AesEncrypt(t),r=JSON.stringify(e),n="crc="+_sd._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return _log("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),_oldEncoder.call(_sd.kit,t)}}function isTruthy(t,e){return!!t||(_log(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function matchType(t,e,r){return typeof t===r||(_log("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function doEnDecrypt(t,e,r,n){try{var i=r||_config&&_config.k;return isTruthy(i,"\u53c2\u6570key")&&matchType(i,"\u53c2\u6570key","string")?(n===undefined&&(n=r!==undefined),t?encryptData(e,i,null,n):decryptData(e,i,n)):e}catch(o){return _log("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var AesEncryption={init:function(t,e){_log=(_sd=t)&&_sd.log||_log,t&&t.kit&&t.kit.encodeTrackData?isTruthy(e,"\u521d\u59cb\u914d\u7f6econfig")&&isTruthy(e.k,"\u521d\u59cb\u53c2\u6570k")&&isTruthy(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&isTruthy(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&matchType(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&matchType(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&matchType(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_config=e,_iv=generateIVData(),_oldEncoder=_sd.kit.encodeTrackData,_sd.kit.encodeTrackData=encodeTrackData,_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25"):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return doEnDecrypt(!0,t,e,r)},decrypt:function(t,e,r){return doEnDecrypt(!1,t,e,r)}},index=createPlugin(AesEncryption,"AesEncryption","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var n=t.init;t.init=function(i,o){if(wrapLogFn(i,t,e),i.readyState&&i.readyState.state>=3||!i.on)return c();function c(){n.call(t,i,o)}i.on(r,c)}}return t}function wrapLogFn(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}var root={};function isObject(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}!function(t,e){var r;t.CryptoJS=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(y){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(y){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},c=o.lib={},a=c.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},p=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},h=c.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,u=o/a,f=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*c,p=t.min(4*f,o);if(f){for(var d=0;d>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,c=t[e+0],s=t[e+1],h=t[e+2],l=t[e+3],y=t[e+4],g=t[e+5],_=t[e+6],v=t[e+7],k=t[e+8],S=t[e+9],m=t[e+10],B=t[e+11],w=t[e+12],C=t[e+13],x=t[e+14],E=t[e+15],D=o[0],b=o[1],z=o[2],A=o[3];D=u(D,b,z,A,c,7,a[0]),A=u(A,D,b,z,s,12,a[1]),z=u(z,A,D,b,h,17,a[2]),b=u(b,z,A,D,l,22,a[3]),D=u(D,b,z,A,y,7,a[4]),A=u(A,D,b,z,g,12,a[5]),z=u(z,A,D,b,_,17,a[6]),b=u(b,z,A,D,v,22,a[7]),D=u(D,b,z,A,k,7,a[8]),A=u(A,D,b,z,S,12,a[9]),z=u(z,A,D,b,m,17,a[10]),b=u(b,z,A,D,B,22,a[11]),D=u(D,b,z,A,w,7,a[12]),A=u(A,D,b,z,C,12,a[13]),z=u(z,A,D,b,x,17,a[14]),D=f(D,b=u(b,z,A,D,E,22,a[15]),z,A,s,5,a[16]),A=f(A,D,b,z,_,9,a[17]),z=f(z,A,D,b,B,14,a[18]),b=f(b,z,A,D,c,20,a[19]),D=f(D,b,z,A,g,5,a[20]),A=f(A,D,b,z,m,9,a[21]),z=f(z,A,D,b,E,14,a[22]),b=f(b,z,A,D,y,20,a[23]),D=f(D,b,z,A,S,5,a[24]),A=f(A,D,b,z,x,9,a[25]),z=f(z,A,D,b,l,14,a[26]),b=f(b,z,A,D,k,20,a[27]),D=f(D,b,z,A,C,5,a[28]),A=f(A,D,b,z,h,9,a[29]),z=f(z,A,D,b,v,14,a[30]),D=p(D,b=f(b,z,A,D,w,20,a[31]),z,A,g,4,a[32]),A=p(A,D,b,z,k,11,a[33]),z=p(z,A,D,b,B,16,a[34]),b=p(b,z,A,D,x,23,a[35]),D=p(D,b,z,A,s,4,a[36]),A=p(A,D,b,z,y,11,a[37]),z=p(z,A,D,b,v,16,a[38]),b=p(b,z,A,D,m,23,a[39]),D=p(D,b,z,A,C,4,a[40]),A=p(A,D,b,z,c,11,a[41]),z=p(z,A,D,b,l,16,a[42]),b=p(b,z,A,D,_,23,a[43]),D=p(D,b,z,A,S,4,a[44]),A=p(A,D,b,z,w,11,a[45]),z=p(z,A,D,b,E,16,a[46]),D=d(D,b=p(b,z,A,D,h,23,a[47]),z,A,c,6,a[48]),A=d(A,D,b,z,v,10,a[49]),z=d(z,A,D,b,x,15,a[50]),b=d(b,z,A,D,g,21,a[51]),D=d(D,b,z,A,w,6,a[52]),A=d(A,D,b,z,l,10,a[53]),z=d(z,A,D,b,m,15,a[54]),b=d(b,z,A,D,s,21,a[55]),D=d(D,b,z,A,k,6,a[56]),A=d(A,D,b,z,E,10,a[57]),z=d(z,A,D,b,_,15,a[58]),b=d(b,z,A,D,C,21,a[59]),D=d(D,b,z,A,y,6,a[60]),A=d(A,D,b,z,B,10,a[61]),z=d(z,A,D,b,h,15,a[62]),b=d(b,z,A,D,S,21,a[63]),o[0]=o[0]+D|0,o[1]=o[1]+b|0,o[2]=o[2]+z|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),c=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,i,o,c){var a=t+(e&r|~e&n)+i+c;return(a<>>32-o)+e}function f(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function p(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function d(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s)}(Math),r.MD5}(root),function(t,e,r){var n,i,o,c,a,s,u,f;n=t.CryptoJS,o=(i=n).lib,c=o.Base,a=o.WordArray,s=i.algo,u=s.MD5,f=s.EvpKDF=c.extend({cfg:c.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,s=n.keySize,u=n.iterations;c.length>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var s=n.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64}(root),function(t,e,r){var n,i,o,c,a,s,u,f,p,d,h,l,y,g,_,v,k,S,m,B,w,C,x,E;(n=t.CryptoJS).lib.Cipher||(c=(o=n).lib,a=c.Base,s=c.WordArray,u=c.BufferedBlockAlgorithm,(f=o.enc).Utf8,p=f.Base64,d=o.algo,h=d.EvpKDF,l=c.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:w}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),c.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),y=o.mode={},g=c.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),_=y.CBC=function(){var t=g.extend();function e(t,e,r){var n,o=this._iv;o?(n=o,this._iv=i):n=this._prevBlock;for(var c=0;c>>2];t.sigBytes-=e}},c.BlockCipher=l.extend({cfg:l.cfg.extend({mode:_,padding:k}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),S=c.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=o.format={},B=m.OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(e):e).toString(p)},parse:function(t){var e,r=p.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),S.create({ciphertext:r,salt:e})}},w=c.SerializableCipher=a.extend({cfg:a.extend({format:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return S.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),C=o.kdf={},x=C.OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=h.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,S.create({key:i,iv:o,salt:n})}},E=c.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:x}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=w.decrypt.call(this,t,e,i.key,n);return o}}))}(root),function(t,e,r){var n;n=t.CryptoJS,function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],o=[],c=[],a=[],s=[],u=[],f=[],p=[],d=[],h=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var l=n^n<<1^n<<2^n<<3^n<<4;l=l>>>8^255&l^99,i[r]=l,o[l]=r;var y=t[r],g=t[y],_=t[g],v=257*t[l]^16843008*l;c[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,s[r]=v<<8|v>>>24,u[r]=v,v=16843009*_^65537*g^257*y^16843008*r,f[l]=v<<24|v>>>8,p[l]=v<<16|v>>>16,d[l]=v<<8|v>>>24,h[l]=v,r?(r=y^t[t[t[_^y]]],n^=t[t[n]]):r=n=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],y=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],c=0;c6&&c%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=l[c/r|0]<<24),o[c]=o[c-r]^u);for(var a=this._invKeySchedule=[],s=0;s>>24]]^p[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,s,u,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,p,d,h,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],p=t[e+2]^r[2],d=t[e+3]^r[3],h=4,l=1;l>>24]^i[f>>>16&255]^o[p>>>8&255]^c[255&d]^r[h++],g=n[f>>>24]^i[p>>>16&255]^o[d>>>8&255]^c[255&u]^r[h++],_=n[p>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[h++],v=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&p]^r[h++];u=y,f=g,p=_,d=v}y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[f>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&p])^r[h++],t[e]=y,t[e+1]=g,t[e+2]=_,t[e+3]=v},keySize:8});t.AES=e._createHelper(y)}(),n.AES}(root);var getRandomBasic=function(){var t=(new Date).getTime();return function(e){return Math.ceil((t=(9301*t+49297)%233280)/233280*e)}}();function getRandom(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),isObject(t)&&t.getRandomValues){var e=new Uint32Array(1);return t.getRandomValues(e)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}var CryptoJS=root.CryptoJS;function buildAESOption(t){return{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:t||generateIVData()}}function encryptData(t,e,r,n){var i=buildAESOption(r),o=t;"string"!=typeof t&&(o=JSON.stringify(t)),n||(e=CryptoJS.enc.Base64.parse(e));var c=CryptoJS.enc.Utf8.parse(o),a=CryptoJS.AES.encrypt(c,e,i).toString();return i.iv.clone().concat(CryptoJS.enc.Base64.parse(a)).toString(CryptoJS.enc.Base64)}function decryptData(t,e,r){var n=CryptoJS.enc.Base64.parse(t).toString(),i=n.substr(0,32),o=CryptoJS.enc.Hex.parse(n.substr(32)).toString(CryptoJS.enc.Base64),c=buildAESOption(CryptoJS.enc.Hex.parse(i));return r||(e=CryptoJS.enc.Base64.parse(e)),CryptoJS.AES.decrypt(o,e,c).toString(CryptoJS.enc.Utf8)}function generateIVData(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*getRandom()).toString(16);e+=2===r.length?r:"0"+r}return CryptoJS.enc.Hex.parse(e)}var _iv,_sd,_config,_oldEncoder,_log=window.console&&window.console.log||function(){};function AesEncrypt(t){var e=encryptData(t,_config.k,_iv);return{key_id:_config.kid,key_hash:_config.khash,nc:1,payload:e}}function encodeTrackData(t){try{var e=AesEncrypt(t),r=JSON.stringify(e),n="crc="+_sd._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return _log("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),_oldEncoder.call(_sd.kit,t)}}function isTruthy(t,e){return!!t||(_log(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function matchType(t,e,r){return typeof t===r||(_log("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function doEnDecrypt(t,e,r,n){try{var i=r||_config&&_config.k;return isTruthy(i,"\u53c2\u6570key")&&matchType(i,"\u53c2\u6570key","string")?(n===undefined&&(n=r!==undefined),t?encryptData(e,i,null,n):decryptData(e,i,n)):e}catch(o){return _log("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var AesEncryption={init:function(t,e){_log=(_sd=t)&&_sd.log||_log,t&&t.kit&&t.kit.encodeTrackData?isTruthy(e,"\u521d\u59cb\u914d\u7f6econfig")&&isTruthy(e.k,"\u521d\u59cb\u53c2\u6570k")&&isTruthy(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&isTruthy(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&matchType(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&matchType(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&matchType(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_config=e,_iv=generateIVData(),_oldEncoder=_sd.kit.encodeTrackData,_sd.kit.encodeTrackData=encodeTrackData,_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25"):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return doEnDecrypt(!0,t,e,r)},decrypt:function(t,e,r){return doEnDecrypt(!1,t,e,r)}},index=createPlugin(AesEncryption,"AesEncryption","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.js b/dist/web/plugin/aes-encryption/index.js index 0c6c7405..09d3122f 100644 --- a/dist/web/plugin/aes-encryption/index.js +++ b/dist/web/plugin/aes-encryption/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AesEncryption=function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.25.9",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],b=u[0],E=u[1],D=u[2],M=u[3];b=r(b,E,D,M,f,7,h[0]),M=r(M,b,E,D,d,12,h[1]),D=r(D,M,b,E,p,17,h[2]),E=r(E,D,M,b,l,22,h[3]),b=r(b,E,D,M,y,7,h[4]),M=r(M,b,E,D,v,12,h[5]),D=r(D,M,b,E,g,17,h[6]),E=r(E,D,M,b,_,22,h[7]),b=r(b,E,D,M,k,7,h[8]),M=r(M,b,E,D,m,12,h[9]),D=r(D,M,b,E,S,17,h[10]),E=r(E,D,M,b,B,22,h[11]),b=r(b,E,D,M,w,7,h[12]),M=r(M,b,E,D,x,12,h[13]),D=r(D,M,b,E,C,17,h[14]),E=r(E,D,M,b,z,22,h[15]),b=n(b,E,D,M,d,5,h[16]),M=n(M,b,E,D,g,9,h[17]),D=n(D,M,b,E,B,14,h[18]),E=n(E,D,M,b,f,20,h[19]),b=n(b,E,D,M,v,5,h[20]),M=n(M,b,E,D,S,9,h[21]),D=n(D,M,b,E,z,14,h[22]),E=n(E,D,M,b,y,20,h[23]),b=n(b,E,D,M,m,5,h[24]),M=n(M,b,E,D,C,9,h[25]),D=n(D,M,b,E,l,14,h[26]),E=n(E,D,M,b,k,20,h[27]),b=n(b,E,D,M,x,5,h[28]),M=n(M,b,E,D,p,9,h[29]),D=n(D,M,b,E,_,14,h[30]),E=n(E,D,M,b,w,20,h[31]),b=i(b,E,D,M,v,4,h[32]),M=i(M,b,E,D,k,11,h[33]),D=i(D,M,b,E,B,16,h[34]),E=i(E,D,M,b,C,23,h[35]),b=i(b,E,D,M,d,4,h[36]),M=i(M,b,E,D,y,11,h[37]),D=i(D,M,b,E,_,16,h[38]),E=i(E,D,M,b,S,23,h[39]),b=i(b,E,D,M,x,4,h[40]),M=i(M,b,E,D,f,11,h[41]),D=i(D,M,b,E,l,16,h[42]),E=i(E,D,M,b,g,23,h[43]),b=i(b,E,D,M,m,4,h[44]),M=i(M,b,E,D,w,11,h[45]),D=i(D,M,b,E,z,16,h[46]),E=i(E,D,M,b,p,23,h[47]),b=o(b,E,D,M,f,6,h[48]),M=o(M,b,E,D,_,10,h[49]),D=o(D,M,b,E,C,15,h[50]),E=o(E,D,M,b,v,21,h[51]),b=o(b,E,D,M,w,6,h[52]),M=o(M,b,E,D,l,10,h[53]),D=o(D,M,b,E,S,15,h[54]),E=o(E,D,M,b,d,21,h[55]),b=o(b,E,D,M,k,6,h[56]),M=o(M,b,E,D,z,10,h[57]),D=o(D,M,b,E,g,15,h[58]),E=o(E,D,M,b,x,21,h[59]),b=o(b,E,D,M,y,6,h[60]),M=o(M,b,E,D,B,10,h[61]),D=o(D,M,b,E,p,15,h[62]),E=o(E,D,M,b,m,21,h[63]),u[0]=u[0]+b|0,u[1]=u[1]+E|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AesEncryption=function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.25.10",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],b=u[0],E=u[1],D=u[2],M=u[3];b=r(b,E,D,M,f,7,h[0]),M=r(M,b,E,D,d,12,h[1]),D=r(D,M,b,E,p,17,h[2]),E=r(E,D,M,b,l,22,h[3]),b=r(b,E,D,M,y,7,h[4]),M=r(M,b,E,D,v,12,h[5]),D=r(D,M,b,E,g,17,h[6]),E=r(E,D,M,b,_,22,h[7]),b=r(b,E,D,M,k,7,h[8]),M=r(M,b,E,D,m,12,h[9]),D=r(D,M,b,E,S,17,h[10]),E=r(E,D,M,b,B,22,h[11]),b=r(b,E,D,M,w,7,h[12]),M=r(M,b,E,D,x,12,h[13]),D=r(D,M,b,E,C,17,h[14]),E=r(E,D,M,b,z,22,h[15]),b=n(b,E,D,M,d,5,h[16]),M=n(M,b,E,D,g,9,h[17]),D=n(D,M,b,E,B,14,h[18]),E=n(E,D,M,b,f,20,h[19]),b=n(b,E,D,M,v,5,h[20]),M=n(M,b,E,D,S,9,h[21]),D=n(D,M,b,E,z,14,h[22]),E=n(E,D,M,b,y,20,h[23]),b=n(b,E,D,M,m,5,h[24]),M=n(M,b,E,D,C,9,h[25]),D=n(D,M,b,E,l,14,h[26]),E=n(E,D,M,b,k,20,h[27]),b=n(b,E,D,M,x,5,h[28]),M=n(M,b,E,D,p,9,h[29]),D=n(D,M,b,E,_,14,h[30]),E=n(E,D,M,b,w,20,h[31]),b=i(b,E,D,M,v,4,h[32]),M=i(M,b,E,D,k,11,h[33]),D=i(D,M,b,E,B,16,h[34]),E=i(E,D,M,b,C,23,h[35]),b=i(b,E,D,M,d,4,h[36]),M=i(M,b,E,D,y,11,h[37]),D=i(D,M,b,E,_,16,h[38]),E=i(E,D,M,b,S,23,h[39]),b=i(b,E,D,M,x,4,h[40]),M=i(M,b,E,D,f,11,h[41]),D=i(D,M,b,E,l,16,h[42]),E=i(E,D,M,b,g,23,h[43]),b=i(b,E,D,M,m,4,h[44]),M=i(M,b,E,D,w,11,h[45]),D=i(D,M,b,E,z,16,h[46]),E=i(E,D,M,b,p,23,h[47]),b=o(b,E,D,M,f,6,h[48]),M=o(M,b,E,D,_,10,h[49]),D=o(D,M,b,E,C,15,h[50]),E=o(E,D,M,b,v,21,h[51]),b=o(b,E,D,M,w,6,h[52]),M=o(M,b,E,D,l,10,h[53]),D=o(D,M,b,E,S,15,h[54]),E=o(E,D,M,b,d,21,h[55]),b=o(b,E,D,M,k,6,h[56]),M=o(M,b,E,D,z,10,h[57]),D=o(D,M,b,E,g,15,h[58]),E=o(E,D,M,b,x,21,h[59]),b=o(b,E,D,M,y,6,h[60]),M=o(M,b,E,D,B,10,h[61]),D=o(D,M,b,E,p,15,h[62]),E=o(E,D,M,b,m,21,h[63]),u[0]=u[0]+b|0,u[1]=u[1]+E|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.closure.js b/dist/web/plugin/ajax-sender/index.closure.js index f93bd03a..e30045a0 100644 --- a/dist/web/plugin/ajax-sender/index.closure.js +++ b/dist/web/plugin/ajax-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(o,i){function u(){a.call(n,o,i)}return r(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=c,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){if("ajax"===u.para.send_type){var e=n.server_url;n.data=u.kit.encodeTrackData(n.data),l.isArray(e)&&e.length?l.each(e,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof u.para.server_url&&""!==u.para.server_url?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function o(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,c="1.25.9",s={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,i()}},f=e(s);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=c,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,c="1.25.10",s={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},f=e(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.es6.js b/dist/web/plugin/ajax-sender/index.es6.js index 93760a3c..d3239d08 100644 --- a/dist/web/plugin/ajax-sender/index.es6.js +++ b/dist/web/plugin/ajax-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(t,i){if(wrapLogFn(t,n,e),t.readyState&&t.readyState.state>=3||!t.on)return o();function o(){a.call(n,t,i)}t.on(r,o)}}return n}function wrapLogFn(n,e,r){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(r+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.AjaxSend(n).start()}function sendInterceptor(n,e){if("ajax"===sd.para.send_type){var r=n.server_url;n.data=sd.kit.encodeTrackData(n.data),_.isArray(r)&&r.length?_.each(r,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof sd.para.server_url&&""!==sd.para.server_url?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"ajax"!==sd.para.send_type||_.isSupportCors()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor}})})}var AjaxSender={plugin_name:"AjaxSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(AjaxSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.AjaxSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("ajax"===r||!r&&"ajax"===sd.para.send_type)&&_.isSupportCors()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"ajax"!==sd.para.send_type||_.isSupportCors()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor}})})}var AjaxSender={plugin_name:"AjaxSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(AjaxSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.js b/dist/web/plugin/ajax-sender/index.js index ad896756..7615dfe0 100644 --- a/dist/web/plugin/ajax-sender/index.js +++ b/dist/web/plugin/ajax-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AjaxSender=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(o,i){function u(){a.call(n,o,i)}return r(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=s,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){if("ajax"===u.para.send_type){var e=n.server_url;n.data=u.kit.encodeTrackData(n.data),l.isArray(e)&&e.length?l.each(e,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof u.para.server_url&&""!==u.para.server_url?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function o(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,s="1.25.9",c={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,i()}},g=e(c);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AjaxSender=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=s,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,s="1.25.10",c={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},g=e(c);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/amp/index.closure.js b/dist/web/plugin/amp/index.closure.js index 82d5fb07..e26f6d01 100644 --- a/dist/web/plugin/amp/index.closure.js +++ b/dist/web/plugin/amp/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,d){function o(){e.call(t,r,d)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(s,o)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.25.9",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file +!function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,d){function o(){e.call(t,r,d)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(s,o)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.25.10",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file diff --git a/dist/web/plugin/amp/index.es6.js b/dist/web/plugin/amp/index.es6.js index feb4292a..d4fd4c1b 100644 --- a/dist/web/plugin/amp/index.es6.js +++ b/dist/web/plugin/amp/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var e=i.init;i.init=function(s,r){if(wrapLogFn(s,i,t),s.readyState&&s.readyState.state>=3||!s.on)return d();function d(){e.call(i,s,r)}s.on(n,d)}}return i}function wrapLogFn(i,t,n){function e(t,e){i.logger?i.logger.msg.apply(i.logger,e).module(n+""||"").level(t).log():i.log&&i.log.apply(i,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function createPlugin(i,t,n){return wrapPluginInitFn(i,t,n),i.plugin_version=sdkversion_placeholder,i}var amp={sd:null,init:function(i){if(this.sd)return!1;if(this.sd=i,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(t&&t.length>0){var e="amp-"===t.slice(0,4);if(t!==n){if(!e)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(t,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var i=this;this.sd.events.on("changeDistinctId",function(t){i.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(i){this.sd._.cookie.set("sensors_amp_id",i)}},index=createPlugin(amp,"Amp","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var e=i.init;i.init=function(s,r){if(wrapLogFn(s,i,t),s.readyState&&s.readyState.state>=3||!s.on)return d();function d(){e.call(i,s,r)}s.on(n,d)}}return i}function wrapLogFn(i,t,n){function e(t,e){i.logger?i.logger.msg.apply(i.logger,e).module(n+""||"").level(t).log():i.log&&i.log.apply(i,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function createPlugin(i,t,n){return wrapPluginInitFn(i,t,n),i.plugin_version=sdkversion_placeholder,i}var amp={sd:null,init:function(i){if(this.sd)return!1;if(this.sd=i,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(t&&t.length>0){var e="amp-"===t.slice(0,4);if(t!==n){if(!e)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(t,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var i=this;this.sd.events.on("changeDistinctId",function(t){i.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(i){this.sd._.cookie.set("sensors_amp_id",i)}},index=createPlugin(amp,"Amp","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/amp/index.js b/dist/web/plugin/amp/index.js index fdcbecd9..7133a4d3 100644 --- a/dist/web/plugin/amp/index.js +++ b/dist/web/plugin/amp/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Amp=function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,o){function d(){e.call(t,r,o)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?d():void r.on(s,d)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.25.9",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Amp=function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,o){function d(){e.call(t,r,o)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?d():void r.on(s,d)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.25.10",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.closure.js b/dist/web/plugin/android-bridge/index.closure.js index 556022be..e7fde2b2 100644 --- a/dist/web/plugin/android-bridge/index.closure.js +++ b/dist/web/plugin/android-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e){return y&&y.call(f,JSON.stringify(e))}function a(e){return v.call(f)&&b&&b.call(f,JSON.stringify(e))}function r(e,a){return a&&"function"==typeof a[e.callType]&&a[e.callType]()}function i(e,a,r){if(a&&(e.plugin_name=a),r&&e.init){var i=e.init;e.init=function(t,s){function o(){i.call(e,t,s)}return n(t,e,a),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function n(e,a,r){function i(a,i){e.logger?e.logger.msg.apply(e.logger,i).module(r+""||"").level(a).log():e.log&&e.log.apply(e,i)}a.log=function(){i("log",arguments)},a.warn=function(){i("warn",arguments)},a.error=function(){i("error",arguments)}}function t(e,a,r){return i(e,a,r),e.plugin_version=w,e}function s(){if(l=window.SensorsData_APP_New_H5_Bridge,_=l&&l.sensorsdata_track,c=_&&l.sensorsdata_get_server_url&&l.sensorsdata_get_server_url(),u&&!u.bridge.activeBridge&&c){if(u.bridge.activeBridge=j,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=c&&u.bridge.validateAppUrl(c)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!l.sensorsdata_js_call_app},!u.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by android bridge.");u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}),g("Android bridge inits succeed.")}}function o(e,a){if(u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(_&&_.call(l,JSON.stringify(p.extend({server_url:u.para.server_url},e.data))),p.isFunction(r)&&r(),a.cancellationToken.cancel(),e):u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(p.isFunction(r)&&r(),a.cancellationToken.cancel(),e)}function d(e){var a=e.callType;return a in m.commands?m.commands[a](e,l):void(l&&p.isFunction(l.sensorsdata_js_call_app)&&l.sensorsdata_js_call_app(JSON.stringify(e)))}var l,_,c,u,p,g,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,y=f&&f.sensorsdata_visualized_alert_info,b=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:a,page_info:a,sensorsdata_get_app_visual_config:r}},w="1.25.9",j={init:function(e){u=e,p=u&&u._,g=u&&u.log||console&&console.log||function(){},s()},handleCommand:d},S=t(j,"AndroidBridge","sdkAfterInitPara");return S}(); \ No newline at end of file +!function(){"use strict";function e(e){return y&&y.call(f,JSON.stringify(e))}function a(e){return v.call(f)&&b&&b.call(f,JSON.stringify(e))}function r(e,a){return a&&"function"==typeof a[e.callType]&&a[e.callType]()}function i(e,a,r){if(a&&(e.plugin_name=a),r&&e.init){var i=e.init;e.init=function(t,s){function o(){i.call(e,t,s)}return n(t,e,a),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function n(e,a,r){function i(a,i){e.logger?e.logger.msg.apply(e.logger,i).module(r+""||"").level(a).log():e.log&&e.log.apply(e,i)}a.log=function(){i("log",arguments)},a.warn=function(){i("warn",arguments)},a.error=function(){i("error",arguments)}}function t(e,a,r){return i(e,a,r),e.plugin_version=w,e}function s(){if(l=window.SensorsData_APP_New_H5_Bridge,_=l&&l.sensorsdata_track,c=_&&l.sensorsdata_get_server_url&&l.sensorsdata_get_server_url(),u&&!u.bridge.activeBridge&&c){if(u.bridge.activeBridge=j,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=c&&u.bridge.validateAppUrl(c)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!l.sensorsdata_js_call_app},!u.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by android bridge.");u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}),g("Android bridge inits succeed.")}}function o(e,a){if(u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(_&&_.call(l,JSON.stringify(p.extend({server_url:u.para.server_url},e.data))),p.isFunction(r)&&r(),a.cancellationToken.cancel(),e):u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(p.isFunction(r)&&r(),a.cancellationToken.cancel(),e)}function d(e){var a=e.callType;return a in m.commands?m.commands[a](e,l):void(l&&p.isFunction(l.sensorsdata_js_call_app)&&l.sensorsdata_js_call_app(JSON.stringify(e)))}var l,_,c,u,p,g,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,y=f&&f.sensorsdata_visualized_alert_info,b=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:a,page_info:a,sensorsdata_get_app_visual_config:r}},w="1.25.10",j={init:function(e){u=e,p=u&&u._,g=u&&u.log||console&&console.log||function(){},s()},handleCommand:d},S=t(j,"AndroidBridge","sdkAfterInitPara");return S}(); \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.es6.js b/dist/web/plugin/android-bridge/index.es6.js index 52a03f1e..4e88c1b1 100644 --- a/dist/web/plugin/android-bridge/index.es6.js +++ b/dist/web/plugin/android-bridge/index.es6.js @@ -1 +1 @@ -var vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anServerUrl,sd,_,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return s();function s(){i.call(e,n,d)}n.on(a,s)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd&&!sd.bridge.activeBridge&&anServerUrl&&(sd.bridge.activeBridge=AndroidBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=anServerUrl&&sd.bridge.validateAppUrl(anServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return sd.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;if(r in vbridge$1.commands)return vbridge$1.commands[r](e,anBridge);anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index=createPlugin(AndroidBridge,"AndroidBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anServerUrl,sd,_,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return s();function s(){i.call(e,n,d)}n.on(a,s)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd&&!sd.bridge.activeBridge&&anServerUrl&&(sd.bridge.activeBridge=AndroidBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=anServerUrl&&sd.bridge.validateAppUrl(anServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return sd.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;if(r in vbridge$1.commands)return vbridge$1.commands[r](e,anBridge);anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index=createPlugin(AndroidBridge,"AndroidBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.js b/dist/web/plugin/android-bridge/index.js index 48d1f8ce..dbfe75e7 100644 --- a/dist/web/plugin/android-bridge/index.js +++ b/dist/web/plugin/android-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidBridge=function(){"use strict";function e(e){return b&&b.call(f,JSON.stringify(e))}function n(e){return v.call(f)&&y&&y.call(f,JSON.stringify(e))}function i(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,i){if(n&&(e.plugin_name=n),i&&e.init){var a=e.init;e.init=function(t,s){function o(){a.call(e,t,s)}return r(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(i,o)}}return e}function r(e,n,i){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,i){return a(e,n,i),e.plugin_version=w,e}function s(){if(l=window.SensorsData_APP_New_H5_Bridge,_=l&&l.sensorsdata_track,c=_&&l.sensorsdata_get_server_url&&l.sensorsdata_get_server_url(),u&&!u.bridge.activeBridge&&c){if(u.bridge.activeBridge=S,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=c&&u.bridge.validateAppUrl(c)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!l.sensorsdata_js_call_app},!u.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by android bridge.");u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}),g("Android bridge inits succeed.")}}function o(e,n){if(u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return u.bridge.is_verify_success?(_&&_.call(l,JSON.stringify(p.extend({server_url:u.para.server_url},e.data))),p.isFunction(i)&&i(),n.cancellationToken.cancel(),e):u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(p.isFunction(i)&&i(),n.cancellationToken.cancel(),e)}function d(e){var n=e.callType;return n in m.commands?m.commands[n](e,l):void(l&&p.isFunction(l.sensorsdata_js_call_app)&&l.sensorsdata_js_call_app(JSON.stringify(e)))}var l,_,c,u,p,g,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,b=f&&f.sensorsdata_visualized_alert_info,y=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:i}},w="1.25.9",S={init:function(e){u=e,p=u&&u._,g=u&&u.log||console&&console.log||function(){},s()},handleCommand:d},j=t(S,"AndroidBridge","sdkAfterInitPara");return j}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidBridge=function(){"use strict";function e(e){return b&&b.call(f,JSON.stringify(e))}function n(e){return v.call(f)&&y&&y.call(f,JSON.stringify(e))}function i(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,i){if(n&&(e.plugin_name=n),i&&e.init){var a=e.init;e.init=function(t,s){function o(){a.call(e,t,s)}return r(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(i,o)}}return e}function r(e,n,i){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,i){return a(e,n,i),e.plugin_version=w,e}function s(){if(l=window.SensorsData_APP_New_H5_Bridge,_=l&&l.sensorsdata_track,c=_&&l.sensorsdata_get_server_url&&l.sensorsdata_get_server_url(),u&&!u.bridge.activeBridge&&c){if(u.bridge.activeBridge=S,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=c&&u.bridge.validateAppUrl(c)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!l.sensorsdata_js_call_app},!u.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by android bridge.");u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}),g("Android bridge inits succeed.")}}function o(e,n){if(u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return u.bridge.is_verify_success?(_&&_.call(l,JSON.stringify(p.extend({server_url:u.para.server_url},e.data))),p.isFunction(i)&&i(),n.cancellationToken.cancel(),e):u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(p.isFunction(i)&&i(),n.cancellationToken.cancel(),e)}function d(e){var n=e.callType;return n in m.commands?m.commands[n](e,l):void(l&&p.isFunction(l.sensorsdata_js_call_app)&&l.sensorsdata_js_call_app(JSON.stringify(e)))}var l,_,c,u,p,g,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,b=f&&f.sensorsdata_visualized_alert_info,y=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:i}},w="1.25.10",S={init:function(e){u=e,p=u&&u._,g=u&&u.log||console&&console.log||function(){},s()},handleCommand:d},j=t(S,"AndroidBridge","sdkAfterInitPara");return j}(); \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.closure.js b/dist/web/plugin/android-obsolete-bridge/index.closure.js index 5cbd3490..4513fab4 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.closure.js +++ b/dist/web/plugin/android-obsolete-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e){return b&&b.call(v,JSON.stringify(e))}function n(e){return y.call(v)&&m&&m.call(v,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,o){function s(){a.call(e,t,o)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?s():void t.on(r,s)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=w,e}function o(){if(c=window.SensorsData_APP_JS_Bridge,d=c&&c.sensorsdata_track,u=c&&c.sensorsdata_verify,_=c&&c.sensorsdata_visual_verify,p&&!p.bridge.activeBridge&&(u||d||_)){p.bridge.activeBridge=k;var e=u||d;if(_&&(e=!!_.call(c,JSON.stringify({server_url:p.para.server_url}))),p.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!p.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");p.registerInterceptor("sendDataStage",{send:{priority:80,entry:s}}),f("Android obsolete bridge inits succeed.")}}function s(e,n){if(p.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(c,JSON.stringify(g.extend({server_url:p.para.server_url},e.data)));return a?(g.isFunction(r)&&r(),n.cancellationToken.cancel(),e):p.para.app_js_bridge.is_send?(p.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(g.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return d&&d.call(c,JSON.stringify(g.extend({server_url:p.para.server_url},e.data))),g.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){var n=e.callType;return n in S.commands?S.commands[n](e,c):c&&g.isFunction(c.sensorsdata_js_call_app)?c.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var c,d,u,_,p,g,f,v=window.SensorsData_App_Visual_Bridge,y=v&&v.sensorsdata_visualized_mode,b=v&&v.sensorsdata_visualized_alert_info,m=v&&v.sensorsdata_hover_web_nodes,S={isVerify:function(){return y&&(y===!0||y.call(v))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},w="1.25.9",k={init:function(e){p=e,g=p&&p._,f=p&&p.log||console&&console.log||function(){},o()},handleCommand:l},J=t(k,"AndroidObsoleteBridge","sdkAfterInitPara");return J}(); \ No newline at end of file +!function(){"use strict";function e(e){return b&&b.call(v,JSON.stringify(e))}function n(e){return y.call(v)&&m&&m.call(v,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,o){function s(){a.call(e,t,o)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?s():void t.on(r,s)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=w,e}function o(){if(c=window.SensorsData_APP_JS_Bridge,d=c&&c.sensorsdata_track,u=c&&c.sensorsdata_verify,_=c&&c.sensorsdata_visual_verify,p&&!p.bridge.activeBridge&&(u||d||_)){p.bridge.activeBridge=k;var e=u||d;if(_&&(e=!!_.call(c,JSON.stringify({server_url:p.para.server_url}))),p.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!p.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");p.registerInterceptor("sendDataStage",{send:{priority:80,entry:s}}),f("Android obsolete bridge inits succeed.")}}function s(e,n){if(p.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(c,JSON.stringify(g.extend({server_url:p.para.server_url},e.data)));return a?(g.isFunction(r)&&r(),n.cancellationToken.cancel(),e):p.para.app_js_bridge.is_send?(p.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(g.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return d&&d.call(c,JSON.stringify(g.extend({server_url:p.para.server_url},e.data))),g.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){var n=e.callType;return n in S.commands?S.commands[n](e,c):c&&g.isFunction(c.sensorsdata_js_call_app)?c.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var c,d,u,_,p,g,f,v=window.SensorsData_App_Visual_Bridge,y=v&&v.sensorsdata_visualized_mode,b=v&&v.sensorsdata_visualized_alert_info,m=v&&v.sensorsdata_hover_web_nodes,S={isVerify:function(){return y&&(y===!0||y.call(v))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},w="1.25.10",k={init:function(e){p=e,g=p&&p._,f=p&&p.log||console&&console.log||function(){},o()},handleCommand:l},J=t(k,"AndroidObsoleteBridge","sdkAfterInitPara");return J}(); \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.es6.js b/dist/web/plugin/android-obsolete-bridge/index.es6.js index 9e59be1e..4e9b7ae5 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.es6.js +++ b/dist/web/plugin/android-obsolete-bridge/index.es6.js @@ -1 +1 @@ -var vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anVerify,anVisualVerify,sd,_,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(i,d){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){n.call(e,i,d)}i.on(a,o)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){if(anBridge=window.SensorsData_APP_JS_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anVerify=anBridge&&anBridge.sensorsdata_verify,anVisualVerify=anBridge&&anBridge.sensorsdata_visual_verify,sd&&!sd.bridge.activeBridge&&(anVerify||anTrack||anVisualVerify)){sd.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack;anVisualVerify&&(e=!!anVisualVerify.call(anBridge,JSON.stringify({server_url:sd.para.server_url}))),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData}}),log("Android obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return anVerify?anVerify&&anVerify.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data)))?(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):(anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return r in vbridge$1.commands?vbridge$1.commands[r](e,anBridge):anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)?anBridge.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var index=createPlugin(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anVerify,anVisualVerify,sd,_,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(i,d){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){n.call(e,i,d)}i.on(a,o)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){if(anBridge=window.SensorsData_APP_JS_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anVerify=anBridge&&anBridge.sensorsdata_verify,anVisualVerify=anBridge&&anBridge.sensorsdata_visual_verify,sd&&!sd.bridge.activeBridge&&(anVerify||anTrack||anVisualVerify)){sd.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack;anVisualVerify&&(e=!!anVisualVerify.call(anBridge,JSON.stringify({server_url:sd.para.server_url}))),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData}}),log("Android obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return anVerify?anVerify&&anVerify.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data)))?(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):(anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return r in vbridge$1.commands?vbridge$1.commands[r](e,anBridge):anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)?anBridge.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var index=createPlugin(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.js b/dist/web/plugin/android-obsolete-bridge/index.js index 48180567..2dde9bf7 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.js +++ b/dist/web/plugin/android-obsolete-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidObsoleteBridge=function(){"use strict";function e(e){return b&&b.call(v,JSON.stringify(e))}function n(e){return y.call(v)&&S&&S.call(v,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,o){function s(){a.call(e,t,o)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?s():void t.on(r,s)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=w,e}function o(){if(d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,_=d&&d.sensorsdata_visual_verify,g&&!g.bridge.activeBridge&&(u||c||_)){g.bridge.activeBridge=J;var e=u||c;if(_&&(e=!!_.call(d,JSON.stringify({server_url:g.para.server_url}))),g.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!g.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");g.registerInterceptor("sendDataStage",{send:{priority:80,entry:s}}),f("Android obsolete bridge inits succeed.")}}function s(e,n){if(g.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data)));return a?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):g.para.app_js_bridge.is_send?(g.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return c&&c.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){var n=e.callType;return n in m.commands?m.commands[n](e,d):d&&p.isFunction(d.sensorsdata_js_call_app)?d.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var d,c,u,_,g,p,f,v=window.SensorsData_App_Visual_Bridge,y=v&&v.sensorsdata_visualized_mode,b=v&&v.sensorsdata_visualized_alert_info,S=v&&v.sensorsdata_hover_web_nodes,m={isVerify:function(){return y&&(y===!0||y.call(v))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},w="1.25.9",J={init:function(e){g=e,p=g&&g._,f=g&&g.log||console&&console.log||function(){},o()},handleCommand:l},O=t(J,"AndroidObsoleteBridge","sdkAfterInitPara");return O}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidObsoleteBridge=function(){"use strict";function e(e){return b&&b.call(v,JSON.stringify(e))}function n(e){return y.call(v)&&S&&S.call(v,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,o){function s(){a.call(e,t,o)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?s():void t.on(r,s)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=w,e}function o(){if(d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,_=d&&d.sensorsdata_visual_verify,g&&!g.bridge.activeBridge&&(u||c||_)){g.bridge.activeBridge=J;var e=u||c;if(_&&(e=!!_.call(d,JSON.stringify({server_url:g.para.server_url}))),g.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!g.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");g.registerInterceptor("sendDataStage",{send:{priority:80,entry:s}}),f("Android obsolete bridge inits succeed.")}}function s(e,n){if(g.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data)));return a?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):g.para.app_js_bridge.is_send?(g.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return c&&c.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){var n=e.callType;return n in m.commands?m.commands[n](e,d):d&&p.isFunction(d.sensorsdata_js_call_app)?d.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var d,c,u,_,g,p,f,v=window.SensorsData_App_Visual_Bridge,y=v&&v.sensorsdata_visualized_mode,b=v&&v.sensorsdata_visualized_alert_info,S=v&&v.sensorsdata_hover_web_nodes,m={isVerify:function(){return y&&(y===!0||y.call(v))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},w="1.25.10",J={init:function(e){g=e,p=g&&g._,f=g&&g.log||console&&console.log||function(){},o()},handleCommand:l},O=t(J,"AndroidObsoleteBridge","sdkAfterInitPara");return O}(); \ No newline at end of file diff --git a/dist/web/plugin/batch-sender/index.closure.js b/dist/web/plugin/batch-sender/index.closure.js index 619e2bc8..494105e1 100644 --- a/dist/web/plugin/batch-sender/index.closure.js +++ b/dist/web/plugin/batch-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(o,i){function c(){r.call(n,o,i)}return t(o,n,a),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!r.on)return i();function i(){e.call(n,r,o)}r.on(t,i)}}return n}function wrapLogFn(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function createPlugin(n,a,t){return wrapPluginInitFn(n,a,t),n.plugin_version=sdkversion_placeholder,n}var batchInstance=null;function sendData(n,a){return!sd.para.app_js_bridge&&sd.para.batch_send&&_.localStorage.isSupport()&&localStorage.length=3||!r.on)return i();function i(){e.call(n,r,o)}r.on(t,i)}}return n}function wrapLogFn(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function createPlugin(n,a,t){return wrapPluginInitFn(n,a,t),n.plugin_version=sdkversion_placeholder,n}var batchInstance=null;function sendData(n,a){return!sd.para.app_js_bridge&&sd.para.batch_send&&_.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!o.on?u():void o.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=l,r}function t(n){var r=new c.BeaconSend(n);r.start()}function a(n,r){if("beacon"===u.para.send_type){var e=n.server_url;n.data=u.kit.encodeTrackData(n.data),c.isArray(e)&&e.length?c.each(e,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof u.para.server_url&&""!==u.para.server_url?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function o(){"beacon"!==u.para.send_type||c.isSupportBeaconSend()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:110,entry:a}})})}var u,c,l="1.25.9",s={plugin_name:"BeaconSender",init:function(n){u=n,c=u._,i()}},f=e(s);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var o=n.init;n.init=function(a,i){function c(){o.call(n,a,i)}return e(a,n,r),a.readyState&&a.readyState.state>=3||!a.on?c():void a.on(t,c)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new u.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;u.isObject(n.config)&&(r=n.config.send_type,o=u.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===c.para.send_type;if(a&&u.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=c.kit.encodeTrackData(n.data),u.isArray(i)&&i.length?u.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==c.para.send_type||u.isSupportBeaconSend()||(c.para.send_type="image")}function i(){c.on("sdkInitPara",function(){a()}),c.on("sdkAfterInitPara",function(){c.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var c,u,l="1.25.10",s={plugin_name:"BeaconSender",init:function(n){c=n,u=c._,i()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/beacon-sender/index.es6.js b/dist/web/plugin/beacon-sender/index.es6.js index 02d34703..1397cf2e 100644 --- a/dist/web/plugin/beacon-sender/index.es6.js +++ b/dist/web/plugin/beacon-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(t,i){if(wrapLogFn(t,n,e),t.readyState&&t.readyState.state>=3||!t.on)return o();function o(){a.call(n,t,i)}t.on(r,o)}}return n}function wrapLogFn(n,e,r){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(r+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.BeaconSend(n).start()}function sendInterceptor(n,e){if("beacon"===sd.para.send_type){var r=n.server_url;n.data=sd.kit.encodeTrackData(n.data),_.isArray(r)&&r.length?_.each(r,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof sd.para.server_url&&""!==sd.para.server_url?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"beacon"!==sd.para.send_type||_.isSupportBeaconSend()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var BeaconSender={plugin_name:"BeaconSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(BeaconSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.BeaconSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("beacon"===r||!r&&"beacon"===sd.para.send_type)&&_.isSupportBeaconSend()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"beacon"!==sd.para.send_type||_.isSupportBeaconSend()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var BeaconSender={plugin_name:"BeaconSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(BeaconSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/beacon-sender/index.js b/dist/web/plugin/beacon-sender/index.js index 897f9b3a..ef408d55 100644 --- a/dist/web/plugin/beacon-sender/index.js +++ b/dist/web/plugin/beacon-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).BeaconSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(o,i){function u(){a.call(n,o,i)}return e(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(t,u)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new c.BeaconSend(n);e.start()}function a(n,e){if("beacon"===u.para.send_type){var r=n.server_url;n.data=u.kit.encodeTrackData(n.data),c.isArray(r)&&r.length?c.each(r,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof u.para.server_url&&""!==u.para.server_url?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function o(){"beacon"!==u.para.send_type||c.isSupportBeaconSend()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:110,entry:a}})})}var u,c,l="1.25.9",s={plugin_name:"BeaconSender",init:function(n){u=n,c=u._,i()}},g=r(s);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).BeaconSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var o=n.init;n.init=function(a,i){function u(){o.call(n,a,i)}return e(a,n,r),a.readyState&&a.readyState.state>=3||!a.on?u():void a.on(t,u)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new c.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;c.isObject(n.config)&&(r=n.config.send_type,o=c.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===u.para.send_type;if(a&&c.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=u.kit.encodeTrackData(n.data),c.isArray(i)&&i.length?c.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==u.para.send_type||c.isSupportBeaconSend()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){a()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var u,c,l="1.25.10",s={plugin_name:"BeaconSender",init:function(n){u=n,c=u._,i()}},g=r(s);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.closure.js b/dist/web/plugin/channel-utm/index.closure.js index 48159ae3..7e3d3006 100644 --- a/dist/web/plugin/channel-utm/index.closure.js +++ b/dist/web/plugin/channel-utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,r){return n(t,e,r),t.plugin_version=a,t}var r,a="1.25.9",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var t=!1,e=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(t=!0,e[n.slice(8)]=a)}),t&&r.register&&r.register({link_v:"1"}),e}}}))}},u=e(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file +!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,r){return n(t,e,r),t.plugin_version=a,t}var r,a="1.25.10",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var t=!1,e=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(t=!0,e[n.slice(8)]=a)}),t&&r.register&&r.register({link_v:"1"}),e}}}))}},u=e(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.es6.js b/dist/web/plugin/channel-utm/index.es6.js index 6ca337bb..1bd5b17e 100644 --- a/dist/web/plugin/channel-utm/index.es6.js +++ b/dist/web/plugin/channel-utm/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}var sd,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(n){n&&!sd&&((sd=n)._.each(utmKeys,function(n){sd.source_channel_standard=sd.source_channel_standard+" "+n,sd.para.source_type.utm.push(n)}),sd.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return sd._.each(utmKeys,function(n){var r=sd._.getQueryParam(location.href,n);r.length&&(e=!0,t[n.slice(8)]=r)}),e&&sd.register&&sd.register({link_v:"1"}),t}}}))}},index=createPlugin(ChannelUtm,"ChannelUtm","sdkAfterInitPara");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}var sd,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(n){n&&!sd&&((sd=n)._.each(utmKeys,function(n){sd.source_channel_standard=sd.source_channel_standard+" "+n,sd.para.source_type.utm.push(n)}),sd.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return sd._.each(utmKeys,function(n){var r=sd._.getQueryParam(location.href,n);r.length&&(e=!0,t[n.slice(8)]=r)}),e&&sd.register&&sd.register({link_v:"1"}),t}}}))}},index=createPlugin(ChannelUtm,"ChannelUtm","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.js b/dist/web/plugin/channel-utm/index.js index 301f5fc7..44c30340 100644 --- a/dist/web/plugin/channel-utm/index.js +++ b/dist/web/plugin/channel-utm/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ChannelUtm=function(){"use strict";function n(n,t,r){if(t&&(n.plugin_name=t),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function e(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function t(e,t,r){return n(e,t,r),e.plugin_version=a,e}var r,a="1.25.9",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(e=!0,t[n.slice(8)]=a)}),e&&r.register&&r.register({link_v:"1"}),t}}}))}},u=t(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ChannelUtm=function(){"use strict";function n(n,t,r){if(t&&(n.plugin_name=t),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function e(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function t(e,t,r){return n(e,t,r),e.plugin_version=a,e}var r,a="1.25.10",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(e=!0,t[n.slice(8)]=a)}),e&&r.register&&r.register({link_v:"1"}),t}}}))}},u=t(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/channel/index.closure.js b/dist/web/plugin/channel/index.closure.js index 4138589b..dd7c1c98 100644 --- a/dist/web/plugin/channel/index.closure.js +++ b/dist/web/plugin/channel/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var a=e.init;e.init=function(r,s){function l(){a.call(e,r,s)}return n(r,e,t),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.25.9",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.25.10",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!a.on)return l();function l(){i.call(e,a,r)}a.on(t,l)}}return e}function wrapLogFn(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){if(sd||!e)return!1;cookie_name=(n=n||{}).cookie_name||"sensorsdata2015jssdkchannel",sd=e;var t=this;!function(){if(_=sd._,store=sd.store,!_.localStorage.isSupport())return!1;sd.para.max_string_length=1024,t.eventList.init(),t.addLatestChannelUrl(),t.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd.registerPage({$is_channel_callback_event:function(e){if(_.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_.isReferralTraffic(document.referrer)){var t=_.getQueryParam(location.href,"sat_cf");_.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?sd.registerPage(n):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);sd.para.encrypt_cookie&&(t=sd.kit.userEncrypt(t)),_.cookie.set(cookie_name,t)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!a.on)return l();function l(){i.call(e,a,r)}a.on(t,l)}}return e}function wrapLogFn(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){if(sd||!e)return!1;cookie_name=(n=n||{}).cookie_name||"sensorsdata2015jssdkchannel",sd=e;var t=this;!function(){if(_=sd._,store=sd.store,!_.localStorage.isSupport())return!1;sd.para.max_string_length=1024,t.eventList.init(),t.addLatestChannelUrl(),t.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd.registerPage({$is_channel_callback_event:function(e){if(_.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_.isReferralTraffic(document.referrer)){var t=_.getQueryParam(location.href,"sat_cf");_.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?sd.registerPage(n):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);sd.para.encrypt_cookie&&(t=sd.kit.userEncrypt(t)),_.cookie.set(cookie_name,t)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.25.9",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.25.10",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!l.on?s():void l.on(t,s)}}return o}function n(o,n,e){function t(n,t){o.logger?o.logger.msg.apply(o.logger,t).module(e+""||"").level(n).log():o.log&&o.log.apply(o,t)}n.log=function(){t("log",arguments)},n.warn=function(){t("warn",arguments)},n.error=function(){t("error",arguments)}}function e(n,e,t){return o(n,e,t),n.plugin_version=v,n}function t(o){return null===h?void r(o):void h.push(o)}function r(o){try{if("log"===o.level&&l())return void a(o);if("warn"===o.level&&i())return void a(o);if("error"===o.level&&s())return void a(o)}catch(n){}}function l(){return!!f()||(p.para.show_log===!0||d.isObject(p.para.show_log)&&"log"===p.para.show_log.level)}function i(){return!!f()||(l()||d.isObject(p.para.show_log)&&"warn"===p.para.show_log.level)}function s(){return!!f()||(!d.isObject(p.para.show_log)||"none"!==p.para.show_log.level)}function a(o){var n=o.content,e=d.isObject(n[0])?d.formatJsonString(n[0]):n[0],t=u(o);n[0]=t+(t.length>0?": ":"")+e;try{console&&(d.isFunction(console[o.level])?console[o.level].apply(console,n):d.isObject(console[o.level])&&console[o.level](n[0]))}catch(r){}}function u(o){var n="",e="",t=p.para.show_log;return d.isObject(t)&&t.show_brand===!1||(n+=o.brand),d.isObject(t)&&t.show_level===!1||(n+=(n.length>0?"-":"")+o.level),n.length>0&&(n="["+n+"]"),d.isObject(t)&&t.show_module===!1||(e=o.module),n+e}function c(){d.sessionStorage.isSupport()&&sessionStorage.setItem(b,"true")}function g(){d.sessionStorage.isSupport()&&sessionStorage.removeItem(b)}function f(){return d.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(b)}var v="1.25.9",p=null,d=null,h=[],_={init:function(o){o&&(p=o,d=p._,p.logger&&p.logger.appendWriter(t),p.on&&p.on("sdkAfterInitPara",function(){for(var o=0;o=3||!l.on?s():void l.on(t,s)}}return o}function n(o,n,e){function t(n,t){o.logger?o.logger.msg.apply(o.logger,t).module(e+""||"").level(n).log():o.log&&o.log.apply(o,t)}n.log=function(){t("log",arguments)},n.warn=function(){t("warn",arguments)},n.error=function(){t("error",arguments)}}function e(n,e,t){return o(n,e,t),n.plugin_version=v,n}function t(o){return null===h?void r(o):void h.push(o)}function r(o){try{if("log"===o.level&&l())return void a(o);if("warn"===o.level&&i())return void a(o);if("error"===o.level&&s())return void a(o)}catch(n){}}function l(){return!!f()||(p.para.show_log===!0||d.isObject(p.para.show_log)&&"log"===p.para.show_log.level)}function i(){return!!f()||(l()||d.isObject(p.para.show_log)&&"warn"===p.para.show_log.level)}function s(){return!!f()||(!d.isObject(p.para.show_log)||"none"!==p.para.show_log.level)}function a(o){var n=o.content,e=d.isObject(n[0])?d.formatJsonString(n[0]):n[0],t=u(o);n[0]=t+(t.length>0?": ":"")+e;try{console&&(d.isFunction(console[o.level])?console[o.level].apply(console,n):d.isObject(console[o.level])&&console[o.level](n[0]))}catch(r){}}function u(o){var n="",e="",t=p.para.show_log;return d.isObject(t)&&t.show_brand===!1||(n+=o.brand),d.isObject(t)&&t.show_level===!1||(n+=(n.length>0?"-":"")+o.level),n.length>0&&(n="["+n+"]"),d.isObject(t)&&t.show_module===!1||(e=o.module),n+e}function c(){d.sessionStorage.isSupport()&&sessionStorage.setItem(b,"true")}function g(){d.sessionStorage.isSupport()&&sessionStorage.removeItem(b)}function f(){return d.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(b)}var v="1.25.10",p=null,d=null,h=[],_={init:function(o){o&&(p=o,d=p._,p.logger&&p.logger.appendWriter(t),p.on&&p.on("sdkAfterInitPara",function(){for(var o=0;o=3||!l.on)return t();function t(){r.call(o,l,a)}l.on(n,t)}}return o}function wrapLogFn(o,e,n){function r(e,r){o.logger?o.logger.msg.apply(o.logger,r).module(n+""||"").level(e).log():o.log&&o.log.apply(o,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(o,e,n){return wrapPluginInitFn(o,e,n),o.plugin_version=sdkversion_placeholder,o}var _sd=null,_=null,_cacheLogs=[],ConsoleLogger={init:function(o){o&&(_=(_sd=o)._,_sd.logger&&_sd.logger.appendWriter(logWriter),_sd.on&&_sd.on("sdkAfterInitPara",function(){for(var o=0;o<_cacheLogs.length;o++)printLog(_cacheLogs[o]);_cacheLogs=null}),_sd.on&&_sd.on("sdkInitAPI",function(){_sd.enableLocalLog=enableLocalLog,_sd.disableLocalLog=disableLocalLog}))}},index=createPlugin(ConsoleLogger,"ConsoleLogger");function logWriter(o){null!==_cacheLogs?_cacheLogs.push(o):printLog(o)}function printLog(o){try{if("log"===o.level&&canLog())return void writeLog(o);if("warn"===o.level&&canWarn())return void writeLog(o);if("error"===o.level&&canError())return void writeLog(o)}catch(e){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd.para.show_log||_.isObject(_sd.para.show_log)&&"log"===_sd.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_.isObject(_sd.para.show_log)&&"warn"===_sd.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_.isObject(_sd.para.show_log)||"none"!==_sd.para.show_log.level)}function writeLog(o){var e=o.content,n=_.isObject(e[0])?_.formatJsonString(e[0]):e[0],r=getLogHead(o);e[0]=r+(r.length>0?": ":"")+n;try{console&&(_.isFunction(console[o.level])?console[o.level].apply(console,e):_.isObject(console[o.level])&&console[o.level](e[0]))}catch(l){}}function getLogHead(o){var e="",n="",r=_sd.para.show_log;return _.isObject(r)&&!1===r.show_brand||(e+=o.brand),_.isObject(r)&&!1===r.show_level||(e+=(e.length>0?"-":"")+o.level),e.length>0&&(e="["+e+"]"),_.isObject(r)&&!1===r.show_module||(n=o.module),e+n}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(o,e,n){if(e&&(o.plugin_name=e),n&&o.init){var r=o.init;o.init=function(l,a){if(wrapLogFn(l,o,e),l.readyState&&l.readyState.state>=3||!l.on)return t();function t(){r.call(o,l,a)}l.on(n,t)}}return o}function wrapLogFn(o,e,n){function r(e,r){o.logger?o.logger.msg.apply(o.logger,r).module(n+""||"").level(e).log():o.log&&o.log.apply(o,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(o,e,n){return wrapPluginInitFn(o,e,n),o.plugin_version=sdkversion_placeholder,o}var _sd=null,_=null,_cacheLogs=[],ConsoleLogger={init:function(o){o&&(_=(_sd=o)._,_sd.logger&&_sd.logger.appendWriter(logWriter),_sd.on&&_sd.on("sdkAfterInitPara",function(){for(var o=0;o<_cacheLogs.length;o++)printLog(_cacheLogs[o]);_cacheLogs=null}),_sd.on&&_sd.on("sdkInitAPI",function(){_sd.enableLocalLog=enableLocalLog,_sd.disableLocalLog=disableLocalLog}))}},index=createPlugin(ConsoleLogger,"ConsoleLogger");function logWriter(o){null!==_cacheLogs?_cacheLogs.push(o):printLog(o)}function printLog(o){try{if("log"===o.level&&canLog())return void writeLog(o);if("warn"===o.level&&canWarn())return void writeLog(o);if("error"===o.level&&canError())return void writeLog(o)}catch(e){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd.para.show_log||_.isObject(_sd.para.show_log)&&"log"===_sd.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_.isObject(_sd.para.show_log)&&"warn"===_sd.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_.isObject(_sd.para.show_log)||"none"!==_sd.para.show_log.level)}function writeLog(o){var e=o.content,n=_.isObject(e[0])?_.formatJsonString(e[0]):e[0],r=getLogHead(o);e[0]=r+(r.length>0?": ":"")+n;try{console&&(_.isFunction(console[o.level])?console[o.level].apply(console,e):_.isObject(console[o.level])&&console[o.level](e[0]))}catch(l){}}function getLogHead(o){var e="",n="",r=_sd.para.show_log;return _.isObject(r)&&!1===r.show_brand||(e+=o.brand),_.isObject(r)&&!1===r.show_level||(e+=(e.length>0?"-":"")+o.level),e.length>0&&(e="["+e+"]"),_.isObject(r)&&!1===r.show_module||(n=o.module),e+n}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}export default index; \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.closure.js b/dist/web/plugin/custom-events-sender/index.closure.js index dd567fd4..e4d55bf8 100644 --- a/dist/web/plugin/custom-events-sender/index.closure.js +++ b/dist/web/plugin/custom-events-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var r=n.init;n.init=function(i,o){function c(){r.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?c():void i.on(a,c)}}return n}function t(n,t,e){function a(t,a){n.logger?n.logger.msg.apply(n.logger,a).module(e+""||"").level(t).log():n.log&&n.log.apply(n,a)}t.log=function(){a("log",arguments)},t.warn=function(){a("warn",arguments)},t.error=function(){a("error",arguments)}}function e(t,e,a){return n(t,e,a),t.plugin_version=l,t}function a(n){var t=[];return c.each(n,function(n){c.isArray(n)?t=t.concat(a(n)):t.push(c.optimizeServerUrl(n))}),t}function r(n,t){t=c.isArray(t)?t:[t];var e=!1;return c.isArray(n)?c.each(n,function(n){c.indexOf(t,n)>-1&&(e=!0)}):c.indexOf(t,n)>-1&&(e=!0),e}function i(n,t){var e=o.kit.encodeTrackData(t);return n.indexOf("?")!==-1?n+"&"+e:n+"?"+e}var o,c,u,l="1.25.9",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,t){return s.sendData(n,t),n}}})},sendData:function(n,t){var e=n.data,i=e.event,o=n.server_url,u=n.callback,l=this,s=this.hookFn({event_name:i,data:c.extend2Lev({identities:{},lib:{},properties:{}},e),server_url:o});return c.isArray(s)&&s.length?(s=a(s),r(o,s)?u=null:t.cancellationToken.stop(),c.each(s,function(t){if(t&&""!==t&&!r(t,o)){var e=function(t){return function(){l.sendCall({server_url:t,data:n.data,config:null,callback:u}),u=null,n.callback=null}}(t);setTimeout(e)}}),n):(c.isFunction(u)&&u(),t.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&c.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new c.BeaconSend(n)):"ajax"===o.para.send_type&&c.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new c.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new c.ImageSend(n))},sendCall:function(n){var t=this.getInstance(n);t.start()}},d={plugin_name:"CustomEventsSender",init:function(n,t){if(o=n,c=o._,u=o&&o.log||console&&console.log||function(){},c.isFunction(t)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(t);o.on("sdkAfterInitPara",function(){s.init(t)})}else u("CustomEventsSender init failed\uff0chookFn error. hookFn:",t)}},f=e(d);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var r=n.init;n.init=function(i,o){function c(){r.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?c():void i.on(a,c)}}return n}function t(n,t,e){function a(t,a){n.logger?n.logger.msg.apply(n.logger,a).module(e+""||"").level(t).log():n.log&&n.log.apply(n,a)}t.log=function(){a("log",arguments)},t.warn=function(){a("warn",arguments)},t.error=function(){a("error",arguments)}}function e(t,e,a){return n(t,e,a),t.plugin_version=l,t}function a(n){var t=[];return c.each(n,function(n){c.isArray(n)?t=t.concat(a(n)):t.push(c.optimizeServerUrl(n))}),t}function r(n,t){t=c.isArray(t)?t:[t];var e=!1;return c.isArray(n)?c.each(n,function(n){c.indexOf(t,n)>-1&&(e=!0)}):c.indexOf(t,n)>-1&&(e=!0),e}function i(n,t){var e=o.kit.encodeTrackData(t);return n.indexOf("?")!==-1?n+"&"+e:n+"?"+e}var o,c,u,l="1.25.10",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,t){return s.sendData(n,t),n}}})},sendData:function(n,t){var e=n.data,i=e.event,o=n.server_url,u=n.callback,l=this,s=this.hookFn({event_name:i,data:c.extend2Lev({identities:{},lib:{},properties:{}},e),server_url:o});return c.isArray(s)&&s.length?(s=a(s),r(o,s)?u=null:t.cancellationToken.stop(),c.each(s,function(t){if(t&&""!==t&&!r(t,o)){var e=function(t){return function(){l.sendCall({server_url:t,data:n.data,config:null,callback:u}),u=null,n.callback=null}}(t);setTimeout(e)}}),n):(c.isFunction(u)&&u(),t.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&c.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new c.BeaconSend(n)):"ajax"===o.para.send_type&&c.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new c.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new c.ImageSend(n))},sendCall:function(n){var t=this.getInstance(n);t.start()}},d={plugin_name:"CustomEventsSender",init:function(n,t){if(o=n,c=o._,u=o&&o.log||console&&console.log||function(){},c.isFunction(t)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(t);o.on("sdkAfterInitPara",function(){s.init(t)})}else u("CustomEventsSender init failed\uff0chookFn error. hookFn:",t)}},f=e(d);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.es6.js b/dist/web/plugin/custom-events-sender/index.es6.js index af6eaf2f..0132567d 100644 --- a/dist/web/plugin/custom-events-sender/index.es6.js +++ b/dist/web/plugin/custom-events-sender/index.es6.js @@ -1 +1 @@ -var sd,_,log,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}function flattenArray(n){var e=[];return _.each(n,function(n){_.isArray(n)?e=e.concat(flattenArray(n)):e.push(_.optimizeServerUrl(n))}),e}function hasEqualServerUrl(n,e){e=_.isArray(e)?e:[e];var t=!1;return _.isArray(n)?_.each(n,function(n){_.indexOf(e,n)>-1&&(t=!0)}):_.indexOf(e,n)>-1&&(t=!0),t}function getSendUrl(n,e){var t=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+t:n+"?"+t}var sender={hookFn:null,init:function(n){this.hookFn=n,sd.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return sender.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,r=t.event,a=n.server_url,i=n.callback,o=this,l=this.hookFn({event_name:r,data:_.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:a});return _.isArray(l)&&l.length?(l=flattenArray(l),hasEqualServerUrl(a,l)?i=null:e.cancellationToken.stop(),_.each(l,function(e){if(e&&""!==e&&!hasEqualServerUrl(e,a)){var t=(r=e,function(){o.sendCall({server_url:r,data:n.data,config:null,callback:i}),i=null,n.callback=null});setTimeout(t)}var r}),n):(_.isFunction(i)&&i(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===sd.para.send_type&&_.isSupportBeaconSend()?(n.data=sd.kit.encodeTrackData(n.data),new _.BeaconSend(n)):"ajax"===sd.para.send_type&&_.isSupportCors()?(n.data=sd.kit.encodeTrackData(n.data),new _.AjaxSend(n)):(n.data.time=1*new Date,n.data=getSendUrl(n.server_url,n.data),new _.ImageSend(n))},sendCall:function(n){this.getInstance(n).start()}},CustomEventsSender={plugin_name:"CustomEventsSender",init:function(n,e){if(_=(sd=n)._,log=sd&&sd.log||console&&console.log||function(){},_.isFunction(e)){if(sd.readyState&&sd.readyState.state>=3||!sd.on)return sender.init(e);sd.on("sdkAfterInitPara",function(){sender.init(e)})}else log("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},index=createPlugin(CustomEventsSender);export default index; \ No newline at end of file +var sd,_,log,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}function flattenArray(n){var e=[];return _.each(n,function(n){_.isArray(n)?e=e.concat(flattenArray(n)):e.push(_.optimizeServerUrl(n))}),e}function hasEqualServerUrl(n,e){e=_.isArray(e)?e:[e];var t=!1;return _.isArray(n)?_.each(n,function(n){_.indexOf(e,n)>-1&&(t=!0)}):_.indexOf(e,n)>-1&&(t=!0),t}function getSendUrl(n,e){var t=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+t:n+"?"+t}var sender={hookFn:null,init:function(n){this.hookFn=n,sd.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return sender.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,r=t.event,a=n.server_url,i=n.callback,o=this,l=this.hookFn({event_name:r,data:_.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:a});return _.isArray(l)&&l.length?(l=flattenArray(l),hasEqualServerUrl(a,l)?i=null:e.cancellationToken.stop(),_.each(l,function(e){if(e&&""!==e&&!hasEqualServerUrl(e,a)){var t=(r=e,function(){o.sendCall({server_url:r,data:n.data,config:null,callback:i}),i=null,n.callback=null});setTimeout(t)}var r}),n):(_.isFunction(i)&&i(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===sd.para.send_type&&_.isSupportBeaconSend()?(n.data=sd.kit.encodeTrackData(n.data),new _.BeaconSend(n)):"ajax"===sd.para.send_type&&_.isSupportCors()?(n.data=sd.kit.encodeTrackData(n.data),new _.AjaxSend(n)):(n.data.time=1*new Date,n.data=getSendUrl(n.server_url,n.data),new _.ImageSend(n))},sendCall:function(n){this.getInstance(n).start()}},CustomEventsSender={plugin_name:"CustomEventsSender",init:function(n,e){if(_=(sd=n)._,log=sd&&sd.log||console&&console.log||function(){},_.isFunction(e)){if(sd.readyState&&sd.readyState.state>=3||!sd.on)return sender.init(e);sd.on("sdkAfterInitPara",function(){sender.init(e)})}else log("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},index=createPlugin(CustomEventsSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.js b/dist/web/plugin/custom-events-sender/index.js index 671ce6f0..2bf997b3 100644 --- a/dist/web/plugin/custom-events-sender/index.js +++ b/dist/web/plugin/custom-events-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).CustomEventsSender=function(){"use strict";function n(n,t,a){if(t&&(n.plugin_name=t),a&&n.init){var r=n.init;n.init=function(i,o){function u(){r.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(a,u)}}return n}function e(n,e,t){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(t+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function t(e,t,a){return n(e,t,a),e.plugin_version=l,e}function a(n){var e=[];return u.each(n,function(n){u.isArray(n)?e=e.concat(a(n)):e.push(u.optimizeServerUrl(n))}),e}function r(n,e){e=u.isArray(e)?e:[e];var t=!1;return u.isArray(n)?u.each(n,function(n){u.indexOf(e,n)>-1&&(t=!0)}):u.indexOf(e,n)>-1&&(t=!0),t}function i(n,e){var t=o.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+t:n+"?"+t}var o,u,c,l="1.25.9",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return s.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,i=t.event,o=n.server_url,c=n.callback,l=this,s=this.hookFn({event_name:i,data:u.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:o});return u.isArray(s)&&s.length?(s=a(s),r(o,s)?c=null:e.cancellationToken.stop(),u.each(s,function(e){if(e&&""!==e&&!r(e,o)){var t=function(e){return function(){l.sendCall({server_url:e,data:n.data,config:null,callback:c}),c=null,n.callback=null}}(e);setTimeout(t)}}),n):(u.isFunction(c)&&c(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&u.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new u.BeaconSend(n)):"ajax"===o.para.send_type&&u.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new u.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new u.ImageSend(n))},sendCall:function(n){var e=this.getInstance(n);e.start()}},d={plugin_name:"CustomEventsSender",init:function(n,e){if(o=n,u=o._,c=o&&o.log||console&&console.log||function(){},u.isFunction(e)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(e);o.on("sdkAfterInitPara",function(){s.init(e)})}else c("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},f=t(d);return f}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).CustomEventsSender=function(){"use strict";function n(n,t,a){if(t&&(n.plugin_name=t),a&&n.init){var r=n.init;n.init=function(i,o){function u(){r.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(a,u)}}return n}function e(n,e,t){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(t+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function t(e,t,a){return n(e,t,a),e.plugin_version=l,e}function a(n){var e=[];return u.each(n,function(n){u.isArray(n)?e=e.concat(a(n)):e.push(u.optimizeServerUrl(n))}),e}function r(n,e){e=u.isArray(e)?e:[e];var t=!1;return u.isArray(n)?u.each(n,function(n){u.indexOf(e,n)>-1&&(t=!0)}):u.indexOf(e,n)>-1&&(t=!0),t}function i(n,e){var t=o.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+t:n+"?"+t}var o,u,c,l="1.25.10",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return s.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,i=t.event,o=n.server_url,c=n.callback,l=this,s=this.hookFn({event_name:i,data:u.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:o});return u.isArray(s)&&s.length?(s=a(s),r(o,s)?c=null:e.cancellationToken.stop(),u.each(s,function(e){if(e&&""!==e&&!r(e,o)){var t=function(e){return function(){l.sendCall({server_url:e,data:n.data,config:null,callback:c}),c=null,n.callback=null}}(e);setTimeout(t)}}),n):(u.isFunction(c)&&c(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&u.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new u.BeaconSend(n)):"ajax"===o.para.send_type&&u.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new u.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new u.ImageSend(n))},sendCall:function(n){var e=this.getInstance(n);e.start()}},d={plugin_name:"CustomEventsSender",init:function(n,e){if(o=n,u=o._,c=o&&o.log||console&&console.log||function(){},u.isFunction(e)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(e);o.on("sdkAfterInitPara",function(){s.init(e)})}else c("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},f=t(d);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.closure.js b/dist/web/plugin/debug-sender/index.closure.js index 124f0074..8c0fa222 100644 --- a/dist/web/plugin/debug-sender/index.closure.js +++ b/dist/web/plugin/debug-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.25.9",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file +!function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.25.10",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.es6.js b/dist/web/plugin/debug-sender/index.es6.js index 06966b15..53aaee81 100644 --- a/dist/web/plugin/debug-sender/index.es6.js +++ b/dist/web/plugin/debug-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(d,t){if(wrapLogFn(d,e,r),d.readyState&&d.readyState.state>=3||!d.on)return i();function i(){n.call(e,d,t)}d.on(a,i)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}function debugPath(e){var r=e,a="";a=-1!==sd.para.debug_mode_url.indexOf("?")?sd.para.debug_mode_url+"&"+sd.kit.encodeTrackData(e):sd.para.debug_mode_url+"?"+sd.kit.encodeTrackData(e),_.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(sd.para.debug_mode_upload)},success:function(e){!0===_.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData(e,r){if(!0===sd.para.debug_mode){var a=e.data;e.callback;debugPath(JSON.stringify(a)),r.cancellationToken.stop()}return e}function initPara(){!0===sd.para.debug_mode&&(sd.para.debug_mode_upload=sd.para.debug_mode_upload||!1,_.isString(sd.para.debug_mode_url)||(_.isString(sd.para.server_url)?sd.para.debug_mode_url=sd.para.server_url.replace("sa.gif","debug"):_.isArray(sd.para.server_url)&&_.isString(sd.para.server_url[0])?sd.para.debug_mode_url=sd.para.server_url[0].replace("sa.gif","debug"):sd.para.debug_mode=!1))}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData}})})}var DebugSender={plugin_name:"DebugSender",init:function(e){_=(sd=e)._,senderInit()}},index=createPlugin(DebugSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(d,t){if(wrapLogFn(d,e,r),d.readyState&&d.readyState.state>=3||!d.on)return i();function i(){n.call(e,d,t)}d.on(a,i)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}function debugPath(e){var r=e,a="";a=-1!==sd.para.debug_mode_url.indexOf("?")?sd.para.debug_mode_url+"&"+sd.kit.encodeTrackData(e):sd.para.debug_mode_url+"?"+sd.kit.encodeTrackData(e),_.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(sd.para.debug_mode_upload)},success:function(e){!0===_.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData(e,r){if(!0===sd.para.debug_mode){var a=e.data;e.callback;debugPath(JSON.stringify(a)),r.cancellationToken.stop()}return e}function initPara(){!0===sd.para.debug_mode&&(sd.para.debug_mode_upload=sd.para.debug_mode_upload||!1,_.isString(sd.para.debug_mode_url)||(_.isString(sd.para.server_url)?sd.para.debug_mode_url=sd.para.server_url.replace("sa.gif","debug"):_.isArray(sd.para.server_url)&&_.isString(sd.para.server_url[0])?sd.para.debug_mode_url=sd.para.server_url[0].replace("sa.gif","debug"):sd.para.debug_mode=!1))}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData}})})}var DebugSender={plugin_name:"DebugSender",init:function(e){_=(sd=e)._,senderInit()}},index=createPlugin(DebugSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.js b/dist/web/plugin/debug-sender/index.js index 5b033100..579d821c 100644 --- a/dist/web/plugin/debug-sender/index.js +++ b/dist/web/plugin/debug-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DebugSender=function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.25.9",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DebugSender=function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.25.10",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.closure.js b/dist/web/plugin/deeplink/index.closure.js index 1d14ac3f..0e91ce86 100644 --- a/dist/web/plugin/deeplink/index.closure.js +++ b/dist/web/plugin/deeplink/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.25.9",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},c=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},g=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=g(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=c(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file +!function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.25.10",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},c=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},g=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=g(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=c(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.es6.js b/dist/web/plugin/deeplink/index.es6.js index f406ba8a..c2b3f233 100644 --- a/dist/web/plugin/deeplink/index.es6.js +++ b/dist/web/plugin/deeplink/index.es6.js @@ -1 +1 @@ -var hidden,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(i,e,t){if(e&&(i.plugin_name=e),t&&i.init){var n=i.init;i.init=function(o,r){if(wrapLogFn(o,i,e),o.readyState&&o.readyState.state>=3||!o.on)return s();function s(){n.call(i,o,r)}o.on(t,s)}}return i}function wrapLogFn(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(i,e,t){return wrapPluginInitFn(i,e,t),i.plugin_version=sdkversion_placeholder,i}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var i in OSs)if(navigator.userAgent.match(OSs[i]))return i;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},parseShortURL=function(i){return i.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},handleAndroidLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,i.timer=setTimeout(function(){var e=isPageHidden();if(i.log("hide:"+hidden+":"+document[hidden]),e)return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=t},i.timeout)},handleIOSLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){if(isPageHidden())return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=t},i.timeout),i.log("new timer:"+i.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&isObject(arguments[1])&&(e=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=parseShortURL(n);if(!o)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){if(i.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1;SADeepLink.data=i,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),handleIOSLinks(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=getSupportedProperty().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index=createPlugin(SADeepLink,"Deeplink","sdkReady");export default index; \ No newline at end of file +var hidden,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(i,e,t){if(e&&(i.plugin_name=e),t&&i.init){var n=i.init;i.init=function(o,r){if(wrapLogFn(o,i,e),o.readyState&&o.readyState.state>=3||!o.on)return s();function s(){n.call(i,o,r)}o.on(t,s)}}return i}function wrapLogFn(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(i,e,t){return wrapPluginInitFn(i,e,t),i.plugin_version=sdkversion_placeholder,i}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var i in OSs)if(navigator.userAgent.match(OSs[i]))return i;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},parseShortURL=function(i){return i.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},handleAndroidLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,i.timer=setTimeout(function(){var e=isPageHidden();if(i.log("hide:"+hidden+":"+document[hidden]),e)return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=t},i.timeout)},handleIOSLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){if(isPageHidden())return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=t},i.timeout),i.log("new timer:"+i.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&isObject(arguments[1])&&(e=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=parseShortURL(n);if(!o)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){if(i.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1;SADeepLink.data=i,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),handleIOSLinks(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=getSupportedProperty().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index=createPlugin(SADeepLink,"Deeplink","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.js b/dist/web/plugin/deeplink/index.js index c7ffe917..a85fd461 100644 --- a/dist/web/plugin/deeplink/index.js +++ b/dist/web/plugin/deeplink/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Deeplink=(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).deeplink=function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.25.9",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},g=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},c=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=c(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=g(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Deeplink=(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).deeplink=function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.25.10",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},g=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},c=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=c(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=g(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange;i&&document.addEventListener(i,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.closure.js b/dist/web/plugin/disable-sdk/index.closure.js index f7d116bf..8f1026c1 100644 --- a/dist/web/plugin/disable-sdk/index.closure.js +++ b/dist/web/plugin/disable-sdk/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,i,o){if(i&&(n.plugin_name=i),o&&n.init){var e=n.init;n.init=function(r,u){function l(){e.call(n,r,u)}return t(r,n,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(o,l)}}return n}function t(n,t,i){function o(t,o){n.logger?n.logger.msg.apply(n.logger,o).module(i+""||"").level(t).log():n.log&&n.log.apply(n,o)}t.log=function(){o("log",arguments)},t.warn=function(){o("warn",arguments)},t.error=function(){o("error",arguments)}}function i(t,i,o){return n(t,i,o),t.plugin_version=u,t}function o(){l=!0}function e(){l=!1}function r(){return l}var u="1.25.9",l=!1,a=null,c={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},f=i(c,"DisableSDK","sdkInitAPI");return f}(); \ No newline at end of file +!function(){"use strict";function n(n,i,o){if(i&&(n.plugin_name=i),o&&n.init){var e=n.init;n.init=function(r,u){function l(){e.call(n,r,u)}return t(r,n,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(o,l)}}return n}function t(n,t,i){function o(t,o){n.logger?n.logger.msg.apply(n.logger,o).module(i+""||"").level(t).log():n.log&&n.log.apply(n,o)}t.log=function(){o("log",arguments)},t.warn=function(){o("warn",arguments)},t.error=function(){o("error",arguments)}}function i(t,i,o){return n(t,i,o),t.plugin_version=u,t}function o(){l=!0}function e(){l=!1}function r(){return l}var u="1.25.10",l=!1,a=null,c={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},f=i(c,"DisableSDK","sdkInitAPI");return f}(); \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.es6.js b/dist/web/plugin/disable-sdk/index.es6.js index d8b524f6..72fa28a0 100644 --- a/dist/web/plugin/disable-sdk/index.es6.js +++ b/dist/web/plugin/disable-sdk/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,i,e){if(i&&(n.plugin_name=i),e&&n.init){var l=n.init;n.init=function(a,r){if(wrapLogFn(a,n,i),a.readyState&&a.readyState.state>=3||!a.on)return t();function t(){l.call(n,a,r)}a.on(e,t)}}return n}function wrapLogFn(n,i,e){function l(i,l){n.logger?n.logger.msg.apply(n.logger,l).module(e+""||"").level(i).log():n.log&&n.log.apply(n,l)}i.log=function(){l("log",arguments)},i.warn=function(){l("warn",arguments)},i.error=function(){l("error",arguments)}}function createPlugin(n,i,e){return wrapPluginInitFn(n,i,e),n.plugin_version=sdkversion_placeholder,n}var isDisabled=!1,sd=null,disableSDKPlugin={init:function(n){(sd=n).disableSDK=disableSDK,sd.enableSDK=enableSDK,sd.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var index=createPlugin(disableSDKPlugin,"DisableSDK","sdkInitAPI");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,i,e){if(i&&(n.plugin_name=i),e&&n.init){var l=n.init;n.init=function(a,r){if(wrapLogFn(a,n,i),a.readyState&&a.readyState.state>=3||!a.on)return t();function t(){l.call(n,a,r)}a.on(e,t)}}return n}function wrapLogFn(n,i,e){function l(i,l){n.logger?n.logger.msg.apply(n.logger,l).module(e+""||"").level(i).log():n.log&&n.log.apply(n,l)}i.log=function(){l("log",arguments)},i.warn=function(){l("warn",arguments)},i.error=function(){l("error",arguments)}}function createPlugin(n,i,e){return wrapPluginInitFn(n,i,e),n.plugin_version=sdkversion_placeholder,n}var isDisabled=!1,sd=null,disableSDKPlugin={init:function(n){(sd=n).disableSDK=disableSDK,sd.enableSDK=enableSDK,sd.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var index=createPlugin(disableSDKPlugin,"DisableSDK","sdkInitAPI");export default index; \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.js b/dist/web/plugin/disable-sdk/index.js index c2821707..bc74af9b 100644 --- a/dist/web/plugin/disable-sdk/index.js +++ b/dist/web/plugin/disable-sdk/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DisableSDK=function(){"use strict";function n(n,t,o){if(t&&(n.plugin_name=t),o&&n.init){var e=n.init;n.init=function(r,l){function u(){e.call(n,r,l)}return i(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?u():void r.on(o,u)}}return n}function i(n,i,t){function o(i,o){n.logger?n.logger.msg.apply(n.logger,o).module(t+""||"").level(i).log():n.log&&n.log.apply(n,o)}i.log=function(){o("log",arguments)},i.warn=function(){o("warn",arguments)},i.error=function(){o("error",arguments)}}function t(i,t,o){return n(i,t,o),i.plugin_version=l,i}function o(){u=!0}function e(){u=!1}function r(){return u}var l="1.25.9",u=!1,a=null,g={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},c=t(g,"DisableSDK","sdkInitAPI");return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DisableSDK=function(){"use strict";function n(n,t,o){if(t&&(n.plugin_name=t),o&&n.init){var e=n.init;n.init=function(r,l){function u(){e.call(n,r,l)}return i(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?u():void r.on(o,u)}}return n}function i(n,i,t){function o(i,o){n.logger?n.logger.msg.apply(n.logger,o).module(t+""||"").level(i).log():n.log&&n.log.apply(n,o)}i.log=function(){o("log",arguments)},i.warn=function(){o("warn",arguments)},i.error=function(){o("error",arguments)}}function t(i,t,o){return n(i,t,o),i.plugin_version=l,i}function o(){u=!0}function e(){u=!1}function r(){return u}var l="1.25.10",u=!1,a=null,g={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},c=t(g,"DisableSDK","sdkInitAPI");return c}(); \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.closure.js b/dist/web/plugin/exposure/index.closure.js index 373e1a79..2682b968 100644 --- a/dist/web/plugin/exposure/index.closure.js +++ b/dist/web/plugin/exposure/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=u,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:s("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:s("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):s("parameter config.repeated error. config:",e)}}),t}var a,o,s,u="1.25.9",c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void s("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),u={};return a&&(u.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(u){s("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),u.config=i(n),u.properties=r,u},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return s("parameter option.eventName error. option:",e),!1;o.isElement(t)||s("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},m={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,s=a.log,v.init(t),void s("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void s("Exposure Plugin uninitialized.");if(!o.isElement(e))return void s("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void s("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void s("removeExposureView parameter ele errors."):void s("Exposure Plugin uninitialized.")}},g=r(m,"Exposure","sdkAfterInitPara");return g}(); \ No newline at end of file +!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=u,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:s("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:s("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):s("parameter config.repeated error. config:",e)}}),t}var a,o,s,u="1.25.10",c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void s("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),u={};return a&&(u.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(u){s("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),u.config=i(n),u.properties=r,u},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return s("parameter option.eventName error. option:",e),!1;o.isElement(t)||s("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},m={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,s=a.log,v.init(t),void s("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void s("Exposure Plugin uninitialized.");if(!o.isElement(e))return void s("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void s("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void s("removeExposureView parameter ele errors."):void s("Exposure Plugin uninitialized.")}},g=r(m,"Exposure","sdkAfterInitPara");return g}(); \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.es6.js b/dist/web/plugin/exposure/index.es6.js index 95aa532c..99a90c56 100644 --- a/dist/web/plugin/exposure/index.es6.js +++ b/dist/web/plugin/exposure/index.es6.js @@ -1 +1 @@ -var sd,_,log,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,o){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,o)}i.on(r,a)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder,e}var EXPOSURE_ATTR_EVENT_NAME="data-sensors-exposure-event-name",exposureIntersection={},exposureEleOption=[],exposureConfig={area_rate:0,stay_duration:0,repeated:!0};function isSupport(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function formatConfig(e){var t={};return _.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:log("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:log("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||!1===r||"true"===r||!0===r?t.repeated="false"!==r&&Boolean(r):log("parameter config.repeated error. config:",e)}}),t}var exposurePlugin={isReady:!1,init:function(e){if(isSupport()){var t=this;_.isObject(e)&&(exposureConfig=_.extend(exposureConfig,formatConfig(e))),_.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),mutation.init()}),sd.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),_.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0}else log("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.")},getElesByEventName:function(e){return(e=e||document).querySelectorAll("["+EXPOSURE_ATTR_EVENT_NAME+"]")},getEleEventName:function(e){return e.getAttribute(EXPOSURE_ATTR_EVENT_NAME)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},i=this.getEleEventName(e),o={};return i&&(o.eventName=i),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var o=_.isObject(i)?i:JSON.parse(i);n=_.isObject(o.config)?o.config:n,r=_.isObject(o.properties)?o.properties:r}}catch(a){log("element attribute data-sensors-exposure-option error. value:",i)}}),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var o=t.name.match(/^data-sensors-exposure-property-(.+)/);o&&(r[o[1]]=i)}catch(s){}try{var a=t.name.match(/^data-sensors-exposure-config-(.+)/);if(a)switch(a[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(s){}}),o.config=formatConfig(n),o.properties=r,o},addObserveByNodes:function(e){if(e.length){var t=this;_.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(EXPOSURE_ATTR_EVENT_NAME)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=this;return exposureIntersection[e.area_rate]?exposureIntersection[e.area_rate]:exposureIntersection[e.area_rate]=new IntersectionObserver(function(){t.exposure.apply(t,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;_.each(e,function(e){var r=e.target,n=t.getEleOption(r);!1!==e.isIntersecting&&n&&!n.config.isSend?e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,o=i&&i.shouldExpose,a=i&&i.didExpose,s=sd.heatmap.getEleDetail(r),u=_.extend({},s,n.properties);if(o&&_.isFunction(o))try{if(!1===o(r,u))return}catch(l){}if(sd.track(n.eventName,u),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),a&&_.isFunction(a))try{a(r,u)}catch(l){}}},1e3*n.config.stay_duration)):n&&n.timer&&(clearTimeout(n.timer),n.timer=null)})},getEleOption:function(e){var t=null;return _.each(exposureEleOption,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=exposurePlugin.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return _.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(!(e=_.extend2Lev({},{config:_.extend({},exposureConfig)},n,e)).eventName)return log("parameter option.eventName error. option:",e),!1;_.isElement(t)||log("parameter element error. option:",e),this.getIntersection(e.config).observe(t),exposureEleOption.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(_.each(exposureEleOption,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=exposureIntersection[n.area_rate];i&&_.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&exposureEleOption.splice(r,1))}},start:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&n.observe(r)})},stop:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),exposureIntersection={},exposureEleOption=[]}},mutation={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){_.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?_.each(e.removedNodes,function(e){if(1===e.nodeType){exposurePlugin.removeWatchEle(e);var t=exposurePlugin.getElesByEventName(e);t.length&&_.each(t,function(e){exposurePlugin.removeWatchEle(e)})}}):e.addedNodes.length&&(exposurePlugin.addObserveByNodes(e.addedNodes),_.each(e.addedNodes,function(e){if(1===e.nodeType){var t=exposurePlugin.getElesByEventName(e);exposurePlugin.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!_.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=exposurePlugin.getEleAttr(t);n.ele=t,exposurePlugin.addOrUpdateWatchEle(n)}else r===EXPOSURE_ATTR_EVENT_NAME&&exposurePlugin.removeWatchEle(t)}})}},Exposure={exposureViews:exposureEleOption,init:function(e,t){if(!e||sd)return!1;_=(sd=e)._,log=sd.log,exposurePlugin.init(t),log("Exposure Plugin initialized successfully")},addExposureView:function(e,t){if(exposurePlugin.isReady)if(_.isElement(e)){var r={ele:e,config:_.isObject(t.config)?formatConfig(t.config):{},eventName:t.eventName,properties:_.isObject(t.properties)?t.properties:{},listener:_.isObject(t.listener)?t.listener:{}};_.isString(r.eventName)&&r.eventName?exposurePlugin.addOrUpdateWatchEle(r):log("parameter option.eventName error. option",t)}else log("parameter element error.");else log("Exposure Plugin uninitialized.")},removeExposureView:function(e){exposurePlugin.isReady?_.isElement(e)?exposurePlugin.removeWatchEle(e):log("removeExposureView parameter ele errors."):log("Exposure Plugin uninitialized.")}},index=createPlugin(Exposure,"Exposure","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,_,log,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,o){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,o)}i.on(r,a)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder,e}var EXPOSURE_ATTR_EVENT_NAME="data-sensors-exposure-event-name",exposureIntersection={},exposureEleOption=[],exposureConfig={area_rate:0,stay_duration:0,repeated:!0};function isSupport(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function formatConfig(e){var t={};return _.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:log("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:log("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||!1===r||"true"===r||!0===r?t.repeated="false"!==r&&Boolean(r):log("parameter config.repeated error. config:",e)}}),t}var exposurePlugin={isReady:!1,init:function(e){if(isSupport()){var t=this;_.isObject(e)&&(exposureConfig=_.extend(exposureConfig,formatConfig(e))),_.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),mutation.init()}),sd.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),_.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0}else log("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.")},getElesByEventName:function(e){return(e=e||document).querySelectorAll("["+EXPOSURE_ATTR_EVENT_NAME+"]")},getEleEventName:function(e){return e.getAttribute(EXPOSURE_ATTR_EVENT_NAME)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},i=this.getEleEventName(e),o={};return i&&(o.eventName=i),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var o=_.isObject(i)?i:JSON.parse(i);n=_.isObject(o.config)?o.config:n,r=_.isObject(o.properties)?o.properties:r}}catch(a){log("element attribute data-sensors-exposure-option error. value:",i)}}),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var o=t.name.match(/^data-sensors-exposure-property-(.+)/);o&&(r[o[1]]=i)}catch(s){}try{var a=t.name.match(/^data-sensors-exposure-config-(.+)/);if(a)switch(a[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(s){}}),o.config=formatConfig(n),o.properties=r,o},addObserveByNodes:function(e){if(e.length){var t=this;_.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(EXPOSURE_ATTR_EVENT_NAME)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=this;return exposureIntersection[e.area_rate]?exposureIntersection[e.area_rate]:exposureIntersection[e.area_rate]=new IntersectionObserver(function(){t.exposure.apply(t,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;_.each(e,function(e){var r=e.target,n=t.getEleOption(r);!1!==e.isIntersecting&&n&&!n.config.isSend?e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,o=i&&i.shouldExpose,a=i&&i.didExpose,s=sd.heatmap.getEleDetail(r),u=_.extend({},s,n.properties);if(o&&_.isFunction(o))try{if(!1===o(r,u))return}catch(l){}if(sd.track(n.eventName,u),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),a&&_.isFunction(a))try{a(r,u)}catch(l){}}},1e3*n.config.stay_duration)):n&&n.timer&&(clearTimeout(n.timer),n.timer=null)})},getEleOption:function(e){var t=null;return _.each(exposureEleOption,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=exposurePlugin.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return _.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(!(e=_.extend2Lev({},{config:_.extend({},exposureConfig)},n,e)).eventName)return log("parameter option.eventName error. option:",e),!1;_.isElement(t)||log("parameter element error. option:",e),this.getIntersection(e.config).observe(t),exposureEleOption.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(_.each(exposureEleOption,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=exposureIntersection[n.area_rate];i&&_.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&exposureEleOption.splice(r,1))}},start:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&n.observe(r)})},stop:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),exposureIntersection={},exposureEleOption=[]}},mutation={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){_.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?_.each(e.removedNodes,function(e){if(1===e.nodeType){exposurePlugin.removeWatchEle(e);var t=exposurePlugin.getElesByEventName(e);t.length&&_.each(t,function(e){exposurePlugin.removeWatchEle(e)})}}):e.addedNodes.length&&(exposurePlugin.addObserveByNodes(e.addedNodes),_.each(e.addedNodes,function(e){if(1===e.nodeType){var t=exposurePlugin.getElesByEventName(e);exposurePlugin.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!_.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=exposurePlugin.getEleAttr(t);n.ele=t,exposurePlugin.addOrUpdateWatchEle(n)}else r===EXPOSURE_ATTR_EVENT_NAME&&exposurePlugin.removeWatchEle(t)}})}},Exposure={exposureViews:exposureEleOption,init:function(e,t){if(!e||sd)return!1;_=(sd=e)._,log=sd.log,exposurePlugin.init(t),log("Exposure Plugin initialized successfully")},addExposureView:function(e,t){if(exposurePlugin.isReady)if(_.isElement(e)){var r={ele:e,config:_.isObject(t.config)?formatConfig(t.config):{},eventName:t.eventName,properties:_.isObject(t.properties)?t.properties:{},listener:_.isObject(t.listener)?t.listener:{}};_.isString(r.eventName)&&r.eventName?exposurePlugin.addOrUpdateWatchEle(r):log("parameter option.eventName error. option",t)}else log("parameter element error.");else log("Exposure Plugin uninitialized.")},removeExposureView:function(e){exposurePlugin.isReady?_.isElement(e)?exposurePlugin.removeWatchEle(e):log("removeExposureView parameter ele errors."):log("Exposure Plugin uninitialized.")}},index=createPlugin(Exposure,"Exposure","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.js b/dist/web/plugin/exposure/index.js index b4bcae94..a4781328 100644 --- a/dist/web/plugin/exposure/index.js +++ b/dist/web/plugin/exposure/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Exposure=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=u,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:s("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:s("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):s("parameter config.repeated error. config:",e)}}),t}var a,o,s,u="1.25.9",c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void s("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),u={};return a&&(u.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(u){s("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),u.config=i(n),u.properties=r,u},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return s("parameter option.eventName error. option:",e),!1;o.isElement(t)||s("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,s=a.log,v.init(t),void s("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void s("Exposure Plugin uninitialized.");if(!o.isElement(e))return void s("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void s("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void s("removeExposureView parameter ele errors."):void s("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Exposure=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=u,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:s("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:s("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):s("parameter config.repeated error. config:",e)}}),t}var a,o,s,u="1.25.10",c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void s("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),u={};return a&&(u.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(u){s("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),u.config=i(n),u.properties=r,u},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return s("parameter option.eventName error. option:",e),!1;o.isElement(t)||s("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,s=a.log,v.init(t),void s("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void s("Exposure Plugin uninitialized.");if(!o.isElement(e))return void s("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void s("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void s("removeExposureView parameter ele errors."):void s("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.closure.js b/dist/web/plugin/general-encryption/index.closure.js index db08658b..8a043096 100644 --- a/dist/web/plugin/general-encryption/index.closure.js +++ b/dist/web/plugin/general-encryption/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var r=n.init;n.init=function(o,c){function a(){r.call(n,o,c)}return i(o,n,t),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function i(n,i,t){function e(i,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(i).log():n.log&&n.log.apply(n,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function t(i,t,e){return n(i,t,e),i.plugin_version=o,i}var e,r,o="1.25.9",c={init:function(n,i){e=n,r=e._;var t=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=e&&e.log||o;var c=e.kit.encodeTrackData;return e&&e.kit&&c?r.isObject(t)&&r.isFunction(t.encryptEvent)&&r.isFunction(t.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(e.kit.encodeTrackData=function(n){try{var a=t.encryptEvent,l=t.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(t.encryptEvent)){var p=a(n),d=e._.base64Encode(p),s={pkv:u,ekey:l(y),payloads:[d]},g=JSON.stringify(s),f=encodeURIComponent(g);return"data="+f}return c.call(e.kit,n)}catch(v){return o("Encrypted data exception."),c.call(e.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},a=t(c,"GeneralEncryption","sdkReady");return a}(); \ No newline at end of file +!function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var r=n.init;n.init=function(o,c){function a(){r.call(n,o,c)}return i(o,n,t),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function i(n,i,t){function e(i,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(i).log():n.log&&n.log.apply(n,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function t(i,t,e){return n(i,t,e),i.plugin_version=o,i}var e,r,o="1.25.10",c={init:function(n,i){e=n,r=e._;var t=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=e&&e.log||o;var c=e.kit.encodeTrackData;return e&&e.kit&&c?r.isObject(t)&&r.isFunction(t.encryptEvent)&&r.isFunction(t.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(e.kit.encodeTrackData=function(n){try{var a=t.encryptEvent,l=t.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(t.encryptEvent)){var p=a(n),d=e._.base64Encode(p),s={pkv:u,ekey:l(y),payloads:[d]},g=JSON.stringify(s),f=encodeURIComponent(g);return"data="+f}return c.call(e.kit,n)}catch(v){return o("Encrypted data exception."),c.call(e.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},a=t(c,"GeneralEncryption","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.es6.js b/dist/web/plugin/general-encryption/index.es6.js index b895eb49..7f207b81 100644 --- a/dist/web/plugin/general-encryption/index.es6.js +++ b/dist/web/plugin/general-encryption/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,i){if(e&&(n.plugin_name=e),i&&n.init){var t=n.init;n.init=function(r,o){if(wrapLogFn(r,n,e),r.readyState&&r.readyState.state>=3||!r.on)return a();function a(){t.call(n,r,o)}r.on(i,a)}}return n}function wrapLogFn(n,e,i){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(i+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,i){return wrapPluginInitFn(n,e,i),n.plugin_version=sdkversion_placeholder,n}var GeneralEncryption={init:function(n,e){_=(sd=n)._;var i=e&&e.encrypt_utils,t=window.console&&window.console.log||function(){};t=sd&&sd.log||t;var r=sd.kit.encodeTrackData;sd&&sd.kit&&r?_.isObject(i)&&_.isFunction(i.encryptEvent)&&_.isFunction(i.encryptSymmetricKeyWithPublicKey)&&_.isString(e.pub_key)&&_.isNumber(e.pkv)?(sd.kit.encodeTrackData=function(n){try{var o=i.encryptEvent,a=i.encryptSymmetricKeyWithPublicKey,c=e.pkv,l=e.pub_key;if(_.isFunction(i.encryptEvent)){var u=o(n),d=sd._.base64Encode(u),p={pkv:c,ekey:a(l),payloads:[d]},s=JSON.stringify(p);return"data="+encodeURIComponent(s)}return r.call(sd.kit,n)}catch(y){return t("Encrypted data exception."),r.call(sd.kit,n)}},t("GeneralEncryption Plugin initialized successfully.")):t("GeneralEncryption Plugin initialization failed. parameter error."):t("Web SDK initialization failed.")}},index=createPlugin(GeneralEncryption,"GeneralEncryption","sdkReady");export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,i){if(e&&(n.plugin_name=e),i&&n.init){var t=n.init;n.init=function(r,o){if(wrapLogFn(r,n,e),r.readyState&&r.readyState.state>=3||!r.on)return a();function a(){t.call(n,r,o)}r.on(i,a)}}return n}function wrapLogFn(n,e,i){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(i+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,i){return wrapPluginInitFn(n,e,i),n.plugin_version=sdkversion_placeholder,n}var GeneralEncryption={init:function(n,e){_=(sd=n)._;var i=e&&e.encrypt_utils,t=window.console&&window.console.log||function(){};t=sd&&sd.log||t;var r=sd.kit.encodeTrackData;sd&&sd.kit&&r?_.isObject(i)&&_.isFunction(i.encryptEvent)&&_.isFunction(i.encryptSymmetricKeyWithPublicKey)&&_.isString(e.pub_key)&&_.isNumber(e.pkv)?(sd.kit.encodeTrackData=function(n){try{var o=i.encryptEvent,a=i.encryptSymmetricKeyWithPublicKey,c=e.pkv,l=e.pub_key;if(_.isFunction(i.encryptEvent)){var u=o(n),d=sd._.base64Encode(u),p={pkv:c,ekey:a(l),payloads:[d]},s=JSON.stringify(p);return"data="+encodeURIComponent(s)}return r.call(sd.kit,n)}catch(y){return t("Encrypted data exception."),r.call(sd.kit,n)}},t("GeneralEncryption Plugin initialized successfully.")):t("GeneralEncryption Plugin initialization failed. parameter error."):t("Web SDK initialization failed.")}},index=createPlugin(GeneralEncryption,"GeneralEncryption","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.js b/dist/web/plugin/general-encryption/index.js index 5a19391d..c74e4a2e 100644 --- a/dist/web/plugin/general-encryption/index.js +++ b/dist/web/plugin/general-encryption/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).GeneralEncryption=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(o,a){function c(){r.call(n,o,a)}return i(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(t,c)}}return n}function i(n,i,e){function t(i,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(i).log():n.log&&n.log.apply(n,t)}i.log=function(){t("log",arguments)},i.warn=function(){t("warn",arguments)},i.error=function(){t("error",arguments)}}function e(i,e,t){return n(i,e,t),i.plugin_version=o,i}var t,r,o="1.25.9",a={init:function(n,i){t=n,r=t._;var e=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=t&&t.log||o;var a=t.kit.encodeTrackData;return t&&t.kit&&a?r.isObject(e)&&r.isFunction(e.encryptEvent)&&r.isFunction(e.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(t.kit.encodeTrackData=function(n){try{var c=e.encryptEvent,l=e.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(e.encryptEvent)){var p=c(n),s=t._.base64Encode(p),d={pkv:u,ekey:l(y),payloads:[s]},g=JSON.stringify(d),f=encodeURIComponent(g);return"data="+f}return a.call(t.kit,n)}catch(v){return o("Encrypted data exception."),a.call(t.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},c=e(a,"GeneralEncryption","sdkReady");return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).GeneralEncryption=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(o,a){function c(){r.call(n,o,a)}return i(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(t,c)}}return n}function i(n,i,e){function t(i,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(i).log():n.log&&n.log.apply(n,t)}i.log=function(){t("log",arguments)},i.warn=function(){t("warn",arguments)},i.error=function(){t("error",arguments)}}function e(i,e,t){return n(i,e,t),i.plugin_version=o,i}var t,r,o="1.25.10",a={init:function(n,i){t=n,r=t._;var e=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=t&&t.log||o;var a=t.kit.encodeTrackData;return t&&t.kit&&a?r.isObject(e)&&r.isFunction(e.encryptEvent)&&r.isFunction(e.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(t.kit.encodeTrackData=function(n){try{var c=e.encryptEvent,l=e.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(e.encryptEvent)){var p=c(n),s=t._.base64Encode(p),d={pkv:u,ekey:l(y),payloads:[s]},g=JSON.stringify(d),f=encodeURIComponent(g);return"data="+f}return a.call(t.kit,n)}catch(v){return o("Encrypted data exception."),a.call(t.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},c=e(a,"GeneralEncryption","sdkReady");return c}(); \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.closure.js b/dist/web/plugin/image-sender/index.closure.js index c2043ebe..83712f4b 100644 --- a/dist/web/plugin/image-sender/index.closure.js +++ b/dist/web/plugin/image-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(o,i){function l(){a.call(n,o,i)}return e(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?l():void o.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=g,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new c.ImageSend(n);e.start()}function o(n,e){var r=n.server_url,o=n.data;c.isArray(r)&&r.length?c.each(r,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof r&&""!==r?(n.data=t(r,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function i(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:o}})})}var u,c,g="1.25.9",f={plugin_name:"ImageSender",init:function(n){u=n,c=u._,l()}},s=r(f);return s}(); \ No newline at end of file +!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=g,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new c.ImageSend(n);e.start()}function i(n,e){var r=null;c.isObject(n.config)&&(r=c.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,c.isArray(i)&&i.length?c.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,c,g="1.25.10",s={plugin_name:"ImageSender",init:function(n){u=n,c=u._,l()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.es6.js b/dist/web/plugin/image-sender/index.es6.js index 81fdc90c..bb443a8c 100644 --- a/dist/web/plugin/image-sender/index.es6.js +++ b/dist/web/plugin/image-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function getSendUrl(n,e){var r=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+r:n+"?"+r}function sendData(n){new _.ImageSend(n).start()}function sendInterceptor(n,e){var r=n.server_url,t=n.data;_.isArray(r)&&r.length?_.each(r,function(e){e&&(n.data=getSendUrl(e,t),n.callback=null,n.server_url=e,sendData(n))}):"string"==typeof r&&""!==r?(n.data=getSendUrl(r,t),sendData(n)):sd.logger&&sd.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function initPara(){"image"!==sd.para.send_type&&"ajax"!==sd.para.send_type&&"beacon"!==sd.para.send_type&&(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor}})})}var ImageSender={plugin_name:"ImageSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(ImageSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function getSendUrl(n,e){var r=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+r:n+"?"+r}function sendData(n){new _.ImageSend(n).start()}function sendInterceptor(n,e){var r=null;_.isObject(n.config)&&(r=_.optimizeServerUrl(n.config.server_url));var t=r||n.server_url,a=n.data;n.server_url=t,_.isArray(t)&&t.length?_.each(t,function(e){e&&(n.data=getSendUrl(e,a),n.callback=null,n.server_url=e,sendData(n))}):"string"==typeof t&&""!==t?(n.data=getSendUrl(t,a),sendData(n)):sd.logger&&sd.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function initPara(){"image"!==sd.para.send_type&&"ajax"!==sd.para.send_type&&"beacon"!==sd.para.send_type&&(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor}})})}var ImageSender={plugin_name:"ImageSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(ImageSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.js b/dist/web/plugin/image-sender/index.js index 7af7f36c..7d2f38e1 100644 --- a/dist/web/plugin/image-sender/index.js +++ b/dist/web/plugin/image-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ImageSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(o,i){function l(){a.call(n,o,i)}return e(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?l():void o.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=c,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new g.ImageSend(n);e.start()}function o(n,e){var r=n.server_url,o=n.data;g.isArray(r)&&r.length?g.each(r,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof r&&""!==r?(n.data=t(r,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function i(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:o}})})}var u,g,c="1.25.9",s={plugin_name:"ImageSender",init:function(n){u=n,g=u._,l()}},f=r(s);return f}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ImageSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=c,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new g.ImageSend(n);e.start()}function i(n,e){var r=null;g.isObject(n.config)&&(r=g.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,g.isArray(i)&&i.length?g.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,g,c="1.25.10",s={plugin_name:"ImageSender",init:function(n){u=n,g=u._,l()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.closure.js b/dist/web/plugin/ios-bridge/index.closure.js index caa0e442..00f68b7a 100644 --- a/dist/web/plugin/ios-bridge/index.closure.js +++ b/dist/web/plugin/ios-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=g,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),c("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,c,g="1.25.9",l={init:function(e){d=e,_=d&&d._,c=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file +!function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=g,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),c("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,c,g="1.25.10",l={init:function(e){d=e,_=d&&d._,c=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.es6.js b/dist/web/plugin/ios-bridge/index.es6.js index 55121aa5..1952912f 100644 --- a/dist/web/plugin/ios-bridge/index.es6.js +++ b/dist/web/plugin/ios-bridge/index.es6.js @@ -1 +1 @@ -var iosServerUrl,iosTracker,sd,_,log,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,r,i){if(r&&(e.plugin_name=r),i&&e.init){var a=e.init;e.init=function(s,n){if(wrapLogFn(s,e,r),s.readyState&&s.readyState.state>=3||!s.on)return t();function t(){a.call(e,s,n)}s.on(i,t)}}return e}function wrapLogFn(e,r,i){function a(r,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(r).log():e.log&&e.log.apply(e,a)}r.log=function(){a("log",arguments)},r.warn=function(){a("warn",arguments)},r.error=function(){a("error",arguments)}}function createPlugin(e,r,i){return wrapPluginInitFn(e,r,i),e.plugin_version=sdkversion_placeholder,e}var IOSBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd&&!sd.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd.bridge.activeBridge=IOSBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=iosServerUrl&&sd.bridge.validateAppUrl(iosServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData}}),log("IOS bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return sd.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:sd.para.server_url},e.data)})),_.isFunction(i)&&i(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return"page_info"!==r&&"visualized_track"!==r||sd.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===r?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[r]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var index=createPlugin(IOSBridge,"IOSBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var iosServerUrl,iosTracker,sd,_,log,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,r,i){if(r&&(e.plugin_name=r),i&&e.init){var a=e.init;e.init=function(s,n){if(wrapLogFn(s,e,r),s.readyState&&s.readyState.state>=3||!s.on)return t();function t(){a.call(e,s,n)}s.on(i,t)}}return e}function wrapLogFn(e,r,i){function a(r,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(r).log():e.log&&e.log.apply(e,a)}r.log=function(){a("log",arguments)},r.warn=function(){a("warn",arguments)},r.error=function(){a("error",arguments)}}function createPlugin(e,r,i){return wrapPluginInitFn(e,r,i),e.plugin_version=sdkversion_placeholder,e}var IOSBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd&&!sd.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd.bridge.activeBridge=IOSBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=iosServerUrl&&sd.bridge.validateAppUrl(iosServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData}}),log("IOS bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return sd.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:sd.para.server_url},e.data)})),_.isFunction(i)&&i(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return"page_info"!==r&&"visualized_track"!==r||sd.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===r?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[r]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var index=createPlugin(IOSBridge,"IOSBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.js b/dist/web/plugin/ios-bridge/index.js index af0ad91c..22cbcba8 100644 --- a/dist/web/plugin/ios-bridge/index.js +++ b/dist/web/plugin/ios-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSBridge=function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=c,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),g("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,g,c="1.25.9",l={init:function(e){d=e,_=d&&d._,g=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSBridge=function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=c,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),g("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,g,c="1.25.10",l={init:function(e){d=e,_=d&&d._,g=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.closure.js b/dist/web/plugin/ios-obsolete-bridge/index.closure.js index c0c11c0a..7555931e 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.closure.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=l,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),c("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,c,l="1.25.9",g={init:function(e){s=e,u=s&&s._,c=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file +!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=l,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),c("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,c,l="1.25.10",g={init:function(e){s=e,u=s&&s._,c=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.es6.js b/dist/web/plugin/ios-obsolete-bridge/index.es6.js index 2270dba8..545d821a 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.es6.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.es6.js @@ -1 +1 @@ -var sd,_,log,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,r,t){if(r&&(e.plugin_name=r),t&&e.init){var n=e.init;e.init=function(i,s){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,s)}i.on(t,a)}}return e}function wrapLogFn(e,r,t){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(t+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,t){return wrapPluginInitFn(e,r,t),e.plugin_version=sdkversion_placeholder,e}var IOSObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()}};function initBridge(){sd&&!sd.bridge.activeBridge&&hasBridge()&&(sd.bridge.activeBridge=IOSObsoleteBridge,sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData}}),log("IOS obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var r=null,t=null;try{r=_.URL(sd.para.server_url).hostname,t=_.URL(sd.para.server_url).searchParams.get("project")||"default"}catch(n){sd.log(n)}return!(!r||r!==e[0]||!t||t!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var t,n,i=e.callback;if(sd.bridge.bridge_info.verify_success){var s=document.createElement("iframe"),a=(t=e.data,n=(n=JSON.stringify(_.extend({server_url:sd.para.server_url},t))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return s.setAttribute("src",a),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,_.isFunction(i)&&i(),r.cancellationToken.cancel(),!0}return sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}var index=createPlugin(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,_,log,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,r,t){if(r&&(e.plugin_name=r),t&&e.init){var n=e.init;e.init=function(i,s){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,s)}i.on(t,a)}}return e}function wrapLogFn(e,r,t){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(t+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,t){return wrapPluginInitFn(e,r,t),e.plugin_version=sdkversion_placeholder,e}var IOSObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()}};function initBridge(){sd&&!sd.bridge.activeBridge&&hasBridge()&&(sd.bridge.activeBridge=IOSObsoleteBridge,sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData}}),log("IOS obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var r=null,t=null;try{r=_.URL(sd.para.server_url).hostname,t=_.URL(sd.para.server_url).searchParams.get("project")||"default"}catch(n){sd.log(n)}return!(!r||r!==e[0]||!t||t!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var t,n,i=e.callback;if(sd.bridge.bridge_info.verify_success){var s=document.createElement("iframe"),a=(t=e.data,n=(n=JSON.stringify(_.extend({server_url:sd.para.server_url},t))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return s.setAttribute("src",a),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,_.isFunction(i)&&i(),r.cancellationToken.cancel(),!0}return sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}var index=createPlugin(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.js b/dist/web/plugin/ios-obsolete-bridge/index.js index a3cff1b7..f6411abe 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSObsoleteBridge=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=c,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void l("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),l("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,l,c="1.25.9",g={init:function(e){s=e,u=s&&s._,l=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSObsoleteBridge=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=c,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void l("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),l("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,l,c="1.25.10",g={init:function(e){s=e,u=s&&s._,l=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.closure.js b/dist/web/plugin/jsapp-sender/index.closure.js index 7d4e13a8..91b0f653 100644 --- a/dist/web/plugin/jsapp-sender/index.closure.js +++ b/dist/web/plugin/jsapp-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return t(r,n,a),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=s,t}function e(n,t){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),o.para.jsapp.setData(a),t.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var t=o.para.jsapp.getData();p.isArray(t)&&t.length>0&&p.each(t,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.25.9",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=a(c);return l}(); \ No newline at end of file +!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return t(r,n,a),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=s,t}function e(n,t){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),o.para.jsapp.setData(a),t.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var t=o.para.jsapp.getData();p.isArray(t)&&t.length>0&&p.each(t,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.25.10",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=a(c);return l}(); \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.es6.js b/dist/web/plugin/jsapp-sender/index.es6.js index 85633a99..02cf65ea 100644 --- a/dist/web/plugin/jsapp-sender/index.es6.js +++ b/dist/web/plugin/jsapp-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var t=n.init;n.init=function(i,r){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){t.call(n,i,r)}i.on(a,s)}}return n}function wrapLogFn(n,e,a){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(a+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,a){return wrapPluginInitFn(n,e,a),n.plugin_version=sdkversion_placeholder,n}function sendData(n,e){if(_.isObject(sd.para.jsapp)&&!sd.para.jsapp.isOnline&&"function"==typeof sd.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),sd.para.jsapp.setData(a),e.cancellationToken.stop()}return n}function senderInit(){sd.on("sdkAfterInitAPI",function(){_.isObject(sd.commonWays)&&(sd.commonWays.setOnlineState=setOnlineState),sd.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData}})})}function setOnlineState(n){if(!0===n&&_.isObject(sd.para.jsapp)&&"function"==typeof sd.para.jsapp.getData){sd.para.jsapp.isOnline=!0;var e=sd.para.jsapp.getData();_.isArray(e)&&e.length>0&&_.each(e,function(n){_.isJSONString(n)&&sd.kit.sendData(JSON.parse(n))})}else sd.para.jsapp.isOnline=!1}var JsappSender={plugin_name:"JsappSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(JsappSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var t=n.init;n.init=function(i,r){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){t.call(n,i,r)}i.on(a,s)}}return n}function wrapLogFn(n,e,a){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(a+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,a){return wrapPluginInitFn(n,e,a),n.plugin_version=sdkversion_placeholder,n}function sendData(n,e){if(_.isObject(sd.para.jsapp)&&!sd.para.jsapp.isOnline&&"function"==typeof sd.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),sd.para.jsapp.setData(a),e.cancellationToken.stop()}return n}function senderInit(){sd.on("sdkAfterInitAPI",function(){_.isObject(sd.commonWays)&&(sd.commonWays.setOnlineState=setOnlineState),sd.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData}})})}function setOnlineState(n){if(!0===n&&_.isObject(sd.para.jsapp)&&"function"==typeof sd.para.jsapp.getData){sd.para.jsapp.isOnline=!0;var e=sd.para.jsapp.getData();_.isArray(e)&&e.length>0&&_.each(e,function(n){_.isJSONString(n)&&sd.kit.sendData(JSON.parse(n))})}else sd.para.jsapp.isOnline=!1}var JsappSender={plugin_name:"JsappSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(JsappSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.js b/dist/web/plugin/jsapp-sender/index.js index d3d9e2f0..35844c69 100644 --- a/dist/web/plugin/jsapp-sender/index.js +++ b/dist/web/plugin/jsapp-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).JsappSender=function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return a(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function a(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function t(a,t,e){return n(a,t,e),a.plugin_version=s,a}function e(n,a){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var t=n;delete t.callback,t=JSON.stringify(t),o.para.jsapp.setData(t),a.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var a=o.para.jsapp.getData();p.isArray(a)&&a.length>0&&p.each(a,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.25.9",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=t(c);return l}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).JsappSender=function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return a(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function a(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function t(a,t,e){return n(a,t,e),a.plugin_version=s,a}function e(n,a){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var t=n;delete t.callback,t=JSON.stringify(t),o.para.jsapp.setData(t),a.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var a=o.para.jsapp.getData();p.isArray(a)&&a.length>0&&p.each(a,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.25.10",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=t(c);return l}(); \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.closure.js b/dist/web/plugin/pageleave/index.closure.js index 709a6043..8ffbc612 100644 --- a/dist/web/plugin/pageleave/index.closure.js +++ b/dist/web/plugin/pageleave/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,i,a){if(i&&(t.plugin_name=i),a&&t.init){var r=t.init;t.init=function(s,n){function o(){r.call(t,s,n)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(a,o)}}return t}function e(t,e,i){function a(e,a){t.logger?t.logger.msg.apply(t.logger,a).module(i+""||"").level(e).log():t.log&&t.log.apply(t,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function i(e,i,a){return t(e,i,a),e.plugin_version=r,e}function a(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=n}var r="1.25.9",s=5e3,n=432e3;a.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var i=e.heartbeat_interval_time;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.heartbeat_interval_time=1e3*i);var a=e.max_duration;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.max_duration=a)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},a.prototype.log=function(t){this.sd&&this.sd.log(t)},a.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},s)},a.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},a.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},a.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},a.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},a.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},a.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},a.prototype.addSinglePageListener=function(){var t=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(e){e!==location.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.current_page_url=t.url,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})},a.prototype.addPageEndListener=function(){var t=this;this._.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&t._.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})},a.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},a.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},a.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},a.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},a.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),i=new Date;e.$time=i,"is_first_heartbeat"===t&&(e.event_duration=3.14);var a=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});try{"success"===this.sd.bridge.bridge_info.verify_success&&(a.properties.$time=1*i)}catch(r){this.log(r.message)}a.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,a)},a.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},a.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var i=window.localStorage.key(e);if(i&&i!==this.storage_name+"-"+this.page_id&&0===i.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(i);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(i))}}},a.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),i=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;i=Math.round(i)||0;var a={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:i};return 0!==t&&(a.event_duration=t),a=this._.extend(a,this.option.custom_props)};var o=new a,h=i(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file +!function(){"use strict";function t(t,i,a){if(i&&(t.plugin_name=i),a&&t.init){var r=t.init;t.init=function(s,n){function o(){r.call(t,s,n)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(a,o)}}return t}function e(t,e,i){function a(e,a){t.logger?t.logger.msg.apply(t.logger,a).module(i+""||"").level(e).log():t.log&&t.log.apply(t,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function i(e,i,a){return t(e,i,a),e.plugin_version=r,e}function a(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=n}var r="1.25.10",s=5e3,n=432e3;a.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var i=e.heartbeat_interval_time;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.heartbeat_interval_time=1e3*i);var a=e.max_duration;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.max_duration=a)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},a.prototype.log=function(t){this.sd&&this.sd.log(t)},a.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},s)},a.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},a.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},a.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},a.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},a.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},a.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},a.prototype.addSinglePageListener=function(){var t=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(e){e!==location.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.current_page_url=t.url,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})},a.prototype.addPageEndListener=function(){var t=this;this._.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&t._.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})},a.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},a.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},a.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},a.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},a.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),i=new Date;e.$time=i,"is_first_heartbeat"===t&&(e.event_duration=3.14);var a=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});try{"success"===this.sd.bridge.bridge_info.verify_success&&(a.properties.$time=1*i)}catch(r){this.log(r.message)}a.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,a)},a.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},a.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var i=window.localStorage.key(e);if(i&&i!==this.storage_name+"-"+this.page_id&&0===i.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(i);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(i))}}},a.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),i=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;i=Math.round(i)||0;var a={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:i};return 0!==t&&(a.event_duration=t),a=this._.extend(a,this.option.custom_props)};var o=new a,h=i(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.es6.js b/dist/web/plugin/pageleave/index.es6.js index 4a209d52..6a2f221b 100644 --- a/dist/web/plugin/pageleave/index.es6.js +++ b/dist/web/plugin/pageleave/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,t,a){if(t&&(e.plugin_name=t),a&&e.init){var i=e.init;e.init=function(r,n){if(wrapLogFn(r,e,t),r.readyState&&r.readyState.state>=3||!r.on)return s();function s(){i.call(e,r,n)}r.on(a,s)}}return e}function wrapLogFn(e,t,a){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,a){return wrapPluginInitFn(e,t,a),e.plugin_version=sdkversion_placeholder,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var a=t.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=t.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),a=new Date;t.$time=a,"is_first_heartbeat"===e&&(t.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(i.properties.$time=1*a)}catch(r){this.log(r.message)}i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(t);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:a};return 0!==e&&(i.event_duration=e),i=this._.extend(i,this.option.custom_props)};var pageLeave=new PageLeave,index=createPlugin(pageLeave,"PageLeave","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,t,a){if(t&&(e.plugin_name=t),a&&e.init){var i=e.init;e.init=function(r,n){if(wrapLogFn(r,e,t),r.readyState&&r.readyState.state>=3||!r.on)return s();function s(){i.call(e,r,n)}r.on(a,s)}}return e}function wrapLogFn(e,t,a){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,a){return wrapPluginInitFn(e,t,a),e.plugin_version=sdkversion_placeholder,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var a=t.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=t.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),a=new Date;t.$time=a,"is_first_heartbeat"===e&&(t.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(i.properties.$time=1*a)}catch(r){this.log(r.message)}i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(t);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:a};return 0!==e&&(i.event_duration=e),i=this._.extend(i,this.option.custom_props)};var pageLeave=new PageLeave,index=createPlugin(pageLeave,"PageLeave","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.js b/dist/web/plugin/pageleave/index.js index da0195cc..8edad32a 100644 --- a/dist/web/plugin/pageleave/index.js +++ b/dist/web/plugin/pageleave/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLeave=function(){"use strict";function t(t,i,a){if(i&&(t.plugin_name=i),a&&t.init){var r=t.init;t.init=function(s,n){function o(){r.call(t,s,n)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(a,o)}}return t}function e(t,e,i){function a(e,a){t.logger?t.logger.msg.apply(t.logger,a).module(i+""||"").level(e).log():t.log&&t.log.apply(t,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function i(e,i,a){return t(e,i,a),e.plugin_version=r,e}function a(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=n}var r="1.25.9",s=5e3,n=432e3;a.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var i=e.heartbeat_interval_time;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.heartbeat_interval_time=1e3*i);var a=e.max_duration;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.max_duration=a)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},a.prototype.log=function(t){this.sd&&this.sd.log(t)},a.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},s)},a.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},a.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},a.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},a.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},a.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},a.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},a.prototype.addSinglePageListener=function(){var t=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(e){e!==location.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.current_page_url=t.url,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})},a.prototype.addPageEndListener=function(){var t=this;this._.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&t._.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})},a.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},a.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},a.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},a.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},a.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),i=new Date;e.$time=i,"is_first_heartbeat"===t&&(e.event_duration=3.14);var a=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});try{"success"===this.sd.bridge.bridge_info.verify_success&&(a.properties.$time=1*i)}catch(r){this.log(r.message)}a.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,a)},a.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},a.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var i=window.localStorage.key(e);if(i&&i!==this.storage_name+"-"+this.page_id&&0===i.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(i);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(i))}}},a.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),i=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;i=Math.round(i)||0;var a={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:i};return 0!==t&&(a.event_duration=t),a=this._.extend(a,this.option.custom_props)};var o=new a,h=i(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLeave=function(){"use strict";function t(t,i,a){if(i&&(t.plugin_name=i),a&&t.init){var r=t.init;t.init=function(s,n){function o(){r.call(t,s,n)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(a,o)}}return t}function e(t,e,i){function a(e,a){t.logger?t.logger.msg.apply(t.logger,a).module(i+""||"").level(e).log():t.log&&t.log.apply(t,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function i(e,i,a){return t(e,i,a),e.plugin_version=r,e}function a(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=n}var r="1.25.10",s=5e3,n=432e3;a.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var i=e.heartbeat_interval_time;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.heartbeat_interval_time=1e3*i);var a=e.max_duration;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.max_duration=a)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},a.prototype.log=function(t){this.sd&&this.sd.log(t)},a.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},s)},a.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},a.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},a.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},a.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},a.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},a.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},a.prototype.addSinglePageListener=function(){var t=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(e){e!==location.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.current_page_url=t.url,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})},a.prototype.addPageEndListener=function(){var t=this;this._.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&t._.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})},a.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},a.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},a.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},a.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},a.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),i=new Date;e.$time=i,"is_first_heartbeat"===t&&(e.event_duration=3.14);var a=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});try{"success"===this.sd.bridge.bridge_info.verify_success&&(a.properties.$time=1*i)}catch(r){this.log(r.message)}a.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,a)},a.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},a.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var i=window.localStorage.key(e);if(i&&i!==this.storage_name+"-"+this.page_id&&0===i.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(i);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(i))}}},a.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),i=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;i=Math.round(i)||0;var a={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:i};return 0!==t&&(a.event_duration=t),a=this._.extend(a,this.option.custom_props)};var o=new a,h=i(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.closure.js b/dist/web/plugin/pageload/index.closure.js index f6cd5544..7ad9cc57 100644 --- a/dist/web/plugin/pageload/index.closure.js +++ b/dist/web/plugin/pageload/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var o=e.init;e.init=function(i,a){function d(){o.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(r,d)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,o){return e(n,t,o),n.plugin_version=r,n}var r="1.25.9",o=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}function r(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var r=n.getEntriesByType("navigation")||[{}];t=(r[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||r(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}o||(e.track("$WebPageLoad",c),o=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file +!function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var o=e.init;e.init=function(i,a){function d(){o.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(r,d)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,o){return e(n,t,o),n.plugin_version=r,n}var r="1.25.10",o=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}function r(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var r=n.getEntriesByType("navigation")||[{}];t=(r[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||r(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}o||(e.track("$WebPageLoad",c),o=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.es6.js b/dist/web/plugin/pageload/index.es6.js index 3a17f145..22ea88fd 100644 --- a/dist/web/plugin/pageload/index.es6.js +++ b/dist/web/plugin/pageload/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(o,i){if(wrapLogFn(o,e,n),o.readyState&&o.readyState.state>=3||!o.on)return a();function a(){r.call(e,o,i)}o.on(t,a)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var eventSent=!1,PageLoad={init:function(e,n){function t(){var r=0,o=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,i={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(o?(r=function(n){var t=0;return e._.isFunction(n.getEntriesByType)&&(t=((n.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),t}(o)||function(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}(o),function(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}(o,i)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),r>0){var a=e._.isObject(n)&&n.max_duration||1800;r=Number((r/1e3).toFixed(3)),(!e._.isNumber(a)||a<=0||r<=a)&&(i.event_duration=r)}eventSent||(e.track("$WebPageLoad",i),eventSent=!0),window.removeEventListener?window.removeEventListener("load",t):window.detachEvent&&window.detachEvent("onload",t)}"complete"==document.readyState?t():window.addEventListener?window.addEventListener("load",t):window.attachEvent&&window.attachEvent("onload",t)}},index=createPlugin(PageLoad,"PageLoad","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(o,i){if(wrapLogFn(o,e,n),o.readyState&&o.readyState.state>=3||!o.on)return a();function a(){r.call(e,o,i)}o.on(t,a)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var eventSent=!1,PageLoad={init:function(e,n){function t(){var r=0,o=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,i={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(o?(r=function(n){var t=0;return e._.isFunction(n.getEntriesByType)&&(t=((n.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),t}(o)||function(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}(o),function(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}(o,i)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),r>0){var a=e._.isObject(n)&&n.max_duration||1800;r=Number((r/1e3).toFixed(3)),(!e._.isNumber(a)||a<=0||r<=a)&&(i.event_duration=r)}eventSent||(e.track("$WebPageLoad",i),eventSent=!0),window.removeEventListener?window.removeEventListener("load",t):window.detachEvent&&window.detachEvent("onload",t)}"complete"==document.readyState?t():window.addEventListener?window.addEventListener("load",t):window.attachEvent&&window.attachEvent("onload",t)}},index=createPlugin(PageLoad,"PageLoad","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.js b/dist/web/plugin/pageload/index.js index f8f0a94a..9b25254a 100644 --- a/dist/web/plugin/pageload/index.js +++ b/dist/web/plugin/pageload/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLoad=function(){"use strict";function e(e,t,o){if(t&&(e.plugin_name=t),o&&e.init){var r=e.init;e.init=function(i,a){function d(){r.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(o,d)}}return e}function n(e,n,t){function o(n,o){e.logger?e.logger.msg.apply(e.logger,o).module(t+""||"").level(n).log():e.log&&e.log.apply(e,o)}n.log=function(){o("log",arguments)},n.warn=function(){o("warn",arguments)},n.error=function(){o("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=o,n}var o="1.25.9",r=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var o=n.getEntries(),r=null,i=0;i=0&&r<10737418240&&(t.$page_resource_size=Number((r/1024).toFixed(3)))}}function o(n){var t=0;if(n.timing){var o=n.timing;0!==o.fetchStart&&e._.isNumber(o.fetchStart)&&0!==o.domContentLoadedEventEnd&&e._.isNumber(o.domContentLoadedEventEnd)?t=o.domContentLoadedEventEnd-o.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var o=n.getEntriesByType("navigation")||[{}];t=(o[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||o(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}r||(e.track("$WebPageLoad",c),r=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLoad=function(){"use strict";function e(e,t,o){if(t&&(e.plugin_name=t),o&&e.init){var r=e.init;e.init=function(i,a){function d(){r.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(o,d)}}return e}function n(e,n,t){function o(n,o){e.logger?e.logger.msg.apply(e.logger,o).module(t+""||"").level(n).log():e.log&&e.log.apply(e,o)}n.log=function(){o("log",arguments)},n.warn=function(){o("warn",arguments)},n.error=function(){o("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=o,n}var o="1.25.10",r=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var o=n.getEntries(),r=null,i=0;i=0&&r<10737418240&&(t.$page_resource_size=Number((r/1024).toFixed(3)))}}function o(n){var t=0;if(n.timing){var o=n.timing;0!==o.fetchStart&&e._.isNumber(o.fetchStart)&&0!==o.domContentLoadedEventEnd&&e._.isNumber(o.domContentLoadedEventEnd)?t=o.domContentLoadedEventEnd-o.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var o=n.getEntriesByType("navigation")||[{}];t=(o[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||o(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}r||(e.track("$WebPageLoad",c),r=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.closure.js b/dist/web/plugin/register-properties/index.closure.js index b7a6df00..1eba3467 100644 --- a/dist/web/plugin/register-properties/index.closure.js +++ b/dist/web/plugin/register-properties/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,e){if("track"!==t.type)return t;var i=e.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},t),s=e.customRegister,p=n.properties,u=n.event,c={};return r.each(s,function(t){if(r.isObject(t))r.indexOf(t.events,u)>-1&&o({properties:t.properties})&&(c=r.extend(c,t.properties));else if(r.isFunction(t)){var e=t({event:u,properties:p,data:n});r.isObject(e)&&!r.isEmptyObject(e)&&o({properties:e})&&(c=r.extend(c,e))}}),t.properties=r.extend(p,c),t}function e(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var o=t.init;t.init=function(n,s){function p(){o.call(t,n,s)}return r(n,t,e),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return t}function r(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function o(t,e,r){return i(t,e,r),t.plugin_version=n,t}e.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var i=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return t(e,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.25.9";e.prototype.plugin_name="RegisterProperties";var s=new e,p=o(s);return p}(); \ No newline at end of file +!function(){"use strict";function t(t,e){if("track"!==t.type)return t;var i=e.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},t),s=e.customRegister,p=n.properties,u=n.event,c={};return r.each(s,function(t){if(r.isObject(t))r.indexOf(t.events,u)>-1&&o({properties:t.properties})&&(c=r.extend(c,t.properties));else if(r.isFunction(t)){var e=t({event:u,properties:p,data:n});r.isObject(e)&&!r.isEmptyObject(e)&&o({properties:e})&&(c=r.extend(c,e))}}),t.properties=r.extend(p,c),t}function e(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var o=t.init;t.init=function(n,s){function p(){o.call(t,n,s)}return r(n,t,e),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return t}function r(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function o(t,e,r){return i(t,e,r),t.plugin_version=n,t}e.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var i=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return t(e,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.25.10";e.prototype.plugin_name="RegisterProperties";var s=new e,p=o(s);return p}(); \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.es6.js b/dist/web/plugin/register-properties/index.es6.js index b4a7d076..6a17d1c5 100644 --- a/dist/web/plugin/register-properties/index.es6.js +++ b/dist/web/plugin/register-properties/index.es6.js @@ -1 +1 @@ -function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,s=i.saEvent.check,n=r.extend2Lev({properties:{}},e),o=t.customRegister,p=n.properties,g=n.event,l={};return r.each(o,function(e){if(r.isObject(e))r.indexOf(e.events,g)>-1&&s({properties:e.properties})&&(l=r.extend(l,e.properties));else if(r.isFunction(e)){var t=e({event:g,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&s({properties:t})&&(l=r.extend(l,t))}}),e.properties=r.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var r=e.init;e.init=function(s,n){if(wrapLogFn(s,e,t),s.readyState&&s.readyState.state>=3||!s.on)return o();function o(){r.call(e,s,n)}s.on(i,o)}}return e}function wrapLogFn(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index=createPlugin(instance);export default index; \ No newline at end of file +function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,s=i.saEvent.check,n=r.extend2Lev({properties:{}},e),o=t.customRegister,p=n.properties,g=n.event,l={};return r.each(o,function(e){if(r.isObject(e))r.indexOf(e.events,g)>-1&&s({properties:e.properties})&&(l=r.extend(l,e.properties));else if(r.isFunction(e)){var t=e({event:g,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&s({properties:t})&&(l=r.extend(l,t))}}),e.properties=r.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var r=e.init;e.init=function(s,n){if(wrapLogFn(s,e,t),s.readyState&&s.readyState.state>=3||!s.on)return o();function o(){r.call(e,s,n)}s.on(i,o)}}return e}function wrapLogFn(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index=createPlugin(instance);export default index; \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.js b/dist/web/plugin/register-properties/index.js index ef6b5bf7..595e2ed4 100644 --- a/dist/web/plugin/register-properties/index.js +++ b/dist/web/plugin/register-properties/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterProperties=function(){"use strict";function e(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},e),s=t.customRegister,p=n.properties,u=n.event,g={};return r.each(s,function(e){if(r.isObject(e))r.indexOf(e.events,u)>-1&&o({properties:e.properties})&&(g=r.extend(g,e.properties));else if(r.isFunction(e)){var t=e({event:u,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&o({properties:t})&&(g=r.extend(g,t))}}),e.properties=r.extend(p,g),e}function t(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var o=e.init;e.init=function(n,s){function p(){o.call(e,n,s)}return r(n,e,t),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return e}function r(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function o(e,t,r){return i(e,t,r),e.plugin_version=n,e}t.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var i=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return e(t,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.25.9";t.prototype.plugin_name="RegisterProperties";var s=new t,p=o(s);return p}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterProperties=function(){"use strict";function e(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},e),s=t.customRegister,p=n.properties,u=n.event,g={};return r.each(s,function(e){if(r.isObject(e))r.indexOf(e.events,u)>-1&&o({properties:e.properties})&&(g=r.extend(g,e.properties));else if(r.isFunction(e)){var t=e({event:u,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&o({properties:t})&&(g=r.extend(g,t))}}),e.properties=r.extend(p,g),e}function t(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var o=e.init;e.init=function(n,s){function p(){o.call(e,n,s)}return r(n,e,t),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return e}function r(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function o(e,t,r){return i(e,t,r),e.plugin_version=n,e}t.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var i=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return e(t,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.25.10";t.prototype.plugin_name="RegisterProperties";var s=new t,p=o(s);return p}(); \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.closure.js b/dist/web/plugin/register-property-page-height/index.closure.js index dfb78cc5..f74afc8c 100644 --- a/dist/web/plugin/register-property-page-height/index.closure.js +++ b/dist/web/plugin/register-property-page-height/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function l(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(n,l)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){l("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.25.9",l=window.console&&window.console.log||function(){},a={init:function(e){return o=e,l=o&&o.log||l,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(a,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file +!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function l(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(n,l)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){l("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.25.10",l=window.console&&window.console.log||function(){},a={init:function(e){return o=e,l=o&&o.log||l,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(a,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.es6.js b/dist/web/plugin/register-property-page-height/index.es6.js index bde05bba..df96f0f4 100644 --- a/dist/web/plugin/register-property-page-height/index.es6.js +++ b/dist/web/plugin/register-property-page-height/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var n=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return l();function l(){n.call(e,o,r)}o.on(i,l)}}return e}function wrapLogFn(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(o){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index=createPlugin(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var n=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return l();function l(){n.call(e,o,r)}o.on(i,l)}}return e}function wrapLogFn(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(o){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index=createPlugin(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.js b/dist/web/plugin/register-property-page-height/index.js index 46a4e5e0..5644de90 100644 --- a/dist/web/plugin/register-property-page-height/index.js +++ b/dist/web/plugin/register-property-page-height/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterPropertyPageHeight=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function a(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){a("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.25.9",a=window.console&&window.console.log||function(){},l={init:function(e){return o=e,a=o&&o.log||a,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(l,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterPropertyPageHeight=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function a(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){a("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.25.10",a=window.console&&window.console.log||function(){},l={init:function(e){return o=e,a=o&&o.log||a,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(l,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.closure.js b/dist/web/plugin/sat-props-patch/index.closure.js index 19fdee32..715d1dc0 100644 --- a/dist/web/plugin/sat-props-patch/index.closure.js +++ b/dist/web/plugin/sat-props-patch/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,_){function l(){r.call(n,i,_)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(e,l)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(l,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.25.9",_={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},l={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(_,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file +!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,_){function l(){r.call(n,i,_)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(e,l)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(l,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.25.10",_={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},l={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(_,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.es6.js b/dist/web/plugin/sat-props-patch/index.es6.js index 3f262696..c199ba0c 100644 --- a/dist/web/plugin/sat-props-patch/index.es6.js +++ b/dist/web/plugin/sat-props-patch/index.es6.js @@ -1 +1 @@ -var _,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(t,i){if(wrapLogFn(t,n,a),t.readyState&&t.readyState.state>=3||!t.on)return l();function l(){r.call(n,t,i)}t.on(e,l)}}return n}function wrapLogFn(n,a,e){function r(a,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(a).log():n.log&&n.log.apply(n,r)}a.log=function(){r("log",arguments)},a.warn=function(){r("warn",arguments)},a.error=function(){r("error",arguments)}}function createPlugin(n,a,e){return wrapPluginInitFn(n,a,e),n.plugin_version=sdkversion_placeholder,n}var plugin={init:function(n){_=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return convertSatPropsName(n),n}}})}},pMap={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"};function convertSatPropsName(n){if(n.properties){var a=n.properties;_.each(pMap,function(n,e){_.isUndefined(a[e])||(a[n]=a[e],delete a[e])})}}var index=createPlugin(plugin,"SatPropsPatch","sdkAfterInitPara");export default index; \ No newline at end of file +var _,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(t,i){if(wrapLogFn(t,n,a),t.readyState&&t.readyState.state>=3||!t.on)return l();function l(){r.call(n,t,i)}t.on(e,l)}}return n}function wrapLogFn(n,a,e){function r(a,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(a).log():n.log&&n.log.apply(n,r)}a.log=function(){r("log",arguments)},a.warn=function(){r("warn",arguments)},a.error=function(){r("error",arguments)}}function createPlugin(n,a,e){return wrapPluginInitFn(n,a,e),n.plugin_version=sdkversion_placeholder,n}var plugin={init:function(n){_=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return convertSatPropsName(n),n}}})}},pMap={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"};function convertSatPropsName(n){if(n.properties){var a=n.properties;_.each(pMap,function(n,e){_.isUndefined(a[e])||(a[n]=a[e],delete a[e])})}}var index=createPlugin(plugin,"SatPropsPatch","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.js b/dist/web/plugin/sat-props-patch/index.js index 2ba335b0..7205ad01 100644 --- a/dist/web/plugin/sat-props-patch/index.js +++ b/dist/web/plugin/sat-props-patch/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SatPropsPatch=function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,l){function _(){r.call(n,i,l)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?_():void i.on(e,_)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(_,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.25.9",l={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},_={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(l,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SatPropsPatch=function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,l){function _(){r.call(n,i,l)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?_():void i.on(e,_)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(_,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.25.10",l={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},_={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(l,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.closure.js b/dist/web/plugin/session-event/index.closure.js index aa15aa8c..4cc72fa4 100644 --- a/dist/web/plugin/session-event/index.closure.js +++ b/dist/web/plugin/session-event/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.25.9";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file +!function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.25.10";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.es6.js b/dist/web/plugin/session-event/index.es6.js index 254c1cea..35d3d3e5 100644 --- a/dist/web/plugin/session-event/index.es6.js +++ b/dist/web/plugin/session-event/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var s=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return n();function n(){s.call(e,o,r)}o.on(i,n)}}return e}function wrapLogFn(e,t,i){function s(t,s){e.logger?e.logger.msg.apply(e.logger,s).module(i+""||"").level(t).log():e.log&&e.log.apply(e,s)}t.log=function(){s("log",arguments)},t.warn=function(){s("warn",arguments)},t.error=function(){s("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},e),n=t.customRegister,p=r.properties,a=r.event,l={};return s.each(n,function(e){if(s.isObject(e))s.indexOf(e.events,a)>-1&&o({properties:e.properties})&&(l=s.extend(l,e.properties));else if(s.isFunction(e)){var t=e({event:a,properties:p,data:r});s.isObject(t)&&!s.isEmptyObject(t)&&o({properties:t})&&(l=s.extend(l,t))}}),e.properties=s.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Store(e){this.sd=e,this._=e._,this.cookie_value=null}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Store.prototype.saveObjectVal=function(e,t){this._.isString(t)||(t=JSON.stringify(t)),1==this.sd.para.encrypt_cookie&&(t=this.sd.kit.userEncrypt(t)),this._.cookie.isSupport()&&this._.cookie.set(e,t),this.cookie_value=t},Store.prototype.readObjectVal=function(e){var t=this._.cookie.isSupport()?this._.cookie.get(e):this.cookie_value;return t?(t=this.sd.kit.userDecryptIfNeeded(t),this._.safeJSONParse(t)):null};var COOKIE_NAME="sensorsdata2015jssdksession";function SessionEvent(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}SessionEvent.prototype.init=function(e){if(e&&"object"==typeof e){var t=this;this.sd=e,this._=e._,this.log=e.log,this.cookie_name=COOKIE_NAME+(e.para.sdk_id||""),this.registerProperties=new RegisterProperties,this.registerProperties.init(e),this.store=new Store(e),this.registerProperties.hookRegister(function(){return t.addSessionID()})}else this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01")},SessionEvent.prototype.addSessionID=function(){var e=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var t=this.prop.first_session_time,i=this.prop.latest_session_time;if(!t||!i||t>e||i>e||e-t>432e5||e-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:e,latest_session_time:e}}else this.prop.latest_session_time=e;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var instance=new SessionEvent,index=createPlugin(instance,"SessionEvent","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var s=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return n();function n(){s.call(e,o,r)}o.on(i,n)}}return e}function wrapLogFn(e,t,i){function s(t,s){e.logger?e.logger.msg.apply(e.logger,s).module(i+""||"").level(t).log():e.log&&e.log.apply(e,s)}t.log=function(){s("log",arguments)},t.warn=function(){s("warn",arguments)},t.error=function(){s("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},e),n=t.customRegister,p=r.properties,a=r.event,l={};return s.each(n,function(e){if(s.isObject(e))s.indexOf(e.events,a)>-1&&o({properties:e.properties})&&(l=s.extend(l,e.properties));else if(s.isFunction(e)){var t=e({event:a,properties:p,data:r});s.isObject(t)&&!s.isEmptyObject(t)&&o({properties:t})&&(l=s.extend(l,t))}}),e.properties=s.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Store(e){this.sd=e,this._=e._,this.cookie_value=null}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Store.prototype.saveObjectVal=function(e,t){this._.isString(t)||(t=JSON.stringify(t)),1==this.sd.para.encrypt_cookie&&(t=this.sd.kit.userEncrypt(t)),this._.cookie.isSupport()&&this._.cookie.set(e,t),this.cookie_value=t},Store.prototype.readObjectVal=function(e){var t=this._.cookie.isSupport()?this._.cookie.get(e):this.cookie_value;return t?(t=this.sd.kit.userDecryptIfNeeded(t),this._.safeJSONParse(t)):null};var COOKIE_NAME="sensorsdata2015jssdksession";function SessionEvent(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}SessionEvent.prototype.init=function(e){if(e&&"object"==typeof e){var t=this;this.sd=e,this._=e._,this.log=e.log,this.cookie_name=COOKIE_NAME+(e.para.sdk_id||""),this.registerProperties=new RegisterProperties,this.registerProperties.init(e),this.store=new Store(e),this.registerProperties.hookRegister(function(){return t.addSessionID()})}else this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01")},SessionEvent.prototype.addSessionID=function(){var e=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var t=this.prop.first_session_time,i=this.prop.latest_session_time;if(!t||!i||t>e||i>e||e-t>432e5||e-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:e,latest_session_time:e}}else this.prop.latest_session_time=e;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var instance=new SessionEvent,index=createPlugin(instance,"SessionEvent","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.js b/dist/web/plugin/session-event/index.js index f3e2c6b8..d36b56c6 100644 --- a/dist/web/plugin/session-event/index.js +++ b/dist/web/plugin/session-event/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SessionEvent=function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.25.9";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SessionEvent=function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.25.10";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.closure.js b/dist/web/plugin/sf-instant-event/index.closure.js index e2d29d69..4cca0594 100644 --- a/dist/web/plugin/sf-instant-event/index.closure.js +++ b/dist/web/plugin/sf-instant-event/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return t(i,e,n),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function t(e,t,n){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(n+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function n(t,n,r){return e(t,n,r),t.plugin_version=f,t}function r(e,t){var n=s.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+n:e+"?"+n}function a(e){if("beacon"===s.para.send_type&&c.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);if("ajax"===s.para.send_type&&c.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);var t=r(e.server_url,e.data),n=c.getQueryParam(t,"ext"),a=c.urlParse(t);return a.addQueryString({ext:n+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new c.ImageSend(e)}function i(e){var t=a(e);t.start()}function o(e,t){var n=e.data.event,r=e.data.type;if(!n||c.indexOf(d,n)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;t.cancellationToken.stop();var f=e.server_url;return c.isArray(f)&&f.length?void c.each(f,function(t){e.callback=null,e.server_url=t,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,c,d,f="1.25.9",l={plugin_name:"SfInstantEvent",init:function(e,t){if(s=e,c=s._,c.isObject(t)&&c.isArray(t.instant_events)){if(d=t.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",t)}},g=n(l);return g}(); \ No newline at end of file +!function(){"use strict";function e(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return t(i,e,n),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function t(e,t,n){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(n+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function n(t,n,r){return e(t,n,r),t.plugin_version=f,t}function r(e,t){var n=s.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+n:e+"?"+n}function a(e){if("beacon"===s.para.send_type&&c.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);if("ajax"===s.para.send_type&&c.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);var t=r(e.server_url,e.data),n=c.getQueryParam(t,"ext"),a=c.urlParse(t);return a.addQueryString({ext:n+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new c.ImageSend(e)}function i(e){var t=a(e);t.start()}function o(e,t){var n=e.data.event,r=e.data.type;if(!n||c.indexOf(d,n)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;t.cancellationToken.stop();var f=e.server_url;return c.isArray(f)&&f.length?void c.each(f,function(t){e.callback=null,e.server_url=t,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,c,d,f="1.25.10",l={plugin_name:"SfInstantEvent",init:function(e,t){if(s=e,c=s._,c.isObject(t)&&c.isArray(t.instant_events)){if(d=t.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",t)}},g=n(l);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.es6.js b/dist/web/plugin/sf-instant-event/index.es6.js index 46260f91..1b404e7c 100644 --- a/dist/web/plugin/sf-instant-event/index.es6.js +++ b/dist/web/plugin/sf-instant-event/index.es6.js @@ -1 +1 @@ -var sd,_,instant_events,sdkversion_placeholder="1.25.9";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(a,i){if(wrapLogFn(a,e,n),a.readyState&&a.readyState.state>=3||!a.on)return s();function s(){r.call(e,a,i)}a.on(t,s)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}function getSendUrl(e,n){var t=sd.kit.encodeTrackData(n);return-1!==e.indexOf("?")?e+"&"+t:e+"?"+t}function getInstance(e){if("beacon"===sd.para.send_type&&_.isSupportBeaconSend())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);if("ajax"===sd.para.send_type&&_.isSupportCors())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);var n=getSendUrl(e.server_url,e.data),t=_.getQueryParam(n,"ext"),r=_.urlParse(n);return r.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=r.getUrl(),new _.ImageSend(e)}function sendCall(e){getInstance(e).start()}function sendInterceptor(e,n){var t=e.data.event,r=e.data.type;if(!t||-1===_.indexOf(instant_events,t))return e;var a=sd.para.app_js_bridge&&sd.bridge&&sd.bridge.bridge_info&&"success"===sd.bridge.bridge_info.verify_success,i="item_set"===r||"item_delete"===r,s=!0===sd.para.app_js_bridge.is_mui;if(a&&!i&&!s)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var d=e.server_url;if(!_.isArray(d)||!d.length)return sendCall(e),e;_.each(d,function(n){e.callback=null,e.server_url=n,sendCall(e)})}function senderInit(){sd.registerInterceptor("sendDataStage",{send:{priority:50,entry:sendInterceptor}})}var SfInstantEvent={plugin_name:"SfInstantEvent",init:function(e,n){if((_=(sd=e)._).isObject(n)&&_.isArray(n.instant_events)){if(instant_events=n.instant_events,sd.readyState&&sd.readyState.state>=3||!sd.on)return senderInit();sd.on("sdkAfterInitPara",function(){senderInit()})}else sd.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},index=createPlugin(SfInstantEvent);export default index; \ No newline at end of file +var sd,_,instant_events,sdkversion_placeholder="1.25.10";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(a,i){if(wrapLogFn(a,e,n),a.readyState&&a.readyState.state>=3||!a.on)return s();function s(){r.call(e,a,i)}a.on(t,s)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}function getSendUrl(e,n){var t=sd.kit.encodeTrackData(n);return-1!==e.indexOf("?")?e+"&"+t:e+"?"+t}function getInstance(e){if("beacon"===sd.para.send_type&&_.isSupportBeaconSend())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);if("ajax"===sd.para.send_type&&_.isSupportCors())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);var n=getSendUrl(e.server_url,e.data),t=_.getQueryParam(n,"ext"),r=_.urlParse(n);return r.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=r.getUrl(),new _.ImageSend(e)}function sendCall(e){getInstance(e).start()}function sendInterceptor(e,n){var t=e.data.event,r=e.data.type;if(!t||-1===_.indexOf(instant_events,t))return e;var a=sd.para.app_js_bridge&&sd.bridge&&sd.bridge.bridge_info&&"success"===sd.bridge.bridge_info.verify_success,i="item_set"===r||"item_delete"===r,s=!0===sd.para.app_js_bridge.is_mui;if(a&&!i&&!s)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var d=e.server_url;if(!_.isArray(d)||!d.length)return sendCall(e),e;_.each(d,function(n){e.callback=null,e.server_url=n,sendCall(e)})}function senderInit(){sd.registerInterceptor("sendDataStage",{send:{priority:50,entry:sendInterceptor}})}var SfInstantEvent={plugin_name:"SfInstantEvent",init:function(e,n){if((_=(sd=e)._).isObject(n)&&_.isArray(n.instant_events)){if(instant_events=n.instant_events,sd.readyState&&sd.readyState.state>=3||!sd.on)return senderInit();sd.on("sdkAfterInitPara",function(){senderInit()})}else sd.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},index=createPlugin(SfInstantEvent);export default index; \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.js b/dist/web/plugin/sf-instant-event/index.js index 57937999..74e3694b 100644 --- a/dist/web/plugin/sf-instant-event/index.js +++ b/dist/web/plugin/sf-instant-event/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SfInstantEvent=function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=l,n}function r(e,n){var t=s.kit.encodeTrackData(n);return e.indexOf("?")!==-1?e+"&"+t:e+"?"+t}function a(e){if("beacon"===s.para.send_type&&d.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);if("ajax"===s.para.send_type&&d.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);var n=r(e.server_url,e.data),t=d.getQueryParam(n,"ext"),a=d.urlParse(n);return a.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new d.ImageSend(e)}function i(e){var n=a(e);n.start()}function o(e,n){var t=e.data.event,r=e.data.type;if(!t||d.indexOf(c,t)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var l=e.server_url;return d.isArray(l)&&l.length?void d.each(l,function(n){e.callback=null,e.server_url=n,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,d,c,l="1.25.9",f={plugin_name:"SfInstantEvent",init:function(e,n){if(s=e,d=s._,d.isObject(n)&&d.isArray(n.instant_events)){if(c=n.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},g=t(f);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SfInstantEvent=function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=l,n}function r(e,n){var t=s.kit.encodeTrackData(n);return e.indexOf("?")!==-1?e+"&"+t:e+"?"+t}function a(e){if("beacon"===s.para.send_type&&d.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);if("ajax"===s.para.send_type&&d.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);var n=r(e.server_url,e.data),t=d.getQueryParam(n,"ext"),a=d.urlParse(n);return a.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new d.ImageSend(e)}function i(e){var n=a(e);n.start()}function o(e,n){var t=e.data.event,r=e.data.type;if(!t||d.indexOf(c,t)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var l=e.server_url;return d.isArray(l)&&l.length?void d.each(l,function(n){e.callback=null,e.server_url=n,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,d,c,l="1.25.10",f={plugin_name:"SfInstantEvent",init:function(e,n){if(s=e,d=s._,d.isObject(n)&&d.isArray(n.instant_events)){if(c=n.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},g=t(f);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.amd.min.js b/dist/web/plugin/sf-sdk-web/popup.amd.min.js index 9e67a82e..1f892cd0 100644 --- a/dist/web/plugin/sf-sdk-web/popup.amd.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.amd.min.js @@ -1,2 +1,2 @@ -define(function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ +define(function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){u("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),r.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var e=a.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(e){r.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(e))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;r.isArray(e)&&r.each(e,function(e){e.is_in_window&&(u("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},a.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";r.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),u(n),u(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||r.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)u("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(r.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);t>e[0]?(u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):u("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){r.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(u("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var e={equal:function(e,t){if(!r.isNumber(e)&&!r.isString(e))return!1;for(var n=0,i=t.length;n=0},notContain:function(e,t){return!!r.isString(e)&&e.indexOf(t[0])===-1},isTrue:function(e){return e===!0},isFalse:function(e){return e===!1},isSet:function(e){return"undefined"!=typeof e},notSet:function(e){return"undefined"==typeof e},isEmpty:function(e){if(!r.isString(e)&&!r.isArray(e))return!1;if(r.isString(e))return""===e;for(var t=0;tr.getConvertNumberValue(t[0]))},between:function(e,t){if(!r.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=r.getConvertNumberValue(e),i=r.getConvertNumberValue(t[0]),o=r.getConvertNumberValue(t[1]);return n>=i&&n<=o},isIn:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=n&&o<=i}catch(a){u("absolute_between Error",a)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),i=new Date(t[1]),o=new Date(e);return o>=n&&o<=i}catch(a){u("absolute_between Error",a)}}},t=this,n=r.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,o=i.relation,a="or"===String(o).toLowerCase(),s="and"===String(o).toLowerCase(),p=!!s,l=!0;return r.each(i.conditions,function(n){if(!l)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),o=n.params,r="in"===n["function"]?"isIn":n["function"];if(!e[r])return p=!1,l=!1,!1;if(i<0)return!1;var u=n.field.slice(i+1),c=t.event_data.properties,_=c[u];"$event_duration"===u&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,l=!1),s&&!d&&(p=!1,l=!1)}),p});r.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),u("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):u("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];r.each(e,function(e){if(!e.params||!e.params[0])return u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(e.params[0]);1===i?n.push(e):i>1&&r.isObject(e.window)&&e.window.value>0&&(!r.isObject(e.is_in_window)||!r.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=i?n.push(e):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=a.localData.msg_limit_global,t=!0,n=this;r.isObject(e)&&e.is_in_use===!0&&r.isArray(e.limits)&&r.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(r.each(e.limits,function(e){if(r.isObject(e)&&r.isNumber(e.limit)){var i=a.ruleTime.getLast(e,n.current_time),o=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);u("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+i),t=o0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=r.localStorage.get(a.config.storageName);r.isString(e)&&(e=n(e));try{e=JSON.parse(e)}catch(t){r.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),a.info.encrypt_cookie&&(e=i(e)),r.localStorage.set(a.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=a.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return e?(r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&r.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return!!e&&void(e.popup_sdk_users&&r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=a.localData,this.saveJSONData(e)))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),i=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),a=[];r.each(n,function(n,i){o-n.update_time>t&&(delete e.popup_sdk_plans[i],a.push(i))}),r.each(i,function(t,n){a.length>0&&r.each(a,function(i){t.user_id&&i===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=a.localData.popup_plans;if(!e||!r.isArray(e))return!1;var t=r.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});a.convertPlans=t,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var e=a.localData,t=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!t||r.isEmptyObject(t))return!1;if(!e||r.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return r.extend(a.localData,t),!1;var n=t.popup_plans;r.each(n,function(t,i){var o=null;if(r.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,r.isObject(t.window_update)&&r.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=a.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var s=o.pattern_popup.matcher_list;r.extend2Lev(o,t),o.pattern_popup.matcher_list=s,n[i]=o}),r.extend(a.localData,t)},getEventRule:function(){var e=a.localData.popup_plans,t={};return!(!e||!r.isArray(e))&&(r.each(e,function(e){var n=e.pattern_popup.matcher_list;r.each(n,function(n){var i={plan:e,rule:[n]},o=n.event_name,a=!1;if(t[o]){if(r.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),a=!0)}),a)return!1;t[o].push(i)}else t[o]=[i]})}),r.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),a.eventRule=t,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var e=this;a.sa.events.on("send",function(t){t.event&&a.eventRule[t.event]&&(r.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(t),e.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(t){e.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){function t(e){var t=new Image;t.src=e}if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),e(),void n.setIntervalTime(n.interval_time)):(t(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},e(),void n.setIntervalTime(n.interval_time)):(t(),!1)}})},updateUserPlans:function(){var e=a.store.getJSONData(),t=a.sa.store.getDistinctId(),n=a.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?a.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(a.localData);this.local_data!==e&&(this.local_data=e,a.store.saveLocalData())},initial:function(){a.store.init();var e=a.localData.local_update_time,t=(new Date).getTime();if(r.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(e){this.active_state=!0,e=e||{getLocalData:!0},e.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var e=r.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",i=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:i}},start:function(){var e=a.info.project,t=a.info.platform,n=this.hasParam().popup_window_id,i=this.hasParam().platform,o=encodeURIComponent(a.sa.store.getDistinctId());return"WEB"===i?(a.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1):void r.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=r.getUuid();r.isObject(e)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var o=a.getPopupInfo(t);o.$sf_msg_id=n;var s={content:e.content,type:e.popup_type||"PRESET"};if(e.popup_type&&"CUSTOMIZED"===e.popup_type)r.isString(e.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(o.$sf_succeed=!1,o.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s)):(o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"));else if(r.isObject(t)&&r.isObject(t.properties)&&r.isObject(t.template)){var p=new a.ElementRender(t);p.render(),o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s),a.info.popup_listener.onLoadSuccess()}else o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")},error:function(e){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},a.setPara=function(e){r.isObject(e)||(e={}),a.info=r.extend({},a.defaultPara,e);var t=a.sa;if(!t)return a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(t.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),!r.isString(a.info.api_base_url)||"http"!==a.info.api_base_url.slice(0,4))return a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,!r.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(a.info.project||(a.info.project=r.URL(t.para.server_url).searchParams.get("project")||"default"),r.isObject(a.info.popup_listener)){var n=a.info.popup_listener;r.isFunction(n.onClick)||(a.info.popup_listener.onClick=function(){}),r.isFunction(n.onLoadSuccess)||(a.info.popup_listener.onLoadSuccess=function(){}),r.isFunction(n.onLoadFailed)||(a.info.popup_listener.onLoadFailed=function(){}),r.isFunction(n.onClose)||(a.info.popup_listener.onClose=function(){}),r.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(a.info.popup_listener.openlink="customize"):a.info.popup_listener.openlink="customize"}else a.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return a.info.supportCustom=!0,r.isObject(a.info.popup_campaign_listener)?(r.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),r.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),r.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),r.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),r.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},a.getBridgeState=function(){return!r.isObject(a.sa.para.app_js_bridge)||!a.sa.para.app_js_bridge.is_mui&&(!a.sa.bridge||!a.sa.bridge.is_verify_success)},a.init=function(){var e=window.sensorsDataAnalytic201505;if(a.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)o.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){o.apply(t,n)})}},a.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||a,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||a):window.SensorsDataWebJSSDKPlugin={popup:a,Popup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.esm.min.js b/dist/web/plugin/sf-sdk-web/popup.esm.min.js index e0a551a8..a0fc4581 100644 --- a/dist/web/plugin/sf-sdk-web/popup.esm.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.esm.min.js @@ -1 +1 @@ -var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"}},_={visibility:function(e){e=e||{};var t={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var p in t)n+=e+"-"+p+":"+_.conversionNum(t[p])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(_.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(t,n),_.localStorage.get(t)!==n&&(e=!1),_.localStorage.remove(t)}catch(p){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(p){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,p){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,p.call(this,t)},!1);else{var o="on"+n,i=t[o];t[o]=function(t,n,p){return function(o){if(!(o=o||e(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(t,o),!1!==i&&!1!==a||(r=!1),r}}(t,p,i)}}).apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return _.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return _.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(_.isObject(t[n])&&_.isObject(e[n])?_.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var a=0,r=e.length;a=200&&n.status<300||304==n.status?e.success(t(n.responseText)):e.error(t(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(e.type,e.url,!0);try{e.credentials&&(n.withCredentials=!0),_.isObject(e.header)&&_.each(e.header,function(e,t){n.setRequestHeader&&n.setRequestHeader(t,e)}),e.data&&(e.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(e.data||null)},getUuid:function(){var e=function(){return Math.random().toString(16).replace(".","")};return function(){var t=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)}()+"-"+e()+"-"+e();return t||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(_.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var p=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var e=_.getURLSearchParams(n.search);return{get:function(t){return e[t]}}}()}return n},contentLoaded:function(e,t){var n=!1,p=!0,o=e.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?e:o)[s](u+p.type,l,!1),!n&&(n=!0)&&t.call(e,p.type||p))},c=function(){try{i.doScroll("left")}catch(e){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!a&&i.doScroll){try{p=!e.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),e[r](u+"load",l,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(e){if(!_.isObject(e)||!_.isObject(e.template))return{};var t={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(e){_.each(e.subviews,function(e){var p=e.properties||{};"title"===p.msgType?t.$sf_msg_title=p.text:"content"===p.msgType?t.$sf_msg_content=p.text:"image"===e.type&&(t.$sf_msg_image_url=p.image),e.subviews&&n(e)})}(e.template),t},popup.getSFCampaign=function(e){e=_.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=_.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=_.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},popup.getImageList=function(e){if(!_.isArray(e))return!1;for(var t,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=e.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(e,t){r.push(t)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(e){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}};var IMAGE_MAP={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},NODE_NAME_MAP={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},NODE_STYLE_MAP={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:_.boxModel("margin"),padding:_.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};function ElementRender(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}ElementRender.prototype={constructor:ElementRender,render:function(){var e=this;if(document.querySelector("div[data-sf-mask]"))return!1;return e.template.isRoot=!0,e.containerEle=e.createView(e.template),e.maskEle=e.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:e.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:_.getRgba(e.properties.maskColor),"z-index":999998})}),_.addEvent(e.maskEle,"click",function(t){var n=t.target.getAttribute("data-ele-mask"),p=e.properties,o=e.msg;if(!o)return!1;var i={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:o.$sf_msg_title,$sf_msg_content:o.$sf_msg_content,$sf_msg_image_url:o.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:p.maskActionId};return n&&p&&p.maskAction?(function(t,n){var p=t.maskAction.H5,o=_.isArray(p)&&p[0];if(_.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":popup.track.trackEvent("$PlanPopupClick",n,e.msg);break;case"customize":case"openlink":popup.track.trackEvent("$PlanPopupClick",n,e.msg),o.closeable&&e.destory();break;case"close":o.closeable&&(popup.track.trackEvent("$PlanPopupClick",n,e.msg),e.destory())}}(p,i),!1):n&&e.properties.maskCloseEnabled?(popup.track.trackEvent("$PlanPopupClick",i,o),e.destory(),!1):void popup.track.elementClickCallback(t,e)}),e.maskEle.setAttribute("data-sf-mask",!0),e.maskEle.appendChild(e.containerEle),_.contentLoaded(window,function(){e.appendPopup()}),!0},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(n){document.body.appendChild(this.maskEle)}var e=document.querySelector("[data-ele-mask] > div"),t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e&&e.offsetHeight>t&&(e.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,p=e.attr,o=e.prop,i=e.child,a=e.action,r=e.element_info,s=document.createElement(t);return n&&s.setAttribute("style",n),p&&_.each(p,function(e,t){e&&s.setAttribute(t,e)}),o&&_.each(o,function(e,t){e&&(s[t]=e)}),i&&i.length&&_.each(i,function(e){if(!e)return!1;s.appendChild(e)}),a&&a.H5&&a.H5.length&&s.setAttribute("data-action",JSON.stringify(a.H5)),r&&s.setAttribute("data-info",JSON.stringify(r)),s},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return _.each(e,function(e,p){e=_.conversionNum(e);var o=NODE_STYLE_MAP[p];if(_.indexOf(n,p)>=0)return!1;_.isString(o)?t+=o+":"+_.getRgba(e)+";":_.isFunction(o)?t+=o(e)+";":t+=p+":"+_.getRgba(e)+";"}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},p={},o={},i=NODE_NAME_MAP[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var a=e.properties.font,r=a?1.7*parseInt(a)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(p["data-sensors-click"]=!0,e.properties.localImageName?p.src=IMAGE_MAP[e.properties.localImageName]:p.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",_.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":_.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":r});break;case"label":_.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":r,"margin-top":"0px","margin-bottom":"0px"});break;case"button":_.extend(n,{outline:"none","letter-spacing":"1px","line-height":r})}_.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&_.each(e.subviews,function(e){t.push(this.createView(e))},this);var s=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:i,attr:p,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var u=document.createElement("div");n="display:flex;justify-content:"+{center:"center",left:"flex-start",right:"flex-end"}[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",u.setAttribute("style",n),u.setAttribute("data-ele-mask",!0)):u.setAttribute("style",n),u.appendChild(s),u}return s},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}popup.info.popup_listener.onClose(e),popup.info.popup_campaign_listener.onEnd(popup.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},popup.ElementRender=ElementRender,popup.handlerCampaign=function(e){var t,n=e,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{t=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:t,plan:n.plan};switch(n.plan.strategy_id?n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===o.popup_type&&_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER":n.plan.is_control_group?a.state="DIALOG_NOT_SHOW":r?_.isObject(t)&&t.properties&&t.template?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"DIALOG_SHOW":n.showPopup(s);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;case"DIALOG_NOT_SHOW":n.popupFailed(1003,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:e.$sf_msg_id};return _.isEmptyObject(t)||!_.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var p=popup.track.getPublicProps(n);_.extend(t,p),_.each(t,function(e,n){""!==e&&e!==undefined||delete t[n]}),popup.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=t.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(e){popup.log("elementClickCallback error",e)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=t.msg.plan?t.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=t.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(e){popup.log("popup_listener.onClick error",e)}if("close"===a.type)t.destory();else if(a.closeable&&t.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(popup.convertPlans));_.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var p=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!e)return!1;_.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(e){var t=popup.info.project,n=!1;if(!e&&0===popup.convertPlans.length)return!1;e&&(_.each(popup.convertPlans,function(t){t.plan_id===e.plan_id&&(n=!0)}),n||popup.convertPlans.push(e)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(popup.convertPlans)),n=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];if(_.each(e,function(e,t){return!!e.is_in_convert_window&&((new Date).getTime()>e.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[t].plan_id),delete popup.convertPlans[t].is_in_convert_window,popup.convertPlans.splice(t,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,popup.convertPlans[t].is_in_convert_window.step=5e3),void(n>e.is_in_convert_window.step&&(n=e.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(t)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){popup.changeCovertStatus(e),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(e,t){var n=t,p=Number(e.value)||0,o=Number(e.value)||0,i=String(e.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var e=(a=new Date(n)).getDay();0===e&&(e=7);var t=7-e;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var e=(a=new Date(n)).getMonth()+o;return e>=11?(a.setFullYear(a.getFullYear()+parseInt(e/12)),a.setMonth(e%12)):a.setMonth(e),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),e in t&&(o=t[e]*p),a.getTime()+o}};return!0!==e.natural?r.second(i):i in r?r[i]():void 0},getLast:function(e,t){var n=Number(e.value)||0,p=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(t)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var e=(i=new Date(t)).getDay();return 0===e&&(e=7),--e,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*e*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var e=(i=new Date(t)).getMonth()+1-p;return e<=0?(i.setFullYear(i.getFullYear()+(parseInt(e/12)-1)),i.setMonth(12+e%12-1)):i.setMonth(e-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(e){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(t),e in p&&(o=p[e]*n),i.getTime()-o}};return!0!==e.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var e=!1,t=popup.localData.eventQueue[0],n=popup.eventRule[t.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(e){_.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new popup.RuleCheck(e,t)}),_.each(n,function(t){!0===t.match_state?!1===e?(e=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new popup.PopupCheck(t,!0)):!0===e&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new popup.PopupCheck(t,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(e,t,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[e],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!t&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,e,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),e,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(e){var t=popup.getSFCampaign(e.plan),n=popup.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(e){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new popup.ElementRender(e.content),n=popup.getPopupInfo(e.content);if(n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,_.extend(t.msg,n),t.popupCheckInstance=this,popup.track.popupDisplay(n),!t.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),popup.info.popup_listener.onLoadSuccess(e.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(e){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(e){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,e))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var e=popup.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(e){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(e))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;_.isArray(e)&&_.each(e,function(e){e.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},popup.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);t>e[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},popup.RuleCheck.prototype.checkProperties=function(){var e={equal:function(e,t){if(!_.isNumber(e)&&!_.isString(e))return!1;for(var n=0,p=t.length;n=0},notContain:function(e,t){return!!_.isString(e)&&-1===e.indexOf(t[0])},isTrue:function(e){return!0===e},isFalse:function(e){return!1===e},isSet:function(e){return void 0!==e},notSet:function(e){return void 0===e},isEmpty:function(e){if(!_.isString(e)&&!_.isArray(e))return!1;if(_.isString(e))return""===e;for(var t=0;t_.getConvertNumberValue(t[0]))},between:function(e,t){if(!_.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=_.getConvertNumberValue(e),p=_.getConvertNumberValue(t[0]),o=_.getConvertNumberValue(t[1]);return n>=p&&n<=o},isIn:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),p=new Date(t[1]),o=new Date(e);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},t=this,n=_.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var p=n.filter,o=p.relation,i="or"===String(o).toLowerCase(),a="and"===String(o).toLowerCase(),r=!!a,s=!0;return _.each(p.conditions,function(n){if(!s)return!1;if(!n.field)return!1;var p=n.field.lastIndexOf("."),o=n.params,u="in"===n["function"]?"isIn":n["function"];if(!e[u])return r=!1,s=!1,!1;if(p<0)return!1;var l=n.field.slice(p+1),c=t.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[u](_,o);i&&d&&(r=!0,s=!1),a&&!d&&(r=!1,s=!1)}),r});_.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];_.each(e,function(e){if(!e.params||!e.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(e.params[0]);1===p?n.push(e):p>1&&_.isObject(e.window)&&e.window.value>0&&(!_.isObject(e.is_in_window)||!_.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=p?n.push(e):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=popup.localData.msg_limit_global,t=!0,n=this;_.isObject(e)&&!0===e.is_in_use&&_.isArray(e.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(e.limits,function(e){if(_.isObject(e)&&_.isNumber(e.limit)){var p=popup.ruleTime.getLast(e,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+p),t=o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&_.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(popup.info.platform="H5",!!popup.setIsLoad()&&(!!this.getBridgeState()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial()))))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=_.localStorage.get(popup.config.storageName);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(t){_.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),popup.info.encrypt_cookie&&(e=encrypt(e)),_.localStorage.set(popup.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=popup.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;return e?(_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&_.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;if(!e)return!1;e.popup_sdk_users&&_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=popup.localData,this.saveJSONData(e))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),p=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>t&&(delete e.popup_sdk_plans[p],i.push(p))}),_.each(p,function(t,n){i.length>0&&_.each(i,function(p){t.user_id&&p===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=popup.localData.popup_plans;if(!e||!_.isArray(e))return!1;var t=_.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});popup.convertPlans=t,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var e=popup.localData,t=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!t||_.isEmptyObject(t))return!1;if(!e||_.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return _.extend(popup.localData,t),!1;var n=t.popup_plans;_.each(n,function(t,p){var o=null;if(_.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,_.isObject(t.window_update)&&_.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,t),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,t)},getEventRule:function(){var e=popup.localData.popup_plans,t={};if(!e||!_.isArray(e))return!1;_.each(e,function(e){var n=e.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:e,rule:[n]},o=n.event_name,i=!1;if(t[o]){if(_.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),i=!0)}),i)return!1;t[o].push(p)}else t[o]=[p]})}),_.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),popup.eventRule=t,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var e=this;popup.sa.events.on("send",function(t){t.event&&popup.eventRule[t.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(t),e.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(t){e.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var t=0;t0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),e(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return t(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},e(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var e=popup.store.getJSONData(),t=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?popup.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(popup.localData);this.local_data!==e&&(this.local_data=e,popup.store.saveLocalData())},initial:function(){popup.store.init();var e=popup.localData.local_update_time,t=(new Date).getTime();if(_.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(e){this.active_state=!0,(e=e||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var e=_.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",p=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:p}},start:function(){var e=popup.info.project,t=popup.info.platform,n=this.hasParam().popup_window_id,p=this.hasParam().platform,o=encodeURIComponent(popup.sa.store.getDistinctId());if("WEB"===p)return popup.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1;_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=_.getUuid();_.isObject(e)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var p=popup.getPopupInfo(t);p.$sf_msg_id=n;var o={content:e.content,type:e.popup_type||"PRESET"};e.popup_type&&"CUSTOMIZED"===e.popup_type?_.isString(e.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")):_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?(new popup.ElementRender(t).render(),p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o),popup.info.popup_listener.onLoadSuccess()):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(e){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},popup.setPara=function(e){_.isObject(e)||(e={}),popup.info=_.extend({},popup.defaultPara,e);var t=popup.sa;if(!t)return popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(!0===t.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),!_.isString(popup.info.api_base_url)||"http"!==popup.info.api_base_url.slice(0,4))return popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,!_.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(popup.info.project||(popup.info.project=_.URL(t.para.server_url).searchParams.get("project")||"default"),_.isObject(popup.info.popup_listener)){var n=popup.info.popup_listener;_.isFunction(n.onClick)||(popup.info.popup_listener.onClick=function(){}),_.isFunction(n.onLoadSuccess)||(popup.info.popup_listener.onLoadSuccess=function(){}),_.isFunction(n.onLoadFailed)||(popup.info.popup_listener.onLoadFailed=function(){}),_.isFunction(n.onClose)||(popup.info.popup_listener.onClose=function(){}),_.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(popup.info.popup_listener.openlink="customize"):popup.info.popup_listener.openlink="customize"}else popup.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},popup.getBridgeState=function(){return!_.isObject(popup.sa.para.app_js_bridge)||!popup.sa.para.app_js_bridge.is_mui&&(!popup.sa.bridge||!popup.sa.bridge.is_verify_success)},popup.init=function(){var e=window.sensorsDataAnalytic201505;if(popup.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)initPopup.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){initPopup.apply(t,n)})}},popup.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||popup,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||popup):window.SensorsDataWebJSSDKPlugin={popup:popup,Popup:popup};export default popup; \ No newline at end of file +var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"}},_={visibility:function(e){e=e||{};var t={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var p in t)n+=e+"-"+p+":"+_.conversionNum(t[p])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(_.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(t,n),_.localStorage.get(t)!==n&&(e=!1),_.localStorage.remove(t)}catch(p){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(p){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,p){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,p.call(this,t)},!1);else{var o="on"+n,i=t[o];t[o]=function(t,n,p){return function(o){if(!(o=o||e(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(t,o),!1!==i&&!1!==a||(r=!1),r}}(t,p,i)}}).apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return _.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return _.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(_.isObject(t[n])&&_.isObject(e[n])?_.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var a=0,r=e.length;a=200&&n.status<300||304==n.status?e.success(t(n.responseText)):e.error(t(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(e.type,e.url,!0);try{e.credentials&&(n.withCredentials=!0),_.isObject(e.header)&&_.each(e.header,function(e,t){n.setRequestHeader&&n.setRequestHeader(t,e)}),e.data&&(e.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(e.data||null)},getUuid:function(){var e=function(){return Math.random().toString(16).replace(".","")};return function(){var t=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)}()+"-"+e()+"-"+e();return t||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(_.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var p=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var e=_.getURLSearchParams(n.search);return{get:function(t){return e[t]}}}()}return n},contentLoaded:function(e,t){var n=!1,p=!0,o=e.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?e:o)[s](u+p.type,l,!1),!n&&(n=!0)&&t.call(e,p.type||p))},c=function(){try{i.doScroll("left")}catch(e){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!a&&i.doScroll){try{p=!e.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),e[r](u+"load",l,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(e){if(!_.isObject(e)||!_.isObject(e.template))return{};var t={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(e){_.each(e.subviews,function(e){var p=e.properties||{};"title"===p.msgType?t.$sf_msg_title=p.text:"content"===p.msgType?t.$sf_msg_content=p.text:"image"===e.type&&(t.$sf_msg_image_url=p.image),e.subviews&&n(e)})}(e.template),t},popup.getSFCampaign=function(e){e=_.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=_.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=_.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},popup.getImageList=function(e){if(!_.isArray(e))return!1;for(var t,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=e.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(e,t){r.push(t)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(e){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}};var IMAGE_MAP={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},NODE_NAME_MAP={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},NODE_STYLE_MAP={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:_.boxModel("margin"),padding:_.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};function ElementRender(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}ElementRender.prototype={constructor:ElementRender,render:function(){var e=this;if(document.querySelector("div[data-sf-mask]"))return!1;return e.template.isRoot=!0,e.containerEle=e.createView(e.template),e.maskEle=e.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:e.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:_.getRgba(e.properties.maskColor),"z-index":999998})}),_.addEvent(e.maskEle,"click",function(t){var n=t.target.getAttribute("data-ele-mask"),p=e.properties,o=e.msg;if(!o)return!1;var i={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:o.$sf_msg_title,$sf_msg_content:o.$sf_msg_content,$sf_msg_image_url:o.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:p.maskActionId};return n&&p&&p.maskAction?(function(t,n){var p=t.maskAction.H5,o=_.isArray(p)&&p[0];if(_.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":popup.track.trackEvent("$PlanPopupClick",n,e.msg);break;case"customize":case"openlink":popup.track.trackEvent("$PlanPopupClick",n,e.msg),o.closeable&&e.destory();break;case"close":o.closeable&&(popup.track.trackEvent("$PlanPopupClick",n,e.msg),e.destory())}}(p,i),!1):n&&e.properties.maskCloseEnabled?(popup.track.trackEvent("$PlanPopupClick",i,o),e.destory(),!1):void popup.track.elementClickCallback(t,e)}),e.maskEle.setAttribute("data-sf-mask",!0),e.maskEle.appendChild(e.containerEle),_.contentLoaded(window,function(){e.appendPopup()}),!0},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(n){document.body.appendChild(this.maskEle)}var e=document.querySelector("[data-ele-mask] > div"),t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e&&e.offsetHeight>t&&(e.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,p=e.attr,o=e.prop,i=e.child,a=e.action,r=e.element_info,s=document.createElement(t);return n&&s.setAttribute("style",n),p&&_.each(p,function(e,t){e&&s.setAttribute(t,e)}),o&&_.each(o,function(e,t){e&&(s[t]=e)}),i&&i.length&&_.each(i,function(e){if(!e)return!1;s.appendChild(e)}),a&&a.H5&&a.H5.length&&s.setAttribute("data-action",JSON.stringify(a.H5)),r&&s.setAttribute("data-info",JSON.stringify(r)),s},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return _.each(e,function(e,p){e=_.conversionNum(e);var o=NODE_STYLE_MAP[p];if(_.indexOf(n,p)>=0)return!1;_.isString(o)?t+=o+":"+_.getRgba(e)+";":_.isFunction(o)?t+=o(e)+";":t+=p+":"+_.getRgba(e)+";"}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},p={},o={},i=NODE_NAME_MAP[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var a=e.properties.font,r=a?1.7*parseInt(a)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(p["data-sensors-click"]=!0,e.properties.localImageName?p.src=IMAGE_MAP[e.properties.localImageName]:p.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",_.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":_.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":r});break;case"label":_.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":r,"margin-top":"0px","margin-bottom":"0px"});break;case"button":_.extend(n,{outline:"none","letter-spacing":"1px","line-height":r})}_.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&_.each(e.subviews,function(e){t.push(this.createView(e))},this);var s=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:i,attr:p,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var u=document.createElement("div");n="display:flex;justify-content:"+{center:"center",left:"flex-start",right:"flex-end"}[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",u.setAttribute("style",n),u.setAttribute("data-ele-mask",!0)):u.setAttribute("style",n),u.appendChild(s),u}return s},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}popup.info.popup_listener.onClose(e),popup.info.popup_campaign_listener.onEnd(popup.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},popup.ElementRender=ElementRender,popup.handlerCampaign=function(e){var t,n=e,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{t=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:t,plan:n.plan};switch(n.plan.strategy_id?n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===o.popup_type&&_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER":n.plan.is_control_group?a.state="DIALOG_NOT_SHOW":r?_.isObject(t)&&t.properties&&t.template?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"DIALOG_SHOW":n.showPopup(s);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;case"DIALOG_NOT_SHOW":n.popupFailed(1003,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:e.$sf_msg_id};return _.isEmptyObject(t)||!_.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var p=popup.track.getPublicProps(n);_.extend(t,p),_.each(t,function(e,n){""!==e&&e!==undefined||delete t[n]}),popup.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=t.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(e){popup.log("elementClickCallback error",e)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=t.msg.plan?t.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=t.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(e){popup.log("popup_listener.onClick error",e)}if("close"===a.type)t.destory();else if(a.closeable&&t.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(popup.convertPlans));_.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var p=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!e)return!1;_.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(e){var t=popup.info.project,n=!1;if(!e&&0===popup.convertPlans.length)return!1;e&&(_.each(popup.convertPlans,function(t){t.plan_id===e.plan_id&&(n=!0)}),n||popup.convertPlans.push(e)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(popup.convertPlans)),n=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];if(_.each(e,function(e,t){return!!e.is_in_convert_window&&((new Date).getTime()>e.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[t].plan_id),delete popup.convertPlans[t].is_in_convert_window,popup.convertPlans.splice(t,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,popup.convertPlans[t].is_in_convert_window.step=5e3),void(n>e.is_in_convert_window.step&&(n=e.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(t)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){popup.changeCovertStatus(e),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(e,t){var n=t,p=Number(e.value)||0,o=Number(e.value)||0,i=String(e.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var e=(a=new Date(n)).getDay();0===e&&(e=7);var t=7-e;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var e=(a=new Date(n)).getMonth()+o;return e>=11?(a.setFullYear(a.getFullYear()+parseInt(e/12)),a.setMonth(e%12)):a.setMonth(e),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),e in t&&(o=t[e]*p),a.getTime()+o}};return!0!==e.natural?r.second(i):i in r?r[i]():void 0},getLast:function(e,t){var n=Number(e.value)||0,p=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(t)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var e=(i=new Date(t)).getDay();return 0===e&&(e=7),--e,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*e*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var e=(i=new Date(t)).getMonth()+1-p;return e<=0?(i.setFullYear(i.getFullYear()+(parseInt(e/12)-1)),i.setMonth(12+e%12-1)):i.setMonth(e-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(e){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(t),e in p&&(o=p[e]*n),i.getTime()-o}};return!0!==e.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var e=!1,t=popup.localData.eventQueue[0],n=popup.eventRule[t.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(e){_.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new popup.RuleCheck(e,t)}),_.each(n,function(t){!0===t.match_state?!1===e?(e=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new popup.PopupCheck(t,!0)):!0===e&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new popup.PopupCheck(t,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(e,t,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[e],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!t&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,e,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),e,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(e){var t=popup.getSFCampaign(e.plan),n=popup.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(e){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new popup.ElementRender(e.content),n=popup.getPopupInfo(e.content);if(n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,_.extend(t.msg,n),t.popupCheckInstance=this,popup.track.popupDisplay(n),!t.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),popup.info.popup_listener.onLoadSuccess(e.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(e){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(e){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,e))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var e=popup.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(e){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(e))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;_.isArray(e)&&_.each(e,function(e){e.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},popup.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);t>e[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},popup.RuleCheck.prototype.checkProperties=function(){var e={equal:function(e,t){if(!_.isNumber(e)&&!_.isString(e))return!1;for(var n=0,p=t.length;n=0},notContain:function(e,t){return!!_.isString(e)&&-1===e.indexOf(t[0])},isTrue:function(e){return!0===e},isFalse:function(e){return!1===e},isSet:function(e){return void 0!==e},notSet:function(e){return void 0===e},isEmpty:function(e){if(!_.isString(e)&&!_.isArray(e))return!1;if(_.isString(e))return""===e;for(var t=0;t_.getConvertNumberValue(t[0]))},between:function(e,t){if(!_.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=_.getConvertNumberValue(e),p=_.getConvertNumberValue(t[0]),o=_.getConvertNumberValue(t[1]);return n>=p&&n<=o},isIn:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),p=new Date(t[1]),o=new Date(e);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},t=this,n=_.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var p=n.filter,o=p.relation,i="or"===String(o).toLowerCase(),a="and"===String(o).toLowerCase(),r=!!a,s=!0;return _.each(p.conditions,function(n){if(!s)return!1;if(!n.field)return!1;var p=n.field.lastIndexOf("."),o=n.params,u="in"===n["function"]?"isIn":n["function"];if(!e[u])return r=!1,s=!1,!1;if(p<0)return!1;var l=n.field.slice(p+1),c=t.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[u](_,o);i&&d&&(r=!0,s=!1),a&&!d&&(r=!1,s=!1)}),r});_.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];_.each(e,function(e){if(!e.params||!e.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(e.params[0]);1===p?n.push(e):p>1&&_.isObject(e.window)&&e.window.value>0&&(!_.isObject(e.is_in_window)||!_.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=p?n.push(e):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=popup.localData.msg_limit_global,t=!0,n=this;_.isObject(e)&&!0===e.is_in_use&&_.isArray(e.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(e.limits,function(e){if(_.isObject(e)&&_.isNumber(e.limit)){var p=popup.ruleTime.getLast(e,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+p),t=o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&_.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(popup.info.platform="H5",!!popup.setIsLoad()&&(!!this.getBridgeState()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial()))))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=_.localStorage.get(popup.config.storageName);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(t){_.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),popup.info.encrypt_cookie&&(e=encrypt(e)),_.localStorage.set(popup.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=popup.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;return e?(_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&_.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;if(!e)return!1;e.popup_sdk_users&&_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=popup.localData,this.saveJSONData(e))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),p=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>t&&(delete e.popup_sdk_plans[p],i.push(p))}),_.each(p,function(t,n){i.length>0&&_.each(i,function(p){t.user_id&&p===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=popup.localData.popup_plans;if(!e||!_.isArray(e))return!1;var t=_.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});popup.convertPlans=t,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var e=popup.localData,t=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!t||_.isEmptyObject(t))return!1;if(!e||_.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return _.extend(popup.localData,t),!1;var n=t.popup_plans;_.each(n,function(t,p){var o=null;if(_.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,_.isObject(t.window_update)&&_.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,t),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,t)},getEventRule:function(){var e=popup.localData.popup_plans,t={};if(!e||!_.isArray(e))return!1;_.each(e,function(e){var n=e.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:e,rule:[n]},o=n.event_name,i=!1;if(t[o]){if(_.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),i=!0)}),i)return!1;t[o].push(p)}else t[o]=[p]})}),_.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),popup.eventRule=t,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var e=this;popup.sa.events.on("send",function(t){t.event&&popup.eventRule[t.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(t),e.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(t){e.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var t=0;t0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),e(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return t(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},e(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var e=popup.store.getJSONData(),t=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?popup.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(popup.localData);this.local_data!==e&&(this.local_data=e,popup.store.saveLocalData())},initial:function(){popup.store.init();var e=popup.localData.local_update_time,t=(new Date).getTime();if(_.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(e){this.active_state=!0,(e=e||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var e=_.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",p=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:p}},start:function(){var e=popup.info.project,t=popup.info.platform,n=this.hasParam().popup_window_id,p=this.hasParam().platform,o=encodeURIComponent(popup.sa.store.getDistinctId());if("WEB"===p)return popup.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1;_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=_.getUuid();_.isObject(e)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var p=popup.getPopupInfo(t);p.$sf_msg_id=n;var o={content:e.content,type:e.popup_type||"PRESET"};e.popup_type&&"CUSTOMIZED"===e.popup_type?_.isString(e.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")):_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?(new popup.ElementRender(t).render(),p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o),popup.info.popup_listener.onLoadSuccess()):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(e){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},popup.setPara=function(e){_.isObject(e)||(e={}),popup.info=_.extend({},popup.defaultPara,e);var t=popup.sa;if(!t)return popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(!0===t.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),!_.isString(popup.info.api_base_url)||"http"!==popup.info.api_base_url.slice(0,4))return popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,!_.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(popup.info.project||(popup.info.project=_.URL(t.para.server_url).searchParams.get("project")||"default"),_.isObject(popup.info.popup_listener)){var n=popup.info.popup_listener;_.isFunction(n.onClick)||(popup.info.popup_listener.onClick=function(){}),_.isFunction(n.onLoadSuccess)||(popup.info.popup_listener.onLoadSuccess=function(){}),_.isFunction(n.onLoadFailed)||(popup.info.popup_listener.onLoadFailed=function(){}),_.isFunction(n.onClose)||(popup.info.popup_listener.onClose=function(){}),_.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(popup.info.popup_listener.openlink="customize"):popup.info.popup_listener.openlink="customize"}else popup.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},popup.getBridgeState=function(){return!_.isObject(popup.sa.para.app_js_bridge)||!popup.sa.para.app_js_bridge.is_mui&&(!popup.sa.bridge||!popup.sa.bridge.is_verify_success)},popup.init=function(){var e=window.sensorsDataAnalytic201505;if(popup.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)initPopup.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){initPopup.apply(t,n)})}},popup.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||popup,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||popup):window.SensorsDataWebJSSDKPlugin={popup:popup,Popup:popup};export default popup; \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.min.js b/dist/web/plugin/sf-sdk-web/popup.min.js index b2ddddf7..0e962272 100644 --- a/dist/web/plugin/sf-sdk-web/popup.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():t()}(this,function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():t()}(this,function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){u("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),r.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var e=a.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(e){r.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(e))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;r.isArray(e)&&r.each(e,function(e){e.is_in_window&&(u("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},a.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";r.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),u(n),u(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||r.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)u("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(r.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);t>e[0]?(u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):u("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){r.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(u("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var e={equal:function(e,t){if(!r.isNumber(e)&&!r.isString(e))return!1;for(var n=0,i=t.length;n=0},notContain:function(e,t){return!!r.isString(e)&&e.indexOf(t[0])===-1},isTrue:function(e){return e===!0},isFalse:function(e){return e===!1},isSet:function(e){return"undefined"!=typeof e},notSet:function(e){return"undefined"==typeof e},isEmpty:function(e){if(!r.isString(e)&&!r.isArray(e))return!1;if(r.isString(e))return""===e;for(var t=0;tr.getConvertNumberValue(t[0]))},between:function(e,t){if(!r.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=r.getConvertNumberValue(e),i=r.getConvertNumberValue(t[0]),o=r.getConvertNumberValue(t[1]);return n>=i&&n<=o},isIn:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=n&&o<=i}catch(a){u("absolute_between Error",a)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),i=new Date(t[1]),o=new Date(e);return o>=n&&o<=i}catch(a){u("absolute_between Error",a)}}},t=this,n=r.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,o=i.relation,a="or"===String(o).toLowerCase(),s="and"===String(o).toLowerCase(),p=!!s,l=!0;return r.each(i.conditions,function(n){if(!l)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),o=n.params,r="in"===n["function"]?"isIn":n["function"];if(!e[r])return p=!1,l=!1,!1;if(i<0)return!1;var u=n.field.slice(i+1),c=t.event_data.properties,_=c[u];"$event_duration"===u&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,l=!1),s&&!d&&(p=!1,l=!1)}),p});r.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),u("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):u("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];r.each(e,function(e){if(!e.params||!e.params[0])return u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(e.params[0]);1===i?n.push(e):i>1&&r.isObject(e.window)&&e.window.value>0&&(!r.isObject(e.is_in_window)||!r.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=i?n.push(e):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=a.localData.msg_limit_global,t=!0,n=this;r.isObject(e)&&e.is_in_use===!0&&r.isArray(e.limits)&&r.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(r.each(e.limits,function(e){if(r.isObject(e)&&r.isNumber(e.limit)){var i=a.ruleTime.getLast(e,n.current_time),o=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);u("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+i),t=o0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=r.localStorage.get(a.config.storageName);r.isString(e)&&(e=n(e));try{e=JSON.parse(e)}catch(t){r.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),a.info.encrypt_cookie&&(e=i(e)),r.localStorage.set(a.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=a.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return e?(r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&r.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return!!e&&void(e.popup_sdk_users&&r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=a.localData,this.saveJSONData(e)))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),i=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),a=[];r.each(n,function(n,i){o-n.update_time>t&&(delete e.popup_sdk_plans[i],a.push(i))}),r.each(i,function(t,n){a.length>0&&r.each(a,function(i){t.user_id&&i===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=a.localData.popup_plans;if(!e||!r.isArray(e))return!1;var t=r.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});a.convertPlans=t,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var e=a.localData,t=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!t||r.isEmptyObject(t))return!1;if(!e||r.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return r.extend(a.localData,t),!1;var n=t.popup_plans;r.each(n,function(t,i){var o=null;if(r.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,r.isObject(t.window_update)&&r.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=a.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var s=o.pattern_popup.matcher_list;r.extend2Lev(o,t),o.pattern_popup.matcher_list=s,n[i]=o}),r.extend(a.localData,t)},getEventRule:function(){var e=a.localData.popup_plans,t={};return!(!e||!r.isArray(e))&&(r.each(e,function(e){var n=e.pattern_popup.matcher_list;r.each(n,function(n){var i={plan:e,rule:[n]},o=n.event_name,a=!1;if(t[o]){if(r.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),a=!0)}),a)return!1;t[o].push(i)}else t[o]=[i]})}),r.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),a.eventRule=t,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var e=this;a.sa.events.on("send",function(t){t.event&&a.eventRule[t.event]&&(r.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(t),e.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(t){e.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){function t(e){var t=new Image;t.src=e}if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),e(),void n.setIntervalTime(n.interval_time)):(t(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},e(),void n.setIntervalTime(n.interval_time)):(t(),!1)}})},updateUserPlans:function(){var e=a.store.getJSONData(),t=a.sa.store.getDistinctId(),n=a.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?a.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(a.localData);this.local_data!==e&&(this.local_data=e,a.store.saveLocalData())},initial:function(){a.store.init();var e=a.localData.local_update_time,t=(new Date).getTime();if(r.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(e){this.active_state=!0,e=e||{getLocalData:!0},e.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var e=r.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",i=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:i}},start:function(){var e=a.info.project,t=a.info.platform,n=this.hasParam().popup_window_id,i=this.hasParam().platform,o=encodeURIComponent(a.sa.store.getDistinctId());return"WEB"===i?(a.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1):void r.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=r.getUuid();r.isObject(e)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var o=a.getPopupInfo(t);o.$sf_msg_id=n;var s={content:e.content,type:e.popup_type||"PRESET"};if(e.popup_type&&"CUSTOMIZED"===e.popup_type)r.isString(e.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(o.$sf_succeed=!1,o.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s)):(o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"));else if(r.isObject(t)&&r.isObject(t.properties)&&r.isObject(t.template)){var p=new a.ElementRender(t);p.render(),o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s),a.info.popup_listener.onLoadSuccess()}else o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")},error:function(e){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},a.setPara=function(e){r.isObject(e)||(e={}),a.info=r.extend({},a.defaultPara,e);var t=a.sa;if(!t)return a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(t.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),!r.isString(a.info.api_base_url)||"http"!==a.info.api_base_url.slice(0,4))return a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,!r.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(a.info.project||(a.info.project=r.URL(t.para.server_url).searchParams.get("project")||"default"),r.isObject(a.info.popup_listener)){var n=a.info.popup_listener;r.isFunction(n.onClick)||(a.info.popup_listener.onClick=function(){}),r.isFunction(n.onLoadSuccess)||(a.info.popup_listener.onLoadSuccess=function(){}),r.isFunction(n.onLoadFailed)||(a.info.popup_listener.onLoadFailed=function(){}),r.isFunction(n.onClose)||(a.info.popup_listener.onClose=function(){}),r.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(a.info.popup_listener.openlink="customize"):a.info.popup_listener.openlink="customize"}else a.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return a.info.supportCustom=!0,r.isObject(a.info.popup_campaign_listener)?(r.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),r.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),r.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),r.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),r.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},a.getBridgeState=function(){return!r.isObject(a.sa.para.app_js_bridge)||!a.sa.para.app_js_bridge.is_mui&&(!a.sa.bridge||!a.sa.bridge.is_verify_success)},a.init=function(){var e=window.sensorsDataAnalytic201505;if(a.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)o.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){o.apply(t,n)})}},a.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||a,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||a):window.SensorsDataWebJSSDKPlugin={popup:a,Popup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js b/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js index 020d7a3f..937f4758 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js @@ -1,2 +1,2 @@ -define(function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},e=this,n=o.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,a=i.relation,r="or"===String(a).toLowerCase(),s="and"===String(a).toLowerCase(),p=!!s,u=!0;return o.each(i.conditions,function(n){if(!u)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),a=n.params,o="in"===n["function"]?"isIn":n["function"];if(!t[o])return p=!1,u=!1,!1;if(i<0)return!1;var l=n.field.slice(i+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[o](_,a);r&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p});o.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);r("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+s+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+i), +define(function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},e=this,n=o.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,a=i.relation,r="or"===String(a).toLowerCase(),s="and"===String(a).toLowerCase(),p=!!s,u=!0;return o.each(i.conditions,function(n){if(!u)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),a=n.params,o="in"===n["function"]?"isIn":n["function"];if(!t[o])return p=!1,u=!1,!1;if(i<0)return!1;var l=n.field.slice(i+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[o](_,a);r&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p});o.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);r("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+s+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+i), e=s0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=o.localStorage.get(a.config.storageName);o.isString(t)&&(t=e(t));try{t=JSON.parse(t)}catch(n){o.log(n)}return t},saveJSONData:function(t){t=JSON.stringify(t),a.info.encrypt_cookie&&(t=n(t)),o.localStorage.set(a.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=a.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return t?(o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&o.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return!!t&&void(t.popup_sdk_users&&o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=a.localData,this.saveJSONData(t)))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),i=JSON.parse(JSON.stringify(t.popup_sdk_users)),a=(new Date).getTime(),r=[];o.each(n,function(n,i){a-n.update_time>e&&(delete t.popup_sdk_plans[i],r.push(i))}),o.each(i,function(e,n){r.length>0&&o.each(r,function(i){e.user_id&&i===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=a.localData.popup_plans;if(!t||!o.isArray(t))return!1;var e=o.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});a.convertPlans=e,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var t=a.localData,e=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!e||o.isEmptyObject(e))return!1;if(!t||o.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return o.extend(a.localData,e),!1;var n=e.popup_plans;o.each(n,function(e,i){var r=null;if(o.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(r=t,e.audience_id||delete r.audience_id,o.isObject(e.window_update)&&o.each(e.window_update,function(t,n){r.window_update&&r.window_update[n]===t||("trigger_window"===n?r.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&r.is_in_convert_window&&e.convert_window&&r.is_in_convert_window.start_time&&(r.is_in_convert_window.expire_time=a.ruleTime.getExpire(e.convert_window,r.is_in_convert_window.start_time)))}))}),!r)return!1;if(!e.window_update&&r.last_update_config_time!==e.last_update_config_time)return!1;var s=r.pattern_popup.matcher_list;o.extend2Lev(r,e),r.pattern_popup.matcher_list=s,n[i]=r}),o.extend(a.localData,e)},getEventRule:function(){var t=a.localData.popup_plans,e={};return!(!t||!o.isArray(t))&&(o.each(t,function(t){var n=t.pattern_popup.matcher_list;o.each(n,function(n){var i={plan:t,rule:[n]},a=n.event_name,r=!1;if(e[a]){if(o.each(e[a],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),r=!0)}),r)return!1;e[a].push(i)}else e[a]=[i]})}),o.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),a.eventRule=e,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var t=this;a.sa.events.on("send",function(e){e.event&&a.eventRule[e.event]&&(o.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(e),t.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(e){t.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){function e(t){var e=new Image;e.src=t}if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),t(),void n.setIntervalTime(n.interval_time)):(e(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},t(),void n.setIntervalTime(n.interval_time)):(e(),!1)}})},updateUserPlans:function(){var t=a.store.getJSONData(),e=a.sa.store.getDistinctId(),n=a.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?a.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(a.localData);this.local_data!==t&&(this.local_data=t,a.store.saveLocalData())},initial:function(){a.store.init();var t=a.localData.local_update_time,e=(new Date).getTime();if(o.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(t){this.active_state=!0,t=t||{getLocalData:!0},t.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var t=o.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",i=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:i}},start:function(){var t=this.hasParam().platform;return"WEB"!==t?(a.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1):void this.webCampaign()},webCampaign:function(){var t=a.info.project,e=a.info.platform,n=this.hasParam().popup_window_id,i=encodeURIComponent(a.sa.store.getDistinctId());o.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+i,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=o.getUuid();o.isObject(t)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var r=a.getPopupInfo(e);r.$sf_msg_id=n;var s={content:t.content,type:t.popup_type||"CUSTOMIZED"};o.isString(t.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(r.$sf_succeed=!1,r.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(r.$sf_succeed=!0,a.track.popupDisplay(r),a.info.popup_campaign_listener.onStart(s)):(r.$sf_succeed=!1,r.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},a.setPara=function(t){o.isObject(t)||(t={}),a.info=o.extend({},a.defaultPara,t);var e=a.sa;return e?(e.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),o.isString(a.info.api_base_url)&&"http"===a.info.api_base_url.slice(0,4)?"http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,o.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(a.info.project||(a.info.project=o.URL(e.para.server_url).searchParams.get("project")||"default"),a.info.supportCustom=!0,o.isObject(a.info.popup_campaign_listener)?(o.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),o.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),o.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),o.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),o.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},a.init=function(){var t=window.sensorsDataAnalytic201505;if(a.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)i.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){i.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||a:window.SensorsDataWebJSSDKPlugin={WebPopup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js b/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js index 62ea29eb..260e7e64 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js @@ -1 +1 @@ -var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"}},_={visibility:function(t){t=t||{};var e={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var p in e)n+=t+"-"+p+":"+_.conversionNum(e[p])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(_.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(e,n),_.localStorage.get(e)!==n&&(t=!1),_.localStorage.remove(e)}catch(p){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(p){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,n,p){if(e&&e.addEventListener)e.addEventListener(n,function(e){e._getPath=t._getPath,p.call(this,e)},!1);else{var o="on"+n,i=e[o];e[o]=function(e,n,p){return function(o){if(!(o=o||t(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(e,o),!1!==i&&!1!==a||(r=!1),r}}(e,p,i)}}).apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return _.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return _.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(_.isObject(e[n])&&_.isObject(t[n])?_.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==t)return!1;if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var a=0,r=t.length;a=200&&n.status<300||304==n.status?t.success(e(n.responseText)):t.error(e(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(t.type,t.url,!0);try{t.credentials&&(n.withCredentials=!0),_.isObject(t.header)&&_.each(t.header,function(t,e){n.setRequestHeader&&n.setRequestHeader(e,t)}),t.data&&(t.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(t.data||null)},getUuid:function(){var t=function(){return Math.random().toString(16).replace(".","")};return function(){var e=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)}()+"-"+t()+"-"+t();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(_.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var p=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var t=_.getURLSearchParams(n.search);return{get:function(e){return t[e]}}}()}return n},contentLoaded:function(t,e){var n=!1,p=!0,o=t.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?t:o)[s](u+p.type,l,!1),!n&&(n=!0)&&e.call(t,p.type||p))},c=function(){try{i.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)e.call(t,"lazy");else{if(!a&&i.doScroll){try{p=!t.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),t[r](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(t){if(!_.isObject(t)||!_.isObject(t.template))return{};var e={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(t){_.each(t.subviews,function(t){var p=t.properties||{};"title"===p.msgType?e.$sf_msg_title=p.text:"content"===p.msgType?e.$sf_msg_content=p.text:"image"===t.type&&(e.$sf_msg_image_url=p.image),t.subviews&&n(t)})}(t.template),e},popup.getSFCampaign=function(t){t=_.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=_.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=_.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},popup.getImageList=function(t){if(!_.isArray(t))return!1;for(var e,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=t.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(t,e){r.push(e)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(t){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}},popup.handlerCampaign=function(t){var e,n=t,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{e=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:e,plan:n.plan};switch(n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===o.popup_type&&popup.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),a.state="DIALOG_NOT_SHOW_JSON_FAILED"):a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:t.$sf_msg_id};return _.isEmptyObject(e)||!_.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var p=popup.track.getPublicProps(n);_.extend(e,p),_.each(e,function(t,n){""!==t&&t!==undefined||delete e[n]}),popup.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=e.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(t){popup.log("elementClickCallback error",t)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=e.msg.plan?e.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=e.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(t){popup.log("popup_listener.onClick error",t)}if("close"===a.type)e.destory();else if(a.closeable&&e.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(popup.convertPlans));_.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var p=e.is_in_convert_window.step,o=e.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!t)return!1;_.each(t,function(t){t.popup_display_uuid===o&&t.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(t){var e=popup.info.project,n=!1;if(!t&&0===popup.convertPlans.length)return!1;t&&(_.each(popup.convertPlans,function(e){e.plan_id===t.plan_id&&(n=!0)}),n||popup.convertPlans.push(t)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(popup.convertPlans)),n=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,o=[];if(_.each(t,function(t,e){return!!t.is_in_convert_window&&((new Date).getTime()>t.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[e].plan_id),delete popup.convertPlans[e].is_in_convert_window,popup.convertPlans.splice(e,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,popup.convertPlans[e].is_in_convert_window.step=5e3),void(n>t.is_in_convert_window.step&&(n=t.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(e)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){popup.changeCovertStatus(t),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(t,e){var n=e,p=Number(t.value)||0,o=Number(t.value)||0,i=String(t.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var t=(a=new Date(n)).getDay();0===t&&(t=7);var e=7-t;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*e*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var t=(a=new Date(n)).getMonth()+o;return t>=11?(a.setFullYear(a.getFullYear()+parseInt(t/12)),a.setMonth(t%12)):a.setMonth(t),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),t in e&&(o=e[t]*p),a.getTime()+o}};return!0!==t.natural?r.second(i):i in r?r[i]():void 0},getLast:function(t,e){var n=Number(t.value)||0,p=Number(t.value)-1||0,o=String(t.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(e)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var t=(i=new Date(e)).getDay();return 0===t&&(t=7),--t,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*t*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var t=(i=new Date(e)).getMonth()+1-p;return t<=0?(i.setFullYear(i.getFullYear()+(parseInt(t/12)-1)),i.setMonth(12+t%12-1)):i.setMonth(t-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(t){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(e),t in p&&(o=p[t]*n),i.getTime()-o}};return!0!==t.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var t=!1,e=popup.localData.eventQueue[0],n=popup.eventRule[e.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(t){_.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new popup.RuleCheck(t,e)}),_.each(n,function(e){!0===e.match_state?!1===t?(t=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new popup.PopupCheck(e,!0)):!0===t&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new popup.PopupCheck(e,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(t,e,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[t],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!e&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,t,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),t,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(t){var e=popup.getSFCampaign(t.plan),n=popup.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(t){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new popup.ElementRender(t.content),n=popup.getPopupInfo(t.content);if(n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,_.extend(e.msg,n),e.popupCheckInstance=this,popup.track.popupDisplay(n),!e.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),popup.info.popup_listener.onLoadSuccess(t.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(t){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(t){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,t))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var t=popup.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(t){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(t))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;_.isArray(t)&&_.each(t,function(t){t.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},popup.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);e>t[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},popup.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!_.isNumber(t)&&!_.isString(t))return!1;for(var n=0,p=e.length;n=0},notContain:function(t,e){return!!_.isString(t)&&-1===t.indexOf(e[0])},isTrue:function(t){return!0===t},isFalse:function(t){return!1===t},isSet:function(t){return void 0!==t},notSet:function(t){return void 0===t},isEmpty:function(t){if(!_.isString(t)&&!_.isArray(t))return!1;if(_.isString(t))return""===t;for(var e=0;e_.getConvertNumberValue(e[0]))},between:function(t,e){if(!_.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=_.getConvertNumberValue(t),p=_.getConvertNumberValue(e[0]),o=_.getConvertNumberValue(e[1]);return n>=p&&n<=o},isIn:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),p=new Date(e[1]),o=new Date(t);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},e=this,n=_.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var p=n.filter,o=p.relation,i="or"===String(o).toLowerCase(),a="and"===String(o).toLowerCase(),r=!!a,s=!0;return _.each(p.conditions,function(n){if(!s)return!1;if(!n.field)return!1;var p=n.field.lastIndexOf("."),o=n.params,u="in"===n["function"]?"isIn":n["function"];if(!t[u])return r=!1,s=!1,!1;if(p<0)return!1;var l=n.field.slice(p+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[u](_,o);i&&d&&(r=!0,s=!1),a&&!d&&(r=!1,s=!1)}),r});_.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];_.each(t,function(t){if(!t.params||!t.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(t.params[0]);1===p?n.push(t):p>1&&_.isObject(t.window)&&t.window.value>0&&(!_.isObject(t.is_in_window)||!_.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=p?n.push(t):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=popup.localData.msg_limit_global,e=!0,n=this;_.isObject(t)&&!0===t.is_in_use&&_.isArray(t.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(t.limits,function(t){if(_.isObject(t)&&_.isNumber(t.limit)){var p=popup.ruleTime.getLast(t,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+p),e=o0&&(1===arguments.length&&_.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(popup.info.platform="WEB",!!popup.setIsLoad()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial())))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=_.localStorage.get(popup.config.storageName);_.isString(t)&&(t=decrypt(t));try{t=JSON.parse(t)}catch(e){_.log(e)}return t},saveJSONData:function(t){t=JSON.stringify(t),popup.info.encrypt_cookie&&(t=encrypt(t)),_.localStorage.set(popup.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=popup.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;return t?(_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&_.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;if(!t)return!1;t.popup_sdk_users&&_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=popup.localData,this.saveJSONData(t))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),p=JSON.parse(JSON.stringify(t.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>e&&(delete t.popup_sdk_plans[p],i.push(p))}),_.each(p,function(e,n){i.length>0&&_.each(i,function(p){e.user_id&&p===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=popup.localData.popup_plans;if(!t||!_.isArray(t))return!1;var e=_.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});popup.convertPlans=e,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var t=popup.localData,e=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!e||_.isEmptyObject(e))return!1;if(!t||_.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return _.extend(popup.localData,e),!1;var n=e.popup_plans;_.each(n,function(e,p){var o=null;if(_.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(o=t,e.audience_id||delete o.audience_id,_.isObject(e.window_update)&&_.each(e.window_update,function(t,n){o.window_update&&o.window_update[n]===t||("trigger_window"===n?o.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&e.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(e.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!e.window_update&&o.last_update_config_time!==e.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,e),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,e)},getEventRule:function(){var t=popup.localData.popup_plans,e={};if(!t||!_.isArray(t))return!1;_.each(t,function(t){var n=t.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:t,rule:[n]},o=n.event_name,i=!1;if(e[o]){if(_.each(e[o],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),i=!0)}),i)return!1;e[o].push(p)}else e[o]=[p]})}),_.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),popup.eventRule=e,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var t=this;popup.sa.events.on("send",function(e){e.event&&popup.eventRule[e.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(e),t.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(e){t.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var e=0;e0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),t(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return e(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},t(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var t=popup.store.getJSONData(),e=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?popup.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(popup.localData);this.local_data!==t&&(this.local_data=t,popup.store.saveLocalData())},initial:function(){popup.store.init();var t=popup.localData.local_update_time,e=(new Date).getTime();if(_.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(t){this.active_state=!0,(t=t||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var t=_.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",p=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:p}},start:function(){if("WEB"!==this.hasParam().platform)return popup.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1;this.webCampaign()},webCampaign:function(){var t=popup.info.project,e=popup.info.platform,n=this.hasParam().popup_window_id,p=encodeURIComponent(popup.sa.store.getDistinctId());_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+p,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=_.getUuid();_.isObject(t)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var p=popup.getPopupInfo(e);p.$sf_msg_id=n;var o={content:t.content,type:t.popup_type||"CUSTOMIZED"};_.isString(t.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},popup.setPara=function(t){_.isObject(t)||(t={}),popup.info=_.extend({},popup.defaultPara,t);var e=popup.sa;return e?(!0===e.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),_.isString(popup.info.api_base_url)&&"http"===popup.info.api_base_url.slice(0,4)?"http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,_.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(popup.info.project||(popup.info.project=_.URL(e.para.server_url).searchParams.get("project")||"default"),popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},popup.init=function(){var t=window.sensorsDataAnalytic201505;if(popup.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)initPopup.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){initPopup.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||popup:window.SensorsDataWebJSSDKPlugin={WebPopup:popup};export default popup; \ No newline at end of file +var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"}},_={visibility:function(t){t=t||{};var e={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var p in e)n+=t+"-"+p+":"+_.conversionNum(e[p])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(_.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(e,n),_.localStorage.get(e)!==n&&(t=!1),_.localStorage.remove(e)}catch(p){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(p){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,n,p){if(e&&e.addEventListener)e.addEventListener(n,function(e){e._getPath=t._getPath,p.call(this,e)},!1);else{var o="on"+n,i=e[o];e[o]=function(e,n,p){return function(o){if(!(o=o||t(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(e,o),!1!==i&&!1!==a||(r=!1),r}}(e,p,i)}}).apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return _.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return _.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(_.isObject(e[n])&&_.isObject(t[n])?_.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==t)return!1;if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var a=0,r=t.length;a=200&&n.status<300||304==n.status?t.success(e(n.responseText)):t.error(e(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(t.type,t.url,!0);try{t.credentials&&(n.withCredentials=!0),_.isObject(t.header)&&_.each(t.header,function(t,e){n.setRequestHeader&&n.setRequestHeader(e,t)}),t.data&&(t.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(t.data||null)},getUuid:function(){var t=function(){return Math.random().toString(16).replace(".","")};return function(){var e=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)}()+"-"+t()+"-"+t();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(_.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var p=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var t=_.getURLSearchParams(n.search);return{get:function(e){return t[e]}}}()}return n},contentLoaded:function(t,e){var n=!1,p=!0,o=t.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?t:o)[s](u+p.type,l,!1),!n&&(n=!0)&&e.call(t,p.type||p))},c=function(){try{i.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)e.call(t,"lazy");else{if(!a&&i.doScroll){try{p=!t.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),t[r](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(t){if(!_.isObject(t)||!_.isObject(t.template))return{};var e={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(t){_.each(t.subviews,function(t){var p=t.properties||{};"title"===p.msgType?e.$sf_msg_title=p.text:"content"===p.msgType?e.$sf_msg_content=p.text:"image"===t.type&&(e.$sf_msg_image_url=p.image),t.subviews&&n(t)})}(t.template),e},popup.getSFCampaign=function(t){t=_.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=_.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=_.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},popup.getImageList=function(t){if(!_.isArray(t))return!1;for(var e,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=t.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(t,e){r.push(e)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(t){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}},popup.handlerCampaign=function(t){var e,n=t,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{e=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:e,plan:n.plan};switch(n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===o.popup_type&&popup.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),a.state="DIALOG_NOT_SHOW_JSON_FAILED"):a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:t.$sf_msg_id};return _.isEmptyObject(e)||!_.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var p=popup.track.getPublicProps(n);_.extend(e,p),_.each(e,function(t,n){""!==t&&t!==undefined||delete e[n]}),popup.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=e.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(t){popup.log("elementClickCallback error",t)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=e.msg.plan?e.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=e.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(t){popup.log("popup_listener.onClick error",t)}if("close"===a.type)e.destory();else if(a.closeable&&e.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(popup.convertPlans));_.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var p=e.is_in_convert_window.step,o=e.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!t)return!1;_.each(t,function(t){t.popup_display_uuid===o&&t.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(t){var e=popup.info.project,n=!1;if(!t&&0===popup.convertPlans.length)return!1;t&&(_.each(popup.convertPlans,function(e){e.plan_id===t.plan_id&&(n=!0)}),n||popup.convertPlans.push(t)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(popup.convertPlans)),n=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,o=[];if(_.each(t,function(t,e){return!!t.is_in_convert_window&&((new Date).getTime()>t.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[e].plan_id),delete popup.convertPlans[e].is_in_convert_window,popup.convertPlans.splice(e,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,popup.convertPlans[e].is_in_convert_window.step=5e3),void(n>t.is_in_convert_window.step&&(n=t.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(e)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){popup.changeCovertStatus(t),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(t,e){var n=e,p=Number(t.value)||0,o=Number(t.value)||0,i=String(t.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var t=(a=new Date(n)).getDay();0===t&&(t=7);var e=7-t;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*e*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var t=(a=new Date(n)).getMonth()+o;return t>=11?(a.setFullYear(a.getFullYear()+parseInt(t/12)),a.setMonth(t%12)):a.setMonth(t),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),t in e&&(o=e[t]*p),a.getTime()+o}};return!0!==t.natural?r.second(i):i in r?r[i]():void 0},getLast:function(t,e){var n=Number(t.value)||0,p=Number(t.value)-1||0,o=String(t.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(e)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var t=(i=new Date(e)).getDay();return 0===t&&(t=7),--t,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*t*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var t=(i=new Date(e)).getMonth()+1-p;return t<=0?(i.setFullYear(i.getFullYear()+(parseInt(t/12)-1)),i.setMonth(12+t%12-1)):i.setMonth(t-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(t){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(e),t in p&&(o=p[t]*n),i.getTime()-o}};return!0!==t.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var t=!1,e=popup.localData.eventQueue[0],n=popup.eventRule[e.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(t){_.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new popup.RuleCheck(t,e)}),_.each(n,function(e){!0===e.match_state?!1===t?(t=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new popup.PopupCheck(e,!0)):!0===t&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new popup.PopupCheck(e,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(t,e,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[t],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!e&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,t,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),t,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(t){var e=popup.getSFCampaign(t.plan),n=popup.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(t){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new popup.ElementRender(t.content),n=popup.getPopupInfo(t.content);if(n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,_.extend(e.msg,n),e.popupCheckInstance=this,popup.track.popupDisplay(n),!e.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),popup.info.popup_listener.onLoadSuccess(t.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(t){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(t){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,t))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var t=popup.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(t){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(t))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;_.isArray(t)&&_.each(t,function(t){t.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},popup.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);e>t[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},popup.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!_.isNumber(t)&&!_.isString(t))return!1;for(var n=0,p=e.length;n=0},notContain:function(t,e){return!!_.isString(t)&&-1===t.indexOf(e[0])},isTrue:function(t){return!0===t},isFalse:function(t){return!1===t},isSet:function(t){return void 0!==t},notSet:function(t){return void 0===t},isEmpty:function(t){if(!_.isString(t)&&!_.isArray(t))return!1;if(_.isString(t))return""===t;for(var e=0;e_.getConvertNumberValue(e[0]))},between:function(t,e){if(!_.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=_.getConvertNumberValue(t),p=_.getConvertNumberValue(e[0]),o=_.getConvertNumberValue(e[1]);return n>=p&&n<=o},isIn:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),p=new Date(e[1]),o=new Date(t);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},e=this,n=_.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var p=n.filter,o=p.relation,i="or"===String(o).toLowerCase(),a="and"===String(o).toLowerCase(),r=!!a,s=!0;return _.each(p.conditions,function(n){if(!s)return!1;if(!n.field)return!1;var p=n.field.lastIndexOf("."),o=n.params,u="in"===n["function"]?"isIn":n["function"];if(!t[u])return r=!1,s=!1,!1;if(p<0)return!1;var l=n.field.slice(p+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[u](_,o);i&&d&&(r=!0,s=!1),a&&!d&&(r=!1,s=!1)}),r});_.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];_.each(t,function(t){if(!t.params||!t.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(t.params[0]);1===p?n.push(t):p>1&&_.isObject(t.window)&&t.window.value>0&&(!_.isObject(t.is_in_window)||!_.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=p?n.push(t):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=popup.localData.msg_limit_global,e=!0,n=this;_.isObject(t)&&!0===t.is_in_use&&_.isArray(t.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(t.limits,function(t){if(_.isObject(t)&&_.isNumber(t.limit)){var p=popup.ruleTime.getLast(t,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+p),e=o0&&(1===arguments.length&&_.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(popup.info.platform="WEB",!!popup.setIsLoad()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial())))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=_.localStorage.get(popup.config.storageName);_.isString(t)&&(t=decrypt(t));try{t=JSON.parse(t)}catch(e){_.log(e)}return t},saveJSONData:function(t){t=JSON.stringify(t),popup.info.encrypt_cookie&&(t=encrypt(t)),_.localStorage.set(popup.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=popup.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;return t?(_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&_.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;if(!t)return!1;t.popup_sdk_users&&_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=popup.localData,this.saveJSONData(t))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),p=JSON.parse(JSON.stringify(t.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>e&&(delete t.popup_sdk_plans[p],i.push(p))}),_.each(p,function(e,n){i.length>0&&_.each(i,function(p){e.user_id&&p===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=popup.localData.popup_plans;if(!t||!_.isArray(t))return!1;var e=_.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});popup.convertPlans=e,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var t=popup.localData,e=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!e||_.isEmptyObject(e))return!1;if(!t||_.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return _.extend(popup.localData,e),!1;var n=e.popup_plans;_.each(n,function(e,p){var o=null;if(_.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(o=t,e.audience_id||delete o.audience_id,_.isObject(e.window_update)&&_.each(e.window_update,function(t,n){o.window_update&&o.window_update[n]===t||("trigger_window"===n?o.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&e.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(e.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!e.window_update&&o.last_update_config_time!==e.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,e),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,e)},getEventRule:function(){var t=popup.localData.popup_plans,e={};if(!t||!_.isArray(t))return!1;_.each(t,function(t){var n=t.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:t,rule:[n]},o=n.event_name,i=!1;if(e[o]){if(_.each(e[o],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),i=!0)}),i)return!1;e[o].push(p)}else e[o]=[p]})}),_.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),popup.eventRule=e,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var t=this;popup.sa.events.on("send",function(e){e.event&&popup.eventRule[e.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(e),t.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(e){t.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var e=0;e0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),t(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return e(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},t(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var t=popup.store.getJSONData(),e=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?popup.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(popup.localData);this.local_data!==t&&(this.local_data=t,popup.store.saveLocalData())},initial:function(){popup.store.init();var t=popup.localData.local_update_time,e=(new Date).getTime();if(_.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(t){this.active_state=!0,(t=t||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var t=_.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",p=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:p}},start:function(){if("WEB"!==this.hasParam().platform)return popup.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1;this.webCampaign()},webCampaign:function(){var t=popup.info.project,e=popup.info.platform,n=this.hasParam().popup_window_id,p=encodeURIComponent(popup.sa.store.getDistinctId());_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+p,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=_.getUuid();_.isObject(t)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var p=popup.getPopupInfo(e);p.$sf_msg_id=n;var o={content:t.content,type:t.popup_type||"CUSTOMIZED"};_.isString(t.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},popup.setPara=function(t){_.isObject(t)||(t={}),popup.info=_.extend({},popup.defaultPara,t);var e=popup.sa;return e?(!0===e.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),_.isString(popup.info.api_base_url)&&"http"===popup.info.api_base_url.slice(0,4)?"http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,_.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(popup.info.project||(popup.info.project=_.URL(e.para.server_url).searchParams.get("project")||"default"),popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},popup.init=function(){var t=window.sensorsDataAnalytic201505;if(popup.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)initPopup.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){initPopup.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||popup:window.SensorsDataWebJSSDKPlugin={WebPopup:popup};export default popup; \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.min.js b/dist/web/plugin/sf-sdk-web/webPopup.min.js index b37d2524..298510ac 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.9",plugin_version:"1.25.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},e=this,n=o.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,a=i.relation,r="or"===String(a).toLowerCase(),s="and"===String(a).toLowerCase(),p=!!s,u=!0;return o.each(i.conditions,function(n){if(!u)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),a=n.params,o="in"===n["function"]?"isIn":n["function"];if(!t[o])return p=!1,u=!1,!1;if(i<0)return!1;var l=n.field.slice(i+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[o](_,a);r&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p});o.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.25.10",plugin_version:"1.25.10",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null,this.checkProperties()):r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null,this.checkProperties())},a.RuleCheck.prototype.checkProperties=function(){var t={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},e=this,n=o.filter(this.rule_arr,function(n){if(!n.filter||n.filter.conditions&&0===n.filter.conditions.length)return!0;var i=n.filter,a=i.relation,r="or"===String(a).toLowerCase(),s="and"===String(a).toLowerCase(),p=!!s,u=!0;return o.each(i.conditions,function(n){if(!u)return!1;if(!n.field)return!1;var i=n.field.lastIndexOf("."),a=n.params,o="in"===n["function"]?"isIn":n["function"];if(!t[o])return p=!1,u=!1,!1;if(i<0)return!1;var l=n.field.slice(i+1),c=e.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[o](_,a);r&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p});o.isArray(n)&&n.length>0?(this.checkWindowAndMatch(n),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i); r("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+s+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+i),e=s0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=o.localStorage.get(a.config.storageName);o.isString(t)&&(t=e(t));try{t=JSON.parse(t)}catch(n){o.log(n)}return t},saveJSONData:function(t){t=JSON.stringify(t),a.info.encrypt_cookie&&(t=n(t)),o.localStorage.set(a.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=a.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return t?(o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&o.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return!!t&&void(t.popup_sdk_users&&o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=a.localData,this.saveJSONData(t)))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),i=JSON.parse(JSON.stringify(t.popup_sdk_users)),a=(new Date).getTime(),r=[];o.each(n,function(n,i){a-n.update_time>e&&(delete t.popup_sdk_plans[i],r.push(i))}),o.each(i,function(e,n){r.length>0&&o.each(r,function(i){e.user_id&&i===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=a.localData.popup_plans;if(!t||!o.isArray(t))return!1;var e=o.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});a.convertPlans=e,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var t=a.localData,e=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!e||o.isEmptyObject(e))return!1;if(!t||o.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return o.extend(a.localData,e),!1;var n=e.popup_plans;o.each(n,function(e,i){var r=null;if(o.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(r=t,e.audience_id||delete r.audience_id,o.isObject(e.window_update)&&o.each(e.window_update,function(t,n){r.window_update&&r.window_update[n]===t||("trigger_window"===n?r.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&r.is_in_convert_window&&e.convert_window&&r.is_in_convert_window.start_time&&(r.is_in_convert_window.expire_time=a.ruleTime.getExpire(e.convert_window,r.is_in_convert_window.start_time)))}))}),!r)return!1;if(!e.window_update&&r.last_update_config_time!==e.last_update_config_time)return!1;var s=r.pattern_popup.matcher_list;o.extend2Lev(r,e),r.pattern_popup.matcher_list=s,n[i]=r}),o.extend(a.localData,e)},getEventRule:function(){var t=a.localData.popup_plans,e={};return!(!t||!o.isArray(t))&&(o.each(t,function(t){var n=t.pattern_popup.matcher_list;o.each(n,function(n){var i={plan:t,rule:[n]},a=n.event_name,r=!1;if(e[a]){if(o.each(e[a],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),r=!0)}),r)return!1;e[a].push(i)}else e[a]=[i]})}),o.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),a.eventRule=e,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var t=this;a.sa.events.on("send",function(e){e.event&&a.eventRule[e.event]&&(o.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(e),t.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(e){t.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){function e(t){var e=new Image;e.src=t}if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),t(),void n.setIntervalTime(n.interval_time)):(e(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},t(),void n.setIntervalTime(n.interval_time)):(e(),!1)}})},updateUserPlans:function(){var t=a.store.getJSONData(),e=a.sa.store.getDistinctId(),n=a.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?a.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(a.localData);this.local_data!==t&&(this.local_data=t,a.store.saveLocalData())},initial:function(){a.store.init();var t=a.localData.local_update_time,e=(new Date).getTime();if(o.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(t){this.active_state=!0,t=t||{getLocalData:!0},t.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var t=o.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",i=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:i}},start:function(){var t=this.hasParam().platform;return"WEB"!==t?(a.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1):void this.webCampaign()},webCampaign:function(){var t=a.info.project,e=a.info.platform,n=this.hasParam().popup_window_id,i=encodeURIComponent(a.sa.store.getDistinctId());o.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+i,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=o.getUuid();o.isObject(t)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var r=a.getPopupInfo(e);r.$sf_msg_id=n;var s={content:t.content,type:t.popup_type||"CUSTOMIZED"};o.isString(t.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(r.$sf_succeed=!1,r.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(r.$sf_succeed=!0,a.track.popupDisplay(r),a.info.popup_campaign_listener.onStart(s)):(r.$sf_succeed=!1,r.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},a.setPara=function(t){o.isObject(t)||(t={}),a.info=o.extend({},a.defaultPara,t);var e=a.sa;return e?(e.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),o.isString(a.info.api_base_url)&&"http"===a.info.api_base_url.slice(0,4)?"http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,o.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(a.info.project||(a.info.project=o.URL(e.para.server_url).searchParams.get("project")||"default"),a.info.supportCustom=!0,o.isObject(a.info.popup_campaign_listener)?(o.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),o.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),o.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),o.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),o.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},a.init=function(){var t=window.sensorsDataAnalytic201505;if(a.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)i.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){i.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||a:window.SensorsDataWebJSSDKPlugin={WebPopup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/site-linker-concat-utm/index.closure.js b/dist/web/plugin/site-linker-concat-utm/index.closure.js index f0104fea..71b635af 100644 --- a/dist/web/plugin/site-linker-concat-utm/index.closure.js +++ b/dist/web/plugin/site-linker-concat-utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,r,e){if(r&&(t.plugin_name=r),e&&t.init){var n=t.init;t.init=function(s,a){function o(){n.call(t,s,a)}return i(s,t,r),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(e,o)}}return t}function i(t,i,r){function e(i,e){t.logger?t.logger.msg.apply(t.logger,e).module(r+""||"").level(i).log():t.log&&t.log.apply(t,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function r(i,r,n){return t(i,r,n),i.plugin_version=e,i}var e="1.25.9",n={};n.getPart=function(t){var i=!1,r=this.option.length;if(r)for(var e=0;e-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,r=!1;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!!r},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var r=i?"f"+t:"d"+t;return encodeURIComponent(r)},n.rewriteUrl=function(t,i){var r=this,e=/([^?#]+)(\?[^#]*)?(#.*)?/,n=e.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),e=[];return r._.each(i,function(t){t.indexOf("_sasdk=")>-1?e.push(l):e.push(t)}),e.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var e="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==i&&(e?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(r))}},n.addListen=function(){var t=this,i=function(i){var r,e,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(r=n.href,e=n):(r=a.href,e=a);var o=t._.URL(r),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(r)&&t.rewriteUrl(r,e)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function r(i){for(var r=i.length,e=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=r(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=r(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function r(t){var i={};if(s._.isArray(t)){var r=t[2]||"";if(""!==r)for(var e=r.slice(1).split("&"),n=0;n=3||!s.on?o():void s.on(e,o)}}return t}function i(t,i,r){function e(i,e){t.logger?t.logger.msg.apply(t.logger,e).module(r+""||"").level(i).log():t.log&&t.log.apply(t,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function r(i,r,n){return t(i,r,n),i.plugin_version=e,i}var e="1.25.10",n={};n.getPart=function(t){var i=!1,r=this.option.length;if(r)for(var e=0;e-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,r=!1;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!!r},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var r=i?"f"+t:"d"+t;return encodeURIComponent(r)},n.rewriteUrl=function(t,i){var r=this,e=/([^?#]+)(\?[^#]*)?(#.*)?/,n=e.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),e=[];return r._.each(i,function(t){t.indexOf("_sasdk=")>-1?e.push(l):e.push(t)}),e.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var e="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==i&&(e?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(r))}},n.addListen=function(){var t=this,i=function(i){var r,e,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(r=n.href,e=n):(r=a.href,e=a);var o=t._.URL(r),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(r)&&t.rewriteUrl(r,e)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function r(i){for(var r=i.length,e=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=r(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=r(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function r(t){var i={};if(s._.isArray(t)){var r=t[2]||"";if(""!==r)for(var e=r.slice(1).split("&"),n=0;n=3||!n.on)return a();function a(){r.call(t,n,s)}n.on(e,a)}}return t}function wrapLogFn(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function createPlugin(t,i,e){return wrapPluginInitFn(t,i,e),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return!0;return!1},getPartHash:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(i?"f"+t:"d"+t)},rewriteUrl:function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,a=r[1]||"",o=r[2]||"",l=r[3]||"",u="_sasdk="+this.getCurrenId(),f=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(u):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=l.indexOf("_sasdk"),n=l.indexOf("?")>-1?s>-1?a+o+"#"+l.substring(1,s)+f(l.substring(s,l.length)):a+o+l+"&"+u:a+o+"#"+l.substring(1)+"?"+u;else s=o.indexOf("_sasdk"),n=/^\?(\w)+/.test(o)?s>-1?a+"?"+f(o.substring(1))+l:a+o+"&"+u+l:a+"?"+u+l;return i&&(i.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},setRefferId:function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);(e=e.substring(1))!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},addListen:function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e).protocol;"http:"!==o&&"https:"!==o||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},init:function(t,i){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(i)&&this._.isArray(i.linker)&&i.linker.length>0?(this.setRefferId(i),this.addListen(),this.option=i.linker,this.option=function(i){for(var e=i.length,r=[],n=0;n=3||!n.on)return a();function a(){r.call(t,n,s)}n.on(e,a)}}return t}function wrapLogFn(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function createPlugin(t,i,e){return wrapPluginInitFn(t,i,e),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return!0;return!1},getPartHash:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(i?"f"+t:"d"+t)},rewriteUrl:function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,a=r[1]||"",o=r[2]||"",l=r[3]||"",u="_sasdk="+this.getCurrenId(),f=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(u):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=l.indexOf("_sasdk"),n=l.indexOf("?")>-1?s>-1?a+o+"#"+l.substring(1,s)+f(l.substring(s,l.length)):a+o+l+"&"+u:a+o+"#"+l.substring(1)+"?"+u;else s=o.indexOf("_sasdk"),n=/^\?(\w)+/.test(o)?s>-1?a+"?"+f(o.substring(1))+l:a+o+"&"+u+l:a+"?"+u+l;return i&&(i.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},setRefferId:function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);(e=e.substring(1))!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},addListen:function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e).protocol;"http:"!==o&&"https:"!==o||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},init:function(t,i){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(i)&&this._.isArray(i.linker)&&i.linker.length>0?(this.setRefferId(i),this.addListen(),this.option=i.linker,this.option=function(i){for(var e=i.length,r=[],n=0;n=3||!s.on?o():void s.on(r,o)}}return t}function i(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function e(i,e,n){return t(i,e,n),i.plugin_version=r,i}var r="1.25.9",n={};n.getPart=function(t){var i=!1,e=this.option.length;if(e)for(var r=0;r-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,e=!1;if(i)for(var r=0;r-1)return this.option[r].after_hash;return!!e},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var e=i?"f"+t:"d"+t;return encodeURIComponent(e)},n.rewriteUrl=function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(l):r.push(t)}),r.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);e=e.substring(1),e!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},n.addListen=function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function e(i){for(var e=i.length,r=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=e(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=e(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function e(t){var i={};if(s._.isArray(t)){var e=t[2]||"";if(""!==e)for(var r=e.slice(1).split("&"),n=0;n=3||!s.on?o():void s.on(r,o)}}return t}function i(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function e(i,e,n){return t(i,e,n),i.plugin_version=r,i}var r="1.25.10",n={};n.getPart=function(t){var i=!1,e=this.option.length;if(e)for(var r=0;r-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,e=!1;if(i)for(var r=0;r-1)return this.option[r].after_hash;return!!e},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var e=i?"f"+t:"d"+t;return encodeURIComponent(e)},n.rewriteUrl=function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(l):r.push(t)}),r.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);e=e.substring(1),e!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},n.addListen=function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function e(i){for(var e=i.length,r=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=e(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=e(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function e(t){var i={};if(s._.isArray(t)){var e=t[2]||"";if(""!==e)for(var r=e.slice(1).split("&"),n=0;n=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.25.9",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",f=n[3]||"",h="_sasdk="+this.getCurrenId(),d=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(h):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=f.indexOf("_sasdk");var g=f.indexOf("?");s=g>-1?o>-1?a+u+"#"+f.substring(1,o)+d(f.substring(o,f.length)):a+u+f+"&"+h:a+u+"#"+f.substring(1)+"?"+h}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+d(u.substring(1))+f:a+u+"&"+h+f:a+"?"+h+f}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file +!function(){"use strict";function t(t,i,r){if(i&&(t.plugin_name=i),r&&t.init){var n=t.init;t.init=function(s,o){function a(){n.call(t,s,o)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.25.10",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",f=n[3]||"",h="_sasdk="+this.getCurrenId(),d=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(h):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=f.indexOf("_sasdk");var g=f.indexOf("?");s=g>-1?o>-1?a+u+"#"+f.substring(1,o)+d(f.substring(o,f.length)):a+u+f+"&"+h:a+u+"#"+f.substring(1)+"?"+h}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+d(u.substring(1))+f:a+u+"&"+h+f:a+"?"+h+f}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file diff --git a/dist/web/plugin/site-linker/index.es6.js b/dist/web/plugin/site-linker/index.es6.js index 0ada8c9b..2a77b5f9 100644 --- a/dist/web/plugin/site-linker/index.es6.js +++ b/dist/web/plugin/site-linker/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var r=t.init;t.init=function(n,s){if(wrapLogFn(n,t,e),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){r.call(t,n,s)}n.on(i,o)}}return t}function wrapLogFn(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(t,e,i){return wrapPluginInitFn(t,e,i),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return!0;return!1},getPartHash:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return this.option[i].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(e?"f"+t:"d"+t)},rewriteUrl:function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,o=r[1]||"",a=r[2]||"",u=r[3]||"",d="_sasdk="+this.getCurrenId(),f=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(d):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=u.indexOf("_sasdk"),n=u.indexOf("?")>-1?s>-1?o+a+"#"+u.substring(1,s)+f(u.substring(s,u.length)):o+a+u+"&"+d:o+a+"#"+u.substring(1)+"?"+d;else s=a.indexOf("_sasdk"),n=/^\?(\w)+/.test(a)?s>-1?o+"?"+f(a.substring(1))+u:o+a+"&"+d+u:o+"?"+d+u;return e&&(e.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},setRefferId:function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);(i=i.substring(1))!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},addListen:function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i).protocol;"http:"!==a&&"https:"!==a||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},init:function(t,e){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(e)&&this._.isArray(e.linker)&&e.linker.length>0?(this.setRefferId(e),this.addListen(),this.option=e.linker,this.option=function(e){for(var i=e.length,r=[],n=0;n=3||!n.on)return o();function o(){r.call(t,n,s)}n.on(i,o)}}return t}function wrapLogFn(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(t,e,i){return wrapPluginInitFn(t,e,i),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return!0;return!1},getPartHash:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return this.option[i].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(e?"f"+t:"d"+t)},rewriteUrl:function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,o=r[1]||"",a=r[2]||"",u=r[3]||"",d="_sasdk="+this.getCurrenId(),f=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(d):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=u.indexOf("_sasdk"),n=u.indexOf("?")>-1?s>-1?o+a+"#"+u.substring(1,s)+f(u.substring(s,u.length)):o+a+u+"&"+d:o+a+"#"+u.substring(1)+"?"+d;else s=a.indexOf("_sasdk"),n=/^\?(\w)+/.test(a)?s>-1?o+"?"+f(a.substring(1))+u:o+a+"&"+d+u:o+"?"+d+u;return e&&(e.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},setRefferId:function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);(i=i.substring(1))!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},addListen:function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i).protocol;"http:"!==a&&"https:"!==a||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},init:function(t,e){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(e)&&this._.isArray(e.linker)&&e.linker.length>0?(this.setRefferId(e),this.addListen(),this.option=e.linker,this.option=function(e){for(var i=e.length,r=[],n=0;n=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.25.9",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",d=n[3]||"",f="_sasdk="+this.getCurrenId(),h=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(f):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=d.indexOf("_sasdk");var g=d.indexOf("?");s=g>-1?o>-1?a+u+"#"+d.substring(1,o)+h(d.substring(o,d.length)):a+u+d+"&"+f:a+u+"#"+d.substring(1)+"?"+f}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+h(u.substring(1))+d:a+u+"&"+f+d:a+"?"+f+d}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SiteLinker=function(){"use strict";function t(t,i,r){if(i&&(t.plugin_name=i),r&&t.init){var n=t.init;t.init=function(s,o){function a(){n.call(t,s,o)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.25.10",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",d=n[3]||"",f="_sasdk="+this.getCurrenId(),h=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(f):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=d.indexOf("_sasdk");var g=d.indexOf("?");s=g>-1?o>-1?a+u+"#"+d.substring(1,o)+h(d.substring(o,d.length)):a+u+d+"&"+f:a+u+"#"+d.substring(1)+"?"+f}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+h(u.substring(1))+d:a+u+"&"+f+d:a+"?"+f+d}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file diff --git a/dist/web/plugin/user-encrypt-default/index.closure.js b/dist/web/plugin/user-encrypt-default/index.closure.js index 9d855892..04779095 100644 --- a/dist/web/plugin/user-encrypt-default/index.closure.js +++ b/dist/web/plugin/user-encrypt-default/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var i=n.init;n.init=function(u,o){function f(){i.call(n,u,o)}return t(u,n,e),u.readyState&&u.readyState.state>=3||!u.on?f():void u.on(r,f)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,i){return n(t,e,i),t.plugin_version=r,t}var r="1.25.9",i={init:function(n){var t=n._.isString,e=n._.rot13defs,r=n._.dfmapping,i="data:enc;",u="dfm-enc-";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return u+r(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=e(n)):0===n.indexOf(u)&&(n=n.substring(u.length),n=r(n)),n},n.kit.userDecryptIfNeeded=function(e){return!t(e)||0!==e.indexOf(i)&&0!==e.indexOf(u)||(e=n.kit.userDecrypt(e)),e}})},plugin_name:"UserEncryptDefault"},u=e(i);return u}(); \ No newline at end of file +!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var i=n.init;n.init=function(u,o){function f(){i.call(n,u,o)}return t(u,n,e),u.readyState&&u.readyState.state>=3||!u.on?f():void u.on(r,f)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,i){return n(t,e,i),t.plugin_version=r,t}var r="1.25.10",i={init:function(n){var t=n._.isString,e=n._.rot13defs,r=n._.dfmapping,i="data:enc;",u="dfm-enc-";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return u+r(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=e(n)):0===n.indexOf(u)&&(n=n.substring(u.length),n=r(n)),n},n.kit.userDecryptIfNeeded=function(e){return!t(e)||0!==e.indexOf(i)&&0!==e.indexOf(u)||(e=n.kit.userDecrypt(e)),e}})},plugin_name:"UserEncryptDefault"},u=e(i);return u}(); \ No newline at end of file diff --git a/dist/web/plugin/user-encrypt-default/index.es6.js b/dist/web/plugin/user-encrypt-default/index.es6.js index a952065d..82b2d599 100644 --- a/dist/web/plugin/user-encrypt-default/index.es6.js +++ b/dist/web/plugin/user-encrypt-default/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(i,u){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){t.call(n,i,u)}i.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}var userEncryptDefault={init:function(n){var e=n._.isString,r=n._.rot13defs,t=n._.dfmapping,i="data:enc;";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return"dfm-enc-"+t(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=r(n)):0===n.indexOf("dfm-enc-")&&(n=n.substring("dfm-enc-".length),n=t(n)),n},n.kit.userDecryptIfNeeded=function(r){return!e(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=n.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault);export default index; \ No newline at end of file +var sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(i,u){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){t.call(n,i,u)}i.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}var userEncryptDefault={init:function(n){var e=n._.isString,r=n._.rot13defs,t=n._.dfmapping,i="data:enc;";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return"dfm-enc-"+t(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=r(n)):0===n.indexOf("dfm-enc-")&&(n=n.substring("dfm-enc-".length),n=t(n)),n},n.kit.userDecryptIfNeeded=function(r){return!e(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=n.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault);export default index; \ No newline at end of file diff --git a/dist/web/plugin/utm/index.closure.js b/dist/web/plugin/utm/index.closure.js index 3a97473d..25a75055 100644 --- a/dist/web/plugin/utm/index.closure.js +++ b/dist/web/plugin/utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,u){function a(){i.call(n,o,u)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.25.9",u={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},a=r(u,"Utm","sdkAfterInitPara");return a}(); \ No newline at end of file +!function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,u){function a(){i.call(n,o,u)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.25.10",u={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},a=r(u,"Utm","sdkAfterInitPara");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/utm/index.es6.js b/dist/web/plugin/utm/index.es6.js index 731cea37..660e4a26 100644 --- a/dist/web/plugin/utm/index.es6.js +++ b/dist/web/plugin/utm/index.es6.js @@ -1 +1 @@ -var sd,source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder="1.25.9";function wrapPluginInitFn(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,r),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(e,o)}}return n}function wrapLogFn(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function createPlugin(n,r,e){return wrapPluginInitFn(n,r,e),n.plugin_version=sdkversion_placeholder,n}var utm={init:function(n){n&&!sd&&(sd=n).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var n=source_channel_standard.split(" "),r="",e={};sd._.isArray(sd.para.source_channel)&&sd.para.source_channel.length>0&&(n=n.concat(sd.para.source_channel),n=sd._.unique(n));return sd._.each(n,function(n){(r=sd._.getQueryParam(location.href,n)).length&&(e[n]=r)}),e}()}}})}},index=createPlugin(utm,"Utm","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder="1.25.10";function wrapPluginInitFn(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,r),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(e,o)}}return n}function wrapLogFn(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function createPlugin(n,r,e){return wrapPluginInitFn(n,r,e),n.plugin_version=sdkversion_placeholder,n}var utm={init:function(n){n&&!sd&&(sd=n).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var n=source_channel_standard.split(" "),r="",e={};sd._.isArray(sd.para.source_channel)&&sd.para.source_channel.length>0&&(n=n.concat(sd.para.source_channel),n=sd._.unique(n));return sd._.each(n,function(n){(r=sd._.getQueryParam(location.href,n)).length&&(e[n]=r)}),e}()}}})}},index=createPlugin(utm,"Utm","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/utm/index.js b/dist/web/plugin/utm/index.js index 712476ee..e7239408 100644 --- a/dist/web/plugin/utm/index.js +++ b/dist/web/plugin/utm/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Utm=function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,a){function u(){i.call(n,o,a)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(e,u)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.25.9",a={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},u=r(a,"Utm","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Utm=function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,a){function u(){i.call(n,o,a)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(e,u)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.25.10",a={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},u=r(a,"Utm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/wechat-webview-channel/index.closure.js b/dist/web/plugin/wechat-webview-channel/index.closure.js index 100c8eeb..0896da52 100644 --- a/dist/web/plugin/wechat-webview-channel/index.closure.js +++ b/dist/web/plugin/wechat-webview-channel/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var a=e.init;e.init=function(r,s){function o(){a.call(e,r,s)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);r=f?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);r=f?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i-1)return!0;return!1},siteLinker.getPartHash=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!1},siteLinker.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},siteLinker.rewriteUrl=function(e,t){var n=this,i=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),a="";if(i){var s,r=i[1]||"",o=i[2]||"",l=i[3]||"",_="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),i=[];return n._.each(t,function(e){e.indexOf("_sasdk=")>-1?i.push(_):i.push(e)}),i.join("&")};if(this.getPartHash(e))s=l.indexOf("_sasdk"),a=l.indexOf("?")>-1?s>-1?r+o+"#"+l.substring(1,s)+d(l.substring(s,l.length)):r+o+l+"&"+_:r+o+"#"+l.substring(1)+"?"+_;else s=o.indexOf("_sasdk"),a=/^\?(\w)+/.test(o)?s>-1?r+"?"+d(o.substring(1))+l:r+o+"&"+_+l:r+"?"+_+l;return t&&(t.href=a),a}},siteLinker.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},siteLinker.setRefferId=function(e){var t=this.store.getDistinctId(),n=this.getUrlId();if(n&&""!==n){var i="a"===n.substring(0,1)||"d"===n.substring(0,1);(n=n.substring(1))!==t&&(i?(this.sd.identify(n,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:n,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(n))}},siteLinker.addListen=function(){var e=this,t=function(t){var n,i,a=t.target,s=a.tagName.toLowerCase(),r=a.parentNode;if("a"===s&&a.href||r&&r.tagName&&"a"===r.tagName.toLowerCase()&&r.href){"a"===s&&a.href?(n=a.href,i=a):(n=r.href,i=r);var o=e._.URL(n).protocol;"http:"!==o&&"https:"!==o||e.getPart(n)&&e.rewriteUrl(n,i)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},siteLinker.init=function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var n=t.length,i=[],a=0;a0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd.registerPage(t):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},n=JSON.stringify(t);sd.para.encrypt_cookie&&(n=sd.kit.userEncrypt(n)),_.cookie.set(cookie_name,n)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var n=t-e.latest_event_initial_time;n>0&&n=3||!a.on)return r();function r(){i.call(e,a,s)}a.on(n,r)}}return e}function wrapLogFn(e,t,n){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(n+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,n){return wrapPluginInitFn(e,t,n),e.plugin_version=sdkversion_placeholder,e}var sa={},url_obj={},_$1={};siteLinker.init=function(e){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this.setRefferId()},siteLinker.getUrlId=function(){return url_obj.prefix+url_obj.did},Channel.addLatestChannelUrl=function(){},Channel.saveProp=function(){Channel.registerAndSave({$app_id:url_obj.aid,$ad_custom_data_type:url_obj.adt})},Channel.getProp=function(){var e=this.cookie.getChannel();_$1.isObject(e)&&e.$app_id&&e.$ad_custom_data_type&&sa.registerPage({$app_id:e.$app_id,$ad_custom_data_type:e.$ad_custom_data_type})};var wwc={getWechatWebViewPara:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(sa._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)?t=[t.substring(0,1),t.substring(1)]:sa._.urlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64(t)?t=[t.substring(0,1),sa._.base64Decode(sa._.urlSafeBase64.decode(t.substring(1)))]:sa._.rot13defs&&(t=[t.substring(0,1),sa._.rot13defs(t.substring(1))]);var n=sa._.safeJSONParse(t[1]);if(sa._.isObject(n)&&n.did&&n.aid&&n.adt)return{prefix:t[0],did:n.did,aid:n.aid,adt:n.adt}}return""},init:function(e){sa=e,_$1=e._,url_obj=this.getWechatWebViewPara(),Channel.init(e,{cookie_name:"sas2015-ad-ww"}),sa._.isObject(url_obj)&&url_obj.did&&url_obj.aid&&url_obj.adt?(siteLinker.init(e),Channel.saveProp()):Channel.getProp()}},index=createPlugin(wwc,"WechatWebviewChannel","sdkReady");export default index; \ No newline at end of file +var _,sd,store,cookie_name,siteLinker={};siteLinker.getPart=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return!0;return!1},siteLinker.getPartHash=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!1},siteLinker.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},siteLinker.rewriteUrl=function(e,t){var n=this,i=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),a="";if(i){var s,r=i[1]||"",o=i[2]||"",l=i[3]||"",_="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),i=[];return n._.each(t,function(e){e.indexOf("_sasdk=")>-1?i.push(_):i.push(e)}),i.join("&")};if(this.getPartHash(e))s=l.indexOf("_sasdk"),a=l.indexOf("?")>-1?s>-1?r+o+"#"+l.substring(1,s)+d(l.substring(s,l.length)):r+o+l+"&"+_:r+o+"#"+l.substring(1)+"?"+_;else s=o.indexOf("_sasdk"),a=/^\?(\w)+/.test(o)?s>-1?r+"?"+d(o.substring(1))+l:r+o+"&"+_+l:r+"?"+_+l;return t&&(t.href=a),a}},siteLinker.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},siteLinker.setRefferId=function(e){var t=this.store.getDistinctId(),n=this.getUrlId();if(n&&""!==n){var i="a"===n.substring(0,1)||"d"===n.substring(0,1);(n=n.substring(1))!==t&&(i?(this.sd.identify(n,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:n,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(n))}},siteLinker.addListen=function(){var e=this,t=function(t){var n,i,a=t.target,s=a.tagName.toLowerCase(),r=a.parentNode;if("a"===s&&a.href||r&&r.tagName&&"a"===r.tagName.toLowerCase()&&r.href){"a"===s&&a.href?(n=a.href,i=a):(n=r.href,i=r);var o=e._.URL(n).protocol;"http:"!==o&&"https:"!==o||e.getPart(n)&&e.rewriteUrl(n,i)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},siteLinker.init=function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var n=t.length,i=[],a=0;a0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd.registerPage(t):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},n=JSON.stringify(t);sd.para.encrypt_cookie&&(n=sd.kit.userEncrypt(n)),_.cookie.set(cookie_name,n)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var n=t-e.latest_event_initial_time;n>0&&n=3||!a.on)return r();function r(){i.call(e,a,s)}a.on(n,r)}}return e}function wrapLogFn(e,t,n){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(n+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,n){return wrapPluginInitFn(e,t,n),e.plugin_version=sdkversion_placeholder,e}var sa={},url_obj={},_$1={};siteLinker.init=function(e){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this.setRefferId()},siteLinker.getUrlId=function(){return url_obj.prefix+url_obj.did},Channel.addLatestChannelUrl=function(){},Channel.saveProp=function(){Channel.registerAndSave({$app_id:url_obj.aid,$ad_custom_data_type:url_obj.adt})},Channel.getProp=function(){var e=this.cookie.getChannel();_$1.isObject(e)&&e.$app_id&&e.$ad_custom_data_type&&sa.registerPage({$app_id:e.$app_id,$ad_custom_data_type:e.$ad_custom_data_type})};var wwc={getWechatWebViewPara:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(sa._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)?t=[t.substring(0,1),t.substring(1)]:sa._.urlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64(t)?t=[t.substring(0,1),sa._.base64Decode(sa._.urlSafeBase64.decode(t.substring(1)))]:sa._.rot13defs&&(t=[t.substring(0,1),sa._.rot13defs(t.substring(1))]);var n=sa._.safeJSONParse(t[1]);if(sa._.isObject(n)&&n.did&&n.aid&&n.adt)return{prefix:t[0],did:n.did,aid:n.aid,adt:n.adt}}return""},init:function(e){sa=e,_$1=e._,url_obj=this.getWechatWebViewPara(),Channel.init(e,{cookie_name:"sas2015-ad-ww"}),sa._.isObject(url_obj)&&url_obj.did&&url_obj.aid&&url_obj.adt?(siteLinker.init(e),Channel.saveProp()):Channel.getProp()}},index=createPlugin(wwc,"WechatWebviewChannel","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/wechat-webview-channel/index.js b/dist/web/plugin/wechat-webview-channel/index.js index 4d55302e..8d4b4016 100644 --- a/dist/web/plugin/wechat-webview-channel/index.js +++ b/dist/web/plugin/wechat-webview-channel/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).WechatWebViewChannel=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var a=e.init;e.init=function(r,s){function o(){a.call(e,r,s)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var h=/^\?(\w)+/.test(l);r=h?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var h=/^\?(\w)+/.test(l);r=h?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Wi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Gi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Wi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(Yi&&e.forEach===Yi)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Wi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Wi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Wi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Wi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Wi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Wi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Wi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Wi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:pa.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,$a._state.identities);var a={identities:i,distinct_id:$a.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,$a.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ba.properties(),$a.getProps(),$a.getSessionProps(),ba.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ua.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Ba.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Sa.checkIsAddSign(a),Sa.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Ma.stage.process("basicProps",e)}function dt(e){return Ma.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Ka.stage.process("webClickEvent",e)}function ht(e){return Ka.stage.process("webStayEvent",e)}function mt(){var e=ba.campaignParams(),t={};return k(e,function(e,r,n){(" "+Fi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(Fi.is_first_visitor&&r){var n={};Fi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=va.id(),n.$search_keyword_id_type=va.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),Fi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Za.EVENT_LIST&&(r=Za.EVENT_LIST[e],Za[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=$a.getFirstId(),s=$a.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===$a.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(a)&&n===$a._state.first_id)return!1;var l=$a._state.history_login_id.name!==a||n!==$a._state.history_login_id.value;if(l){$a._state.identities[a]=n,$a.set("history_login_id",{name:a,value:n}), o||$a.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:$a._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];$a._state.identities=t,$a.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(e)&&$a._state.identities[e]===t){var n=$a.getUnionId().login_id;n&&e+"+"+t===n&&($a._state.distinct_id=$a._state.first_id,$a._state.first_id="",$a.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete $a._state.identities[e],$a.save())}var i={};return i[e]=t,i}function Pt(){Fi._t=Fi._t||1*new Date,Fi.is_first_visitor=!1,Fi.source_channel_standard=fa}function Ct(e){P(pa,e||Fi.para||{}),Fi.para=pa;var t={};if(r(Fi.para.is_track_latest))for(var n in Fi.para.is_track_latest)t["latest_"+n]=Fi.para.is_track_latest[n];Fi.para.preset_properties=P({},da.preset_properties,t,Fi.para.preset_properties||{});var i;for(i in da)void 0===Fi.para[i]&&(Fi.para[i]=da[i]);"string"!=typeof Fi.para.web_url||"://"!==Fi.para.web_url.slice(0,3)&&"//"!==Fi.para.web_url.slice(0,2)||("://"===Fi.para.web_url.slice(0,3)?Fi.para.web_url=location.protocol.slice(0,-1)+Fi.para.web_url:Fi.para.web_url=location.protocol+Fi.para.web_url),ya.protocol.serverUrl(),Fi.bridge&&Fi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Fi.para.source_type&&(Fi.para.source_type.utm=v(Fi.para.source_type.utm)?Fi.para.source_type.utm.concat(a):a,Fi.para.source_type.search=v(Fi.para.source_type.search)?Fi.para.source_type.search.concat(o):o,Fi.para.source_type.social=v(Fi.para.source_type.social)?Fi.para.source_type.social.concat(s):s,Fi.para.source_type.keyword=r(Fi.para.source_type.keyword)?P(l,Fi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Fi.para.heatmap&&!r(Fi.para.heatmap)&&(Fi.para.heatmap={}),r(Fi.para.heatmap)){Fi.para.heatmap.clickmap=Fi.para.heatmap.clickmap||"default",Fi.para.heatmap.scroll_notice_map=Fi.para.heatmap.scroll_notice_map||"default",Fi.para.heatmap.scroll_delay_time=Fi.para.heatmap.scroll_delay_time||4e3,Fi.para.heatmap.scroll_event_duration=Fi.para.heatmap.scroll_event_duration||18e3,Fi.para.heatmap.renderRefreshTime=Fi.para.heatmap.renderRefreshTime||1e3,Fi.para.heatmap.loadTimeout=Fi.para.heatmap.loadTimeout||1e3,Fi.para.heatmap.get_vtrack_config!==!0&&(Fi.para.heatmap.get_vtrack_config=!1);var p=v(Fi.para.heatmap.track_attr)?U(Fi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),Fi.para.heatmap.track_attr=p,r(Fi.para.heatmap.collect_tags))if(Fi.para.heatmap.collect_tags.div===!0)Fi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Fi.para.heatmap.collect_tags.div)){if(Fi.para.heatmap.collect_tags.div.ignore_tags?v(Fi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Fi.para.heatmap.collect_tags.div.ignore_tags=c):Fi.para.heatmap.collect_tags.div.ignore_tags=c,Fi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,Fi.para.heatmap.collect_tags.div.max_level)===-1&&(Fi.para.heatmap.collect_tags.div.max_level=1)}}else Fi.para.heatmap.collect_tags.div=!1;else Fi.para.heatmap.collect_tags=u}Fi.para.server_url=Ge(Fi.para.server_url),Fi.para.noCache===!0?Fi.para.noCache="?"+(new Date).getTime():Fi.para.noCache="",Fi.para.callback_timeout>Fi.para.datasend_timeout&&(Fi.para.datasend_timeout=Fi.para.callback_timeout),Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&r(Fi.para.heatmap.collect_tags)&&k(Fi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Fi.heatmap.otherTags.push(t)}),Fi.para.heatmap&&"default"===Fi.para.heatmap.clickmap&&Fi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Wa[t]?Wa[t].apply(Wa,r):void("function"==typeof t?t.apply(Fi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Fi,n),a.plugin_is_init=!0,Fi.modules=Fi.modules||{},Fi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Fi.modules&&Fi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(Fi.modules)&&r(Fi.modules[t])?a=Fi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Fi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&qa.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&($a._state.identities[e]=t,$a.save(),void qa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&qa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,Fi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,Fi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Fi.track(t,r,i)}))}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&qa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&qa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||qa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?qa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){qa.send({type:"profile_delete"},e),$a.set("distinct_id",Zi()),$a.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),qa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=$a.getFirstId();if("undefined"==typeof e){var n=Zi();r?$a.set("first_id",n):$a.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?$a.set("first_id",e):$a.set("distinct_id",e):r?$a.change("first_id",e):$a.change("distinct_id",e))}function Mt(e,t,r,n){var i=$a.getFirstId()||$a.getDistinctId();$a.set("distinct_id",e),qa.send({original_id:i,distinct_id:$a.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ba.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){$a.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Fi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){Fi.para.is_track_single_page&&za.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ba.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Fi.quick&&Fi.quick("autoTrack",i)}};if("boolean"==typeof Fi.para.is_track_single_page)i();else if("function"==typeof Fi.para.is_track_single_page){var a=Fi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){Fi._q&&v(Fi._q)&&Fi._q.length>0&&k(Fi._q,function(e){Fi[e[0]].apply(Fi,Array.prototype.slice.call(e[1]))}),r(Fi.para.heatmap)&&(Va.initHeatmap(),Va.initScrollmap())}function pr(){Fi.readyState.setState(3),new Fi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),lr(!1),Fi.bridge.app_js_bridge_v1(),ba.initPage(),ur(),$a.init(),or(),fr(),Fi.readyState.setState(4),cr()}function dr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function fr(){Ba.init(),"success"===Fi.bridge.bridge_info.verify_success&&Ua.init()}function gr(){k(io,function(t){var r=Fi[t];Fi[t]=function(){if(Fi.readyState.state<3)return v(Fi._q)||(Fi._q=[]),Ne("calling sdk api before init is deprecated."),Fi._q.push([t,arguments]),!1;if(!e(Fi.getDisabled)||!Fi.getDisabled())return Fi.readyState.getState()?r.apply(Fi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function yr(e,t){_o[e]&&_o[e](t)}function br(){return ho.stage&&ho.stage.process("getUtmData")}function wr(e){return mo.stage.process("send",e)}function Sr(e){e.kit=vo,e.saEvent=qa,this.buildDataStage=Ma,this.sendDataStage=mo,this.businessStage=ho}function kr(e){e.heatmap=Va,this.viewStage=Ka}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(Fi.events=Ia,Fi.bridge=to,Fi.SDKJSBridge=rr,Fi.JSBridge=ar,Fi.store=$a,Fi.unlimitedDiv=Ra,Fi.customProp=Ha,Fi.vtrackcollect=Ba,Fi.vapph5collect=Ua,Fi.detectMode=dr,Fi.registerFeature=vr,Fi.registerInterceptor=yr,Fi.commonWays=Wa,vr(new Sr(Fi)),vr(new kr(Fi)),yr("viewStage",yo));var t=e?Ya:ao;for(var r in t)Fi[r]=t[r];Fi.logger=ca,Fi.log=Oe,Fi._=eo,Fi.on=bt,Fi.ee=Za,Fi.use=Nt,Fi.lib_version=ga,Fi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=Bo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function Ar(e){return zo&&zo.call(Vo,JSON.stringify(e))}function Dr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=Go,e}function Rr(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),Co&&!Co.bridge.activeBridge&&Po){if(Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},!Co.para.app_js_bridge)return void No("app_js_bridge is not configured, data will not be sent by android bridge.");Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),No("Android bridge inits succeed.")}}function Hr(e,t){if(Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return rs&&rs.call(es,JSON.stringify(e))}function Mr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=as,e}function Wr(){if(jo=window.SensorsData_APP_JS_Bridge,To=jo&&jo.sensorsdata_track,Io=jo&&jo.sensorsdata_verify,$o=jo&&jo.sensorsdata_visual_verify,Ao&&!Ao.bridge.activeBridge&&(Io||To||$o)){Ao.bridge.activeBridge=os;var e=Io||To;if($o&&(e=!!$o.call(jo,JSON.stringify({server_url:Ao.para.server_url}))),Ao.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Ao.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Ao.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),xo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Ao.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Io){var n=Io&&Io.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data)));return n?(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Ao.para.app_js_bridge.is_send?(Ao.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return To&&To.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data))),Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in is.commands?is.commands[t](e,jo):jo&&Do.isFunction(jo.sensorsdata_js_call_app)?jo.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ls,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=ps,e}function rn(){return"undefined"!=typeof Ho&&document[Ho]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=As,e}function sn(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=Ds,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),ms("IOS bridge inits succeed.")}}function ln(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Es,e}function fn(){if(vs&&!vs.bridge.activeBridge&&gn()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),bs("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Rs,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=Bs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=qs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); -}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===pl.para.send_type){var r=e.server_url;e.data=pl.kit.encodeTrackData(e.data),dl.isArray(r)&&r.length?dl.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof pl.para.server_url&&""!==pl.para.server_url?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===fl.para.send_type){var r=e.server_url;e.data=fl.kit.encodeTrackData(e.data),gl.isArray(r)&&r.length?gl.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof fl.para.server_url&&""!==fl.para.server_url?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;hl.isArray(r)&&r.length?hl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Ki()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t)))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1; -return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.9",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.9",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.9",Ls={ -init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.9",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.9",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.9",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;dl.isObject(e.config)&&(r=e.config.send_type,n=dl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===pl.para.send_type;if(i&&dl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=pl.kit.encodeTrackData(e.data),dl.isArray(a)&&a.length?dl.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Ki()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t)))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n); +if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.10",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.10",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.10",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.10",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.10",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){ +this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.10",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.10",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.10",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.10",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.10",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.10",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.10",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.10",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.10",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.10",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.10",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.10",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.10",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,d,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};(function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}).apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--){if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){if(e.element_path&&"div"!==trim(e.element_path.split(">").pop()).slice(0,3))return!1;return!0},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t)))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):saEvent.send({type:"profile_increment",properties:e},t))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r}()}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t=e,r="";r=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){if("beacon"===sd$b.para.send_type){var r=e.server_url;e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(r)&&r.length?_$9.each(r,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof sd$b.para.server_url&&""!==sd$b.para.server_url?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){if("ajax"===sd$c.para.send_type){var r=e.server_url;e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(r)&&r.length?_$a.each(r,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof sd$c.para.server_url&&""!==sd$c.para.server_url?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=e.server_url,n=e.data;_$b.isArray(r)&&r.length?_$b.each(r,function(t){t&&(e.data=getSendUrl(t,n),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof r&&""!==r?(e.data=getSendUrl(r,n),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,L=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},C=function(e,t,r,n,i,a,s){var o,d,u,p,f,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return L(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}).call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return i({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};(function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement||a.target;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}).apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){logger.log(t)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),ry(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!isArray(r))return null;for(var n=r.length-1;n>=0;n--){if(t=r[n].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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i=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{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function base64Encode(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler)}}).init()}function loadScript(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")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).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)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(each(e,function(e){t[t.length]=e}),t)}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],n={},i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}};function saAddEvent(e,t,r){var n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}};var dataStoragePrefix="sawebjssdk-",tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){var r=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){if(e.element_path&&"div"!==trim(e.element_path.split(">").pop()).slice(0,3))return!1;return!0},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},configIsMatch:function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t)))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(e.$element_position!==undefined){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(!isObject(t)||!isString(t.$element_path))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isFunction(e.tagName.toLowerCase)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=i.parentNode.tagName.toLowerCase();"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);a?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),sd.is_first_visitor=!1}}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,n=window.history.pushState,i=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),e(r),r=location.href}),t=window.document.documentMode?"hashchange":n?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete store._state.identities[e],store.save())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("warning: invalid plugin, plugin version required."),!r.plugin_is_init&&r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"==typeof e&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"==typeof e&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):saEvent.send({type:"profile_increment",properties:e},t))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e,t){"number"==typeof e&&(e=String(e));var r=store.getFirstId();if(void 0===e){var n=UUID();r?store.set("first_id",n):store.set("distinct_id",n)}else check({distinct_id:e})&&(!0===t?r?store.set("first_id",e):store.set("distinct_id",e):r?store.change("first_id",e):store.change("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="1.25.10";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.25.10";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="1.25.10";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="1.25.10";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){if(anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData$1(e,t){if(sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return anVerify?anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)))?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="1.25.10";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.25.10";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="1.25.10";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(sd$5.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.25.10";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var e=this.getPageLeaveProperties();!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},PageLeave.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.25.10";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.25.10";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="1.25.10";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.25.10";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r}()}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.25.10";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="1.25.10";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t=e,r="";r=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e),_$6.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="1.25.10";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="1.25.10";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="1.25.10";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="1.25.10";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k],autoUsePlugins=[consoleLogger,index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{p(e)||(e=String(e)),e=d(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Wi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Gi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){Wi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(Yi&&e.forEach===Yi)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Wi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function j(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}function T(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},p=function(){try{a.doScroll("left")}catch(e){return void setTimeout(p,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(d){Wi.log(d)}n&&p()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function I(e){return k(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function $(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function A(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=d(e);var r;if("body"===e)return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Wi.log(o)}return i&&_(i)?r(i):null}if(!p(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=d(e.textContent):e.innerText&&(r=d(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Wi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function Z(e){return p(e)?(e=d(e),$(e)):$(location.href)}function G(e){return p(e)?(e=d(e),$(e)):$(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e}function de(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!p(t.callbackName))return Wi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Wi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Wi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Wi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({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)}function he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,p)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else p(i)||ce(i)||D(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function rt(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function nt(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function it(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))it(e[a]);else if(p(i)){if(re(n,a)>-1)return;e[a]=rt(i,re(t,a)>-1?1024:pa.max_string_length)}})}function at(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function ot(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};et({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};et({item_id:n},i)}}function st(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&et({propertyKey:n},i)})}function lt(e){var t=e.properties;ye(e),r(t)?(tt(t),nt(t),at(e),st(t),it(t)):"properties"in e&&(e.properties={}),ot(e)}function ut(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function ct(e,t){var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,$a._state.identities);var a={identities:i,distinct_id:$a.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,$a.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},ba.properties(),$a.getProps(),$a.getSessionProps(),ba.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!p(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!p(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&p(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&p(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!p(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!p(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!p(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),p(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&D(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ua.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Ba.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Sa.checkIsAddSign(a),Sa.checkIsFirstTime(a),Fe(a),Ve(a),a}function pt(e){return Ma.stage.process("basicProps",e)}function dt(e){return Ma.stage.process("formatData",e)}function ft(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&He(e.ele,"click",function(e){i(e)}))))}function gt(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function _t(e){return Ka.stage.process("webClickEvent",e)}function ht(e){return Ka.stage.process("webStayEvent",e)}function mt(){var e=ba.campaignParams(),t={};return k(e,function(e,r,n){(" "+Fi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function vt(e,t,r){if(Fi.is_first_visitor&&r){var n={};Fi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Ie()&&(n.$search_keyword_id=va.id(),n.$search_keyword_id_type=va.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=De(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:p(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:p(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:Be(),$first_search_keyword:Ee()},mt(),n)),Fi.is_first_visitor=!1}}function yt(t){var r=location.href,n=window.history.pushState,i=window.history.replaceState;e(window.history.pushState)&&(window.history.pushState=function(){n.apply(window.history,arguments),t(r),r=location.href}),e(window.history.replaceState)&&(window.history.replaceState=function(){i.apply(window.history,arguments),t(r),r=location.href});var a;a=window.document.documentMode?"hashchange":n?"popstate":"hashchange",b(window,a,function(){t(r),r=location.href})}function bt(e,t){var r=[];"string"==typeof e&&e in Za.EVENT_LIST&&(r=Za.EVENT_LIST[e],Za[r[0]].on(r[1],t))}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=$a.getFirstId(),s=$a.getOriginDistinctId();if(!et({distinct_id:n}))return je("login id is invalid"),!1;if(n===$a.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(a)&&n===$a._state.first_id)return!1;var l=$a._state.history_login_id.name!==a||n!==$a._state.history_login_id.value;if(l){$a._state.identities[a]=n,$a.set("history_login_id",{name:a,value:n}),o||$a.set("first_id",s), t(n,"$SignUp",{},i);var u={$identity_cookie_id:$a._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];$a._state.identities=t,$a.save()}function kt(e,t){if(!et({unbindKey:e,bindValue:t}))return!1;if(r($a._state.identities)&&$a._state.identities.hasOwnProperty(e)&&$a._state.identities[e]===t){var n=$a.getUnionId().login_id;n&&e+"+"+t===n&&($a._state.distinct_id=$a._state.first_id,$a._state.first_id="",$a.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete $a._state.identities[e],$a.save())}var i={};return i[e]=t,i}function Pt(){Fi._t=Fi._t||1*new Date,Fi.is_first_visitor=!1,Fi.source_channel_standard=fa}function Ct(e){P(pa,e||Fi.para||{}),Fi.para=pa;var t={};if(r(Fi.para.is_track_latest))for(var n in Fi.para.is_track_latest)t["latest_"+n]=Fi.para.is_track_latest[n];Fi.para.preset_properties=P({},da.preset_properties,t,Fi.para.preset_properties||{});var i;for(i in da)void 0===Fi.para[i]&&(Fi.para[i]=da[i]);"string"!=typeof Fi.para.web_url||"://"!==Fi.para.web_url.slice(0,3)&&"//"!==Fi.para.web_url.slice(0,2)||("://"===Fi.para.web_url.slice(0,3)?Fi.para.web_url=location.protocol.slice(0,-1)+Fi.para.web_url:Fi.para.web_url=location.protocol+Fi.para.web_url),ya.protocol.serverUrl(),Fi.bridge&&Fi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Fi.para.source_type&&(Fi.para.source_type.utm=v(Fi.para.source_type.utm)?Fi.para.source_type.utm.concat(a):a,Fi.para.source_type.search=v(Fi.para.source_type.search)?Fi.para.source_type.search.concat(o):o,Fi.para.source_type.social=v(Fi.para.source_type.social)?Fi.para.source_type.social.concat(s):s,Fi.para.source_type.keyword=r(Fi.para.source_type.keyword)?P(l,Fi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Fi.para.heatmap&&!r(Fi.para.heatmap)&&(Fi.para.heatmap={}),r(Fi.para.heatmap)){Fi.para.heatmap.clickmap=Fi.para.heatmap.clickmap||"default",Fi.para.heatmap.scroll_notice_map=Fi.para.heatmap.scroll_notice_map||"default",Fi.para.heatmap.scroll_delay_time=Fi.para.heatmap.scroll_delay_time||4e3,Fi.para.heatmap.scroll_event_duration=Fi.para.heatmap.scroll_event_duration||18e3,Fi.para.heatmap.renderRefreshTime=Fi.para.heatmap.renderRefreshTime||1e3,Fi.para.heatmap.loadTimeout=Fi.para.heatmap.loadTimeout||1e3,Fi.para.heatmap.get_vtrack_config!==!0&&(Fi.para.heatmap.get_vtrack_config=!1);var p=v(Fi.para.heatmap.track_attr)?U(Fi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(p.push("data-sensors-click"),Fi.para.heatmap.track_attr=p,r(Fi.para.heatmap.collect_tags))if(Fi.para.heatmap.collect_tags.div===!0)Fi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Fi.para.heatmap.collect_tags.div)){if(Fi.para.heatmap.collect_tags.div.ignore_tags?v(Fi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Fi.para.heatmap.collect_tags.div.ignore_tags=c):Fi.para.heatmap.collect_tags.div.ignore_tags=c,Fi.para.heatmap.collect_tags.div.max_level){var d=[1,2,3];re(d,Fi.para.heatmap.collect_tags.div.max_level)===-1&&(Fi.para.heatmap.collect_tags.div.max_level=1)}}else Fi.para.heatmap.collect_tags.div=!1;else Fi.para.heatmap.collect_tags=u}Fi.para.server_url=Ge(Fi.para.server_url),Fi.para.noCache===!0?Fi.para.noCache="?"+(new Date).getTime():Fi.para.noCache="",Fi.para.callback_timeout>Fi.para.datasend_timeout&&(Fi.para.datasend_timeout=Fi.para.callback_timeout),Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&r(Fi.para.heatmap.collect_tags)&&k(Fi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Fi.heatmap.otherTags.push(t)}),Fi.para.heatmap&&"default"===Fi.para.heatmap.clickmap&&Fi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Wa[t]?Wa[t].apply(Wa,r):void("function"==typeof t?t.apply(Fi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Fi,n),a.plugin_is_init=!0,Fi.modules=Fi.modules||{},Fi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!p(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Fi.modules&&Fi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return p(t)&&(r(Fi.modules)&&r(Fi.modules[t])?a=Fi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Fi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){et({event:e,properties:t})&&qa.send({type:"track",event:e,properties:t},r)}function Tt(e,t){return!!et({bindKey:e,bindValue:t})&&($a._state.identities[e]=t,$a.save(),void qa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function It(e,t){var r=kt(e,t);r&&qa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function $t(e,t,r){"object"==typeof e&&e.tagName?ft({ele:e},t,r,Fi.track):"object"==typeof e&&e.target&&e.event&&ft(e,t,r,Fi.track)}function At(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void He(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Fi.track(t,r,i)}))}function Dt(e,t,r){et({item_type:e,item_id:t,properties:r})&&qa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){et({item_type:e,item_id:t})&&qa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set",properties:e},t)}function Lt(e,t){et({propertiesMust:e})&&qa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){et({propertiesMust:e})&&(k(e,function(t,r){p(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||qa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;p(e)&&(e={},e[n]=1),et({propertiesMust:e})&&(r(e)?qa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Ht(e){qa.send({type:"profile_delete"},e),$a.set("distinct_id",Zi()),$a.set("first_id","")}function Bt(e,t){var r=e,n={};p(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){p(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),qa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e,t){"number"==typeof e&&(e=String(e));var r=$a.getFirstId();if("undefined"==typeof e){var n=Zi();r?$a.set("first_id",n):$a.set("distinct_id",n)}else et({distinct_id:e})&&(t===!0?r?$a.set("first_id",e):$a.set("distinct_id",e):r?$a.change("first_id",e):$a.change("distinct_id",e))}function Mt(e,t,r,n){var i=$a.getFirstId()||$a.getDistinctId();$a.set("distinct_id",e),qa.send({original_id:i,distinct_id:$a.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function qt(e,t,r,n){"number"==typeof e&&(e=String(e)),et({distinct_id:e,event:t,properties:r})&&Mt(e,t,r,n)}function Kt(e){et({properties:e})?P(ba.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Ft(e){$a.clearAllProps(e)}function Vt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Fi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vapph5define.min.js"})}else t();else t()}function ur(t){Fi.para.is_track_single_page&&za.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){ba.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Fi.quick&&Fi.quick("autoTrack",i)}};if("boolean"==typeof Fi.para.is_track_single_page)i();else if("function"==typeof Fi.para.is_track_single_page){var a=Fi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function cr(){Fi._q&&v(Fi._q)&&Fi._q.length>0&&k(Fi._q,function(e){Fi[e[0]].apply(Fi,Array.prototype.slice.call(e[1]))}),r(Fi.para.heatmap)&&(Va.initHeatmap(),Va.initScrollmap())}function pr(){Fi.readyState.setState(3),new Fi.SDKJSBridge("visualized").onAppNotify(function(){lr("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),lr(!1),Fi.bridge.app_js_bridge_v1(),ba.initPage(),ur(),$a.init(),or(),fr(),Fi.readyState.setState(4),cr()}function dr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function fr(){Ba.init(),"success"===Fi.bridge.bridge_info.verify_success&&Ua.init()}function gr(){k(io,function(t){var r=Fi[t];Fi[t]=function(){if(Fi.readyState.state<3)return v(Fi._q)||(Fi._q=[]),Ne("calling sdk api before init is deprecated."),Fi._q.push([t,arguments]),!1;if(!e(Fi.getDisabled)||!Fi.getDisabled())return Fi.readyState.getState()?r.apply(Fi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function _r(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function hr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new _r,this.sensors=r}function mr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function vr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function yr(e,t){_o[e]&&_o[e](t)}function br(){return ho.stage&&ho.stage.process("getUtmData")}function wr(e){return mo.stage.process("send",e)}function Sr(e){e.kit=vo,e.saEvent=qa,this.buildDataStage=Ma,this.sendDataStage=mo,this.businessStage=ho}function kr(e){e.heatmap=Va,this.viewStage=Ka}function Pr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};yr("buildDataStage",r)}function Cr(e){e&&(Fi.events=Ia,Fi.bridge=to,Fi.SDKJSBridge=rr,Fi.JSBridge=ar,Fi.store=$a,Fi.unlimitedDiv=Ra,Fi.customProp=Ha,Fi.vtrackcollect=Ba,Fi.vapph5collect=Ua,Fi.detectMode=dr,Fi.registerFeature=vr,Fi.registerInterceptor=yr,Fi.commonWays=Wa,vr(new Sr(Fi)),vr(new kr(Fi)),yr("viewStage",yo));var t=e?Ya:ao;for(var r in t)Fi[r]=t[r];Fi.logger=ca,Fi.log=Oe,Fi._=eo,Fi.on=bt,Fi.ee=Za,Fi.use=Nt,Fi.lib_version=ga,Fi.registerPropertyPlugin=Pr}function Or(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jr(e,t,r){return Or(e,t,r),e.plugin_version=Bo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ir(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ir(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $r(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function Ar(e){return zo&&zo.call(Vo,JSON.stringify(e))}function Dr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function xr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Er(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Lr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Lr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ur(e,t,r){return Er(e,t,r),e.plugin_version=Go,e}function Rr(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),Co&&!Co.bridge.activeBridge&&Po){if(Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},!Co.para.app_js_bridge)return void No("app_js_bridge is not configured, data will not be sent by android bridge.");Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}),No("Android bridge inits succeed.")}}function Hr(e,t){if(Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function Br(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Jr(e){return rs&&rs.call(es,JSON.stringify(e))}function Mr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function qr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Kr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Fr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Fr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Vr(e,t,r){return Kr(e,t,r),e.plugin_version=as,e}function Wr(){if(jo=window.SensorsData_APP_JS_Bridge,To=jo&&jo.sensorsdata_track,Io=jo&&jo.sensorsdata_verify,$o=jo&&jo.sensorsdata_visual_verify,Ao&&!Ao.bridge.activeBridge&&(Io||To||$o)){Ao.bridge.activeBridge=os;var e=Io||To;if($o&&(e=!!$o.call(jo,JSON.stringify({server_url:Ao.para.server_url}))),Ao.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Ao.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Ao.registerInterceptor("sendDataStage",{send:{priority:80,entry:zr}}),xo("Android obsolete bridge inits succeed.")}}function zr(e,t){if(Ao.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(Io){var n=Io&&Io.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data)));return n?(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Ao.para.app_js_bridge.is_send?(Ao.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return To&&To.call(jo,JSON.stringify(Do.extend({server_url:Ao.para.server_url},e.data))),Do.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Xr(e){var t=e.callType;return t in is.commands?is.commands[t](e,jo):jo&&Do.isFunction(jo.sensorsdata_js_call_app)?jo.sensorsdata_js_call_app(JSON.stringify(e)):void 0}function Zr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Qr(e,t,r){return Zr(e,t,r),e.plugin_version=ls,e}function Yr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return en(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function en(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function tn(e,t,r){return Yr(e,t,r),e.plugin_version=ps,e}function rn(){return"undefined"!=typeof Ho&&document[Ho]}function nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return an(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function an(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function on(e,t,r){return nn(e,t,r),e.plugin_version=As,e}function sn(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=Ds,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:ln}}),ms("IOS bridge inits succeed.")}}function ln(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function un(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function cn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function dn(e,t,r){return cn(e,t,r),e.plugin_version=Es,e}function fn(){if(vs&&!vs.bridge.activeBridge&&gn()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_n()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:hn}}),bs("IOS obsolete bridge inits succeed.")}}function gn(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function _n(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function hn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function mn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yn(e,t,r){return mn(e,t,r),e.plugin_version=Rs,e}function bn(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=Bs}function wn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Sn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Sn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function kn(e,t,r){return wn(e,t,r),e.plugin_version=qs,e}function Pn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function Cn(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function On(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Nn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Nn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); -}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function jn(e,t,r){return On(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return In(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){if("beacon"===pl.para.send_type){var r=e.server_url;e.data=pl.kit.encodeTrackData(e.data),dl.isArray(r)&&r.length?dl.each(r,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof pl.para.server_url&&""!==pl.para.server_url?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){if("ajax"===fl.para.send_type){var r=e.server_url;e.data=fl.kit.encodeTrackData(e.data),gl.isArray(r)&&r.length?gl.each(r,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof fl.para.server_url&&""!==fl.para.server_url?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=e.server_url,n=e.data;hl.isArray(r)&&r.length?hl.each(r,function(t){t&&(e.data=Ni(t,n),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof r&&""!==r?(e.data=Ni(r,n),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Ki()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t)))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1; -return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.9",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.9",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.9",Ls={ -init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.9",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.9";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.9",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.9",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e=3||!i.on?o():void i.on(r,o)}}return e}function In(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function $n(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function An(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function Dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function En(e,t,r){return Dn(e,t,r),e.plugin_version=rl,e}function Ln(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Un(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Un(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rn(e,t,r){return Ln(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Bn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Bn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Jn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function Mn(){kl=!0}function qn(){kl=!1}function Kn(){return kl}function Fn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wn(e,t,r){return Fn(e,t,r),e.plugin_version=Nl,e}function zn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Xn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;zn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Zn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Gn(){al.on("sdkInitPara",function(){Zn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Xn}})})}function Qn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ei(e,t,r){return Qn(e,t,r),e.plugin_version=Il,e}function ti(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ri(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ni),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ti}})})}function ni(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ii(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ai(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ai(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function oi(e,t,r){return ii(e,t,r),e.plugin_version=Dl,e}function si(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function di(e,t,r){return ci(e,t,r),e.plugin_version=Ul,e}function fi(e){var t=new dl.BeaconSend(e);t.start()}function gi(e,t){var r=null,n=null;dl.isObject(e.config)&&(r=e.config.send_type,n=dl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===pl.para.send_type;if(i&&dl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=pl.kit.encodeTrackData(e.data),dl.isArray(a)&&a.length?dl.each(a,function(t){e.callback=null,e.server_url=t,fi(e)}):"string"==typeof a&&""!==a?fi(e):pl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function _i(){"beacon"!==pl.para.send_type||dl.isSupportBeaconSend()||(pl.para.send_type="image")}function hi(){pl.on("sdkInitPara",function(){_i()}),pl.on("sdkAfterInitPara",function(){pl.registerInterceptor("sendDataStage",{send:{priority:110,entry:gi}})})}function mi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return vi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function vi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function yi(e,t,r){return mi(e,t,r),e.plugin_version=Bl,e}function bi(e){var t=new gl.AjaxSend(e);t.start()}function wi(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,bi(e)}):"string"==typeof a&&""!==a?bi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function Si(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function ki(){fl.on("sdkInitPara",function(){Si()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:wi}})})}function Pi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ci(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ci(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Oi(e,t,r){return Pi(e,t,r),e.plugin_version=ql,e}function Ni(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function ji(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=Ni(t,i),e.callback=null,e.server_url=t,ji(e))}):"string"==typeof n&&""!==n?(e.data=Ni(n,i),ji(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ii(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function $i(){_l.on("sdkInitPara",function(){Ii()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function Ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Di(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Di(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function xi(e,t,r){return Ai(e,t,r),e.plugin_version=ga,e}function Ei(e){return null===zl?void Li(e):void zl.push(e)}function Li(e){try{if("log"===e.level&&Ui())return void Bi(e);if("warn"===e.level&&Ri())return void Bi(e);if("error"===e.level&&Hi())return void Bi(e)}catch(t){}}function Ui(){return!!Ki()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Ri(){return!!Ki()||(Ui()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Ki()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Bi(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Ji(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Ji(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function Mi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Ki(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Fi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new p((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new p(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new p((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new p((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var d,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),d=5==n.a.length&&1===n.a[0],d&&(a(function(){d=!f('"\t"')}),d&&a(function(){d=1!==f("01")}),d&&a(function(){d=1!==f("1.")})))},function(){d=!1}),t=d}}return o[e]=!!t}function s(e){return A(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,p=n.Date||r.Date,d=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new p((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var T={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},I="000000",$=function(e,t){return(I+(t||0)).slice(-e)},A=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return p[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;d(r+1,0)<=i;r++);for(n=c((i-d(r,0))/30.42);d(r,n+1)<=i;n++);i=1+i-d(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+$(6,r<0?-r:r):$(4,r))+"-"+$(2,n+1)+"-"+$(2,i)+"T"+$(2,o)+":"+$(2,s)+":"+$(2,l)+"."+$(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var D=i.stringify;i.stringify=function(e,t,r){var n=p.prototype.toJSON;p.prototype.toJSON=s;var i=D(e,t,r);return p.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=T[t];return r?r:x+$(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,d,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===p.prototype.toJSON?l=A(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),d=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,H));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(H),t=H;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++H);e+=a.slice(t,H)}if(34==a.charCodeAt(H))return H++,e;q();default:if(t=H,45==i&&(n=!0,i=a.charCodeAt(++H)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(H+1),i>=48&&i<=57)&&q(),n=!1;H=48&&i<=57);H++);if(46==a.charCodeAt(H)){for(r=++H;r57));r++);r==H&&q(),H=r}if(i=a.charCodeAt(H),101==i||69==i){for(i=a.charCodeAt(++H),43!=i&&45!=i||H++,r=H;r57));r++);r==H&&q(),H=r}return+a.slice(t,H)}n&&q();var s=a.slice(H,H+4);if("true"==s)return H+=4,!0;if("fals"==s&&101==a.charCodeAt(H+4))return H+=5,!1;if("null"==s)return H+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return H=0,B=""+e,r=F(K()),"$"!=K()&&q(),H=B=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Vi,Wi={setup:function(e){Vi=e},log:function(){(Vi||console&&console.log||function(){}).apply(null,arguments)}},zi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(zi.get(e))||null}catch(r){Wi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Wi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";zi.set(t,r),zi.get(t)!==r&&(e=!1),zi.remove(t)}catch(n){e=!1}return e}},Xi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=zi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(zi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(zi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(zi.get(e)),zi.remove(e),zi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=zi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(zi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(zi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?zi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].push(r?t:{listener:t,once:!1}),this},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"==typeof t;return this._events[e].unshift(r?t:{listener:t,once:!1}),this},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var n=0,i=r.length;n=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Gi=function(e){this.ele=e},Qi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Gi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){return{top:0,left:0}}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(t){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),y(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=i.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(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return Qi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Qi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},Sa={checkIsAddSign:function(e){"track"===e.type&&(Re()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,n=ma.get("sensorsdata2015jssdkcross"+Fi.para.sdk_id);n=Fi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Fi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Fi.para.encrypt_cookie&&(i=Fi.kit.userEncrypt(i)),ma.set("sensorsdata2015jssdkcross"+Fi.para.sdk_id,i,null,!0)),Fi.para.is_track_device_id&&(ba.currentProps.$device_id=r)},storeInitCheck:function(){if(Fi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};ma.isSupport()?ma.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):wa.set(wa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)}}},ka=function(){this._events=[],this.pendingEvents=[]};ka.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20?this.pendingEvents.shift():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Pa=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data};Pa.prototype.start=function(){var e=this;Ze({url:this.server_url,type:"POST",data:this.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},Pa.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Ca="sawebjssdk-",Oa="tab-sawebjssdk-";Ye.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},pa.batch_send.send_interval)},getServerUrl:function(){return p(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(!(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),zi.remove(e[n])}r=Ce(r),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Ca+String(n()),a=zi.get(this.tabKey);null===a?(this.tabKey=Oa+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,zi.set(this.tabKey,JSON.stringify(a)),Fi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Oa+String(n()),zi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var p=new a(n);p.get(s,r,1e3,function(e){if(e){null===zi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(zi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),zi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var d=i(zi.get(s))||{expireTime:0};t()-d.expireTime>r&&zi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!p(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!p(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=$a._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},xa={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Aa[n])&&Aa[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Aa[n])&&Aa[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Aa[n])&&Aa[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){et({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Aa[i])&&Aa[i](n)),!0};et({propertyValue:t},n)}):Da.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Aa[n])&&Aa[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Aa[n])&&Aa[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Aa[n])&&Aa[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Aa[n])&&Aa[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=d(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ea.configIsMatchNew=function(e,t){if(p(e.$element_selector)&&p(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t["function"])return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t["function"])return e.$element_selector.indexOf(t.element_selector)>-1}if(p(e.$element_path)&&p(t.element_path)){if("element_path"===t.element_field&&"equal"===t["function"])return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t["function"])return e.$element_path.indexOf(t.element_path)>-1}return!1},Ea.configIsMatch=function(e,t){return(!t.limit_element_content||t.element_content===e.$element_content)&&((!t.limit_element_position||t.element_position===String(e.$element_position))&&(t.element_field&&t["function"]?Ea.configIsMatchNew(e,t):Ea.configIsMatchOldVersion(e,t)))},Ea.configIsMatchOldVersion=function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(Ea.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},Ea.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ea.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ea.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ea.getPropElInLi=function(e,t){if(!(e&&_(e)&&p(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Fi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ea.getProp=function(e,t){if(!r(e))return!1;if(!(p(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(p(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!p(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Fi.heatmap.getClosestLi(s);o=Ea.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!p(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ea.getAssignConfigs=function(e,t){var n=Ea.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var La={events:[],getAssignConfigs:Ea.getAssignConfigs,filterConfig:Ea.filterConfig,getProp:Ea.getProp,initUrl:Ea.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),p(a.event_name)&&n.push(a.event_name))}),Fi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Fi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Fi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ua={events:[],customProp:La,getAssignConfigs:Ea.getAssignConfigs,initUrl:Ea.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Fi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Fi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ra={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Ba.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Fi.heatmap.getEleDetail(e);if(!r(t)||!p(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Ba.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ea.getProp,getPropElInLi:Ea.getPropElInLi,filterConfig:Ea.filterConfig},Ba={unlimitedDiv:Ra,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ha,initUrl:function(){var e=Ea.initUrl();if(e){var t;try{t=new f(Fi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Fi.para.heatmap)||!Fi.para.heatmap.get_vtrack_config)return!1;if(zi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=$a.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Fi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Fi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n); +if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Va.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Va.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(t){var r=function(t,r){for(;t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&e(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null};return r(t,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Fi.heatmap.getClosestLi(e);if(!i||!_(e))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Fi.is_heatmap_render_mode=!0,Fi.para.heatmap||(Fi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Fi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Fi.para.heatmap_url||(Fi.para.heatmap_url=gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):this.getDomSelector(e.parentNode,t,r)):(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&&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},getEleDetail:function(e){var t=this.getDomSelector(e),r=We({target:e});r.$element_selector=t?t:"",r.$element_path=Fi.heatmap.getElementPath(e,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);var n=Fi.heatmap.getElementPosition(e,r.$element_path,Fi.para.heatmap&&"not_use_id"===Fi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Fi.para.heatmap)&&e(Fi.para.heatmap.collect_element)&&!Fi.para.heatmap.collect_element(n))return!1;var s=Va.getBasicEleInfo(t,n,i,a,o);_t(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Fi.para.heatmap&&Fi.para.heatmap.custom_property){var c=Fi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div?!!(r(Fi.para.heatmap)&&r(Fi.para.heatmap.collect_tags)&&r(Fi.para.heatmap.collect_tags.div)&&v(Fi.para.heatmap.collect_tags.div.ignore_tags)&&re(Fi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Fi.para&&Fi.para.heatmap&&Fi.para.heatmap.collect_tags&&Fi.para.heatmap.collect_tags.div&&Fi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Fi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.scroll_notice_map)return!1;var t=!0;Fi.para.scrollmap&&e(Fi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Fi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Fi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Fi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,ht(e)),this.current_time=n}});i.current_time=new Date,He(window,"scroll",function(){return!!t&&void i.go()}),He(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Fi.para.heatmap)||"default"!==Fi.para.heatmap.clickmap)&&(e(Fi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Fi.para.heatmap.collect_url()}),"all"===Fi.para.heatmap.collect_elements?Fi.para.heatmap.collect_elements="all":Fi.para.heatmap.collect_elements="interact",void("all"===Fi.para.heatmap.collect_elements?He(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=i.parentNode.tagName.toLowerCase();"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):He(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Fi.heatmap.getTargetElement(a,e);o?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Fi.para.heatmap)&&Fi.para.heatmap.get_vtrack_config&&Ra.events.length>0&&Ra.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"})})))}},Wa={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Fi.log("error: isReady callback must be function")},getUtm:function(){return ba.campaignParams()},getStayTime:function(){return(new Date-Fi._t)/1e3},setProfileLocal:function(e){if(!zi.isSupport())return Fi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=$a.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&($a.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Fi.setProfile(e))}else $a.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Fi.setProfile(e)},setInitReferrer:function(){var e=De();Fi.setOnceProfile({_init_referrer:e,_init_referrer_host:ba.pageProp.referrer_host})},setSessionReferrer:function(){var e=De();$a.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:ba.pageProp.referrer_host})},setDefaultAttr:function(){ba.register({_current_url:location.href,_referrer:De(),_referring_host:ba.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Fi.para.heatmap&&Fi.para.heatmap.track_attr?Fi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Va.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Va.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Fi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,mt()),t),i=Z()}var i;i=this.autoTrackIsUsed?ba.pageProp.url:ba.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,vt(Fi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=mt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Fi.para.is_single_page&&w(function(){var r=De(a,!0);Fi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Fi.track("$pageview",P({$referrer:De(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),vt(Fi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe($a._state)?"SDK is not initialized.":$a._state._first_id||$a._state.first_id||$a._state._distinct_id||$a._state.distinct_id},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Fi.modules)&&Fi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Fi.use.apply(Fi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},za=new l,Xa=new l,Za={};Za.spa=za,Za.sdk=Xa,Za.initSystemEvent=function(){yt(function(e){za.emit("switch",e)})},Za.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:Tt,unbind:It,trackLink:$t,trackLinks:At,setItem:Dt,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Ht,unsetProfile:Bt,identify:Jt,trackSignup:qt,registerPage:Kt,clearAllRegister:Ft,clearPageRegister:Vt,register:Wt,registerOnce:zt,registerSession:Xt,registerSessionOnce:Zt,login:Gt,loginWithKey:Qt,logout:Yt,getPresetProperties:er,readyState:Ga,debug:ya,on:bt,log:Oe};Wi.setup(Oe);var eo=P({},la,Ta),to={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:Fi.para.use_app_track_is_send!==!1&&"only"!==Fi.para.use_app_track,white_list:[],is_mui:"mui"===Fi.para.use_app_track};"object"==typeof Fi.para.app_js_bridge?Fi.para.app_js_bridge=P({},e,Fi.para.app_js_bridge):Fi.para.use_app_track!==!0&&Fi.para.app_js_bridge!==!0&&"only"!==Fi.para.use_app_track&&"mui"!==Fi.para.use_app_track||(Fi.para.app_js_bridge=P({},e)),Fi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(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,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Fi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ir};rr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),nr(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},rr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},rr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),nr(r)},ar.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Fi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Va.setNotice(n),ia.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Fi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Fi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Fi.heatmap_version&&Fi.heatmap_version===Fi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Fi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Va.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=p(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&p(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return p(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Va.setNotice(i),ia.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return ia.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(sr("sa-visual-mode")===!0||"true"===sr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Fi.para.vtrack_url?Fi.para.vtrack_url:gt()+"//static.sensorsdata.cn/sdk/"+Fi.lib_version+"/vtrack.min.js"})},messageListener:function(e){function t(e){return se(e)?he(e):(je("\u53ef\u89c6\u5316\u6a21\u5f0f\u68c0\u6d4b URL \u5931\u8d25"),!1)}if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(ia.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var r=t(e.data.data.userURL);r&&(window.location.href=r)}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:ga}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},login:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};mr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new hr(t,n,Fi),a=0;a=2)&&(wo&&(Cr(!0),gr()),Za.initSystemEvent(),Fi.setInitVar(),Fi.readyState.setState(2),Fi.initPara(e),Za.sdk.emit("initPara"),Za.sdk.emit("afterInitPara"),Za.sdk.emit("initAPI"),Za.sdk.emit("afterInitAPI"),Fi.detectMode(),tr(),Za.sdk.emit("afterInit"),void Za.sdk.emit("ready"))},wo?Cr(!1):(Cr(!0),gr());var So,ko,Po,Co,Oo,No,jo,To,Io,$o,Ao,Do,xo,Eo,Lo,Uo,Ro,Ho,Bo="1.25.10",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=jr(Jo),qo="1.25.10",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=$r(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:Ar,visualized_track:Dr,page_info:Dr,sensorsdata_get_app_visual_config:xr}},Go="1.25.10",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Rr()},handleCommand:Br},Yo=Ur(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Jr,visualized_track:Mr,page_info:Mr,sensorsdata_get_app_visual_config:qr}},as="1.25.10",os={init:function(e){Ao=e,Do=Ao&&Ao._,xo=Ao&&Ao.log||console&&console.log||function(){},Wr()},handleCommand:Xr},ss=Vr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.25.10",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Is.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Is.data=e,Is.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Is.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ts(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(e){ +this.sd&&this.sd.log(e)},addListeners:function(){var e=ds().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},$s=tn(Is,"Deeplink","sdkReady"),As="1.25.10",Ds={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},sn()},handleCommand:un},xs=on(Ds,"IOSBridge","sdkAfterInitPara"),Es="1.25.10",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},fn()}},Us=dn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.25.10",Hs=5e3,Bs=432e3;bn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},bn.prototype.log=function(e){this.sd&&this.sd.log(e)},bn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Hs)},bn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},bn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},bn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData()}},bn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},bn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},bn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},bn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},bn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},bn.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},bn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},bn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!0;this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},bn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},bn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});try{"success"===this.sd.bridge.bridge_info.verify_success&&(n.properties.$time=1*r)}catch(i){this.log(i.message)}n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},bn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},bn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},bn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;r=Math.round(r)||0;var n={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new bn,Ms=yn(Js,"PageLeave","sdkReady"),qs="1.25.10",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=kn(Fs,"PageLoad","sdkReady");Cn.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Pn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Cn.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.25.10";Cn.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new Cn,Gs=jn(Zs),Qs="1.25.10",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=An,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=$n(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.25.10",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),p=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var d=u.indexOf("?");a=d>-1?o>-1?s+l+"#"+u.substring(1,o)+p(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+p(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,pl,dl,fl,gl,_l,hl,ml=En(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.25.10",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Rn(bl,"Utm","sdkAfterInitPara"),Sl="1.25.10",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=Mn,Pl.enableSDK=qn,Pl.getDisabled=Kn}},Ol=Jn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.25.10",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Gn()}},Tl=Wn(jl),Il="1.25.10",$l={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ri()}},Al=ei($l),Dl="1.25.10",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ui()}},Ll=oi(El),Ul="1.25.10",Rl={plugin_name:"BeaconSender",init:function(e){pl=e,dl=pl._,hi()}},Hl=di(Rl),Bl="1.25.10",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,ki()}},Ml=yi(Jl),ql="1.25.10",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,$i()}},Fl=Oi(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Ei),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e"===e[e.length-1]&&e.length>=3?[null,e,null]:ge.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:z,!0)),de.test(r[1])&&re.isPlainObject(t))for(r in t)re.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=z.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):re.isFunction(e)?void 0!==n.ready?n.ready(e):e(re):re.makeArray(e,this)};ve.prototype=re.fn,he=re(z);var me=/^(?:parents|prev(?:Until|All))/,ye={children:!0,contents:!0,next:!0,prev:!0};re.fn.extend({has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&re.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?re.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?J.call(re(e),this[0]):J.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.uniqueSort(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ue(e,"parentNode")},parentsUntil:function(e,t,n){return ue(e,"parentNode",n)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return ue(e,"nextSibling")},prevAll:function(e){return ue(e,"previousSibling")},nextUntil:function(e,t,n){return ue(e,"nextSibling",n)},prevUntil:function(e,t,n){return ue(e,"previousSibling",n)},siblings:function(e){return ce((e.parentNode||{}).firstChild,e)},children:function(e){return ce(e.firstChild)},contents:function(e){return i(e,"iframe")?e.contentDocument:(i(e,"template")&&(e=e.content||e),re.merge([],e.childNodes))}},function(e,t){re.fn[e]=function(n,r){var i=re.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=re.filter(r,i)),this.length>1&&(ye[e]||re.uniqueSort(i),me.test(e)&&i.reverse()),this.pushStack(i)}});var xe=/[^\x20\t\r\n\f]+/g;re.Callbacks=function(e){e="string"==typeof e?s(e):re.extend({},e);var t,n,r,i,o=[],a=[],l=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)o.splice(n,1),n<=l&&l--}),this},has:function(e){return e?re.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},re.extend({Deferred:function(t){var n=[["notify","progress",re.Callbacks("memory"),re.Callbacks("memory"),2],["resolve","done",re.Callbacks("once memory"),re.Callbacks("once memory"),0,"resolved"],["reject","fail",re.Callbacks("once memory"),re.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return re.Deferred(function(t){re.each(n,function(n,r){var i=re.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var s=this,c=arguments,f=function(){var e,f;if(!(t=a&&(r!==u&&(s=void 0,c=[e]),n.rejectWith(s,c))}};t?d():(re.Deferred.getStackHook&&(d.stackTrace=re.Deferred.getStackHook()),e.setTimeout(d))}}var a=0;return re.Deferred(function(e){n[0][3].add(o(0,e,re.isFunction(i)?i:l,e.notifyWith)),n[1][3].add(o(0,e,re.isFunction(t)?t:l)),n[2][3].add(o(0,e,re.isFunction(r)?r:u))}).promise()},promise:function(e){return null!=e?re.extend(e,i):i}},o={};return re.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[0][2].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=V.call(arguments),o=re.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?V.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(c(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||re.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)c(i[n],a(n),o.reject);return o.promise()}});var be=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;re.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&be.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},re.readyException=function(t){e.setTimeout(function(){throw t})};var we=re.Deferred();re.fn.ready=function(e){return we.then(e)["catch"](function(e){re.readyException(e)}),this},re.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--re.readyWait:re.isReady)||(re.isReady=!0,e!==!0&&--re.readyWait>0||we.resolveWith(z,[re]))}}),re.ready.then=we.then,"complete"===z.readyState||"loading"!==z.readyState&&!z.documentElement.doScroll?e.setTimeout(re.ready):(z.addEventListener("DOMContentLoaded",f),e.addEventListener("load",f));var _e=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===re.type(n)){i=!0;for(s in n)_e(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,re.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(re(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Te.remove(this,e)})}}),re.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Ce.get(e,t),n&&(!r||Array.isArray(n)?r=Ce.access(e,t,re.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),r=n.length,i=n.shift(),o=re._queueHooks(e,t),a=function(){re.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ce.get(e,n)||Ce.access(e,n,{empty:re.Callbacks("once memory").add(function(){Ce.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,He=/^$|\/(?:java|ecma)script/i,Fe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Fe.optgroup=Fe.option,Fe.tbody=Fe.tfoot=Fe.colgroup=Fe.caption=Fe.thead,Fe.th=Fe.td;var Oe=/<|&#?\w+;/;!function(){var e=z.createDocumentFragment(),t=e.appendChild(z.createElement("div")),n=z.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),te.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",te.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var je=z.documentElement,Re=/^key/,qe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ue=/^([^.]*)(?:\.(.+)|)/;re.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,g,v=Ce.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&re.find.matchesSelector(je,i),n.guid||(n.guid=re.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(t){return"undefined"!=typeof re&&re.event.triggered!==t.type?re.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(xe)||[""],u=t.length;u--;)s=Ue.exec(t[u])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p&&(f=re.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=re.event.special[p]||{},c=re.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&re.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[p])||(d=l[p]=[],d.delegateCount=0,f.setup&&f.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),re.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,g,v=Ce.hasData(e)&&Ce.get(e);if(v&&(l=v.events)){for(t=(t||"").match(xe)||[""],u=t.length;u--;)if(s=Ue.exec(t[u])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p){for(f=re.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=l[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&f.teardown.call(e,h,v.handle)!==!1||re.removeEvent(e,p,v.handle),delete l[p])}else for(p in l)re.event.remove(e,p+t[u],n,r,!0);re.isEmptyObject(l)&&Ce.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=re.event.fix(e),l=new Array(arguments.length),u=(Ce.get(this,"events")||{})[s.type]||[],c=re.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||u.disabled!==!0)){for(o=[],a={},n=0;n-1:re.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,ze=/\s*$/g;re.extend({htmlPrefilter:function(e){return e.replace(We,"<$1>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=re.contains(e.ownerDocument,e);if(!(te.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(a=y(s),o=y(e),r=0,i=o.length;r0&&x(a,!l&&y(e,"script")),s},cleanData:function(e){for(var t,n,r,i=re.event.special,o=0;void 0!==(n=e[o]);o++)if(ke(n)){if(t=n[Ce.expando]){if(t.events)for(r in t.events)i[r]?re.event.remove(n,r):re.removeEvent(n,r,t.handle);n[Ce.expando]=void 0}n[Te.expando]&&(n[Te.expando]=void 0)}}}),re.fn.extend({detach:function(e){return L(this,e,!0)},remove:function(e){return L(this,e)},text:function(e){return _e(this,function(e){return void 0===e?re.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(y(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return _e(this,function(e){var n=this[0]||{},r=0,i=this.length;if(void 0===e&&1===n.nodeType)return n.innerHTML;if("string"==typeof e&&!ze.test(e)&&!Fe[(Me.exec(e)||["",""])[1].toLowerCase()]){e=re.htmlPrefilter(e);try{for(;r1)}}),re.fn.delay=function(t,n){return t=re.fx?re.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=z.createElement("input"),t=z.createElement("select"),n=t.appendChild(z.createElement("option"));e.type="checkbox",te.checkOn=""!==e.value,te.optSelected=n.selected,e=z.createElement("input"),e.value="t",e.type="radio",te.radioValue="t"===e.value}();var rt,it=re.expr.attrHandle;re.fn.extend({attr:function(e,t){return _e(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?re.prop(e,t,n):(1===o&&re.isXMLDoc(e)||(i=re.attrHooks[t.toLowerCase()]||(re.expr.match.bool.test(t)?rt:void 0)),void 0!==n?null===n?void re.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=re.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!te.radioValue&&"radio"===t&&i(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(xe);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),rt={set:function(e,t,n){return t===!1?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var n=it[t]||re.find.attr;it[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=it[a],it[a]=i,i=null!=n(e,t,r)?a:null,it[a]=o),i}});var ot=/^(?:input|select|textarea|button)$/i,at=/^(?:a|area)$/i;re.fn.extend({prop:function(e,t){return _e(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})}}),re.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&re.isXMLDoc(e)||(t=re.propFix[t]||t,i=re.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=re.find.attr(e,"tabindex");return t?parseInt(t,10):ot.test(e.nodeName)||at.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),te.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this}),re.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,R(this)))});if("string"==typeof e&&e)for(t=e.match(xe)||[];n=this[l++];)if(i=R(n),r=1===n.nodeType&&" "+j(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=j(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,R(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(xe)||[];n=this[l++];)if(i=R(n),r=1===n.nodeType&&" "+j(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=j(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,R(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=re(this),o=e.match(xe)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=R(this),t&&Ce.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Ce.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+j(R(n))+" ").indexOf(t)>-1)return!0;return!1}});var st=/\r/g;re.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,re(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=re.map(i,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=re.valHooks[i.type]||re.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(st,""):null==n?"":n)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:j(re.text(e))}},select:{get:function(e){var t,n,r,o=e.options,a=e.selectedIndex,s="select-one"===e.type,l=s?null:[],u=s?a+1:o.length;for(r=a<0?u:s?a:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=re.inArray(re(e).val(),t)>-1}},te.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var lt=/^(?:focusinfocus|focusoutblur)$/;re.extend(re.event,{trigger:function(t,n,r,i){var o,a,s,l,u,c,f,d=[r||z],p=Q.call(t,"type")?t.type:t,h=Q.call(t,"namespace")?t.namespace.split("."):[];if(a=s=r=r||z,3!==r.nodeType&&8!==r.nodeType&&!lt.test(p+re.event.triggered)&&(p.indexOf(".")>-1&&(h=p.split("."),p=h.shift(),h.sort()),u=p.indexOf(":")<0&&"on"+p,t=t[re.expando]?t:new re.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:re.makeArray(n,[t]),f=re.event.special[p]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!re.isWindow(r)){for(l=f.delegateType||p,lt.test(l+p)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(r.ownerDocument||z)&&d.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=d[o++])&&!t.isPropagationStopped();)t.type=o>1?l:f.bindType||p,c=(Ce.get(a,"events")||{})[t.type]&&Ce.get(a,"handle"),c&&c.apply(a,n),c=u&&a[u],c&&c.apply&&ke(a)&&(t.result=c.apply(a,n),t.result===!1&&t.preventDefault());return t.type=p,i||t.isDefaultPrevented()||f._default&&f._default.apply(d.pop(),n)!==!1||!ke(r)||u&&re.isFunction(r[p])&&!re.isWindow(r)&&(s=r[u],s&&(r[u]=null),re.event.triggered=p,r[p](),re.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=re.extend(new re.Event,n,{type:e,isSimulated:!0});re.event.trigger(r,null,t)}}),re.fn.extend({trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return re.event.trigger(e,t,n,!0)}}),re.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),te.focusin="onfocusin"in e,te.focusin||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){re.event.simulate(t,e.target,re.event.fix(e)); };re.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Ce.access(r,t);i||r.addEventListener(e,n,!0),Ce.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Ce.access(r,t)-1;i?Ce.access(r,t,i):(r.removeEventListener(e,n,!0),Ce.remove(r,t))}}});var ut=/\[\]$/,ct=/\r?\n/g,ft=/^(?:submit|button|image|reset|file)$/i,dt=/^(?:input|select|textarea|keygen)/i;return re.param=function(e,t){var n,r=[],i=function(e,t){var n=re.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)q(n,e[n],t,i);return r.join("&")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&dt.test(this.nodeName)&&!ft.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:Array.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(ct,"\r\n")}}):{name:t.name,value:n.replace(ct,"\r\n")}}).get()}}),re.fn.extend({wrapAll:function(e){var t;return this[0]&&(re.isFunction(e)&&(e=e.call(this[0])),t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){re(this).replaceWith(this.childNodes)}),this}}),re.expr.pseudos.hidden=function(e){return!re.expr.pseudos.visible(e)},re.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},te.createHTMLDocument=function(){var e=z.implementation.createHTMLDocument("").body;return e.innerHTML="
",2===e.childNodes.length}(),re.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,o;return t||(te.createHTMLDocument?(t=z.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=z.location.href,t.head.appendChild(r)):t=z),i=de.exec(e),o=!n&&[],i?[t.createElement(i[1])]:(i=b([e],t,o),o&&o.length&&re(o).remove(),re.merge([],i.childNodes))},re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u,c=re.css(e,"position"),f=re(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=re.css(e,"top"),l=re.css(e,"left"),u=("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1,u?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,re.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r,i,o=this[0];if(o)return o.getClientRects().length?(r=o.getBoundingClientRect(),t=o.ownerDocument,n=t.documentElement,i=t.defaultView,{top:r.top+i.pageYOffset-n.clientTop,left:r.left+i.pageXOffset-n.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),i(e[0],"html")||(r=e.offset()),r={top:r.top+re.css(e[0],"borderTopWidth",!0),left:r.left+re.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===re.css(e,"position");)e=e.offsetParent;return e||je})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;re.fn[e]=function(r){return _e(this,function(e,r,i){var o;return re.isWindow(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i?o?o[t]:e[r]:void(o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i)},e,r,arguments.length)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=I(te.pixelPosition,function(e,n){if(n)return n=P(e,t),Je.test(n)?re(e).position()[t]+"px":n})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||o===!0?"margin":"border");return _e(this,function(t,n,i){var o;return re.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?re.css(t,n,s):re.style(t,n,i,s)},t,a?i:void 0,a)}})}),re.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),re.holdReady=function(e){e?re.readyWait++:re.ready(!0)},re.isArray=Array.isArray,re.parseJSON=JSON.parse,re.nodeName=i,re}(window);!function(){function t(e){this.mode=c.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,n=this.data.length;t65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function r(e,t){if(void 0==e.length)throw new Error(e.length+"/"+t);for(var n=0;nv.length)throw new Error("Too long data");return n}function u(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}t.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=p.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n),i=1;this.make();for(var o=0;o>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=p.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var l=!1;o>>i&1));var u=p.getMask(t,r,a-s);u&&(l=!l),this.modules[r][a-s]=l,i--,i==-1&&(o++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var a=i.getRSBlocks(e,t),s=new o,l=0;l8*c)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*c+")");for(s.getLengthInBits()+4<=8*c&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*c)break;if(s.put(n.PAD0,8),s.getLengthInBits()>=8*c)break;s.put(n.PAD1,8)}return n.createBytes(s,a)},n.createBytes=function(e,t){for(var n=0,i=0,o=0,a=new Array(t.length),s=new Array(t.length),l=0;l=0?g.get(v):0}}for(var m=0,f=0;f=0;)t^=p.G15<=0;)t^=p.G18<>>=1;return t},getPatternPosition:function(e){return p.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case d.PATTERN000:return(t+n)%2==0;case d.PATTERN001:return t%2==0;case d.PATTERN010:return n%3==0;case d.PATTERN011:return(t+n)%3==0;case d.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case d.PATTERN101:return t*n%2+t*n%3==0;case d.PATTERN110:return(t*n%2+t*n%3)%2==0;case d.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new r([1],0),n=0;n5&&(n+=3+o-5)}for(var r=0;r=256;)e-=255;return h.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},g=0;g<8;g++)h.EXP_TABLE[g]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var v=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],m=function(){var e=function(e,t){this._el=e,this._htOption=t};return e.prototype.draw=function(e){function t(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg",e);for(var r in t)t.hasOwnProperty(r)&&n.setAttribute(r,t[r]);return n}var n=this._htOption,r=this._el,i=e.getModuleCount();Math.floor(n.width/i),Math.floor(n.height/i);this.clear();var o=t("svg",{viewBox:"0 0 "+String(i)+" "+String(i),width:"100%",height:"100%",fill:n.colorLight});o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(o),o.appendChild(t("rect",{fill:n.colorLight,width:"100%",height:"100%"})),o.appendChild(t("rect",{fill:n.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a=1;f--)arguments[f]=arguments[f]*n;else"undefined"==typeof u&&(arguments[1]*=n,arguments[2]*=n,arguments[3]*=n,arguments[4]*=n);r.apply(this,arguments)}}var i=function(e,t){this._bIsPainted=!1,this._android=s(),this._htOption=t,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=t.width,this._elCanvas.height=t.height,e.appendChild(this._elCanvas),this._el=e,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(e){var t=this._elImage,n=this._oContext,r=this._htOption,i=e.getModuleCount(),o=r.width/i,a=r.height/i,s=Math.round(o),l=Math.round(a);t.style.display="none",this.clear();for(var u=0;u'],s=0;s");for(var l=0;l');a.push("")}a.push(""),n.innerHTML=a.join("");var u=n.childNodes[0],c=(t.width-u.offsetWidth)/2,f=(t.height-u.offsetHeight)/2;c>0&&f>0&&(u.style.margin=f+"px "+c+"px")},e.prototype.clear=function(){this._el.innerHTML=""},e}();return e=function(e,t){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:f.H},"string"==typeof t&&(t={text:t}),t)for(var n in t)this._htOption[n]=t[n];"string"==typeof e&&(e=document.getElementById(e)),this._htOption.useSVG&&(x=m),this._android=s(),this._el=e,this._oQRCode=null,this._oDrawing=new x(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},e.prototype.makeCode=function(e){this._oQRCode=new n(l(e,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(e),this._oQRCode.make(),this._el.title=e,this._oDrawing.draw(this._oQRCode),this.makeImage()},e.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},e.prototype.clear=function(){this._oDrawing.clear()},e.CorrectLevel=f,e}();var n=e;!function(){function e(){i.logger&&i.logger.msg.apply(i.logger,arguments).level("warn").log()}function r(){i.logger&&i.logger.msg.apply(i.logger,arguments).level("error").log()}var i=null,o=null,a={originalHeatData:null,ajaxHeatData:null,heatDataElement:[],heatMapList:[],heatMode:1,getCurrentUrl:function(){var e=o.urlParse(location.href),n={};return n["sa-request-url"]=sessionStorage.getItem("sensors_heatmap_url"),n["sa-request-url"]=n["sa-request-url"]?encodeURIComponent(n["sa-request-url"]):"",n["sa-request-id"]=sessionStorage.getItem("sensors_heatmap_id"),n["sa-request-type"]=sessionStorage.getItem("sensors_heatmap_type")||"1",t.each(n,function(e,t){t||delete n[e]}),e.addQueryString(n),e.getUrl()},setHeatState:function(e,t,n,r){if(r)"1"===t?this.setClickMap(e,n):"2"===t?this.setScrollMap(e,n):"3"===t&&this.setNoticeMap(e,n);else{var a=i._.urlParse(location.href);if(!e)return!1;t||(t=1);var s={"sa-request-id":e,"sa-request-type":t,"sa-request-url":sessionStorage&&sessionStorage.getItem?sessionStorage.getItem("sensors_heatmap_url")||"":""};try{var l={};o.isJSONString(window.name)?(l=JSON.parse(window.name),window.name=JSON.stringify(o.extend(l,s))):""==window.name&&(window.name=JSON.stringify(s))}catch(u){}1==this.requestType?(a.addQueryString(s),location.href=a.getUrl()):(sessionStorage&&sessionStorage.setItem&&sessionStorage.setItem("sensors_heatmap_type",t),location.reload())}},setDropDown:function(e,n,r){function o(){var e=null,n=!1;return t(window).on("scroll.v2",function(){n||(t("#heatMapContainer").html(""),n=!0),clearTimeout(e),e=setTimeout(function(){a.refreshHeatData(a.heatMode),n=!1},i.para.heatmap.renderRefreshTime||1e3)}),t(window).on("resize.v2",function(){n||(t("#heatMapContainer").html(""),n=!0),clearTimeout(e),e=setTimeout(function(){a.refreshHeatData(a.heatMode),n=!1},i.para.heatmap.renderRefreshTime||1e3)}),function(){t(window).off("scroll.v2"),t(window).off("resize.v2"),e&&(clearTimeout(e),e=null,n=!1)}}function s(e){function n(t,n){r=t,e.click(t,n),"type"==i?p.text(u[r]):"version"==i&&p.text(c[r])}var r=e.init(),i=e.name,s=e.id,l=t(s+">div"),d=t(s+">ul"),p=l.find("span:first");l.on("click",function(e){e.preventDefault(),e.stopPropagation(),t(s+">ul:visible").is(":visible")?d.hide():(t(".sa-sdk-heatmap-toolbar-selectmap ul").css("display","none"),d.css("display","block"),t(document).on("click.sa-jssdk-dropdown",function(){d.hide(),t(document).off("click.sa-jssdk-dropdown")}))}),d.on("click","li",function(){var e=t(this).attr("data-state");r!==e&&n(e)}),e.init&&n(r,!0),"version"===i&&t(document).on("keypress",function(e){f&&(f(),f=null),114==e.keyCode&&a.refreshHeatData(a.heatMode),122==e.keyCode&&(t("#chooseVersion").find("span:first").text("\u65b9\u6848\u4e00"),a.refreshHeatData(1),r="1"),120==e.keyCode&&(t("#chooseVersion").find("span:first").text("\u65b9\u6848\u4e8c"),a.refreshHeatData(2),f=o(),r="2")})}n=n||"1";var l="1"===n?"1":"0",u={1:"\u70b9\u51fb\u56fe",2:"\u89e6\u8fbe\u7387\u56fe",3:"\u6ce8\u610f\u529b\u56fe"},c={1:"\u65b9\u6848\u4e00",2:"\u65b9\u6848\u4e8c"},f=null,d=this;s({init:function(){return n},id:"#chooseType",name:"type",click:function(n,i){d.setHeatState(e,n,r,i),t("#sa_sdk_heatmap_toolbar_filter").toggle("1"==n)}}),"1"===n&&s({init:function(){return t("#chooseVersion").css("display","block"),l},name:"version",id:"#chooseVersion",click:function(e,t){t||(f&&(f(),f=null),"1"===e?a.refreshHeatData(1):"2"===e&&(a.refreshHeatData(2),f=o()))}})},setScrollMap:function(e,n){var a=this;if("string"==typeof e&&i.para.web_url){var l=new o.urlParse(i.para.web_url);l._values.Path="/api/scroll_heat_map/report/"+e;var u=new o.urlParse(i.para.web_url);u._values.Path="/api/scroll_heat_map/report/"+e,u.addQueryString({pathUrl:encodeURIComponent(n)});var c=u.getUrl(),f=new o.urlParse(i.para.web_url);f._values.Path="/api/v2/sa/scroll_heat_maps/report/jsonp/"+e;var d=new o.urlParse(i.para.web_url);d._values.Path="/api/v2/sa/scroll_heat_maps/report/jsonp/"+e,d.addQueryString({pathUrl:encodeURIComponent(n)});var p=d.getUrl(),h=function(e){function n(n){var r=parseInt((n.pageY+15)/10),i=0;i=r<=e.detail.length&&e.detail[r]?Math.floor(e.detail[r]/e.total*100*100)/100:0,u&&u.remove(),u=t(l.replace("{{top}}",n.pageY+15).replace("{{percent}}",i+"%")),t(document.body).append(u)}if("object"!=typeof e||!o.isArray(e.result)||0===e.result.length)return a.showErrorInfo(2,{error:"\u672a\u53d6\u5230\u6570\u636e"}),!1;if(e.detail=e.result||[],!e.total||0===e.total||"number"!=typeof e.total||e.total<2)return a.showErrorInfo(2,{error:"\u6709\u6548\u7684\u89e6\u53d1\u7528\u6237\u6570\u5c11\u4e8e2\u4eba"}),!1;e.origin_total=e.total,e.total=e.result[0],e.percent={};var r={setData:function(e,t,n){e=String(e),this.data[e]=this.data[e]||{},this.data[e][t]=n},data:{},getData:function(){var e={},t=[],n=null;for(var r in this.data){t=[];for(var i in this.data[r])t.push([i,this.data[r][i]]);this.data[r]=t,n=this.data[r].sort(function(e,t){return Math.abs(e[0]-Number(r))-Math.abs(t[0]-Number(r))})[0],e[n[0]]=n[1]}return e}};o.each(e.result,function(t,n){t/e.total==1?e.percent[100]=10*(n+1):t/e.total>.7&&t/e.total<.8?r.setData(75,parseInt(t/e.total*100),10*(n+1)):t/e.total>.45&&t/e.total<.55?r.setData(50,parseInt(t/e.total*100),10*(n+1)):t/e.total>.2&&t/e.total<.3&&r.setData(25,parseInt(t/e.total*100),10*(n+1))}),o.extend(e.percent,r.getData());var i='
{{percent}}
';for(var s in e.percent)t(document.body).append(t(i.replace("{{top}}",e.percent[s]-2).replace("{{percent}}",s+"%")));var l='
{{percent}}\u7684\u7528\u6237\u6d4f\u89c8\u5230\u8fd9\u91cc
',u=null;t(document).on("mousemove",o.throttle(n,150))},g=function(e){o.isObject(e)&&e.error?a.showErrorInfo(2,{error:e.error}):a.showErrorInfo(2,{error:"\u670d\u52a1\u5f02\u5e38"}),sessionStorage.removeItem("sensors_heatmap_id")};n?this.requestType=3:this.requestType=1,s.getServerData.start({url:{ajax:3===this.requestType?c:l.getUrl(),jsonp:3===this.requestType?p:f.getUrl()},success:h,error:g})}else r("\u7f3a\u5c11web_url")},setNoticeMap:function(){},setContainer:function(e){if(!e)return!1;if(e.classList.add("saContainer"),e&&e.children)for(var t=e.children,n=0;ni:"lt"===e?tMath.min(i,o)&&t