index.vue-3.0.30.js.下载 26 KB

1
  1. var YouZanHummer=function(t){"use strict";var e=function(t,r){return(e=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])})(t,r)};function r(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}var i=null;function a(){if(i)return i;var t,e=(t=null,"undefined"!=typeof wx&&(t=wx),"undefined"!=typeof swan&&(t=swan),"undefined"!=typeof my&&(t=my),t?{ctx:t,console:console}:null);return e?(i=e,e):(i=window,window)}var s,u,c,p,l=Object.prototype.toString;function f(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object DOMException]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}function h(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function d(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function v(t){return"string"==typeof t}function m(t){return"[object Object]"===Object.prototype.toString.call(t)}function y(t){return"[object RegExp]"===l.call(t)}function g(t,e){return!(!t||!e)&&(y(t)?t.test(e):!(!v(t)||!v(e))&&-1!==e.indexOf(t))}!function(t){t.XHR_ERROR="XhrError",t.PROMISE_ERROR="PromiseError",t.NAVIGATE_ERROR="NavigateError",t.UNKNOWN_ERROR="UnknownError",t.DOM_ERROR="DomError",t.CUSTOM_ERROR="CustomError"}(s||(s={})),function(t){t.ON_ERROR="onError",t.ON_PROMISE="onPromise",t.ON_NAVIGATE="onNavigate",t.ON_XHR="onXhr",t.ON_CUSTOM="onCustom",t.ON_UNKNOWN="onUnknown",t.ON_TIMER="onTimer",t.ON_A_FRAME="onAFrame",t.ON_EVENT="onEvent",t.ON_RANTA="onRanta"}(u||(u={})),function(t){t.ERROR="error",t.WARN="warn",t.INFO="info"}(c||(c={})),function(t){t[t.WEB=1]="WEB",t[t.NODE=2]="NODE",t[t.ANT=3]="ANT",t[t.WX=4]="WX",t[t.QQ=5]="QQ",t[t.BAIDU=6]="BAIDU",t[t.XHS=7]="XHS"}(p||(p={}));var E=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function R(t,e,r,n,o){return o?O(o):function(t,e,r,n){var o=function(t){var e=h(t)?t.message:t;if("string"==typeof e){var r=e.match(E);if(r)return{name:r[1],message:r[2]}}return{name:s.UNKNOWN_ERROR,message:e}}(t),i=o.name,a=o.message;return{exception:{type:i,message:a,stack:i+": "+a+"\nat "+e+":"+r+":"+n,source:u.ON_UNKNOWN}}}(t,e,r,n)}function O(t,e){if(void 0===e&&(e=!1),h(t)&&t.error)return _(t.error);var r,n={};if(d(t)||(r=t,"[object DOMException]"===Object.prototype.toString.call(r))){var o=t.name||d(t)?s.DOM_ERROR:"DOMException",i=t.message?o+": "+t.message:o;return n.exception={type:o,message:i,stack:"",source:u.ON_UNKNOWN},n}return f(t)?_(t):v(t)?_({stack:t}):x(e)}function _(t){var e={};return e.exception={type:t.name,message:t.message,stack:t.stack||t.stacktrace||"",source:u.ON_UNKNOWN},e}function x(t){return w(t?s.PROMISE_ERROR:s.UNKNOWN_ERROR,"Unknown Error from "+(t?"Promise rejection":"Exception"))}function w(t,e){return{exception:{type:t,message:e,stack:"",source:u.ON_UNKNOWN}}}function b(t,e,r,n){return void 0===n&&(n="error"),t.exception&&(t.exception.source=e),t.level=r,t.type=n,t}function N(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach((function(t){t&&Object.keys(t).forEach((function(e){var n=t[e];m(n)?m(r[e])?r[e]=N(r[e],n):r[e]=N(n):Array.isArray(n)?r[e]=(r[e]||[]).concat(n):r[e]=n}))})),r}function k(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function M(t,e,r){if(t&&e in t){var n=t[e];t[e]=function(t,e){var r=e(t);if("function"==typeof r)try{r.prototype=r.prototype||{},Object.defineProperties(r,{__hummer__:{enumerable:!1,value:!0},__hummer_source__:{enumerable:!1,value:t}})}catch(t){}return r}(n,r)}}function T(t,e){if("function"!=typeof t)return t;try{if(t.__hummer__)return t;if(t.__hummer_wrapped__)return t.__hummer_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{var n=r.map((function(t){return T(t,e)}));return t.handleEvent?t.handleEvent.apply(this,n):t.apply(this,n)}catch(t){throw e&&e(t),t}};try{for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__hummer_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__hummer__:{enumerable:!1,value:!0},__hummer_source__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}var L="YouZanFeHummer",j={debug:!1,enable:1,enableError:1,enablePerformance:1,appKey:"",url:"https://tj1.youzanyun.com/v3/js/log",ignoreError:[],ignoreURL:[],allowURL:[],issueRules:[],fsRule:{},middlePages:[],sample:1,perSample:1,debounce:300,maxExecuteNumber:3,timeout:5e3,retry:1,perfEntryRetry:{max:15,delay:200},error:{onError:!0,onReject:!0,onNavigate:!0,onXhr:!0,setTimeout:!0,setInterval:!0,requestAnimationFrame:!0,eventTarget:!0,xhrErrorStatus:function(t){return t<300&&t>=200}}},P=new(function(){function t(){this._enable=!1}return t.prototype.setEnable=function(){return this._enable=!0,this},t.prototype.setUnable=function(){return this._enable=!1,this},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._processLogger(t,"log"),this},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._processLogger(t,"warn"),this},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._processLogger(t,"error"),this},t.prototype.rawError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._processLogger(t,"error",!0),this},t.prototype.devWarn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{if("development"!==process.env.NODE_ENV)return this}catch(t){return this}return this._processLogger(t,"warn",!0),this},t.prototype._processLogger=function(t,e,r){if(void 0===r&&(r=!1),this._enable||r){var n=a().console[e];if(n){var i=L+":";n.__hummer__&&n.__hummer_source__?n.__hummer_source__.apply(n,o([i],t)):n.apply(void 0,o([i],t))}}},t}()),S=function(){function t(){this.cache={}}return t.prototype.clear=function(){this.cache={}},t.prototype.get=function(t,e){return this.cache[t]||e||null},t.prototype.set=function(t,e){return this.cache[t]=e,this},t}(),U="USER_KEY",I="EXTRA_KEY",A="BIZ_KEY",D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setBiz=function(t){return this.set(A,N(this.getBiz(),t)),P.info("Store: setBiz",t),this},e.prototype.getBiz=function(){return this.get(A,{})},e.prototype.setUser=function(t){return this.set(U,N(this.getUser(),t)),P.info("Store: setUser",t),this},e.prototype.getUser=function(){return this.get(U,{})},e.prototype.setExtra=function(t){var e=this.get(I,{}),r=Object.assign(e,t);return P.info("Store: setExtra",r),this.set(I,r),this},e.prototype.getExtra=function(){return this.get(I,{})},e}(S),q=function(){function t(){}return t.prototype.exceptionEvent=function(t){var e=O(t);return e.level=c.ERROR,Promise.resolve(e)},t.prototype.exceptionMessage=function(t,e){void 0===e&&(e="error");var r=w(s.CUSTOM_ERROR,t);return r.level=e,Promise.resolve(r)},t}(),C=function(){},W=function(t){function e(r){var n=t.call(this,r)||this;return n.isHummerError=!0,Object.setPrototypeOf&&Object.setPrototypeOf(n,e.prototype),n}return r(e,t),e}(Error);function H(t){return new W(L+":Error: "+t)}function K(t){return t&&t.isHummerError}var B=function(){function t(t,e){this.taskList=[],this.executeList=[],this.retry=0,this.running=!1,this.enable=!1,this.maxExecuteNumber=t.maxExecuteNumber,this.retry=t.retry,this.adapter=e}return t.prototype.add=function(t){this.taskList.unshift(t),this.next()},t.prototype.run=function(){this.running?P.info("Queue is executing, do not call repeatedly"):(this.enable=!0,this.running=!0,this.next())},t.prototype.clear=function(){P.info("sdk: uninstall task queue"),this.enable=!1,this.running=!1,this.taskList=[],this.executeList=[]},t.prototype.next=function(){if(this.enable&&this.taskList.length){if(this.maxExecuteNumber-this.executeList.length<=0)P.info("Queue: Task is over, waiting....");else{for(var t=null,e=0;e<this.taskList.length;e++){var r=this.taskList.pop();if(t){if(e>=6)return;t.data.events=t.data.events.concat(r.data.events)}else t=r}if(t){var n=this.adapter.request(t);n.id=t.id||"none",n.retry=this.retry,this.executeTask(n)}}}},t.prototype.executeTask=function(t){var e=this.executeList.push(t.id)-1,r=this;t.then((function(){P.info("Report: "+t.id+" success"),r.executeList.splice(e,1),r.next()})).catch((function(){P.info("Report: "+t.id+" fail"),r.executeList.splice(e,1),r.again(t)}))},t.prototype.again=function(t){t.retry<=0||(t.retry--,P.info("Queue: "+t.id+" retry again, retry count is "+t.retry),this.executeTask(t))},t}(),F=function(){function t(t){this.unityList=[],this.unityName=t}return t.prototype.add=function(t){return P.info(this.unityName+": "+(t.name||"unknown"+this.unityName)+" is attached"),this.unityList.push(t),this.unityList.length-1},t.prototype.use=function(t,e){for(var r=this,n=Promise.resolve(t),i=t,a=o(this.unityList,[function(){return t}]);a.length;){var s=a.shift();if(!i)return Promise.reject(H(this.unityName+": no return value, discard "+t.id+" event"));if(i=s(!0===i?t:i,e),n=Promise.resolve(i),i instanceof Promise){n=i;break}}for(var u=function(){var o=a.shift();n=n.then((function(n){return n?o(!0===n?t:n,e):Promise.reject(H(r.unityName+": no return value, discard "+t.id+" event"))}))};a.length;)u();return n},t.prototype.remove=function(t){var e=this.unityList[t];e&&(P.info(this.unityName+": "+(e.name||"unknown"+this.unityName)+" is unload"),this.unityList[t]=null)},t.prototype.clear=function(){P.info("sdk: uninstall "+this.unityName+"Manager"),this.unityList=[]},t}();function z(t,e){if(t.id=k(),t.captureTime=Date.now(),t.user=e.store.getUser(),t.extra=n(n({},t.extra||{}),e.store.getExtra()||{}),t.biz=e.store.getBiz(),t.type||(t.type="error"),"per"===t.type)return t.hash=0,t;var r=t.exception;if(!r)return t;r.type||(r.type=s.UNKNOWN_ERROR);var o,i,a=e.options.issueRules,u=void 0===a?[]:a,c=r.message,p=r.stack.split("\n").find((function(t){return/\.js:\d+:\d+/.test(t)}))||"";return t.hash=function(t){for(var e=5381,r=0,n=t.length;r<n;r++)e+=(e<<5)+t.charCodeAt(r);return 2147483647&e}(""+[e.options.appKey,r.type,(o=c,i=u,void 0===i&&(i=[]),o&&0!==i.length?i.reduce((function(t,e){return t=t.replace(y(e.reg)?e.reg:new RegExp(e.reg,"g"),e.value)}),o):o),p].join("")),t}var X="EVENT_SYSTEM";function V(t,e){var r=e.store.get(X);return r?(t.system=r,t):e.adapter.getSystemInfo().then((function(r){return t.system=r,e.store.set(X,r),t}))}function Q(t,e){if("route"in t)return t;var r=e.adapter.getRoute();return t.route=r,t}function J(t,e){var r,n=e.options;return function(t){return t&&t.exception&&-1!==t.exception.message.indexOf(""+L)}(t)?(P.info("Event discard due to being matched by isHummerError, message is "+t.exception.message),!1):function(t,e){return"error"===t.type&&e.some((function(e){return g(e,t.exception.message)}))}(t,n.ignoreError)?(P.info("Event discard due to being matched by ignoreError, message is "+t.exception.message),!1):(r=t.route.url,n.ignoreURL.some((function(t){return g(t,r)}))?(P.info("Event discard due to being matched by ignoreURL, url is "+t.route.url),!1):!!function(t,e){return 0===e.length||e.some((function(e){return g(e,t)}))}(t.route.url,n.allowURL)||(P.info("Event discard due to being matched by not in allowURL, url is "+t.route.url),!1))}function Y(t,e){var r=e.options,n=r.sample,o=r.perSample;return"per"===t.type&&Math.random()>o?(P.info("Event discard due to per sample options, per sample is "+o),!1):!("error"===t.type&&Math.random()>n)||(P.info("Event discard due to error sample options, error sample is "+n),!1)}function G(t,e){if("error"!==t.type)return!0;var r=e.store;return r.get(""+t.hash)?(P.info("Event discard due to hash duplicated",t),!1):(r.set(""+t.hash,!0),!0)}var Z=function(){function t(t){this.captors=[],this.control=t}return t.prototype.run=function(){this.captors.forEach((function(t){t&&t.onLoad&&t.onLoad()}))},t.prototype.update=function(){this.captors.forEach((function(t){t&&t.update&&t.update()}))},t.prototype.add=function(t){if(t.control||(t.control=this.control),this.control.getOptions().enable&&t.install(),t.constructor){var e=t.constructor.name||"unknown";P.info("Captor: "+e+" is attached")}return this.captors.push(t)},t.prototype.remove=function(t){this.captors[t]&&(P.info("Captor: "+(t||"unknown captor")+" is unload"),this.captors[t]=null)},t.prototype.clear=function(){P.info("sdk: uninstall CaptorManager"),this.captors.forEach((function(t){t&&t.uninstall&&t.uninstall()})),this.captors=[]},t}(),$=function(){function t(t){this.control=t}return t.prototype.skynetURL=function(t){var e=this.control;return e.getOptions().url+"?appKey="+e.getOptions().appKey+"&__hummer__=1"},t.prototype.createRequestData=function(t){var e;return{data:{plat:{yai:"fe-monitor",st:"js",sv:"0.0.0"},user:{login_sign:t.user.mobile?1:0,uuid:t.user.uuid,uid:t.user.uid,m:t.user.mobile},context:{},env:{app_name:this.control.getOptions().appKey,net:t.system.net,node_env:null===(e=t.env)||void 0===e?void 0:e.nodeEnv},events:[this.transformEvent(t)]},header:{"Content-type":"text/plain; charset=UTF-8"}}},t.prototype.transformEvent=function(t){var e,r,n,o,i,a,s,u,c,p,l,f,h={l:t.level,ct:t.captureTime,skn:t.sdk.name,skv:t.sdk.version,t:t.type,sta:t.system.app,std:t.system.model,stap:t.system.appPlatform,stv:t.system.appVersion,stp:t.system.platform,stm:t.system.mpSdkVersion,bk:t.biz.kdtId,bn:t.biz.shopName,bv:t.biz.mpVersion,path:t.route.path,st:t.baseTime,df:null===(e=t.per)||void 0===e?void 0:e.df,pn:null===(r=t.per)||void 0===r?void 0:r.pn,dp:null===(n=t.per)||void 0===n?void 0:n.dp,est:null===(o=t.per)||void 0===o?void 0:o.es,fr:null===(i=t.per)||void 0===i?void 0:i.fr,fp:null===(a=t.per)||void 0===a?void 0:a.fp,fcp:null===(s=t.per)||void 0===s?void 0:s.fcp,lcp:null===(u=t.per)||void 0===u?void 0:u.lcp};if((null===(c=t.per)||void 0===c?void 0:c.al)&&(h.al=t.per.al),(null===(p=t.per)||void 0===p?void 0:p.rt)&&(h.rt=t.per.rt),(null===(l=t.per)||void 0===l?void 0:l.navigation)&&(h.navigation=t.per.navigation),t.exception&&(h.et=t.exception.type,h.em=t.exception.message,h.es=t.exception.source,h.ek=t.exception.stack,h.h=t.hash),t.extra)try{var d=JSON.stringify(t.extra);h.ea=d.substr(0,300)}catch(t){}return{durl:t.route.url,ei:t.type,en:"per"===t.type?"性能数据":"错误数据",et:"custom",params:h,ts:(new Date).getTime(),st:t.captureTime,si:t.biz.kdtId,rurl:null!==(f=t.rurl)&&void 0!==f?f:""}},t}();function tt(t,e){return new Promise((function(r){return setTimeout((function(){r(t)}),e.options.debounce+100)}))}function et(t,e){return e.adapter.createUid().then((function(e){return t.user&&(t.user.uuid=e),t}))}var rt=function(){function t(t,e){this.running=!1,this.ignore=!1,this.options=t,this.adapter=e,this.processorManager=new F("Processor"),this.filterManager=new F("Filter"),this.store=new D,this.app=new $(this),this.queue=new B({maxExecuteNumber:t.maxExecuteNumber,retry:t.retry},e),this.captorManager=new Z(this),t.debug&&(P.setEnable(),P.info("sdk: init succeed, with options:",this.options)),this.install()}return t.prototype.getOptions=function(){return this.options},t.prototype.setOptions=function(t){return P.info("sdk: set options",t),this.options=N(this.options,t),t.enable?this.ready():0===t.enable&&this.running?this.uninstall():void 0},t.prototype.captureException=function(t,e){var r=this;this.adapter.exceptionEvent(t).then((function(t){return e&&(t.exception=N(t.exception,e)),r.disposeEvent(t)}))},t.prototype.captureMessage=function(t,e){var r=this;this.adapter.exceptionMessage(t,e).then((function(t){return r.disposeEvent(t)}))},t.prototype.captureEvent=function(t){return P.info("Event: captureEvent",t),this.disposeEvent(t)},t.prototype.ignoreNextEvent=function(){this.ignore=!0},t.prototype.ready=function(){this.running||0===this.options.enable||(this.running=!0,this.captorManager.run(),this.queue.run(),P.info("sdk: is onLoaded ready to work"))},t.prototype.update=function(){this.captorManager.update()},t.prototype.install=function(){var t=this;this.processorManager.add(Q),this.processorManager.add(tt),this.processorManager.add(z),this.processorManager.add(V),this.processorManager.add(et),this.filterManager.add(G),this.filterManager.add(Y),this.filterManager.add(J),this.adapter.onLoad((function(){t.ready()}))},t.prototype.uninstall=function(){P.info("sdk: begin uninstall..."),this.captorManager.clear(),this.queue.clear(),this.processorManager.clear(),this.filterManager.clear(),this.store.clear(),this.running=!1},t.prototype.disposeEvent=function(t){var e=this;return this.ignore&&"error"===t.type?(P.warn("ignore Event, Event is ",t),void(this.ignore=!1)):this.processorManager.use(t,this).then((function(t){return e.filterManager.use(t,e)})).then((function(t){return e.createRequest(t),!0})).catch((function(t){P.error(t)}))},t.prototype.createRequest=function(t){var e=n({id:t.id,url:this.app.skynetURL(t),method:"POST"},this.app.createRequestData(t));P.info("Event: report",t),this.queue.add(e)},t}(),nt=function(){function t(){}return t.init=function(t,e){this.control=new rt(N(j,t),e)},t.setOptions=function(t){this.control.setOptions(t)},t.createInitError=function(){return!!this.control||(P.rawError(new Error("Please call Hummer.init first")),!1)},t.setEnv=function(t){if(this.createInitError())return this.control.store.setUser(t).setBiz(t),this.instance},t.setExtra=function(t){if(this.createInitError())return this.control.store.setExtra(t),this.instance},t.capture=function(t,e){if(this.createInitError())return f(t)?this.control.captureException(t,e):this.control.captureMessage(t,(null==e?void 0:e.level)||c.ERROR)},t.captureEvent=function(t){this.createInitError()&&this.control.captureEvent(t)},t.addProcessor=function(t){return this.createInitError()?this.control.processorManager.add(t):-1},t.removeProcessor=function(t){this.control.processorManager.remove(t)},t.addFilter=function(t){return this.createInitError()?this.control.filterManager.add(t):-1},t.removeFilter=function(t){this.createInitError()&&this.control.filterManager.remove(t)},t.addCaptor=function(t){return this.createInitError()?this.control.captorManager.add(t):-1},t.removeCaptor=function(t){this.createInitError()&&this.control.captorManager.remove(t)},t}(),ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.uuid="",e}return r(e,t),e.prototype.createUid=function(){var t,e;return this.uuid||(this.uuid=(t="yz_log_uuid",((e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)")))?decodeURIComponent(e[3]):null)||k())),Promise.resolve(this.uuid)},e.prototype.getSystemInfo=function(){var t,e=a().navigator,r=e.connection,n=e.userAgent;if(r&&r.effectiveType)t=r.effectiveType;else if(/MicroMessenger/i.test(n)){var o=n.match(/NetType\/([\w.]+)/i);t=o?o[1]:""}var i={net:t||"unknown",platform:p.WEB,app:"web"};return Promise.resolve(i)},e.prototype.getRoute=function(){var t=a().location,e=t.pathname,r=t.href,n=e.split("/"),o=n.pop()||"";return o.search(/[0-9]/)>-1?n.push(":alias"):n.push(o),{url:r,path:n.join("/")}},e.prototype.request=function(t){return new Promise((function(e,r){var n=t.method,o=t.url,i=t.data,a=void 0===i?null:i,s=t.timeout,u=t.header,c=new XMLHttpRequest;c.open(n,o,!0),s&&(c.timeout=s),c.onreadystatechange=function(){4===c.readyState&&0!==c.status&&(200!==c.status?r(H("Request Error")):e({status:c.status}))},c.onerror=function(){r(H("Network Error"))},c.ontimeout=function(){r(H("Timeout of "+s+" ms exceeded"))},u&&Object.keys(u).forEach((function(t){c.setRequestHeader(t,u[t])})),c.send(JSON.stringify(a))}))},e.prototype.onLoad=function(t){a().addEventListener("load",(function(){t()}),!1)},e.prototype.onLoaded=function(){},e}(q),it=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.uninstall=function(){},e.prototype.install=function(){var t=this.control.options,e=t.error;t.enableError&&(e.onError&&this.installOnError(),e.onReject&&this.installOnPromiseReject(),e.requestAnimationFrame&&this.installRequestAnimationFrameError(),e.eventTarget&&it.forEach(this.wrapEventTarget.bind(this)))},e.prototype.installOnError=function(){var t=this.control,e=window.onerror;window.onerror=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=r[1],a=r[2],s=r[3],p=r[4];if(!p||!K(p)){var l=R(o,i,a,s,p);b(l,u.ON_ERROR,c.ERROR),t.captureEvent(l),e&&e.apply(window,r)}}},e.prototype.installOnPromiseReject=function(){var t=this.control,e=window.onunhandledrejection;window.onunhandledrejection=function(r){var n,o=null;try{"reason"in r&&(o=r.reason)}catch(o){P.error("window.onunhandledrejection unknown error")}if(!o||!K(o)){var i=function(t){return t?v(t)?w(s.PROMISE_ERROR,t):t.code?w(s.PROMISE_ERROR,"code: "+t.code+", msg: "+t.msg):O(t,!0):x(!0)}(o);b(i,u.ON_PROMISE,(null===(n=i.exception)||void 0===n?void 0:n.stack)?c.ERROR:c.WARN),t.captureEvent(i),e&&e.call(this,r)}}},e.prototype.installRequestAnimationFrameError=function(){var t=this.control;M(window,"requestAnimationFrame",(function(e){return function(r){return e.call(this,T(r,(function(e){var r=_(e);b(r,u.ON_A_FRAME,c.ERROR),t.captureEvent(r)})))}}))},e.prototype.wrapEventTarget=function(t){var e=this.control,r=window[t]&&window[t].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(M(r,"addEventListener",(function(t){return function(r,n,o){try{"function"==typeof n.handleEvent&&(n.handleEvent=T(n.handleEvent.bind(n),(function(t){var r=_(t);b(r,u.ON_EVENT,c.ERROR),e.captureEvent(r)})))}catch(t){}return t.call(this,r,T(n,(function(t){var r=_(t);b(r,u.ON_EVENT,c.ERROR),e.captureEvent(r)})),o)}})),M(r,"removeEventListener",(function(t){return function(e,r,n){try{var o=r,i=null==o?void 0:o.__hummer_wrapped__;i&&t.call(this,e,i,n)}catch(t){}return t.call(this,e,r,n)}})))},e}(C);function st(t){return t.sdk={name:"hummer-browser",version:"3.0.30"},t}var ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.install=function(){var t=this.control.options.error;t.setTimeout&&this.installTimer("setTimeout"),t.setInterval&&this.installTimer("setInterval")},e.prototype.uninstall=function(){},e.prototype.installTimer=function(t){var e=this.control;M(window,t,(function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0];return r[0]=T(o,(function(t){var r=_(t);b(r,u.ON_TIMER,c.ERROR),e.captureEvent(r),e.ignoreNextEvent()})),t.apply(this,r)}}))},e}(C),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.init=function(r){return this.instance||(t.init.call(this,r,new ot),this.instance=new e,this.addProcessor(st),this.addCaptor(new at),this.addCaptor(new ut)),this.instance},e}(nt);var pt="mark-map";function lt(t){document.cookie="mark-map="+JSON.stringify(t)+";domain=.youzan.com;path=/"}function ft(t){var e=function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null}(pt)||"{}",r=JSON.parse(e);return t?r[t]:r}function ht(t){try{var e=ft();return t?delete e[t]:Object.keys(e).forEach((function(t){return delete e[t]})),lt(e),!0}catch(t){return!1}}var dt="p_i",vt=function(t,e,r){var n,o=r.baseTime,i=r.options,a=void 0===i?{evt:{}}:i,s={df:e,pn:t};if(r.reportNavigation){var u=window.performance.getEntriesByType("navigation");s.navigation=u}return{baseTime:o||Date.now(),per:s,level:"info",type:"per",rurl:null===(n=null==a?void 0:a.evt)||void 0===n?void 0:n.rurl,env:a.env,extra:(null==a?void 0:a.extra)||{}}};var mt={start:function(t,e,r){var o,i,a,s="number"==typeof e&&e||Date.now(),u=n(n({},r),{st:s});i=u,a={},(o=t)&&i&&((a=ft())[o]=i),lt(a),ft()},end:function(t,e){if(e!==dt){var r=Date.now();try{!function(t,e,r){var n=ft(r||t)||{},o=n.st,i=n.evt,a=void 0===i?{}:i,s=n.env;if(o){var u=Math.ceil(e-o);if(u<=0)return ht(t);var c=vt(t,u,{baseTime:o,options:{evt:a,env:s}});ht(t),ct.captureEvent(c)}}(t,r,e)}catch(t){console.error(t)}}else this.log(t)},log:function(t,e){var r=Date.now();setTimeout((function(){var n,o,i=(null===(o=null===(n=window.performance)||void 0===n?void 0:n.timing)||void 0===o?void 0:o.navigationStart)||r,a=Math.ceil(r-i);try{!function(t,e){var r=e.df,n=e.baseTime,o=e.options;if(!(r<=0)){var i=vt(t,r,{baseTime:n,reportNavigation:!0,options:void 0===o?{evt:{}}:o});ct.captureEvent(i)}}(t,{df:a,baseTime:i,options:e})}catch(t){console.error(t)}}),2500)},delete:function(t){ft(t)&&ht(t)}};window.performance.getEntries().map((function(t){var e=JSON.parse(JSON.stringify(t)),r=e.entryType,n=e.name;return"navigation"===r&&Object.assign(e,{path:n,name:"appLaunch"}),e})).forEach((function(t){return e=t.name,o=(null===(n=null===(r=window.performance)||void 0===r?void 0:r.timing)||void 0===n?void 0:n.navigationStart)||Date.now(),void("appLaunch"===e&&mt.start(dt,o));var e,r,n,o}));var yt=function(t){function e(e){var r=t.call(this)||this;return r.vue=null,r.log=!1,r.vue=e.vue,r.log=e.log,r}return r(e,t),e.prototype.install=function(){this.installErrorHandler()},e.prototype.uninstall=function(){},e.prototype.installErrorHandler=function(){var t=this,e=t.control,r=t.vue,n=t.log;if(r){var o=r.config.errorHandler;r.config.errorHandler=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var a=t[0];e.captureException(a,{source:"onVue"}),o&&o.apply(r,t),n&&console.error(a)}}},e}(C);return t.BaseCaptor=C,t.Hummer=ct,t.VueCaptor=yt,t.mark=mt,Object.defineProperty(t,"__esModule",{value:!0}),t}({});