hina-cloud-js-sdk 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _createForOfIteratorHelper(e,t){var n,r,i,a,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return r=!(n=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return n=e.done,e},e:function(e){r=!0,i=e},f:function(){try{n||null==o.return||o.return()}finally{if(r)throw i}}};if(Array.isArray(e)||(o=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==typeof e?e:String(e)}var MAX_REFERRER_STRING_LENGTH=2e3,LIB_VERSION="3.1.1",utmTypes=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],searchTypes=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],socialTypes=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],searchKeywords={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"},cookieTestName="hinasdk_domain_test",slice=Array.prototype.slice,toString=Object.prototype.toString,nativeForEach=Array.prototype.forEach,hasOwnProperty=Object.prototype.hasOwnProperty,_window=window,location=_window.location,screen=_window.screen,localStorage$1=_window.localStorage,history=_window.history,Log=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"log",value:function(){if(!this.showLog)return!1;if(!0!==this.showLog&&"string"!==this.showLog||(arguments[0]=_.formatJsonString(arguments[0])),"object"===("undefined"==typeof console?"undefined":_typeof(console))&&console.log)try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}}]),e}(),SDKDebug=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"checkProtocolIsSame",value:function(e,t){try{if(_.URL(e).protocol!==_.URL(t).protocol)return!1}catch(e){return Log.log("The _.URL method is not supported"),!1}return!0}},{key:"checkServerUrl",value:function(){return _.check.isString(this.serverUrl)&&""!==_.trim(this.serverUrl)?!(_.check.isString(this.serverUrl)&&""!==this.serverUrl&&!this.checkProtocolIsSame(this.serverUrl,location.href)&&(Log.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。\n因为:1、https 下面发送 http 的图片请求会失败。2、http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。"),1)):(Log.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!"),!1)}},{key:"checkAjax",value:function(e){if(e===this.serverUrl)return!1;_.check.isString(e)&&""!==e&&!this.checkProtocolIsSame(e,location.href)&&Log.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为 http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。")}}]),e}(),_={},DomElementInfo=(_.MAX_REFERRER_STRING_LENGTH=MAX_REFERRER_STRING_LENGTH,_.LIB_VERSION=LIB_VERSION,_.utmTypes=utmTypes,_.searchTypes=searchTypes,_.socialTypes=socialTypes,_.searchKeywords=searchKeywords,_.each=function(e,t,n){if(null!==e)if(nativeForEach&&e.forEach===nativeForEach)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e)==={})return}else for(var a in e)if(hasOwnProperty.call(e,a)&&t.call(n,e[a],a,e)==={})return},_.map=function(e,r){var i=[];if(null!=e){if(Array.prototype.map&&e.map===Array.prototype.map)return e.map(r);_.each(e,function(e,t,n){i.push(r(e,t,n))})}return i},_.extend=function(n){return _.each(slice.call(arguments,1),function(e){for(var t in e)void 0!==e[t]&&(n[t]=e[t])}),n},_.indexOf=function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var r=0;r<e.length;r++)if(t===e[r])return r;return-1},_.trim=function(e){return e.replace(/(^[\s\uFEFF\xA0]+)|([\s\uFEFF\xA0]+$)/g,"")},_.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())+"."+((e=e.getMilliseconds())<10?"00"+e:e<100?"0"+e:e)},_.formatTimeZone=function(e,t){var n;return"number"!=typeof t?e:(n=e.getTime(),e=6e4*e.getTimezoneOffset(),new Date(n+e+36e5*t))},_.formatJsonString=function(t){try{return JSON.stringify(t,null,8)}catch(e){return JSON.stringify(t)}},_.searchObjDate=function(n,r){(_.check.isObject(n)||_.check.isArray(n))&&_.each(n,function(e,t){_.check.isObject(e)||_.check.isArray(e)?_.searchObjDate(n[t],r):_.check.isDate(e)&&(n[t]=_.formatDate(_.formatTimeZone(e,r)))})},_.paramType=function(e){return Object.prototype.toString.call(e).replace("[object ","").replace("]","")},_.check={isUndefined:function(e){return void 0===e},isObject:function(e){return"[object Object]"===toString.call(e)&&null!==e},isEmptyObject:function(e){if(_.check.isObject(e)){for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}return!1},isArray:function(e){return"[object Array]"===toString.call(e)},isString:function(e){return"[object String]"===toString.call(e)},isDate:function(e){return"[object Date]"===toString.call(e)},isNumber:function(e){return"[object Number]"===toString.call(e)},isBoolean:function(e){return"[object Boolean]"===toString.call(e)},isFunction:function(e){return!!e&&("[object Function]"===(e=Object.prototype.toString.call(e))||"[object AsyncFunction]"===e)},isJSONString:function(e){try{JSON.parse(e)}catch(e){return!1}return!0},isElement:function(e){return!(!e||1!==e.nodeType)}},_.UUID=function(){function t(){for(var e=+new Date,t=0;e===+new Date;)t++;return e.toString(16)+t.toString(16)}return function(){var e=(e=String(screen.height*screen.width))&&/\d{5,}/.test(e)?e.toString(16):String(31242*Math.random()).replace(".","").slice(0,8),e=t()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=navigator.userAgent,i=[],r=0;function a(e,t){for(var n=0,r=0;r<t.length;r++)n|=i[r]<<8*r;return e^n}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),4<=i.length&&(r=a(r,i),i=[]);return(r=0<i.length?a(r,i):r).toString(16)}()+"-"+e+"-"+t();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}}(),_.getReferrer=function(e){e=e||document.referrer;return"string"!=typeof e?"referrer exception"+String(e):"string"==typeof(e=(e=0===e.indexOf("https://www.baidu.com/")?e.split("?")[0]:e).slice(0,MAX_REFERRER_STRING_LENGTH))?e:""},_.getCookielDomain=function(e){e=e||location.hostname;var t=(e=_.check.isString(e)&&e.match(/^[a-zA-Z0-9\u4e00-\u9fa5\-\.]+$/)?e:"").split(".");if(_.check.isArray(t)&&2<=t.length&&!/^(\d+\.)+\d+$/.test(e))for(var n="."+t.splice(t.length-1,1);0<t.length;){var r,n="."+t.splice(t.length-1,1)+n;if(document.cookie=cookieTestName+"=true; path=/; domain="+n,-1!==document.cookie.indexOf(cookieTestName+"=true"))return(r=new Date).setTime(r.getTime()-1e3),document.cookie=cookieTestName+"=true; expires="+r.toGMTString()+"; path=/; SameSite=Lax; domain="+n,n}return""},_.getCurrentDomain=function(e){var t=_.getCookielDomain();return""===e||""===t?"url解析失败":t},_.hashCode=function(e){if("string"!=typeof e)return 0;var t=0;if(0!==e.length)for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t},_.base64Decode=function(e){var t=[];try{t=_.map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(e){t=[]}try{return decodeURIComponent(t.join(""))}catch(e){return t.join("")}},_.base64Encode=function(t){var n="";try{n=btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(e){n=t}return n},_.decodeURIComponent=function(t){var n="";try{n=decodeURIComponent(t)}catch(e){n=t}return n},_.encodeURIComponent=function(t){var n="";try{n=encodeURIComponent(t)}catch(e){n=t}return n},_.cookie={get:function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return _.decodeURIComponent(i.substring(t.length,i.length))}return null},set:function(e,t,n,r,i,a,o){var s="",c="",l="";function u(e){return!!e&&e.replace(/\r\n/g,"")}0!==(n=null==n?73e3:n)&&(h=new Date,"s"===String(n).slice(-1)?h.setTime(h.getTime()+1e3*Number(String(n).slice(0,-1))):h.setTime(h.getTime()+24*n*60*60*1e3),s="; expires="+h.toGMTString()),_.check.isString(i)&&""!==i&&(l="; SameSite="+i),a&&(c="; secure");var n="",h="",i="";e&&(n=u(e)),h=t&&_.check.isString(t)?u(t):t,o&&(i=u(o)),n&&h&&(document.cookie=n+"="+encodeURIComponent(h)+s+"; path=/"+i+l+c)},remove:function(e,t){this.set(e,"1",-1,t)},isSupport:function(e,t){e=e||"cookie_support_test",t=t||"1";var n=this;return navigator.cookieEnabled&&(n.set(e,t),n.get(e)===t)&&(n.remove(e),!0)}},_.localStorage={get:function(e){return localStorage$1.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_.localStorage.get(e))||null}catch(e){Log.log("parse localStorage failed")}return t},set:function(e,t){try{localStorage$1.setItem(e,t)}catch(e){Log.log("localStorage is not support")}},remove:function(e){localStorage$1.removeItem(e)},isSupport:function(){var t=!0;try{var e="__localStorageSupport__",n="testIsSupportStorage";_.localStorage.set(e,n),_.localStorage.get(e)!==n&&(t=!1),_.localStorage.remove(e)}catch(e){t=!1}return t},key:function(e){localStorage$1.key(e)},length:localStorage$1.length},_.memory={data:{},get:function(e){e=this.data[e];return _.check.isUndefined(e)?null:_.check.isUndefined(e.expireTime)?e:e.expireTime<_.now()?null:e.value},set:function(e,t,n){var r;n&&(r=_.now(),r="s"===String(n).slice(-1)?r+1e3*Number(String(n).slice(0,-1)):r+24*n*60*60*1e3,this.data[e]={value:t,expireTime:r}),this.data[e]=t}},_.now=function(){return Date.now&&_.check.isFunction(Date.now)?Date.now():(new Date).getTime()},_.getRandom=function(){return(new Date).getTime()+"_"+Math.floor(1e6*Math.random())},_.safeJSONParse=function(t){var e=null;try{e=JSON.parse(t)}catch(e){return t}return e},_.saveObjectVal=function(e,t,n){_.check.isString(t)||(t=JSON.stringify(t)),_.localStorage.set(e,t)},_.readObjectVal=function(e,t){e=_.localStorage.get(e);return e?_.safeJSONParse(e):null},_.stripEmptyProperties=function(e){var n={};return _.each(e,function(e,t){_.check.isString(e)&&0<e.length&&(n[t]=e)}),n},_.info={os:function(){var e=navigator.userAgent;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)&&!window.MSStream?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},browser:function(){var e={type:"",version:""};try{var t,n,r=navigator.userAgent.toLowerCase(),i=[];null!==r.match(/baidubrowser/)?(e.type="baidu",i.push(/baidubrowser\/([\d.]+)/)):null!==r.match(/bidubrowser/)?(e.type="baidu",i.push(/bidubrowser\/([\d.]+)/)):null!==r.match(/edga/)?(e.type="edge",i.push(/edga\/([\d.]+)/)):null!==r.match(/edgios/)?(e.type="edge",i.push(/edgios\/([\d.]+)/)):null!==r.match(/liebaofast/)?(e.type="liebao",i.push(/liebaofast\/([\d.]+)/)):null!==r.match(/sogoumobilebrowser/)?(e.type="sogou",i.push(/sogoumobilebrowser\/([\d.]+)/)):null!==r.match(/lbbrowser/)?(e.type="liebao",i.push(/lbbrowser\/([\d.]+)/)):null!==r.match(/crios/)?(e.type="chrome",i.push(/crios\/([\d.]+)/)):null!==r.match(/qihoobrowser/)?(e.type="360",i.push(/qihoobrowser\/([\d.]+)/)):null!==r.match(/mxios/)?(e.type="maxthon",i.push(/mxios\/([\d.]+)/)):null!==r.match(/fxios/)?(e.type="firefox",i.push(/fxios\/([\d.\w]+)/)):null!==r.match(/edge/)?(e.type="edge",i.push(/edge\/([\d.]+)/)):null!==r.match(/metasr/)?(e.type="sogou",i.push(/metasr ([\d.]+)/)):null!==r.match(/micromessenger/)?(e.type="micromessenger",i.push(/micromessenger\/([\d.]+)/)):null!==r.match(/mqqbrowser/)?(e.type="qq",i.push(/mqqbrowser\/([\d.]+)/)):null!==r.match(/qqbrowserlite/)?(e.type="qq",i.push(/qqbrowserlite\/([\d.]+)/)):null!==r.match(/tencenttraveler/)?(e.type="qq",i.push(/tencenttraveler\/([\d.]+)/)):null!==r.match(/qqbrowser/)?(e.type="qq",i.push(/qqbrowser\/([\d.]+)/)):null!==r.match(/maxthon/)?(e.type="maxthon",i.push(/maxthon\/([\d.]+)/)):null!==r.match(/ubrowser/)?(e.type="uc",i.push(/ubrowser\/([\d.]+)/)):null!==r.match(/ucbrowser/)?(e.type="uc",i.push(/ucbrowser\/([\d.]+)/)):null!==r.match(/firefox/)?(e.type="firefox",i.push(/firefox\/([\d.]+)/)):null!==r.match(/opera/)?(e.type="opera",i.push(/opera\/([\d.]+)/)):null!==r.match(/opr/)?(e.type="opera",i.push(/opr\/([\d.]+)/)):null!==r.match(/chrome/)?(e.type="chrome",i.push(/chrome\/([\d.]+)/)):null!==r.match(/safari/)?(e.type="safari",i.push(/version\/([\d.]+)/)):null===r.match(/trident/)&&null===r.match(/msie/)||(e.type="ie"),"ie"===e.type?(t=r.match(/trident\/([\d.]+)/)?r.match(/trident\/([\d.]+)/)[1]:"",n=r.match(/msie ([\d.]+)/)?r.match(/msie ([\d.]+)/)[1]:"",""!==t?e.version=String(parseInt(t)+4):""!==n&&(e.version=n)):i&&(e.version=r.match(i[0])?r.match(i[0])[1]:"")}catch(e){Log.w("getting browser info failed due to ",e)}return e},properties:function(){var e=_.info.browser();return _.extend({H_os:_.info.os(),H_lib_version:LIB_VERSION,H_lib:"js",H_screen_height:Number(screen.height)||0,H_screen_width:Number(screen.width)||0,H_browser:e.type,H_browser_version:e.version,H_system_language:_.check.isString(navigator.languages[1])?navigator.languages[1].toLowerCase():"取值异常"})},pageProperties:function(){var e=_.getReferrer(),t=_.getCurrentDomain(location.href);return _.stripEmptyProperties({H_referrer:e,H_referrer_host:e?_.getHostname(e):"",H_url:location.href,H_url_host:_.getHostname(location.url,"url_host取值异常"),H_url_domain:t,H_url_path:location.pathname,H_title:document.title})},getElementInfo:function(e,t){var n;return _.check.isElement(e)?(e={H_element_type:n=e.tagName.toLowerCase(),H_element_name:e.getAttribute("name"),H_element_id:e.getAttribute("id"),H_element_target_url:e.getAttribute("href"),H_element_class_name:_.check.isString(e.className)?e.className:null,H_element_content:_.getElementContent(e,n,t)},_.stripEmptyProperties(e)):{}}},_.getElementContent=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return"input"===t?(["button","submit"].includes(e.type)||n)&&e.value||"":(n="",e.textContent?n=_.trim(e.textContent):e.innerText&&(n=_.trim(e.innerText)),(n=n&&n.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))||"")},_.getHostname=function(e,t){if(t&&"string"==typeof t||(t="hostname解析异常"),!e)return t;var n=null;try{n=_.URL(e).hostname}catch(e){Log.log("getHostname传入的url参数不合法!")}return n||t},_.isReferralTraffic=function(e){return""===(e=e||document.referrer)||_.getCookielDomain(_.getHostname(e))!==_.getCookielDomain()},_.getUtm=function(){var n={};return _.each(utmTypes,function(e){var t=_.getQueryParam(location.href,e);t.length&&(n[e]=t)}),n},_.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=_.decodeURIComponent(e);t=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===t||t&&"string"!=typeof t[1]&&t[1].length?"":_.decodeURIComponent(t[1])},function(){function t(e){_classCallCheck(this,t),this.ele=e}return _createClass(t,[{key:"addClass",value:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this}},{key:"removeClass",value:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this}},{key:"hasClass",value:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")}},{key:"attr",value:function(e,t){return"string"==typeof e&&_.check.isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)}},{key:"offset",value:function(){var e,t=this.ele.getBoundingClientRect();return t.width||t.height?(e=this.ele.ownerDocument.documentElement,{top:t.top+window.pageYOffset-e.clientTop,left:t.left+window.pageXOffset-e.clientLeft}):{top:0,left:0}}},{key:"getSize",value: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(e){return{width:0,height:0}}}},{key:"getStyle",value:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)}},{key:"wrap",value:function(e){e=document.createElement(e);return this.ele.parentNode.insertBefore(e,this.ele),e.appendChild(this.ele),_.getDomElementInfo(e)}},{key:"getCssStyle",value:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var n=null;if(!(n="function"==typeof window.getMatchedCSSRules?window.getMatchedCSSRules(this.ele):n)||!_.check.isArray(n))return null;for(var r=n.length-1;0<=r;r--)if(t=n[r].style.getPropertyValue(e))return t}},{key:"sibling",value:function(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}},{key:"next",value:function(){return this.sibling(this.ele,"nextSibling")}},{key:"prev",value:function(){return this.sibling(this.ele,"previousSibling")}},{key:"siblingsFn",value:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}},{key:"siblings",value:function(){return this.siblingsFn((this.ele.parentNode||{}).firstChild,this.ele)}},{key:"children",value:function(){return this.siblingsFn(this.ele.firstChild)}},{key:"parent",value:function(){var e;return e=(e=this.ele.parentNode)&&11!==e.nodeType?e:null,_.getDomElementInfo(e)}},{key:"previousElementSibling",value:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return _.getDomElementInfo(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return _.getDomElementInfo(e);return _.getDomElementInfo(null)}},{key:"getSameTypeSiblings",value:function(){for(var e=this.ele,t=e.parentNode,n=e.tagName.toLowerCase(),r=[],i=0;i<t.children.length;i++){var a=t.children[i];1===a.nodeType&&a.tagName.toLowerCase()===n&&r.push(t.children[i])}return r}},{key:"getParents",value:function(){try{var e=this.ele;if(!_.check.isElement(e))return[];var t=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,t.push(e);return t}catch(e){return[]}}}]),t}()),SearchKeyword=(_.getDomElementInfo=function(e){return new DomElementInfo(e)},_.addEvent=function(e,t,n,l){function u(e){return e&&(e.preventDefault=u.preventDefault,e.stopPropagation=u.stopPropagation,e._getPath=u._getPath),e}u._getPath=function(){return this.path||_.getDomElementInfo(this.target).getParents()},u.preventDefault=function(){this.returnValue=!1},u.stopPropagation=function(){this.cancelBubble=!0};!function(e,t,n){var r,i,a,o,s,c;void 0===l&&"click"===t&&(l=!0),e&&e.addEventListener?e.addEventListener(t,function(e){e._getPath=u._getPath,n.call(this,e)},l):(i=e[r="on"+t],e[r]=(a=e,o=n,s=i,c=t,function(e){var t,n;if(e=e||u(window.event))return e.target=e.srcElement,t=!0,"function"==typeof s&&(n=s(e)),e=o.call(a,e),"beforeunload"!==c?!1!==n&&!1!==e&&t:void 0}))}.apply(null,arguments)},_.addCaptureEvent=function(e,t,n){return this.addEvent(e,t,n,"click"===t)},_.hasCircularReference=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Set;if("object"===_typeof(e)&&null!==e){if(t.has(e))return!0;for(var n in t.add(e),e)if(_.hasCircularReference(e[n],t))return!0;t.delete(e)}return!1},_.parseSuperProperties=function(e){var n=e.properties||{},r=JSON.parse(JSON.stringify(e));_.check.isObject(n)&&_.each(n,function(e,t){if(_.check.isFunction(e))try{n[t]=e(r),_.check.isFunction(n[t])&&(Log.log("属性--"+t+" 格式不满足要求, 已被删除"),delete n[t])}catch(e){delete n[t],Log.log("属性--"+t+" 格式不满足要求, 已被删除")}})},_.getURLSearchParams=function(e){for(var t={},n=(e=e||"").substring(1).split("&"),r=0;r<n.length;r++){var i,a=n[r].indexOf("=");-1!==a&&(i=n[r].substring(0,a),a=n[r].substring(a+1),i=_.decodeURIComponent(i),a=_.decodeURIComponent(a),t[i]=a)}return t},_.urlParse=function(e){function t(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)}return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!==_typeof(e))return!1;var t,n=this._values.QueryString||"";for(t in e)n=new RegExp(t+"[^&]+").test(n)?n.replace(new RegExp(t+"[^&]+"),t+"="+e[t]):"&"===n.slice(-1)?n+t+"="+e[t]:""===n?t+"="+e[t]:n+"&"+t+"="+e[t];this._values.QueryString=n},t.prototype.getUrl=function(){var e="";return(e+=this._values.Origin)+(this._values.Port?":"+this._values.Port:"")+this._values.Path+(this._values.QueryString?"?"+this._values.QueryString:"")+(this._values.Fragment?"#"+this._values.Fragment:"")},t.prototype._parse=function(e){this._initValues();this._regex.exec(e)||Log.i("URLParser::_parse -> Invalid URL");var t,e=e.split("#"),n=e[0],e=e.slice(1).join("#"),r=this._regex.exec(n);for(t in this._fields)void 0!==r[this._fields[t]]&&(this._values[t]=r[this._fields[t]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=e},new t(e)},_.URL=function(e){var t,n,r={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(n=_.getURLSearchParams(r.search),{get:function(e){return n[e]}}));else{_.check.isString(e)||(e=String(e)),e=_.trim(e);if(!1===/^https?:\/\/.+/.test(e))return void Log.w("Invalid URL");e=_.urlParse(e);r.hash=e._values.Fragment,r.host=e._values.Host?e._values.Host+(e._values.Port?":"+e._values.Port:""):"",r.href=e._values.URL,r.password=e._values.Password,r.pathname=e._values.Path,r.port=e._values.Port,r.search=e._values.QueryString?"?"+e._values.QueryString:"",r.username=e._values.Username,r.hostname=e._values.Hostname,r.protocol=e._values.Protocol?e._values.Protocol+":":"",r.origin=e._values.Origin?e._values.Origin+(e._values.Port?":"+e._values.Port:""):"",r.searchParams=(t=_.getURLSearchParams("?"+e._values.QueryString),{get:function(e){return t[e]}})}return r},function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"getSourceFromReferrer",value:function(){function e(e,t){for(var n=0;n<e.length;n++)if(-1!==t.split("?")[0].indexOf(e[n]))return 1}var t="("+utmTypes.join("|")+")\\=[^&]+",n=document.referrer||"",r=location.href;return r?(r=r.match(new RegExp(t)))&&r[0]?"付费广告流量":e(searchTypes,n)?"自然搜索流量":e(socialTypes,n)?"社交网站流量":""===n?"直接流量":"引荐流量":"获取url异常"}},{key:"getReferSearchEngine",value:function(e){var t=_.getHostname(e);if(!t||"hostname解析异常"===t)return"";var n,r,i={baidu:[/^.*\.baidu\.com$/],bing:[/^.*\.bing\.com$/],google:[/^www\.google\.com$/,/^www\.google\.com\.[a-z]{2}$/,/^www\.google\.[a-z]{2}$/],sm:[/^m\.sm\.cn$/],so:[/^.+\.so\.com$/],sogou:[/^.*\.sogou\.com$/],yahoo:[/^.*\.yahoo\.com$/]},a={};for(n in i)a[n]=i[n].map(function(e){return new RegExp(e)});for(r in a){var o,s=_createForOfIteratorHelper(a[r]);try{for(s.s();!(o=s.n()).done;)if(o.value.test(t))return r}catch(e){s.e(e)}finally{s.f()}}return"未知搜索引擎"}},{key:"getKeywordFromReferrer",value:function(e,t){if(e=e||document.referrer,document&&_.check.isString(e)){if(0!==e.indexOf("http"))return""===e?"未取到值_直接打开":"未取到值_非http的url";var n=this.getReferSearchEngine(e),r=_.getURLSearchParams(e);if(!_.check.isEmptyObject(r)){var i,a;for(a in searchKeywords)if(n===a&&_.check.isObject(r))if(i=searchKeywords[a],_.check.isArray(i))for(a=0;a<i.length;a++){var o=r[i[a]];if(o)return t?{active:o}:o}else if(r[i])return t?{active:r[i]}:r[i]}return"未取到值"}return"取值异常_referrer异常_"+String(e)}}]),e}());function isVaildFunction(e){return!!_.check.isFunction(e)||!(!e||!_.check.isObject(e))&&isVaildFunction(e.callback)}var EventEmitter=function(){function e(){return _classCallCheck(this,e),e.instance||((e.instance=this).events={}),e.instance}return _createClass(e,[{key:"on",value:function(e,t){if(!e||!t)return!1;if(isVaildFunction(t))return this.events[e]=this.events[e]||[],_.check.isObject(t)?this.events[e].push(t):this.events[e].push({callback:t,once:!1}),this;throw new Error("callback must be a fcuntion")}},{key:"prepend",value:function(e,t){if(!e||!t)return!1;if(isVaildFunction(t))return this.events[e]=this.events[e]||[],_.check.isObject(t)?this.events[e].unshift(t):this.events[e].unshift({callback:t,once:!1}),this;throw new Error("callback must be a fcuntion")}},{key:"prependOnce",value:function(e,t){return this.prepend(e,{callback:t,once:!0})}},{key:"once",value:function(e,t){return this.on(e,{callback:t,once:!0})}},{key:"off",value:function(e,t){var n=this.events[e];if(!n)return!1;if(_.check.isNumber(t))n.splice(t,1);else if(_.check.isFunction(t))for(var r=0;r<n.length;r++)n[r]&&n[r].callback===t&&n.splice(r,1);return this}},{key:"emit",value:function(e,t){var n=this.events[e];if(!n)return!1;var r,i=_createForOfIteratorHelper(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;_.check.isObject(a)&&(a.callback.call(this,t||{}),a.once)&&this.off(e,a.callback)}}catch(e){i.e(e)}finally{i.f()}return this}},{key:"clear",value:function(e){e&&this.events(e)?this.events[e]=[]:this.events={}}},{key:"getEvent",value:function(e){return e&&this.events[e]?this.events[e]:this.events}}]),e}();function xhr(){return void 0!==window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:void 0!==window.XDomainRequest?new window.XDomainRequest:null}function ajax(e){SDKDebug.checkAjax(e.url),e.timeout=e.timeout||2e4;var t=xhr();if(!t)return!1;function n(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];i&&(clearTimeout(i),i=null,e)&&(t.onreadystatechange=null,t.onload=null,t.onerror=null)}function r(e){return e?_.safeJSONParse(e):""}var i,a=(e=_.extend({success:function(){},error:function(){}},e)).success,o=e.error;e.success=function(e){a(e),n()},e.error=function(e){o(e),n()},i=setTimeout(function(){try{t&&_.check.isObject(t)&&t.abort&&t.abort()}catch(e){Log.log(e)}n(!0)},e.timeout);"undefined"!=typeof XDomainRequest&&t instanceof window.XDomainRequest&&(t.onload=function(){e.success&&e.success(r(t.responseText)),t.onreadystatechange=null,t.onload=null,t.onerror=null},t.onerror=function(){e.error&&e.error(r(t.responseText),t.status),t.onreadystatechange=null,t.onerror=null,t.onload=null}),t.open("post",e.url,!0),e.credentials&&(t.withCredentials=!0),t.setRequestHeader&&t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onreadystatechange=function(){try{4===t.readyState&&(200<=t.status&&t.status<300||304===t.status?e.success(r(t.responseText)):e.error(r(t.responseText),t.status),t.onreadystatechange=null,t.onload=null)}catch(e){t.onreadystatechange=null,t.onload=null}},t.send(e.data||null)}_.mitt=new EventEmitter,_.initUrlChange=function(){var e=location.href,t=history.pushState,n=history.replaceState,r=(_.check.isFunction(t)&&(history.pushState=function(){t.apply(history,arguments),_.mitt.emit("urlChange",e),e=location.href}),_.check.isFunction(n)&&(history.replaceState=function(){n.apply(history,arguments),_.mitt.emit("urlChange",e),e=location.href}),t?"popstate":"hashchange");_.addEvent(window,r,function(){_.mitt.emit("urlChange",e),e=location.href})};var AjaxSend=function(){function t(e){_classCallCheck(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data,this.dataSendTimeout=e.dataSendTimeout}return _createClass(t,[{key:"run",value:function(){ajax({url:this.serverUrl,data:this.data,timeout:this.dataSendTimeout,success:this.cb,error:this.cb})}},{key:"cb",value:function(){this.callback&&(_.check.isFunction(this.callback)?this.callback():Log.log("sdk callback is not a function"))}}]),t}(),ImageSend=function(){function t(e){_classCallCheck(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data,this.dataSendTimeout=e.dataSendTimeout,this.img=document.createElement("img"),this.img.width=1,this.img.height=1,e.imgUseCrossOrigin&&(this.img.crossOrigin="anonymous")}return _createClass(t,[{key:"run",value:function(){function e(){t.img&&!t.img.complete&&(t.img.complete=!0,t.cb)&&t.cb()}var t=this;this.img.onload=function(){this.onload=null,e()},this.img.onerror=function(){this.onerror=null,e()},this.img.onabort=function(){this.onabort=null,e()},-1!==this.serverUrl.indexOf("?")?this.img.src=this.serverUrl+"&"+this.data:this.img.src=this.serverUrl+"?"+this.data}},{key:"cb",value:function(){var t=this;if(this.callback){if(!_.check.isFunction(this.callback))return void Log.log("sdk callback is not a function");this.callback()}setTimeout(function(){var e=_.info.browser().type;t.img.src="ie"===e?"about:blank":""},this.dataSendTimeout)}}]),t}(),BeaconSend=function(){function t(e){_classCallCheck(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data}return _createClass(t,[{key:"run",value:function(){var e,t=this;_.check.isObject(navigator)&&_.check.isFunction(navigator.sendBeacon)&&((e=new FormData).append("data",_.base64Encode(this.data)),navigator.sendBeacon(this.serverUrl,e)),setTimeout(function(){t.cb()})}},{key:"cb",value:function(){this.callback&&(_.check.isFunction(this.callback)?this.callback():Log.log("sdk callback is not a function"))}}]),t}(),dataStoragePrefix="hinasdk_data_",tabStoragePrefix="hinasdk_tab",BatchSend=function(){function t(e){_classCallCheck(this,t),this.timer=null,this.sendTimeStamp=0,this.batchConfig=_.extend({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},e.batchSend),this.tabKey=tabStoragePrefix,this.config=e}return _createClass(t,[{key:"batchInterval",value:function(){var e=this;SDKDebug.checkServerUrl(this.config.serverUrl)&&(this.timer=setTimeout(function(){e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},this.batchConfig.sendInterval))}},{key:"request",value:function(e,t){var n=this;ajax({url:this.config.serverUrl,data:"data_list="+encodeURIComponent(_.base64Encode(JSON.stringify(e))),timeout:this.batchConfig.dataSendTimeout,success:function(){n.remove(t),n.sendTimeStamp=0},error:function(){n.sendTimeStamp=0}})}},{key:"send",value:function(){if(!(this.sendTimeStamp&&_.now()-this.sendTimeStamp<this.batchConfig.dataSendTimeout)){var e=_.localStorage.get(this.tabKey);if(e){this.sendTimeStamp=_.now();var t=_.safeJSONParse(e)||[];if(t.length){for(var n=[],r=[],i=t.length<this.batchConfig.storageLimit?t.length:this.batchConfig.storageLimit,a=0;a<i;a++){var o=_.readObjectVal(t[a].dataKey);r.push(t[a].dataKey),n.push(o)}this.request(n,r)}}}}},{key:"remove",value:function(e){var t=_.localStorage.get(this.tabKey);if(t){for(var n,r=null==(n=_.safeJSONParse(t)||[])?void 0:n.map(function(e){return e.dataKey}),i=0;i<e.length;i++){var a=_.indexOf(r,e[i]);-1<a&&t.splice(a,1),_.localStorage.remove(e[i])}_.localStorage.set(this.tabKey,JSON.stringify(t))}}},{key:"add",value:function(e){var t=dataStoragePrefix+_.getRandom(),n=null!=(n=_.localStorage.get(this.tabKey))&&_.safeJSONParse(n)||[];if((n=_.check.isString(n)?_.safeJSONParse(n)||[]:n).push({dataKey:t,expireTime:_.now()+2*this.batchConfig.sendInterval}),_.localStorage.set(this.tabKey,JSON.stringify(n)),_.saveObjectVal(t,e),n.length>this.batchConfig.storageLimit){for(var r=n.slice(0,20),i=[],a=0;a<r.length;a++){var o=_.readObjectVal(r[a].dataKey);i.push(o)}this.request(i,r)}"track_signup"!==e.type&&"H_pageview"!==e.event||this.send()}},{key:"recycle",value:function(){var e=_.localStorage.get(this.tabKey);if(e){var t=_.safeJSONParse(e)||[];if(t.length){for(var n=[],r=0;r<t.length;r++)_.now()>t[r].expireTime&&n.push(t[r].dataKey);this.remove(n)}else{for(var i=0;i<localStorage.length;i++){var a=_.localStorage.key(i);0===a.indexOf(dataStoragePrefix)&&t.push({dataKey:a,expireTime:_.now()+2*this.batchConfig.sendInterval})}0<t.length&&_.localStorage.set(this.tabKey,JSON.stringify(t))}}}}]),t}();function checkIsNewUser(){return _.cookie.isSupport()?null!=_.cookie.get("hinasdk_isNewUser"):null!=_.memory.get("hinasdk_isNewUser")}var HinaDataStore={name:"hinasdk_crossdata",state:{deviceId:null,accountId:null,firstId:null,firstVisitTime:_.now(),props:{}},isFirstTime:!1,isFirstDay:checkIsNewUser(),isFirstVisit:!0,load:function(){var e,t,n=null;_.cookie.isSupport()?this.storage=_.cookie:(Log.log("Cookie storage is not supported, SDK internal cache has been enabled"),this.storage=_.memory),(n=n||this.storage.get(this.name))&&_.check.isJSONString(n)&&(this.state=_.extend({},JSON.parse(n))),n?(this.save(),this.isFirstVisit=!1):this.isFirstVisit=!0,this.isFirstVisit?(t=23-(n=new Date).getHours(),e=59-n.getMinutes(),n=59-n.getSeconds(),this.storage.set("hinasdk_isNewUser",!0,3600*t+60*e+n+"s"),this.isFirstDay=!0,this.isFirstTime=!0):this.checkIsFirstTime=function(e){"track"===e.type&&"H_pageview"===e.event&&(e.properties.H_is_first_time=!1)},this.getAccountId()||(t=_.UUID(),this.setDeviceId(t),this.setAccountId(t))},checkIsFirstTime:function(e){"track"===e.type&&"H_pageview"===e.event&&(checkIsNewUser()&&this.isFirstTime?(e.properties.H_is_first_time=!0,this.isFirstTime=!1):e.properties.H_is_first_time=!1)},checkIsFirstSign:function(e){"track"===e.type&&(checkIsNewUser()&&this.isFirstDay?e.properties.H_is_first_day=!0:(this.isFirstDay=!1,e.properties.H_is_first_day=!1))},setDeviceId:function(e){this.state.deviceId?Log.log("Current deviceId is "+this.getDeviceId()+", it has been set"):this.set("deviceId",e)},setAccountId:function(e){this.set("accountId",e)},getDeviceId:function(){return this.state.deviceId},getAccountId:function(){return this.state.__accountId||this.state.accountId},getFirstId:function(){return this.state.__firstId||this.state.firstId},getAnonymousId:function(){var e=this.getAccountId(),t=this.getFirstId();return e&&t?t:e},change:function(e,t){this.state["__"+e]=t},set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length?arguments[1]:void 0;this.state=this.state||{},-1<["accountId","firstId"].indexOf(e)&&delete this.state["__"+e],this.state[e]=t,this.save()},save:function(){this.storage.set(this.name,JSON.stringify(this.state),null,!0)},clear:function(){this.state={},this.save()}},pageInfo={pageProp:{},currentProps:{},register:function(e){_.extend(pageInfo.currentProps,e)},getPresetProperties:function(){var e=window.innerHeight||document.documentElement.clientHeight||document.body&&document.body.clientHeight||0,t=window.innerWidth||document.documentElement.clientWidth||document.body&&document.body.clientWidth||0,e={H_timezone_offset:(new Date).getTimezoneOffset(),H_viewport_height:e,H_viewport_width:t};return _.extend(e,_.info.properties()),e},getPageProperties:function(){return _.extend(this.pageProp,_.info.pageProperties()),this.pageProp},getUmtsParams:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",e=_.getUtm(),a={},o={};return _.each(e,function(e,t,n){_.utmTypes.includes(t)?a[r+t]=n[t]:o[i+t]=n[t]}),{allUtms:a,otherUtms:o}}};function initLatestProps(e){var t,n={};_.each(e.presetProperties,function(e,t){if(-1===t.indexOf("latest_"))return!1;if(t=t.slice(7),e){e=_.getCurrentDomain(window.location.href);if("utm"!==t&&"url解析失败"===e)n["H_latest_"+t]="url的domain解析失败";else if(_.isReferralTraffic(document.referrer))switch(t){case"traffic_source_type":n.H_latest_traffic_source_type=SearchKeyword.getSourceFromReferrer();break;case"referrer":n.H_latest_referrer=pageInfo.pageProp.referrer;break;case"search_keyword":SearchKeyword.getKeywordFromReferrer()&&(n.H_latest_search_keyword=SearchKeyword.getKeywordFromReferrer())}}}),e.presetProperties.latest_utm&&(t=(e=pageInfo.getUmtsParams("H_latest_","_latest_")).allUtms,e=e.otherUtms,_.check.isEmptyObject(t)||_.extend(n,t),_.check.isEmptyObject(e)||_.extend(n,e)),pageInfo.register(n)}function getPresetProperties(){var e=pageInfo.getUmtsParams("H_",""),t=e.allUtms,e=e.otherUtms,n={H_is_first_day:HinaDataStore.isFirstDay,H_is_first_time:HinaDataStore.isFirstTime,device_id:HinaDataStore.getDeviceId(),anonymous_id:HinaDataStore.getAnonymousId(),account_id:HinaDataStore.getAccountId(),properties:_objectSpread2({},HinaDataStore.state.props)};return _.extend(n.properties,t,e,pageInfo.getPresetProperties(),pageInfo.getPageProperties()),n}function sendFirstProfile(e,t,n){HinaDataStore.isFirstVisit&&(t=_.getReferrer(null,t),e.call(n,_.extend({H_first_visit_time:_.now(),H_first_referrer:t,H_first_host:t?_.getHostname(t,"取值异常"):"",H_first_browser_language:_.check.isString(navigator.languages[1])?navigator.languages[1].toLowerCase():"取值异常",H_first_traffic_source_type:SearchKeyword.getSourceFromReferrer(),H_first_search_keyword:SearchKeyword.getKeywordFromReferrer()})),HinaDataStore.isFirstVisit=!1)}function addProps(e,t){var t=t.config||{},n=pageInfo.getUmtsParams("H_",""),r=n.allUtms,n=n.otherUtms,i={anonymous_id:HinaDataStore.getAnonymousId(),properties:_objectSpread2({H_lib:"js",H_lib_version:_.LIB_VERSION,H_lib_method:"code"},HinaDataStore.state.props),type:e.type,event:e.event,time:_.now(),_track_id:Number(String(_.getRandom()).slice(2,5)+String(_.getRandom()).slice(2,4)+String(_.now()).slice(-4))};return HinaDataStore.getAccountId()&&(i.account_id=HinaDataStore.getAccountId()),t.isTrackDeviceId&&(i.device_id=HinaDataStore.getDeviceId()),e.type&&"user"===e.type.slice(0,4)?i.properties=_.extend(i.properties,e.properties):i.properties=_.extend(i.properties,r,n,pageInfo.currentProps,pageInfo.getPageProperties(),pageInfo.getPresetProperties(),e.properties),_.parseSuperProperties(i),HinaDataStore.checkIsFirstSign(i),HinaDataStore.checkIsFirstTime(i),i}var _window$1=window,location$1=_window$1.location,ignoreTags=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],defaultTags=["a","div","input","button","textarea"],AutoTrack=function(){function r(e,t,n){_classCallCheck(this,r),this.autoTrackIsUsed=!1,this.otherTag=[],this.isTrackList={a:!0,button:!0},this.autoTrackConfig=_.extend({clickAutoTrack:!0,stayAutoTrack:!0,isCollectUrl:function(){return!0},isCollectElement:function(){return!0},isCollectInput:function(){return!1},addCustomProperty:function(){},stayDelayTime:4e3,maxStayPageDuration:18e3,collectTags:{div:!1},trackAttr:[]},e),this.stayAutoTrackConfig=_.extend({isCollectUrl:function(){return!0}},t),this.ctx=n,this.load(e)}return _createClass(r,[{key:"load",value:function(e){var n=this;_.check.isArray(e.trackAttr)?(this.autoTrackConfig.trackAttr=e.trackAttr.filter(function(e){return _.check.isString(e)}),this.autoTrackConfig.trackAttr.push("hn-click")):this.autoTrackConfig.trackAttr=["hn-click"],_.check.isObject(e.collectTags)?(!0===e.collectTags.div?this.autoTrackConfig.collectTags.div={ignoreTags:ignoreTags,maxLevel:1}:_.check.isObject(e.collectTags.div)?(this.autoTrackConfig.collectTags.div.ignoreTags=ignoreTags,_.check.isNumber(e.collectTags.div.maxLevel)&&[1,2,3].includes(e.collectTags.div.maxLevel)||(this.autoTrackConfig.collectTags.div.maxLevel=1)):this.autoTrackConfig.collectTags.div=!1,_.each(e.collectTags,function(e,t){"div"!==t&&e&&n.otherTag.push(t)}),!0===this.autoTrackConfig.clickAutoTrack&&_.each(this.otherTag,function(e){e in n.isTrackList&&(n.isTrackList[e]=!0)})):this.autoTrackConfig.collectTags={div:!1}}},{key:"autoTrack",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0;this.ctx.track("H_pageview",_.extend({H_referrer:_.getReferrer(null,!0),H_url:location$1.href,H_url_path:location$1.pathname,H_title:document.title},e),t),sendFirstProfile(this.ctx.userSetOnce,!0,this.ctx),this.autoTrackIsUsed=!0}},{key:"autoTrackSinglePage",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=this.autoTrackIsUsed?location$1.href:_.getReferrer();this.ctx.track("H_pageview",_.extend({H_referrer:n,url:location$1.href,H_url_path:location$1.pathname,H_title:document.title},e),t),sendFirstProfile(this.ctx.userSetOnce,!1,this.ctx)}},{key:"listenSinglePage",value:function(){var r=this,i=this.ctx.getConfig("isSinglePage");i&&_.mitt.on("hasInit",function(){r.onUrlChange(function(t){function e(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};t!==location$1.href&&(pageInfo.pageProp.H_referrer=t,e=_.extend({H_url:location$1.href,H_referrer:t},e),r.autoTrack(e))}var n;_.check.isBoolean(i)?e():_.check.isFunction(i)&&(n=i(),_.check.isObject(n)?e(n):!0===n&&e())})})}},{key:"initWebClick",value:function(){var n,r=this;!0===this.autoTrackConfig.clickAutoTrack&&(n=!0,_.check.isFunction(this.autoTrackConfig.isCollectUrl)&&this.onUrlChange(function(){n=!!r.autoTrackConfig.isCollectUrl()}),_.addCaptureEvent(document,"click",function(e){var t;n&&(e=e||window.event)&&(t=e.target||e.srcElement,t=r.getTargetElement(t,e))&&r.emitClick(e,t)}))}},{key:"emitClick",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length?arguments[3]:void 0;if(_.check.isFunction(this.autoTrackConfig.isCollectElement)&&!this.autoTrackConfig.isCollectElement(t))return!1;var i,a=this.getClickElementInfo(t);_.check.isFunction(this.autoTrackConfig.addCustomProperty)&&(i=this.autoTrackConfig.addCustomProperty(t),_.check.isObject(i))&&(a=_.extend(a,i)),a=_.extend(a,this.getPageXYInfo(e,t),n),this.ctx.track("H_WebClick",a,r)}},{key:"initWebStay",value:function(){var e,o,s,c,t,r,n=this;!0===this.autoTrackConfig.stayAutoTrack&&(e=!0,_.check.isFunction(this.stayAutoTrackConfig.isCollectUrl)&&this.onUrlChange(function(){e=!!n.stayAutoTrackConfig.isCollectUrl()}),o=this.autoTrackConfig.stayDelayTime,s=this.autoTrackConfig.maxStayPageDuration,c=this.ctx,(t=r={timer:null,timeout:1e3,callback:function(e,t){var n=(null==(n=document.documentElement)?void 0:n.scrollTop)||window.pageYOffset||document.body.scrollTop||0,r=e.H_viewport_position,i=new Date,a=i-this.nowTime;(o<a&&n-r!=0||t)&&(_.extend(e,{event_duration:Math.min(parseInt(a)/1e3,s)},_.info.pageProperties()),c.track("H_WebStay",e)),this.nowTime=i},run:function(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n={};r.timer||(e=(null==(e=document.documentElement)?void 0:e.scrollTop)||window.pageYOffset||document.body.scrollTop||0,n.H_viewport_position=Math.round(e)||0,t?(r.callback(n,!0),r.timer=null):r.timer=setTimeout(function(){r.callback(n,!1),r.timer=null},r.timeout))}}).nowTime=new Date,_.addCaptureEvent(window,"scroll",function(){e&&t.run()}),_.addCaptureEvent(window,"unload",function(){e&&t.run(!0)}))}},{key:"onUrlChange",value:function(e){_.check.isFunction(e)&&(e(),_.mitt.on("urlChange",e))}},{key:"getTargetElement",value:function(e,t){if(!_.check.isElement(e))return null;if(!_.check.isString(e.tagName))return null;var n=e.tagName.toLowerCase();if(["body","html"].includes(n))return null;if(["a","button","input","textarea"].concat(this.otherTag).includes(n))return e;if("div"===n&&this.autoTrackConfig.collectTags.div&&this.isDivLevelValid(e)&&(1<((null==(r=this.autoTrackConfig.collectTags)||null==(r=r.div)?void 0:r.maxLevel)||1)||this.isCollectableDiv(e)))return e;if(this.isStyleTag(n)&&this.autoTrackConfig.collectTags.div){var r=this.getCollectableParent(e);if(r&&this.isDivLevelValid(r))return r}return this.hasElement({event:(null==t?void 0:t.originalEvent)||t,element:e})||null}},{key:"isDivLevelValid",value:function(e){for(var t,n=(null==(t=this.autoTrackConfig.collectTags)||null==(t=t.div)?void 0:t.maxLevel)||1,r=e.getElementsByTagName("div"),i=r.length-1;0<=i;i--)if(this.getDivLevel(r[i],e)>n)return!1;return!0}},{key:"getDivLevel",value:function(e,t){var e=this.getElementPath(e,!0,t).split(" > "),n=0;return e.forEach(function(e){"div"===e&&n++}),n}},{key:"getElementPath",value:function(e,t,n){for(var r=[];e.parentNode&&_.check.isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){r.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(n&&e===n){r.unshift(e.tagName.toLowerCase());break}if(e===document.body){r.unshift("body");break}r.unshift(e.tagName.toLowerCase()),e=e.parentNode}return r.join(" > ")}},{key:"isCollectableDiv",value:function(e){try{var t=e.children||[];if(0!==(null==t?void 0:t.length))for(var n,r,i=0;i<t.length;i++)if(1===t[i].nodeType){var a=t[i].tagName.toLowerCase(),o=(null==(n=this.autoTrackConfig.collectTags)||null==(r=n.div)?void 0:r.maxLevel)||1;if(!("div"===a&&1<o||this.isStyleTag(a)))return!1;if(!this.isCollectableDiv(t[i]))return!1}return!0}catch(e){Log.log(e)}return!1}},{key:"getCollectableParent",value:function(e){try{var t,n,r=e.parentNode,i=r?r.tagName.toLowerCase():"";if("body"===i)return!1;var a=(null==(t=this.autoTrackConfig.collectTags)||null==(n=t.div)?void 0:n.maxLevel)||1;if("div"===i&&(1<a||this.isCollectableDiv(r)))return r;if(r&&this.isStyleTag(i))return this.getCollectableParent(r)}catch(e){Log.log(e)}return!1}},{key:"isStyleTag",value:function(e){var t;return!defaultTags.includes(e)&&!(null==(t=this.autoTrackConfig.collectTags)||null==(t=t.div)||null==(t=t.ignoreTags)||!t.includes(e))}},{key:"hasElement",value:function(e){e.event?t=(t=e.event).path||(null==t?void 0:t._getPath()):e.element&&(t=_.getDomElementInfo(e.element).getParents());var t,n=this.autoTrackConfig.trackAttr;if(_.check.isArray(t)&&0<t.length){var r,i=_createForOfIteratorHelper(t);try{for(i.s();!(r=i.n()).done;){var a,o=r.value,s=null==(a=o.tagName)?void 0:a.toLowerCase();if(_.check.isElement(o)&&1===o.nodeType&&(this.isTrackList[s]||this.hasAttributes(o,n)))return o}}catch(e){i.e(e)}finally{i.f()}}}},{key:"hasAttribute",value:function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(null==(e=e.attributes[t])||!e.value):void 0}},{key:"hasAttributes",value:function(e,t){if(_.check.isArray(t)){for(var n=!1,r=0;r<t.length;r++)if(this.hasAttribute(e,t[r])){n=!0;break}return n}}},{key:"getPageXYInfo",value:function(e,t){return e?(n=(e=e).pageX||e.clientX+r().scrollLeft||e.offsetX+i().targetEleX||0,e=e.pageY||e.clientY+r().scrollTop||e.offsetY+i().targetEleY||0,{H_page_x:a(n),H_page_y:a(e)}):{};var n;function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function i(){var e;if(document.documentElement.getBoundingClientRect)return{targetEleX:(e=t.getBoundingClientRect()).left+r().scrollLeft||0,targetEleY:e.top+r().scrollTop||0}}function a(e){return Number(Number(e).toFixed(3))}}},{key:"getClickElementInfo",value:function(e){var t=this.autoTrackConfig.isCollectInput(),n=this.getDomSelector(e),t=_.info.getElementInfo(e,t);return t.H_element_selector=n||"",t.H_element_path=this.getElementPath(e,!1),t}},{key:"getDomSelector",value:function(e){var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return!!(e&&e.parentNode&&e.parentNode.children)&&(t=e.nodeName.toLowerCase(),e&&"body"!==t&&1===e.nodeType?(n.unshift(this.getSelector(e)),null!=e&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))?n.join(" > "):this.getDomSelector(e.parentNode,n)):(n.unshift("body"),n.join(" > ")))}},{key:"getSelector",value:function(e){var t,n=e.tagName.toLowerCase(),r=-1;return 9!==(null==e||null==(t=e.parentNode)?void 0:t.nodeType)&&(r=this.getDomIndex(e)),null!=e&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))?"#"+e.getAttribute("id"):n+(~r?":nth-of-type("+(r+1)+")":"")}},{key:"getDomIndex",value:function(e){if(e.parentNode)for(var t,n=0,r=e.tagName.toLowerCase(),i=e.parentNode.children,a=0;a<i.length;a++)if((null==(t=i[a])||null==(t=t.tagName)?void 0:t.toLowerCase())===r){if(i[a]===e)return n;n++}return-1}}]),r}(),_window$2=window,location$2=_window$2.location,SiteLinker=function(){function e(){_classCallCheck(this,e),this.ctx={},this.option={},this.isInited=!1}return _createClass(e,[{key:"init",value:function(e,t){this.ctx=e,this.option=t,this.isInited||(this.isInited=!0,_.check.isObject(t)&&_.check.isArray(t.linker)&&0<t.linker.length?(this.setRefferId(t),this.addClickListen(),this.option=function(e){for(var t=e.length,n=[],r=0;r<t;r++)/[A-Za-z0-9]+\./.test(e[r].part_url)&&_.check.isBoolean(e[r].after_hash)?n.push(e[r]):Log.log("The configuration of linker "+(r+1)+" is not supported.Please check format");return n}(t.linker)):Log.log("siteLinker plugin: Please configure the linker parameter"))}},{key:"getPartUrl",value:function(e){var t=this.option.length;if(t)for(var n=0;n<t;n++)if(-1<e.indexOf(this.option[n].part_url))return!0;return!1}},{key:"getPartHash",value:function(e){var t=this.option.length;if(t)for(var n=0;n<t;n++)if(-1<e.indexOf(this.option[n].part_url))return this.option[n].after_hash;return!1}},{key:"getCurrentId",value:function(){var e=this.ctx.store.getAccountId()||"",t=this.ctx.store.getFirstId()||"";return _.encodeURIComponent(t?"f"+e:"d"+e)}},{key:"rewriteUrl",value:function(e,t){var n,r,i,a,o=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),s="";if(o)return n=o[1]||"",r=o[2]||"",o=o[3]||"",i="_hnsdk="+this.getCurrentId(),s=this.getPartHash(e)?(a=o.indexOf("_hnsdk"),-1<o.indexOf("?")?-1<a?n+r+"#"+o.substring(1,a)+c(o.substring(a,o.length)):n+r+"#"+o.substring(1)+"&"+i:n+r+"#"+o.substring(1)+"?"+i):(a=r.indexOf("_hnsdk"),/^\?(\w)+/.test(r)?-1<a?n+"?"+c(r.substring(1))+o:n+"?"+r.substring(1)+"&"+i+o:n+"?"+r.substring(1)+i+o),t&&(t.href=s),s;function c(e){var e=e.split("&"),t=[];return _.each(e,function(e){-1<e.indexOf("_hnsdk=")?t.push(i):t.push(e)}),t.join("&")}}},{key:"getUrlId",value:function(){var e=location$2.href.match(/_hnsdk=([aufd][^\?\#\&\=]+)/);return _.check.isArray(e)&&e[1]?_.decodeURIComponent(e[1]):""}},{key:"setRefferId",value:function(e){var t=this.ctx.store.getAccountId();if(""===(n=this.getUrlId()))return!1;var n,r="d"===n.substring(0,1);(n=n.substring(1))!==t&&(r?(this.ctx.setDeviceUId(n,!0),this.ctx.store.getFirstId()&&this.ctx.sendRequest({anonymous_id:n,account_id:t,type:"track_signup",event:"H_signUp",properties:{}})):this.ctx.store.getFirstId()&&!e.re_login||this.ctx.setUserUId(n))}},{key:"addClickListen",value:function(){function e(e){var t,n=(e=e.target).tagName.toLowerCase(),r=e.parentNode,i=null==r||null==(i=r.tagName)?void 0:i.toLowerCase();("a"===n&&e.href||"a"===i&&r.href)&&(i="a"===n&&e.href?(t=e.href,e):(t=r.href,r),"http:"!==(n=_.URL(t).protocol)&&"https:"!==n||a.getPartUrl(t)&&a.rewriteUrl(t,i))}var a=this;_.addEvent(document,"mosedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&0<=window.navigator.maxTouchPoints&&_.addEvent(document,"pointerdown",e)}}]),e}(),PageLoad=function(){function e(){_classCallCheck(this,e),this.ctx={},this.option={},this.isInited=!1}return _createClass(e,[{key:"init",value:function(e,t){function r(){var e=0,t=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,n={H_url:(n=window.location).href,H_title:document.title,H_url_path:n.pathname,H_referrer:_.getReferrer(null,!0)};t?(e=i.getDuration(t)||i.getDurationCompatible(t),i.getPageSize(t,n),0<e&&(t=1800,_.check.isObject(i.option)&&i.option.max_duration&&(t=i.option.max_duration),e=Number((e/1e3).toFixed(3)),!_.check.isNumber(t)||t<=0||e<=t)&&(n.event_duration=e),i.isInited||(i.ctx.track("H_WebPageLoad",n),i.isInited=!0),window.removeEventListener&&window.removeEventListener("load",r)):Log.log("your browser not support performance API")}var i=this;this.ctx=e,this.option=t;"complete"===document.readyState?r():window.addEventListener&&window.addEventListener("load",r)}},{key:"getPageSize",value:function(e,t){if(e.getEntries&&_.check.isFunction(e.getEntries)){for(var n=e.getEntries(),r=0,i=0;i<n.length;i++)"transferSize"in n[i]&&(r+=n[i].transferSize);_.check.isNumber(r)&&0<=r&&r<10737418240&&(t.H_page_resource_size=Number((r/1024).toFixed(3)))}}},{key:"getDurationCompatible",value:function(e){var t=0;return e.timing&&(0!==(e=e.timing).fetchStart&&_.check.isNumber(e.fetchStart)&&0!==e.domContentLoadedEventEnd&&_.check.isNumber(e.domContentLoadedEventEnd)?t=e.domContentLoadedEventEnd-e.fetchStart:Log.log("performance data parsing exception")),t}},{key:"getDuration",value:function(e){var t=0;return t=_.check.isFunction(e.getEntriesByType)?((e.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0:t}}]),e}(),PageLeave=function(){function e(){_classCallCheck(this,e),this.isInited=!1,this.startTime=_.now(),this.currentPageUrl=document.referrer,this.url=location$2.href,this.title=document.title||"",this.pageShowStatus=!0,this.pageHiddenStatus=!1,this.timer=null,this.heartbeatIntervalTime=5e3,this.heartbeatIntervalTimer=null,this.pageId=null,this.maxDuration=432e3,this.storageName="hinasdk_pageleave_"}return _createClass(e,[{key:"init",value:function(e,t){this.ctx=e,this.option=t,this.isInited||(this.isInited=!0,this.option&&((e=(this.option=t).heartbeat_interval_time)&&_.check.isNumber(+e)&&0<+e&&(this.heartbeatIntervalTime=1e3*e),e=t.max_duration)&&_.check.isNumber(+e)&&0<+e&&(this.maxDuration=e),this.pageId=Number(String(_.getRandom()).slice(2,5)+String(_.getRandom()).slice(2,4)+String(_.now()).slice(-4)),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.addHeartBeatInterval())}},{key:"refreshPageEndTimer",value:function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.pageHiddenStatus=!1},5e3)}},{key:"hiddenStatusHandler",value:function(){clearTimeout(this.timer),this.timer=null,this.pageHiddenStatus=!1}},{key:"pageStartHandler",value:function(){this.startTime=_.now(),!0===document.hidden?this.pageShowStatus=!1:this.pageShowStatus=!0,this.url=location$2.href,this.title=document.title}},{key:"pageEndHandler",value:function(){var e;this.pageHiddenStatus||(e=this.getPageLeaveProperties(),this.pageShowStatus||delete e.event_duration,this.pageShowStatus=!1,this.pageHiddenStatus=!0,this.isCollectUrl(this.url)&&this.ctx.track("H_WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData())}},{key:"addPageLeaveEventListener",value:function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()}},{key:"addPageStartListener",value:function(){var e=this;"onpageshow"in window&&_.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})}},{key:"addPageSwitchListener",value:function(){var t=this;_.mitt.prepend("urlChange",function(e){e!==location$2.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.currentPageUrl=e,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})}},{key:"addSinglePageListener",value:function(){}},{key:"addPageEndListener",value:function(){var t=this;_.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&_.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})}},{key:"addHeartBeatInterval",value:function(){_.localStorage.isSupport()&&this.startHeartBeatInterval()}},{key:"startHeartBeatInterval",value:function(){var e=this,t=(this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),!0);(t=this.isCollectUrl(this.url)?t:!1)&&(this.heartbeatIntervalTimer=setInterval(function(){e.saveHeartBeatData()},this.heartbeatIntervalTime),this.saveHeartBeatData("first")),this.reissueHeartBeatData()}},{key:"reissueHeartBeatData",value:function(){for(var e=_.localStorage.length-1;0<=e;e--){var t,n=_.localStorage.key(e);n&&n!==this.storageName+this.pageId&&-1<n.indexOf(this.storageName)&&(t=_.readObjectVal(n),_.check.isObject(t))&&_.now()-t.time>t.heartbeat_interval_time+5e3&&(delete t.heartbeat_interval_time,this.ctx.sendRequest(t),this.delHeartBeatData(n))}}},{key:"stopHeartBeatInterval",value:function(){this.heartbeatIntervalTimer&&clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null}},{key:"saveHeartBeatData",value:function(e){var t=this.getPageLeaveProperties(),e=(t.H_time=_.now(),"first"===e&&(t.event_duration=3),addProps({type:"track",event:"H_WebPageLeave",properties:t},this.ctx));e.heartbeat_interval_time=this.heartbeatIntervalTime,_.saveObjectVal(this.storageName+this.pageId,e)}},{key:"delHeartBeatData",value:function(e){_.localStorage.isSupport()&&_.localStorage.remove(e||this.storageName+this.pageId)}},{key:"isCollectUrl",value:function(e){return!_.check.isFunction(this.option.isCollectUrl)||!_.check.isString(e)||this.option.isCollectUrl(e)}},{key:"getPageLeaveProperties",value:function(){var e=(_.now()-this.startTime)/1e3,t=((!_.check.isNumber(e)||e<0||e>this.maxDuration)&&(e=0),e=Number(e.toFixed(3)),_.getReferrer(this.currentPageUrl)),n=(null==(n=document.documentElement)?void 0:n.scrollTop)||window.pageYOffset||(null==(n=document.body)?void 0:n.scrollTop)||0,n=Math.round(n)||0,t={H_title:this.title,H_url:this.url,H_url_path:_.URL(this.url).pathname,H_referrer_host:t?_.getHostname(t):"",H_referrer:t,H_viewport_position:n};return e&&(t.event_duration=e),t=_.extend(t,this.option.custom_props)}}]),e}(),plugin={SiteLinker:SiteLinker,PageLoad:PageLoad,PageLeave:PageLeave},defaultPara={name:"",showLog:!1,autoTrackConfig:{clickAutoTrack:!1,stayAutoTrack:!1},stayAutoTrackConfig:{},imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:"image",dataSendTimeout:3e3,isTrackDeviceId:!1,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0,url:!0,title:!0}},HinaDataLib=function(){function e(){return _classCallCheck(this,e),e.instance||((e.instance=this).config={},this.initialized=!1,this._=_),e.instance}return _createClass(e,[{key:"setConfig",value:function(e){_.check.isObject(e)&&_.extend(this.config,e)}},{key:"getConfig",value:function(e){return this.config[e]}},{key:"init",value:function(e){var t;_.check.isEmptyObject(this.config)?(this.setConfig(_.extend({},defaultPara,e)),Log.showLog=this.getConfig("showLog"),SDKDebug.serverUrl=this.getConfig("serverUrl"),_.initUrlChange(),HinaDataStore.load(this.config),initLatestProps(this.config),this.store=HinaDataStore,e=this.getConfig("sendType"),["image","ajax","beacon"].includes(e)||this.setConfig({sendType:"image"}),!0!==this.getConfig("batchSend")&&!_.check.isObject(this.getConfig("batchSend"))||(this.batchSender=new BatchSend(this.config),this.batchSender.batchInterval()),e=this.getConfig("autoTrackConfig"),t=this.getConfig("stayAutoTrackConfig"),e=new AutoTrack(e,t,this),(this.autoTrackInstance=e).initWebClick(),e.initWebStay(),e.listenSinglePage(),this.initialized=!0,Log.log("hinaSDK initialized successfully"),_.mitt.emit("hasInit")):Log.log("hinaSDK has been initialized")}},{key:"sendRequest",value:function(e,t){if((e=addProps(e,this)).send_time=_.now(),Log.log(e),this.getConfig("appJsBridge")){var n=window.Hina_Cloud_H5_Bridge||{};if(_.check.isObject(n)&&n.track)return n.track(e.event,e.type,JSON.stringify(e)),_.check.isFunction(t)&&t(),void Log.log("The data has been sent to the Android side");if("iOS"===_.info.os()){n=null==(n=window.webkit)||null==(n=n.messageHandlers)?void 0:n.hinaNativeTracker;if(null!=n&&n.postMessage)return r=JSON.stringify({eventName:e.event,eventType:e.type,properties:e}),n.postMessage(r),_.check.isFunction(t)&&t(),void Log.log("The data has been sent to the iOS side")}Log.log("The app JSBridge data transmission has failed.")}if(this.getConfig("batchSend"))new BatchSend(this.config).add(e);else{_.check.isString(e)||(e=JSON.stringify(e));var n=_.base64Encode(e),r="crc="+_.hashCode(n),e="data="+_.encodeURIComponent(n)+"&ext="+_.encodeURIComponent(r),n=this.getConfig("sendType"),i={callback:t,data:e,serverUrl:this.getConfig("serverUrl"),dataSendTimeout:this.getConfig("dataSendTimeout")};switch(n){case"ajax":new AjaxSend(i).run();break;case"beacon":new BeaconSend(i).run();break;default:new ImageSend(_.extend(i,{imgUseCrossOrigin:this.getConfig("imgUseCrossOrigin")})).run()}}}},{key:"quick",value:function(e){for(var t={autoTrack:this.autoTrackInstance.autoTrack,autoTrackSinglePage:this.autoTrackInstance.autoTrackSinglePage},n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t[e].call(this.autoTrackInstance,r)}},{key:"track",value:function(e,t,n){n=_.check.isFunction(n)?n:function(){};_.check.isString(e)&&_.check.isObject(t)?this.sendRequest({type:"track",event:e,properties:t},n):Log.log("eventName must be a sting and properties must be an object")}},{key:"setUserUId",value:function(e,t){var n,r;_.check.isNumber(e)||_.check.isString(e)?(e=String(e),n=this.store.getFirstId(),e!==(r=this.store.getAccountId())||n?e!==r&&(n||this.store.set("firstId",r),this.store.setAccountId(e),this.sendRequest({account_id:this.store.getAccountId(),type:"track_signup",event:"H_signUp",properties:{}},t)):Log.log("setUserUId: uid is equal to account_id")):Log.log("setUserUId: uid must be string or number")}},{key:"getDeviceUId",value:function(){return this.store.getAnonymousId()}},{key:"setDeviceUId",value:function(e,t){var n,r=this.store.getFirstId();_.check.isUndefined(e)?(n=_.UUID(),r?this.store.set("firstId",n):this.store.setAccountId(n)):(_.check.isNumber(e)||_.check.isString(e))&&(e=String(e),!0===t?r?this.store.set("firstId",e):this.store.set("accountId",e):r?this.store.change("firstId",e):this.store.change("accountId",e))}},{key:"userSet",value:function(e,t){_.check.isObject(e)&&!_.check.isEmptyObject(e)&&this.sendRequest({type:"user_set",properties:e},t)}},{key:"userSetOnce",value:function(e,t){_.check.isObject(e)&&!_.check.isEmptyObject(e)&&this.sendRequest({type:"user_setOnce",properties:e},t)}},{key:"userAdd",value:function(e,t){_.check.isString(e)&&(e=_defineProperty({},e,1)),_.check.isObject(e)&&!_.check.isEmptyObject(e)&&function(e){for(var t in e)if(t in e&&!/-*\d+/.test(String(e[t])))return Log.log("userAdd: value is must be number"),0;return 1}(e)&&this.sendRequest({type:"user_add",properties:e},t)}},{key:"userUnset",value:function(e,t){var n={};_.check.isString(e)&&(e=[e]),_.check.isArray(e)?(_.each(e,function(e){_.check.isString(e)?n[e]=!0:Log.log("userUnset: value inside the array must be string and have already been filtered out",e)}),this.sendRequest({type:"user_unset",properties:n},t)):Log.log("userUnset: param must be an array or string")}},{key:"userDelete",value:function(e){this.sendRequest({type:"user_delete"},e),this.store.setAccountId(_.UUID()),this.store.set("firstId","")}},{key:"registerCommonProperties",value:function(e){this.store.set("props",e)}},{key:"getPresetProperties",value:function(){return getPresetProperties()}},{key:"use",value:function(e,t){_.check.isString(e)?e in plugin?(new plugin[e]).init(this,t):Log.log("please write a valid plugin name"):Log.log("pluginName must be string")}}]),e}(),hina=new Proxy(new HinaDataLib,{get:function(r,i){return _.check.isFunction(r[i])?function(){if(r.initialized||"init"===i){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[i].apply(r,t)}console.log("sdk not yet initialized!")}:r[i]}});export default window.hinaDataStatistic=hina;
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).hina=t()}(this,function(){"use strict";function i(t,e){var n,i=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)),i}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,h(i.key),i)}}function n(e,t,n){t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1})}function c(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t){var n,i,r,o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,r=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(a=function(e,t){var n;if(e)return"string"==typeof e?u(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){e=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=typeof(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:String(e)}var t="3.1.1",d=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],f=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],g=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],m={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"},p="hinasdk_domain_test",A=Array.prototype.slice,v=Object.prototype.toString,y=Array.prototype.forEach,k=Object.prototype.hasOwnProperty,e=window,b=e.location,_=e.screen,w=e.localStorage,S=e.history,T=function(){function e(){a(this,e)}return n(e,null,[{key:"log",value:function(){if(!this.showLog)return!1;if(!0!==this.showLog&&"string"!==this.showLog||(arguments[0]=I.formatJsonString(arguments[0])),"object"===("undefined"==typeof console?"undefined":r(console))&&console.log)try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}}]),e}(),C=function(){function e(){a(this,e)}return n(e,null,[{key:"checkProtocolIsSame",value:function(e,t){try{if(I.URL(e).protocol!==I.URL(t).protocol)return!1}catch(e){return T.log("The _.URL method is not supported"),!1}return!0}},{key:"checkServerUrl",value:function(){return I.check.isString(this.serverUrl)&&""!==I.trim(this.serverUrl)?!(I.check.isString(this.serverUrl)&&""!==this.serverUrl&&!this.checkProtocolIsSame(this.serverUrl,b.href)&&(T.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。\n因为:1、https 下面发送 http 的图片请求会失败。2、http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。"),1)):(T.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!"),!1)}},{key:"checkAjax",value:function(e){if(e===this.serverUrl)return!1;I.check.isString(e)&&""!==e&&!this.checkProtocolIsSame(e,b.href)&&T.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为 http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。")}}]),e}(),I={};function P(){for(var e=+new Date,t=0;e===+new Date;)t++;return e.toString(16)+t.toString(16)}I.MAX_REFERRER_STRING_LENGTH=2e3,I.LIB_VERSION=t,I.utmTypes=d,I.searchTypes=f,I.socialTypes=g,I.searchKeywords=m,I.each=function(e,t,n){if(null!==e)if(y&&e.forEach===y)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i,e)==={})return}else for(var o in e)if(k.call(e,o)&&t.call(n,e[o],o,e)==={})return},I.map=function(e,i){var r=[];if(null!=e){if(Array.prototype.map&&e.map===Array.prototype.map)return e.map(i);I.each(e,function(e,t,n){r.push(i(e,t,n))})}return r},I.extend=function(n){return I.each(A.call(arguments,1),function(e){for(var t in e)void 0!==e[t]&&(n[t]=e[t])}),n},I.indexOf=function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i<e.length;i++)if(t===e[i])return i;return-1},I.trim=function(e){return e.replace(/(^[\s\uFEFF\xA0]+)|([\s\uFEFF\xA0]+$)/g,"")},I.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())+"."+((e=e.getMilliseconds())<10?"00"+e:e<100?"0"+e:e)},I.formatTimeZone=function(e,t){var n;return"number"!=typeof t?e:(n=e.getTime(),e=6e4*e.getTimezoneOffset(),new Date(n+e+36e5*t))},I.formatJsonString=function(t){try{return JSON.stringify(t,null,8)}catch(e){return JSON.stringify(t)}},I.searchObjDate=function(n,i){(I.check.isObject(n)||I.check.isArray(n))&&I.each(n,function(e,t){I.check.isObject(e)||I.check.isArray(e)?I.searchObjDate(n[t],i):I.check.isDate(e)&&(n[t]=I.formatDate(I.formatTimeZone(e,i)))})},I.paramType=function(e){return Object.prototype.toString.call(e).replace("[object ","").replace("]","")},I.check={isUndefined:function(e){return void 0===e},isObject:function(e){return"[object Object]"===v.call(e)&&null!==e},isEmptyObject:function(e){if(I.check.isObject(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1},isArray:function(e){return"[object Array]"===v.call(e)},isString:function(e){return"[object String]"===v.call(e)},isDate:function(e){return"[object Date]"===v.call(e)},isNumber:function(e){return"[object Number]"===v.call(e)},isBoolean:function(e){return"[object Boolean]"===v.call(e)},isFunction:function(e){return!!e&&("[object Function]"===(e=Object.prototype.toString.call(e))||"[object AsyncFunction]"===e)},isJSONString:function(e){try{JSON.parse(e)}catch(e){return!1}return!0},isElement:function(e){return!(!e||1!==e.nodeType)}},I.UUID=function(){var e=(e=String(_.height*_.width))&&/\d{5,}/.test(e)?e.toString(16):String(31242*Math.random()).replace(".","").slice(0,8),e=P()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=navigator.userAgent,r=[],i=0;function o(e,t){for(var n=0,i=0;i<t.length;i++)n|=r[i]<<8*i;return e^n}for(e=0;e<n.length;e++)t=n.charCodeAt(e),r.unshift(255&t),4<=r.length&&(i=o(i,r),r=[]);return(i=0<r.length?o(i,r):i).toString(16)}()+"-"+e+"-"+P();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)},I.getReferrer=function(e){e=e||document.referrer;return"string"!=typeof e?"referrer exception"+String(e):"string"==typeof(e=(e=0===e.indexOf("https://www.baidu.com/")?e.split("?")[0]:e).slice(0,2e3))?e:""},I.getCookielDomain=function(e){e=e||b.hostname;var t=(e=I.check.isString(e)&&e.match(/^[a-zA-Z0-9\u4e00-\u9fa5\-\.]+$/)?e:"").split(".");if(I.check.isArray(t)&&2<=t.length&&!/^(\d+\.)+\d+$/.test(e))for(var n="."+t.splice(t.length-1,1);0<t.length;){var i,n="."+t.splice(t.length-1,1)+n;if(document.cookie=p+"=true; path=/; domain="+n,-1!==document.cookie.indexOf(p+"=true"))return(i=new Date).setTime(i.getTime()-1e3),document.cookie=p+"=true; expires="+i.toGMTString()+"; path=/; SameSite=Lax; domain="+n,n}return""},I.getCurrentDomain=function(e){var t=I.getCookielDomain();return""===e||""===t?"url解析失败":t},I.hashCode=function(e){if("string"!=typeof e)return 0;var t=0;if(0!==e.length)for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t},I.base64Decode=function(e){var t=[];try{t=I.map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(e){t=[]}try{return decodeURIComponent(t.join(""))}catch(e){return t.join("")}},I.base64Encode=function(t){var n="";try{n=btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(e){n=t}return n},I.decodeURIComponent=function(t){var n="";try{n=decodeURIComponent(t)}catch(e){n=t}return n},I.encodeURIComponent=function(t){var n="";try{n=encodeURIComponent(t)}catch(e){n=t}return n},I.cookie={get:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return I.decodeURIComponent(r.substring(t.length,r.length))}return null},set:function(e,t,n,i,r,o,a){var s="",c="",u="";function l(e){return!!e&&e.replace(/\r\n/g,"")}0!==(n=null==n?73e3:n)&&(h=new Date,"s"===String(n).slice(-1)?h.setTime(h.getTime()+1e3*Number(String(n).slice(0,-1))):h.setTime(h.getTime()+24*n*60*60*1e3),s="; expires="+h.toGMTString()),I.check.isString(r)&&""!==r&&(u="; SameSite="+r),o&&(c="; secure");var n="",h="",r="";e&&(n=l(e)),h=t&&I.check.isString(t)?l(t):t,a&&(r=l(a)),n&&h&&(document.cookie=n+"="+encodeURIComponent(h)+s+"; path=/"+r+u+c)},remove:function(e,t){this.set(e,"1",-1,t)},isSupport:function(e,t){e=e||"cookie_support_test",t=t||"1";var n=this;return navigator.cookieEnabled&&(n.set(e,t),n.get(e)===t)&&(n.remove(e),!0)}},I.localStorage={get:function(e){return w.getItem(e)},parse:function(e){var t;try{t=JSON.parse(I.localStorage.get(e))||null}catch(e){T.log("parse localStorage failed")}return t},set:function(e,t){try{w.setItem(e,t)}catch(e){T.log("localStorage is not support")}},remove:function(e){w.removeItem(e)},isSupport:function(){var t=!0;try{var e="__localStorageSupport__",n="testIsSupportStorage";I.localStorage.set(e,n),I.localStorage.get(e)!==n&&(t=!1),I.localStorage.remove(e)}catch(e){t=!1}return t},key:function(e){w.key(e)},length:w.length},I.memory={data:{},get:function(e){e=this.data[e];return I.check.isUndefined(e)?null:I.check.isUndefined(e.expireTime)?e:e.expireTime<I.now()?null:e.value},set:function(e,t,n){var i;n&&(i=I.now(),i="s"===String(n).slice(-1)?i+1e3*Number(String(n).slice(0,-1)):i+24*n*60*60*1e3,this.data[e]={value:t,expireTime:i}),this.data[e]=t}},I.now=function(){return Date.now&&I.check.isFunction(Date.now)?Date.now():(new Date).getTime()},I.getRandom=function(){return(new Date).getTime()+"_"+Math.floor(1e6*Math.random())},I.safeJSONParse=function(t){var e=null;try{e=JSON.parse(t)}catch(e){return t}return e},I.saveObjectVal=function(e,t,n){I.check.isString(t)||(t=JSON.stringify(t)),I.localStorage.set(e,t)},I.readObjectVal=function(e,t){e=I.localStorage.get(e);return e?I.safeJSONParse(e):null},I.stripEmptyProperties=function(e){var n={};return I.each(e,function(e,t){I.check.isString(e)&&0<e.length&&(n[t]=e)}),n},I.info={os:function(){var e=navigator.userAgent;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)&&!window.MSStream?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},browser:function(){var e={type:"",version:""};try{var t,n,i=navigator.userAgent.toLowerCase(),r=[];null!==i.match(/baidubrowser/)?(e.type="baidu",r.push(/baidubrowser\/([\d.]+)/)):null!==i.match(/bidubrowser/)?(e.type="baidu",r.push(/bidubrowser\/([\d.]+)/)):null!==i.match(/edga/)?(e.type="edge",r.push(/edga\/([\d.]+)/)):null!==i.match(/edgios/)?(e.type="edge",r.push(/edgios\/([\d.]+)/)):null!==i.match(/liebaofast/)?(e.type="liebao",r.push(/liebaofast\/([\d.]+)/)):null!==i.match(/sogoumobilebrowser/)?(e.type="sogou",r.push(/sogoumobilebrowser\/([\d.]+)/)):null!==i.match(/lbbrowser/)?(e.type="liebao",r.push(/lbbrowser\/([\d.]+)/)):null!==i.match(/crios/)?(e.type="chrome",r.push(/crios\/([\d.]+)/)):null!==i.match(/qihoobrowser/)?(e.type="360",r.push(/qihoobrowser\/([\d.]+)/)):null!==i.match(/mxios/)?(e.type="maxthon",r.push(/mxios\/([\d.]+)/)):null!==i.match(/fxios/)?(e.type="firefox",r.push(/fxios\/([\d.\w]+)/)):null!==i.match(/edge/)?(e.type="edge",r.push(/edge\/([\d.]+)/)):null!==i.match(/metasr/)?(e.type="sogou",r.push(/metasr ([\d.]+)/)):null!==i.match(/micromessenger/)?(e.type="micromessenger",r.push(/micromessenger\/([\d.]+)/)):null!==i.match(/mqqbrowser/)?(e.type="qq",r.push(/mqqbrowser\/([\d.]+)/)):null!==i.match(/qqbrowserlite/)?(e.type="qq",r.push(/qqbrowserlite\/([\d.]+)/)):null!==i.match(/tencenttraveler/)?(e.type="qq",r.push(/tencenttraveler\/([\d.]+)/)):null!==i.match(/qqbrowser/)?(e.type="qq",r.push(/qqbrowser\/([\d.]+)/)):null!==i.match(/maxthon/)?(e.type="maxthon",r.push(/maxthon\/([\d.]+)/)):null!==i.match(/ubrowser/)?(e.type="uc",r.push(/ubrowser\/([\d.]+)/)):null!==i.match(/ucbrowser/)?(e.type="uc",r.push(/ucbrowser\/([\d.]+)/)):null!==i.match(/firefox/)?(e.type="firefox",r.push(/firefox\/([\d.]+)/)):null!==i.match(/opera/)?(e.type="opera",r.push(/opera\/([\d.]+)/)):null!==i.match(/opr/)?(e.type="opera",r.push(/opr\/([\d.]+)/)):null!==i.match(/chrome/)?(e.type="chrome",r.push(/chrome\/([\d.]+)/)):null!==i.match(/safari/)?(e.type="safari",r.push(/version\/([\d.]+)/)):null===i.match(/trident/)&&null===i.match(/msie/)||(e.type="ie"),"ie"===e.type?(t=i.match(/trident\/([\d.]+)/)?i.match(/trident\/([\d.]+)/)[1]:"",n=i.match(/msie ([\d.]+)/)?i.match(/msie ([\d.]+)/)[1]:"",""!==t?e.version=String(parseInt(t)+4):""!==n&&(e.version=n)):r&&(e.version=i.match(r[0])?i.match(r[0])[1]:"")}catch(e){T.w("getting browser info failed due to ",e)}return e},properties:function(){var e=I.info.browser();return I.extend({H_os:I.info.os(),H_lib_version:t,H_lib:"js",H_screen_height:Number(_.height)||0,H_screen_width:Number(_.width)||0,H_browser:e.type,H_browser_version:e.version,H_system_language:I.check.isString(navigator.languages[1])?navigator.languages[1].toLowerCase():"取值异常"})},pageProperties:function(){var e=I.getReferrer(),t=I.getCurrentDomain(b.href);return I.stripEmptyProperties({H_referrer:e,H_referrer_host:e?I.getHostname(e):"",H_url:b.href,H_url_host:I.getHostname(b.url,"url_host取值异常"),H_url_domain:t,H_url_path:b.pathname,H_title:document.title})},getElementInfo:function(e,t){var n;return I.check.isElement(e)?(e={H_element_type:n=e.tagName.toLowerCase(),H_element_name:e.getAttribute("name"),H_element_id:e.getAttribute("id"),H_element_target_url:e.getAttribute("href"),H_element_class_name:I.check.isString(e.className)?e.className:null,H_element_content:I.getElementContent(e,n,t)},I.stripEmptyProperties(e)):{}}},I.getElementContent=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return"input"===t?(["button","submit"].includes(e.type)||n)&&e.value||"":(t="",e.textContent?t=I.trim(e.textContent):e.innerText&&(t=I.trim(e.innerText)),(t=t&&t.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))||"")},I.getHostname=function(e,t){if(t&&"string"==typeof t||(t="hostname解析异常"),!e)return t;var n=null;try{n=I.URL(e).hostname}catch(e){T.log("getHostname传入的url参数不合法!")}return n||t},I.isReferralTraffic=function(e){return""===(e=e||document.referrer)||I.getCookielDomain(I.getHostname(e))!==I.getCookielDomain()},I.getUtm=function(){var n={};return I.each(d,function(e){var t=I.getQueryParam(b.href,e);t.length&&(n[e]=t)}),n},I.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=I.decodeURIComponent(e);t=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===t||t&&"string"!=typeof t[1]&&t[1].length?"":I.decodeURIComponent(t[1])};var R=function(){function t(e){a(this,t),this.ele=e}return n(t,[{key:"addClass",value:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this}},{key:"removeClass",value:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this}},{key:"hasClass",value:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")}},{key:"attr",value:function(e,t){return"string"==typeof e&&I.check.isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)}},{key:"offset",value:function(){var e,t=this.ele.getBoundingClientRect();return t.width||t.height?(e=this.ele.ownerDocument.documentElement,{top:t.top+window.pageYOffset-e.clientTop,left:t.left+window.pageXOffset-e.clientLeft}):{top:0,left:0}}},{key:"getSize",value: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(e){return{width:0,height:0}}}},{key:"getStyle",value:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)}},{key:"wrap",value:function(e){e=document.createElement(e);return this.ele.parentNode.insertBefore(e,this.ele),e.appendChild(this.ele),I.getDomElementInfo(e)}},{key:"getCssStyle",value:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var n=null;if(!(n="function"==typeof window.getMatchedCSSRules?window.getMatchedCSSRules(this.ele):n)||!I.check.isArray(n))return null;for(var i=n.length-1;0<=i;i--)if(t=n[i].style.getPropertyValue(e))return t}},{key:"sibling",value:function(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}},{key:"next",value:function(){return this.sibling(this.ele,"nextSibling")}},{key:"prev",value:function(){return this.sibling(this.ele,"previousSibling")}},{key:"siblingsFn",value:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}},{key:"siblings",value:function(){return this.siblingsFn((this.ele.parentNode||{}).firstChild,this.ele)}},{key:"children",value:function(){return this.siblingsFn(this.ele.firstChild)}},{key:"parent",value:function(){var e;return e=(e=this.ele.parentNode)&&11!==e.nodeType?e:null,I.getDomElementInfo(e)}},{key:"previousElementSibling",value:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return I.getDomElementInfo(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return I.getDomElementInfo(e);return I.getDomElementInfo(null)}},{key:"getSameTypeSiblings",value:function(){for(var e=this.ele,t=e.parentNode,n=e.tagName.toLowerCase(),i=[],r=0;r<t.children.length;r++){var o=t.children[r];1===o.nodeType&&o.tagName.toLowerCase()===n&&i.push(t.children[r])}return i}},{key:"getParents",value:function(){try{var e=this.ele;if(!I.check.isElement(e))return[];var t=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,t.push(e);return t}catch(e){return[]}}}]),t}(),x=(I.getDomElementInfo=function(e){return new R(e)},I.addEvent=function(e,t,n,u){function l(e){return e&&(e.preventDefault=l.preventDefault,e.stopPropagation=l.stopPropagation,e._getPath=l._getPath),e}l._getPath=function(){return this.path||I.getDomElementInfo(this.target).getParents()},l.preventDefault=function(){this.returnValue=!1},l.stopPropagation=function(){this.cancelBubble=!0};!function(e,t,n){var i,r,o,a,s,c;void 0===u&&"click"===t&&(u=!0),e&&e.addEventListener?e.addEventListener(t,function(e){e._getPath=l._getPath,n.call(this,e)},u):(r=e[i="on"+t],e[i]=(o=e,a=n,s=r,c=t,function(e){var t,n;if(e=e||l(window.event))return e.target=e.srcElement,t=!0,"function"==typeof s&&(n=s(e)),e=a.call(o,e),"beforeunload"!==c?!1!==n&&!1!==e&&t:void 0}))}.apply(null,arguments)},I.addCaptureEvent=function(e,t,n){return this.addEvent(e,t,n,"click"===t)},I.hasCircularReference=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Set;if("object"===r(e)&&null!==e){if(t.has(e))return!0;for(var n in t.add(e),e)if(I.hasCircularReference(e[n],t))return!0;t.delete(e)}return!1},I.parseSuperProperties=function(e){var n=e.properties||{},i=JSON.parse(JSON.stringify(e));I.check.isObject(n)&&I.each(n,function(e,t){if(I.check.isFunction(e))try{n[t]=e(i),I.check.isFunction(n[t])&&(T.log("属性--"+t+" 格式不满足要求, 已被删除"),delete n[t])}catch(e){delete n[t],T.log("属性--"+t+" 格式不满足要求, 已被删除")}})},I.getURLSearchParams=function(e){for(var t={},n=(e=e||"").substring(1).split("&"),i=0;i<n.length;i++){var r,o=n[i].indexOf("=");-1!==o&&(r=n[i].substring(0,o),o=n[i].substring(o+1),r=I.decodeURIComponent(r),o=I.decodeURIComponent(o),t[r]=o)}return t},I.urlParse=function(e){function t(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)}return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!==r(e))return!1;var t,n=this._values.QueryString||"";for(t in e)n=new RegExp(t+"[^&]+").test(n)?n.replace(new RegExp(t+"[^&]+"),t+"="+e[t]):"&"===n.slice(-1)?n+t+"="+e[t]:""===n?t+"="+e[t]:n+"&"+t+"="+e[t];this._values.QueryString=n},t.prototype.getUrl=function(){var e="";return(e+=this._values.Origin)+(this._values.Port?":"+this._values.Port:"")+this._values.Path+(this._values.QueryString?"?"+this._values.QueryString:"")+(this._values.Fragment?"#"+this._values.Fragment:"")},t.prototype._parse=function(e){this._initValues();this._regex.exec(e)||T.i("URLParser::_parse -> Invalid URL");var t,e=e.split("#"),n=e[0],e=e.slice(1).join("#"),i=this._regex.exec(n);for(t in this._fields)void 0!==i[this._fields[t]]&&(this._values[t]=i[this._fields[t]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=e},new t(e)},I.URL=function(e){var t,n,i={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(e){return!1}}())(i=new URL(e)).searchParams||(i.searchParams=(n=I.getURLSearchParams(i.search),{get:function(e){return n[e]}}));else{I.check.isString(e)||(e=String(e)),e=I.trim(e);if(!1===/^https?:\/\/.+/.test(e))return void T.w("Invalid URL");e=I.urlParse(e);i.hash=e._values.Fragment,i.host=e._values.Host?e._values.Host+(e._values.Port?":"+e._values.Port:""):"",i.href=e._values.URL,i.password=e._values.Password,i.pathname=e._values.Path,i.port=e._values.Port,i.search=e._values.QueryString?"?"+e._values.QueryString:"",i.username=e._values.Username,i.hostname=e._values.Hostname,i.protocol=e._values.Protocol?e._values.Protocol+":":"",i.origin=e._values.Origin?e._values.Origin+(e._values.Port?":"+e._values.Port:""):"",i.searchParams=(t=I.getURLSearchParams("?"+e._values.QueryString),{get:function(e){return t[e]}})}return i},function(){function e(){a(this,e)}return n(e,null,[{key:"getSourceFromReferrer",value:function(){function e(e,t){for(var n=0;n<e.length;n++)if(-1!==t.split("?")[0].indexOf(e[n]))return 1}var t="("+d.join("|")+")\\=[^&]+",n=document.referrer||"",i=b.href;return i?(i=i.match(new RegExp(t)))&&i[0]?"付费广告流量":e(f,n)?"自然搜索流量":e(g,n)?"社交网站流量":""===n?"直接流量":"引荐流量":"获取url异常"}},{key:"getReferSearchEngine",value:function(e){var t=I.getHostname(e);if(!t||"hostname解析异常"===t)return"";var n,i,r={baidu:[/^.*\.baidu\.com$/],bing:[/^.*\.bing\.com$/],google:[/^www\.google\.com$/,/^www\.google\.com\.[a-z]{2}$/,/^www\.google\.[a-z]{2}$/],sm:[/^m\.sm\.cn$/],so:[/^.+\.so\.com$/],sogou:[/^.*\.sogou\.com$/],yahoo:[/^.*\.yahoo\.com$/]},o={};for(n in r)o[n]=r[n].map(function(e){return new RegExp(e)});for(i in o){var a,s=l(o[i]);try{for(s.s();!(a=s.n()).done;)if(a.value.test(t))return i}catch(e){s.e(e)}finally{s.f()}}return"未知搜索引擎"}},{key:"getKeywordFromReferrer",value:function(e,t){if(e=e||document.referrer,document&&I.check.isString(e)){if(0!==e.indexOf("http"))return""===e?"未取到值_直接打开":"未取到值_非http的url";var n=this.getReferSearchEngine(e),i=I.getURLSearchParams(e);if(!I.check.isEmptyObject(i)){var r,o;for(o in m)if(n===o&&I.check.isObject(i))if(I.check.isArray(r=m[o]))for(o=0;o<r.length;o++){var a=i[r[o]];if(a)return t?{active:a}:a}else if(i[r])return t?{active:i[r]}:i[r]}return"未取到值"}return"取值异常_referrer异常_"+String(e)}}]),e}());function H(e){return!!I.check.isFunction(e)||!(!e||!I.check.isObject(e))&&H(e.callback)}e=function(){function e(){return a(this,e),e.instance||((e.instance=this).events={}),e.instance}return n(e,[{key:"on",value:function(e,t){if(!e||!t)return!1;if(H(t))return this.events[e]=this.events[e]||[],I.check.isObject(t)?this.events[e].push(t):this.events[e].push({callback:t,once:!1}),this;throw new Error("callback must be a fcuntion")}},{key:"prepend",value:function(e,t){if(!e||!t)return!1;if(H(t))return this.events[e]=this.events[e]||[],I.check.isObject(t)?this.events[e].unshift(t):this.events[e].unshift({callback:t,once:!1}),this;throw new Error("callback must be a fcuntion")}},{key:"prependOnce",value:function(e,t){return this.prepend(e,{callback:t,once:!0})}},{key:"once",value:function(e,t){return this.on(e,{callback:t,once:!0})}},{key:"off",value:function(e,t){var n=this.events[e];if(!n)return!1;if(I.check.isNumber(t))n.splice(t,1);else if(I.check.isFunction(t))for(var i=0;i<n.length;i++)n[i]&&n[i].callback===t&&n.splice(i,1);return this}},{key:"emit",value:function(e,t){var n=this.events[e];if(!n)return!1;var i,r=l(n);try{for(r.s();!(i=r.n()).done;){var o=i.value;I.check.isObject(o)&&(o.callback.call(this,t||{}),o.once)&&this.off(e,o.callback)}}catch(e){r.e(e)}finally{r.f()}return this}},{key:"clear",value:function(e){e&&this.events(e)?this.events[e]=[]:this.events={}}},{key:"getEvent",value:function(e){return e&&this.events[e]?this.events[e]:this.events}}]),e}();function O(e){C.checkAjax(e.url),e.timeout=e.timeout||2e4;var t,n,i,r,o,a=void 0!==window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:void 0!==window.XDomainRequest?new window.XDomainRequest:null;a&&(t=(e=I.extend({success:function(){},error:function(){}},e)).success,n=e.error,r=function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];i&&(clearTimeout(i),i=null,e)&&(a.onreadystatechange=null,a.onload=null,a.onerror=null)},e.success=function(e){t(e),r()},e.error=function(e){n(e),r()},i=setTimeout(function(){try{a&&I.check.isObject(a)&&a.abort&&a.abort()}catch(e){T.log(e)}r(!0)},e.timeout),o=function(e){return e?I.safeJSONParse(e):""},"undefined"!=typeof XDomainRequest&&a instanceof window.XDomainRequest&&(a.onload=function(){e.success&&e.success(o(a.responseText)),a.onreadystatechange=null,a.onload=null,a.onerror=null},a.onerror=function(){e.error&&e.error(o(a.responseText),a.status),a.onreadystatechange=null,a.onerror=null,a.onload=null}),a.open("post",e.url,!0),e.credentials&&(a.withCredentials=!0),a.setRequestHeader&&a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.onreadystatechange=function(){try{4===a.readyState&&(200<=a.status&&a.status<300||304===a.status?e.success(o(a.responseText)):e.error(o(a.responseText),a.status),a.onreadystatechange=null,a.onload=null)}catch(e){a.onreadystatechange=null,a.onload=null}},a.send(e.data||null))}I.mitt=new e,I.initUrlChange=function(){var e=b.href,t=S.pushState,n=S.replaceState,i=(I.check.isFunction(t)&&(S.pushState=function(){t.apply(S,arguments),I.mitt.emit("urlChange",e),e=b.href}),I.check.isFunction(n)&&(S.replaceState=function(){n.apply(S,arguments),I.mitt.emit("urlChange",e),e=b.href}),t?"popstate":"hashchange");I.addEvent(window,i,function(){I.mitt.emit("urlChange",e),e=b.href})};var j=function(){function t(e){a(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data,this.dataSendTimeout=e.dataSendTimeout}return n(t,[{key:"run",value:function(){O({url:this.serverUrl,data:this.data,timeout:this.dataSendTimeout,success:this.cb,error:this.cb})}},{key:"cb",value:function(){this.callback&&(I.check.isFunction(this.callback)?this.callback():T.log("sdk callback is not a function"))}}]),t}(),F=function(){function t(e){a(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data,this.dataSendTimeout=e.dataSendTimeout,this.img=document.createElement("img"),this.img.width=1,this.img.height=1,e.imgUseCrossOrigin&&(this.img.crossOrigin="anonymous")}return n(t,[{key:"run",value:function(){function e(){t.img&&!t.img.complete&&(t.img.complete=!0,t.cb)&&t.cb()}var t=this;this.img.onload=function(){this.onload=null,e()},this.img.onerror=function(){this.onerror=null,e()},this.img.onabort=function(){this.onabort=null,e()},-1!==this.serverUrl.indexOf("?")?this.img.src=this.serverUrl+"&"+this.data:this.img.src=this.serverUrl+"?"+this.data}},{key:"cb",value:function(){var t=this;if(this.callback){if(!I.check.isFunction(this.callback))return void T.log("sdk callback is not a function");this.callback()}setTimeout(function(){var e=I.info.browser().type;t.img.src="ie"===e?"about:blank":""},this.dataSendTimeout)}}]),t}(),q=function(){function t(e){a(this,t),this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data}return n(t,[{key:"run",value:function(){var e,t=this;I.check.isObject(navigator)&&I.check.isFunction(navigator.sendBeacon)&&((e=new FormData).append("data",I.base64Encode(this.data)),navigator.sendBeacon(this.serverUrl,e)),setTimeout(function(){t.cb()})}},{key:"cb",value:function(){this.callback&&(I.check.isFunction(this.callback)?this.callback():T.log("sdk callback is not a function"))}}]),t}(),B="hinasdk_data_",J=function(){function t(e){a(this,t),this.timer=null,this.sendTimeStamp=0,this.batchConfig=I.extend({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},e.batchSend),this.tabKey="hinasdk_tab",this.config=e}return n(t,[{key:"batchInterval",value:function(){var e=this;C.checkServerUrl(this.config.serverUrl)&&(this.timer=setTimeout(function(){e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},this.batchConfig.sendInterval))}},{key:"request",value:function(e,t){var n=this;O({url:this.config.serverUrl,data:"data_list="+encodeURIComponent(I.base64Encode(JSON.stringify(e))),timeout:this.batchConfig.dataSendTimeout,success:function(){n.remove(t),n.sendTimeStamp=0},error:function(){n.sendTimeStamp=0}})}},{key:"send",value:function(){if(!(this.sendTimeStamp&&I.now()-this.sendTimeStamp<this.batchConfig.dataSendTimeout)){var e=I.localStorage.get(this.tabKey);if(e){this.sendTimeStamp=I.now();var t=I.safeJSONParse(e)||[];if(t.length){for(var n=[],i=[],r=t.length<this.batchConfig.storageLimit?t.length:this.batchConfig.storageLimit,o=0;o<r;o++){var a=I.readObjectVal(t[o].dataKey);i.push(t[o].dataKey),n.push(a)}this.request(n,i)}}}}},{key:"remove",value:function(e){var t=I.localStorage.get(this.tabKey);if(t){for(var n,i=null==(n=I.safeJSONParse(t)||[])?void 0:n.map(function(e){return e.dataKey}),r=0;r<e.length;r++){var o=I.indexOf(i,e[r]);-1<o&&t.splice(o,1),I.localStorage.remove(e[r])}I.localStorage.set(this.tabKey,JSON.stringify(t))}}},{key:"add",value:function(e){var t=B+I.getRandom(),n=null!=(n=I.localStorage.get(this.tabKey))&&I.safeJSONParse(n)||[];if((n=I.check.isString(n)?I.safeJSONParse(n)||[]:n).push({dataKey:t,expireTime:I.now()+2*this.batchConfig.sendInterval}),I.localStorage.set(this.tabKey,JSON.stringify(n)),I.saveObjectVal(t,e),n.length>this.batchConfig.storageLimit){for(var i=n.slice(0,20),r=[],o=0;o<i.length;o++){var a=I.readObjectVal(i[o].dataKey);r.push(a)}this.request(r,i)}"track_signup"!==e.type&&"H_pageview"!==e.event||this.send()}},{key:"recycle",value:function(){var e=I.localStorage.get(this.tabKey);if(e){var t=I.safeJSONParse(e)||[];if(t.length){for(var n=[],i=0;i<t.length;i++)I.now()>t[i].expireTime&&n.push(t[i].dataKey);this.remove(n)}else{for(var r=0;r<localStorage.length;r++){var o=I.localStorage.key(r);0===o.indexOf(B)&&t.push({dataKey:o,expireTime:I.now()+2*this.batchConfig.sendInterval})}0<t.length&&I.localStorage.set(this.tabKey,JSON.stringify(t))}}}}]),t}();function U(){return I.cookie.isSupport()?null!=I.cookie.get("hinasdk_isNewUser"):null!=I.memory.get("hinasdk_isNewUser")}var E={name:"hinasdk_crossdata",state:{deviceId:null,accountId:null,firstId:null,firstVisitTime:I.now(),props:{}},isFirstTime:!1,isFirstDay:U(),isFirstVisit:!0,load:function(){var e,t,n=null;I.cookie.isSupport()?this.storage=I.cookie:(T.log("Cookie storage is not supported, SDK internal cache has been enabled"),this.storage=I.memory),(n=n||this.storage.get(this.name))&&I.check.isJSONString(n)&&(this.state=I.extend({},JSON.parse(n))),n?(this.save(),this.isFirstVisit=!1):this.isFirstVisit=!0,this.isFirstVisit?(t=23-(n=new Date).getHours(),e=59-n.getMinutes(),n=59-n.getSeconds(),this.storage.set("hinasdk_isNewUser",!0,3600*t+60*e+n+"s"),this.isFirstDay=!0,this.isFirstTime=!0):this.checkIsFirstTime=function(e){"track"===e.type&&"H_pageview"===e.event&&(e.properties.H_is_first_time=!1)},this.getAccountId()||(t=I.UUID(),this.setDeviceId(t),this.setAccountId(t))},checkIsFirstTime:function(e){"track"===e.type&&"H_pageview"===e.event&&(U()&&this.isFirstTime?(e.properties.H_is_first_time=!0,this.isFirstTime=!1):e.properties.H_is_first_time=!1)},checkIsFirstSign:function(e){"track"===e.type&&(U()&&this.isFirstDay?e.properties.H_is_first_day=!0:(this.isFirstDay=!1,e.properties.H_is_first_day=!1))},setDeviceId:function(e){this.state.deviceId?T.log("Current deviceId is "+this.getDeviceId()+", it has been set"):this.set("deviceId",e)},setAccountId:function(e){this.set("accountId",e)},getDeviceId:function(){return this.state.deviceId},getAccountId:function(){return this.state.__accountId||this.state.accountId},getFirstId:function(){return this.state.__firstId||this.state.firstId},getAnonymousId:function(){var e=this.getAccountId(),t=this.getFirstId();return e&&t?t:e},change:function(e,t){this.state["__"+e]=t},set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length?arguments[1]:void 0;this.state=this.state||{},-1<["accountId","firstId"].indexOf(e)&&delete this.state["__"+e],this.state[e]=t,this.save()},save:function(){this.storage.set(this.name,JSON.stringify(this.state),null,!0)},clear:function(){this.state={},this.save()}},L={pageProp:{},currentProps:{},register:function(e){I.extend(L.currentProps,e)},getPresetProperties:function(){var e=window.innerHeight||document.documentElement.clientHeight||document.body&&document.body.clientHeight||0,t=window.innerWidth||document.documentElement.clientWidth||document.body&&document.body.clientWidth||0,e={H_timezone_offset:(new Date).getTimezoneOffset(),H_viewport_height:e,H_viewport_width:t};return I.extend(e,I.info.properties()),e},getPageProperties:function(){return I.extend(this.pageProp,I.info.pageProperties()),this.pageProp},getUmtsParams:function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",e=I.getUtm(),o={},a={};return I.each(e,function(e,t,n){I.utmTypes.includes(t)?o[i+t]=n[t]:a[r+t]=n[t]}),{allUtms:o,otherUtms:a}}};function z(e,t,n){E.isFirstVisit&&(t=I.getReferrer(null,t),e.call(n,I.extend({H_first_visit_time:I.now(),H_first_referrer:t,H_first_host:t?I.getHostname(t,"取值异常"):"",H_first_browser_language:I.check.isString(navigator.languages[1])?navigator.languages[1].toLowerCase():"取值异常",H_first_traffic_source_type:x.getSourceFromReferrer(),H_first_search_keyword:x.getKeywordFromReferrer()})),E.isFirstVisit=!1)}function M(e,t){var t=t.config||{},n=L.getUmtsParams("H_",""),i=n.allUtms,n=n.otherUtms,r={anonymous_id:E.getAnonymousId(),properties:o({H_lib:"js",H_lib_version:I.LIB_VERSION,H_lib_method:"code"},E.state.props),type:e.type,event:e.event,time:I.now(),_track_id:Number(String(I.getRandom()).slice(2,5)+String(I.getRandom()).slice(2,4)+String(I.now()).slice(-4))};return E.getAccountId()&&(r.account_id=E.getAccountId()),t.isTrackDeviceId&&(r.device_id=E.getDeviceId()),e.type&&"user"===e.type.slice(0,4)?r.properties=I.extend(r.properties,e.properties):r.properties=I.extend(r.properties,i,n,L.currentProps,L.getPageProperties(),L.getPresetProperties(),e.properties),I.parseSuperProperties(r),E.checkIsFirstSign(r),E.checkIsFirstTime(r),r}var D=window.location,V=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],K=["a","div","input","button","textarea"],W=function(){function i(e,t,n){a(this,i),this.autoTrackIsUsed=!1,this.otherTag=[],this.isTrackList={a:!0,button:!0},this.autoTrackConfig=I.extend({clickAutoTrack:!0,stayAutoTrack:!0,isCollectUrl:function(){return!0},isCollectElement:function(){return!0},isCollectInput:function(){return!1},addCustomProperty:function(){},stayDelayTime:4e3,maxStayPageDuration:18e3,collectTags:{div:!1},trackAttr:[]},e),this.stayAutoTrackConfig=I.extend({isCollectUrl:function(){return!0}},t),this.ctx=n,this.load(e)}return n(i,[{key:"load",value:function(e){var n=this;I.check.isArray(e.trackAttr)?(this.autoTrackConfig.trackAttr=e.trackAttr.filter(function(e){return I.check.isString(e)}),this.autoTrackConfig.trackAttr.push("hn-click")):this.autoTrackConfig.trackAttr=["hn-click"],I.check.isObject(e.collectTags)?(!0===e.collectTags.div?this.autoTrackConfig.collectTags.div={ignoreTags:V,maxLevel:1}:I.check.isObject(e.collectTags.div)?(this.autoTrackConfig.collectTags.div.ignoreTags=V,I.check.isNumber(e.collectTags.div.maxLevel)&&[1,2,3].includes(e.collectTags.div.maxLevel)||(this.autoTrackConfig.collectTags.div.maxLevel=1)):this.autoTrackConfig.collectTags.div=!1,I.each(e.collectTags,function(e,t){"div"!==t&&e&&n.otherTag.push(t)}),!0===this.autoTrackConfig.clickAutoTrack&&I.each(this.otherTag,function(e){e in n.isTrackList&&(n.isTrackList[e]=!0)})):this.autoTrackConfig.collectTags={div:!1}}},{key:"autoTrack",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0;this.ctx.track("H_pageview",I.extend({H_referrer:I.getReferrer(null,!0),H_url:D.href,H_url_path:D.pathname,H_title:document.title},e),t),z(this.ctx.userSetOnce,!0,this.ctx),this.autoTrackIsUsed=!0}},{key:"autoTrackSinglePage",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=this.autoTrackIsUsed?D.href:I.getReferrer();this.ctx.track("H_pageview",I.extend({H_referrer:n,url:D.href,H_url_path:D.pathname,H_title:document.title},e),t),z(this.ctx.userSetOnce,!1,this.ctx)}},{key:"listenSinglePage",value:function(){var i=this,r=this.ctx.getConfig("isSinglePage");r&&I.mitt.on("hasInit",function(){i.onUrlChange(function(t){function e(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};t!==D.href&&(L.pageProp.H_referrer=t,e=I.extend({H_url:D.href,H_referrer:t},e),i.autoTrack(e))}var n;I.check.isBoolean(r)?e():I.check.isFunction(r)&&(n=r(),I.check.isObject(n)?e(n):!0===n&&e())})})}},{key:"initWebClick",value:function(){var n,i=this;!0===this.autoTrackConfig.clickAutoTrack&&(n=!0,I.check.isFunction(this.autoTrackConfig.isCollectUrl)&&this.onUrlChange(function(){n=!!i.autoTrackConfig.isCollectUrl()}),I.addCaptureEvent(document,"click",function(e){var t;n&&(e=e||window.event)&&(t=e.target||e.srcElement,t=i.getTargetElement(t,e))&&i.emitClick(e,t)}))}},{key:"emitClick",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0;if(I.check.isFunction(this.autoTrackConfig.isCollectElement)&&!this.autoTrackConfig.isCollectElement(t))return!1;var r,o=this.getClickElementInfo(t);I.check.isFunction(this.autoTrackConfig.addCustomProperty)&&(r=this.autoTrackConfig.addCustomProperty(t),I.check.isObject(r))&&(o=I.extend(o,r)),o=I.extend(o,this.getPageXYInfo(e,t),n),this.ctx.track("H_WebClick",o,i)}},{key:"initWebStay",value:function(){var e,a,s,c,t,i,n=this;!0===this.autoTrackConfig.stayAutoTrack&&(e=!0,I.check.isFunction(this.stayAutoTrackConfig.isCollectUrl)&&this.onUrlChange(function(){e=!!n.stayAutoTrackConfig.isCollectUrl()}),a=this.autoTrackConfig.stayDelayTime,s=this.autoTrackConfig.maxStayPageDuration,c=this.ctx,(t=i={timer:null,timeout:1e3,callback:function(e,t){var n=(null==(n=document.documentElement)?void 0:n.scrollTop)||window.pageYOffset||document.body.scrollTop||0,i=e.H_viewport_position,r=new Date,o=r-this.nowTime;(a<o&&n-i!=0||t)&&(I.extend(e,{event_duration:Math.min(parseInt(o)/1e3,s)},I.info.pageProperties()),c.track("H_WebStay",e)),this.nowTime=r},run:function(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n={};i.timer||(e=(null==(e=document.documentElement)?void 0:e.scrollTop)||window.pageYOffset||document.body.scrollTop||0,n.H_viewport_position=Math.round(e)||0,t?(i.callback(n,!0),i.timer=null):i.timer=setTimeout(function(){i.callback(n,!1),i.timer=null},i.timeout))}}).nowTime=new Date,I.addCaptureEvent(window,"scroll",function(){e&&t.run()}),I.addCaptureEvent(window,"unload",function(){e&&t.run(!0)}))}},{key:"onUrlChange",value:function(e){I.check.isFunction(e)&&(e(),I.mitt.on("urlChange",e))}},{key:"getTargetElement",value:function(e,t){if(!I.check.isElement(e))return null;if(!I.check.isString(e.tagName))return null;var n=e.tagName.toLowerCase();if(["body","html"].includes(n))return null;if(["a","button","input","textarea"].concat(this.otherTag).includes(n))return e;if("div"===n&&this.autoTrackConfig.collectTags.div&&this.isDivLevelValid(e)&&(1<((null==(i=this.autoTrackConfig.collectTags)||null==(i=i.div)?void 0:i.maxLevel)||1)||this.isCollectableDiv(e)))return e;if(this.isStyleTag(n)&&this.autoTrackConfig.collectTags.div){var i=this.getCollectableParent(e);if(i&&this.isDivLevelValid(i))return i}return this.hasElement({event:(null==t?void 0:t.originalEvent)||t,element:e})||null}},{key:"isDivLevelValid",value:function(e){for(var t,n=(null==(t=this.autoTrackConfig.collectTags)||null==(t=t.div)?void 0:t.maxLevel)||1,i=e.getElementsByTagName("div"),r=i.length-1;0<=r;r--)if(this.getDivLevel(i[r],e)>n)return!1;return!0}},{key:"getDivLevel",value:function(e,t){var e=this.getElementPath(e,!0,t).split(" > "),n=0;return e.forEach(function(e){"div"===e&&n++}),n}},{key:"getElementPath",value:function(e,t,n){for(var i=[];e.parentNode&&I.check.isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){i.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(n&&e===n){i.unshift(e.tagName.toLowerCase());break}if(e===document.body){i.unshift("body");break}i.unshift(e.tagName.toLowerCase()),e=e.parentNode}return i.join(" > ")}},{key:"isCollectableDiv",value:function(e){try{var t=e.children||[];if(0!==(null==t?void 0:t.length))for(var n,i,r=0;r<t.length;r++)if(1===t[r].nodeType){var o=t[r].tagName.toLowerCase(),a=(null==(n=this.autoTrackConfig.collectTags)||null==(i=n.div)?void 0:i.maxLevel)||1;if(!("div"===o&&1<a||this.isStyleTag(o)))return!1;if(!this.isCollectableDiv(t[r]))return!1}return!0}catch(e){T.log(e)}return!1}},{key:"getCollectableParent",value:function(e){try{var t,n,i=e.parentNode,r=i?i.tagName.toLowerCase():"";if("body"===r)return!1;var o=(null==(t=this.autoTrackConfig.collectTags)||null==(n=t.div)?void 0:n.maxLevel)||1;if("div"===r&&(1<o||this.isCollectableDiv(i)))return i;if(i&&this.isStyleTag(r))return this.getCollectableParent(i)}catch(e){T.log(e)}return!1}},{key:"isStyleTag",value:function(e){var t;return!K.includes(e)&&!(null==(t=this.autoTrackConfig.collectTags)||null==(t=t.div)||null==(t=t.ignoreTags)||!t.includes(e))}},{key:"hasElement",value:function(e){e.event?t=(t=e.event).path||(null==t?void 0:t._getPath()):e.element&&(t=I.getDomElementInfo(e.element).getParents());var t,n=this.autoTrackConfig.trackAttr;if(I.check.isArray(t)&&0<t.length){var i,r=l(t);try{for(r.s();!(i=r.n()).done;){var o,a=i.value,s=null==(o=a.tagName)?void 0:o.toLowerCase();if(I.check.isElement(a)&&1===a.nodeType&&(this.isTrackList[s]||this.hasAttributes(a,n)))return a}}catch(e){r.e(e)}finally{r.f()}}}},{key:"hasAttribute",value:function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(null==(e=e.attributes[t])||!e.value):void 0}},{key:"hasAttributes",value:function(e,t){if(I.check.isArray(t)){for(var n=!1,i=0;i<t.length;i++)if(this.hasAttribute(e,t[i])){n=!0;break}return n}}},{key:"getPageXYInfo",value:function(e,t){return e?(n=(e=e).pageX||e.clientX+i().scrollLeft||e.offsetX+r().targetEleX||0,e=e.pageY||e.clientY+i().scrollTop||e.offsetY+r().targetEleY||0,{H_page_x:o(n),H_page_y:o(e)}):{};var n;function i(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function r(){var e;if(document.documentElement.getBoundingClientRect)return{targetEleX:(e=t.getBoundingClientRect()).left+i().scrollLeft||0,targetEleY:e.top+i().scrollTop||0}}function o(e){return Number(Number(e).toFixed(3))}}},{key:"getClickElementInfo",value:function(e){var t=this.autoTrackConfig.isCollectInput(),n=this.getDomSelector(e),t=I.info.getElementInfo(e,t);return t.H_element_selector=n||"",t.H_element_path=this.getElementPath(e,!1),t}},{key:"getDomSelector",value:function(e){var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return!!(e&&e.parentNode&&e.parentNode.children)&&(t=e.nodeName.toLowerCase(),e&&"body"!==t&&1===e.nodeType?(n.unshift(this.getSelector(e)),null!=e&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))?n.join(" > "):this.getDomSelector(e.parentNode,n)):(n.unshift("body"),n.join(" > ")))}},{key:"getSelector",value:function(e){var t,n=e.tagName.toLowerCase(),i=-1;return 9!==(null==e||null==(t=e.parentNode)?void 0:t.nodeType)&&(i=this.getDomIndex(e)),null!=e&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))?"#"+e.getAttribute("id"):n+(~i?":nth-of-type("+(i+1)+")":"")}},{key:"getDomIndex",value:function(e){if(e.parentNode)for(var t,n=0,i=e.tagName.toLowerCase(),r=e.parentNode.children,o=0;o<r.length;o++)if((null==(t=r[o])||null==(t=t.tagName)?void 0:t.toLowerCase())===i){if(r[o]===e)return n;n++}return-1}}]),i}(),N=window.location,X={SiteLinker:function(){function e(){a(this,e),this.ctx={},this.option={},this.isInited=!1}return n(e,[{key:"init",value:function(e,t){this.ctx=e,this.option=t,this.isInited||(this.isInited=!0,I.check.isObject(t)&&I.check.isArray(t.linker)&&0<t.linker.length?(this.setRefferId(t),this.addClickListen(),this.option=function(e){for(var t=e.length,n=[],i=0;i<t;i++)/[A-Za-z0-9]+\./.test(e[i].part_url)&&I.check.isBoolean(e[i].after_hash)?n.push(e[i]):T.log("The configuration of linker "+(i+1)+" is not supported.Please check format");return n}(t.linker)):T.log("siteLinker plugin: Please configure the linker parameter"))}},{key:"getPartUrl",value:function(e){var t=this.option.length;if(t)for(var n=0;n<t;n++)if(-1<e.indexOf(this.option[n].part_url))return!0;return!1}},{key:"getPartHash",value:function(e){var t=this.option.length;if(t)for(var n=0;n<t;n++)if(-1<e.indexOf(this.option[n].part_url))return this.option[n].after_hash;return!1}},{key:"getCurrentId",value:function(){var e=this.ctx.store.getAccountId()||"",t=this.ctx.store.getFirstId()||"";return I.encodeURIComponent(t?"f"+e:"d"+e)}},{key:"rewriteUrl",value:function(e,t){var n,i,r,o,a=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),s="";if(a)return n=a[1]||"",i=a[2]||"",a=a[3]||"",r="_hnsdk="+this.getCurrentId(),s=this.getPartHash(e)?(o=a.indexOf("_hnsdk"),-1<a.indexOf("?")?-1<o?n+i+"#"+a.substring(1,o)+c(a.substring(o,a.length)):n+i+"#"+a.substring(1)+"&"+r:n+i+"#"+a.substring(1)+"?"+r):(o=i.indexOf("_hnsdk"),/^\?(\w)+/.test(i)?-1<o?n+"?"+c(i.substring(1))+a:n+"?"+i.substring(1)+"&"+r+a:n+"?"+i.substring(1)+r+a),t&&(t.href=s),s;function c(e){var e=e.split("&"),t=[];return I.each(e,function(e){-1<e.indexOf("_hnsdk=")?t.push(r):t.push(e)}),t.join("&")}}},{key:"getUrlId",value:function(){var e=N.href.match(/_hnsdk=([aufd][^\?\#\&\=]+)/);return I.check.isArray(e)&&e[1]?I.decodeURIComponent(e[1]):""}},{key:"setRefferId",value:function(e){var t=this.ctx.store.getAccountId();if(""===(n=this.getUrlId()))return!1;var n,i="d"===n.substring(0,1);(n=n.substring(1))!==t&&(i?(this.ctx.setDeviceUId(n,!0),this.ctx.store.getFirstId()&&this.ctx.sendRequest({anonymous_id:n,account_id:t,type:"track_signup",event:"H_signUp",properties:{}})):this.ctx.store.getFirstId()&&!e.re_login||this.ctx.setUserUId(n))}},{key:"addClickListen",value:function(){function e(e){var t,n=(e=e.target).tagName.toLowerCase(),i=e.parentNode,r=null==i||null==(r=i.tagName)?void 0:r.toLowerCase();("a"===n&&e.href||"a"===r&&i.href)&&(r="a"===n&&e.href?(t=e.href,e):(t=i.href,i),"http:"!==(n=I.URL(t).protocol)&&"https:"!==n||o.getPartUrl(t)&&o.rewriteUrl(t,r))}var o=this;I.addEvent(document,"mosedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&0<=window.navigator.maxTouchPoints&&I.addEvent(document,"pointerdown",e)}}]),e}(),PageLoad:function(){function e(){a(this,e),this.ctx={},this.option={},this.isInited=!1}return n(e,[{key:"init",value:function(e,t){function i(){var e=0,t=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,n={H_url:(n=window.location).href,H_title:document.title,H_url_path:n.pathname,H_referrer:I.getReferrer(null,!0)};t?(e=r.getDuration(t)||r.getDurationCompatible(t),r.getPageSize(t,n),0<e&&(t=1800,I.check.isObject(r.option)&&r.option.max_duration&&(t=r.option.max_duration),e=Number((e/1e3).toFixed(3)),!I.check.isNumber(t)||t<=0||e<=t)&&(n.event_duration=e),r.isInited||(r.ctx.track("H_WebPageLoad",n),r.isInited=!0),window.removeEventListener&&window.removeEventListener("load",i)):T.log("your browser not support performance API")}var r=this;this.ctx=e,this.option=t;"complete"===document.readyState?i():window.addEventListener&&window.addEventListener("load",i)}},{key:"getPageSize",value:function(e,t){if(e.getEntries&&I.check.isFunction(e.getEntries)){for(var n=e.getEntries(),i=0,r=0;r<n.length;r++)"transferSize"in n[r]&&(i+=n[r].transferSize);I.check.isNumber(i)&&0<=i&&i<10737418240&&(t.H_page_resource_size=Number((i/1024).toFixed(3)))}}},{key:"getDurationCompatible",value:function(e){var t=0;return e.timing&&(0!==(e=e.timing).fetchStart&&I.check.isNumber(e.fetchStart)&&0!==e.domContentLoadedEventEnd&&I.check.isNumber(e.domContentLoadedEventEnd)?t=e.domContentLoadedEventEnd-e.fetchStart:T.log("performance data parsing exception")),t}},{key:"getDuration",value:function(e){var t=0;return t=I.check.isFunction(e.getEntriesByType)?((e.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0:t}}]),e}(),PageLeave:function(){function e(){a(this,e),this.isInited=!1,this.startTime=I.now(),this.currentPageUrl=document.referrer,this.url=N.href,this.title=document.title||"",this.pageShowStatus=!0,this.pageHiddenStatus=!1,this.timer=null,this.heartbeatIntervalTime=5e3,this.heartbeatIntervalTimer=null,this.pageId=null,this.maxDuration=432e3,this.storageName="hinasdk_pageleave_"}return n(e,[{key:"init",value:function(e,t){this.ctx=e,this.option=t,this.isInited||(this.isInited=!0,this.option&&((e=(this.option=t).heartbeat_interval_time)&&I.check.isNumber(+e)&&0<+e&&(this.heartbeatIntervalTime=1e3*e),e=t.max_duration)&&I.check.isNumber(+e)&&0<+e&&(this.maxDuration=e),this.pageId=Number(String(I.getRandom()).slice(2,5)+String(I.getRandom()).slice(2,4)+String(I.now()).slice(-4)),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.addHeartBeatInterval())}},{key:"refreshPageEndTimer",value:function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.pageHiddenStatus=!1},5e3)}},{key:"hiddenStatusHandler",value:function(){clearTimeout(this.timer),this.timer=null,this.pageHiddenStatus=!1}},{key:"pageStartHandler",value:function(){this.startTime=I.now(),!0===document.hidden?this.pageShowStatus=!1:this.pageShowStatus=!0,this.url=N.href,this.title=document.title}},{key:"pageEndHandler",value:function(){var e;this.pageHiddenStatus||(e=this.getPageLeaveProperties(),this.pageShowStatus||delete e.event_duration,this.pageShowStatus=!1,this.pageHiddenStatus=!0,this.isCollectUrl(this.url)&&this.ctx.track("H_WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData())}},{key:"addPageLeaveEventListener",value:function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()}},{key:"addPageStartListener",value:function(){var e=this;"onpageshow"in window&&I.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})}},{key:"addPageSwitchListener",value:function(){var t=this;I.mitt.prepend("urlChange",function(e){e!==N.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.currentPageUrl=e,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})}},{key:"addSinglePageListener",value:function(){}},{key:"addPageEndListener",value:function(){var t=this;I.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&I.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})}},{key:"addHeartBeatInterval",value:function(){I.localStorage.isSupport()&&this.startHeartBeatInterval()}},{key:"startHeartBeatInterval",value:function(){var e=this,t=(this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),!0);(t=this.isCollectUrl(this.url)?t:!1)&&(this.heartbeatIntervalTimer=setInterval(function(){e.saveHeartBeatData()},this.heartbeatIntervalTime),this.saveHeartBeatData("first")),this.reissueHeartBeatData()}},{key:"reissueHeartBeatData",value:function(){for(var e=I.localStorage.length-1;0<=e;e--){var t,n=I.localStorage.key(e);n&&n!==this.storageName+this.pageId&&-1<n.indexOf(this.storageName)&&(t=I.readObjectVal(n),I.check.isObject(t))&&I.now()-t.time>t.heartbeat_interval_time+5e3&&(delete t.heartbeat_interval_time,this.ctx.sendRequest(t),this.delHeartBeatData(n))}}},{key:"stopHeartBeatInterval",value:function(){this.heartbeatIntervalTimer&&clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null}},{key:"saveHeartBeatData",value:function(e){var t=this.getPageLeaveProperties(),e=(t.H_time=I.now(),"first"===e&&(t.event_duration=3),M({type:"track",event:"H_WebPageLeave",properties:t},this.ctx));e.heartbeat_interval_time=this.heartbeatIntervalTime,I.saveObjectVal(this.storageName+this.pageId,e)}},{key:"delHeartBeatData",value:function(e){I.localStorage.isSupport()&&I.localStorage.remove(e||this.storageName+this.pageId)}},{key:"isCollectUrl",value:function(e){return!I.check.isFunction(this.option.isCollectUrl)||!I.check.isString(e)||this.option.isCollectUrl(e)}},{key:"getPageLeaveProperties",value:function(){var e=(I.now()-this.startTime)/1e3,t=((!I.check.isNumber(e)||e<0||e>this.maxDuration)&&(e=0),e=Number(e.toFixed(3)),I.getReferrer(this.currentPageUrl)),n=(null==(n=document.documentElement)?void 0:n.scrollTop)||window.pageYOffset||(null==(n=document.body)?void 0:n.scrollTop)||0,n=Math.round(n)||0,t={H_title:this.title,H_url:this.url,H_url_path:I.URL(this.url).pathname,H_referrer_host:t?I.getHostname(t):"",H_referrer:t,H_viewport_position:n};return e&&(t.event_duration=e),t=I.extend(t,this.option.custom_props)}}]),e}()},$={name:"",showLog:!1,autoTrackConfig:{clickAutoTrack:!1,stayAutoTrack:!1},stayAutoTrackConfig:{},imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:"image",dataSendTimeout:3e3,isTrackDeviceId:!1,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0,url:!0,title:!0}},e=new Proxy(new(function(){function e(){return a(this,e),e.instance||((e.instance=this).config={},this.initialized=!1,this._=I),e.instance}return n(e,[{key:"setConfig",value:function(e){I.check.isObject(e)&&I.extend(this.config,e)}},{key:"getConfig",value:function(e){return this.config[e]}},{key:"init",value:function(e){var t,n,i;I.check.isEmptyObject(this.config)?(this.setConfig(I.extend({},$,e)),T.showLog=this.getConfig("showLog"),C.serverUrl=this.getConfig("serverUrl"),I.initUrlChange(),E.load(this.config),e=this.config,i={},I.each(e.presetProperties,function(e,t){if(-1===t.indexOf("latest_"))return!1;if(t=t.slice(7),e){e=I.getCurrentDomain(window.location.href);if("utm"!==t&&"url解析失败"===e)i["H_latest_"+t]="url的domain解析失败";else if(I.isReferralTraffic(document.referrer))switch(t){case"traffic_source_type":i.H_latest_traffic_source_type=x.getSourceFromReferrer();break;case"referrer":i.H_latest_referrer=L.pageProp.referrer;break;case"search_keyword":x.getKeywordFromReferrer()&&(i.H_latest_search_keyword=x.getKeywordFromReferrer())}}}),e.presetProperties.latest_utm&&(n=(e=L.getUmtsParams("H_latest_","_latest_")).allUtms,e=e.otherUtms,I.check.isEmptyObject(n)||I.extend(i,n),I.check.isEmptyObject(e)||I.extend(i,e)),L.register(i),this.store=E,n=this.getConfig("sendType"),["image","ajax","beacon"].includes(n)||this.setConfig({sendType:"image"}),!0!==this.getConfig("batchSend")&&!I.check.isObject(this.getConfig("batchSend"))||(this.batchSender=new J(this.config),this.batchSender.batchInterval()),e=this.getConfig("autoTrackConfig"),t=this.getConfig("stayAutoTrackConfig"),e=new W(e,t,this),(this.autoTrackInstance=e).initWebClick(),e.initWebStay(),e.listenSinglePage(),this.initialized=!0,T.log("hinaSDK initialized successfully"),I.mitt.emit("hasInit")):T.log("hinaSDK has been initialized")}},{key:"sendRequest",value:function(e,t){if((e=M(e,this)).send_time=I.now(),T.log(e),this.getConfig("appJsBridge")){var n=window.Hina_Cloud_H5_Bridge||{};if(I.check.isObject(n)&&n.track)return n.track(e.event,e.type,JSON.stringify(e)),I.check.isFunction(t)&&t(),void T.log("The data has been sent to the Android side");if("iOS"===I.info.os()){n=null==(n=window.webkit)||null==(n=n.messageHandlers)?void 0:n.hinaNativeTracker;if(null!=n&&n.postMessage)return i=JSON.stringify({eventName:e.event,eventType:e.type,properties:e}),n.postMessage(i),I.check.isFunction(t)&&t(),void T.log("The data has been sent to the iOS side")}T.log("The app JSBridge data transmission has failed.")}if(this.getConfig("batchSend"))new J(this.config).add(e);else{I.check.isString(e)||(e=JSON.stringify(e));var n=I.base64Encode(e),i="crc="+I.hashCode(n),e="data="+I.encodeURIComponent(n)+"&ext="+I.encodeURIComponent(i),n=this.getConfig("sendType"),r={callback:t,data:e,serverUrl:this.getConfig("serverUrl"),dataSendTimeout:this.getConfig("dataSendTimeout")};switch(n){case"ajax":new j(r).run();break;case"beacon":new q(r).run();break;default:new F(I.extend(r,{imgUseCrossOrigin:this.getConfig("imgUseCrossOrigin")})).run()}}}},{key:"quick",value:function(e){for(var t={autoTrack:this.autoTrackInstance.autoTrack,autoTrackSinglePage:this.autoTrackInstance.autoTrackSinglePage},n=arguments.length,i=new Array(1<n?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t[e].call(this.autoTrackInstance,i)}},{key:"track",value:function(e,t,n){n=I.check.isFunction(n)?n:function(){};I.check.isString(e)&&I.check.isObject(t)?this.sendRequest({type:"track",event:e,properties:t},n):T.log("eventName must be a sting and properties must be an object")}},{key:"setUserUId",value:function(e,t){var n,i;I.check.isNumber(e)||I.check.isString(e)?(e=String(e),n=this.store.getFirstId(),e!==(i=this.store.getAccountId())||n?e!==i&&(n||this.store.set("firstId",i),this.store.setAccountId(e),this.sendRequest({account_id:this.store.getAccountId(),type:"track_signup",event:"H_signUp",properties:{}},t)):T.log("setUserUId: uid is equal to account_id")):T.log("setUserUId: uid must be string or number")}},{key:"getDeviceUId",value:function(){return this.store.getAnonymousId()}},{key:"setDeviceUId",value:function(e,t){var n,i=this.store.getFirstId();I.check.isUndefined(e)?(n=I.UUID(),i?this.store.set("firstId",n):this.store.setAccountId(n)):(I.check.isNumber(e)||I.check.isString(e))&&(e=String(e),!0===t?i?this.store.set("firstId",e):this.store.set("accountId",e):i?this.store.change("firstId",e):this.store.change("accountId",e))}},{key:"userSet",value:function(e,t){I.check.isObject(e)&&!I.check.isEmptyObject(e)&&this.sendRequest({type:"user_set",properties:e},t)}},{key:"userSetOnce",value:function(e,t){I.check.isObject(e)&&!I.check.isEmptyObject(e)&&this.sendRequest({type:"user_setOnce",properties:e},t)}},{key:"userAdd",value:function(e,t){I.check.isString(e)&&(e=c({},e,1)),I.check.isObject(e)&&!I.check.isEmptyObject(e)&&function(e){for(var t in e)if(t in e&&!/-*\d+/.test(String(e[t])))return T.log("userAdd: value is must be number"),0;return 1}(e)&&this.sendRequest({type:"user_add",properties:e},t)}},{key:"userUnset",value:function(e,t){var n={};I.check.isString(e)&&(e=[e]),I.check.isArray(e)?(I.each(e,function(e){I.check.isString(e)?n[e]=!0:T.log("userUnset: value inside the array must be string and have already been filtered out",e)}),this.sendRequest({type:"user_unset",properties:n},t)):T.log("userUnset: param must be an array or string")}},{key:"userDelete",value:function(e){this.sendRequest({type:"user_delete"},e),this.store.setAccountId(I.UUID()),this.store.set("firstId","")}},{key:"registerCommonProperties",value:function(e){this.store.set("props",e)}},{key:"getPresetProperties",value:function(){return e=(t=L.getUmtsParams("H_","")).allUtms,t=t.otherUtms,n={H_is_first_day:E.isFirstDay,H_is_first_time:E.isFirstTime,device_id:E.getDeviceId(),anonymous_id:E.getAnonymousId(),account_id:E.getAccountId(),properties:o({},E.state.props)},I.extend(n.properties,e,t,L.getPresetProperties(),L.getPageProperties()),n;var e,t,n}},{key:"use",value:function(e,t){I.check.isString(e)?e in X?(new X[e]).init(this,t):T.log("please write a valid plugin name"):T.log("pluginName must be string")}}]),e}()),{get:function(i,r){return I.check.isFunction(i[r])?function(){if(i.initialized||"init"===r){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i[r].apply(i,t)}console.log("sdk not yet initialized!")}:i[r]}});return window.hinaDataStatistic=e});
@@ -0,0 +1 @@
1
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";var e=document.createElement("script");e.integrity="sha384-d7r7Q+K7p1zv6z7dX8fFn3u3pgGz1l4/eUgZGBnKU7gN3k6IjzR4b2q6s7s5+6+7",e.crossOrigin="anonymous",e.async="async",e.src="https://cdn.staticfile.org/jquery/3.0.0/jquery.min.js",e.type="text/javascript",e.addEventListener("load",function(){var e,n,t,k=!1,B=220,E=315,H=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,o='\n .hina-click-area:before{\n pointer-events: none;\n cursor: pointer;\n content: "";\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: rgba(56, 166, 251, 0.6);\n box-shadow: rgba(0, 0, 0, 0.6) 0px 2px 4px;\n cursor: pointer\n }\n .hina-click-area:after{\n pointer-events: none;\n height: 14px;\n line-height: 14px;\n margin: -7px 0 0 -28px;\n width: 56px;\n color: #fff;\n content: attr(data-click);\n font-size: 14px;\n font-weight: 700;\n left: 50%;\n line-height: 1em;\n position: absolute;\n text-align: center;\n text-indent: 0;\n text-shadow: 1px 1px 2px #000;\n top: 50%;\n z-index: 999;\n}\n',i=document.createElement("style");i.type="text/css";try{i.appendChild(document.createTextNode(o))}catch(e){i.styleSheet.cssText=o}var o=document.getElementsByTagName("head")[0],l=document.getElementsByTagName("script")[0];o?o.children.length?o.insertBefore(i,o.children[0]):o.appendChild(i):l.parentNode.insertBefore(i,l),window.addEventListener("message",function(n){var t,o,i,e=null==(e=n.data)?void 0:e.type;if("view"===e){var l=null==(g=n.data)?void 0:g.lastGraph;$("body > .shadeBoxWrap").remove();for(var a=0;a<(null==l?void 0:l.length);a++){var d=l[a].H_element_selector;$(d).removeClass("hina-click-area")}k=!1,window.removeEventListener("scroll",function(){},!0);for(var s=null==(g=n.data)||null==(g=g.viewData)?void 0:g[0],r=null==(g=[null==s?void 0:s.view100,null==s?void 0:s.view90,null==s?void 0:s.view80,null==s?void 0:s.view70,null==s?void 0:s.view60,null==s?void 0:s.view50,null==s?void 0:s.view40,null==s?void 0:s.view30,null==s?void 0:s.view20,null==s?void 0:s.view10])?void 0:g.map(function(e){return e+H}),c=new Array(10).fill(1).map(function(e,n){return 10*(n+1)}).reverse(),p=function(e){return"\n <span \n style='\n font-size:12px;\n position:absolute;\n padding: 0 12px;\n top: -24px;\n height: 26px;\n line-height: 26px;\n left: 0;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n '>\n ".concat(e,"%\n </span>\n ")},u=0;u<c.length;u++){var v=document.createElement("div"),h=(v.setAttribute("style","\n border-bottom: 1px dashed #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n top: 50px;\n z-index:999;\n "),v.setAttribute("class","viewBaseLineStyle"),s["view".concat(c[u])]);v.style.top="".concat(h+H,"px"),0!==u?26<s["view".concat(c[u])]-s["view".concat(c[u-1])]&&(v.innerHTML=p(c[u])):26<s["view".concat(c[u])]&&(v.innerHTML=p(c[u])),document.body.appendChild(v)}var x=document.createElement("div");x.setAttribute("style","\n border-bottom: 1px solid #0174df;\n height: 1px;\n width: 100%;\n position: absolute;\n z-index: 9999;\n top: 0;\n "),x.setAttribute("class","viewMoveLineStyle"),document.body.appendChild(x),$(document).on("mousemove",(t=function(e){x.style.top="".concat(e.pageY,"px");e=function(e,n){for(var t=0;t<e.length;t++)if(e[t]>n)return t}(r,e.pageY),e=c[e];x.innerHTML="\n <span \n style='\n font-size:12px;\n height:26px;\n line-height: 26px;\n background: #E6F1FB;\n color: #0174df;\n border-radius: 2px;\n left:50%;\n margin-left:-65px;\n position: absolute;\n top:-13px;\n padding: 0 5px;\n '>\n ".concat(e||0,"%的用户浏览到这里\n </span>\n ")},o=150,i=Date.now(),function(){var e=arguments,n=Date.now();o<=n-i&&(t.apply(this,e),i=Date.now())}))}else if("click"===e){k=!0,$("body > .viewBaseLineStyle").remove(),$("body > .viewMoveLineStyle").remove();var f=null==(g=n.data)?void 0:g.hotData,g=null==(e=n.data)?void 0:e.isResize,y=null==(e=n.data)?void 0:e.lastGraph;if(g&&$("body > .shadeBoxWrap").remove(),null!=f&&f.length){for(var b=function(){var e,n,t,o,i=f[m],l=(i.H_element_content,i.H_element_selector),a=(i.button_click_prop,i.button_click_rate),i=(i.button_click_times,i.button_click_users,i.his_H_element_content,document.createElement("div")),d=(i.setAttribute("style","position: relative;\n "),i.setAttribute("class","hina-click-area"),i=f[m],e=i.H_element_content,i.H_element_selector,n=i.button_click_prop,h=i.button_click_rate,t=i.button_click_times,o=i.button_click_users,i=i.his_H_element_content,e="\n <div style='padding: 8px;'>\n <div style='color: #CACACA'>当前内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>".concat(e||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <table style='width:100%;color:#fff;font-size:13px;background:#333;border:1px solid #333;'>\n <tr>\n <td>点击次数:</td>\n <td style='text-align:right;'>").concat(t,"</td>\n </tr>\n <tr>\n <td>点击人数:</td>\n <td style='text-align:right;'>").concat(o,"</td>\n </tr>\n <tr>\n <td>点击率:</td>\n <td style='text-align:right;'>").concat(h,"</td>\n </tr>\n <tr>\n <td>点击占比:</td>\n <td style='text-align:right;'>").concat(n,"</td>\n </tr>\n </table>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 8px;'>\n <div style='color: #CACACA;'>历史内容:</div>\n <div style='white-space:nowrap;overflow:hidden;text-overflow:ellipsis;'>").concat(i||"-","</div>\n </div>\n <div style='background: #444; height:1px;'></div>\n <div style='padding: 6px 8px;' class='user-list' hina-tag-disable='true'>\n <p style='color:#2a90e2;text-decoration: none;'>查看用户列表</p>\n </div>\n "),t=document.createElement("div"),document.body.appendChild(t),t.setAttribute("class","shadeBoxWrap"),t.setAttribute("style","\n border-radius:3px;\n display: none;\n border:1px solid #000;\n cursor: pointer;\n position: absolute;\n left:0;\n top:0;\n background: #333;\n line-height:24px;\n font-size:13px;\n width:".concat(B,"px;\n height:").concat(E,"px;\n color: #fff;\n box-shadow: 0 2px 4px rgba(0,0,0,0.24);\n z-index:9999;\n ")),t.innerHTML=e,t),s=null==(o=$(l))||null==(h=o.offset())?void 0:h.left,r=window.scrollY,c=$(window).width(),p=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,u=null==(n=$(l))||null==(i=n.position())?void 0:i.top,v=null==(e=$(l))||null==(t=e.offset())?void 0:t.top,h=null==(o=$(l))?void 0:o.css("width"),x=null==(n=$(l))?void 0:n.css("height");$(l).addClass("hina-click-area"),$(l).css("position","relative"),$("".concat(l,":before")).css("position","absolute"),$(l).attr("data-click",a),[h,x,"undefined"].includes("0px")&&($(l).removeClass("display","inline-block"),$(l).css("width","15px"),$(l).css("height","15px")),$(l).mouseenter(function(){$("body > .shadeBoxWrap > .user-list > p").attr("drillSelector",l),v<50?$("body > .shadeBoxWrap").css("position","fixed"):$("body > .shadeBoxWrap").css("position","absolute"),d.style.display="block",c-s<B?(d.style.left="".concat(s-B,"px"),d.style.top="".concat(E<v?v+parseFloat(x)-E:v,"px")):(d.style.left="".concat(s,"px"),E<p-v?window.scrollY>E?d.style.top="".concat(u+parseFloat(x),"px"):d.style.top="".concat(v+parseFloat(x)-r,"px"):d.style.top="".concat(v-E,"px"))}),$(l).mouseleave(function(){$("body > .shadeBoxWrap").css("display","none")}),d.addEventListener("mouseenter",function(){d.style.display="block"}),d.addEventListener("mouseleave",function(){$("body > .shadeBoxWrap").css("display","none")})},m=0;m<(null==f?void 0:f.length);m++)b();$("body > .shadeBoxWrap > .user-list > p").on("click",function(e){n.stopPropagation(),window.parent.postMessage({eleSelector:null==e||null==(e=e.target)||null==(e=e.attributes)||null==(e=e.drillselector)?void 0:e.value},"*")})}else for(var w=0;w<(null==y?void 0:y.length);w++){var _=y[w].H_element_selector;$(_).removeClass("hina-click-area")}}},!1),window.addEventListener("scroll",(e=function(){k&&window.parent.postMessage({isRefush:!0},"*")},n=800,function(){null!==t&&clearTimeout(t),t=setTimeout(e,n)}),!(t=null))}),document.head.appendChild(e)});
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "hina-cloud-js-sdk",
3
+ "version": "0.0.1",
4
+ "description": "hinaCloud javascript sdk",
5
+ "main": "build/hina.min.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "rollup -c",
9
+ "lint:report": "eslint ./src -f json -o report.json --ext .js,.ts || exit 0"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git@gitlab.hinadt.com:hina-cloud/hina-cloud-js-sdk.git"
14
+ },
15
+ "keywords": [
16
+ "sdk",
17
+ "javascript",
18
+ "hinaCloud"
19
+ ],
20
+ "devDependencies": {
21
+ "@babel/core": "^7.5.4",
22
+ "@babel/plugin-proposal-optional-chaining": "^7.20.7",
23
+ "@babel/preset-env": "^7.5.4",
24
+ "eslint": "^8.46.0",
25
+ "rollup": "^1.16.7",
26
+ "rollup-plugin-babel": "^4.3.3",
27
+ "rollup-plugin-javascript-obfuscator": "^1.0.4",
28
+ "rollup-plugin-uglify": "^6.0.4"
29
+ },
30
+ "author": "",
31
+ "license": "ISC",
32
+ "dependencies": {
33
+ "crypto": "^1.0.1"
34
+ }
35
+ }
package/report.json ADDED
@@ -0,0 +1,101 @@
1
+ [
2
+ {
3
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/hotAnalyse.js",
4
+ "messages": [],
5
+ "suppressedMessages": [],
6
+ "errorCount": 0,
7
+ "fatalErrorCount": 0,
8
+ "warningCount": 0,
9
+ "fixableErrorCount": 0,
10
+ "fixableWarningCount": 0,
11
+ "usedDeprecatedRules": []
12
+ },
13
+ {
14
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/monitor/performance-monitor/index.js",
15
+ "messages": [],
16
+ "suppressedMessages": [],
17
+ "errorCount": 0,
18
+ "fatalErrorCount": 0,
19
+ "warningCount": 0,
20
+ "fixableErrorCount": 0,
21
+ "fixableWarningCount": 0,
22
+ "usedDeprecatedRules": []
23
+ },
24
+ {
25
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/monitor/performance-monitor/web-vitals.js",
26
+ "messages": [],
27
+ "suppressedMessages": [],
28
+ "errorCount": 0,
29
+ "fatalErrorCount": 0,
30
+ "warningCount": 0,
31
+ "fixableErrorCount": 0,
32
+ "fixableWarningCount": 0,
33
+ "usedDeprecatedRules": []
34
+ },
35
+ {
36
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/autoTrack.js",
37
+ "messages": [],
38
+ "suppressedMessages": [],
39
+ "errorCount": 0,
40
+ "fatalErrorCount": 0,
41
+ "warningCount": 0,
42
+ "fixableErrorCount": 0,
43
+ "fixableWarningCount": 0,
44
+ "usedDeprecatedRules": []
45
+ },
46
+ {
47
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/http.js",
48
+ "messages": [],
49
+ "suppressedMessages": [],
50
+ "errorCount": 0,
51
+ "fatalErrorCount": 0,
52
+ "warningCount": 0,
53
+ "fixableErrorCount": 0,
54
+ "fixableWarningCount": 0,
55
+ "usedDeprecatedRules": []
56
+ },
57
+ {
58
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/index.js",
59
+ "messages": [],
60
+ "suppressedMessages": [],
61
+ "errorCount": 0,
62
+ "fatalErrorCount": 0,
63
+ "warningCount": 0,
64
+ "fixableErrorCount": 0,
65
+ "fixableWarningCount": 0,
66
+ "usedDeprecatedRules": []
67
+ },
68
+ {
69
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/plugin.js",
70
+ "messages": [],
71
+ "suppressedMessages": [],
72
+ "errorCount": 0,
73
+ "fatalErrorCount": 0,
74
+ "warningCount": 0,
75
+ "fixableErrorCount": 0,
76
+ "fixableWarningCount": 0,
77
+ "usedDeprecatedRules": []
78
+ },
79
+ {
80
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/property.js",
81
+ "messages": [],
82
+ "suppressedMessages": [],
83
+ "errorCount": 0,
84
+ "fatalErrorCount": 0,
85
+ "warningCount": 0,
86
+ "fixableErrorCount": 0,
87
+ "fixableWarningCount": 0,
88
+ "usedDeprecatedRules": []
89
+ },
90
+ {
91
+ "filePath": "/Users/swh/git-xy/hicloud-js-sdk/src/pv-sdk/utils.js",
92
+ "messages": [],
93
+ "suppressedMessages": [],
94
+ "errorCount": 0,
95
+ "fatalErrorCount": 0,
96
+ "warningCount": 0,
97
+ "fixableErrorCount": 0,
98
+ "fixableWarningCount": 0,
99
+ "usedDeprecatedRules": []
100
+ }
101
+ ]
@@ -0,0 +1,57 @@
1
+ import babel from "rollup-plugin-babel";
2
+ import { uglify } from "rollup-plugin-uglify";
3
+ // import obfuscatorPlugin from 'rollup-plugin-javascript-obfuscator'
4
+
5
+ export default [
6
+ {
7
+ input: "src/pv-sdk/index.js",
8
+ output: {
9
+ file: "build/hina.esm.min.js",
10
+ name: "hina",
11
+ format: "esm",
12
+ },
13
+ plugins: [
14
+ babel({
15
+ exclude: "node_modules/**",
16
+ }),
17
+ // obfuscatorPlugin({
18
+ // compact: true
19
+ // }),
20
+ uglify(),
21
+ ],
22
+ },
23
+ {
24
+ input: "src/pv-sdk/index.js",
25
+ output: {
26
+ file: "build/hina.min.js",
27
+ name: "hina",
28
+ format: "umd",
29
+ },
30
+ plugins: [
31
+ babel({
32
+ exclude: "node_modules/**",
33
+ }),
34
+ // obfuscatorPlugin({
35
+ // compact: true
36
+ // }),
37
+ uglify(),
38
+ ],
39
+ },
40
+ {
41
+ input: "src/hotAnalyse.js",
42
+ output: {
43
+ file: "build/hotAnalyse.min.js",
44
+ name: "hina",
45
+ format: "umd"
46
+ },
47
+ plugins: [
48
+ babel({
49
+ exclude: "node_modules/**",
50
+ }),
51
+ // obfuscatorPlugin({
52
+ // compact: true
53
+ // }),
54
+ uglify(),
55
+ ],
56
+ },
57
+ ];
package/sdk.png ADDED
Binary file
@@ -0,0 +1,3 @@
1
+ sonar.projectKey=hina-cloud-sdk_hina-cloud-js-sdk_AYm0HXxE2zk_fVMIU_ZT
2
+ sonar.qualitygate.wait=true
3
+ sonar.eslint.reportPaths=report.json