New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tuhu/mp-sensor

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tuhu/mp-sensor - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

4

./@types/index.d.ts

@@ -78,2 +78,6 @@ interface KVObject {

/**
* 设置动态公共属性
*/
registerDynamicSuperProperties(func: () => KVObject): void;
/**
* 设置用户属性

@@ -80,0 +84,0 @@ */

2

lib/index.js

@@ -1,1 +0,1 @@

(function () {var B;function f(r){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var a=wx,A=function(r){"object"===f(r)&&(a=r)};var b={},c={para:{name:"sensors",server_url:"https://analytics.tuhu.com/sa?project=production",send_timeout:1e3,use_client_time:!1,show_log:!0,allow_amend_share_path:!0,max_string_length:300,datasend_timeout:3e3,autoTrack:{appLaunch:!0,appShow:!0,appHide:!0,pageShow:!0,pageShare:!0}},setPara:function(r){c.para=b.extend2Lev(c.para,r),b.isObject(c.para.register)&&b.extend(b.info.properties,c.para.register),c.para.openid_url||(c.para.openid_url=c.para.server_url.replace(/([^\/])\/(sa)(\.gif){0,1}/,"$1/mp_login")),"number"!=typeof c.para.send_timeout&&(c.para.send_timeout=1e3);var $={send_timeout:6e3,max_length:6};!0===c.para.batch_send?(c.para.batch_send=b.extend({},$),c.para.use_client_time=!0):"object"==f(c.para.batch_send)&&(c.para.use_client_time=!0,c.para.batch_send=b.extend({},$,c.para.batch_send))},status:{}},o=Array.prototype,z=Function.prototype,r=Object.prototype,g=o.slice,h=r.toString,p=r.hasOwnProperty,m="1.13.2",t="MiniProgram",i="utm_source utm_medium utm_campaign utm_content utm_term",x={1001:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\uFF0C\u201C\u6700\u8FD1\u4F7F\u7528\u201D\u5217\u8868",1005:"\u9876\u90E8\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1006:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1007:"\u5355\u4EBA\u804A\u5929\u4F1A\u8BDD\u4E2D\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1008:"\u7FA4\u804A\u4F1A\u8BDD\u4E2D\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1011:"\u626B\u63CF\u4E8C\u7EF4\u7801",1012:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u4E8C\u7EF4\u7801",1013:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u4E8C\u7EF4\u7801",1014:"\u5C0F\u7A0B\u5E8F\u6A21\u7248\u6D88\u606F",1017:"\u524D\u5F80\u4F53\u9A8C\u7248\u7684\u5165\u53E3\u9875",1019:"\u5FAE\u4FE1\u94B1\u5305",1020:"\u516C\u4F17\u53F7 profile \u9875\u76F8\u5173\u5C0F\u7A0B\u5E8F\u5217\u8868",1022:"\u804A\u5929\u9876\u90E8\u7F6E\u9876\u5C0F\u7A0B\u5E8F\u5165\u53E3",1023:"\u5B89\u5353\u7CFB\u7EDF\u684C\u9762\u56FE\u6807",1024:"\u5C0F\u7A0B\u5E8F profile \u9875",1025:"\u626B\u63CF\u4E00\u7EF4\u7801",1026:"\u9644\u8FD1\u5C0F\u7A0B\u5E8F\u5217\u8868",1027:"\u9876\u90E8\u641C\u7D22\u6846\u641C\u7D22\u7ED3\u679C\u9875\u201C\u4F7F\u7528\u8FC7\u7684\u5C0F\u7A0B\u5E8F\u201D\u5217\u8868",1028:"\u6211\u7684\u5361\u5305",1029:"\u5361\u5238\u8BE6\u60C5\u9875",1030:"\u81EA\u52A8\u5316\u6D4B\u8BD5\u4E0B\u6253\u5F00\u5C0F\u7A0B\u5E8F",1031:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u4E00\u7EF4\u7801",1032:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u4E00\u7EF4\u7801",1034:"\u5FAE\u4FE1\u652F\u4ED8\u5B8C\u6210\u9875",1035:"\u516C\u4F17\u53F7\u81EA\u5B9A\u4E49\u83DC\u5355",1036:"App \u5206\u4EAB\u6D88\u606F\u5361\u7247",1037:"\u5C0F\u7A0B\u5E8F\u6253\u5F00\u5C0F\u7A0B\u5E8F",1038:"\u4ECE\u53E6\u4E00\u4E2A\u5C0F\u7A0B\u5E8F\u8FD4\u56DE",1039:"\u6447\u7535\u89C6",1042:"\u6DFB\u52A0\u597D\u53CB\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1043:"\u516C\u4F17\u53F7\u6A21\u677F\u6D88\u606F",1044:"\u5E26 shareTicket \u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247\uFF08\u8BE6\u60C5)",1045:"\u670B\u53CB\u5708\u5E7F\u544A",1046:"\u670B\u53CB\u5708\u5E7F\u544A\u8BE6\u60C5\u9875",1047:"\u626B\u63CF\u5C0F\u7A0B\u5E8F\u7801",1048:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u5C0F\u7A0B\u5E8F\u7801",1049:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u5C0F\u7A0B\u5E8F\u7801",1052:"\u5361\u5238\u7684\u9002\u7528\u95E8\u5E97\u5217\u8868",1053:"\u641C\u4E00\u641C\u7684\u7ED3\u679C\u9875",1054:"\u9876\u90E8\u641C\u7D22\u6846\u5C0F\u7A0B\u5E8F\u5FEB\u6377\u5165\u53E3",1056:"\u97F3\u4E50\u64AD\u653E\u5668\u83DC\u5355",1057:"\u94B1\u5305\u4E2D\u7684\u94F6\u884C\u5361\u8BE6\u60C5\u9875",1058:"\u516C\u4F17\u53F7\u6587\u7AE0",1059:"\u4F53\u9A8C\u7248\u5C0F\u7A0B\u5E8F\u7ED1\u5B9A\u9080\u8BF7\u9875",1064:"\u5FAE\u4FE1\u8FDEWi-Fi\u72B6\u6001\u680F",1067:"\u516C\u4F17\u53F7\u6587\u7AE0\u5E7F\u544A",1068:"\u9644\u8FD1\u5C0F\u7A0B\u5E8F\u5217\u8868\u5E7F\u544A",1069:"\u79FB\u52A8\u5E94\u7528",1071:"\u94B1\u5305\u4E2D\u7684\u94F6\u884C\u5361\u5217\u8868\u9875",1072:"\u4E8C\u7EF4\u7801\u6536\u6B3E\u9875\u9762",1073:"\u5BA2\u670D\u6D88\u606F\u5217\u8868\u4E0B\u53D1\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1074:"\u516C\u4F17\u53F7\u4F1A\u8BDD\u4E0B\u53D1\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1077:"\u6447\u5468\u8FB9",1078:"\u8FDEWi-Fi\u6210\u529F\u9875",1079:"\u5FAE\u4FE1\u6E38\u620F\u4E2D\u5FC3",1081:"\u5BA2\u670D\u6D88\u606F\u4E0B\u53D1\u7684\u6587\u5B57\u94FE",1082:"\u516C\u4F17\u53F7\u4F1A\u8BDD\u4E0B\u53D1\u7684\u6587\u5B57\u94FE",1084:"\u670B\u53CB\u5708\u5E7F\u544A\u539F\u751F\u9875",1089:"\u5FAE\u4FE1\u804A\u5929\u4E3B\u754C\u9762\u4E0B\u62C9",1090:"\u957F\u6309\u5C0F\u7A0B\u5E8F\u53F3\u4E0A\u89D2\u83DC\u5355\u5524\u51FA\u6700\u8FD1\u4F7F\u7528\u5386\u53F2",1091:"\u516C\u4F17\u53F7\u6587\u7AE0\u5546\u54C1\u5361\u7247",1092:"\u57CE\u5E02\u670D\u52A1\u5165\u53E3",1095:"\u5C0F\u7A0B\u5E8F\u5E7F\u544A\u7EC4\u4EF6",1096:"\u804A\u5929\u8BB0\u5F55",1097:"\u5FAE\u4FE1\u652F\u4ED8\u7B7E\u7EA6\u9875",1099:"\u9875\u9762\u5185\u5D4C\u63D2\u4EF6",1102:"\u516C\u4F17\u53F7 profile \u9875\u670D\u52A1\u9884\u89C8",1103:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\uFF0C\u201C\u6211\u7684\u5C0F\u7A0B\u5E8F\u201D\u5217\u8868",1104:"\u5FAE\u4FE1\u804A\u5929\u4E3B\u754C\u9762\u4E0B\u62C9\uFF0C\u201C\u6211\u7684\u5C0F\u7A0B\u5E8F\u201D\u680F"},q="\u76F4\u63A5\u6253\u5F00";c.status.referrer="\u76F4\u63A5\u6253\u5F00";var l=null,j=0,n="",w=!1;c.lib_version=m;var d="object"==f(d)?d:{};function e(r,$,a){var e=c.autoTrackCustom[a];if(r[$]){var t=r[$];r[$]=function(){"onLaunch"===$&&(this[c.para.name]=c),!c.para.autoTrackIsFirst||b.isObject(c.para.autoTrackIsFirst)&&!c.para.autoTrackIsFirst[a]?(t.apply(this,arguments),e.apply(this,arguments)):(!0===c.para.autoTrackIsFirst||b.isObject(c.para.autoTrackIsFirst)&&c.para.autoTrackIsFirst[a])&&(e.apply(this,arguments),t.apply(this,arguments))}}else r[$]=function(){"onLaunch"===$&&(this[c.para.name]=c),e.apply(this,arguments)}}d.info=function(){if(c.para.show_log&&"object"==("undefined"==typeof console?"undefined":f(console))&&console.log)try{return console.log.apply(console,arguments)}catch(r){console.log(arguments[0])}},function(){z.bind;var r=o.forEach,$=o.indexOf,a=Array.isArray,e={},t=b.each=function($,a,t){if(null==$)return!1;if(r&&$.forEach===r)$.forEach(a,t);else if($.length===+$.length){for(var s=0,n=$.length;s<n;s++)if(s in $&&a.call(t,$[s],s,$)===e)return!1}else for(var i in $)if(p.call($,i)&&a.call(t,$[i],i,$)===e)return!1};b.logger=d,b.extend=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&(r[a]=$[a])}),r},b.extend2Lev=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&(b.isObject($[a])&&b.isObject(r[a])?b.extend(r[a],$[a]):r[a]=$[a])}),r},b.coverExtend=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&void 0===r[a]&&(r[a]=$[a])}),r},b.isArray=a||function(r){return"[object Array]"===h.call(r)},b.isFunction=function(r){try{return /^\s*\bfunction\b/.test(r)}catch(r){return!1}},b.isArguments=function(r){return!(!r||!p.call(r,"callee"))},b.toArray=function(r){return r?r.toArray?r.toArray():b.isArray(r)?g.call(r):b.isArguments(r)?g.call(r):b.values(r):[]},b.values=function(r){var $=[];return null==r?$:(t(r,function(r){$[$.length]=r}),$)},b.include=function(r,a){var s=!1;return null==r?s:$&&r.indexOf===$?-1!=r.indexOf(a):(t(r,function(r){if(s||(s=r===a))return e}),s)}}(),b.trim=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},b.isObject=function(r){return null!=r&&"[object Object]"==h.call(r)},b.isEmptyObject=function(r){if(b.isObject(r)){for(var $ in r)if(p.call(r,$))return!1;return!0}return!1},b.isUndefined=function(r){return void 0===r},b.isString=function(r){return"[object String]"==h.call(r)},b.isDate=function(r){return"[object Date]"==h.call(r)},b.isBoolean=function(r){return"[object Boolean]"==h.call(r)},b.isNumber=function(r){return"[object Number]"==h.call(r)&&/[\d\.]+/.test(String(r))},b.isJSONString=function(r){try{JSON.parse(r)}catch(r){return!1}return!0},b.decodeURIComponent=function(r){var $="";try{$=decodeURIComponent(r)}catch(a){$=r}return $},b.encodeDates=function(r){return b.each(r,function($,a){b.isDate($)?r[a]=b.formatDate($):b.isObject($)&&(r[a]=b.encodeDates($))}),r},b.formatDate=function(r){function $(r){return r<10?"0"+r:r}return r.getFullYear()+"-"+$(r.getMonth()+1)+"-"+$(r.getDate())+" "+$(r.getHours())+":"+$(r.getMinutes())+":"+$(r.getSeconds())+"."+$(r.getMilliseconds())},b.searchObjDate=function(r){b.isObject(r)&&b.each(r,function($,a){b.isObject($)?b.searchObjDate(r[a]):b.isDate($)&&(r[a]=b.formatDate($))})},b.formatString=function(r){return r.length>c.para.max_string_length?(d.info("\u5B57\u7B26\u4E32\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\uFF0C\u5DF2\u7ECF\u505A\u622A\u53D6--"+r),r.slice(0,c.para.max_string_length)):r},b.searchObjString=function(r){b.isObject(r)&&b.each(r,function($,a){b.isObject($)?b.searchObjString(r[a]):b.isString($)&&(r[a]=b.formatString($))})},b.unique=function(r){for(var $,a=[],e={},t=0;t<r.length;t++)($=r[t])in e||(e[$]=!0,a.push($));return a},b.strip_sa_properties=function(r){return b.isObject(r)?(b.each(r,function($,a){if(b.isArray($)){var e=[];b.each($,function(r){b.isString(r)?e.push(r):d.info("\u60A8\u7684\u6570\u636E-",$,"\u7684\u6570\u7EC4\u91CC\u7684\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32,\u5DF2\u7ECF\u5C06\u5176\u5220\u9664")}),0!==e.length?r[a]=e:(delete r[a],d.info("\u5DF2\u7ECF\u5220\u9664\u7A7A\u7684\u6570\u7EC4"))}b.isString($)||b.isNumber($)||b.isDate($)||b.isBoolean($)||b.isArray($)||(d.info("\u60A8\u7684\u6570\u636E-",$,"-\u683C\u5F0F\u4E0D\u6EE1\u8DB3\u8981\u6C42\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u5C06\u5176\u5220\u9664"),delete r[a])}),r):r},b.strip_empty_properties=function(r){var $={};return b.each(r,function(r,a){null!=r&&($[a]=r)}),$},b.utf8Encode=function(r){var $,a,e,t,s="";for($=a=0,e=(r=(r+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,t=0;t<e;t++){var n=r.charCodeAt(t),i=null;n<128?a++:i=n>127&&n<2048?String.fromCharCode(n>>6|192,63&n|128):String.fromCharCode(n>>12|224,n>>6&63|128,63&n|128),null!==i&&(a>$&&(s+=r.substring($,a)),s+=i,$=a=t+1)}return a>$&&(s+=r.substring($,r.length)),s},b.base64Encode=function(r){var $,a,e,t,s,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0,o=0,v="",c=[];if(!r)return r;r=b.utf8Encode(r);do{$=(s=r.charCodeAt(i++)<<16|r.charCodeAt(i++)<<8|r.charCodeAt(i++))>>18&63,a=s>>12&63,e=s>>6&63,t=63&s,c[o++]=n.charAt($)+n.charAt(a)+n.charAt(e)+n.charAt(t)}while(i<r.length);switch(v=c.join(""),r.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"=";}return v},b.getCurrentPath=function(){var r="\u672A\u53D6\u5230";try{var $=getCurrentPages();r=$[$.length-1].route}catch(r){d.info(r)}return r},b.getCurrentUrl=function(r){var $=b.getCurrentPath(),a="";return b.isObject(r)&&r.sensors_mp_url_query&&(a=r.sensors_mp_url_query),$?a?$+"?"+a:$:"\u672A\u53D6\u5230"},b.getPath=function(r){return"string"==typeof r?r.replace(/^\//,""):"\u53D6\u503C\u5F02\u5E38"},b.getQueryParam=function(r,$){var a=new RegExp("[\\?&]"+$+"=([^&#]*)").exec(r);return null===a||a&&"string"!=typeof a[1]&&a[1].length?"":b.decodeURIComponent(a[1])},c.initialState={queue:[],isComplete:!1,systemIsComplete:!1,storeIsComplete:!1,checkIsComplete:function(){this.systemIsComplete&&this.storeIsComplete&&(this.isComplete=!0,this.queue.length>0&&(b.each(this.queue,function(r){c[r[0]].apply(c,g.call(r[1]))}),c.queue=[]))}},b.getPrefixUtm=function(r,$,a){if($=$||"",a=a||"_",!b.isObject(r))return{};var e={},t={};for(var s in r)-1!==(" "+i+" ").indexOf(" "+s+" ")?e[$+s]=r[s]:t[a+s]=r[s];return{$utms:e,otherUtms:t}},b.convertObjToParam=function(r){var $=[];for(var a in r)$.push(a+"="+r[a]);return $.join("&")},b.getSource=function(r){if(b.isObject(r)){if(b.isEmptyObject(r))return{};for(var $ in r)-1===(" "+i+" ").indexOf(" "+$+" ")?delete r[$]:r[$]=r[$].replace("?","*");r="?"+(r=b.convertObjToParam(r))}else r=b.decodeURIComponent(r);var a=i.split(" "),e=i.split(" "),t="",s={};return 2!==(r=r.split("?")).length?{}:(r="?"+(r=r[1]),b.isArray(c.para.source_channel)&&c.para.source_channel.length>0&&(e=e.concat(c.para.source_channel),e=b.unique(e)),b.each(e,function($){t=b.getQueryParam(r,$),(t=b.decodeURIComponent(t)).length&&b.include(a,$)&&(s[$]=t)}),s)},b.getObjFromQuery=function(r){var $=r.split("?"),a={};return $&&$[1]?(b.each($[1].split("&"),function(r){var $=r.split("=");$[0]&&$[1]&&(a[$[0]]=$[1])}),a):{}},b.getUtm=function(r,$,a){var e=b.getSource(r);return void 0===a&&$?{pre1:b.getPrefixUtm(e,$).$utms||{},pre2:{}}:void 0!==a&&$?{pre1:b.getPrefixUtm(e,$).$utms||{},pre2:b.getPrefixUtm(e,a).$utms||{}}:{pre1:{},pre2:{}}},b.getMPScene=function(r){return"number"==typeof r||"string"==typeof r&&""!==r?(r=String(r),x[r]||r):"\u672A\u53D6\u5230\u503C"},b.getShareDepth=function(){if("number"==typeof j&&0!==j){var r=c.store.getDistinctId(),$=c.store.getFirstId();return!n||n!==r&&n!==$?j+1:j}return 1},b.setShareInfo=function(r,$){var a={};if(!(r&&b.isObject(r.query)&&r.query.sampshare))return{};if(a=b.decodeURIComponent(r.query.sampshare),!b.isJSONString(a))return{};var e=(a=JSON.parse(a)).d,t=a.p,s=a.i;"string"==typeof s?($.$share_distinct_id=s,n=s):$.$share_distinct_id="\u53D6\u503C\u5F02\u5E38","number"==typeof e?($.$share_depth=e,j=e):$.$share_depth="-1",$.$share_url_path="string"==typeof t?t:"\u53D6\u503C\u5F02\u5E38"},b.getShareInfo=function(){return JSON.stringify({i:c.store.getDistinctId()||"\u53D6\u503C\u5F02\u5E38",p:b.getCurrentPath(),d:b.getShareDepth()})},b.setUtm=function(r,$){var a={};if(r&&b.isObject(r.query)){var e=(a=b.extend({},r.query)).scene;e&&(e=-1!==(e=b.decodeURIComponent(e)).indexOf("?")?"?"+e.replace(/\?/g,""):"?"+e,b.extend(a,b.getObjFromQuery(e))),r.query.q&&b.extend(a,b.getObjFromQuery(b.decodeURIComponent(r.query.q)))}if(r&&b.isObject(r.referrerInfo)&&r.referrerInfo.extraData){var t={};b.isObject(r.referrerInfo.extraData)&&!b.isEmptyObject(r.referrerInfo.extraData)?t=r.referrerInfo.extraData:b.isJSONString(r.referrerInfo.extraData)&&(t=JSON.parse(r.referrerInfo.extraData)),b.extend(a,t)}var s=b.getUtm(a,"$","$latest_");return b.extend($,s.pre1),s},b.wxrequest=function(r){var $=a.request(r);setTimeout(function(){b.isObject($)&&b.isFunction($.abort)&&$.abort()},c.para.datasend_timeout)},b.info={currentProps:{},properties:{$lib:t,$lib_version:String(m)},getSystem:function(){var r=this.properties;a.getNetworkType({success:function($){r.$network_type=$.networkType},complete:function(){a.getSystemInfo({success:function($){r.$manufacturer=$.brand,r.$model=$.model,r.$screen_width=Number($.screenWidth),r.$screen_height=Number($.screenHeight),r.$os=$.system.split(" ")[0],r.$os_version=$.system.split(" ")[1]},complete:function(){c.initialState.systemIsComplete=!0,c.initialState.checkIsComplete()}})}})}},c._=b,c.prepareData=function(r,$){var a={distinct_id:this.store.getDistinctId(),lib:{$lib:t,$lib_method:"code",$lib_version:String(m)},properties:{}};b.extend(a,r),b.isObject(r.properties)&&!b.isEmptyObject(r.properties)&&b.extend(a.properties,r.properties),r.type&&"profile"===r.type.slice(0,7)||(c.para.batch_send&&(a._track_id=Number(String(Math.random()).slice(2,5)+String(Math.random()).slice(2,4)+String(Date.now()).slice(-4))),a.properties=b.extend({},b.info.properties,c.store.getProps(),b.info.currentProps,a.properties),"object"==f(c.store._state)&&"number"==typeof c.store._state.first_visit_day_time&&c.store._state.first_visit_day_time>new Date().getTime()?a.properties.$is_first_day=!0:a.properties.$is_first_day=!1),a.properties.$time&&b.isDate(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):c.para.use_client_time&&(a.time=1*new Date),b.searchObjDate(a),b.searchObjString(a),d.info(a),c.sendStrategy.send(a)},c.store={verifyDistinctId:function(r){return"number"==typeof r&&(r=String(r),/^\d+$/.test(r)||(r="unexpected_id")),"string"==typeof r&&""!==r||(r="unexpected_id"),r},storageInfo:null,getUUID:function(){return Date.now()+"-"+Math.floor(1e7*Math.random())+"-"+Math.random().toString(16).replace(".","")+"-"+String(31242*Math.random()).replace(".","").slice(0,8)},getStorage:function(){return this.storageInfo?this.storageInfo:(this.storageInfo=a.getStorageSync("sensorsdata2015_wechat")||"",this.storageInfo)},_state:{},mem:{mdata:[],getLength:function(){return this.mdata.length},add:function(r){this.mdata.push(r)},clear:function(r){this.mdata.splice(0,r)}},toState:function(r){var $=null;b.isJSONString(r)?($=JSON.parse(r)).distinct_id?this._state=$:this.set("distinct_id",this.getUUID()):b.isObject(r)&&($=r).distinct_id?this._state=$:this.set("distinct_id",this.getUUID())},getFirstId:function(){return this._state.first_id},getDistinctId:function(){return this._state.distinct_id},getProps:function(){return this._state.props||{}},setProps:function(r,$){var a=this._state.props||{};$?this.set("props",r):(b.extend(a,r),this.set("props",a))},set:function(r,$){var a={};for(var e in"string"==typeof r?a[r]=$:"object"==f(r)&&(a=r),this._state=this._state||{},a)this._state[e]=a[e];this.save()},change:function(r,$){this._state[r]=$},save:function(){a.setStorageSync("sensorsdata2015_wechat",this._state)},init:function(){var r=this.getStorage();if(r)this.toState(r);else{w=!0;var $=new Date,a=$.getTime();$.setHours(23),$.setMinutes(59),$.setSeconds(60),c.setOnceProfile({$first_visit_time:new Date}),this.set({distinct_id:this.getUUID(),first_visit_time:a,first_visit_day_time:$.getTime()})}}},c.setProfile=function(r,$){c.prepareData({type:"profile_set",properties:r},$)},c.setOnceProfile=function(r,$){c.prepareData({type:"profile_set_once",properties:r},$)},c.appendProfile=function(r,$){if(!b.isObject(r))return!1;b.each(r,function($,a){b.isString($)?r[a]=[$]:b.isArray($)||(delete r[a],d.info("appendProfile\u5C5E\u6027\u7684\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6216\u8005\u6570\u7EC4"))}),c.prepareData({type:"profile_append",properties:r},$)},c.incrementProfile=function(r,$){if(!b.isObject(r))return!1;var a=r;b.isString(r)&&((r={})[a]=1),c.prepareData({type:"profile_increment",properties:r},$)},c.track=function(r,$,a){this.prepareData({type:"track",event:r,properties:$},a)},c.identify=function(r,$){if("string"!=typeof r&&"number"!=typeof r)return!1;r=c.store.verifyDistinctId(r);var a=c.store.getFirstId();!0===$?a?c.store.set("first_id",r):c.store.set("distinct_id",r):a?c.store.change("first_id",r):c.store.change("distinct_id",r)},c.trackSignup=function(r,$,a,e){c.prepareData({original_id:c.store.getFirstId()||c.store.getDistinctId(),distinct_id:r,type:"track_signup",event:$,properties:a},e),c.store.set("distinct_id",r)},c.registerApp=function(r){b.isObject(r)&&!b.isEmptyObject(r)&&(b.info.currentProps=b.extend(b.info.currentProps,r))},c.register=function(r){b.isObject(r)&&!b.isEmptyObject(r)&&c.store.setProps(r)},c.clearAllRegister=function(){c.store.setProps({},!0)},c.login=function(r){if("string"!=typeof r&&"number"!=typeof r)return!1;r=c.store.verifyDistinctId(r);var $=c.store.getFirstId(),a=c.store.getDistinctId();r!==a&&($?c.trackSignup(r,"$SignUp"):(c.store.set("first_id",a),c.trackSignup(r,"$SignUp")))},c.openid={getRequest:function(r){a.login({success:function($){$.code&&c.para.appid&&c.para.openid_url?b.wxrequest({url:c.para.openid_url+"&code="+$.code+"&appid="+c.para.appid,method:"GET",complete:function($){b.isObject($)&&b.isObject($.data)&&$.data.openid?r($.data.openid):r()}}):r()}})},getWXStorage:function(){var r=c.store.getStorage();if(r&&b.isObject(r))return r.openid},getOpenid:function(r){if(!c.para.appid)return r(),!1;var $=this.getWXStorage();$?r($):this.getRequest(r)}},c.initial=function(){this._.info.getSystem(),this.store.init()},c.init=function(r){if(!0===this.hasInit)return!1;this.hasInit=!0,c.setPara(r),c.para.batch_send&&c.sendStrategy.batchInterval(),c.initialState.storeIsComplete=!0,c.initialState.checkIsComplete()},c.getPresetProperties=function(){if(b.info&&b.info.properties&&b.info.properties.$lib){var r=b.extend({$url_path:b.getCurrentPath()},b.info.properties,c.store.getProps());return delete r.$lib,r}return{}},b.autoExeQueue=function(){return{items:[],enqueue:function(r){this.items.push(r),this.start()},dequeue:function(){return this.items.shift()},getCurrentItem:function(){return this.items[0]},isRun:!1,start:function(){this.items.length>0&&!this.isRun&&(this.isRun=!0,this.getCurrentItem().start())},close:function(){this.dequeue(),this.isRun=!1,this.start()}}},c.requestQueue=function(r){this.url=r.url},c.requestQueue.prototype.isEnd=function(){this.received||(this.received=!0,this.close())},c.requestQueue.prototype.start=function(){var r=this;setTimeout(function(){r.isEnd()},c.para.send_timeout),b.wxrequest({url:this.url,method:"GET",complete:function(){r.isEnd()}})},c.dataQueue=b.autoExeQueue(),c.sendStrategy={dataHasSend:!0,dataHasChange:!1,onAppHide:function(){c.para.batch_send&&this.batchSend()},send:function(r){if(c.para.batch_send){if(this.dataHasChange=!0,c.store.mem.getLength()>=300)return d.info("\u6570\u636E\u91CF\u5B58\u50A8\u8FC7\u5927\uFF0C\u6709\u5F02\u5E38"),!1;c.store.mem.add(r),c.store.mem.getLength()>=c.para.batch_send.max_length&&this.batchSend()}else this.queueSend(r)},queueSend:function(r){r=JSON.stringify(r),r=-1!==c.para.server_url.indexOf("?")?c.para.server_url+"&data="+encodeURIComponent(b.base64Encode(r)):c.para.server_url+"?data="+encodeURIComponent(b.base64Encode(r));var $=new c.requestQueue({url:r});$.close=function(){c.dataQueue.close()},c.dataQueue.enqueue($)},wxrequest:function(r){if(b.isArray(r.data)&&r.data.length>0){var $=Date.now();r.data.forEach(function(r){r._flush_time=$}),r.data=JSON.stringify(r.data),b.wxrequest({url:c.para.server_url,method:"POST",dataType:"text",data:"data_list="+encodeURIComponent(b.base64Encode(r.data)),success:function(){r.success(r.len)}})}else r.success(r.len)},batchSend:function(){if(this.dataHasSend){var r=c.store.mem.mdata,$=r.length;$>0&&(this.dataHasSend=!1,this.wxrequest({data:r,len:$,success:this.batchRemove.bind(this)}))}},batchRemove:function(r){c.store.mem.clear(r),this.dataHasSend=!0,this.dataHasChange=!0,this.batchWrite()},is_first_batch_write:!0,batchWrite:function(){var r=this;this.dataHasChange&&(this.is_first_batch_write&&(this.is_first_batch_write=!1,setTimeout(function(){r.batchSend()},1e3)),this.dataHasChange=!1,a.setStorageSync("sensors_mp_prepare_data",c.store.mem.mdata))},batchInterval:function(){var r=this;!function $(){setTimeout(function(){r.batchWrite(),$()},1e3)}(),function $(){setTimeout(function(){r.batchSend(),$()},c.para.batch_send.send_timeout)}()}},c.setOpenid=function(r,$){c.store.set("openid",r),$?c.store.set("distinct_id",r):c.identify(r,!0)},c.initWithOpenid=function(r,$){(r=r||{}).appid&&(c.para.appid=r.appid),c.openid.getOpenid(function(a){a&&c.setOpenid(a,r.isCoverLogin),$&&b.isFunction($)&&$(a),c.init(r)})},b.each(["setProfile","setOnceProfile","track","register","clearAllRegister","quick"],function(r){var $=c[r];c[r]=function(){c.initialState.isComplete?$.apply(c,arguments):c.initialState.queue.push([r,arguments])}}),b.setQuery=function(r){if(r&&b.isObject(r)&&!b.isEmptyObject(r)){var $=[];return b.each(r,function(r,a){"q"===a&&b.isString(r)&&0===r.indexOf("http")||"scene"===a||$.push(a+"="+r)}),$.join("&")}return""},c.autoTrackCustom={trackCustom:function(r,$,a){var e=c.para.autoTrack[r],t="";c.para.autoTrack&&e&&("function"==typeof e?(t=e(),b.isObject(t)&&b.extend($,t)):b.isObject(e)&&(b.extend($,e),c.para.autoTrack[r]=!0),c.track(a,$))},appLaunch:function(r,$){"object"!=f(this)||this.trackCustom||(this[c.para.name]=c);var a={};r&&r.path&&(a.$url_path=b.getPath(r.path)),b.setShareInfo(r,a);var e=b.setUtm(r,a);w?(a.$is_first_time=!0,b.isEmptyObject(e.pre1)||c.setOnceProfile(e.pre1)):a.$is_first_time=!1,b.isEmptyObject(e.pre2)||c.registerApp(e.pre2),r.scene=r.scene||"\u672A\u53D6\u5230\u503C",a.$scene=b.getMPScene(r.scene),c.registerApp({$latest_scene:a.$scene}),a.$url_query=b.setQuery(r.query),$?(a=b.extend(a,$),c.track("$MPLaunch",a)):c.para.autoTrack&&c.para.autoTrack.appLaunch&&c.autoTrackCustom.trackCustom("appLaunch",a,"$MPLaunch")},appShow:function(r,$){var a={};l=new Date().getTime(),r&&r.path&&(a.$url_path=b.getPath(r.path)),b.setShareInfo(r,a);var e=b.setUtm(r,a);b.isEmptyObject(e.pre2)||c.registerApp(e.pre2),r.scene=r.scene||"\u672A\u53D6\u5230\u503C",a.$scene=b.getMPScene(r.scene),c.registerApp({$latest_scene:a.$scene}),a.$url_query=b.setQuery(r.query),$?(a=b.extend(a,$),c.track("$MPShow",a)):c.para.autoTrack&&c.para.autoTrack.appShow&&c.autoTrackCustom.trackCustom("appShow",a,"$MPShow")},appHide:function(r){var $=new Date().getTime(),a={};a.$url_path=b.getCurrentPath(),l&&$-l>0&&($-l)/36e5<24&&(a.event_duration=($-l)/1e3),r?(a=b.extend(a,r),c.track("$MPHide",a)):c.para.autoTrack&&c.para.autoTrack.appHide&&c.autoTrackCustom.trackCustom("appHide",a,"$MPHide"),c.sendStrategy.onAppHide()},pageLoad:function(r){r&&b.isObject(r)&&(this.sensors_mp_url_query=b.setQuery(r))},pageShow:function(r){var $={},a=b.getCurrentPath();$.$referrer=q,$.$url_path=a,c.status.last_referrer=q,this.sensors_mp_url_query&&($.$url_query=this.sensors_mp_url_query),r?($=b.extend($,r),c.track("$MPViewScreen",$)):c.para.onshow?c.para.onshow(c,a,this):c.para.autoTrack&&c.para.autoTrack.pageShow&&c.autoTrackCustom.trackCustom("pageShow",$,"$MPViewScreen"),q=a,c.status.referrer=a},pageShare:function(r,$){var a=r.onShareAppMessage;r.onShareAppMessage=function(){var r=a.apply(this,arguments);return c.para.autoTrack&&c.para.autoTrack.pageShare&&c.autoTrackCustom.trackCustom("pageShare",{$url_path:b.getCurrentPath(),$share_depth:b.getShareDepth()},"$MPShare"),c.para.allow_amend_share_path&&("object"!=f(r)&&((r={}).path=b.getCurrentUrl(this)),"object"!=f(r)||void 0!==r.path&&""!==r.path||(r.path=b.getCurrentUrl(this)),"object"==f(r)&&"string"==typeof r.path&&(-1===r.path.indexOf("?")?r.path=r.path+"?":"&"!==r.path.slice(-1)&&(r.path=r.path+"&")),r.path=r.path+"sampshare="+encodeURIComponent(b.getShareInfo())),r}}},c.quick=function(){var r=arguments[0],$=arguments[1],a=arguments[2],e=b.isObject(a)?a:{};"appLaunch"===r||"appShow"===r?$?c.autoTrackCustom[r]($,e):d.info("App\u7684launch\u548Cshow\uFF0C\u5728sensors.quick\u7B2C\u4E8C\u4E2A\u53C2\u6570\u5FC5\u987B\u4F20\u5165App\u7684options\u53C2\u6570"):"appHide"===r&&(e=b.isObject($)?$:{},c.autoTrackCustom[r](e))},c.App=function(r){e(r=r||{},"onLaunch","appLaunch"),e(r,"onShow","appShow"),e(r,"onHide","appHide")},c.Page=function(r){e(r,"onLoad","pageLoad"),e(r,"onShow","pageShow"),"function"==typeof r.onShareAppMessage&&c.autoTrackCustom.pageShare(r)},c.initial(),B=c;var v={},y=A,k=B;function u(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var $=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;return y(o),k.setPara({}),s($)&&$.intercept(function($){return k.Page($),$}),s(r)&&r.intercept(function($){return k.App($),$}),k}function s($){return"function"==typeof $}(v=u).default=u;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=v}else if(typeof define==="function"&&define.amd){define(function(){return v})}})();
(function () {var C;function f(r){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var a=wx,A=function(r){"object"===f(r)&&(a=r)};var b={},c={para:{name:"sensors",server_url:"https://analytics.tuhu.com/sa?project=production",send_timeout:1e3,use_client_time:!1,show_log:!0,allow_amend_share_path:!0,max_string_length:300,datasend_timeout:3e3,autoTrack:{appLaunch:!0,appShow:!0,appHide:!0,pageShow:!0,pageShare:!0}},setPara:function(r){c.para=b.extend2Lev(c.para,r),b.isObject(c.para.register)&&b.extend(b.info.properties,c.para.register),c.para.openid_url||(c.para.openid_url=c.para.server_url.replace(/([^\/])\/(sa)(\.gif){0,1}/,"$1/mp_login")),"number"!=typeof c.para.send_timeout&&(c.para.send_timeout=1e3);var $={send_timeout:6e3,max_length:6};!0===c.para.batch_send?(c.para.batch_send=b.extend({},$),c.para.use_client_time=!0):"object"==f(c.para.batch_send)&&(c.para.use_client_time=!0,c.para.batch_send=b.extend({},$,c.para.batch_send))},status:{}},o=Array.prototype,z=Function.prototype,r=Object.prototype,g=o.slice,h=r.toString,p=r.hasOwnProperty,m="1.13.2",t="MiniProgram",k="utm_source utm_medium utm_campaign utm_content utm_term",x={1001:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\uFF0C\u201C\u6700\u8FD1\u4F7F\u7528\u201D\u5217\u8868",1005:"\u9876\u90E8\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1006:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1007:"\u5355\u4EBA\u804A\u5929\u4F1A\u8BDD\u4E2D\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1008:"\u7FA4\u804A\u4F1A\u8BDD\u4E2D\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1011:"\u626B\u63CF\u4E8C\u7EF4\u7801",1012:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u4E8C\u7EF4\u7801",1013:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u4E8C\u7EF4\u7801",1014:"\u5C0F\u7A0B\u5E8F\u6A21\u7248\u6D88\u606F",1017:"\u524D\u5F80\u4F53\u9A8C\u7248\u7684\u5165\u53E3\u9875",1019:"\u5FAE\u4FE1\u94B1\u5305",1020:"\u516C\u4F17\u53F7 profile \u9875\u76F8\u5173\u5C0F\u7A0B\u5E8F\u5217\u8868",1022:"\u804A\u5929\u9876\u90E8\u7F6E\u9876\u5C0F\u7A0B\u5E8F\u5165\u53E3",1023:"\u5B89\u5353\u7CFB\u7EDF\u684C\u9762\u56FE\u6807",1024:"\u5C0F\u7A0B\u5E8F profile \u9875",1025:"\u626B\u63CF\u4E00\u7EF4\u7801",1026:"\u9644\u8FD1\u5C0F\u7A0B\u5E8F\u5217\u8868",1027:"\u9876\u90E8\u641C\u7D22\u6846\u641C\u7D22\u7ED3\u679C\u9875\u201C\u4F7F\u7528\u8FC7\u7684\u5C0F\u7A0B\u5E8F\u201D\u5217\u8868",1028:"\u6211\u7684\u5361\u5305",1029:"\u5361\u5238\u8BE6\u60C5\u9875",1030:"\u81EA\u52A8\u5316\u6D4B\u8BD5\u4E0B\u6253\u5F00\u5C0F\u7A0B\u5E8F",1031:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u4E00\u7EF4\u7801",1032:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u4E00\u7EF4\u7801",1034:"\u5FAE\u4FE1\u652F\u4ED8\u5B8C\u6210\u9875",1035:"\u516C\u4F17\u53F7\u81EA\u5B9A\u4E49\u83DC\u5355",1036:"App \u5206\u4EAB\u6D88\u606F\u5361\u7247",1037:"\u5C0F\u7A0B\u5E8F\u6253\u5F00\u5C0F\u7A0B\u5E8F",1038:"\u4ECE\u53E6\u4E00\u4E2A\u5C0F\u7A0B\u5E8F\u8FD4\u56DE",1039:"\u6447\u7535\u89C6",1042:"\u6DFB\u52A0\u597D\u53CB\u641C\u7D22\u6846\u7684\u641C\u7D22\u7ED3\u679C\u9875",1043:"\u516C\u4F17\u53F7\u6A21\u677F\u6D88\u606F",1044:"\u5E26 shareTicket \u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247\uFF08\u8BE6\u60C5)",1045:"\u670B\u53CB\u5708\u5E7F\u544A",1046:"\u670B\u53CB\u5708\u5E7F\u544A\u8BE6\u60C5\u9875",1047:"\u626B\u63CF\u5C0F\u7A0B\u5E8F\u7801",1048:"\u957F\u6309\u56FE\u7247\u8BC6\u522B\u5C0F\u7A0B\u5E8F\u7801",1049:"\u624B\u673A\u76F8\u518C\u9009\u53D6\u5C0F\u7A0B\u5E8F\u7801",1052:"\u5361\u5238\u7684\u9002\u7528\u95E8\u5E97\u5217\u8868",1053:"\u641C\u4E00\u641C\u7684\u7ED3\u679C\u9875",1054:"\u9876\u90E8\u641C\u7D22\u6846\u5C0F\u7A0B\u5E8F\u5FEB\u6377\u5165\u53E3",1056:"\u97F3\u4E50\u64AD\u653E\u5668\u83DC\u5355",1057:"\u94B1\u5305\u4E2D\u7684\u94F6\u884C\u5361\u8BE6\u60C5\u9875",1058:"\u516C\u4F17\u53F7\u6587\u7AE0",1059:"\u4F53\u9A8C\u7248\u5C0F\u7A0B\u5E8F\u7ED1\u5B9A\u9080\u8BF7\u9875",1064:"\u5FAE\u4FE1\u8FDEWi-Fi\u72B6\u6001\u680F",1067:"\u516C\u4F17\u53F7\u6587\u7AE0\u5E7F\u544A",1068:"\u9644\u8FD1\u5C0F\u7A0B\u5E8F\u5217\u8868\u5E7F\u544A",1069:"\u79FB\u52A8\u5E94\u7528",1071:"\u94B1\u5305\u4E2D\u7684\u94F6\u884C\u5361\u5217\u8868\u9875",1072:"\u4E8C\u7EF4\u7801\u6536\u6B3E\u9875\u9762",1073:"\u5BA2\u670D\u6D88\u606F\u5217\u8868\u4E0B\u53D1\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1074:"\u516C\u4F17\u53F7\u4F1A\u8BDD\u4E0B\u53D1\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247",1077:"\u6447\u5468\u8FB9",1078:"\u8FDEWi-Fi\u6210\u529F\u9875",1079:"\u5FAE\u4FE1\u6E38\u620F\u4E2D\u5FC3",1081:"\u5BA2\u670D\u6D88\u606F\u4E0B\u53D1\u7684\u6587\u5B57\u94FE",1082:"\u516C\u4F17\u53F7\u4F1A\u8BDD\u4E0B\u53D1\u7684\u6587\u5B57\u94FE",1084:"\u670B\u53CB\u5708\u5E7F\u544A\u539F\u751F\u9875",1089:"\u5FAE\u4FE1\u804A\u5929\u4E3B\u754C\u9762\u4E0B\u62C9",1090:"\u957F\u6309\u5C0F\u7A0B\u5E8F\u53F3\u4E0A\u89D2\u83DC\u5355\u5524\u51FA\u6700\u8FD1\u4F7F\u7528\u5386\u53F2",1091:"\u516C\u4F17\u53F7\u6587\u7AE0\u5546\u54C1\u5361\u7247",1092:"\u57CE\u5E02\u670D\u52A1\u5165\u53E3",1095:"\u5C0F\u7A0B\u5E8F\u5E7F\u544A\u7EC4\u4EF6",1096:"\u804A\u5929\u8BB0\u5F55",1097:"\u5FAE\u4FE1\u652F\u4ED8\u7B7E\u7EA6\u9875",1099:"\u9875\u9762\u5185\u5D4C\u63D2\u4EF6",1102:"\u516C\u4F17\u53F7 profile \u9875\u670D\u52A1\u9884\u89C8",1103:"\u53D1\u73B0\u680F\u5C0F\u7A0B\u5E8F\u4E3B\u5165\u53E3\uFF0C\u201C\u6211\u7684\u5C0F\u7A0B\u5E8F\u201D\u5217\u8868",1104:"\u5FAE\u4FE1\u804A\u5929\u4E3B\u754C\u9762\u4E0B\u62C9\uFF0C\u201C\u6211\u7684\u5C0F\u7A0B\u5E8F\u201D\u680F"},q="\u76F4\u63A5\u6253\u5F00";c.status.referrer="\u76F4\u63A5\u6253\u5F00";var l=null,j=0,n="",w=!1;c.lib_version=m;var d="object"==f(d)?d:{};function e(r,$,a){var e=c.autoTrackCustom[a];if(r[$]){var t=r[$];r[$]=function(){"onLaunch"===$&&(this[c.para.name]=c),!c.para.autoTrackIsFirst||b.isObject(c.para.autoTrackIsFirst)&&!c.para.autoTrackIsFirst[a]?(t.apply(this,arguments),e.apply(this,arguments)):(!0===c.para.autoTrackIsFirst||b.isObject(c.para.autoTrackIsFirst)&&c.para.autoTrackIsFirst[a])&&(e.apply(this,arguments),t.apply(this,arguments))}}else r[$]=function(){"onLaunch"===$&&(this[c.para.name]=c),e.apply(this,arguments)}}d.info=function(){if(c.para.show_log&&"object"==("undefined"==typeof console?"undefined":f(console))&&console.log)try{return console.log.apply(console,arguments)}catch(r){console.log(arguments[0])}},function(){z.bind;var r=o.forEach,$=o.indexOf,a=Array.isArray,e={},t=b.each=function($,a,t){if(null==$)return!1;if(r&&$.forEach===r)$.forEach(a,t);else if($.length===+$.length){for(var s=0,n=$.length;s<n;s++)if(s in $&&a.call(t,$[s],s,$)===e)return!1}else for(var i in $)if(p.call($,i)&&a.call(t,$[i],i,$)===e)return!1};b.logger=d,b.extend=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&(r[a]=$[a])}),r},b.extend2Lev=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&(b.isObject($[a])&&b.isObject(r[a])?b.extend(r[a],$[a]):r[a]=$[a])}),r},b.coverExtend=function(r){return t(g.call(arguments,1),function($){for(var a in $)void 0!==$[a]&&void 0===r[a]&&(r[a]=$[a])}),r},b.isArray=a||function(r){return"[object Array]"===h.call(r)},b.isFunction=function(r){try{return /^\s*\bfunction\b/.test(r)}catch(r){return!1}},b.isArguments=function(r){return!(!r||!p.call(r,"callee"))},b.toArray=function(r){return r?r.toArray?r.toArray():b.isArray(r)?g.call(r):b.isArguments(r)?g.call(r):b.values(r):[]},b.values=function(r){var $=[];return null==r?$:(t(r,function(r){$[$.length]=r}),$)},b.include=function(r,a){var s=!1;return null==r?s:$&&r.indexOf===$?-1!=r.indexOf(a):(t(r,function(r){if(s||(s=r===a))return e}),s)}}(),b.trim=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},b.isObject=function(r){return null!=r&&"[object Object]"==h.call(r)},b.isEmptyObject=function(r){if(b.isObject(r)){for(var $ in r)if(p.call(r,$))return!1;return!0}return!1},b.isUndefined=function(r){return void 0===r},b.isString=function(r){return"[object String]"==h.call(r)},b.isDate=function(r){return"[object Date]"==h.call(r)},b.isBoolean=function(r){return"[object Boolean]"==h.call(r)},b.isNumber=function(r){return"[object Number]"==h.call(r)&&/[\d\.]+/.test(String(r))},b.isJSONString=function(r){try{JSON.parse(r)}catch(r){return!1}return!0},b.decodeURIComponent=function(r){var $="";try{$=decodeURIComponent(r)}catch(a){$=r}return $},b.encodeDates=function(r){return b.each(r,function($,a){b.isDate($)?r[a]=b.formatDate($):b.isObject($)&&(r[a]=b.encodeDates($))}),r},b.formatDate=function(r){function $(r){return r<10?"0"+r:r}return r.getFullYear()+"-"+$(r.getMonth()+1)+"-"+$(r.getDate())+" "+$(r.getHours())+":"+$(r.getMinutes())+":"+$(r.getSeconds())+"."+$(r.getMilliseconds())},b.searchObjDate=function(r){b.isObject(r)&&b.each(r,function($,a){b.isObject($)?b.searchObjDate(r[a]):b.isDate($)&&(r[a]=b.formatDate($))})},b.formatString=function(r){return r.length>c.para.max_string_length?(d.info("\u5B57\u7B26\u4E32\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\uFF0C\u5DF2\u7ECF\u505A\u622A\u53D6--"+r),r.slice(0,c.para.max_string_length)):r},b.searchObjString=function(r){b.isObject(r)&&b.each(r,function($,a){b.isObject($)?b.searchObjString(r[a]):b.isString($)&&(r[a]=b.formatString($))})},b.unique=function(r){for(var $,a=[],e={},t=0;t<r.length;t++)($=r[t])in e||(e[$]=!0,a.push($));return a},b.strip_sa_properties=function(r){return b.isObject(r)?(b.each(r,function($,a){if(b.isArray($)){var e=[];b.each($,function(r){b.isString(r)?e.push(r):d.info("\u60A8\u7684\u6570\u636E-",$,"\u7684\u6570\u7EC4\u91CC\u7684\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32,\u5DF2\u7ECF\u5C06\u5176\u5220\u9664")}),0!==e.length?r[a]=e:(delete r[a],d.info("\u5DF2\u7ECF\u5220\u9664\u7A7A\u7684\u6570\u7EC4"))}b.isString($)||b.isNumber($)||b.isDate($)||b.isBoolean($)||b.isArray($)||(d.info("\u60A8\u7684\u6570\u636E-",$,"-\u683C\u5F0F\u4E0D\u6EE1\u8DB3\u8981\u6C42\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u5C06\u5176\u5220\u9664"),delete r[a])}),r):r},b.strip_empty_properties=function(r){var $={};return b.each(r,function(r,a){null!=r&&($[a]=r)}),$},b.utf8Encode=function(r){var $,a,e,t,s="";for($=a=0,e=(r=(r+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,t=0;t<e;t++){var n=r.charCodeAt(t),i=null;n<128?a++:i=n>127&&n<2048?String.fromCharCode(n>>6|192,63&n|128):String.fromCharCode(n>>12|224,n>>6&63|128,63&n|128),null!==i&&(a>$&&(s+=r.substring($,a)),s+=i,$=a=t+1)}return a>$&&(s+=r.substring($,r.length)),s},b.base64Encode=function(r){var $,a,e,t,s,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0,o=0,v="",c=[];if(!r)return r;r=b.utf8Encode(r);do{$=(s=r.charCodeAt(i++)<<16|r.charCodeAt(i++)<<8|r.charCodeAt(i++))>>18&63,a=s>>12&63,e=s>>6&63,t=63&s,c[o++]=n.charAt($)+n.charAt(a)+n.charAt(e)+n.charAt(t)}while(i<r.length);switch(v=c.join(""),r.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"=";}return v},b.getCurrentPath=function(){var r="\u672A\u53D6\u5230";try{var $=getCurrentPages();r=$[$.length-1].route}catch(r){d.info(r)}return r},b.getCurrentUrl=function(r){var $=b.getCurrentPath(),a="";return b.isObject(r)&&r.sensors_mp_url_query&&(a=r.sensors_mp_url_query),$?a?$+"?"+a:$:"\u672A\u53D6\u5230"},b.getPath=function(r){return"string"==typeof r?r.replace(/^\//,""):"\u53D6\u503C\u5F02\u5E38"},b.getQueryParam=function(r,$){var a=new RegExp("[\\?&]"+$+"=([^&#]*)").exec(r);return null===a||a&&"string"!=typeof a[1]&&a[1].length?"":b.decodeURIComponent(a[1])},c.initialState={queue:[],isComplete:!1,systemIsComplete:!1,storeIsComplete:!1,checkIsComplete:function(){this.systemIsComplete&&this.storeIsComplete&&(this.isComplete=!0,this.queue.length>0&&(b.each(this.queue,function(r){c[r[0]].apply(c,g.call(r[1]))}),c.queue=[]))}},b.getPrefixUtm=function(r,$,a){if($=$||"",a=a||"_",!b.isObject(r))return{};var e={},t={};for(var s in r)-1!==(" "+k+" ").indexOf(" "+s+" ")?e[$+s]=r[s]:t[a+s]=r[s];return{$utms:e,otherUtms:t}},b.convertObjToParam=function(r){var $=[];for(var a in r)$.push(a+"="+r[a]);return $.join("&")},b.getSource=function(r){if(b.isObject(r)){if(b.isEmptyObject(r))return{};for(var $ in r)-1===(" "+k+" ").indexOf(" "+$+" ")?delete r[$]:r[$]=r[$].replace("?","*");r="?"+(r=b.convertObjToParam(r))}else r=b.decodeURIComponent(r);var a=k.split(" "),e=k.split(" "),t="",s={};return 2!==(r=r.split("?")).length?{}:(r="?"+(r=r[1]),b.isArray(c.para.source_channel)&&c.para.source_channel.length>0&&(e=e.concat(c.para.source_channel),e=b.unique(e)),b.each(e,function($){t=b.getQueryParam(r,$),(t=b.decodeURIComponent(t)).length&&b.include(a,$)&&(s[$]=t)}),s)},b.getObjFromQuery=function(r){var $=r.split("?"),a={};return $&&$[1]?(b.each($[1].split("&"),function(r){var $=r.split("=");$[0]&&$[1]&&(a[$[0]]=$[1])}),a):{}},b.getUtm=function(r,$,a){var e=b.getSource(r);return void 0===a&&$?{pre1:b.getPrefixUtm(e,$).$utms||{},pre2:{}}:void 0!==a&&$?{pre1:b.getPrefixUtm(e,$).$utms||{},pre2:b.getPrefixUtm(e,a).$utms||{}}:{pre1:{},pre2:{}}},b.getMPScene=function(r){return"number"==typeof r||"string"==typeof r&&""!==r?(r=String(r),x[r]||r):"\u672A\u53D6\u5230\u503C"},b.getShareDepth=function(){if("number"==typeof j&&0!==j){var r=c.store.getDistinctId(),$=c.store.getFirstId();return!n||n!==r&&n!==$?j+1:j}return 1},b.setShareInfo=function(r,$){var a={};if(!(r&&b.isObject(r.query)&&r.query.sampshare))return{};if(a=b.decodeURIComponent(r.query.sampshare),!b.isJSONString(a))return{};var e=(a=JSON.parse(a)).d,t=a.p,s=a.i;"string"==typeof s?($.$share_distinct_id=s,n=s):$.$share_distinct_id="\u53D6\u503C\u5F02\u5E38","number"==typeof e?($.$share_depth=e,j=e):$.$share_depth="-1",$.$share_url_path="string"==typeof t?t:"\u53D6\u503C\u5F02\u5E38"},b.getShareInfo=function(){return JSON.stringify({i:c.store.getDistinctId()||"\u53D6\u503C\u5F02\u5E38",p:b.getCurrentPath(),d:b.getShareDepth()})},b.setUtm=function(r,$){var a={};if(r&&b.isObject(r.query)){var e=(a=b.extend({},r.query)).scene;e&&(e=-1!==(e=b.decodeURIComponent(e)).indexOf("?")?"?"+e.replace(/\?/g,""):"?"+e,b.extend(a,b.getObjFromQuery(e))),r.query.q&&b.extend(a,b.getObjFromQuery(b.decodeURIComponent(r.query.q)))}if(r&&b.isObject(r.referrerInfo)&&r.referrerInfo.extraData){var t={};b.isObject(r.referrerInfo.extraData)&&!b.isEmptyObject(r.referrerInfo.extraData)?t=r.referrerInfo.extraData:b.isJSONString(r.referrerInfo.extraData)&&(t=JSON.parse(r.referrerInfo.extraData)),b.extend(a,t)}var s=b.getUtm(a,"$","$latest_");return b.extend($,s.pre1),s},b.wxrequest=function(r){var $=a.request(r);setTimeout(function(){b.isObject($)&&b.isFunction($.abort)&&$.abort()},c.para.datasend_timeout)},b.info={currentProps:{},properties:{$lib:t,$lib_version:String(m)},getSystem:function(){var r=this.properties;a.getNetworkType({success:function($){r.$network_type=$.networkType},complete:function(){a.getSystemInfo({success:function($){r.$manufacturer=$.brand,r.$model=$.model,r.$screen_width=Number($.screenWidth),r.$screen_height=Number($.screenHeight),r.$os=$.system.split(" ")[0],r.$os_version=$.system.split(" ")[1]},complete:function(){c.initialState.systemIsComplete=!0,c.initialState.checkIsComplete()}})}})}},c._=b,c.prepareData=function(r,$){var a={distinct_id:this.store.getDistinctId(),lib:{$lib:t,$lib_method:"code",$lib_version:String(m)},properties:{}};b.extend(a,r),b.isObject(r.properties)&&!b.isEmptyObject(r.properties)&&b.extend(a.properties,r.properties),r.type&&"profile"===r.type.slice(0,7)||(c.para.batch_send&&(a._track_id=Number(String(Math.random()).slice(2,5)+String(Math.random()).slice(2,4)+String(Date.now()).slice(-4))),a.properties=b.extend({},b.info.properties,c.store.getProps(),b.info.currentProps,a.properties),"object"==f(c.store._state)&&"number"==typeof c.store._state.first_visit_day_time&&c.store._state.first_visit_day_time>new Date().getTime()?a.properties.$is_first_day=!0:a.properties.$is_first_day=!1),a.properties.$time&&b.isDate(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):c.para.use_client_time&&(a.time=1*new Date),b.searchObjDate(a),b.searchObjString(a),d.info(a),c.sendStrategy.send(a)},c.store={verifyDistinctId:function(r){return"number"==typeof r&&(r=String(r),/^\d+$/.test(r)||(r="unexpected_id")),"string"==typeof r&&""!==r||(r="unexpected_id"),r},storageInfo:null,getUUID:function(){return Date.now()+"-"+Math.floor(1e7*Math.random())+"-"+Math.random().toString(16).replace(".","")+"-"+String(31242*Math.random()).replace(".","").slice(0,8)},getStorage:function(){return this.storageInfo?this.storageInfo:(this.storageInfo=a.getStorageSync("sensorsdata2015_wechat")||"",this.storageInfo)},_state:{},mem:{mdata:[],getLength:function(){return this.mdata.length},add:function(r){this.mdata.push(r)},clear:function(r){this.mdata.splice(0,r)}},toState:function(r){var $=null;b.isJSONString(r)?($=JSON.parse(r)).distinct_id?this._state=$:this.set("distinct_id",this.getUUID()):b.isObject(r)&&($=r).distinct_id?this._state=$:this.set("distinct_id",this.getUUID())},getFirstId:function(){return this._state.first_id},getDistinctId:function(){return this._state.distinct_id},getProps:function(){return this._state.props||{}},setProps:function(r,$){var a=this._state.props||{};$?this.set("props",r):(b.extend(a,r),this.set("props",a))},set:function(r,$){var a={};for(var e in"string"==typeof r?a[r]=$:"object"==f(r)&&(a=r),this._state=this._state||{},a)this._state[e]=a[e];this.save()},change:function(r,$){this._state[r]=$},save:function(){a.setStorageSync("sensorsdata2015_wechat",this._state)},init:function(){var r=this.getStorage();if(r)this.toState(r);else{w=!0;var $=new Date,a=$.getTime();$.setHours(23),$.setMinutes(59),$.setSeconds(60),c.setOnceProfile({$first_visit_time:new Date}),this.set({distinct_id:this.getUUID(),first_visit_time:a,first_visit_day_time:$.getTime()})}}},c.setProfile=function(r,$){c.prepareData({type:"profile_set",properties:r},$)},c.setOnceProfile=function(r,$){c.prepareData({type:"profile_set_once",properties:r},$)},c.appendProfile=function(r,$){if(!b.isObject(r))return!1;b.each(r,function($,a){b.isString($)?r[a]=[$]:b.isArray($)||(delete r[a],d.info("appendProfile\u5C5E\u6027\u7684\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6216\u8005\u6570\u7EC4"))}),c.prepareData({type:"profile_append",properties:r},$)},c.incrementProfile=function(r,$){if(!b.isObject(r))return!1;var a=r;b.isString(r)&&((r={})[a]=1),c.prepareData({type:"profile_increment",properties:r},$)},c.track=function(r,$,a){this.prepareData({type:"track",event:r,properties:$},a)},c.identify=function(r,$){if("string"!=typeof r&&"number"!=typeof r)return!1;r=c.store.verifyDistinctId(r);var a=c.store.getFirstId();!0===$?a?c.store.set("first_id",r):c.store.set("distinct_id",r):a?c.store.change("first_id",r):c.store.change("distinct_id",r)},c.trackSignup=function(r,$,a,e){c.prepareData({original_id:c.store.getFirstId()||c.store.getDistinctId(),distinct_id:r,type:"track_signup",event:$,properties:a},e),c.store.set("distinct_id",r)},c.registerApp=function(r){b.isObject(r)&&!b.isEmptyObject(r)&&(b.info.currentProps=b.extend(b.info.currentProps,r))},c.register=function(r){b.isObject(r)&&!b.isEmptyObject(r)&&c.store.setProps(r)},c.clearAllRegister=function(){c.store.setProps({},!0)},c.login=function(r){if("string"!=typeof r&&"number"!=typeof r)return!1;r=c.store.verifyDistinctId(r);var $=c.store.getFirstId(),a=c.store.getDistinctId();r!==a&&($?c.trackSignup(r,"$SignUp"):(c.store.set("first_id",a),c.trackSignup(r,"$SignUp")))},c.openid={getRequest:function(r){a.login({success:function($){$.code&&c.para.appid&&c.para.openid_url?b.wxrequest({url:c.para.openid_url+"&code="+$.code+"&appid="+c.para.appid,method:"GET",complete:function($){b.isObject($)&&b.isObject($.data)&&$.data.openid?r($.data.openid):r()}}):r()}})},getWXStorage:function(){var r=c.store.getStorage();if(r&&b.isObject(r))return r.openid},getOpenid:function(r){if(!c.para.appid)return r(),!1;var $=this.getWXStorage();$?r($):this.getRequest(r)}},c.initial=function(){this._.info.getSystem(),this.store.init()},c.init=function(r){if(!0===this.hasInit)return!1;this.hasInit=!0,c.setPara(r),c.para.batch_send&&c.sendStrategy.batchInterval(),c.initialState.storeIsComplete=!0,c.initialState.checkIsComplete()},c.getPresetProperties=function(){if(b.info&&b.info.properties&&b.info.properties.$lib){var r=b.extend({$url_path:b.getCurrentPath()},b.info.properties,c.store.getProps());return delete r.$lib,r}return{}},b.autoExeQueue=function(){return{items:[],enqueue:function(r){this.items.push(r),this.start()},dequeue:function(){return this.items.shift()},getCurrentItem:function(){return this.items[0]},isRun:!1,start:function(){this.items.length>0&&!this.isRun&&(this.isRun=!0,this.getCurrentItem().start())},close:function(){this.dequeue(),this.isRun=!1,this.start()}}},c.requestQueue=function(r){this.url=r.url},c.requestQueue.prototype.isEnd=function(){this.received||(this.received=!0,this.close())},c.requestQueue.prototype.start=function(){var r=this;setTimeout(function(){r.isEnd()},c.para.send_timeout),b.wxrequest({url:this.url,method:"GET",complete:function(){r.isEnd()}})},c.dataQueue=b.autoExeQueue(),c.sendStrategy={dataHasSend:!0,dataHasChange:!1,onAppHide:function(){c.para.batch_send&&this.batchSend()},send:function(r){if(c.para.batch_send){if(this.dataHasChange=!0,c.store.mem.getLength()>=300)return d.info("\u6570\u636E\u91CF\u5B58\u50A8\u8FC7\u5927\uFF0C\u6709\u5F02\u5E38"),!1;c.store.mem.add(r),c.store.mem.getLength()>=c.para.batch_send.max_length&&this.batchSend()}else this.queueSend(r)},queueSend:function(r){r=JSON.stringify(r),r=-1!==c.para.server_url.indexOf("?")?c.para.server_url+"&data="+encodeURIComponent(b.base64Encode(r)):c.para.server_url+"?data="+encodeURIComponent(b.base64Encode(r));var $=new c.requestQueue({url:r});$.close=function(){c.dataQueue.close()},c.dataQueue.enqueue($)},wxrequest:function(r){if(b.isArray(r.data)&&r.data.length>0){var $=Date.now();r.data.forEach(function(r){r._flush_time=$}),r.data=JSON.stringify(r.data),b.wxrequest({url:c.para.server_url,method:"POST",dataType:"text",data:"data_list="+encodeURIComponent(b.base64Encode(r.data)),success:function(){r.success(r.len)}})}else r.success(r.len)},batchSend:function(){if(this.dataHasSend){var r=c.store.mem.mdata,$=r.length;$>0&&(this.dataHasSend=!1,this.wxrequest({data:r,len:$,success:this.batchRemove.bind(this)}))}},batchRemove:function(r){c.store.mem.clear(r),this.dataHasSend=!0,this.dataHasChange=!0,this.batchWrite()},is_first_batch_write:!0,batchWrite:function(){var r=this;this.dataHasChange&&(this.is_first_batch_write&&(this.is_first_batch_write=!1,setTimeout(function(){r.batchSend()},1e3)),this.dataHasChange=!1,a.setStorageSync("sensors_mp_prepare_data",c.store.mem.mdata))},batchInterval:function(){var r=this;!function $(){setTimeout(function(){r.batchWrite(),$()},1e3)}(),function $(){setTimeout(function(){r.batchSend(),$()},c.para.batch_send.send_timeout)}()}},c.setOpenid=function(r,$){c.store.set("openid",r),$?c.store.set("distinct_id",r):c.identify(r,!0)},c.initWithOpenid=function(r,$){(r=r||{}).appid&&(c.para.appid=r.appid),c.openid.getOpenid(function(a){a&&c.setOpenid(a,r.isCoverLogin),$&&b.isFunction($)&&$(a),c.init(r)})},b.each(["setProfile","setOnceProfile","track","register","clearAllRegister","quick"],function(r){var $=c[r];c[r]=function(){c.initialState.isComplete?$.apply(c,arguments):c.initialState.queue.push([r,arguments])}}),b.setQuery=function(r){if(r&&b.isObject(r)&&!b.isEmptyObject(r)){var $=[];return b.each(r,function(r,a){"q"===a&&b.isString(r)&&0===r.indexOf("http")||"scene"===a||$.push(a+"="+r)}),$.join("&")}return""},c.autoTrackCustom={trackCustom:function(r,$,a){var e=c.para.autoTrack[r],t="";c.para.autoTrack&&e&&("function"==typeof e?(t=e(),b.isObject(t)&&b.extend($,t)):b.isObject(e)&&(b.extend($,e),c.para.autoTrack[r]=!0),c.track(a,$))},appLaunch:function(r,$){"object"!=f(this)||this.trackCustom||(this[c.para.name]=c);var a={};r&&r.path&&(a.$url_path=b.getPath(r.path)),b.setShareInfo(r,a);var e=b.setUtm(r,a);w?(a.$is_first_time=!0,b.isEmptyObject(e.pre1)||c.setOnceProfile(e.pre1)):a.$is_first_time=!1,b.isEmptyObject(e.pre2)||c.registerApp(e.pre2),r.scene=r.scene||"\u672A\u53D6\u5230\u503C",a.$scene=b.getMPScene(r.scene),c.registerApp({$latest_scene:a.$scene}),a.$url_query=b.setQuery(r.query),$?(a=b.extend(a,$),c.track("$MPLaunch",a)):c.para.autoTrack&&c.para.autoTrack.appLaunch&&c.autoTrackCustom.trackCustom("appLaunch",a,"$MPLaunch")},appShow:function(r,$){var a={};l=new Date().getTime(),r&&r.path&&(a.$url_path=b.getPath(r.path)),b.setShareInfo(r,a);var e=b.setUtm(r,a);b.isEmptyObject(e.pre2)||c.registerApp(e.pre2),r.scene=r.scene||"\u672A\u53D6\u5230\u503C",a.$scene=b.getMPScene(r.scene),c.registerApp({$latest_scene:a.$scene}),a.$url_query=b.setQuery(r.query),$?(a=b.extend(a,$),c.track("$MPShow",a)):c.para.autoTrack&&c.para.autoTrack.appShow&&c.autoTrackCustom.trackCustom("appShow",a,"$MPShow")},appHide:function(r){var $=new Date().getTime(),a={};a.$url_path=b.getCurrentPath(),l&&$-l>0&&($-l)/36e5<24&&(a.event_duration=($-l)/1e3),r?(a=b.extend(a,r),c.track("$MPHide",a)):c.para.autoTrack&&c.para.autoTrack.appHide&&c.autoTrackCustom.trackCustom("appHide",a,"$MPHide"),c.sendStrategy.onAppHide()},pageLoad:function(r){r&&b.isObject(r)&&(this.sensors_mp_url_query=b.setQuery(r))},pageShow:function(r){var $={},a=b.getCurrentPath();$.$referrer=q,$.$url_path=a,c.status.last_referrer=q,this.sensors_mp_url_query&&($.$url_query=this.sensors_mp_url_query),r?($=b.extend($,r),c.track("$MPViewScreen",$)):c.para.onshow?c.para.onshow(c,a,this):c.para.autoTrack&&c.para.autoTrack.pageShow&&c.autoTrackCustom.trackCustom("pageShow",$,"$MPViewScreen"),q=a,c.status.referrer=a},pageShare:function(r,$){var a=r.onShareAppMessage;r.onShareAppMessage=function(){var r=a.apply(this,arguments);return c.para.autoTrack&&c.para.autoTrack.pageShare&&c.autoTrackCustom.trackCustom("pageShare",{$url_path:b.getCurrentPath(),$share_depth:b.getShareDepth()},"$MPShare"),c.para.allow_amend_share_path&&("object"!=f(r)&&((r={}).path=b.getCurrentUrl(this)),"object"!=f(r)||void 0!==r.path&&""!==r.path||(r.path=b.getCurrentUrl(this)),"object"==f(r)&&"string"==typeof r.path&&(-1===r.path.indexOf("?")?r.path=r.path+"?":"&"!==r.path.slice(-1)&&(r.path=r.path+"&")),r.path=r.path+"sampshare="+encodeURIComponent(b.getShareInfo())),r}}},c.quick=function(){var r=arguments[0],$=arguments[1],a=arguments[2],e=b.isObject(a)?a:{};"appLaunch"===r||"appShow"===r?$?c.autoTrackCustom[r]($,e):d.info("App\u7684launch\u548Cshow\uFF0C\u5728sensors.quick\u7B2C\u4E8C\u4E2A\u53C2\u6570\u5FC5\u987B\u4F20\u5165App\u7684options\u53C2\u6570"):"appHide"===r&&(e=b.isObject($)?$:{},c.autoTrackCustom[r](e))},c.App=function(r){e(r=r||{},"onLaunch","appLaunch"),e(r,"onShow","appShow"),e(r,"onHide","appHide")},c.Page=function(r){e(r,"onLoad","pageLoad"),e(r,"onShow","pageShow"),"function"==typeof r.onShareAppMessage&&c.autoTrackCustom.pageShare(r)},c.initial(),C=c;var v={},y=A,i=C;function u(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var r=arguments.length>1?arguments[1]:void 0,$=arguments.length>2?arguments[2]:void 0,e=arguments.length>3?arguments[3]:void 0;return y(e),i.setPara({}),s(r)&&r.intercept(function(r){return i.Page(r),r}),s($)&&$.intercept(function(r){return i.App(r),r}),B(i),i}function B(r){var $=r.track,e=[];r.track=function(o,a){var c=e.reduce(function(r,$){return Object.assign(r,$()||{})},{});$.call(r,o,Object.assign(a,c))},r.registerDynamicSuperProperties=function(r){e.push(r)}}function s(r){return"function"==typeof r}(v=u).default=u;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=v}else if(typeof define==="function"&&define.amd){define(function(){return v})}})();
{
"name": "@tuhu/mp-sensor",
"version": "0.0.5",
"version": "0.0.6",
"main": "lib/index.js",

@@ -19,3 +19,3 @@ "license": "MIT",

],
"gitHead": "cf4c0d07bd3517c4e7ea12c4383243f7d00a149d"
"gitHead": "734d12fd663b9cfea4fa729925849a969e27d393"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc