hina-cloud-js-sdk 4.0.3 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hina.cjs.full.js +1 -1
- package/dist/hina.cjs.js +1 -1
- package/dist/hina.esm.full.js +1 -1
- package/dist/hina.esm.js +1 -1
- package/dist/hina.full.js +1 -1
- package/dist/hina.iife.js +1 -1
- package/dist/index.d.ts +33 -88
- package/package.json +5 -5
package/dist/hina.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("hina-cloud-js-core"),e=require("hina-cloud-type"),r=require("hina-cloud-util"),i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t){return 1===(null==t?void 0:t.nodeType)}function l(t,e){var r;if("input"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))return(["button","submit"].includes(t.type)||e)&&t.value||"";var i="";return t.textContent?i=t.textContent.trim():t.innerText&&(i=t.innerText.trim()),i&&(i=i.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),i||""}function c(t,e){var i;if(!s(t))return{};var o,n={H_element_type:null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase(),H_element_name:t.getAttribute("name"),H_element_id:t.getAttribute("id"),H_element_target_url:t.getAttribute("href"),H_element_class_name:t.classList.value||t.className,H_element_content:l(t,e)};return o=n,Object.keys(o).reduce((function(t,e){return r.isValid(o[e])&&""!==o[e]&&(t[e]=o[e]),t}),{})}"function"==typeof SuppressedError&&SuppressedError;var u=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],p=["a","input","button","textarea"],h=function(t){function i(e,r){var i=t.call(this,e,r)||this;return i.options=e,i.context=r,i.name="ClickTrackPlugin",i.isReady=!1,i.isTrackList={a:!0,button:!0},i}return o(i,t),i.prototype.init=function(t){var i=this,o=this.options.autoTrackConfig,n=o.clickAutoTrack,a=o.isCollectUrl,s=o.isCollectElement,l=o.addCustomProperty;!0===n&&(this.isReady?this.context.log("ClickTrack plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN):(this.isReady=!0,document.addEventListener("click",(function(e){if(a()){var o=e||window.event;if(o){var n=o.target||o.srcElement,c=i.getTargetElement(n);if(c){if(r.isFunction(s)&&!s(c))return!1;var u=i.getClickElementInfo(c),p=function(t,e){if(!t)return{};var i=r.getScrollLeft(),o=r.getScrollTop(),n=e.getBoundingClientRect(),a=t.pageX||t.clientX+i||t.offsetX+((null==n?void 0:n.left)||0)+i,s=t.pageY||t.clientY+o||t.offsetY+((null==n?void 0:n.top)||0)+o;return{H_page_x:r.formatDecimal(a,3),H_page_y:r.formatDecimal(s,3)}}(o,c),h=p.H_page_x,f=p.H_page_y;u.H_page_x=h,u.H_page_y=f;var g=i.getElementPosition(c,u.H_element_path);if(r.isNumber(g)&&g>=0&&(u.H_element_position=g),r.isFunction(l)){var d=l(c);r.isObject(d)&&(u=r.merge(u,d))}t(u)}}}}),!0)))},i.prototype.transform=function(t){return this.context.getReportData("track","H_WebClick",t)},i.prototype.hasAttribute=function(t,e){var r;return t.hasAttribute?t.hasAttribute(e):t.attributes?!!(null===(r=t.attributes[e])||void 0===r?void 0:r.value):void 0},i.prototype.hasAttributes=function(t,e){if(r.isArray(e))for(var i=0;i<e.length;i++)if(this.hasAttribute(t,e[i]))return!0;return!1},i.prototype.hasElement=function(t){var e,i,o,n=function(t){var e=[t];try{if(!s(t))return e;if(null===t||null===t.parentElement)return e;for(;null!==t.parentElement;)t=t.parentElement,e.push(t);return e}catch(t){}return e}(t),l=this.options.autoTrackConfig.trackAttr||[];if(r.isArray(n)&&n.length>0)try{for(var c=a(n),u=c.next();!u.done;u=c.next()){var p=u.value,h=p.tagName&&(null===(o=p.tagName)||void 0===o?void 0:o.toLowerCase());if(s(p)&&(this.isTrackList[h]||this.hasAttributes(p,l)))return p}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}},i.prototype.getDivMaxLevel=function(){var t;return(null===(t=this.options.autoTrackConfig.collectTags.div)||void 0===t?void 0:t.maxLevel)||1},i.prototype.isStyleTag=function(t){var e,r=(null===(e=this.options.autoTrackConfig.collectTags.div)||void 0===e?void 0:e.ignoreTags)||[];return null==r?void 0:r.includes(t)},i.prototype.getCollectableParent=function(t){var r;try{var i=t.parentNode,o=i?null===(r=i.tagName)||void 0===r?void 0:r.toLowerCase():"";if("body"===o)return!1;var n=this.getDivMaxLevel();if("div"===o&&(n>1||this.isCollectableDiv(i)))return i;if(i&&this.isStyleTag(o))return this.getCollectableParent(i)}catch(t){this.context.log(t,e.ConsoleTypes.ERROR)}return!1},i.prototype.isCollectableDiv=function(t){var r;try{var i=t.children||[];if(0===i.length)return!0;for(var o=0;o<i.length;o++){var n=i[o];if(s(n)){var a=null===(r=n.tagName)||void 0===r?void 0:r.toLowerCase(),l=this.getDivMaxLevel();if(!("div"===a&&l>1||this.isStyleTag(a)))return!1;if(!this.isCollectableDiv(n))return!1}}return!0}catch(t){this.context.log(t,e.ConsoleTypes.ERROR)}return!1},i.prototype.isDivLevelValid=function(t){for(var e=this.getDivMaxLevel(),r=t.getElementsByTagName("div"),i=r.length-1;i>=0;i--)if(this.getDivLevels(r[i],t)>e)return!1;return!0},i.prototype.getElementPath=function(t,e,r){for(var i,o,n=[];s(t)&&t.parentNode;){if(t.id&&!e&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.id)){var a=t.tagName||"";n.unshift("".concat(a.toLowerCase(),"#").concat(t.id));break}if(r&&t===r){n.unshift(null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase());break}if(t===document.body){n.unshift("body");break}n.unshift(null===(o=t.tagName)||void 0===o?void 0:o.toLowerCase()),t=t.parentNode}return n.join(" > ")},i.prototype.getDivLevels=function(t,e){var r=this.getElementPath(t,!0,e).split(" > "),i=0;return r.forEach((function(t){"div"===t&&i++})),i},i.prototype.getTargetElement=function(t){var e;if(!s(t))return null;var i=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase();if(!r.isString(i))return null;if(["body","html"].includes(i))return null;if(this.context.trackTags.includes(i)&&"div"!==i)return t;if("div"===i&&this.options.autoTrackConfig.collectTags.div&&(this.isDivLevelValid(t)&&(this.getDivMaxLevel()>1||this.isCollectableDiv(t))))return t;if(this.options.autoTrackConfig.collectTags.div&&this.isStyleTag(i)){var o=this.getCollectableParent(t);if(o&&this.isDivLevelValid(o))return o}return this.hasElement(t)||null},i.prototype.getClickElementInfo=function(t){var e=this.options.autoTrackConfig.isCollectInput,i=!1;r.isFunction(e)&&(i=e(t));var o=this.getDomSelector(t),n=c(t,i);return n.H_element_selector=o,n.H_element_path=this.getElementPath(t,!1),n},i.prototype.getDomSelector=function(t){for(var e,r=[];t;){if("body"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())||!s(t)){r.unshift("body");break}if(r.unshift(this.getSelector(t)),(null==t?void 0:t.getAttribute("id"))&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.getAttribute("id")))break;t=t.parentNode}return r.join(" > ")},i.prototype.getSelector=function(t){var e,r,i=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),o=-1;9!==(null===(r=t.parentNode)||void 0===r?void 0:r.nodeType)&&(o=this.getDomIndex(t));var n=t.getAttribute("id");return n&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(n)?"#".concat(n):i+(o>-1?":nth-of-type(".concat(o+1,")"):"")},i.prototype.getDomIndex=function(t){var e,r;if(t.parentNode)for(var i=0,o=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),n=t.parentNode.children,a=0;a<n.length;a++){var s=n[a];if((null===(r=s.tagName)||void 0===r?void 0:r.toLowerCase())===o){if(s===t)return i;i++}}return-1},i.prototype.getClosestLi=function(t){for(;t&&t!==document&&s(t);){if("li"===t.tagName.toLowerCase())return t;t=t.parentNode}return null},i.prototype.getSameTypeSiblings=function(t){for(var e,r,i=t.parentNode,o=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),n=[],a=0;a<i.children.length;a++){var l=i.children[a];s(l)&&(null===(r=l.tagName)||void 0===r?void 0:r.toLowerCase())===o&&n.push(l)}return n},i.prototype.getElementPosition=function(t,e){var i,o=this.getClosestLi(t);if(!o||!s(t)||!r.isString(t.tagName))return null;var n=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase(),a=o.getElementsByTagName(n),l=a.length;if(l>1){for(var c=[],u=0;u<l;u++){this.getElementPath(a[u],!1)===e&&c.push(a[u])}if(c.length>0)return c.findIndex((function(e){return e===t}))}if(!o.parentNode)return-1;var p=this.getSameTypeSiblings(o);return 1===p.length?0:p.findIndex((function(t){return t===o}))},i}(e.PluginBase),f=function(t){function i(e,i){var o=t.call(this,e,i)||this;return o.options=e,o.context=i,o.name="StayTrackPlugin",o.isReady=!1,o.timer=null,o.previousTime=r.nowStamp(),o.previousOffsetTop=0,o}return o(i,t),i.prototype.init=function(t){var i=this,o=this.options,n=o.autoTrackConfig,a=o.stayAutoTrackConfig;if(!0===n.stayAutoTrack)if(this.isReady)this.context.log("StayTrack plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN);else{this.isReady=!0;var s=a.isCollectUrl;r.isFunction(s)||(s=function(){return!0}),this.timer&&(clearTimeout(this.timer),this.timer=null),this.previousTime=r.nowStamp(),window.addEventListener("load",(function(){i.previousOffsetTop=r.getScrollTop()})),window.addEventListener("scroll",(function(){s()&&(i.timer||(i.timer=setTimeout((function(){i.run(t),clearTimeout(i.timer),i.timer=null}),1e3)))})),window.addEventListener("unload",(function(){s()&&i.run(t,!0)}))}},i.prototype.transform=function(t){return this.context.getReportData("track","H_WebStay",t)},i.prototype.run=function(t,e){void 0===e&&(e=!1);var i=this.options.autoTrackConfig,o=i.stayDelayTime,n=i.maxStayPageDuration,a=r.getScrollTop(),s=r.nowStamp(),l=s-this.previousTime;(e||l>o&&a!==this.previousOffsetTop)&&t({H_viewport_width:r.getScreenWidth(),H_viewport_height:r.getScreenHeight(),H_viewport_position:this.previousOffsetTop,event_duration:Math.min(l/1e3,n),H_url_path:window.location.pathname});this.previousTime=s,this.previousOffsetTop=a},i}(e.PluginBase),g=function(t){function i(e,i){var o=t.call(this,e,i)||this;return o.options=e,o.context=i,o.name="PageLeave",o.isReady=!1,o.pageId=r.generatorTrackId(),o.storageName="hinasdk_pageleave_",o.heartbeatIntervalTime=5e3,o.maxDuration=432e3,o.heartbeatIntervalTimer=null,o.startTime=r.nowStamp(),o.url=window.location.href,o.pageShowStatus=!0,o}return o(i,t),i.prototype.init=function(){if(this.options.autoTrackConfig.pageLeaveAutoTrack)if(this.context.store.localStorage)if(this.isReady)this.context.log("PageLeave plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN);else{this.isReady=!0;var t=this.normalizePageLeaveAutoTrack(),i=t.heartbeat_interval_time,o=t.max_duration;i&&i>0&&(this.heartbeatIntervalTime=1e3*i),o&&o>0&&(this.maxDuration=Number(o)),this.startTime=r.nowStamp(),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.startHeartBeatInterval()}else this.context.log("PageLeave plugin需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",e.ConsoleTypes.WARN)},i.prototype.transform=function(){},i.prototype.normalizePageLeaveAutoTrack=function(){var t=this.options.autoTrackConfig.pageLeaveAutoTrack;return r.isObject(t)?t:{}},i.prototype.addPageLeaveEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},i.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&window.addEventListener("pageshow",(function(){t.pageStartHandler()}))},i.prototype.addPageSwitchListener=function(){var t=this;new r.ListenPageState({visible:function(){t.pageStartHandler(),t.startHeartBeatInterval()},hidden:function(){t.url=window.location.href,t.pageEndHandler(),t.stopHeartBeatInterval()}})},i.prototype.addSinglePageListener=function(){var t=this;r.mitt.on("urlChange",(function(e){var r=e.fromHref;r!==e.toHref&&(t.url=r,t.pageEndHandler(),t.stopHeartBeatInterval(),t.pageStartHandler(),t.startHeartBeatInterval())}))},i.prototype.addPageEndListener=function(){var t=this,e=["pagehide","beforeunload","unload"];e.forEach((function(r){"on".concat(e)in window&&window.addEventListener(r,(function(){t.pageEndHandler(),t.stopHeartBeatInterval()}))}))},i.prototype.pageStartHandler=function(){this.startTime=r.nowStamp(),this.pageShowStatus=!document.hidden,this.url=window.location.href},i.prototype.pageEndHandler=function(){if(this.pageShowStatus){if(this.pageShowStatus=!1,this.isCollectUrl()){var t=this.getPageLeaveProperties(),e=this.context.getReportData("track","H_WebPageLeave",t);this.context.report(e)}this.delHeartBeatData()}},i.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),this.isCollectUrl()&&(this.heartbeatIntervalTimer=setInterval((function(){t.saveHeartBeatData()}),this.heartbeatIntervalTime),this.saveHeartBeatData("first_heartbeat")),this.reissueHeartBeatData()},i.prototype.reissueHeartBeatData=function(){for(var t=this.context.store.localStorage,e=t.length(),i=0;i<e;i++){var o=t.key(i);if(o&&o!==this.storageName+this.pageId&&o.includes(this.storageName)){var n=t.get(o),a=r.safeJSONParse(n);r.isObject(a)&&r.nowStamp()-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,this.context.report(a)),this.delHeartBeatData(o)}}},i.prototype.stopHeartBeatInterval=function(){this.heartbeatIntervalTimer&&(clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null)},i.prototype.delHeartBeatData=function(t){this.context.store.localStorage.remove(t||this.storageName+this.pageId)},i.prototype.isCollectUrl=function(){var t=this.normalizePageLeaveAutoTrack().isCollectUrl;return!r.isFunction(t)||t(this.url)},i.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties();e.H_time=r.nowStamp(),"first_heartbeat"===t&&(e.event_duration=3);var i=this.context.getReportData("track","H_WebPageLeave",e);i.heartbeat_interval_time=this.heartbeatIntervalTime,this.context.store.localStorage.set(this.storageName+this.pageId,JSON.stringify(i))},i.prototype.getPageLeaveProperties=function(){var t=(r.nowStamp()-this.startTime)/1e3;t=t<=0||t>this.maxDuration?0:r.formatDecimal(t,3);var e=r.getURL(this.url),i=e.pathname,o=e.hash,a=r.getReferrer(),s={H_url:this.url,H_url_path:i,H_url_hash:o,H_viewport_position:r.getScrollTop(),H_referrer:a,H_referrer_host:a?r.getHostname(a):"",event_duration:t},l=this.normalizePageLeaveAutoTrack().custom_props;return r.isObject(l)&&(s=n(n({},s),l||{})),s},i}(e.PluginBase),d=function(t){function i(e,r){var i=t.call(this,e,r)||this;return i.options=e,i.context=r,i.name="SiteLinker",i.isReady=!1,i.linker=[],i}return o(i,t),i.prototype.init=function(){if(this.options.siteLinkerConfig){var t=this.getLinkerConfig().linker;r.isArray(t)&&t.length>0?this.isReady?this.context.log("SiteLinker plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN):(this.isReady=!0,this.resolveOption(),this.setRefferId(),this.addClickListen()):this.context.log("siteLinker plugin: 请配置正确的linker参数",e.ConsoleTypes.WARN)}},i.prototype.transform=function(){},i.prototype.getLinkerConfig=function(){var t=this.options.siteLinkerConfig||{},e=t.linker;return{linker:(void 0===e?[]:e)||[],re_login:t.re_login}},i.prototype.resolveOption=function(){for(var t=this.getLinkerConfig().linker,i=t.length,o=[],n=0;n<i;n++){var a=t[n],s=a.part_url,l=a.after_hash;/[A-Za-z0-9]+\./.test(s)&&r.isBoolean(l)?o.push({part_url:s,after_hash:l}):this.context.log("The configuration of linker ".concat(n+1," is not supported.Please check format"),e.ConsoleTypes.WARN)}this.linker=o},i.prototype.setRefferId=function(){var t=this.getLinkerConfig().re_login,e=this.getUrlId(),r=e.startsWith("a");if(""!==(e=e.substring(1))){var i=this.context.store.getAnonymousId(),o=this.context.store.getAccountId();if(r){if(e!==i&&(this.context.store.state.anonymousId=e,this.context.store.save()),o){var n=this.context.getReportData("track_signup","H_SignUp",{});this.context.report(n)}}else(!o||t&&o!==e)&&this.context.setUserUId(e)}},i.prototype.getUrlId=function(){var t=window.location.href.match(/_hnsdk=([au][^\?\#\&\=]+)/);return r.isArray(t)&&t[1]?r.handleDecodeURLComponent(t[1]):""},i.prototype.getPartUrl=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return!0;return!1},i.prototype.getPartHash=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return this.linker[r].after_hash;return!1},i.prototype.getCurrentId=function(){var t=this.context.store.getAccountId(),e=this.context.store.getAnonymousId(),i=t?"u".concat(t):"a".concat(e);return r.handleEncodeURLComponent(i)},i.prototype.rewriteUrl=function(t,e){var i=this.getCurrentId(),o=this.getPartHash(t),n=r.rewriteUrl(t,i,o);return e&&(e.href=n),n},i.prototype.addClickListen=function(){var t=this,e=function(e){var i,o,n=e.target;if(n){var a=null===(i=n.tagName)||void 0===i?void 0:i.toLowerCase(),s=n.parentNode,l=null===(o=null==s?void 0:s.tagName)||void 0===o?void 0:o.toLowerCase();if("a"===a&&n.href||"a"===l&&s.href){var c=void 0,u=void 0;"a"===a&&n.href?(c=n.href,u=n):(c=s.href,u=s);var p=r.getURL(c).protocol;"http:"!==p&&"https:"!==p||t.getPartUrl(c)&&t.rewriteUrl(c,u)}}};"PointerEvent"in window?document.addEventListener("pointerdown",e):document.addEventListener("mousedown",e)},i}(e.PluginBase),v=function(t){function i(e,r){var i=t.call(this,e,r)||this;return i.options=e,i.context=r,i.name="HistoryPlugin",i.isReady=!1,i.lastHref=window.location.href,i.lastPath=window.location.pathname,i}return o(i,t),i.prototype.init=function(){if(r.supportHistory())if(this.isReady)this.context.log("History plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN);else{this.isReady=!0;var t=this,i=window.onpopstate,o=function(e,i){var o={fromPath:t.lastPath,fromHref:t.lastHref,toPath:e,toHref:i};t.lastPath=e,t.lastHref=i,r.mitt.emit("urlChange",n(n({},o),{mode:"history"}))};window.onpopstate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=window.location.pathname,n=window.location.href;o(r,n),i&&i.apply(this,t)},r.replaceOld(window.history,"pushState",a),r.replaceOld(window.history,"replaceState",a)}function a(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.apply(this,e);var i=window.location.pathname,n=window.location.href;o(i,n)}}},i.prototype.transform=function(){},i}(e.PluginBase),m=function(t){function i(e,r){var i=t.call(this,e,r)||this;return i.options=e,i.context=r,i.name="HashPlugin",i.isReady=!1,i.lastHref=window.location.href,i.lastPath=window.location.hash,i}return o(i,t),i.prototype.init=function(){var t=this;this.isReady?this.context.log("Hash plugin:插件已经运行,无需重复执行",e.ConsoleTypes.WARN):(this.isReady=!0,window.addEventListener("hashchange",(function(e){var i=e.newURL,o=r.getURL(i).hash,a={fromPath:t.lastPath,fromHref:t.lastHref,toPath:o,toHref:i};t.lastHref=i,t.lastPath=o,r.mitt.emit("urlChange",n(n({},a),{mode:"hash"}))})))},i.prototype.transform=function(){},i}(e.PluginBase),y="4.0.4",_=function(t){function e(e,i){var o=this,n=r.getPlatform();return(o=t.call(this,e,i,n,"hina_webjs_sdk_abtest",y)||this).options=e,o.context=i,o.name="HinaABTest",o}return o(e,t),e.prototype.getResultFromServer=function(t){var e=this;return new Promise((function(i,o){var n=e.createRequestData(t);new r.AjaxRequest({url:e.options.abTestingPluginConfig.url,data:JSON.stringify(n),contentType:"application/json",customHeaders:{"project-key":e.projectKey},timeout:t.timeoutMilliseconds}).run().then((function(t){var r=t.data;"SUCCESS"===(null==r?void 0:r.status)?e.saveResponseData(r.results).then((function(){i(r)})):o()}))}))},e}(r.AbtestBasePlugin),w=function(){function t(){}return t.getSourceFromReferrer=function(){var t=function(t,e){for(var r=0;r<t.length;r++)if(-1!==e.split("?")[0].indexOf(t[r]))return!0},e="(".concat(r.utmTypes.join("|"),")\\=[^&]+"),i=document.referrer||"",o=window.location.href;if(o){var n=o.match(new RegExp(e));return n&&n[0]?"付费广告流量":t(r.searchTypes,i)?"自然搜索流量":t(r.socialTypes,i)?"社交网站流量":""===i?"直接流量":"引荐流量"}return"获取url异常"},t.getReferSearchEngine=function(t){var e,i,o=r.getHostname(t);if(!o||"hostname解析异常"===o)return"";var n={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$/]};for(var s in n){var l=n[s];try{for(var c=(e=void 0,a(l)),u=c.next();!u.done;u=c.next()){if(u.value.test(o))return s}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}}return"未知搜索引擎"},t.getKeywordFromReferrer=function(){var t=document.referrer||"";if(0===t.indexOf("http")){var e=this.getReferSearchEngine(t),i=r.getURLSearchParams(r.getURL(t).search);if(r.isEmptyObject(i))return"未取到值";for(var o in r.searchKeywords){var n=r.searchKeywords[o];if(o===e)if(r.isArray(n))for(var a=0;a<n.length;a++){var s=i[n[a]];if(s)return s}else if(i[n])return i[n]}return"未取到值"}return""===t?"未取到值_直接打开":"未取到值_非http的url"},t}();function T(t){void 0===t&&(t="");var e,i=(e={},r.utmTypes.forEach((function(t){var i=r.getQueryParam(window.location.href,t);i.length&&(e[t]=i)})),e),o={};return Object.keys(i).forEach((function(e){o[t+e]=i[e]})),o}var b=function(t){function i(e,r){void 0===r&&(r=!0);var i=t.call(this,e,r)||this;return i.trackTags=p,i.customProperties={},i.generalProperties={H_lib_version:y,H_lib:"js",H_lib_method:"code",H_timezone_offset:(new Date).getTimezoneOffset()},i.useInstancing&&i.init(e),i}return o(i,t),i.prototype.init=function(t){if(this.isReady)this.log("hinaSDK has been initialized",e.ConsoleTypes.ERROR);else{var i={name:"",serverUrl:"",showLog:!1,autoTrackConfig:{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:["hn-click"],pageviewAutoTrack:!1,pageLeaveAutoTrack:!1},stayAutoTrackConfig:{isCollectUrl:function(){return!0}},maxStringLength:1024,imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:e.ReportTypes.BEACON,customHeaders:{},credentials:!1,dataSendTimeout:3e3,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0},sourceChannel:[],plugins:[]},o=t.performanceErrorConfig,a=t.plugins,s=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]])}return r}(t,["performanceErrorConfig","plugins"]);this.options=r.merge(i,s),this.options=n(n({},this.options),{performanceErrorConfig:o,plugins:a}),this.initState(),this.initAdvProps(),this.normalizeConfig(),this.initPlugins(),this.isReady=!0}},i.prototype.normalizeConfig=function(){var t=this,i=this.options,o=i.serverUrl,a=i.sendType,s=i.batchSend,l=i.maxStringLength,c=i.isSinglePage,p=i.autoTrackConfig,h=void 0===p?{}:p,f=h.trackAttr,g=void 0===f?[]:f,d=h.collectTags,v=h.pageLeaveAutoTrack,m=h.pageviewAutoTrack;if(""===(o=(o=o||"").trim()))this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",e.ConsoleTypes.WARN);else{var y=window.location.href,_=r.getURL(y).protocol||"";(r.getURL(o).protocol||"")!==_&&this.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为:https 下面发送 http 的图片请求会失败。",e.ConsoleTypes.WARN)}if([e.ReportTypes.IMAGE,e.ReportTypes.AJAX,e.ReportTypes.BEACON].includes(a)||this.setConfig({sendType:e.ReportTypes.AJAX}),this.options.maxStringLength=r.normalizeMaxStringLength(l),(!0===v||r.isObject(v)&&r.isEmptyObject(v))&&(this.options.autoTrackConfig.pageLeaveAutoTrack={heartbeat_interval_time:5e3,max_duration:432e3}),r.isArray(g)?(g=g.filter((function(t){return r.isString(t)}))).includes("hn-click")||g.push("hn-click"):g=["hn-click"],this.options.autoTrackConfig.trackAttr=g,r.isObject(d))if(!0===d.div)this.options.autoTrackConfig.collectTags.div={ignoreTags:u,maxLevel:1};else if(r.isObject(d.div)){var w=1,T=d.div;r.isNumber(T.maxLevel)&&[1,2,3].includes(T.maxLevel)&&(w=T.maxLevel),this.options.autoTrackConfig.collectTags.div={ignoreTags:u,maxLevel:w}}else this.options.autoTrackConfig.collectTags.div=!1;else this.options.autoTrackConfig.collectTags={div:!1};this.updateTrackTags(),(!0===s||r.isObject(s)&&!r.isEmptyObject(s))&&(this.options.batchSend=n({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},s),this.batchSender=new r.BatchSend(this.options,"hinasdk_tab","hinasdk_data_")),"auto"===m?this.autoTrack():("singlePage"===m||c)&&(this.autoTrack(),r.mitt.on("urlChange",(function(e){var i=e.fromHref;if(i!==e.toHref){var o={};if(r.isFunction(c)){var a=c();r.isObject(a)&&(o=n(n({},o),a))}t.autoTrack(n(n({},o),{H_referrer:i}))}})))},i.prototype.updateTrackTags=function(){var t=this.options.autoTrackConfig.collectTags,e=function(t,e,r){if(r||2===arguments.length)for(var i,o=0,n=e.length;o<n;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,n=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}(p),!1);Object.keys(t||{}).forEach((function(i){var o=t[i];!0!==o&&!r.isObject(o)||e.includes(i)||e.push(i)})),this.trackTags=e},i.prototype.initState=function(){this.store=new r.WebState(this.options),this.store.init()},i.prototype.initAdvProps=function(){var t={},e=this.options,i=e.presetProperties,o=e.sourceChannel;if(r.isObject(i))for(var a in i){var s=i[a];if(a.includes("latest_")&&(a=a.slice(7),s)){var l=r.getCurrentDomain();if("utm"!==a&&"url解析失败"===l)t["H_latest_".concat(a)]="url的domain解析失败";else if(r.isReferralTraffic())switch(a){case"traffic_source_type":t.H_latest_traffic_source_type=w.getSourceFromReferrer();break;case"search_keyword":var c=w.getKeywordFromReferrer();c&&(t.H_latest_search_keyword=c);break;case"referrer":t.H_latest_referrer=r.getReferrer()}}}var u=this.store.state.props||{},p={};i.latest_utm&&(p=T("H_latest_"));var h={};u.H_utm_source||(h=T("H_"));var f=[],g={};r.isArray(o)&&o.length>0&&(f=o.filter((function(t){return!r.utmTypes.includes(t)}))).length>0&&(g=n(n({},g),function(t,e){void 0===e&&(e=[]);var i={};return e.forEach((function(e){var o=r.getQueryParam(window.location.href,e);o&&(i[e]=o,i["".concat(t).concat(e)]=o)})),i}("H_latest_",f))),this.store.state.props=n(n(n(n(n({},this.store.state.props),t),p),g),h),this.store.setProps(this.store.state.props),this.store.getUtmFromProps(f)},i.prototype.getGeneralProperties=function(){var t=new r.Browser;return this.generalProperties=n(n(n({},this.generalProperties),{H_screen_width:window.screen.width,H_screen_height:window.screen.height,H_viewport_width:r.getScreenWidth(),H_viewport_height:r.getScreenHeight(),H_page_height:r.getPageScrollHeight(),H_browser:t.browserName,H_browser_version:t.browserVersion,H_os:t.os,H_os_version:t.osVersion,H_model:t.model,H_is_first_day:this.store.isFirstDay,H_url:window.location.href,H_url_host:r.getHostname(window.location.href,"url_host取值异常"),H_title:document.title}),this.store.hLatestUtm),this.generalProperties.H_latest_referrer&&(this.generalProperties.H_latest_referrer_host=r.getHostname(this.generalProperties.H_latest_referrer,"hostname解析异常")),this.generalProperties},i.prototype.initPlugins=function(){var t=this,e=this.options,i=e.serverUrl,o=e.name,a=e.showLog,s=e.sendType,l=e.customHeaders,c=e.credentials,u=e.dataSendTimeout,p=e.batchSend,y=e.imgUseCrossOrigin,w=e.globalCallback,T=e.plugins,b=void 0===T?[]:T,k=e.performanceErrorConfig,H=e.autoTrackConfig,C=e.siteLinkerConfig,S=e.abTestingPluginConfig;b=b||[];var P=H.pageLeaveAutoTrack,L=new h(this.options,this),R=new f(this.options,this),A=new v(this.options,this),x=new m(this.options,this),O=new g(this.options,this),E=new d(this.options,this),N=new _(this.options,this);O.disabled=!(r.isObject(P)&&!r.isEmptyObject(P));var D=(C||{}).linker;E.disabled=!(r.isArray(D)&&D.length>0),N.disabled=!(r.isObject(S)&&!r.isEmptyObject(S)),this.plugins=[L,R,A,x,O,E,N],r.isArray(b)&&b.forEach((function(e){if("Monitor"===e.componentName){if(r.isObject(k)&&!r.isEmptyObject(k))new e(n({serverUrl:i,name:o,showLog:a,sendType:s,customHeaders:l,credentials:c,dataSendTimeout:u,batchSend:p,imgUseCrossOrigin:y,globalCallback:w},k),!0)}else{var h=new e(t.options,t);t.plugins.push(h)}})),this.runPlugins(this.plugins)},i.prototype.use=function(t,i){if(this.isReady){if(r.isObject(i)){"PageLeave"===t?this.options.autoTrackConfig.pageLeaveAutoTrack=i:"SiteLinker"===t?this.options.siteLinkerConfig=i:"HinaABTest"===t&&(this.options.abTestingPluginConfig=i);var o=this.plugins.find((function(e){return e.name===t}));return o&&(o.disabled=!1,o.isReady?this.log("".concat(t,"插件已运行,无需重复执行"),e.ConsoleTypes.WARN):o.init()),this.getPluginInstance(t)}this.log("".concat(t,"插件配置项必须是一个对象类型"),e.ConsoleTypes.WARN)}else this.log("请先初始化埋点SDK",e.ConsoleTypes.WARN)},i.prototype.getPluginInstance=function(t){return this.plugins.find((function(e){return e.name===t}))},i.prototype.setConfig=function(t){this.options=r.merge(this.options,t),this.normalizeConfig()},i.prototype.getConfig=function(t){return t?this.options[t]:this.options},i.prototype.setUserUId=function(t,e){var i=this,o=this.store.getAccountId();r.setUserUId(t,o,(function(t){i.store.setAccountId(t);var r=i.getReportData("track_signup","H_SignUp",{});i.report(r,e)}))},i.prototype.cleanUserUId=function(){this.store.setAccountId("")},i.prototype.getUserUid=function(){return this.store.state.accountId},i.prototype.setDeviceUId=function(t){this.store.setDeviceId(t)},i.prototype.getDeviceUId=function(){return this.store.getDeviceId()},i.prototype.userSet=function(t,e){if(r.isObject(t)&&!r.isEmptyObject(t)){var i=this.getReportData("user_set","",t);this.report(i,e)}},i.prototype.userSetOnce=function(t,e){if(r.isObject(t)&&!r.isEmptyObject(t)){var i=this.getReportData("user_setOnce","",t);this.report(i,e)}},i.prototype.userAdd=function(t,e){var i=this;r.userAdd(t,(function(t){var r=i.getReportData("user_add","",t);i.report(r,e)}))},i.prototype.userAppend=function(t,e){var i=this;r.userAppend(t,(function(t){var r=i.getReportData("user_append","",t);i.report(r,e)}))},i.prototype.userUnset=function(t,e){var i=this;r.userUnset(t,(function(t){var r=i.getReportData("user_unset","",t);i.report(r,e)}))},i.prototype.userDelete=function(t){var e=this.getReportData("user_delete","",{});this.report(e,t),this.store.setAccountId("")},i.prototype.registerCommonProperties=function(t){this.customProperties=r.merge(this.customProperties,t)},i.prototype.getPresetProperties=function(){return n(n({},this.getGeneralProperties()),this.customProperties)},i.prototype.clearPageRegister=function(t){var e=this;void 0===t&&(t=!0),!0===t?this.customProperties={}:r.isArray(t)&&t.forEach((function(t){t in e.customProperties&&delete e.customProperties[t]}))},i.prototype.track=function(t,i,o){if(o=o||function(){},r.isString(t)){i=r.isObject(i)?i:{};var n=this.getReportData("track",t,i);this.report(n,o)}else this.log("track事件名必须是字符串,属性必须是是一个对象",e.ConsoleTypes.WARN)},i.prototype.quick=function(t,e,i){if(!this.isReady)return this.log("请先初始化SDK");var o={};i=r.isFunction(i)?i:r.noop,r.isObject(e)?o=e:r.isFunction(e)&&(i=e),this.autoTrack(o,i)},i.prototype.autoTrack=function(t,e){void 0===t&&(t={}),void 0===e&&(e=r.noop);var i=(null==t?void 0:t.H_referrer)||r.getReferrer(),o=n(n(n({H_is_first_time:this.store.isFirstTime,H_url_path:window.location.pathname,H_referrer:i,H_referrer_host:i?r.getHostname(i):""},this.store.hUtm),this.store.customUtm),t||{}),a=this.getReportData("track","H_pageview",o);if(this.report(a,e),this.store.isFirstTime){this.store.isFirstTime=!1;var s=r.getReferrer(),l=n(n({H_first_visit_time:r.nowStamp(),H_first_referrer:s,H_first_referrer_host:s?r.getHostname(s,"取值异常"):"",H_first_traffic_source_type:w.getSourceFromReferrer(),H_first_search_keyword:w.getKeywordFromReferrer(),H_first_browser_language:r.isString(navigator.language)?navigator.language.toLowerCase():"取值异常",H_first_browser_charset:document.characterSet||document.inputEncoding||"UTF-8"},this.store.hUtm),this.store.customUtm);this.userSetOnce(l)}},i.prototype.report=function(t,i,o){var n,a,s=this.options,l=s.appJsBridge,c=s.serverUrl;if(this.log(t),l){var u=!0,p=null===window||void 0===window?void 0:window.Hina_Cloud_H5_Bridge;if(r.isObject(p)&&p.track)u=!1,p.track(t.event,t.type,JSON.stringify(t));else{var h=null===(a=null===(n=null===window||void 0===window?void 0:window.webkit)||void 0===n?void 0:n.messageHandlers)||void 0===a?void 0:a.hinaNativeTracker;if(null==h?void 0:h.postMessage){u=!1;var f=JSON.stringify({eventName:t.event,eventType:t.type,properties:t});h.postMessage(f)}}if(u)return void this.log("JSBridge 发送数据失败",e.ConsoleTypes.WARN);r.isFunction(i)&&i(c,t)}else this.sendReportData(t,i,o)},i.prototype.getReportData=function(t,e,i){var o,a=this.store.getAnonymousId(),s=this.store.getAccountId(),l=r.nowStamp(),c=r.merge(this.customProperties),u=this.getGeneralProperties();if("user"===t.slice(0,4)){var p=u.H_lib,h=u.H_lib_method,f=u.H_lib_version;o=n({device_id:this.store.getDeviceId(),H_lib:p,H_lib_method:h,H_lib_version:f},i||{})}else o=n(n(n({device_id:this.store.getDeviceId()},u),c),i||{});r.checkReportProperties(o,this.options.maxStringLength);var g={anonymous_id:a,type:t,event:e,time:l,_track_id:r.generatorTrackId(),properties:o};return s&&!/^[0-9a-f]{8,}-[0-9a-f]{4,}-[0-9a-f]{4,}-[0-9a-f]{4,}-[0-9a-f]{12,}$/.test(s)&&(g.account_id=s),g.send_time=r.nowStamp(),g},i}(t.WebClient);var k=new b({},!1);exports.HinaTrack=b,exports.default=k,Object.keys(e).forEach((function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var hinaCloudJsCore=require("hina-cloud-js-core"),hinaCloudType=require("hina-cloud-type"),hinaCloudUtil=require("hina-cloud-util"),extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){if("function"!=typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};function __values(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var ignoreTags=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],defaultTags=["a","input","button","textarea"],ClickTrackPlugin=function(_super){function ClickTrackPlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="ClickTrackPlugin",_this.isReady=!1,_this.isTrackList={a:!0,button:!0},_this}return __extends(ClickTrackPlugin,_super),ClickTrackPlugin.prototype.init=function(notify){var _this=this,_a=this.options.autoTrackConfig,clickAutoTrack=_a.clickAutoTrack,isCollectUrl=_a.isCollectUrl,isCollectElement=_a.isCollectElement,addCustomProperty=_a.addCustomProperty;!0===clickAutoTrack&&(this.isReady?this.context.log("ClickTrack plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN):(this.isReady=!0,document.addEventListener("click",(function(e){if(isCollectUrl()){var event=e||window.event;if(event){var eventTarget=event.target||event.srcElement,target=_this.getTargetElement(eventTarget);if(target){if(hinaCloudUtil.isFunction(isCollectElement)&&!isCollectElement(target))return!1;var props=_this.getClickElementInfo(target),_a=hinaCloudUtil.getPageXYInfo(event,target),H_page_x=_a.H_page_x,H_page_y=_a.H_page_y,pathname=hinaCloudUtil.getURL(window.location.href).pathname;props.H_url_path=pathname,props.H_page_x=H_page_x,props.H_page_y=H_page_y;var element_position=_this.getElementPosition(target,props.H_element_path);if(hinaCloudUtil.isNumber(element_position)&&element_position>=0&&(props.H_element_position=element_position),hinaCloudUtil.isFunction(addCustomProperty)){var customProperty=addCustomProperty(target);hinaCloudUtil.isObject(customProperty)&&(props=hinaCloudUtil.merge(props,customProperty))}notify(props)}}}}),!0)))},ClickTrackPlugin.prototype.transform=function(data){return this.context.getReportData("track","H_WebClick",data)},ClickTrackPlugin.prototype.hasAttribute=function(element,attrName){var _a;return element.hasAttribute?element.hasAttribute(attrName):element.attributes?!!(null===(_a=element.attributes[attrName])||void 0===_a?void 0:_a.value):void 0},ClickTrackPlugin.prototype.hasAttributes=function(element,attrNames){if(hinaCloudUtil.isArray(attrNames))for(var i=0;i<attrNames.length;i++)if(this.hasAttribute(element,attrNames[i]))return!0;return!1},ClickTrackPlugin.prototype.hasElement=function(element){var e_1,_a,_b,elementsList=function(element){var pathArr=[element];try{if(!hinaCloudUtil.isElement(element))return pathArr;if(null===element||null===element.parentElement)return pathArr;for(;null!==element.parentElement;)element=element.parentElement,pathArr.push(element);return pathArr}catch(error){}return pathArr}(element),trackAttr=this.options.autoTrackConfig.trackAttr||[];if(hinaCloudUtil.isArray(elementsList)&&elementsList.length>0)try{for(var elementsList_1=__values(elementsList),elementsList_1_1=elementsList_1.next();!elementsList_1_1.done;elementsList_1_1=elementsList_1.next()){var ele=elementsList_1_1.value,tagName=ele.tagName&&(null===(_b=ele.tagName)||void 0===_b?void 0:_b.toLowerCase());if(hinaCloudUtil.isElement(ele)&&(this.isTrackList[tagName]||this.hasAttributes(ele,trackAttr)))return ele}}catch(e_1_1){e_1={error:e_1_1}}finally{try{elementsList_1_1&&!elementsList_1_1.done&&(_a=elementsList_1.return)&&_a.call(elementsList_1)}finally{if(e_1)throw e_1.error}}},ClickTrackPlugin.prototype.getDivMaxLevel=function(){var _a;return(null===(_a=this.options.autoTrackConfig.collectTags.div)||void 0===_a?void 0:_a.maxLevel)||1},ClickTrackPlugin.prototype.isStyleTag=function(tagName){var _a,ignoreTags=(null===(_a=this.options.autoTrackConfig.collectTags.div)||void 0===_a?void 0:_a.ignoreTags)||[];return null==ignoreTags?void 0:ignoreTags.includes(tagName)},ClickTrackPlugin.prototype.getCollectableParent=function(target){var _a;try{var parentNode=target.parentNode,parentTagName=parentNode?null===(_a=parentNode.tagName)||void 0===_a?void 0:_a.toLowerCase():"";if("body"===parentTagName)return!1;var maxLevel=this.getDivMaxLevel();if("div"===parentTagName&&(maxLevel>1||this.isCollectableDiv(parentNode)))return parentNode;if(parentNode&&this.isStyleTag(parentTagName))return this.getCollectableParent(parentNode)}catch(error){this.context.log(error,hinaCloudType.ConsoleTypes.ERROR)}return!1},ClickTrackPlugin.prototype.isCollectableDiv=function(element){var _a;try{var children=element.children||[];if(0===children.length)return!0;for(var i=0;i<children.length;i++){var child=children[i];if(hinaCloudUtil.isElement(child)){var tagName=null===(_a=child.tagName)||void 0===_a?void 0:_a.toLowerCase(),maxLevel=this.getDivMaxLevel();if(!("div"===tagName&&maxLevel>1||this.isStyleTag(tagName)))return!1;if(!this.isCollectableDiv(child))return!1}}return!0}catch(error){this.context.log(error,hinaCloudType.ConsoleTypes.ERROR)}return!1},ClickTrackPlugin.prototype.isDivLevelValid=function(rootElement){for(var maxLevel=this.getDivMaxLevel(),htmlCollection=rootElement.getElementsByTagName("div"),i=htmlCollection.length-1;i>=0;i--)if(this.getDivLevels(htmlCollection[i],rootElement)>maxLevel)return!1;return!0},ClickTrackPlugin.prototype.getElementPath=function(element,ignoreId,rootElement){for(var _a,_b,names=[];hinaCloudUtil.isElement(element)&&element.parentNode;){if(element.id&&!ignoreId&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(element.id)){var tagName=element.tagName||"";names.unshift("".concat(tagName.toLowerCase(),"#").concat(element.id));break}if(rootElement&&element===rootElement){names.unshift(null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase());break}if(element===document.body){names.unshift("body");break}names.unshift(null===(_b=element.tagName)||void 0===_b?void 0:_b.toLowerCase()),element=element.parentNode}return names.join(" > ")},ClickTrackPlugin.prototype.getDivLevels=function(element,rootElement){var pathArr=this.getElementPath(element,!0,rootElement).split(" > "),level=0;return pathArr.forEach((function(tag){"div"===tag&&level++})),level},ClickTrackPlugin.prototype.getTargetElement=function(eventTarget){var _a;if(!hinaCloudUtil.isElement(eventTarget))return null;var tagName=null===(_a=eventTarget.tagName)||void 0===_a?void 0:_a.toLowerCase();if(!hinaCloudUtil.isString(tagName))return null;if(["body","html"].includes(tagName))return null;if(this.context.trackTags.includes(tagName)&&"div"!==tagName)return eventTarget;if("div"===tagName&&this.options.autoTrackConfig.collectTags.div&&(this.isDivLevelValid(eventTarget)&&(this.getDivMaxLevel()>1||this.isCollectableDiv(eventTarget))))return eventTarget;if(this.options.autoTrackConfig.collectTags.div&&this.isStyleTag(tagName)){var parentTrackDiv=this.getCollectableParent(eventTarget);if(parentTrackDiv&&this.isDivLevelValid(parentTrackDiv))return parentTrackDiv}return this.hasElement(eventTarget)||null},ClickTrackPlugin.prototype.getClickElementInfo=function(element){var isCollectInput=this.options.autoTrackConfig.isCollectInput,isCollectInputValue=!1;hinaCloudUtil.isFunction(isCollectInput)&&(isCollectInputValue=isCollectInput(element));var selector=this.getDomSelector(element),props=hinaCloudUtil.getElementProperties(element,isCollectInputValue);return props.H_element_selector=selector,props.H_element_path=this.getElementPath(element,!1),props},ClickTrackPlugin.prototype.getDomSelector=function(element){for(var _a,paths=[];element;){if("body"===(null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase())||!hinaCloudUtil.isElement(element)){paths.unshift("body");break}if(paths.unshift(this.getSelector(element)),(null==element?void 0:element.getAttribute("id"))&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(element.getAttribute("id")))break;element=element.parentNode}return paths.join(" > ")},ClickTrackPlugin.prototype.getSelector=function(element){var _a,_b,tagName=null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase(),i=-1;9!==(null===(_b=element.parentNode)||void 0===_b?void 0:_b.nodeType)&&(i=this.getDomIndex(element));var idValue=element.getAttribute("id");return idValue&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(idValue)?"#".concat(idValue):tagName+(i>-1?":nth-of-type(".concat(i+1,")"):"")},ClickTrackPlugin.prototype.getDomIndex=function(element){var _a,_b;if(element.parentNode)for(var index=0,tagName=null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase(),children=element.parentNode.children,i=0;i<children.length;i++){var child=children[i];if((null===(_b=child.tagName)||void 0===_b?void 0:_b.toLowerCase())===tagName){if(child===element)return index;index++}}return-1},ClickTrackPlugin.prototype.getClosestLi=function(element){for(;element&&element!==document&&hinaCloudUtil.isElement(element);){if("li"===element.tagName.toLowerCase())return element;element=element.parentNode}return null},ClickTrackPlugin.prototype.getSameTypeSiblings=function(element){for(var _a,_b,parentNode=element.parentNode,tagName=null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase(),list=[],i=0;i<parentNode.children.length;i++){var child=parentNode.children[i];hinaCloudUtil.isElement(child)&&(null===(_b=child.tagName)||void 0===_b?void 0:_b.toLowerCase())===tagName&&list.push(child)}return list},ClickTrackPlugin.prototype.getElementPosition=function(element,path){var _a,liElm=this.getClosestLi(element);if(!liElm||!hinaCloudUtil.isElement(element)||!hinaCloudUtil.isString(element.tagName))return null;var tagName=null===(_a=element.tagName)||void 0===_a?void 0:_a.toLowerCase(),targetElementCollection=liElm.getElementsByTagName(tagName),len=targetElementCollection.length;if(len>1){for(var clickElms=[],i=0;i<len;i++){this.getElementPath(targetElementCollection[i],!1)===path&&clickElms.push(targetElementCollection[i])}if(clickElms.length>0)return clickElms.findIndex((function(el){return el===element}))}if(!liElm.parentNode)return-1;var siblings=this.getSameTypeSiblings(liElm);return 1===siblings.length?0:siblings.findIndex((function(el){return el===liElm}))},ClickTrackPlugin}(hinaCloudType.PluginBase),StayTrackPlugin=function(_super){function StayTrackPlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="StayTrackPlugin",_this.isReady=!1,_this.timer=null,_this.previousTime=hinaCloudUtil.nowStamp(),_this.previousOffsetTop=0,_this}return __extends(StayTrackPlugin,_super),StayTrackPlugin.prototype.init=function(notify){var _this=this,_a=this.options,autoTrackConfig=_a.autoTrackConfig,stayAutoTrackConfig=_a.stayAutoTrackConfig;if(!0===autoTrackConfig.stayAutoTrack)if(this.isReady)this.context.log("StayTrack plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN);else{this.isReady=!0;var isCollectUrl=stayAutoTrackConfig.isCollectUrl;hinaCloudUtil.isFunction(isCollectUrl)||(isCollectUrl=function(){return!0}),this.timer&&(clearTimeout(this.timer),this.timer=null),this.previousTime=hinaCloudUtil.nowStamp(),window.addEventListener("load",(function(){_this.previousOffsetTop=hinaCloudUtil.getScrollTop()})),window.addEventListener("scroll",(function(){isCollectUrl()&&(_this.timer||(_this.timer=setTimeout((function(){_this.run(notify),clearTimeout(_this.timer),_this.timer=null}),1e3)))})),window.addEventListener("unload",(function(){isCollectUrl()&&_this.run(notify,!0)}))}},StayTrackPlugin.prototype.transform=function(data){return this.context.getReportData("track","H_WebStay",data)},StayTrackPlugin.prototype.run=function(notify,isClosePage){void 0===isClosePage&&(isClosePage=!1);var autoTrackConfig=this.options.autoTrackConfig,stayDelayTime=autoTrackConfig.stayDelayTime,maxStayPageDuration=autoTrackConfig.maxStayPageDuration,offsetTop=hinaCloudUtil.getScrollTop(),nowTime=hinaCloudUtil.nowStamp(),duration=nowTime-this.previousTime;(isClosePage||duration>stayDelayTime&&offsetTop!==this.previousOffsetTop)&¬ify({H_viewport_width:hinaCloudUtil.getScreenWidth(),H_viewport_height:hinaCloudUtil.getScreenHeight(),H_viewport_position:this.previousOffsetTop,event_duration:Math.min(duration/1e3,maxStayPageDuration),H_url_path:window.location.pathname});this.previousTime=nowTime,this.previousOffsetTop=offsetTop},StayTrackPlugin}(hinaCloudType.PluginBase),PageLeavePlugin=function(_super){function PageLeavePlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="PageLeave",_this.isReady=!1,_this.pageId=hinaCloudUtil.generatorTrackId(),_this.storageName="hinasdk_pageleave_",_this.heartbeatIntervalTime=5e3,_this.maxDuration=432e3,_this.heartbeatIntervalTimer=null,_this.startTime=hinaCloudUtil.nowStamp(),_this.url=window.location.href,_this.pageShowStatus=!0,_this}return __extends(PageLeavePlugin,_super),PageLeavePlugin.prototype.init=function(){if(this.options.autoTrackConfig.pageLeaveAutoTrack)if(this.context.store.localStorage)if(this.isReady)this.context.log("PageLeave plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN);else{this.isReady=!0;var _a=this.normalizePageLeaveAutoTrack(),heartbeat_interval_time=_a.heartbeat_interval_time,max_duration=_a.max_duration;heartbeat_interval_time&&heartbeat_interval_time>0&&(this.heartbeatIntervalTime=1e3*heartbeat_interval_time),max_duration&&max_duration>0&&(this.maxDuration=Number(max_duration)),this.startTime=hinaCloudUtil.nowStamp(),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.startHeartBeatInterval()}else this.context.log("PageLeave plugin需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",hinaCloudType.ConsoleTypes.WARN)},PageLeavePlugin.prototype.transform=function(){},PageLeavePlugin.prototype.normalizePageLeaveAutoTrack=function(){var pageLeaveAutoTrack=this.options.autoTrackConfig.pageLeaveAutoTrack;return hinaCloudUtil.isObject(pageLeaveAutoTrack)?pageLeaveAutoTrack:{}},PageLeavePlugin.prototype.addPageLeaveEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeavePlugin.prototype.addPageStartListener=function(){var _this=this;"onpageshow"in window&&window.addEventListener("pageshow",(function(){_this.pageStartHandler()}))},PageLeavePlugin.prototype.addPageSwitchListener=function(){var _this=this;new hinaCloudUtil.ListenPageState({visible:function(){_this.pageStartHandler(),_this.startHeartBeatInterval()},hidden:function(){_this.url=window.location.href,_this.pageEndHandler(),_this.stopHeartBeatInterval()}})},PageLeavePlugin.prototype.addSinglePageListener=function(){var _this=this;hinaCloudUtil.mitt.on("urlChange",(function(params){var fromHref=params.fromHref;fromHref!==params.toHref&&(_this.url=fromHref,_this.pageEndHandler(),_this.stopHeartBeatInterval(),_this.pageStartHandler(),_this.startHeartBeatInterval())}))},PageLeavePlugin.prototype.addPageEndListener=function(){var _this=this,events=["pagehide","beforeunload","unload"];events.forEach((function(event){"on".concat(events)in window&&window.addEventListener(event,(function(){_this.pageEndHandler(),_this.stopHeartBeatInterval()}))}))},PageLeavePlugin.prototype.pageStartHandler=function(){this.startTime=hinaCloudUtil.nowStamp(),this.pageShowStatus=!document.hidden,this.url=window.location.href},PageLeavePlugin.prototype.pageEndHandler=function(){if(this.pageShowStatus){if(this.pageShowStatus=!1,this.isCollectUrl()){var properties=this.getPageLeaveProperties(),data=this.context.getReportData("track","H_WebPageLeave",properties);this.context.report(data)}this.delHeartBeatData()}},PageLeavePlugin.prototype.startHeartBeatInterval=function(){var _this=this;this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),this.isCollectUrl()&&(this.heartbeatIntervalTimer=setInterval((function(){_this.saveHeartBeatData()}),this.heartbeatIntervalTime),this.saveHeartBeatData("first_heartbeat")),this.reissueHeartBeatData()},PageLeavePlugin.prototype.reissueHeartBeatData=function(){for(var localStorage=this.context.store.localStorage,storageLen=localStorage.length(),i=0;i<storageLen;i++){var itemKey=localStorage.key(i);if(itemKey&&itemKey!==this.storageName+this.pageId&&itemKey.includes(this.storageName)){var value=localStorage.get(itemKey),result=hinaCloudUtil.safeJSONParse(value);hinaCloudUtil.isObject(result)&&hinaCloudUtil.nowStamp()-result.time>result.heartbeat_interval_time+5e3&&(delete result.heartbeat_interval_time,this.context.report(result)),this.delHeartBeatData(itemKey)}}},PageLeavePlugin.prototype.stopHeartBeatInterval=function(){this.heartbeatIntervalTimer&&(clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null)},PageLeavePlugin.prototype.delHeartBeatData=function(storageKey){this.context.store.localStorage.remove(storageKey||this.storageName+this.pageId)},PageLeavePlugin.prototype.isCollectUrl=function(){var isCollectUrl=this.normalizePageLeaveAutoTrack().isCollectUrl;return!hinaCloudUtil.isFunction(isCollectUrl)||isCollectUrl(this.url)},PageLeavePlugin.prototype.saveHeartBeatData=function(type){var properties=this.getPageLeaveProperties();properties.H_time=hinaCloudUtil.nowStamp(),"first_heartbeat"===type&&(properties.event_duration=3);var props=this.context.getReportData("track","H_WebPageLeave",properties);props.heartbeat_interval_time=this.heartbeatIntervalTime,this.context.store.localStorage.set(this.storageName+this.pageId,JSON.stringify(props))},PageLeavePlugin.prototype.getPageLeaveProperties=function(){var duration=(hinaCloudUtil.nowStamp()-this.startTime)/1e3;duration=duration<=0||duration>this.maxDuration?0:hinaCloudUtil.formatDecimal(duration,3);var _a=hinaCloudUtil.getURL(this.url),pathname=_a.pathname,hash=_a.hash,referrer=hinaCloudUtil.getReferrer(),properties={H_url:this.url,H_url_path:pathname,H_url_hash:hash,H_viewport_position:hinaCloudUtil.getScrollTop(),H_referrer:referrer,H_referrer_host:referrer?hinaCloudUtil.getHostname(referrer):"",event_duration:duration},custom_props=this.normalizePageLeaveAutoTrack().custom_props;return hinaCloudUtil.isObject(custom_props)&&(properties=__assign(__assign({},properties),custom_props||{})),properties},PageLeavePlugin}(hinaCloudType.PluginBase),SiteLinkerPlugin=function(_super){function SiteLinkerPlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="SiteLinker",_this.isReady=!1,_this.linker=[],_this}return __extends(SiteLinkerPlugin,_super),SiteLinkerPlugin.prototype.init=function(){if(this.options.siteLinkerConfig){var linker=this.getLinkerConfig().linker;hinaCloudUtil.isArray(linker)&&linker.length>0?this.isReady?this.context.log("SiteLinker plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN):(this.isReady=!0,this.resolveOption(),this.setRefferId(),this.addClickListen()):this.context.log("siteLinker plugin: 请配置正确的linker参数",hinaCloudType.ConsoleTypes.WARN)}},SiteLinkerPlugin.prototype.transform=function(){},SiteLinkerPlugin.prototype.getLinkerConfig=function(){var _a=this.options.siteLinkerConfig||{},_b=_a.linker;return{linker:(void 0===_b?[]:_b)||[],re_login:_a.re_login}},SiteLinkerPlugin.prototype.resolveOption=function(){for(var linker=this.getLinkerConfig().linker,len=linker.length,arr=[],i=0;i<len;i++){var _a=linker[i],part_url=_a.part_url,after_hash=_a.after_hash;/[A-Za-z0-9]+\./.test(part_url)&&hinaCloudUtil.isBoolean(after_hash)?arr.push({part_url:part_url,after_hash:after_hash}):this.context.log("The configuration of linker ".concat(i+1," is not supported.Please check format"),hinaCloudType.ConsoleTypes.WARN)}this.linker=arr},SiteLinkerPlugin.prototype.setRefferId=function(){var re_login=this.getLinkerConfig().re_login,urlId=this.getUrlId(),isAnonymousId=urlId.startsWith("a");if(""!==(urlId=urlId.substring(1))){var anonymousId=this.context.store.getAnonymousId(),accountId=this.context.store.getAccountId();if(isAnonymousId){if(urlId!==anonymousId&&(this.context.store.state.anonymousId=urlId,this.context.store.save()),accountId){var props=this.context.getReportData("track_signup","H_SignUp",{});this.context.report(props)}}else(!accountId||re_login&&accountId!==urlId)&&this.context.setUserUId(urlId)}},SiteLinkerPlugin.prototype.getUrlId=function(){var hnId=window.location.href.match(/_hnsdk=([au][^\?\#\&\=]+)/);return hinaCloudUtil.isArray(hnId)&&hnId[1]?hinaCloudUtil.handleDecodeURLComponent(hnId[1]):""},SiteLinkerPlugin.prototype.getPartUrl=function(url){for(var len=this.linker.length,i=0;i<len;i++)if(url.includes(this.linker[i].part_url))return!0;return!1},SiteLinkerPlugin.prototype.getPartHash=function(url){for(var len=this.linker.length,i=0;i<len;i++)if(url.includes(this.linker[i].part_url))return this.linker[i].after_hash;return!1},SiteLinkerPlugin.prototype.getCurrentId=function(){var accountId=this.context.store.getAccountId(),anonymousId=this.context.store.getAnonymousId(),hnId=accountId?"u".concat(accountId):"a".concat(anonymousId);return hinaCloudUtil.handleEncodeURLComponent(hnId)},SiteLinkerPlugin.prototype.rewriteUrl=function(url,dom){var sdkId=this.getCurrentId(),after_hash=this.getPartHash(url),normalizeUrl=hinaCloudUtil.rewriteUrl(url,sdkId,after_hash);return dom&&(dom.href=normalizeUrl),normalizeUrl},SiteLinkerPlugin.prototype.addClickListen=function(){var _this=this,handleClick=function(event){var _a,_b,target=event.target;if(target){var tagName=null===(_a=target.tagName)||void 0===_a?void 0:_a.toLowerCase(),parentNode=target.parentNode,parentTagName=null===(_b=null==parentNode?void 0:parentNode.tagName)||void 0===_b?void 0:_b.toLowerCase();if("a"===tagName&&target.href||"a"===parentTagName&&parentNode.href){var sdkUrl=void 0,sdkTarget=void 0;"a"===tagName&&target.href?(sdkUrl=target.href,sdkTarget=target):(sdkUrl=parentNode.href,sdkTarget=parentNode);var protocol=hinaCloudUtil.getURL(sdkUrl).protocol;"http:"!==protocol&&"https:"!==protocol||_this.getPartUrl(sdkUrl)&&_this.rewriteUrl(sdkUrl,sdkTarget)}}};"PointerEvent"in window?document.addEventListener("pointerdown",handleClick):document.addEventListener("mousedown",handleClick)},SiteLinkerPlugin}(hinaCloudType.PluginBase),HistoryPlugin=function(_super){function HistoryPlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="HistoryPlugin",_this.isReady=!1,_this.lastHref=window.location.href,_this.lastPath=window.location.pathname,_this}return __extends(HistoryPlugin,_super),HistoryPlugin.prototype.init=function(){if(hinaCloudUtil.supportHistory())if(this.isReady)this.context.log("History plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN);else{this.isReady=!0;var self=this,originalOnpopstate=window.onpopstate,handleRouterChange=function(currentPath,currentHref){var params={fromPath:self.lastPath,fromHref:self.lastHref,toPath:currentPath,toHref:currentHref};self.lastPath=currentPath,self.lastHref=currentHref,hinaCloudUtil.mitt.emit("urlChange",__assign(__assign({},params),{mode:"history"}))};window.onpopstate=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var currentPath=window.location.pathname,currentHref=window.location.href;handleRouterChange(currentPath,currentHref),originalOnpopstate&&originalOnpopstate.apply(this,args)},hinaCloudUtil.replaceOld(window.history,"pushState",historyReplaceFn),hinaCloudUtil.replaceOld(window.history,"replaceState",historyReplaceFn)}function historyReplaceFn(originalHistoryFn){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];originalHistoryFn.apply(this,args);var currentPath=window.location.pathname,currentHref=window.location.href;handleRouterChange(currentPath,currentHref)}}},HistoryPlugin.prototype.transform=function(){},HistoryPlugin}(hinaCloudType.PluginBase),HashPlugin=function(_super){function HashPlugin(options,context){var _this=_super.call(this,options,context)||this;return _this.options=options,_this.context=context,_this.name="HashPlugin",_this.isReady=!1,_this.lastHref=window.location.href,_this.lastPath=window.location.hash,_this}return __extends(HashPlugin,_super),HashPlugin.prototype.init=function(){var _this=this;this.isReady?this.context.log("Hash plugin:插件已经运行,无需重复执行",hinaCloudType.ConsoleTypes.WARN):(this.isReady=!0,window.addEventListener("hashchange",(function(event){var newURL=event.newURL,currentPath=hinaCloudUtil.getURL(newURL).hash,params={fromPath:_this.lastPath,fromHref:_this.lastHref,toPath:currentPath,toHref:newURL};_this.lastHref=newURL,_this.lastPath=currentPath,hinaCloudUtil.mitt.emit("urlChange",__assign(__assign({},params),{mode:"hash"}))})))},HashPlugin.prototype.transform=function(){},HashPlugin}(hinaCloudType.PluginBase),AbTestingPlugin=function(_super){function AbTestingPlugin(options,context){var _this=this,platform=hinaCloudUtil.getPlatform();return(_this=_super.call(this,options,context,platform,"hina_webjs_sdk_abtest","4.0.7")||this).options=options,_this.context=context,_this.name="HinaABTest",_this}return __extends(AbTestingPlugin,_super),AbTestingPlugin.prototype.getResultFromServer=function(params){var _this=this;return new Promise((function(resolve,reject){var requestData=_this.createRequestData(params);new hinaCloudUtil.AjaxRequest({url:_this.options.abTestingPluginConfig.url,data:JSON.stringify(requestData),contentType:"application/json",customHeaders:{"project-key":_this.projectKey},timeout:params.timeoutMilliseconds}).run().then((function(res){var data=res.data;"SUCCESS"===(null==data?void 0:data.status)?_this.saveResponseData(data.results).then((function(){resolve(data)})):reject()}))}))},AbTestingPlugin}(hinaCloudUtil.AbtestBasePlugin),SearchKeyword=function(){function SearchKeyword(){}return SearchKeyword.getSourceFromReferrer=function(){var getMatchStrFromArr=function(arr,str){for(var i=0;i<arr.length;i++)if(-1!==str.split("?")[0].indexOf(arr[i]))return!0},utm_reg="(".concat(hinaCloudUtil.utmTypes.join("|"),")\\=[^&]+"),referrer=document.referrer||"",url=window.location.href;if(url){var utm_match=url.match(new RegExp(utm_reg));return utm_match&&utm_match[0]?"付费广告流量":getMatchStrFromArr(hinaCloudUtil.searchTypes,referrer)?"自然搜索流量":getMatchStrFromArr(hinaCloudUtil.socialTypes,referrer)?"社交网站流量":""===referrer?"直接流量":"引荐流量"}return"获取url异常"},SearchKeyword.getReferSearchEngine=function(referrerUrl){var e_1,_a,hostname=hinaCloudUtil.getHostname(referrerUrl);if(!hostname||"hostname解析异常"===hostname)return"";var regexps={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$/]};for(var regexp in regexps){var regexList=regexps[regexp];try{for(var regexList_1=(e_1=void 0,__values(regexList)),regexList_1_1=regexList_1.next();!regexList_1_1.done;regexList_1_1=regexList_1.next()){if(regexList_1_1.value.test(hostname))return regexp}}catch(e_1_1){e_1={error:e_1_1}}finally{try{regexList_1_1&&!regexList_1_1.done&&(_a=regexList_1.return)&&_a.call(regexList_1)}finally{if(e_1)throw e_1.error}}}return"未知搜索引擎"},SearchKeyword.getKeywordFromReferrer=function(){var referrerUrl=document.referrer||"";if(0===referrerUrl.indexOf("http")){var searchEngine=this.getReferSearchEngine(referrerUrl),query=hinaCloudUtil.getURLSearchParams(hinaCloudUtil.getURL(referrerUrl).search);if(hinaCloudUtil.isEmptyObject(query))return"未取到值";for(var key in hinaCloudUtil.searchKeywords){var value=hinaCloudUtil.searchKeywords[key];if(key===searchEngine)if(hinaCloudUtil.isArray(value))for(var i=0;i<value.length;i++){var val=query[value[i]];if(val)return val}else if(query[value])return query[value]}return"未取到值"}return""===referrerUrl?"未取到值_直接打开":"未取到值_非http的url"},SearchKeyword}();function getUmtsParams(prefix){void 0===prefix&&(prefix="");var params,utms=(params={},hinaCloudUtil.utmTypes.forEach((function(key){var result=hinaCloudUtil.getQueryParam(window.location.href,key);result.length&&(params[key]=result)})),params),allUtms={};return Object.keys(utms).forEach((function(key){allUtms[prefix+key]=utms[key]})),allUtms}var HinaTrack=function(_super){function HinaTrack(options,useInstancing){void 0===useInstancing&&(useInstancing=!0);var _this=_super.call(this,options,useInstancing)||this;return _this.trackTags=defaultTags,_this.customProperties={},_this.generalProperties={H_lib_version:"4.0.7",H_lib:"js",H_lib_method:"code",H_timezone_offset:(new Date).getTimezoneOffset()},_this.useInstancing&&_this.init(options),_this}return __extends(HinaTrack,_super),HinaTrack.prototype.init=function(options){if(this.isReady)this.log("hinaSDK has been initialized",hinaCloudType.ConsoleTypes.ERROR);else{var default_config={name:"",serverUrl:"",showLog:!1,autoTrackConfig:{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:["hn-click"],pageviewAutoTrack:!1,pageLeaveAutoTrack:!1},stayAutoTrackConfig:{isCollectUrl:function(){return!0}},maxStringLength:1024,imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:hinaCloudType.ReportTypes.AJAX,customHeaders:{},credentials:!1,dataSendTimeout:3e3,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0},sourceChannel:[],plugins:[]},performanceErrorConfig=options.performanceErrorConfig,plugins=options.plugins,others=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}(options,["performanceErrorConfig","plugins"]);this.options=hinaCloudUtil.merge(default_config,others),this.options=__assign(__assign({},this.options),{performanceErrorConfig:performanceErrorConfig,plugins:plugins}),this.initState(),this.initAdvProps(),this.normalizeConfig(),this.initPlugins(),this.isReady=!0}},HinaTrack.prototype.normalizeConfig=function(){var _this=this,_a=this.options,serverUrl=_a.serverUrl,sendType=_a.sendType,batchSend=_a.batchSend,maxStringLength=_a.maxStringLength,isSinglePage=_a.isSinglePage,_b=_a.autoTrackConfig,_c=void 0===_b?{}:_b,_d=_c.trackAttr,trackAttr=void 0===_d?[]:_d,collectTags=_c.collectTags,pageLeaveAutoTrack=_c.pageLeaveAutoTrack,pageviewAutoTrack=_c.pageviewAutoTrack;if(""===(serverUrl=(serverUrl=serverUrl||"").trim()))this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",hinaCloudType.ConsoleTypes.WARN);else{var href=window.location.href,currentProtocol=hinaCloudUtil.getURL(href).protocol||"";(hinaCloudUtil.getURL(serverUrl).protocol||"")!==currentProtocol&&this.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为:https 下面发送 http 的图片请求会失败。",hinaCloudType.ConsoleTypes.WARN)}if([hinaCloudType.ReportTypes.IMAGE,hinaCloudType.ReportTypes.AJAX,hinaCloudType.ReportTypes.BEACON].includes(sendType)||this.setConfig({sendType:hinaCloudType.ReportTypes.AJAX}),this.options.maxStringLength=hinaCloudUtil.normalizeMaxStringLength(maxStringLength),(!0===pageLeaveAutoTrack||hinaCloudUtil.isObject(pageLeaveAutoTrack)&&hinaCloudUtil.isEmptyObject(pageLeaveAutoTrack))&&(this.options.autoTrackConfig.pageLeaveAutoTrack={heartbeat_interval_time:5e3,max_duration:432e3}),hinaCloudUtil.isArray(trackAttr)?(trackAttr=trackAttr.filter((function(v){return hinaCloudUtil.isString(v)}))).includes("hn-click")||trackAttr.push("hn-click"):trackAttr=["hn-click"],this.options.autoTrackConfig.trackAttr=trackAttr,hinaCloudUtil.isObject(collectTags))if(!0===collectTags.div)this.options.autoTrackConfig.collectTags.div={ignoreTags:ignoreTags,maxLevel:1};else if(hinaCloudUtil.isObject(collectTags.div)){var maxLevel=1,oDiv=collectTags.div;hinaCloudUtil.isNumber(oDiv.maxLevel)&&[1,2,3].includes(oDiv.maxLevel)&&(maxLevel=oDiv.maxLevel),this.options.autoTrackConfig.collectTags.div={ignoreTags:ignoreTags,maxLevel:maxLevel}}else this.options.autoTrackConfig.collectTags.div=!1;else this.options.autoTrackConfig.collectTags={div:!1};this.updateTrackTags(),(!0===batchSend||hinaCloudUtil.isObject(batchSend)&&!hinaCloudUtil.isEmptyObject(batchSend))&&(this.options.batchSend=__assign({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},batchSend),this.batchSender=new hinaCloudUtil.BatchSend(this.options,"hinasdk_tab","hinasdk_data_")),"auto"===pageviewAutoTrack?this.autoTrack():("singlePage"===pageviewAutoTrack||isSinglePage)&&(this.autoTrack(),hinaCloudUtil.mitt.on("urlChange",(function(data){var fromHref=data.fromHref;if(fromHref!==data.toHref){var payload={};if(hinaCloudUtil.isFunction(isSinglePage)){var extra=isSinglePage();hinaCloudUtil.isObject(extra)&&(payload=__assign(__assign({},payload),extra))}_this.autoTrack(__assign(__assign({},payload),{H_referrer:fromHref}))}})))},HinaTrack.prototype.updateTrackTags=function(){var collectTags=this.options.autoTrackConfig.collectTags,tags=function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}([],function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}(defaultTags),!1);Object.keys(collectTags||{}).forEach((function(key){var value=collectTags[key];!0!==value&&!hinaCloudUtil.isObject(value)||tags.includes(key)||tags.push(key)})),this.trackTags=tags},HinaTrack.prototype.initState=function(){this.store=new hinaCloudUtil.WebState(this.options),this.store.init()},HinaTrack.prototype.initAdvProps=function(){var advProps={},_a=this.options,presetProperties=_a.presetProperties,sourceChannel=_a.sourceChannel;if(hinaCloudUtil.isObject(presetProperties))for(var key in presetProperties){var value=presetProperties[key];if(key.includes("latest_")&&(key=key.slice(7),value)){var url_domain=hinaCloudUtil.getCurrentDomain();if("utm"!==key&&"url解析失败"===url_domain)advProps["H_latest_".concat(key)]="url的domain解析失败";else if(hinaCloudUtil.isReferralTraffic())switch(key){case"traffic_source_type":advProps.H_latest_traffic_source_type=SearchKeyword.getSourceFromReferrer();break;case"search_keyword":var searchKeyword=SearchKeyword.getKeywordFromReferrer();searchKeyword&&(advProps.H_latest_search_keyword=searchKeyword);break;case"referrer":advProps.H_latest_referrer=hinaCloudUtil.getReferrer()}}}var props=this.store.state.props||{},latestAllUtms={};presetProperties.latest_utm&&(latestAllUtms=getUmtsParams("H_latest_"));var firstAllUtms={};props.H_utm_source||(firstAllUtms=getUmtsParams("H_"));var source=[],customUtm={};hinaCloudUtil.isArray(sourceChannel)&&sourceChannel.length>0&&(source=sourceChannel.filter((function(val){return!hinaCloudUtil.utmTypes.includes(val)}))).length>0&&(customUtm=__assign(__assign({},customUtm),function(prefix,utms){void 0===utms&&(utms=[]);var allUtms={};return utms.forEach((function(key){var result=hinaCloudUtil.getQueryParam(window.location.href,key);result&&(allUtms[key]=result,allUtms["".concat(prefix).concat(key)]=result)})),allUtms}("H_latest_",source))),this.store.state.props=__assign(__assign(__assign(__assign(__assign({},this.store.state.props),advProps),latestAllUtms),customUtm),firstAllUtms),this.store.setProps(this.store.state.props),this.store.getUtmFromProps(source)},HinaTrack.prototype.getGeneralProperties=function(){var browserInfo=new hinaCloudUtil.Browser;return this.generalProperties=__assign(__assign(__assign({},this.generalProperties),{H_screen_width:window.screen.width,H_screen_height:window.screen.height,H_viewport_width:hinaCloudUtil.getScreenWidth(),H_viewport_height:hinaCloudUtil.getScreenHeight(),H_page_height:hinaCloudUtil.getPageScrollHeight(),H_browser:browserInfo.browserName,H_browser_version:browserInfo.browserVersion,H_os:browserInfo.os,H_os_version:browserInfo.osVersion,H_model:browserInfo.model,H_is_first_day:this.store.isFirstDay,H_url:window.location.href,H_url_host:hinaCloudUtil.getHostname(window.location.href,"url_host取值异常"),H_title:document.title}),this.store.hLatestUtm),this.generalProperties.H_latest_referrer&&(this.generalProperties.H_latest_referrer_host=hinaCloudUtil.getHostname(this.generalProperties.H_latest_referrer,"hostname解析异常")),this.generalProperties},HinaTrack.prototype.initPlugins=function(){var _this=this,_a=this.options,serverUrl=_a.serverUrl,name=_a.name,showLog=_a.showLog,sendType=_a.sendType,customHeaders=_a.customHeaders,credentials=_a.credentials,dataSendTimeout=_a.dataSendTimeout,batchSend=_a.batchSend,imgUseCrossOrigin=_a.imgUseCrossOrigin,globalCallback=_a.globalCallback,_b=_a.plugins,plugins=void 0===_b?[]:_b,performanceErrorConfig=_a.performanceErrorConfig,autoTrackConfig=_a.autoTrackConfig,siteLinkerConfig=_a.siteLinkerConfig,abTestingPluginConfig=_a.abTestingPluginConfig;plugins=plugins||[];var pageLeaveAutoTrack=autoTrackConfig.pageLeaveAutoTrack,clickCrackPlugin=new ClickTrackPlugin(this.options,this),stayTrackPlugin=new StayTrackPlugin(this.options,this),historyPlugin=new HistoryPlugin(this.options,this),hashPlugin=new HashPlugin(this.options,this),pageLeavePlugin=new PageLeavePlugin(this.options,this),siteLinkerPlugin=new SiteLinkerPlugin(this.options,this),abTestingPlugin=new AbTestingPlugin(this.options,this);pageLeavePlugin.disabled=!(hinaCloudUtil.isObject(pageLeaveAutoTrack)&&!hinaCloudUtil.isEmptyObject(pageLeaveAutoTrack));var linker=(siteLinkerConfig||{}).linker;siteLinkerPlugin.disabled=!(hinaCloudUtil.isArray(linker)&&linker.length>0),abTestingPlugin.disabled=!(hinaCloudUtil.isObject(abTestingPluginConfig)&&!hinaCloudUtil.isEmptyObject(abTestingPluginConfig)),this.plugins=[clickCrackPlugin,stayTrackPlugin,historyPlugin,hashPlugin,pageLeavePlugin,siteLinkerPlugin,abTestingPlugin],hinaCloudUtil.isArray(plugins)&&plugins.forEach((function(Plugin){if("Monitor"===Plugin.componentName){if(hinaCloudUtil.isObject(performanceErrorConfig)&&!hinaCloudUtil.isEmptyObject(performanceErrorConfig))new Plugin(__assign({serverUrl:serverUrl,name:name,showLog:showLog,sendType:sendType,customHeaders:customHeaders,credentials:credentials,dataSendTimeout:dataSendTimeout,batchSend:batchSend,imgUseCrossOrigin:imgUseCrossOrigin,globalCallback:globalCallback},performanceErrorConfig),!0)}else{var instance=new Plugin(_this.options,_this);_this.plugins.push(instance)}})),this.runPlugins(this.plugins)},HinaTrack.prototype.use=function(pluginName,options){if(this.isReady){if(hinaCloudUtil.isObject(options)){"PageLeave"===pluginName?this.options.autoTrackConfig.pageLeaveAutoTrack=options:"SiteLinker"===pluginName?this.options.siteLinkerConfig=options:"HinaABTest"===pluginName&&(this.options.abTestingPluginConfig=options);var instance=this.plugins.find((function(plugin){return plugin.name===pluginName}));return instance&&(instance.disabled=!1,instance.isReady?this.log("".concat(pluginName,"插件已运行,无需重复执行"),hinaCloudType.ConsoleTypes.WARN):instance.init()),this.getPluginInstance(pluginName)}this.log("".concat(pluginName,"插件配置项必须是一个对象类型"),hinaCloudType.ConsoleTypes.WARN)}else this.log("请先初始化埋点SDK",hinaCloudType.ConsoleTypes.WARN)},HinaTrack.prototype.getPluginInstance=function(pluginName){return this.plugins.find((function(plugin){return plugin.name===pluginName}))},HinaTrack.prototype.setConfig=function(options){this.options=hinaCloudUtil.merge(this.options,options),this.normalizeConfig()},HinaTrack.prototype.getConfig=function(key){return key?this.options[key]:this.options},HinaTrack.prototype.setUserUId=function(uid,callback){var _this=this,accountId=this.store.getAccountId();hinaCloudUtil.setUserUId(uid,accountId,(function(id){_this.store.setAccountId(id);var props=_this.getReportData("track_signup","H_SignUp",{});_this.report(props,callback)}))},HinaTrack.prototype.cleanUserUId=function(){this.store.setAccountId("")},HinaTrack.prototype.getUserUid=function(){return this.store.state.accountId},HinaTrack.prototype.setDeviceUId=function(uid){this.store.setDeviceId(uid)},HinaTrack.prototype.getDeviceUId=function(){return this.store.getDeviceId()},HinaTrack.prototype.userSet=function(data,callback){if(hinaCloudUtil.isObject(data)&&!hinaCloudUtil.isEmptyObject(data)){var props=this.getReportData("user_set","",data);this.report(props,callback)}},HinaTrack.prototype.userSetOnce=function(data,callback){if(hinaCloudUtil.isObject(data)&&!hinaCloudUtil.isEmptyObject(data)){var props=this.getReportData("user_setOnce","",data);this.report(props,callback)}},HinaTrack.prototype.userAdd=function(data,callback){var _this=this;hinaCloudUtil.userAdd(data,(function(result){var props=_this.getReportData("user_add","",result);_this.report(props,callback)}))},HinaTrack.prototype.userAppend=function(data,callback){var _this=this;hinaCloudUtil.userAppend(data,(function(result){var props=_this.getReportData("user_append","",result);_this.report(props,callback)}))},HinaTrack.prototype.userUnset=function(data,callback){var _this=this;hinaCloudUtil.userUnset(data,(function(result){var props=_this.getReportData("user_unset","",result);_this.report(props,callback)}))},HinaTrack.prototype.userDelete=function(callback){var props=this.getReportData("user_delete","",{});this.report(props,callback),this.store.setAccountId("")},HinaTrack.prototype.registerCommonProperties=function(params){this.customProperties=hinaCloudUtil.merge(this.customProperties,params)},HinaTrack.prototype.getPresetProperties=function(){return __assign(__assign({},this.getGeneralProperties()),this.customProperties)},HinaTrack.prototype.clearPageRegister=function(payload){var _this=this;void 0===payload&&(payload=!0),!0===payload?this.customProperties={}:hinaCloudUtil.isArray(payload)&&payload.forEach((function(key){key in _this.customProperties&&delete _this.customProperties[key]}))},HinaTrack.prototype.track=function(event,properties,callback){if(callback=callback||function(){},hinaCloudUtil.isString(event)){properties=hinaCloudUtil.isObject(properties)?properties:{};var props=this.getReportData("track",event,properties);this.report(props,callback)}else this.log("track事件名必须是字符串,属性必须是是一个对象",hinaCloudType.ConsoleTypes.WARN)},HinaTrack.prototype.quick=function(name,data,callback){if(!this.isReady)return this.log("请先初始化SDK");var params={};callback=hinaCloudUtil.isFunction(callback)?callback:hinaCloudUtil.noop,hinaCloudUtil.isObject(data)?params=data:hinaCloudUtil.isFunction(data)&&(callback=data),this.autoTrack(params,callback)},HinaTrack.prototype.autoTrack=function(data,callback){void 0===data&&(data={}),void 0===callback&&(callback=hinaCloudUtil.noop);var referrer=(null==data?void 0:data.H_referrer)||hinaCloudUtil.getReferrer(),options=__assign(__assign(__assign({H_is_first_time:this.store.isFirstTime,H_url_path:window.location.pathname,H_referrer:referrer,H_referrer_host:referrer?hinaCloudUtil.getHostname(referrer):""},this.store.hUtm),this.store.customUtm),data||{}),props=this.getReportData("track","H_pageview",options);if(this.report(props,callback),this.store.isFirstTime){this.store.isFirstTime=!1;var referrer_1=hinaCloudUtil.getReferrer(),data_1=__assign(__assign({H_first_visit_time:hinaCloudUtil.nowStamp(),H_first_referrer:referrer_1,H_first_referrer_host:referrer_1?hinaCloudUtil.getHostname(referrer_1,"取值异常"):"",H_first_traffic_source_type:SearchKeyword.getSourceFromReferrer(),H_first_search_keyword:SearchKeyword.getKeywordFromReferrer(),H_first_browser_language:hinaCloudUtil.isString(navigator.language)?navigator.language.toLowerCase():"取值异常",H_first_browser_charset:document.characterSet||document.inputEncoding||"UTF-8"},this.store.hUtm),this.store.customUtm);this.userSetOnce(data_1)}},HinaTrack.prototype.report=function(data,callback,type){var _a,_b,_c=this.options,appJsBridge=_c.appJsBridge,serverUrl=_c.serverUrl;if(this.log(data),appJsBridge){var isError=!0,jsBridge=null===window||void 0===window?void 0:window.Hina_Cloud_H5_Bridge;if(hinaCloudUtil.isObject(jsBridge)&&jsBridge.track)isError=!1,jsBridge.track(data.event,data.type,JSON.stringify(data));else{var Tracker=null===(_b=null===(_a=null===window||void 0===window?void 0:window.webkit)||void 0===_a?void 0:_a.messageHandlers)||void 0===_b?void 0:_b.hinaNativeTracker;if(null==Tracker?void 0:Tracker.postMessage){isError=!1;var params=JSON.stringify({eventName:data.event,eventType:data.type,properties:data});Tracker.postMessage(params)}}if(isError)return void this.log("JSBridge 发送数据失败",hinaCloudType.ConsoleTypes.WARN);hinaCloudUtil.isFunction(callback)&&callback(serverUrl,data)}else this.sendReportData(data,callback,type)},HinaTrack.prototype.getReportData=function(type,event,data){var properties,anonymous_id=this.store.getAnonymousId(),accountId=this.store.getAccountId(),time=hinaCloudUtil.nowStamp(),customProperties=hinaCloudUtil.merge(this.customProperties),generalProperties=this.getGeneralProperties();if("user"===type.slice(0,4)){var H_lib=generalProperties.H_lib,H_lib_method=generalProperties.H_lib_method,H_lib_version=generalProperties.H_lib_version;properties=__assign({device_id:this.store.getDeviceId(),H_lib:H_lib,H_lib_method:H_lib_method,H_lib_version:H_lib_version},data||{})}else properties=__assign(__assign(__assign({device_id:this.store.getDeviceId()},generalProperties),customProperties),data||{});hinaCloudUtil.checkReportProperties(properties,this.options.maxStringLength);var isLogin=accountId&&!/^[0-9a-f]{8,}-[0-9a-f]{4,}-[0-9a-f]{4,}-[0-9a-f]{4,}-[0-9a-f]{12,}$/.test(accountId),props={anonymous_id:anonymous_id,type:type,event:event,time:time,_track_id:hinaCloudUtil.generatorTrackId(),properties:__assign(__assign({},properties),{H_is_login_id:!!isLogin})};return isLogin&&(props.account_id=accountId),props.send_time=hinaCloudUtil.nowStamp(),props},HinaTrack}(hinaCloudJsCore.WebClient);var hinaSdk=new HinaTrack({},!1);exports.HinaTrack=HinaTrack,exports.default=hinaSdk,Object.keys(hinaCloudType).forEach((function(k){"default"===k||Object.prototype.hasOwnProperty.call(exports,k)||Object.defineProperty(exports,k,{enumerable:!0,get:function(){return hinaCloudType[k]}})}));
|