zg-sdk-wechart 2.0.19 → 2.0.20-encrypt.1
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/zhuge.es.min.js +1 -16
- package/dist/zhuge.min.js +1 -16
- package/package.json +1 -1
package/dist/zhuge.es.min.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
var t=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},i=u.iterator||"@@iterator",o=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var u=e&&e.prototype instanceof v?e:v,i=Object.create(u.prototype),o=new E(n||[]);return i._invoke=function(t,e,r){var n=l;return function(u,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===u)throw i;return $()}for(r.method=u,r.arg=i;;){var o=r.delegate;if(o){var s=O(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var a=m(t,e,r);if("normal"===a.type){if(n=r.done?p:d,a.arg===f)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n=p,r.method="throw",r.arg=a.arg)}}}(t,r,o),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",d="suspendedYield",h="executing",p="completed",f={};function v(){}function _(){}function g(){}var y={};y[i]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w(C([])));k&&k!==r&&n.call(k,i)&&(y=k);var b=g.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(u,i,o,s){var a=m(t[u],t,i);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(a.arg)}var u;this._invoke=function(t,n){function i(){return new e((function(e,u){r(t,n,e,u)}))}return u=u?u.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var u=m(n,t.iterator,r.arg);if("throw"===u.type)return r.method="throw",r.arg=u.arg,r.delegate=null,f;var i=u.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,f):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function C(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var u=-1,o=function r(){for(;++u<t.length;)if(n.call(t,u))return r.value=t[u],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}return{next:$}}function $(){return{value:e,done:!0}}return _.prototype=b.constructor=g,g.constructor=_,_.displayName=a(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,a(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,r,n,u,i){void 0===i&&(i=Promise);var o=new S(c(e,r,n,u),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(b),a(b,s,"Generator"),b[i]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function u(n,u){return s.type="throw",s.arg=t,r.next=n,u&&(r.method="next",r.arg=e),!!u}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return u("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return u(o.catchLoc,!0);if(this.prev<o.finallyLoc)return u(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return u(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return u(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var u=this.tryEntries[r];if(u.tryLoc<=this.prev&&n.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var i=u;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var u=n.arg;P(r)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),f}},t}({});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var u=s(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return c(this,r)}}function l(t,e,r){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(n){var u=Object.getOwnPropertyDescriptor(n,e);return u.get?u.get.call(r):u.value}})(t,e,r||t)}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,u=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){u=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(u)throw i}}return r}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
function v(t,e,r,n){var u,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(u=t[s])&&(o=(i<3?u(o):i>3?u(e,r,o):u(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function _(t,e,r,n){return new(r||(r=Promise))((function(u,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?u(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,s)}a((n=n.apply(t,e||[])).next())}))}var g,y={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},jsJSON:function(t){try{return JSON.parse(t),!0}catch(t){return!1}},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=Array.from(new Set(e[n].concat(r[n]))):t.isObject(e[n])&&t.isObject(r[n])?e[n]=t.merge(e[n],r[n]):e[n]=r[n]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(t){var r=function(t){var e=t.constructor;switch(n(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return i(t);case"Symbol":return u(t);case"Function":return t;default:return null}},n=function(t){return Object.prototype.toString.call(t).slice(8,-1)},u=function(t){return Object(Symbol.prototype.valueOf.call(t))},i=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},o=function(t,e){for(var r=-1,n=t.length;++r<n;)e(t[r],r);return t},s=function t(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(u)||null===u)return u;var s=n(u),a=null;return i.get(u)?i.get(u):(i.set(u,a),"Set"!==s&&"Map"!==s&&"Array"!==s&&"Object"!==s?r(u):"Set"===s?(a=new Set,u.forEach((function(e){a.add(t(e,i))})),a):"Map"===s?(a=new Map,u.forEach((function(e,r){a.set(r,t(e,i))})),a):("Array"===s&&(a=new Array,o(u,(function(e,r){a[r]=t(e,i)}))),"Object"===s&&(a=new Object,o(Object.keys(u),(function(e){a[e]=t(u[e],i)}))),a))};return s(t)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var r in t)e.push("".concat(r,"=").concat(decodeURIComponent(t[r])));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var r in t)e["_"+r]=t[r];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var r=!0;for(var n in t)t[n]!==e[n]&&(r=!1);return r},getUtmByQuery:function(t){var e={};for(var r in t)this.utmKeys.includes(r)&&(e[r]=t[r]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var u in t)e.indexOf(u)>-1&&(r=!0,n[u]=t[u]);return r?n:null},deleteQueryParams:function(t,e){var r=t.split("&"),n=[];return r.forEach((function(t){var r=new RegExp(e+"=.*"),u="";r.test(t)?(u=t.replace(r,""))&&n.push(u):n.push(t)})),n.join("&")},addUrlParam:function(t,e){var r=t,n="";for(var u in e)n&&(n+="&"),r=this.deleteQueryParams(r,u),n+=u+"="+e[u];var i=r.split("?");return i.length>1?i[1]?i[1]=n+"&"+i[1]:i[1]=n:1===i.length&&i.push(n),i.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,r,n,u="";t.data&&t.data.title&&t.data.title.length>0&&(u=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!u.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(u=e.text)})),!u.length)){var i=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];u=i?null===(e=i.window)||void 0===e?void 0:e.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(t){}return u||t.route}},w=function(){function t(e,n){r(this,t),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=n,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=e}return u(t,[{key:"generateRequestData",value:function(){var t=new Date,e={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()," ").concat(t.getHours(),":").concat(t.getMinutes(),":").concat(t.getSeconds()),tz:y.getTimezone(t),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:h(this.catch)}),_:t.getTime()+""};return this.catch=[],e}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(t,n){var u,i=!1;u=setTimeout((function(){i=!0,t(null)}),e.timeout),e.requestFunction(e.url,r,{timeout:e.requestTimeout}).then((function(e){i||(clearTimeout(u),t(e))})).catch((function(t){n(t)}))}))}}}]),t}(),k=function(){function e(t,n,u){r(this,e),this.storageFunction=t,this.allData=u||{},this.allData.did||this.set("did",n.config.did||y.UUID()),this.allData.cuid||this.set("cuid",void 0),y.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return u(e,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(e,r){return _(this,void 0,void 0,t.mark((function n(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.allData[e]=r,t.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return t.stop()}}),n,this)})))}}]),e}();!function(t){var e,r,n,u,i,o;(e=t.EventType||(t.EventType={})).connected="connected",e.disconnected="disconnected",e.error="error",e.offline="offline",e.exist="exist",e.online="online",(r=t.RequestType||(t.RequestType={}))[r.common=0]="common",r[r.ping=1]="ping",r[r.pong=2]="pong",r[r.normal=5]="normal",r[r.img=6]="img",(n=t.ResponseCode||(t.ResponseCode={}))[n.offline=109001]="offline",n[n.exist=109002]="exist",n[n.paramError=109005]="paramError",n[n.online=109006]="online",(u=t.SocketMsgOrigin||(t.SocketMsgOrigin={}))[u.xcx=1]="xcx",u[u.app=2]="app",u[u.web=3]="web",(i=t.VisualEndpointType||(t.VisualEndpointType={}))[i.xcx=1]="xcx",(o=t.SocketMessageType||(t.SocketMessageType={})).update="update",o.xcxLogin="xcxLogin",o.eventInfo="eventInfo"}(g||(g={}));var b,x,S,O=g,T=function(){function t(e,n){r(this,t),this.listeners={},this.catch=[],this.showLog=!1,this.url=e,this.params=n,this.open()}return u(t,[{key:"emit",value:function(t,e){var r;if(this.log("info","emit message",[t,e]),!this.client)return this.log("info","缓存消息",[t,e]),void this.catch.push([t,e]);switch(null===(r=this.client)||void 0===r?void 0:r.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[t,e]),this.catch.push([t,e])}}},{key:"on",value:function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"onConnected",value:function(t){this.on(O.EventType.connected,t)}},{key:"onDisconnected",value:function(t){this.on(O.EventType.disconnected,t)}},{key:"onError",value:function(t){this.on(O.EventType.error,t)}},{key:"send",value:function(t){var e;null===(e=this.client)||void 0===e||e.send({data:JSON.stringify(t)})}},{key:"_onError",value:function(t){var e;this.log("error","socket连接异常",t),null===(e=this.listeners.error)||void 0===e||e.forEach((function(e){e.call(void 0,t)}))}},{key:"_onClose",value:function(t){var e;this.log("error","socket连接已关闭"),null===(e=this.listeners.disconnected)||void 0===e||e.forEach((function(t){t.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(t){var e,r=this;this.log("info","socket连接成功",t),null===(e=this.listeners.connected)||void 0===e||e.forEach((function(t){t.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(t){var e=d(t,2),n=e[0],u=e[1];r.emit(n,u)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(t){var e,r,n;if(""!==t.data){var u=JSON.parse(t.data);if(u.code)switch(Number(u.code)){case O.ResponseCode.offline:null===(e=this.listeners[O.EventType.offline])||void 0===e||e.forEach((function(t){t.call(void 0,u)}));break;case O.ResponseCode.online:null===(r=this.listeners[O.EventType.online])||void 0===r||r.forEach((function(t){t.call(void 0,u)}));break;case O.ResponseCode.exist:null===(n=this.listeners[O.EventType.exist])||void 0===n||n.forEach((function(t){t.call(void 0,u)}));break;case O.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(u.type===O.RequestType.pong)return;var i=u.data;this.listeners[i.event]&&this.listeners[i.event].forEach((function(t){t.call(void 0,i.payload)}))}}}},{key:"ping",value:function(){var t=this;this.pingTimer=setInterval((function(){t.send({type:O.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(t,e){var r=this;e?this.listeners[t].forEach((function(n,u){n===e&&r.listeners[t].splice(u,1)})):this.listeners[t]=[]}},{key:"open",value:function(){var t,e,r=this;this.client&&this.close();var n=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(t=this.params)||void 0===t?void 0:t.socketToken,"&appId=").concat(null===(e=this.params)||void 0===e?void 0:e.appId,"&origin=").concat(O.SocketMsgOrigin.xcx)});n.onMessage((function(t){r.onMessage(t)})),n.onError((function(t){r._onError(t)})),n.onClose((function(t){r._onClose(t)})),n.onOpen((function(t){r._onOpen(t)})),this.client=n}},{key:"close",value:function(){var t;null===(t=this.client)||void 0===t||t.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];this.showLog&&(e=console).log.apply(e,["%c【socketClient】:".concat(t),"color: ".concat("error"===t?"red":"#1890ff")].concat(n))}},{key:"openLog",value:function(t){this.showLog=t}}]),t}(),P=function(t,e,r){return new Promise((function(n,u){var o;wx.request((i(o={url:t,data:e,method:(null==r?void 0:r.method)||"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":(null==r?void 0:r.contentType)||"application/x-www-form-urlencoded"}),i(o,"dataType","json"),i(o,"responseType",null!=(null==r?void 0:r.responseType)?null==r?void 0:r.responseType:"arraybuffer"),i(o,"success",(function(t){n(t)})),i(o,"fail",(function(t){u(t)})),o))}))},E=function(){function e(t){r(this,e),this.pagePathJudge=function(t,e){return-1!==e.pagePath.indexOf("*")?-1!==t.pr.$page_url.indexOf(e.pagePath.split("*")[0]):e.pagePath===t.pr.$page_url.split("?")[0]},this.tracker=t,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return u(e,[{key:"init",value:function(){var t=this;this.socket&&this.socket.destroy(),this.socket=new T(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){t.getVisualData()})),this.socket.on("connected",(function(){null===t.socketUserInfo?wx.getSystemInfo({success:function(e){var r=e.model,n=e.system,u=e.version;wx.getUserInfo({success:function(e){var i=e.userInfo.nickName,o=e.userInfo.avatarUrl,s={model:r,system:n,version:u,nickName:i,avatarUrl:o,programId:t.tracker.config.appId};t.socketUserInfo=s,t.sendUserInfo(s)}})}}):t.sendUserInfo(t.socketUserInfo)}))}},{key:"getVisualData",value:function(){var t=this;P("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:O.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(e){e.data&&e.data.data&&(t.visualData=e.data.data)}))}},{key:"sendUserInfo",value:function(t){var e;this.socketState=!0,null===(e=this.socket)||void 0===e||e.send({type:O.RequestType.normal,data:{event:O.SocketMessageType.xcxLogin,payload:{userInfo:t}}})}},{key:"send",value:function(t){var e;this.socketState&&(null===(e=this.socket)||void 0===e||e.send({type:O.RequestType.normal,data:{event:O.SocketMessageType.eventInfo,payload:t}}))}},{key:"event",value:function(e){var r;return _(this,void 0,void 0,t.mark((function n(){var u,i,o,s=this;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(r=this.tracker)||void 0===r?void 0:r.config.visual){t.next=2;break}return t.abrupt("return");case 2:"abp"!==e.dt||"pv"!==e.pr.$eid&&"click"!==e.pr.$eid?"evt"===e.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},e),{eventType:"evt"})):(u=y.clone(e),i=!1,this.visualData.map((function(t){var r,n;if("click"===e.pr.$eid){var o=[],a=y.jsJSON(t.elementConditions)?JSON.parse(t.elementConditions):{};for(var c in a)o.push(a[c]===e.pr[c]);o.push(s.pagePathJudge(e,t)),-1===o.indexOf(!1)&&"click"===t.eventType&&(u.dt="evt",u.pr.$eid=t.eventName,i=!0,s.vRQC?s.send(Object.assign(Object.assign({},u),{visual:t})):null===(r=s.tracker)||void 0===r||r.send(u))}else"pv"===t.eventType&&s.pagePathJudge(e,t)&&(u.dt="evt",u.pr.$eid=t.eventName,i=!0,s.vRQC?s.send(Object.assign(Object.assign({},u),{visual:t})):null===(n=s.tracker)||void 0===n||n.send(u))})),this.vRQC&&!i&&(o="click"===e.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},e),{eventType:o}))));case 3:case"end":return t.stop()}}),n,this)})))}}]),e}();function C(t,e,r){var n=r.value;return r.value=function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:e,args:r})},r}var $=function(){function e(t,n,u){r(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,x=t,b=n,S=u,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new E(this)}return u(e,[{key:"load",value:function(e,r){return _(this,void 0,void 0,t.mark((function n(){var u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.appKey=e,this.config=y.merge(this.config,r||{}),t.prev=2,t.next=5,b.get();case 5:if((u=t.sent)&&u.did){t.next=10;break}return t.next=9,b.getDid();case 9:u.did=t.sent;case 10:this.storage=new k(b,this,u),this.request=new w(x,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2),console.error("sdk初始化失败,缓存读取失败",t.t0);case 20:case"end":return t.stop()}}),n,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var r in e)e[r]&&(t.pr["$".concat(r)]=e[r]);return this.request.send(t)}},{key:"trackBaseData",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Date,t.t0=e,t.t1=n.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=y.getTimezone(n),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=S.os(),t.t9=S.ov(),t.t10=S.version(),t.next=14,S.mnet();case 14:return t.t11=t.sent,t.next=17,S.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15,$page_url:""},(u={dt:"evt",pr:t.t16}).pr=y.merge(u.pr,y.encode(this.config.superProperty)),t.abrupt("return",u);case 25:case"end":return t.stop()}}),r,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(S.windowWidth(),"x").concat(S.windowHeight()),$tz:y.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();e.pr.$dv=r.model,e.pr.$br=r.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,r=t.update-t.sid,n={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:y.getTimezone(e),$dru:r,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return _(this,void 0,void 0,t.mark((function e(){var r,n,u,i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,n=this.storage.allData,u=n.sid,i=n.cuid,t.t0=u,t.t1=u,t.t2=i,t.t3=this.cn,t.t4=y.getTimezone(r),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=S.os(),t.t8=S.ov(),t.t9=S.version(),t.next=14,S.mnet();case 14:return t.t10=t.sent,t.next=17,S.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},o={dt:"ss",pr:t.t15},this.config.utm&&!y.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(o),this.environmentInfo();case 26:case"end":return t.stop()}}),e,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,r=Date.now();if(e.sid&&e.update)if(r-e.update>this.config.timeout){var n=y.clone(e);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n,u,i,o,s;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:for(o in n=t.sent,u={},i=["id","content","type","style","selector","link"],e.target.dataset)-1===i.indexOf(o)&&(u["_".concat(o)]=e.target.dataset[o]);return s=e.target,n.dt="abp",n.pr=y.merge(n.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:s.dataset.id||"",$element_content:s.dataset.content||"",$element_type:s.dataset.type||"",$element_style:s.dataset.style||"",$element_selector:s.dataset.selector||"",$element_link:s.dataset.link||""},u,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=14,this.send(n);case 14:return t.next=16,this.visual.event(n);case 16:case"end":return t.stop()}}),r,this)})))}},{key:"pv",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(n=t.sent).dt="abp",n.pr=y.merge(n.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},e||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=10,this.send(n);case 10:return t.next=12,this.visual.event(n);case 12:case"end":return t.stop()}}),r,this)})))}},{key:"duration",value:function(){return _(this,void 0,void 0,t.mark((function e(){var r,n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),y.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),r=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(n=t.sent).dt="abp",n.pr=y.merge(n.pr,{$dr:r,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(n);case 12:y.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),e,this)})))}},{key:"track",value:function(e,r){return _(this,void 0,void 0,t.mark((function n(){var u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track"),t.next=3,this.trackBaseData(e);case 3:return(u=t.sent).pr=y.merge(u.pr,y.encode(r),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=7,this.send(u);case 7:return t.next=9,this.visual.event(u);case 9:case"end":return t.stop()}}),n,this)})))}},{key:"identify",value:function(e,r){return _(this,void 0,void 0,t.mark((function n(){var u,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),u=new Date,(i={dt:"usr",pr:{$ct:u.getTime(),$tz:y.getTimezone(u),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=y.merge(i.pr,y.encode(r)),t.next=7,this.trackBaseData("usr");case 7:return t.next=9,this.send(i);case 9:case"end":return t.stop()}}),n,this)})))}},{key:"setPushClient",value:function(e,r){return _(this,void 0,void 0,t.mark((function n(){var u,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=new Date,i={dt:"um",pr:{$ct:u.getTime(),$tz:y.getTimezone(u),$push_ch:r||"getui",$push_id:e}},t.next=4,this.trackBaseData("usr");case 4:return t.next=6,this.send(i);case 6:case"end":return t.stop()}}),n,this)})))}},{key:"trackCount",value:function(t,e){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=y.clone(e)),this.previousCountEvent.name===t&&y.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=y.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,r,n){return _(this,void 0,void 0,t.mark((function u(){var i,o,s,a;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track count"),i=Date.now()-this.countStartTime,n&&(i-=this.config.countDuration),o=this.count,this.count=n?0:1,t.next=7,this.trackBaseData(e);case 7:return s=t.sent,a={},y.isObject(r)&&(a=y.clone(r)),s.pr=y.merge(s.pr,y.encode(a),y.encode({count:o,countTime:i})),t.next=13,this.send(s);case 13:case"end":return t.stop()}}),u,this)})))}},{key:"trackRevenue",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n,u,i,o,s,a,c,m;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=function(t,e){var r=0;try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),r.next=4,this.trackBaseData("revenue");case 4:(n=r.sent).dt="abp",(u=y.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=i(u.price,u.productQuantity),o=["productID","revenueType"],s=["price","total","productQuantity"],a={},r.t0=t.keys(u);case 12:if((r.t1=r.t0()).done){r.next=21;break}if(c=r.t1.value,-1!==o.indexOf(c)||-1!==s.indexOf(c)){r.next=16;break}return r.abrupt("continue",12);case 16:m=u[c],s.indexOf(c)>-1&&((m=Number(m))||(m=0)),a["$"+c]=m,r.next=12;break;case 21:return n.pr=y.merge(n.pr,a),r.next=24,this.send(n);case 24:case"end":return r.stop()}}),r,this)})))}},{key:"setUtm",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(n=y.filterUtm(e))&&(this.storage.set("utm",n),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),r,this)})))}},{key:"setSuperProperty",value:function(t){y.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){y.isObject(t)&&(this.config.superProperty=y.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=p(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,u=function(){};return{s:u,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;delete this.config.superProperty[n]}}catch(t){r.e(t)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();v([C],$.prototype,"environmentInfo",null),v([C],$.prototype,"sessionEnd",null),v([C],$.prototype,"sessionStart",null),v([C],$.prototype,"updateSession",null),v([C],$.prototype,"click",null),v([C],$.prototype,"pv",null),v([C],$.prototype,"duration",null),v([C],$.prototype,"track",null),v([C],$.prototype,"identify",null),v([C],$.prototype,"setPushClient",null),v([C],$.prototype,"trackCount",null),v([C],$.prototype,"trackRevenue",null),v([C],$.prototype,"setUtm",null);var D=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],j=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],I=function(t){return y.wxGetTitle(t)},R={did:null,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(r,n){wx.setStorage({key:t,data:e,success:r,fail:n})}))}},L=!1,A=wx.getSystemInfoSync(),z=A.system.split(/\s/),N={os:z[0],ov:z[1],version:A.version,windowHeight:A.windowHeight,windowWidth:A.windowWidth,net:0,mnet:0};function U(t){var e=t.toLowerCase();"wifi"===e?(N.net=1,N.mnet=0):(N.net=0,N.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function q(t){return new Promise((function(e,r){if(L)return e(N[t]);wx.getNetworkType({success:function(r){L=!0,U(r.networkType),e(N[t])}})}))}wx.onNetworkStatusChange((function(t){U(t.networkType)}));var M,F,B={os:function(){return N.os},ov:function(){return N.ov},version:function(){return N.version},net:function(){return q("net")},mnet:function(){return q("mnet")},windowWidth:function(){return N.windowWidth},windowHeight:function(){return N.windowHeight}},Q=App,W=Page,H=Component,G=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function J(t,e,r){if(t[r]&&y.isFunction(t[r])){var n=t[r];t[r]=function(){n.apply(this,arguments),e[r].apply(this,arguments)}}else t[r]=function(){e[r].apply(this,arguments)}}function K(t,e,r){var n=t[e];t[e]=function(){var t=arguments[0];if(M===t||t&&M&&M.timeStamp===t.timeStamp)return n.apply(this,arguments);if(M=t,t){var e=t.type;"tap"===e&&r.click(t)}return n.apply(this,arguments)}}var V=function(e){o(i,$);var n=m(i);function i(t){var e;return r(this,i),(e=n.call(this,P,R,B)).openData={path:"",props:{}},e.shared=!1,e.semiAutoTrackEventCatch={},e.isShareOperation=!1,F=t,e.initLifeCycleHook(),e}return u(i,[{key:"initLifeCycleHook",value:function(){var t,e=this,r=(t=e,{App:{onLaunch:function(e){t.config.visual&&t.visual.getVisualData()},onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){(null==e?void 0:e.scene)&&-1!==decodeURIComponent(e.scene).indexOf("vRQC")&&t.config.visual&&(t.visual.vRQC=decodeURIComponent(e.scene).split("vRQC=")[1],t.visual.init()),t.currentPage.query=y.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),r=e[e.length-1];t.currentPage.route=r.__route__||r.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var n=I;if(t.currentPage.title="function"==typeof n?n(r):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(r),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=y.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=y.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=r;var n=function(t){for(var n in r.App)J(t,r.App,n);for(var u in t)!D.includes(u)&&y.isFunction(t[u])&&K(t,u,e);return Q(t)};for(var u in App)n[u]=App[u];App=n;var i=function(t){for(var n in r.Page)J(t,r.Page,n);for(var u in t)!j.includes(u)&&y.isFunction(t[u])&&"onShareAppMessage"!==u&&K(t,u,e);var i=t.onShareAppMessage;return y.isFunction(i)&&(t.onShareAppMessage=e.onShareAppMessage(i)),W(t)};for(var o in Page)i[o]=Page[o];Page=i,Component=function(t){if(void 0!==t.methods)for(var r in t.methods)K(t.methods,r,e);return H(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return l(s(i.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(e){var r=this,n=Object.create(null,{pv:{get:function(){return l(s(i.prototype),"pv",r)}}});return _(this,void 0,void 0,t.mark((function e(){var r,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},u=y.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(r.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(r.$share_level=Number(this.openOptions.query.zg_share_level)),u.data&&u.data.zg_share_data&&(r=y.merge(r,y.encode(u.data.zg_share_data)))),t.next=5,n.pv.call(this,r);case 5:case"end":return t.stop()}}),e,this)})))}},{key:"click",value:function(e){var r=this,n=Object.create(null,{click:{get:function(){return l(s(i.prototype),"click",r)}}});return _(this,void 0,void 0,t.mark((function r(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.click.call(this,e);case 2:case"end":return t.stop()}}),r,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=y.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&F){var r=t.scene;this.cn=r+"";var n=F[r],u={},i=null,o=F.isShare(r);if(o&&t.referrerInfo&&(i=t.referrerInfo.appId),n){u={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:i};var s=t.query||{};F.isCartShare(r)&&s.zg_uid&&s.zg_share_id&&(u.utm_term=s.zg_uid,u.utm_content=s.zg_share_id)}e=y.merge(u,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&y.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(e){return _(this,void 0,void 0,t.mark((function r(){var n,u,i,o,s,a,c,m,l,d,h;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(n=e.query||{},u=this.currentPage.route,!(F.isCartShare(e.scene)&&n.zg_uid&&n.zg_share_id)){t.next=24;break}for(s in i={$uid:n.zg_uid,$share_id:n.zg_share_id,$title:this.currentPage.title,$path:u,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(n.zg_share_level)},this.shareId=n.zg_share_id,this.shareLevel=Number(n.zg_share_level),o={},n)a=s.replace(/^zg_/,""),-1===G.indexOf(a)&&/^zg_/.test(s)&&(o[a]=n[s]);if(c=this.config.shareToUtm,y.isObject(c)&&!y.isEmpty(c)){for(l in m={},c)null!==o[l]&&void 0!==o[l]&&(d=c[l],m[d]=o[l]);y.isEmpty(m)||(m.utm_campaign||(m.utm_campaign="分享打开"),this.setUtm(m))}return this.openData={path:u,props:o},i=y.merge(i,y.encode(o)),t.next=19,this.trackBaseData("wxsopen");case 19:return(h=t.sent).dt="abp",h.pr=y.merge(h.pr,i),t.next=24,this.send(h);case 24:case"end":return t.stop()}}),r,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var r=t.apply(this,arguments)||{};if(!e.config.forwardShare)return r;r.path=r.path||e.currentPage.url;var n=r.title||e.currentPage.title,u=r.path.split("?")[0],i=this.data.zg_share_data,o=(new Date).getTime(),s=1;!this.data.newShare&&e.openData&&e.openData.path===u&&y.isEqual(i||{},e.openData.props)&&(o=e.shareId,s=e.shareLevel+1);var a={share_id:o,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:s},c={$share_title:n,$title:e.currentPage.title||"",$path:u},m={};for(var l in a)c["$".concat(l)]=m["zg_".concat(l)]=a[l];for(var d in i)-1===G.indexOf(d)&&(c["_".concat(d)]=m["zg_".concat(d)]=i[d]);return r.path=y.addUrlParam(r.path,m),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=y.merge(t.pr,c),e.request.send(t)})),e.shared=!0,r}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var r,n=e.getEventDataFromDataset(t.dataset);(r=l(s(i.prototype),"track",e)).call.apply(r,[e].concat(h(n)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},r="";for(var n in t){if(n.startsWith("expo"))if("expoName"===n)r=t[n];else e[n.replace(/^expo(.*)/,(function(t,e,r,n){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[n]}return[r,e]}}]),i}();v([C],V.prototype,"sceneToUtm",null),v([C],V.prototype,"trackOpenShare",null);var Y={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1103:{utm_source:"发现小程序",utm_medium:"发现栏 - 小程序 - 我的小程序"},1104:{utm_source:"任务栏",utm_medium:"任务栏 - 我的小程序"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1200:{utm_source:"打开小程序",utm_medium:"视频号广告打开小程序"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},1217:{utm_source:"打开小程序",utm_medium:"蓝牙设备后台唤醒小程序"},1218:{utm_source:"打开小程序",utm_medium:"微信键盘预览打开小程序"},1219:{utm_source:"打开小游戏",utm_medium:"视频号直播间小游戏一键上车"},1220:{utm_source:"打开小程序",utm_medium:"发现页设备卡片打开小程序"},1223:{utm_source:"打开小程序",utm_medium:"安卓桌面Widget打开小程序"},1224:{utm_source:"打开小程序",utm_medium:"小程序商家助手功能打开小程序"},1225:{utm_source:"打开小程序",utm_medium:"音视频通话打开小程序"},1226:{utm_source:"打开小程序",utm_medium:"聊天消息在设备打开后打开小程序"},1228:{utm_source:"打开小程序",utm_medium:"视频号原生广告组件打开小程序"},1230:{utm_source:"打开小程序",utm_medium:"订阅号H5广告进入小程序"},1231:{utm_source:"打开小程序",utm_medium:"动态消息提醒入口打开小程序"},1232:{utm_source:"打开小程序",utm_medium:"搜一搜竞价广告打开小程序"},1233:{utm_source:"打开小游戏",utm_medium:"小程序搜索页人气游戏模块打开小游戏"},1238:{utm_source:"打开小程序",utm_medium:"看一看信息流广告打开小程序"},1239:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间气泡浮窗打开小游戏"},1242:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块频道页进入小程序"},1243:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块商品聚合页进入小程序"},1244:{utm_source:"打开小程序",utm_medium:"#tag搜索结果页打开小程序"},1245:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送搜索结果页进入小程序"},1248:{utm_source:"打开小程序",utm_medium:"通过小程序账号迁移进入小程序"},1252:{utm_source:"打开小程序",utm_medium:"搜一搜小程序搜索页「小功能」模块进入小程序"},1254:{utm_source:"打开小程序",utm_medium:"发现页「动态」卡片 打开小程序"},1255:{utm_source:"打开小程序",utm_medium:"发现页「我的」卡片 打开小程序"},1256:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「最近使用」列表"},1257:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「我的小程序」列表"},1258:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「为电脑端优化」模块"},1259:{utm_source:"打开小游戏",utm_medium:"pc端小程序面板「小游戏专区」模块"},1260:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「推荐在电脑端使用」列表"},1261:{utm_source:"打开商品卡片",utm_medium:"公众号返佣商品卡片"},1265:{utm_source:"打开小程序",utm_medium:"小程序图片详情页打开小程序"},1266:{utm_source:"打开小程序",utm_medium:"小程序图片长按半屏入口打开小程序"},1267:{utm_source:"打开小程序",utm_medium:"小程序图片会话角标打开小程序"},1271:{utm_source:"打开小程序",utm_medium:"微信聊天主界面下拉,「我的常用小程序」栏"},1272:{utm_source:"打开小程序",utm_medium:"发现页「游戏」服务tab打开小程序"},1273:{utm_source:"打开小程序",utm_medium:"发现页「常用的小程序」列表"},1274:{utm_source:"打开小程序",utm_medium:"优量汇广告打开小程序"},1275:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片打开小程序"},1276:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片二级聚合页打开小程序"},1277:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片搜索结果页打开小程序"},1278:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」列表打开小程序"},1279:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」合集页打开小程序"},1280:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「建议使用」打开小程序"},1281:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开小程序"},1282:{utm_source:"打开小程序",utm_medium:"听一听播放器打开小程序"},1285:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」短剧合集打开小程序"},1286:{utm_source:"打开小程序",utm_medium:"明文scheme打开小程序"},1287:{utm_source:"打开小程序",utm_medium:"公众号短剧贴片打开小程序"},1292:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」poi 详情页打开小程序"},1293:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片追剧页打开小程序"},1295:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」广告打开小程序"},1296:{utm_source:"打开小程序",utm_medium:"视频号付费短剧气泡打开小程序"},1297:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开小程序"},1298:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开的合集访问小程序"},1299:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」poi 详情页打开小程序"},1300:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开的合集访问小程序"},1301:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」poi 详情页打开小程序"},1302:{utm_source:"打开小程序",utm_medium:"PC端面板「发现小程序」"},1303:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片视频流打开小程序"},1304:{utm_source:"打开小程序",utm_medium:"手机负一屏打开小程序(比如oppo手机)"},1305:{utm_source:"打开小程序",utm_medium:"公众号播放结束页打开小程序"},1306:{utm_source:"打开小程序",utm_medium:"公众号短剧固定选集入口打开小程序"},1307:{utm_source:"打开小程序",utm_medium:"发现页附近服务境外专区打开小程序"},1308:{utm_source:"打开小游戏",utm_medium:"PC端面板小游戏专区页面"},1311:{utm_source:"打开小游戏",utm_medium:"公众号文章打开小游戏CPS卡片"},1313:{utm_source:"打开小程序",utm_medium:"PC OpenSDK打开小程序"},1325:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的表情包消息角标打开小程序"},1326:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的角标打开小程序"},1327:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息角标打开小程序"},1328:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息超链接打开小程序"},1336:{utm_source:"打开小程序",utm_medium:"小店打开小程序关联会员身份"},1337:{utm_source:"打开小程序",utm_medium:"小店确认订单页跳小程序使用会员权益"},1340:{utm_source:"打开小程序",utm_medium:"小程序profile-热门商品入口打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},X=new(function(t){o(n,V);var e=m(n);function n(){return r(this,n),e.call(this,Y)}return u(n,[{key:"load",value:function(t,e){var r=e||{};if(wx.getAccountInfoSync){var u=wx.getAccountInfoSync();u&&u.miniProgram&&u.miniProgram.appId&&(r.appId=u.miniProgram.appId)}return l(s(n.prototype),"load",this).call(this,t,r)}}]),n}());App.zhuge=X;export default X;
|
|
1
|
+
var t=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),u=new D(n||[]);return o._invoke=function(t,e,r){var n=m;return function(i,o){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var s=S(u,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===m)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var a=h(t,e,r);if("normal"===a.type){if(n=r.done?p:f,a.arg===d)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n=p,r.method="throw",r.arg=a.arg)}}}(t,r,u),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var m="suspendedStart",f="suspendedYield",l="executing",p="completed",d={};function v(){}function g(){}function y(){}var _={};_[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(P([])));b&&b!==r&&n.call(b,o)&&(_=b);var T=y.prototype=v.prototype=Object.create(_);function x(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(i,o,u,s){var a=h(t[i],t,o);if("throw"!==a.type){var c=a.arg,m=c.value;return m&&"object"==typeof m&&n.call(m,"__await")?e.resolve(m.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(m).then((function(t){c.value=t,u(c)}),(function(t){return r("throw",t,u,s)}))}s(a.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function S(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=h(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function P(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return u.next=u}}return{next:O}}function O(){return{value:e,done:!0}}return g.prototype=T.constructor=y,y.constructor=g,g.displayName=a(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,a(t,s,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},x(k.prototype),k.prototype[u]=function(){return this},t.AsyncIterator=k,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new k(c(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},x(T),a(T,s,"Generator"),T[o]=function(){return this},T.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}({});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function m(t,e,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(n=(u=s.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t,r,n,i){var o,u=arguments.length,s=u<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,n):i;if("object"===("undefined"==typeof Reflect?"undefined":e(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,r,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(u<3?o(s):u>3?o(r,n,s):o(r,n))||s);return u>3&&s&&Object.defineProperty(r,n,s),s}function g(t,e,r,n){return new(r||(r=Promise))((function(i,o){function u(t){try{a(n.next(t))}catch(t){o(t)}}function s(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((n=n.apply(t,e||[])).next())}))}var y,_={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},jsJSON:function(t){try{return JSON.parse(t),!0}catch(t){return!1}},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=Array.from(new Set(e[n].concat(r[n]))):t.isObject(e[n])&&t.isObject(r[n])?e[n]=t.merge(e[n],r[n]):e[n]=r[n]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(t){var r=function(t){var e=t.constructor;switch(n(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return o(t);case"Symbol":return i(t);case"Function":return t;default:return null}},n=function(t){return Object.prototype.toString.call(t).slice(8,-1)},i=function(t){return Object(Symbol.prototype.valueOf.call(t))},o=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},u=function(t,e){for(var r=-1,n=t.length;++r<n;)e(t[r],r);return t},s=function t(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(i)||null===i)return i;var s=n(i),a=null;return o.get(i)?o.get(i):(o.set(i,a),"Set"!==s&&"Map"!==s&&"Array"!==s&&"Object"!==s?r(i):"Set"===s?(a=new Set,i.forEach((function(e){a.add(t(e,o))})),a):"Map"===s?(a=new Map,i.forEach((function(e,r){a.set(r,t(e,o))})),a):("Array"===s&&(a=new Array,u(i,(function(e,r){a[r]=t(e,o)}))),"Object"===s&&(a=new Object,u(Object.keys(i),(function(e){a[e]=t(i[e],o)}))),a))};return s(t)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var r in t)e.push("".concat(r,"=").concat(decodeURIComponent(t[r])));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var r in t)e["_"+r]=t[r];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var r=!0;for(var n in t)t[n]!==e[n]&&(r=!1);return r},getUtmByQuery:function(t){var e={};for(var r in t)this.utmKeys.includes(r)&&(e[r]=t[r]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var i in t)e.indexOf(i)>-1&&(r=!0,n[i]=t[i]);return r?n:null},deleteQueryParams:function(t,e){var r=t.split("&"),n=[];return r.forEach((function(t){var r=new RegExp(e+"=.*"),i="";r.test(t)?(i=t.replace(r,""))&&n.push(i):n.push(t)})),n.join("&")},addUrlParam:function(t,e){var r=t,n="";for(var i in e)n&&(n+="&"),r=this.deleteQueryParams(r,i),n+=i+"="+e[i];var o=r.split("?");return o.length>1?o[1]?o[1]=n+"&"+o[1]:o[1]=n:1===o.length&&o.push(n),o.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,r,n,i="";t.data&&t.data.title&&t.data.title.length>0&&(i=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!i.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(i=e.text)})),!i.length)){var o=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];i=o?null===(e=o.window)||void 0===e?void 0:e.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(t){}return i||t.route},randomAesKey:function(){for(var t="",e=0;e<32;e++){var r=Math.floor(16*Math.random());t+="0123456789abcdef".substring(r,r+1)}return t}},w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b={exports:{}};y=b,function(){var t;function e(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function r(){return new e(null)}var n="undefined"!=typeof navigator;n&&"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=function(t,e,r,n,i,o){for(var u=32767&e,s=e>>15;--o>=0;){var a=32767&this[t],c=this[t++]>>15,h=s*a+c*u;i=((a=u*a+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+s*c+(i>>>30),r[n++]=1073741823&a}return i},t=30):n&&"Netscape"!=navigator.appName?(e.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var u=e*this[t++]+r[n]+i;i=Math.floor(u/67108864),r[n++]=67108863&u}return i},t=26):(e.prototype.am=function(t,e,r,n,i,o){for(var u=16383&e,s=e>>14;--o>=0;){var a=16383&this[t],c=this[t++]>>14,h=s*a+c*u;i=((a=u*a+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+s*c,r[n++]=268435455&a}return i},t=28),e.prototype.DB=t,e.prototype.DM=(1<<t)-1,e.prototype.DV=1<<t,e.prototype.FV=Math.pow(2,52),e.prototype.F1=52-t,e.prototype.F2=2*t-52;var i,o,u=new Array;for(i="0".charCodeAt(0),o=0;o<=9;++o)u[i++]=o;for(i="a".charCodeAt(0),o=10;o<36;++o)u[i++]=o;for(i="A".charCodeAt(0),o=10;o<36;++o)u[i++]=o;function s(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function a(t,e){var r=u[t.charCodeAt(e)];return null==r?-1:r}function c(t){var e=r();return e.fromInt(t),e}function h(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function m(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function l(t,e){return t&e}function p(t,e){return t|e}function d(t,e){return t^e}function v(t,e){return t&~e}function g(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function b(t){return t}function T(t){this.r2=r(),this.q3=r(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}m.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},m.prototype.revert=function(t){return t},m.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},m.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},m.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var n=r();return t.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),t.s<0&&n.compareTo(e.ZERO)>0&&this.m.subTo(n,n),n},f.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},e.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,u=0;--i>=0;){var s=8==n?255&t[i]:a(t,i);s<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==u?this[this.t++]=s:u+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-u)-1)<<u,this[this.t++]=s>>this.DB-u):this[this.t-1]|=s<<u,(u+=n)>=this.DB&&(u-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,u>0&&(this[this.t-1]|=(1<<this.DB-u)-1<<u)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},e.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},e.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,u=Math.floor(t/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+u+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=u-1;r>=0;--r)e[r]=0;e[u]=s,e.t=this.t+u+1,e.s=this.s,e.clamp()},e.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var u=r+1;u<this.t;++u)e[u-r-1]|=(this[u]&o)<<i,e[u-r]=this[u]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},e.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),o=n.t;for(r.t=o+i.t;--o>=0;)r[o]=0;for(o=0;o<i.t;++o)r[o+n.t]=n.am(0,i[o],r,o,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,n,i){var o=t.abs();if(!(o.t<=0)){var u=this.abs();if(u.t<o.t)return null!=n&&n.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=r());var s=r(),a=this.s,c=t.s,m=this.DB-h(o[o.t-1]);m>0?(o.lShiftTo(m,s),u.lShiftTo(m,i)):(o.copyTo(s),u.copyTo(i));var f=s.t,l=s[f-1];if(0!=l){var p=l*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0),d=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,y=i.t,_=y-f,w=null==n?r():n;for(s.dlShiftTo(_,w),i.compareTo(w)>=0&&(i[i.t++]=1,i.subTo(w,i)),e.ONE.dlShiftTo(f,w),w.subTo(s,s);s.t<f;)s[s.t++]=0;for(;--_>=0;){var b=i[--y]==l?this.DM:Math.floor(i[y]*d+(i[y-1]+g)*v);if((i[y]+=s.am(0,b,i,_,0,f))<b)for(s.dlShiftTo(_,w),i.subTo(w,i);i[y]<--b;)i.subTo(w,i)}null!=n&&(i.drShiftTo(f,n),a!=c&&e.ZERO.subTo(n,n)),i.t=f,i.clamp(),m>0&&i.rShiftTo(m,i),a<0&&e.ZERO.subTo(i,i)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var i=r(),o=r(),u=n.convert(this),s=h(t)-1;for(u.copyTo(i);--s>=0;)if(n.sqrTo(i,o),(t&1<<s)>0)n.mulTo(o,u,i);else{var a=i;i=o,o=a}return n.revert(i)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",u=this.t,a=this.DB-u*this.DB%e;if(u-- >0)for(a<this.DB&&(r=this[u]>>a)>0&&(i=!0,o=s(r));u>=0;)a<e?(r=(this[u]&(1<<a)-1)<<e-a,r|=this[--u]>>(a+=this.DB-e)):(r=this[u]>>(a-=e)&n,a<=0&&(a+=this.DB,--u)),r>0&&(i=!0),i&&(o+=s(r));return i?o:"0"},e.prototype.negate=function(){var t=r();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=r();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new m(e):new f(e),this.exp(t,r)},e.ZERO=c(0),e.ONE=c(1),w.prototype.convert=b,w.prototype.revert=b,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x,k,S,F=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],E=(1<<26)/F[F.length-1];function D(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=q&&(S-=q)}if(e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=c(n),o=r(),u=r(),s="";for(this.divRemTo(i,o,u);o.signum()>0;)s=(n+u.intValue()).toString(t).substr(1)+s,o.divRemTo(i,o,u);return u.intValue().toString(t)+s},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),o=!1,u=0,s=0,c=0;c<t.length;++c){var h=a(t,c);h<0?"-"==t.charAt(c)&&0==this.signum()&&(o=!0):(s=r*s+h,++u>=n&&(this.dMultiply(i),this.dAddOffset(s,0),u=0,s=0))}u>0&&(this.dMultiply(Math.pow(r,u)),this.dAddOffset(s,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),p,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),r.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},e.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},e.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var o=n.shiftRight(i);(t=t+1>>1)>F.length&&(t=F.length);for(var u=r(),s=0;s<t;++s){u.fromInt(F[Math.floor(Math.random()*F.length)]);var a=u.modPow(o,this);if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(n)){for(var c=1;c++<i&&0!=a.compareTo(n);)if(0==(a=a.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=a.compareTo(n))return!1}}return!0},e.prototype.clone=function(){var t=r();return this.copyTo(t),t},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var e=r();return this.bitwiseTo(t,l,e),e},e.prototype.or=function(t){var e=r();return this.bitwiseTo(t,p,e),e},e.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,d,e),e},e.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,v,e),e},e.prototype.not=function(){for(var t=r(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},e.prototype.shiftLeft=function(t){var e=r();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},e.prototype.shiftRight=function(t){var e=r();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},e.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+g(this[t]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=_(this[r]^e);return t},e.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},e.prototype.setBit=function(t){return this.changeBit(t,p)},e.prototype.clearBit=function(t){return this.changeBit(t,v)},e.prototype.flipBit=function(t){return this.changeBit(t,d)},e.prototype.add=function(t){var e=r();return this.addTo(t,e),e},e.prototype.subtract=function(t){var e=r();return this.subTo(t,e),e},e.prototype.multiply=function(t){var e=r();return this.multiplyTo(t,e),e},e.prototype.divide=function(t){var e=r();return this.divRemTo(t,e,null),e},e.prototype.remainder=function(t){var e=r();return this.divRemTo(t,null,e),e},e.prototype.divideAndRemainder=function(t){var e=r(),n=r();return this.divRemTo(t,e,n),new Array(e,n)},e.prototype.modPow=function(t,e){var n,i,o=t.bitLength(),u=c(1);if(o<=0)return u;n=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new m(e):e.isEven()?new T(e):new f(e);var s=new Array,a=3,l=n-1,p=(1<<n)-1;if(s[1]=i.convert(this),n>1){var d=r();for(i.sqrTo(s[1],d);a<=p;)s[a]=r(),i.mulTo(d,s[a-2],s[a]),a+=2}var v,g,y=t.t-1,_=!0,w=r();for(o=h(t[y])-1;y>=0;){for(o>=l?v=t[y]>>o-l&p:(v=(t[y]&(1<<o+1)-1)<<l-o,y>0&&(v|=t[y-1]>>this.DB+o-l)),a=n;0==(1&v);)v>>=1,--a;if((o-=a)<0&&(o+=this.DB,--y),_)s[v].copyTo(u),_=!1;else{for(;a>1;)i.sqrTo(u,w),i.sqrTo(w,u),a-=2;a>0?i.sqrTo(u,w):(g=u,u=w,w=g),i.mulTo(w,s[v],u)}for(;y>=0&&0==(t[y]&1<<o);)i.sqrTo(u,w),g=u,u=w,w=g,--o<0&&(o=this.DB-1,--y)}return i.revert(u)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),i=this.clone(),o=c(1),u=c(0),s=c(0),a=c(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(o.isEven()&&u.isEven()||(o.addTo(this,o),u.subTo(t,u)),o.rShiftTo(1,o)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);n.compareTo(i)>=0?(n.subTo(i,n),r&&o.subTo(s,o),u.subTo(a,u)):(i.subTo(n,i),r&&s.subTo(o,s),a.subTo(u,a))}return 0!=i.compareTo(e.ONE)?e.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},e.prototype.pow=function(t){return this.exp(t,new w)},e.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},e.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=F[F.length-1]){for(e=0;e<F.length;++e)if(r[0]==F[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<F.length;){for(var n=F[e],i=e+1;i<F.length&&n<E;)n*=F[i++];for(n=r.modInt(n);e<i;)if(n%F[e++]==0)return!1}return r.millerRabin(t)},e.prototype.square=function(){var t=r();return this.squareTo(t),t},e.prototype.Barrett=T,null==k){var P;if(k=new Array,S=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var O=new Uint8Array(32);for(window.crypto.getRandomValues(O),P=0;P<32;++P)k[S++]=O[P]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var I=window.crypto.random(32);for(P=0;P<I.length;++P)k[S++]=255&I.charCodeAt(P)}for(;S<q;)P=Math.floor(65536*Math.random()),k[S++]=P>>>8,k[S++]=255&P;S=0,D()}function B(){if(null==x){for(D(),(x=new A).init(k),S=0;S<k.length;++S)k[S]=0;S=0}return x.next()}function C(){}function A(){this.i=0,this.j=0,this.S=new Array}C.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=B()},A.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},A.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var q=256;y.exports={default:e,BigInteger:e,SecureRandom:C}}.call(w);var T=b.exports.BigInteger;var x=function(){function t(){r(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return i(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var t=this.v.length/2,e=t.toString(16);return e.length%2==1&&(e="0"+e),t<128?e:(128+e.length/2).toString(16)+e}},{key:"getValue",value:function(){return""}}]),t}(),k=function(t){u(n,x);var e=h(n);function n(t){var i;return r(this,n),(i=e.call(this)).t="02",t&&(i.v=function(t){var e=t.toString(16);if("-"!==e[0])e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=(e=e.substr(1)).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=(e=(n=new T(n,16)).xor(t).add(T.ONE)).toString(16).replace(/^-/,"")}return e}(t)),i}return i(n,[{key:"getValue",value:function(){return this.v}}]),n}(),S=function(t){u(n,x);var e=h(n);function n(t){var i;return r(this,n),(i=e.call(this)).t="30",i.asn1Array=t,i}return i(n,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(t){return t.getEncodedHex()})).join(""),this.v}}]),n}();function F(t,e){return+t[e+2]<8?1:128&+t.substr(e+2,2)}function E(t,e){var r=F(t,e),n=t.substr(e+2,2*r);return n?(+n[0]<8?new T(n,16):new T(n.substr(2),16)).intValue():-1}function D(t,e){return e+2*(F(t,e)+1)}var P=function(t,e){var r=new k(t),n=new k(e);return new S([r,n]).getEncodedHex()},O=function(t){var e=D(t,0),r=D(t,e),n=E(t,e),i=t.substr(r,2*n),o=r+i.length,u=D(t,o),s=E(t,o),a=t.substr(u,2*s);return{r:new T(i,16),s:new T(a,16)}},I=b.exports.BigInteger,B=new I("2"),C=new I("3"),A=function(){function t(e,n){r(this,t),this.x=n,this.q=e}return i(t,[{key:"equals",value:function(t){return t===this||this.q.equals(t.q)&&this.x.equals(t.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(e){return new t(this.q,this.x.add(e.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(e){return new t(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(e){return new t(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}},{key:"divide",value:function(e){return new t(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t}(),q=function(){function t(e,n,i,o){r(this,t),this.curve=e,this.x=n,this.y=i,this.z=null==o?I.ONE:o,this.zinv=null}return i(t,[{key:"getX",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(I.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(I.ZERO))}},{key:"isInfinity",value:function(){return null===this.x&&null===this.y||this.z.equals(I.ZERO)&&!this.y.toBigInteger().equals(I.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=this.x.toBigInteger(),n=this.y.toBigInteger(),i=this.z,o=e.x.toBigInteger(),u=e.y.toBigInteger(),s=e.z,a=this.curve.q,c=r.multiply(s).mod(a),h=o.multiply(i).mod(a),m=c.subtract(h),f=n.multiply(s).mod(a),l=u.multiply(i).mod(a),p=f.subtract(l);if(I.ZERO.equals(m))return I.ZERO.equals(p)?this.twice():this.curve.infinity;var d=c.add(h),v=i.multiply(s).mod(a),g=m.square().mod(a),y=m.multiply(g).mod(a),_=v.multiply(p.square()).subtract(d.multiply(g)).mod(a),w=m.multiply(_).mod(a),b=p.multiply(g.multiply(c).subtract(_)).subtract(f.multiply(y)).mod(a),T=y.multiply(v).mod(a);return new t(this.curve,this.curve.fromBigInteger(w),this.curve.fromBigInteger(b),T)}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=this.z,i=this.curve.q,o=this.curve.a.toBigInteger(),u=e.square().multiply(C).add(o.multiply(n.square())).mod(i),s=r.shiftLeft(1).multiply(n).mod(i),a=r.square().mod(i),c=a.multiply(e).multiply(n).mod(i),h=s.square().mod(i),m=u.square().subtract(c.shiftLeft(3)).mod(i),f=s.multiply(m).mod(i),l=u.multiply(c.shiftLeft(2).subtract(m)).subtract(h.shiftLeft(1).multiply(a)).mod(i),p=s.multiply(h).mod(i);return new t(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(l),p)}},{key:"multiply",value:function(t){if(this.isInfinity())return this;if(!t.signum())return this.curve.infinity;for(var e=t.multiply(C),r=this.negate(),n=this,i=e.bitLength()-2;i>0;i--){n=n.twice();var o=e.testBit(i);o!==t.testBit(i)&&(n=n.add(o?this:r))}return n}}]),t}(),R=function(){function t(e,n,i){r(this,t),this.q=e,this.a=this.fromBigInteger(n),this.b=this.fromBigInteger(i),this.infinity=new q(this,null,null)}return i(t,[{key:"equals",value:function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}},{key:"fromBigInteger",value:function(t){return new A(this.q,t)}},{key:"decodePointHex",value:function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new I(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new I("4")).add(I.ONE),this.q));return r.toBigInteger().mod(B).equals(new I(t.substr(0,2),16).subtract(B))||(r=r.negate()),new q(this,e,r);case 4:case 6:case 7:var n=(t.length-2)/2,i=t.substr(2,n),o=t.substr(n+2,n);return new q(this,this.fromBigInteger(new I(i,16)),this.fromBigInteger(new I(o,16)));default:return null}}}]),t}(),j={ECPointFp:q,ECCurveFp:R},$=b.exports.BigInteger,L=b.exports.SecureRandom,M=j.ECCurveFp,N=new L,z=K(),U=z.curve,H=z.G,V=z.n;function K(){var t=new $("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new $("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),r=new $("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),n=new M(t,e,r),i=n.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:n,G:i,n:new $("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function Z(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}var Q={getGlobalCurve:function(){return U},generateEcparam:K,generateKeyPairHex:function(t,e,r){var n=(t?new $(t,e,r):new $(V.bitLength(),N)).mod(V.subtract($.ONE)).add($.ONE),i=Z(n.toString(16),64),o=H.multiply(n);return{privateKey:i,publicKey:"04"+Z(o.getX().toBigInteger().toString(16),64)+Z(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");var e=(t.length-2)/2,r=t.substr(2,e),n="03";return new $(t.substr(e+2,e),16).mod(new $("2")).equals($.ZERO)&&(n="02"),n+r},utf8ToHex:function(t){for(var e=(t=unescape(encodeURIComponent(t))).length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;for(var i=[],o=0;o<e;o++){var u=r[o>>>2]>>>24-o%4*8&255;i.push((u>>>4).toString(16)),i.push((15&u).toString(16))}return i.join("")},leftPad:Z,arrayToHex:function(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")},arrayToUtf8:function(t){for(var e=[],r=0,n=0;n<2*t.length;n+=2)e[n>>>3]|=parseInt(t[r],10)<<24-n%8*4,r++;try{for(var i=[],o=0;o<t.length;o++){var u=e[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(u))}return decodeURIComponent(escape(i.join("")))}catch(t){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){var e=[],r=t.length;r%2!=0&&(t=Z(t,r+1)),r=t.length;for(var n=0;n<r;n+=2)e.push(parseInt(t.substr(n,2),16));return e},verifyPublicKey:function(t){var e=U.decodePointHex(t);if(!e)return!1;var r=e.getX();return e.getY().square().equals(r.multiply(r.square()).add(r.multiply(U.a)).add(U.b))},comparePublicKeyHex:function(t,e){var r=U.decodePointHex(t);if(!r)return!1;var n=U.decodePointHex(e);return!!n&&r.equals(n)}},G=new Uint32Array(68),W=new Uint32Array(64);function Y(t,e){var r=31&e;return t<<r|t>>>32-r}function J(t,e){for(var r=[],n=t.length-1;n>=0;n--)r[n]=255&(t[n]^e[n]);return r}function X(t){return t^Y(t,9)^Y(t,17)}function tt(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var n=new Array((r-7)/8),i=new Array(8),o=0,u=n.length;o<u;o++)n[o]=0;for(var s=0,a=i.length;s<a;s++)i[s]=0;e=e.toString(2);for(var c=7;c>=0;c--)if(e.length>8){var h=e.length-8;i[c]=parseInt(e.substr(h),2),e=e.substr(0,h)}else e.length>0&&(i[c]=parseInt(e,2),e="");for(var m,f=new Uint8Array([].concat(l(t),[128],n,i)),p=new DataView(f.buffer,0),d=f.length/64,v=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),g=0;g<d;g++){G.fill(0),W.fill(0);for(var y=16*g,_=0;_<16;_++)G[_]=p.getUint32(4*(y+_),!1);for(var w=16;w<68;w++)G[w]=(m=G[w-16]^G[w-9]^Y(G[w-3],15))^Y(m,15)^Y(m,23)^Y(G[w-13],7)^G[w-6];for(var b=0;b<64;b++)W[b]=G[b]^G[b+4];for(var T=v[0],x=v[1],k=v[2],S=v[3],F=v[4],E=v[5],D=v[6],P=v[7],O=void 0,I=void 0,B=void 0,C=void 0,A=0;A<64;A++)C=A>=0&&A<=15?2043430169:2055708042,I=(A>=0&&A<=15?T^x^k:T&x|T&k|x&k)+S+((O=Y(Y(T,12)+F+Y(C,A),7))^Y(T,12))+W[A],B=(A>=0&&A<=15?F^E^D:F&E|~F&D)+P+O+G[A],S=k,k=Y(x,9),x=T,T=I,P=D,D=Y(E,19),E=F,F=X(B);v[0]^=T,v[1]^=x,v[2]^=k,v[3]^=S,v[4]^=F,v[5]^=E,v[6]^=D,v[7]^=P}for(var q=[],R=0,j=v.length;R<j;R++){var $=v[R];q.push((4278190080&$)>>>24,(16711680&$)>>>16,(65280&$)>>>8,255&$)}return q}for(var et=new Uint8Array(64),rt=new Uint8Array(64),nt=0;nt<64;nt++)et[nt]=54,rt[nt]=92;var it=tt,ot=function(t,e){for(e.length>64&&(e=tt(e));e.length<64;)e.push(0);var r=J(e,et),n=J(e,rt),i=tt([].concat(l(r),l(t)));return tt([].concat(l(n),l(i)))},ut=b.exports.BigInteger,st=P,at=O,ct=Q,ht=it,mt=ct.generateEcparam(),ft=mt.G,lt=mt.curve,pt=mt.n;function dt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";r=ct.utf8ToHex(r);var n,i,o=ct.leftPad(ft.curve.a.toBigInteger().toRadix(16),64),u=ct.leftPad(ft.curve.b.toBigInteger().toRadix(16),64),s=ct.leftPad(ft.getX().toBigInteger().toRadix(16),64),a=ct.leftPad(ft.getY().toBigInteger().toRadix(16),64);if(128===e.length)n=e.substr(0,64),i=e.substr(64,64);else{var c=ft.curve.decodePointHex(e);n=ct.leftPad(c.getX().toBigInteger().toRadix(16),64),i=ct.leftPad(c.getY().toBigInteger().toRadix(16),64)}var h=ct.hexToArray(r+o+u+s+a+n+i),m=4*r.length;h.unshift(255&m),h.unshift(m>>8&255);var f=ht(h);return ct.arrayToHex(ht(f.concat(ct.hexToArray(t))))}function vt(t){var e=ft.multiply(new ut(t,16));return"04"+ct.leftPad(e.getX().toBigInteger().toString(16),64)+ct.leftPad(e.getY().toBigInteger().toString(16),64)}function gt(){var t=ct.generateKeyPairHex(),e=lt.decodePointHex(t.publicKey);return t.k=new ut(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}var yt={generateKeyPairHex:ct.generateKeyPairHex,compressPublicKeyHex:ct.compressPublicKeyHex,comparePublicKeyHex:ct.comparePublicKeyHex,doEncrypt:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t="string"==typeof t?ct.hexToArray(ct.utf8ToHex(t)):Array.prototype.slice.call(t),e=ct.getGlobalCurve().decodePointHex(e);var n=ct.generateKeyPairHex(),i=new ut(n.privateKey,16),o=n.publicKey;o.length>128&&(o=o.substr(o.length-128));var u=e.multiply(i),s=ct.hexToArray(ct.leftPad(u.getX().toBigInteger().toRadix(16),64)),a=ct.hexToArray(ct.leftPad(u.getY().toBigInteger().toRadix(16),64)),c=ct.arrayToHex(ht([].concat(s,t,a))),h=1,m=0,f=[],p=[].concat(s,a),d=function(){f=ht([].concat(l(p),[h>>24&255,h>>16&255,h>>8&255,255&h])),h++,m=0};d();for(var v=0,g=t.length;v<g;v++)m===f.length&&d(),t[v]^=255&f[m++];var y=ct.arrayToHex(t);return 0===r?o+y+c:o+c+y},doDecrypt:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.output,o=void 0===i?"string":i;e=new ut(e,16);var u=t.substr(128,64),s=t.substr(192);0===r&&(u=t.substr(t.length-64),s=t.substr(128,t.length-128-64));var a=ct.hexToArray(s),c=ct.getGlobalCurve().decodePointHex("04"+t.substr(0,128));if(!c||!ct.verifyPublicKey("04"+t.substr(0,128)))return"array"===o?[]:"";var h=c.multiply(e),m=ct.hexToArray(ct.leftPad(h.getX().toBigInteger().toRadix(16),64)),f=ct.hexToArray(ct.leftPad(h.getY().toBigInteger().toRadix(16),64)),p=1,d=0,v=[],g=[].concat(m,f),y=function(){v=ht([].concat(l(g),[p>>24&255,p>>16&255,p>>8&255,255&p])),p++,d=0};y();for(var _=0,w=a.length;_<w;_++)d===v.length&&y(),a[_]^=255&v[d++];var b=ct.arrayToHex(ht([].concat(m,a,f)));return b===u.toLowerCase()?"array"===o?a:ct.arrayToUtf8(a):"array"===o?[]:""},doSignature:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.pointPool,i=r.der,o=r.hash,u=void 0===o||o,s=r.publicKey,a=r.userId,c="string"==typeof t?ct.utf8ToHex(t):ct.arrayToHex(t);u&&(c=dt(c,s=s||vt(e),a));var h=new ut(e,16),m=new ut(c,16),f=null,l=null,p=null;do{do{var d=void 0;f=(d=n&&n.length?n.pop():gt()).k,l=m.add(d.x1).mod(pt)}while(l.equals(ut.ZERO)||l.add(f).equals(pt));p=h.add(ut.ONE).modInverse(pt).multiply(f.subtract(l.multiply(h))).mod(pt)}while(p.equals(ut.ZERO));return i?st(l,p):ct.leftPad(l.toString(16),64)+ct.leftPad(p.toString(16),64)},doVerifySignature:function(t,e,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=o.der,s=o.hash,a=void 0===s||s,c=o.userId,h="string"==typeof t?ct.utf8ToHex(t):ct.arrayToHex(t);if(a&&(h=dt(h,r,c)),u){var m=at(e);n=m.r,i=m.s}else n=new ut(e.substring(0,64),16),i=new ut(e.substring(64),16);var f=pt.subtract(ut.ONE);if(n.compareTo(ut.ONE)<0||n.compareTo(f)>0)return!1;if(i.compareTo(ut.ONE)<0||i.compareTo(f)>0)return!1;var l=lt.decodePointHex(r);if(!l||!ct.verifyPublicKey(r))return!1;var p=new ut(h,16),d=n.add(i).mod(pt);if(d.equals(ut.ZERO))return!1;var v=ft.multiply(i).add(l.multiply(d)),g=p.add(v.getX().toBigInteger()).mod(pt);return n.equals(g)},getPublicKeyFromPrivateKey:vt,getPoint:gt,verifyPublicKey:ct.verifyPublicKey},_t=it,wt=ot;function bt(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")}function Tt(t){var e,r,n=[],i=t.length;i%2!=0&&(r=i+1,t=(e=t).length>=r?e:new Array(r-e.length+1).join("0")+e),i=t.length;for(var o=0;o<i;o+=2)n.push(parseInt(t.substr(o,2),16));return n}var xt=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],kt=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function St(t){for(var e=[],r=0,n=t.length;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return e}function Ft(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")}function Et(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t.codePointAt(r);if(i<=127)e.push(i);else if(i<=2047)e.push(192|i>>>6),e.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)e.push(224|i>>>12),e.push(128|i>>>6&63),e.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw e.push(i),new Error("input is not supported");r++,e.push(240|i>>>18&28),e.push(128|i>>>12&63),e.push(128|i>>>6&63),e.push(128|63&i)}}return e}function Dt(t){for(var e=[],r=0,n=t.length;r<n;r++)t[r]>=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function Pt(t,e){var r=31&e;return t<<r|t>>>32-r}function Ot(t){return(255&xt[t>>>24&255])<<24|(255&xt[t>>>16&255])<<16|(255&xt[t>>>8&255])<<8|255&xt[255&t]}function It(t){return t^Pt(t,2)^Pt(t,10)^Pt(t,18)^Pt(t,24)}function Bt(t){return t^Pt(t,13)^Pt(t,23)}function Ct(t,e,r){for(var n=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&t[4*o],i[1]=255&t[4*o+1],i[2]=255&t[4*o+2],i[3]=255&t[4*o+3],n[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(var u,s=0;s<32;s+=4)u=n[1]^n[2]^n[3]^r[s+0],n[0]^=It(Ot(u)),u=n[2]^n[3]^n[0]^r[s+1],n[1]^=It(Ot(u)),u=n[3]^n[0]^n[1]^r[s+2],n[2]^=It(Ot(u)),u=n[0]^n[1]^n[2]^r[s+3],n[3]^=It(Ot(u));for(var a=0;a<16;a+=4)e[a]=n[3-a/4]>>>24&255,e[a+1]=n[3-a/4]>>>16&255,e[a+2]=n[3-a/4]>>>8&255,e[a+3]=255&n[3-a/4]}function At(t,e,r){for(var n=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&t[0+4*o],i[1]=255&t[1+4*o],i[2]=255&t[2+4*o],i[3]=255&t[3+4*o],n[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];n[0]^=2746333894,n[1]^=1453994832,n[2]^=1736282519,n[3]^=2993693404;for(var u,s=0;s<32;s+=4)u=n[1]^n[2]^n[3]^kt[s+0],e[s+0]=n[0]^=Bt(Ot(u)),u=n[2]^n[3]^n[0]^kt[s+1],e[s+1]=n[1]^=Bt(Ot(u)),u=n[3]^n[0]^n[1]^kt[s+2],e[s+2]=n[2]^=Bt(Ot(u)),u=n[0]^n[1]^n[2]^kt[s+3],e[s+3]=n[3]^=Bt(Ot(u));if(0===r)for(var a,c=0;c<16;c++)a=e[c],e[c]=e[31-c],e[31-c]=a}function qt(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.padding,o=void 0===i?"pkcs#7":i,u=n.mode,s=n.iv,a=void 0===s?[]:s,c=n.output,h=void 0===c?"string":c;if("cbc"===u&&("string"==typeof a&&(a=St(a)),16!==a.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=St(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==r?Et(t):St(t):l(t),("pkcs#5"===o||"pkcs#7"===o)&&0!==r)for(var m=16-t.length%16,f=0;f<m;f++)t.push(m);var p=new Array(32);At(e,p,r);for(var d=[],v=a,g=t.length,y=0;g>=16;){var _=t.slice(y,y+16),w=new Array(16);if("cbc"===u)for(var b=0;b<16;b++)0!==r&&(_[b]^=v[b]);Ct(_,w,p);for(var T=0;T<16;T++)"cbc"===u&&0===r&&(w[T]^=v[T]),d[y+T]=w[T];"cbc"===u&&(v=0!==r?w:_),g-=16,y+=16}if(("pkcs#5"===o||"pkcs#7"===o)&&0===r){for(var x=d.length,k=d[x-1],S=1;S<=k;S++)if(d[x-S]!==k)throw new Error("padding is invalid");d.splice(x-k,k)}return"array"!==h?0!==r?Ft(d):Dt(d):d}var Rt,jt={sm2:yt,sm3:function(t,e){if(t="string"==typeof t?function(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t.codePointAt(r);if(i<=127)e.push(i);else if(i<=2047)e.push(192|i>>>6),e.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)e.push(224|i>>>12),e.push(128|i>>>6&63),e.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw e.push(i),new Error("input is not supported");r++,e.push(240|i>>>18&28),e.push(128|i>>>12&63),e.push(128|i>>>6&63),e.push(128|63&i)}}return e}(t):Array.prototype.slice.call(t),e){if("hmac"!==(e.mode||"hmac"))throw new Error("invalid mode");var r=e.key;if(!r)throw new Error("invalid key");return r="string"==typeof r?Tt(r):Array.prototype.slice.call(r),bt(wt(t,r))}return bt(_t(t))},sm4:{encrypt:function(t,e,r){return qt(t,e,1,r)},decrypt:function(t,e,r){return qt(t,e,0,r)}}},$t=function(){function t(e,n){r(this,t),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=n,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=e}return i(t,[{key:"generateRequestData",value:function(){var t,e=new Date,r={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(e.getFullYear(),"-").concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()),tz:_.getTimezone(e),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:l(this.catch)}),_:e.getTime()+""};if(null===(t=this.tracker)||void 0===t?void 0:t.config.encrypt)if(this.tracker.config.publicKey){var n=_.randomAesKey();r.event=jt.sm4.encrypt(r.event,n),r.key=jt.sm2.doEncrypt(n,this.tracker.config.publicKey,1),r.type=2,r.encrypt=1}else console.warn("未配置公钥,无法加密数据");return this.catch=[],r}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(t,n){var i,o=!1;i=setTimeout((function(){o=!0,t(null)}),e.timeout),e.requestFunction(e.url,r,{timeout:e.requestTimeout}).then((function(e){o||(clearTimeout(i),t(e))})).catch((function(t){n(t)}))}))}}}]),t}(),Lt=function(){function e(t,n,i){r(this,e),this.storageFunction=t,this.allData=i||{},this.allData.did||this.set("did",n.config.did||_.UUID()),this.allData.cuid||this.set("cuid",void 0),_.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return i(e,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(e,r){return g(this,void 0,void 0,t.mark((function n(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.allData[e]=r,t.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return t.stop()}}),n,this)})))}}]),e}();!function(t){var e,r,n,i,o,u;(e=t.EventType||(t.EventType={})).connected="connected",e.disconnected="disconnected",e.error="error",e.offline="offline",e.exist="exist",e.online="online",(r=t.RequestType||(t.RequestType={}))[r.common=0]="common",r[r.ping=1]="ping",r[r.pong=2]="pong",r[r.normal=5]="normal",r[r.img=6]="img",(n=t.ResponseCode||(t.ResponseCode={}))[n.offline=109001]="offline",n[n.exist=109002]="exist",n[n.paramError=109005]="paramError",n[n.online=109006]="online",(i=t.SocketMsgOrigin||(t.SocketMsgOrigin={}))[i.xcx=1]="xcx",i[i.app=2]="app",i[i.web=3]="web",(o=t.VisualEndpointType||(t.VisualEndpointType={}))[o.xcx=1]="xcx",(u=t.SocketMessageType||(t.SocketMessageType={})).update="update",u.xcxLogin="xcxLogin",u.eventInfo="eventInfo"}(Rt||(Rt={}));var Mt,Nt,zt,Ut=Rt,Ht=function(){function t(e,n){r(this,t),this.listeners={},this.catch=[],this.showLog=!1,this.url=e,this.params=n,this.open()}return i(t,[{key:"emit",value:function(t,e){var r;if(this.log("info","emit message",[t,e]),!this.client)return this.log("info","缓存消息",[t,e]),void this.catch.push([t,e]);switch(null===(r=this.client)||void 0===r?void 0:r.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[t,e]),this.catch.push([t,e])}}},{key:"on",value:function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"onConnected",value:function(t){this.on(Ut.EventType.connected,t)}},{key:"onDisconnected",value:function(t){this.on(Ut.EventType.disconnected,t)}},{key:"onError",value:function(t){this.on(Ut.EventType.error,t)}},{key:"send",value:function(t){var e;null===(e=this.client)||void 0===e||e.send({data:JSON.stringify(t)})}},{key:"_onError",value:function(t){var e;this.log("error","socket连接异常",t),null===(e=this.listeners.error)||void 0===e||e.forEach((function(e){e.call(void 0,t)}))}},{key:"_onClose",value:function(t){var e;this.log("error","socket连接已关闭"),null===(e=this.listeners.disconnected)||void 0===e||e.forEach((function(t){t.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(t){var e,r=this;this.log("info","socket连接成功",t),null===(e=this.listeners.connected)||void 0===e||e.forEach((function(t){t.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(t){var e=f(t,2),n=e[0],i=e[1];r.emit(n,i)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(t){var e,r,n;if(""!==t.data){var i=JSON.parse(t.data);if(i.code)switch(Number(i.code)){case Ut.ResponseCode.offline:null===(e=this.listeners[Ut.EventType.offline])||void 0===e||e.forEach((function(t){t.call(void 0,i)}));break;case Ut.ResponseCode.online:null===(r=this.listeners[Ut.EventType.online])||void 0===r||r.forEach((function(t){t.call(void 0,i)}));break;case Ut.ResponseCode.exist:null===(n=this.listeners[Ut.EventType.exist])||void 0===n||n.forEach((function(t){t.call(void 0,i)}));break;case Ut.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(i.type===Ut.RequestType.pong)return;var o=i.data;this.listeners[o.event]&&this.listeners[o.event].forEach((function(t){t.call(void 0,o.payload)}))}}}},{key:"ping",value:function(){var t=this;this.pingTimer=setInterval((function(){t.send({type:Ut.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(t,e){var r=this;e?this.listeners[t].forEach((function(n,i){n===e&&r.listeners[t].splice(i,1)})):this.listeners[t]=[]}},{key:"open",value:function(){var t,e,r=this;this.client&&this.close();var n=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(t=this.params)||void 0===t?void 0:t.socketToken,"&appId=").concat(null===(e=this.params)||void 0===e?void 0:e.appId,"&origin=").concat(Ut.SocketMsgOrigin.xcx)});n.onMessage((function(t){r.onMessage(t)})),n.onError((function(t){r._onError(t)})),n.onClose((function(t){r._onClose(t)})),n.onOpen((function(t){r._onOpen(t)})),this.client=n}},{key:"close",value:function(){var t;null===(t=this.client)||void 0===t||t.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.showLog&&(e=console).log.apply(e,["%c【socketClient】:".concat(t),"color: ".concat("error"===t?"red":"#1890ff")].concat(n))}},{key:"openLog",value:function(t){this.showLog=t}}]),t}(),Vt=function(t,e,r){return new Promise((function(n,i){var u;wx.request((o(u={url:t,data:e,method:(null==r?void 0:r.method)||"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":(null==r?void 0:r.contentType)||"application/x-www-form-urlencoded"}),o(u,"dataType","json"),o(u,"responseType",null!=(null==r?void 0:r.responseType)?null==r?void 0:r.responseType:"arraybuffer"),o(u,"success",(function(t){n(t)})),o(u,"fail",(function(t){i(t)})),u))}))},Kt=function(){function e(t){r(this,e),this.pagePathJudge=function(t,e){return-1!==e.pagePath.indexOf("*")?-1!==t.pr.$page_url.indexOf(e.pagePath.split("*")[0]):e.pagePath===t.pr.$page_url.split("?")[0]},this.tracker=t,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return i(e,[{key:"init",value:function(){var t=this;this.socket&&this.socket.destroy(),this.socket=new Ht(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){t.getVisualData()})),this.socket.on("connected",(function(){null===t.socketUserInfo?wx.getSystemInfo({success:function(e){var r=e.model,n=e.system,i=e.version;wx.getUserInfo({success:function(e){var o=e.userInfo.nickName,u=e.userInfo.avatarUrl,s={model:r,system:n,version:i,nickName:o,avatarUrl:u,programId:t.tracker.config.appId};t.socketUserInfo=s,t.sendUserInfo(s)}})}}):t.sendUserInfo(t.socketUserInfo)}))}},{key:"getVisualData",value:function(){var t=this;Vt("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:Ut.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(e){e.data&&e.data.data&&(t.visualData=e.data.data)}))}},{key:"sendUserInfo",value:function(t){var e;this.socketState=!0,null===(e=this.socket)||void 0===e||e.send({type:Ut.RequestType.normal,data:{event:Ut.SocketMessageType.xcxLogin,payload:{userInfo:t}}})}},{key:"send",value:function(t){var e;this.socketState&&(null===(e=this.socket)||void 0===e||e.send({type:Ut.RequestType.normal,data:{event:Ut.SocketMessageType.eventInfo,payload:t}}))}},{key:"event",value:function(e){var r;return g(this,void 0,void 0,t.mark((function n(){var i,o,u,s=this;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(r=this.tracker)||void 0===r?void 0:r.config.visual){t.next=2;break}return t.abrupt("return");case 2:"abp"!==e.dt||"pv"!==e.pr.$eid&&"click"!==e.pr.$eid?"evt"===e.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},e),{eventType:"evt"})):(i=_.clone(e),o=!1,this.visualData.map((function(t){var r,n;if("click"===e.pr.$eid){var u=[],a=_.jsJSON(t.elementConditions)?JSON.parse(t.elementConditions):{};for(var c in a)u.push(a[c]===e.pr[c]);u.push(s.pagePathJudge(e,t)),-1===u.indexOf(!1)&&"click"===t.eventType&&(i.dt="evt",i.pr.$eid=t.eventName,o=!0,s.vRQC?s.send(Object.assign(Object.assign({},i),{visual:t})):null===(r=s.tracker)||void 0===r||r.send(i))}else"pv"===t.eventType&&s.pagePathJudge(e,t)&&(i.dt="evt",i.pr.$eid=t.eventName,o=!0,s.vRQC?s.send(Object.assign(Object.assign({},i),{visual:t})):null===(n=s.tracker)||void 0===n||n.send(i))})),this.vRQC&&!o&&(u="click"===e.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},e),{eventType:u}))));case 3:case"end":return t.stop()}}),n,this)})))}}]),e}();function Zt(t,e,r){var n=r.value;return r.value=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:e,args:r})},r}var Qt=function(){function e(t,n,i){r(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,Nt=t,Mt=n,zt=i,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",encrypt:!1,publicKey:"031e09b445c808d2b97ff01f318f785672fac17f03afc29c259b0548d7f3ad6c66",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new Kt(this)}return i(e,[{key:"load",value:function(e,r){return g(this,void 0,void 0,t.mark((function n(){var i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.appKey=e,this.config=_.merge(this.config,r||{}),t.prev=2,t.next=5,Mt.get();case 5:if((i=t.sent)&&i.did){t.next=10;break}return t.next=9,Mt.getDid();case 9:i.did=t.sent;case 10:this.storage=new Lt(Mt,this,i),this.request=new $t(Nt,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2),console.error("sdk初始化失败,缓存读取失败",t.t0);case 20:case"end":return t.stop()}}),n,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var r in e)e[r]&&(t.pr["$".concat(r)]=e[r]);return this.request.send(t)}},{key:"trackBaseData",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Date,t.t0=e,t.t1=n.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=_.getTimezone(n),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=zt.os(),t.t9=zt.ov(),t.t10=zt.version(),t.next=14,zt.mnet();case 14:return t.t11=t.sent,t.next=17,zt.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15,$page_url:""},(i={dt:"evt",pr:t.t16}).pr=_.merge(i.pr,_.encode(this.config.superProperty)),t.abrupt("return",i);case 25:case"end":return t.stop()}}),r,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(zt.windowWidth(),"x").concat(zt.windowHeight()),$tz:_.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();e.pr.$dv=r.model,e.pr.$br=r.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,r=t.update-t.sid,n={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:_.getTimezone(e),$dru:r,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return g(this,void 0,void 0,t.mark((function e(){var r,n,i,o,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,n=this.storage.allData,i=n.sid,o=n.cuid,t.t0=i,t.t1=i,t.t2=o,t.t3=this.cn,t.t4=_.getTimezone(r),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=zt.os(),t.t8=zt.ov(),t.t9=zt.version(),t.next=14,zt.mnet();case 14:return t.t10=t.sent,t.next=17,zt.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},u={dt:"ss",pr:t.t15},this.config.utm&&!_.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(u),this.environmentInfo();case 26:case"end":return t.stop()}}),e,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,r=Date.now();if(e.sid&&e.update)if(r-e.update>this.config.timeout){var n=_.clone(e);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n,i,o,u,s;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:for(u in n=t.sent,i={},o=["id","content","type","style","selector","link"],e.target.dataset)-1===o.indexOf(u)&&(i["_".concat(u)]=e.target.dataset[u]);return s=e.target,n.dt="abp",n.pr=_.merge(n.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:s.dataset.id||"",$element_content:s.dataset.content||"",$element_type:s.dataset.type||"",$element_style:s.dataset.style||"",$element_selector:s.dataset.selector||"",$element_link:s.dataset.link||""},i,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=14,this.send(n);case 14:return t.next=16,this.visual.event(n);case 16:case"end":return t.stop()}}),r,this)})))}},{key:"pv",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(n=t.sent).dt="abp",n.pr=_.merge(n.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},e||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=10,this.send(n);case 10:return t.next=12,this.visual.event(n);case 12:case"end":return t.stop()}}),r,this)})))}},{key:"duration",value:function(){return g(this,void 0,void 0,t.mark((function e(){var r,n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),_.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),r=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(n=t.sent).dt="abp",n.pr=_.merge(n.pr,{$dr:r,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(n);case 12:_.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),e,this)})))}},{key:"track",value:function(e,r){return g(this,void 0,void 0,t.mark((function n(){var i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track"),t.next=3,this.trackBaseData(e);case 3:return(i=t.sent).pr=_.merge(i.pr,_.encode(r),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=7,this.send(i);case 7:return t.next=9,this.visual.event(i);case 9:case"end":return t.stop()}}),n,this)})))}},{key:"identify",value:function(e,r){return g(this,void 0,void 0,t.mark((function n(){var i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),i=new Date,(o={dt:"usr",pr:{$ct:i.getTime(),$tz:_.getTimezone(i),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=_.merge(o.pr,_.encode(r)),t.next=7,this.trackBaseData("usr");case 7:return t.next=9,this.send(o);case 9:case"end":return t.stop()}}),n,this)})))}},{key:"setPushClient",value:function(e,r){return g(this,void 0,void 0,t.mark((function n(){var i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new Date,o={dt:"um",pr:{$ct:i.getTime(),$tz:_.getTimezone(i),$push_ch:r||"getui",$push_id:e}},t.next=4,this.trackBaseData("usr");case 4:return t.next=6,this.send(o);case 6:case"end":return t.stop()}}),n,this)})))}},{key:"trackCount",value:function(t,e){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=_.clone(e)),this.previousCountEvent.name===t&&_.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=_.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,r,n){return g(this,void 0,void 0,t.mark((function i(){var o,u,s,a;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track count"),o=Date.now()-this.countStartTime,n&&(o-=this.config.countDuration),u=this.count,this.count=n?0:1,t.next=7,this.trackBaseData(e);case 7:return s=t.sent,a={},_.isObject(r)&&(a=_.clone(r)),s.pr=_.merge(s.pr,_.encode(a),_.encode({count:u,countTime:o})),t.next=13,this.send(s);case 13:case"end":return t.stop()}}),i,this)})))}},{key:"trackRevenue",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n,i,o,u,s,a,c,h;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=function(t,e){var r=0;try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),r.next=4,this.trackBaseData("revenue");case 4:(n=r.sent).dt="abp",(i=_.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=o(i.price,i.productQuantity),u=["productID","revenueType"],s=["price","total","productQuantity"],a={},r.t0=t.keys(i);case 12:if((r.t1=r.t0()).done){r.next=21;break}if(c=r.t1.value,-1!==u.indexOf(c)||-1!==s.indexOf(c)){r.next=16;break}return r.abrupt("continue",12);case 16:h=i[c],s.indexOf(c)>-1&&((h=Number(h))||(h=0)),a["$"+c]=h,r.next=12;break;case 21:return n.pr=_.merge(n.pr,a),r.next=24,this.send(n);case 24:case"end":return r.stop()}}),r,this)})))}},{key:"setUtm",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(n=_.filterUtm(e))&&(this.storage.set("utm",n),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),r,this)})))}},{key:"setSuperProperty",value:function(t){_.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){_.isObject(t)&&(this.config.superProperty=_.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=p(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;delete this.config.superProperty[n]}}catch(t){r.e(t)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();v([Zt],Qt.prototype,"environmentInfo",null),v([Zt],Qt.prototype,"sessionEnd",null),v([Zt],Qt.prototype,"sessionStart",null),v([Zt],Qt.prototype,"updateSession",null),v([Zt],Qt.prototype,"click",null),v([Zt],Qt.prototype,"pv",null),v([Zt],Qt.prototype,"duration",null),v([Zt],Qt.prototype,"track",null),v([Zt],Qt.prototype,"identify",null),v([Zt],Qt.prototype,"setPushClient",null),v([Zt],Qt.prototype,"trackCount",null),v([Zt],Qt.prototype,"trackRevenue",null),v([Zt],Qt.prototype,"setUtm",null);var Gt=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],Wt=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],Yt=function(t){return _.wxGetTitle(t)},Jt={did:void 0,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(r,n){wx.setStorage({key:t,data:e,success:r,fail:n})}))}},Xt=!1,te=wx.getSystemInfoSync(),ee=te.system.split(/\s/),re={os:ee[0],ov:ee[1],version:te.version,windowHeight:te.windowHeight,windowWidth:te.windowWidth,net:0,mnet:0};function ne(t){var e=t.toLowerCase();"wifi"===e?(re.net=1,re.mnet=0):(re.net=0,re.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function ie(t){return new Promise((function(e,r){if(Xt)return e(re[t]);wx.getNetworkType({success:function(r){Xt=!0,ne(r.networkType),e(re[t])}})}))}wx.onNetworkStatusChange((function(t){ne(t.networkType)}));var oe,ue,se={os:function(){return re.os},ov:function(){return re.ov},version:function(){return re.version},net:function(){return ie("net")},mnet:function(){return ie("mnet")},windowWidth:function(){return re.windowWidth},windowHeight:function(){return re.windowHeight}},ae=App,ce=Page,he=Component,me=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function fe(t,e,r){if(t[r]&&_.isFunction(t[r])){var n=t[r];t[r]=function(){n.apply(this,arguments),e[r].apply(this,arguments)}}else t[r]=function(){e[r].apply(this,arguments)}}function le(t,e,r){var n=t[e];t[e]=function(){var t=arguments[0];if(oe===t||t&&oe&&oe.timeStamp===t.timeStamp)return n.apply(this,arguments);if(oe=t,t){var e=t.type;"tap"===e&&r.click(t)}return n.apply(this,arguments)}}var pe=function(e){u(o,Qt);var n=h(o);function o(t){var e;return r(this,o),(e=n.call(this,Vt,Jt,se)).openData={path:"",props:{}},e.shared=!1,e.semiAutoTrackEventCatch={},e.isShareOperation=!1,ue=t,e.initLifeCycleHook(),e}return i(o,[{key:"initLifeCycleHook",value:function(){var t,e=this,r=(t=e,{App:{onLaunch:function(e){t.config.visual&&t.visual.getVisualData()},onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){(null==e?void 0:e.scene)&&-1!==decodeURIComponent(e.scene).indexOf("vRQC")&&t.config.visual&&(t.visual.vRQC=decodeURIComponent(e.scene).split("vRQC=")[1],t.visual.init()),t.currentPage.query=_.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),r=e[e.length-1];t.currentPage.route=r.__route__||r.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var n=Yt;if(t.currentPage.title="function"==typeof n?n(r):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(r),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=_.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=_.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=r;var n=function(t){for(var n in r.App)fe(t,r.App,n);for(var i in t)!Gt.includes(i)&&_.isFunction(t[i])&&le(t,i,e);return ae(t)};for(var i in App)n[i]=App[i];App=n;var o=function(t){for(var n in r.Page)fe(t,r.Page,n);for(var i in t)!Wt.includes(i)&&_.isFunction(t[i])&&"onShareAppMessage"!==i&&le(t,i,e);var o=t.onShareAppMessage;return _.isFunction(o)&&(t.onShareAppMessage=e.onShareAppMessage(o)),ce(t)};for(var u in Page)o[u]=Page[u];Page=o,Component=function(t){if(void 0!==t.methods)for(var r in t.methods)le(t.methods,r,e);return he(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return m(s(o.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(e){var r=this,n=Object.create(null,{pv:{get:function(){return m(s(o.prototype),"pv",r)}}});return g(this,void 0,void 0,t.mark((function e(){var r,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},i=_.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(r.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(r.$share_level=Number(this.openOptions.query.zg_share_level)),i.data&&i.data.zg_share_data&&(r=_.merge(r,_.encode(i.data.zg_share_data)))),t.next=5,n.pv.call(this,r);case 5:case"end":return t.stop()}}),e,this)})))}},{key:"click",value:function(e){var r=this,n=Object.create(null,{click:{get:function(){return m(s(o.prototype),"click",r)}}});return g(this,void 0,void 0,t.mark((function r(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.click.call(this,e);case 2:case"end":return t.stop()}}),r,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=_.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&ue){var r=t.scene;this.cn=r+"";var n=ue[r],i={},o=null,u=ue.isShare(r);if(u&&t.referrerInfo&&(o=t.referrerInfo.appId),n){i={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:o};var s=t.query||{};ue.isCartShare(r)&&s.zg_uid&&s.zg_share_id&&(i.utm_term=s.zg_uid,i.utm_content=s.zg_share_id)}e=_.merge(i,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&_.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(e){return g(this,void 0,void 0,t.mark((function r(){var n,i,o,u,s,a,c,h,m,f,l;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(n=e.query||{},i=this.currentPage.route,!(ue.isCartShare(e.scene)&&n.zg_uid&&n.zg_share_id)){t.next=24;break}for(s in o={$uid:n.zg_uid,$share_id:n.zg_share_id,$title:this.currentPage.title,$path:i,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(n.zg_share_level)},this.shareId=n.zg_share_id,this.shareLevel=Number(n.zg_share_level),u={},n)a=s.replace(/^zg_/,""),-1===me.indexOf(a)&&/^zg_/.test(s)&&(u[a]=n[s]);if(c=this.config.shareToUtm,_.isObject(c)&&!_.isEmpty(c)){for(m in h={},c)null!==u[m]&&void 0!==u[m]&&(f=c[m],h[f]=u[m]);_.isEmpty(h)||(h.utm_campaign||(h.utm_campaign="分享打开"),this.setUtm(h))}return this.openData={path:i,props:u},o=_.merge(o,_.encode(u)),t.next=19,this.trackBaseData("wxsopen");case 19:return(l=t.sent).dt="abp",l.pr=_.merge(l.pr,o),t.next=24,this.send(l);case 24:case"end":return t.stop()}}),r,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var r=t.apply(this,arguments)||{};if(!e.config.forwardShare)return r;r.path=r.path||e.currentPage.url;var n=r.title||e.currentPage.title,i=r.path.split("?")[0],o=this.data.zg_share_data,u=(new Date).getTime(),s=1;!this.data.newShare&&e.openData&&e.openData.path===i&&_.isEqual(o||{},e.openData.props)&&(u=e.shareId,s=e.shareLevel+1);var a={share_id:u,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:s},c={$share_title:n,$title:e.currentPage.title||"",$path:i},h={};for(var m in a)c["$".concat(m)]=h["zg_".concat(m)]=a[m];for(var f in o)-1===me.indexOf(f)&&(c["_".concat(f)]=h["zg_".concat(f)]=o[f]);return r.path=_.addUrlParam(r.path,h),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=_.merge(t.pr,c),e.request.send(t)})),e.shared=!0,r}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var r,n=e.getEventDataFromDataset(t.dataset);(r=m(s(o.prototype),"track",e)).call.apply(r,[e].concat(l(n)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},r="";for(var n in t){if(n.startsWith("expo"))if("expoName"===n)r=t[n];else e[n.replace(/^expo(.*)/,(function(t,e,r,n){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[n]}return[r,e]}}]),o}();v([Zt],pe.prototype,"sceneToUtm",null),v([Zt],pe.prototype,"trackOpenShare",null);var de={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1103:{utm_source:"发现小程序",utm_medium:"发现栏 - 小程序 - 我的小程序"},1104:{utm_source:"任务栏",utm_medium:"任务栏 - 我的小程序"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1200:{utm_source:"打开小程序",utm_medium:"视频号广告打开小程序"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},1217:{utm_source:"打开小程序",utm_medium:"蓝牙设备后台唤醒小程序"},1218:{utm_source:"打开小程序",utm_medium:"微信键盘预览打开小程序"},1219:{utm_source:"打开小游戏",utm_medium:"视频号直播间小游戏一键上车"},1220:{utm_source:"打开小程序",utm_medium:"发现页设备卡片打开小程序"},1223:{utm_source:"打开小程序",utm_medium:"安卓桌面Widget打开小程序"},1224:{utm_source:"打开小程序",utm_medium:"小程序商家助手功能打开小程序"},1225:{utm_source:"打开小程序",utm_medium:"音视频通话打开小程序"},1226:{utm_source:"打开小程序",utm_medium:"聊天消息在设备打开后打开小程序"},1228:{utm_source:"打开小程序",utm_medium:"视频号原生广告组件打开小程序"},1230:{utm_source:"打开小程序",utm_medium:"订阅号H5广告进入小程序"},1231:{utm_source:"打开小程序",utm_medium:"动态消息提醒入口打开小程序"},1232:{utm_source:"打开小程序",utm_medium:"搜一搜竞价广告打开小程序"},1233:{utm_source:"打开小游戏",utm_medium:"小程序搜索页人气游戏模块打开小游戏"},1238:{utm_source:"打开小程序",utm_medium:"看一看信息流广告打开小程序"},1239:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间气泡浮窗打开小游戏"},1242:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块频道页进入小程序"},1243:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块商品聚合页进入小程序"},1244:{utm_source:"打开小程序",utm_medium:"#tag搜索结果页打开小程序"},1245:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送搜索结果页进入小程序"},1248:{utm_source:"打开小程序",utm_medium:"通过小程序账号迁移进入小程序"},1252:{utm_source:"打开小程序",utm_medium:"搜一搜小程序搜索页「小功能」模块进入小程序"},1254:{utm_source:"打开小程序",utm_medium:"发现页「动态」卡片 打开小程序"},1255:{utm_source:"打开小程序",utm_medium:"发现页「我的」卡片 打开小程序"},1256:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「最近使用」列表"},1257:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「我的小程序」列表"},1258:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「为电脑端优化」模块"},1259:{utm_source:"打开小游戏",utm_medium:"pc端小程序面板「小游戏专区」模块"},1260:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「推荐在电脑端使用」列表"},1261:{utm_source:"打开商品卡片",utm_medium:"公众号返佣商品卡片"},1265:{utm_source:"打开小程序",utm_medium:"小程序图片详情页打开小程序"},1266:{utm_source:"打开小程序",utm_medium:"小程序图片长按半屏入口打开小程序"},1267:{utm_source:"打开小程序",utm_medium:"小程序图片会话角标打开小程序"},1271:{utm_source:"打开小程序",utm_medium:"微信聊天主界面下拉,「我的常用小程序」栏"},1272:{utm_source:"打开小程序",utm_medium:"发现页「游戏」服务tab打开小程序"},1273:{utm_source:"打开小程序",utm_medium:"发现页「常用的小程序」列表"},1274:{utm_source:"打开小程序",utm_medium:"优量汇广告打开小程序"},1275:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片打开小程序"},1276:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片二级聚合页打开小程序"},1277:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片搜索结果页打开小程序"},1278:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」列表打开小程序"},1279:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」合集页打开小程序"},1280:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「建议使用」打开小程序"},1281:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开小程序"},1282:{utm_source:"打开小程序",utm_medium:"听一听播放器打开小程序"},1285:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」短剧合集打开小程序"},1286:{utm_source:"打开小程序",utm_medium:"明文scheme打开小程序"},1287:{utm_source:"打开小程序",utm_medium:"公众号短剧贴片打开小程序"},1292:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」poi 详情页打开小程序"},1293:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片追剧页打开小程序"},1295:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」广告打开小程序"},1296:{utm_source:"打开小程序",utm_medium:"视频号付费短剧气泡打开小程序"},1297:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开小程序"},1298:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开的合集访问小程序"},1299:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」poi 详情页打开小程序"},1300:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开的合集访问小程序"},1301:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」poi 详情页打开小程序"},1302:{utm_source:"打开小程序",utm_medium:"PC端面板「发现小程序」"},1303:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片视频流打开小程序"},1304:{utm_source:"打开小程序",utm_medium:"手机负一屏打开小程序(比如oppo手机)"},1305:{utm_source:"打开小程序",utm_medium:"公众号播放结束页打开小程序"},1306:{utm_source:"打开小程序",utm_medium:"公众号短剧固定选集入口打开小程序"},1307:{utm_source:"打开小程序",utm_medium:"发现页附近服务境外专区打开小程序"},1308:{utm_source:"打开小游戏",utm_medium:"PC端面板小游戏专区页面"},1311:{utm_source:"打开小游戏",utm_medium:"公众号文章打开小游戏CPS卡片"},1313:{utm_source:"打开小程序",utm_medium:"PC OpenSDK打开小程序"},1325:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的表情包消息角标打开小程序"},1326:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的角标打开小程序"},1327:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息角标打开小程序"},1328:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息超链接打开小程序"},1336:{utm_source:"打开小程序",utm_medium:"小店打开小程序关联会员身份"},1337:{utm_source:"打开小程序",utm_medium:"小店确认订单页跳小程序使用会员权益"},1340:{utm_source:"打开小程序",utm_medium:"小程序profile-热门商品入口打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},ve=new(function(t){u(n,pe);var e=h(n);function n(){return r(this,n),e.call(this,de)}return i(n,[{key:"load",value:function(t,e){var r=e||{};if(wx.getAccountInfoSync){var i=wx.getAccountInfoSync();i&&i.miniProgram&&i.miniProgram.appId&&(r.appId=i.miniProgram.appId)}return m(s(n.prototype),"load",this).call(this,t,r)}}]),n}());App.zhuge=ve;export default ve;
|
package/dist/zhuge.min.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
var regeneratorRuntime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},i=u.iterator||"@@iterator",o=u.asyncIterator||"@@asyncIterator",a=u.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var u=t&&t.prototype instanceof v?t:v,i=Object.create(u.prototype),o=new R(n||[]);return i._invoke=function(e,t,r){var n=l;return function(u,i){if(n===h)throw new Error("Generator is already running");if(n===f){if("throw"===u)throw i;return C()}for(r.method=u,r.arg=i;;){var o=r.delegate;if(o){var a=O(o,r);if(a){if(a===p)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=m(e,t,r);if("normal"===s.type){if(n=r.done?f:d,s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=f,r.method="throw",r.arg=s.arg)}}}(e,r,o),i}function m(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",d="suspendedYield",h="executing",f="completed",p={};function v(){}function _(){}function g(){}var y={};y[i]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w(E([])));k&&k!==r&&n.call(k,i)&&(y=k);var b=g.prototype=v.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(u,i,o,a){var s=m(e[u],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,a)}),(function(e){r("throw",e,o,a)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,a)}))}a(s.arg)}var u;this._invoke=function(e,n){function i(){return new t((function(t,u){r(e,n,t,u)}))}return u=u?u.then(i,i):i()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var u=m(n,e.iterator,r.arg);if("throw"===u.type)return r.method="throw",r.arg=u.arg,r.delegate=null,p;var i=u.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function E(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var u=-1,o=function r(){for(;++u<e.length;)if(n.call(e,u))return r.value=e[u],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:C}}function C(){return{value:t,done:!0}}return _.prototype=b.constructor=g,g.constructor=_,_.displayName=s(g,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},x(S.prototype),S.prototype[o]=function(){return this},e.AsyncIterator=S,e.async=function(t,r,n,u,i){void 0===i&&(i=Promise);var o=new S(c(t,r,n,u),i);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(b),s(b,a,"Generator"),b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function u(n,u){return a.type="throw",a.arg=e,r.next=n,u&&(r.method="next",r.arg=t),!!u}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return u("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return u(o.catchLoc,!0);if(this.prev<o.finallyLoc)return u(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return u(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return u(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var u=this.tryEntries[r];if(u.tryLoc<=this.prev&&n.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var i=u;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var u=n.arg;P(r)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}({});!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).zhuge=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return s(this,r)}}function m(e,t,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(n){var u=Object.getOwnPropertyDescriptor(n,t);return u.get?u.get.call(r):u.value}})(e,t,r||e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,u=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){u=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(u)throw i}}return r}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
function p(e,t,r,n){var u,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(u=e[a])&&(o=(i<3?u(o):i>3?u(t,r,o):u(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function v(e,t,r,n){return new(r||(r=Promise))((function(u,i){function o(e){try{s(n.next(e))}catch(e){i(e)}}function a(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?u(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}s((n=n.apply(e,t||[])).next())}))}var _,g={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(e){return null==e},type:function(e){return Object.prototype.toString.call(e)},isObject:function(e){return"[object Object]"===this.type(e)},isArray:function(e){return"[object Array]"===this.type(e)},isString:function(e){return"[object String]"===this.type(e)},isNumber:function(e){return"[object Number]"===this.type(e)},isDate:function(e){return"[object Date]"===this.type(e)},isFunction:function(e){return"[object Function]"===this.type(e)},jsJSON:function(e){try{return JSON.parse(e),!0}catch(e){return!1}},isEmpty:function(e){return Array.isArray(e)||"string"==typeof e||e instanceof String?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"[object Object]"===Object.prototype.toString.call(e)&&0===Object.keys(e).length},merge:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return Object.keys(r).forEach((function(n){Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=Array.from(new Set(t[n].concat(r[n]))):e.isObject(t[n])&&e.isObject(r[n])?t[n]=e.merge(t[n],r[n]):t[n]=r[n]})),t}),{})},UUID:function(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},clone:function(t){var r=function(e){var t=e.constructor;switch(n(e)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new t(e);case"RegExp":return i(e);case"Symbol":return u(e);case"Function":return e;default:return null}},n=function(e){return Object.prototype.toString.call(e).slice(8,-1)},u=function(e){return Object(Symbol.prototype.valueOf.call(e))},i=function(e){var t=new e.constructor(e.source,/\w*$/.exec(e));return t.lastIndex=e.lastIndex,t},o=function(e,t){for(var r=-1,n=e.length;++r<n;)t(e[r],r);return e},a=function t(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(u)||null===u)return u;var a=n(u),s=null;return i.get(u)?i.get(u):(i.set(u,s),"Set"!==a&&"Map"!==a&&"Array"!==a&&"Object"!==a?r(u):"Set"===a?(s=new Set,u.forEach((function(e){s.add(t(e,i))})),s):"Map"===a?(s=new Map,u.forEach((function(e,r){s.set(r,t(e,i))})),s):("Array"===a&&(s=new Array,o(u,(function(e,r){s[r]=t(e,i)}))),"Object"===a&&(s=new Object,o(Object.keys(u),(function(e){s[e]=t(u[e],i)}))),s))};return a(t)},parseQuery:function(e){if(this.isEmpty(e))return"";var t=[];for(var r in e)t.push("".concat(r,"=").concat(decodeURIComponent(e[r])));return t.join("&")},getTimezone:function(e){return 6e4*-e.getTimezoneOffset()},encode:function(e){var t={};for(var r in e)t["_"+r]=e[r];return t},isEqual:function(e,t){if(this.type(e)!==this.type(t))return!1;var r=!0;for(var n in e)e[n]!==t[n]&&(r=!1);return r},getUtmByQuery:function(e){var t={};for(var r in e)this.utmKeys.includes(r)&&(t[r]=e[r]);return t},filterUtm:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var u in e)t.indexOf(u)>-1&&(r=!0,n[u]=e[u]);return r?n:null},deleteQueryParams:function(e,t){var r=e.split("&"),n=[];return r.forEach((function(e){var r=new RegExp(t+"=.*"),u="";r.test(e)?(u=e.replace(r,""))&&n.push(u):n.push(e)})),n.join("&")},addUrlParam:function(e,t){var r=e,n="";for(var u in t)n&&(n+="&"),r=this.deleteQueryParams(r,u),n+=u+"="+t[u];var i=r.split("?");return i.length>1?i[1]?i[1]=n+"&"+i[1]:i[1]=n:1===i.length&&i.push(n),i.join("?")},getCurrentPage:function(){var e=getCurrentPages();return e[e.length-1]},wxGetTitle:function(e){var t,r,n,u="";e.data&&e.data.title&&e.data.title.length>0&&(u=Array.isArray(e.data.title)?e.data.title.join(" "):e.data.title);try{if(!u.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(t){t.pagePath==="".concat(e.route,".html")&&t.text&&(u=t.text)})),!u.length)){var i=__wxConfig.page[e.route]||__wxConfig.page["".concat(e.route,".html")];u=i?null===(t=i.window)||void 0===t?void 0:t.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(e){}return u||e.route}},y=function(){function e(r,n){t(this,e),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=n,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=r}return n(e,[{key:"generateRequestData",value:function(){var e=new Date,t={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(e.getFullYear(),"-").concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()),tz:g.getTimezone(e),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:d(this.catch)}),_:e.getTime()+""};return this.catch=[],t}},{key:"clear",value:function(){if(this.catch.length){var e=this.generateRequestData();this.requestFunction(this.url,e,{timeout:this.requestTimeout})}}},{key:"send",value:function(e){var t=this;if(this.catch.push(e),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){t.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(e,n){var u,i=!1;u=setTimeout((function(){i=!0,e(null)}),t.timeout),t.requestFunction(t.url,r,{timeout:t.requestTimeout}).then((function(t){i||(clearTimeout(u),e(t))})).catch((function(e){n(e)}))}))}}}]),e}(),w=function(){function e(r,n,u){t(this,e),this.storageFunction=r,this.allData=u||{},this.allData.did||this.set("did",n.config.did||g.UUID()),this.allData.cuid||this.set("cuid",void 0),g.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return n(e,[{key:"get",value:function(e){return this.allData[e]}},{key:"set",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.allData[e]=t,r.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return r.stop()}}),r,this)})))}}]),e}();!function(e){var t,r,n,u,i,o;(t=e.EventType||(e.EventType={})).connected="connected",t.disconnected="disconnected",t.error="error",t.offline="offline",t.exist="exist",t.online="online",(r=e.RequestType||(e.RequestType={}))[r.common=0]="common",r[r.ping=1]="ping",r[r.pong=2]="pong",r[r.normal=5]="normal",r[r.img=6]="img",(n=e.ResponseCode||(e.ResponseCode={}))[n.offline=109001]="offline",n[n.exist=109002]="exist",n[n.paramError=109005]="paramError",n[n.online=109006]="online",(u=e.SocketMsgOrigin||(e.SocketMsgOrigin={}))[u.xcx=1]="xcx",u[u.app=2]="app",u[u.web=3]="web",(i=e.VisualEndpointType||(e.VisualEndpointType={}))[i.xcx=1]="xcx",(o=e.SocketMessageType||(e.SocketMessageType={})).update="update",o.xcxLogin="xcxLogin",o.eventInfo="eventInfo"}(_||(_={}));var k,b,x,S=_,O=function(){function e(r,n){t(this,e),this.listeners={},this.catch=[],this.showLog=!1,this.url=r,this.params=n,this.open()}return n(e,[{key:"emit",value:function(e,t){var r;if(this.log("info","emit message",[e,t]),!this.client)return this.log("info","缓存消息",[e,t]),void this.catch.push([e,t]);switch(null===(r=this.client)||void 0===r?void 0:r.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[e,t]),this.catch.push([e,t])}}},{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"onConnected",value:function(e){this.on(S.EventType.connected,e)}},{key:"onDisconnected",value:function(e){this.on(S.EventType.disconnected,e)}},{key:"onError",value:function(e){this.on(S.EventType.error,e)}},{key:"send",value:function(e){var t;null===(t=this.client)||void 0===t||t.send({data:JSON.stringify(e)})}},{key:"_onError",value:function(e){var t;this.log("error","socket连接异常",e),null===(t=this.listeners.error)||void 0===t||t.forEach((function(t){t.call(void 0,e)}))}},{key:"_onClose",value:function(e){var t;this.log("error","socket连接已关闭"),null===(t=this.listeners.disconnected)||void 0===t||t.forEach((function(e){e.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(e){var t,r=this;this.log("info","socket连接成功",e),null===(t=this.listeners.connected)||void 0===t||t.forEach((function(e){e.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(e){var t=l(e,2),n=t[0],u=t[1];r.emit(n,u)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(e){var t,r,n;if(""!==e.data){var u=JSON.parse(e.data);if(u.code)switch(Number(u.code)){case S.ResponseCode.offline:null===(t=this.listeners[S.EventType.offline])||void 0===t||t.forEach((function(e){e.call(void 0,u)}));break;case S.ResponseCode.online:null===(r=this.listeners[S.EventType.online])||void 0===r||r.forEach((function(e){e.call(void 0,u)}));break;case S.ResponseCode.exist:null===(n=this.listeners[S.EventType.exist])||void 0===n||n.forEach((function(e){e.call(void 0,u)}));break;case S.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(u.type===S.RequestType.pong)return;var i=u.data;this.listeners[i.event]&&this.listeners[i.event].forEach((function(e){e.call(void 0,i.payload)}))}}}},{key:"ping",value:function(){var e=this;this.pingTimer=setInterval((function(){e.send({type:S.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(e,t){var r=this;t?this.listeners[e].forEach((function(n,u){n===t&&r.listeners[e].splice(u,1)})):this.listeners[e]=[]}},{key:"open",value:function(){var e,t,r=this;this.client&&this.close();var n=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(e=this.params)||void 0===e?void 0:e.socketToken,"&appId=").concat(null===(t=this.params)||void 0===t?void 0:t.appId,"&origin=").concat(S.SocketMsgOrigin.xcx)});n.onMessage((function(e){r.onMessage(e)})),n.onError((function(e){r._onError(e)})),n.onClose((function(e){r._onClose(e)})),n.onOpen((function(e){r._onOpen(e)})),this.client=n}},{key:"close",value:function(){var e;null===(e=this.client)||void 0===e||e.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];this.showLog&&(t=console).log.apply(t,["%c【socketClient】:".concat(e),"color: ".concat("error"===e?"red":"#1890ff")].concat(n))}},{key:"openLog",value:function(e){this.showLog=e}}]),e}(),T=function(e,t,r){return new Promise((function(n,i){var o;wx.request((u(o={url:e,data:t,method:(null==r?void 0:r.method)||"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":(null==r?void 0:r.contentType)||"application/x-www-form-urlencoded"}),u(o,"dataType","json"),u(o,"responseType",null!=(null==r?void 0:r.responseType)?null==r?void 0:r.responseType:"arraybuffer"),u(o,"success",(function(e){n(e)})),u(o,"fail",(function(e){i(e)})),o))}))},P=function(){function e(r){t(this,e),this.pagePathJudge=function(e,t){return-1!==t.pagePath.indexOf("*")?-1!==e.pr.$page_url.indexOf(t.pagePath.split("*")[0]):t.pagePath===e.pr.$page_url.split("?")[0]},this.tracker=r,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return n(e,[{key:"init",value:function(){var e=this;this.socket&&this.socket.destroy(),this.socket=new O(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){e.getVisualData()})),this.socket.on("connected",(function(){null===e.socketUserInfo?wx.getSystemInfo({success:function(t){var r=t.model,n=t.system,u=t.version;wx.getUserInfo({success:function(t){var i=t.userInfo.nickName,o=t.userInfo.avatarUrl,a={model:r,system:n,version:u,nickName:i,avatarUrl:o,programId:e.tracker.config.appId};e.socketUserInfo=a,e.sendUserInfo(a)}})}}):e.sendUserInfo(e.socketUserInfo)}))}},{key:"getVisualData",value:function(){var e=this;T("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:S.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(t){t.data&&t.data.data&&(e.visualData=t.data.data)}))}},{key:"sendUserInfo",value:function(e){var t;this.socketState=!0,null===(t=this.socket)||void 0===t||t.send({type:S.RequestType.normal,data:{event:S.SocketMessageType.xcxLogin,payload:{userInfo:e}}})}},{key:"send",value:function(e){var t;this.socketState&&(null===(t=this.socket)||void 0===t||t.send({type:S.RequestType.normal,data:{event:S.SocketMessageType.eventInfo,payload:e}}))}},{key:"event",value:function(e){var t;return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,u,i,o=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===(t=this.tracker)||void 0===t?void 0:t.config.visual){r.next=2;break}return r.abrupt("return");case 2:"abp"!==e.dt||"pv"!==e.pr.$eid&&"click"!==e.pr.$eid?"evt"===e.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},e),{eventType:"evt"})):(n=g.clone(e),u=!1,this.visualData.map((function(t){var r,i;if("click"===e.pr.$eid){var a=[],s=g.jsJSON(t.elementConditions)?JSON.parse(t.elementConditions):{};for(var c in s)a.push(s[c]===e.pr[c]);a.push(o.pagePathJudge(e,t)),-1===a.indexOf(!1)&&"click"===t.eventType&&(n.dt="evt",n.pr.$eid=t.eventName,u=!0,o.vRQC?o.send(Object.assign(Object.assign({},n),{visual:t})):null===(r=o.tracker)||void 0===r||r.send(n))}else"pv"===t.eventType&&o.pagePathJudge(e,t)&&(n.dt="evt",n.pr.$eid=t.eventName,u=!0,o.vRQC?o.send(Object.assign(Object.assign({},n),{visual:t})):null===(i=o.tracker)||void 0===i||i.send(n))})),this.vRQC&&!u&&(i="click"===e.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},e),{eventType:i}))));case 3:case"end":return r.stop()}}),r,this)})))}}]),e}();function R(e,t,r){var n=r.value;return r.value=function(){for(var e=arguments.length,r=new Array(e),u=0;u<e;u++)r[u]=arguments[u];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:t,args:r})},r}var E=function(){function e(r,n,u){t(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,b=r,k=n,x=u,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new P(this)}return n(e,[{key:"load",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.appKey=e,this.config=g.merge(this.config,t||{}),r.prev=2,r.next=5,k.get();case 5:if((n=r.sent)&&n.did){r.next=10;break}return r.next=9,k.getDid();case 9:n.did=r.sent;case 10:this.storage=new w(k,this,n),this.request=new y(b,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(2),console.error("sdk初始化失败,缓存读取失败",r.t0);case 20:case"end":return r.stop()}}),r,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(e){var t=this.storage.allData.utm;if(t)for(var r in t)t[r]&&(e.pr["$".concat(r)]=t[r]);return this.request.send(e)}},{key:"trackBaseData",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,t.t0=e,t.t1=r.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=g.getTimezone(r),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=x.os(),t.t9=x.ov(),t.t10=x.version(),t.next=14,x.mnet();case 14:return t.t11=t.sent,t.next=17,x.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15,$page_url:""},(n={dt:"evt",pr:t.t16}).pr=g.merge(n.pr,g.encode(this.config.superProperty)),t.abrupt("return",n);case 25:case"end":return t.stop()}}),t,this)})))}},{key:"environmentInfo",value:function(){var e=new Date,t={dt:"pl",pr:{$rs:"".concat(x.windowWidth(),"x").concat(x.windowHeight()),$tz:g.getTimezone(e),$ct:e.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();t.pr.$dv=r.model,t.pr.$br=r.brand}else delete t.pr.$dv,delete t.pr.$br;this.send(t)}},{key:"sessionEnd",value:function(e){var t=new Date,r=e.update-e.sid,n={dt:"se",pr:{$ct:e.update,$cn:this.cn,$tz:g.getTimezone(t),$dru:r,$sid:e.sid,$cuid:e.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,u,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Date,r=this.storage.allData,n=r.sid,u=r.cuid,e.t0=n,e.t1=n,e.t2=u,e.t3=this.cn,e.t4=g.getTimezone(t),e.t5=this.currentPage.url,e.t6=this.prevPage.url,e.t7=x.os(),e.t8=x.ov(),e.t9=x.version(),e.next=14,x.mnet();case 14:return e.t10=e.sent,e.next=17,x.net();case 17:e.t11=e.sent,e.t12=this.config.vn,e.t13=this.referrerDomain,e.t14=this.config.appId,e.t15={$ct:e.t0,$sid:e.t1,$cuid:e.t2,$cn:e.t3,$tz:e.t4,$url:e.t5,$ref:e.t6,$os:e.t7,$ov:e.t8,$wv:e.t9,$mnet:e.t10,$net:e.t11,$vn:e.t12,$referrer_domain:e.t13,$wxeid:e.t14},i={dt:"ss",pr:e.t15},this.config.utm&&!g.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(i),this.environmentInfo();case 26:case"end":return e.stop()}}),e,this)})))}},{key:"updateSession",value:function(e){var t=this.storage.allData,r=Date.now();if(t.sid&&t.update)if(r-t.update>this.config.timeout){var n=g.clone(t);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,u,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:for(i in r=t.sent,n={},u=["id","content","type","style","selector","link"],e.target.dataset)-1===u.indexOf(i)&&(n["_".concat(i)]=e.target.dataset[i]);return o=e.target,r.dt="abp",r.pr=g.merge(r.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:o.dataset.id||"",$element_content:o.dataset.content||"",$element_type:o.dataset.type||"",$element_style:o.dataset.style||"",$element_selector:o.dataset.selector||"",$element_link:o.dataset.link||""},n,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=14,this.send(r);case 14:return t.next=16,this.visual.event(r);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"pv",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(r=t.sent).dt="abp",r.pr=g.merge(r.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},e||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=10,this.send(r);case 10:return t.next=12,this.visual.event(r);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"duration",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.config.duration){e.next=2;break}return e.abrupt("return");case 2:return this.updateSession("duration"),g.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),t=this.currentPage.time-this.prevPage.time,e.next=7,this.trackBaseData("dr");case 7:return(r=e.sent).dt="abp",r.pr=g.merge(r.pr,{$dr:t,$url:this.prevPage.url,$title:this.prevPage.title}),e.next=12,this.send(r);case 12:g.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return e.stop()}}),e,this)})))}},{key:"track",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.updateSession("track"),r.next=3,this.trackBaseData(e);case 3:return(n=r.sent).pr=g.merge(n.pr,g.encode(t),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),r.next=7,this.send(n);case 7:return r.next=9,this.visual.event(n);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"identify",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),n=new Date,(u={dt:"usr",pr:{$ct:n.getTime(),$tz:g.getTimezone(n),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=g.merge(u.pr,g.encode(t)),r.next=7,this.trackBaseData("usr");case 7:return r.next=9,this.send(u);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"setPushClient",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=new Date,u={dt:"um",pr:{$ct:n.getTime(),$tz:g.getTimezone(n),$push_ch:t||"getui",$push_id:e}},r.next=4,this.trackBaseData("usr");case 4:return r.next=6,this.send(u);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"trackCount",value:function(e,t){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=e,this.previousCountEvent.props=g.clone(t)),this.previousCountEvent.name===e&&g.isEqual(this.previousCountEvent.props,t)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=e,this.previousCountEvent.props=g.clone(t),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(e,t,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,t,r){return v(this,void 0,void 0,regeneratorRuntime.mark((function n(){var u,i,o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.updateSession("track count"),u=Date.now()-this.countStartTime,r&&(u-=this.config.countDuration),i=this.count,this.count=r?0:1,n.next=7,this.trackBaseData(e);case 7:return o=n.sent,a={},g.isObject(t)&&(a=g.clone(t)),o.pr=g.merge(o.pr,g.encode(a),g.encode({count:i,countTime:u})),n.next=13,this.send(o);case 13:case"end":return n.stop()}}),n,this)})))}},{key:"trackRevenue",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,u,i,o,a,s,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=function(e,t){var r=0;try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(e){console.error(e)}try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(e){console.error(e)}return Number(e.toString().replace(".",""))*Number(t.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),t.next=4,this.trackBaseData("revenue");case 4:(r=t.sent).dt="abp",(n=g.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=u(n.price,n.productQuantity),i=["productID","revenueType"],o=["price","total","productQuantity"],a={},t.t0=regeneratorRuntime.keys(n);case 12:if((t.t1=t.t0()).done){t.next=21;break}if(s=t.t1.value,-1!==i.indexOf(s)||-1!==o.indexOf(s)){t.next=16;break}return t.abrupt("continue",12);case 16:c=n[s],o.indexOf(s)>-1&&((c=Number(c))||(c=0)),a["$"+s]=c,t.next=12;break;case 21:return r.pr=g.merge(r.pr,a),t.next=24,this.send(r);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"setUtm",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(r=g.filterUtm(e))&&(this.storage.set("utm",r),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"setSuperProperty",value:function(e){g.isObject(e)&&(this.config.superProperty=e)}},{key:"extendSuperPropertys",value:function(e){g.isObject(e)&&(this.config.superProperty=g.merge(this.config.superProperty,e))}},{key:"removeSuperProperty",value:function(e){var t,r=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=h(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,u=function(){};return{s:u,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;delete this.config.superProperty[n]}}catch(e){r.e(e)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();p([R],E.prototype,"environmentInfo",null),p([R],E.prototype,"sessionEnd",null),p([R],E.prototype,"sessionStart",null),p([R],E.prototype,"updateSession",null),p([R],E.prototype,"click",null),p([R],E.prototype,"pv",null),p([R],E.prototype,"duration",null),p([R],E.prototype,"track",null),p([R],E.prototype,"identify",null),p([R],E.prototype,"setPushClient",null),p([R],E.prototype,"trackCount",null),p([R],E.prototype,"trackRevenue",null),p([R],E.prototype,"setUtm",null);var C=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],$=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],D=function(e){return g.wxGetTitle(e)},j={did:null,getDid:function(){return new Promise((function(e,t){wx.getStorage({key:"zg-did",success:function(t){e(t.data||""),wx.removeStorage({key:"zg-did"})},fail:function(t){e("")}})}))},get:function(){return new Promise((function(e,t){wx.getStorage({key:"zg",success:function(t){e(t.data||{})},fail:function(t){e({})}})}))},set:function(e,t){return new Promise((function(r,n){wx.setStorage({key:e,data:t,success:r,fail:n})}))}},I=!1,L=wx.getSystemInfoSync(),A=L.system.split(/\s/),z={os:A[0],ov:A[1],version:L.version,windowHeight:L.windowHeight,windowWidth:L.windowWidth,net:0,mnet:0};function N(e){var t=e.toLowerCase();"wifi"===t?(z.net=1,z.mnet=0):(z.net=0,z.mnet={"2g":1,"3g":3,"4g":13}[t]||0)}function U(e){return new Promise((function(t,r){if(I)return t(z[e]);wx.getNetworkType({success:function(r){I=!0,N(r.networkType),t(z[e])}})}))}wx.onNetworkStatusChange((function(e){N(e.networkType)}));var q,M,F={os:function(){return z.os},ov:function(){return z.ov},version:function(){return z.version},net:function(){return U("net")},mnet:function(){return U("mnet")},windowWidth:function(){return z.windowWidth},windowHeight:function(){return z.windowHeight}},B=App,Q=Page,W=Component,H=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function G(e,t,r){if(e[r]&&g.isFunction(e[r])){var n=e[r];e[r]=function(){n.apply(this,arguments),t[r].apply(this,arguments)}}else e[r]=function(){t[r].apply(this,arguments)}}function J(e,t,r){var n=e[t];e[t]=function(){var e=arguments[0];if(q===e||e&&q&&q.timeStamp===e.timeStamp)return n.apply(this,arguments);if(q=e,e){var t=e.type;"tap"===t&&r.click(e)}return n.apply(this,arguments)}}var K=function(e){i(u,e);var r=c(u);function u(e){var n;return t(this,u),(n=r.call(this,T,j,F)).openData={path:"",props:{}},n.shared=!1,n.semiAutoTrackEventCatch={},n.isShareOperation=!1,M=e,n.initLifeCycleHook(),n}return n(u,[{key:"initLifeCycleHook",value:function(){var e,t=this,r=(e=t,{App:{onLaunch:function(t){e.config.visual&&e.visual.getVisualData()},onShow:function(t){e.sceneToUtm(t),e.openOptions=t,e.updateSession("appOnShow")},onHide:function(){e.flush(),e.config.duration&&!e.isShareOperation&&(e.pageReady=!0,e.currentPage.time=Date.now(),e.duration().then((function(){e.pageReady=!1,e.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(t){(null==t?void 0:t.scene)&&-1!==decodeURIComponent(t.scene).indexOf("vRQC")&&e.config.visual&&(e.visual.vRQC=decodeURIComponent(t.scene).split("vRQC=")[1],e.visual.init()),e.currentPage.query=g.parseQuery(t),e.currentPage.queryObj=t},onShow:function(){var t=getCurrentPages(),r=t[t.length-1];e.currentPage.route=r.__route__||r.route,e.currentPage.time=Date.now(),e.currentPage.url="".concat(e.currentPage.route);var n=D;if(e.currentPage.title="function"==typeof n?n(r):"",e.currentPage.query&&(e.currentPage.url+="?".concat(e.currentPage.query)),e.pageReady=!0,e.freeBuffer(),e.currentPage.url!==e.prevPage.url){""!==e.prevPage.url&&e.duration();try{e.trackOpenShare(e.openOptions)}catch(t){console.warn(t,"".concat(e.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}e.pv()}e.startObserveMarkElement(r),e.openOptions=null,e.isShareOperation=!1},onHide:function(){e.semiAutoTrackEventCatch={},e.prevPage=g.clone(e.currentPage),e.pageReady=!1,e.flush()},onUnload:function(){e.semiAutoTrackEventCatch={},e.prevPage=g.clone(e.currentPage),e.pageReady=!1,e.flush()}}});this.lifecycle=r;var n=function(e){for(var n in r.App)G(e,r.App,n);for(var u in e)!C.includes(u)&&g.isFunction(e[u])&&J(e,u,t);return B(e)};for(var u in App)n[u]=App[u];App=n;var i=function(e){for(var n in r.Page)G(e,r.Page,n);for(var u in e)!$.includes(u)&&g.isFunction(e[u])&&"onShareAppMessage"!==u&&J(e,u,t);var i=e.onShareAppMessage;return g.isFunction(i)&&(e.onShareAppMessage=t.onShareAppMessage(i)),Q(e)};for(var o in Page)i[o]=Page[o];Page=i,Component=function(e){if(void 0!==e.methods)for(var r in e.methods)J(e.methods,r,t);return W(e)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=t}},{key:"load",value:function(e,t){return m(o(u.prototype),"load",this).call(this,e,t)}},{key:"pv",value:function(e){var t=this,r=Object.create(null,{pv:{get:function(){return m(o(u.prototype),"pv",t)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},n=g.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(t.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(t.$share_level=Number(this.openOptions.query.zg_share_level)),n.data&&n.data.zg_share_data&&(t=g.merge(t,g.encode(n.data.zg_share_data)))),e.next=5,r.pv.call(this,t);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"click",value:function(e){var t=this,r=Object.create(null,{click:{get:function(){return m(o(u.prototype),"click",t)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.click.call(this,e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"sceneToUtm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=g.getUtmByQuery(e.query);if(this.config.parseScene&&e.scene&&M){var r=e.scene;this.cn=r+"";var n=M[r],u={},i=null,o=M.isShare(r);if(o&&e.referrerInfo&&(i=e.referrerInfo.appId),n){u={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:i};var a=e.query||{};M.isCartShare(r)&&a.zg_uid&&a.zg_share_id&&(u.utm_term=a.zg_uid,u.utm_content=a.zg_share_id)}t=g.merge(u,t)}this.utmCatch=t,"fresh"===this.config.utmMode&&g.isEmpty(this.config.utm)&&this.storage.set("utm",t)}},{key:"trackOpenShare",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,u,i,o,a,s,c,m,l,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(r=e.query||{},n=this.currentPage.route,!(M.isCartShare(e.scene)&&r.zg_uid&&r.zg_share_id)){t.next=24;break}for(o in u={$uid:r.zg_uid,$share_id:r.zg_share_id,$title:this.currentPage.title,$path:n,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(r.zg_share_level)},this.shareId=r.zg_share_id,this.shareLevel=Number(r.zg_share_level),i={},r)a=o.replace(/^zg_/,""),-1===H.indexOf(a)&&/^zg_/.test(o)&&(i[a]=r[o]);if(s=this.config.shareToUtm,g.isObject(s)&&!g.isEmpty(s)){for(m in c={},s)null!==i[m]&&void 0!==i[m]&&(l=s[m],c[l]=i[m]);g.isEmpty(c)||(c.utm_campaign||(c.utm_campaign="分享打开"),this.setUtm(c))}return this.openData={path:n,props:i},u=g.merge(u,g.encode(i)),t.next=19,this.trackBaseData("wxsopen");case 19:return(d=t.sent).dt="abp",d.pr=g.merge(d.pr,u),t.next=24,this.send(d);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"onShareAppMessage",value:function(e){var t=this;return function(){t.isShareOperation=!0;var r=e.apply(this,arguments)||{};if(!t.config.forwardShare)return r;r.path=r.path||t.currentPage.url;var n=r.title||t.currentPage.title,u=r.path.split("?")[0],i=this.data.zg_share_data,o=(new Date).getTime(),a=1;!this.data.newShare&&t.openData&&t.openData.path===u&&g.isEqual(i||{},t.openData.props)&&(o=t.shareId,a=t.shareLevel+1);var s={share_id:o,uid:t.storage.allData.cuid||t.storage.allData.did,share_level:a},c={$share_title:n,$title:t.currentPage.title||"",$path:u},m={};for(var l in s)c["$".concat(l)]=m["zg_".concat(l)]=s[l];for(var d in i)-1===H.indexOf(d)&&(c["_".concat(d)]=m["zg_".concat(d)]=i[d]);return r.path=g.addUrlParam(r.path,m),t.trackBaseData("wxshare").then((function(e){e.dt="abp",e.pr=g.merge(e.pr,c),t.request.send(e)})),t.shared=!0,r}}},{key:"startObserveMarkElement",value:function(e){var t=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),e.isComponent?this.elementObserver=e.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(e,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(e){if(e.intersectionRatio>0){var r,n=t.getEventDataFromDataset(e.dataset);(r=m(o(u.prototype),"track",t)).call.apply(r,[t].concat(d(n)))}})))}},{key:"getEventDataFromDataset",value:function(e){var t={},r="";for(var n in e){if(n.startsWith("expo"))if("expoName"===n)r=e[n];else t[n.replace(/^expo(.*)/,(function(e,t,r,n){return t.replace(t[0],t[0].toLocaleLowerCase())}))]=e[n]}return[r,t]}}]),u}(E);p([R],K.prototype,"sceneToUtm",null),p([R],K.prototype,"trackOpenShare",null);var V={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1103:{utm_source:"发现小程序",utm_medium:"发现栏 - 小程序 - 我的小程序"},1104:{utm_source:"任务栏",utm_medium:"任务栏 - 我的小程序"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1200:{utm_source:"打开小程序",utm_medium:"视频号广告打开小程序"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},1217:{utm_source:"打开小程序",utm_medium:"蓝牙设备后台唤醒小程序"},1218:{utm_source:"打开小程序",utm_medium:"微信键盘预览打开小程序"},1219:{utm_source:"打开小游戏",utm_medium:"视频号直播间小游戏一键上车"},1220:{utm_source:"打开小程序",utm_medium:"发现页设备卡片打开小程序"},1223:{utm_source:"打开小程序",utm_medium:"安卓桌面Widget打开小程序"},1224:{utm_source:"打开小程序",utm_medium:"小程序商家助手功能打开小程序"},1225:{utm_source:"打开小程序",utm_medium:"音视频通话打开小程序"},1226:{utm_source:"打开小程序",utm_medium:"聊天消息在设备打开后打开小程序"},1228:{utm_source:"打开小程序",utm_medium:"视频号原生广告组件打开小程序"},1230:{utm_source:"打开小程序",utm_medium:"订阅号H5广告进入小程序"},1231:{utm_source:"打开小程序",utm_medium:"动态消息提醒入口打开小程序"},1232:{utm_source:"打开小程序",utm_medium:"搜一搜竞价广告打开小程序"},1233:{utm_source:"打开小游戏",utm_medium:"小程序搜索页人气游戏模块打开小游戏"},1238:{utm_source:"打开小程序",utm_medium:"看一看信息流广告打开小程序"},1239:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间气泡浮窗打开小游戏"},1242:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块频道页进入小程序"},1243:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块商品聚合页进入小程序"},1244:{utm_source:"打开小程序",utm_medium:"#tag搜索结果页打开小程序"},1245:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送搜索结果页进入小程序"},1248:{utm_source:"打开小程序",utm_medium:"通过小程序账号迁移进入小程序"},1252:{utm_source:"打开小程序",utm_medium:"搜一搜小程序搜索页「小功能」模块进入小程序"},1254:{utm_source:"打开小程序",utm_medium:"发现页「动态」卡片 打开小程序"},1255:{utm_source:"打开小程序",utm_medium:"发现页「我的」卡片 打开小程序"},1256:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「最近使用」列表"},1257:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「我的小程序」列表"},1258:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「为电脑端优化」模块"},1259:{utm_source:"打开小游戏",utm_medium:"pc端小程序面板「小游戏专区」模块"},1260:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「推荐在电脑端使用」列表"},1261:{utm_source:"打开商品卡片",utm_medium:"公众号返佣商品卡片"},1265:{utm_source:"打开小程序",utm_medium:"小程序图片详情页打开小程序"},1266:{utm_source:"打开小程序",utm_medium:"小程序图片长按半屏入口打开小程序"},1267:{utm_source:"打开小程序",utm_medium:"小程序图片会话角标打开小程序"},1271:{utm_source:"打开小程序",utm_medium:"微信聊天主界面下拉,「我的常用小程序」栏"},1272:{utm_source:"打开小程序",utm_medium:"发现页「游戏」服务tab打开小程序"},1273:{utm_source:"打开小程序",utm_medium:"发现页「常用的小程序」列表"},1274:{utm_source:"打开小程序",utm_medium:"优量汇广告打开小程序"},1275:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片打开小程序"},1276:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片二级聚合页打开小程序"},1277:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片搜索结果页打开小程序"},1278:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」列表打开小程序"},1279:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」合集页打开小程序"},1280:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「建议使用」打开小程序"},1281:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开小程序"},1282:{utm_source:"打开小程序",utm_medium:"听一听播放器打开小程序"},1285:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」短剧合集打开小程序"},1286:{utm_source:"打开小程序",utm_medium:"明文scheme打开小程序"},1287:{utm_source:"打开小程序",utm_medium:"公众号短剧贴片打开小程序"},1292:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」poi 详情页打开小程序"},1293:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片追剧页打开小程序"},1295:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」广告打开小程序"},1296:{utm_source:"打开小程序",utm_medium:"视频号付费短剧气泡打开小程序"},1297:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开小程序"},1298:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开的合集访问小程序"},1299:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」poi 详情页打开小程序"},1300:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开的合集访问小程序"},1301:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」poi 详情页打开小程序"},1302:{utm_source:"打开小程序",utm_medium:"PC端面板「发现小程序」"},1303:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片视频流打开小程序"},1304:{utm_source:"打开小程序",utm_medium:"手机负一屏打开小程序(比如oppo手机)"},1305:{utm_source:"打开小程序",utm_medium:"公众号播放结束页打开小程序"},1306:{utm_source:"打开小程序",utm_medium:"公众号短剧固定选集入口打开小程序"},1307:{utm_source:"打开小程序",utm_medium:"发现页附近服务境外专区打开小程序"},1308:{utm_source:"打开小游戏",utm_medium:"PC端面板小游戏专区页面"},1311:{utm_source:"打开小游戏",utm_medium:"公众号文章打开小游戏CPS卡片"},1313:{utm_source:"打开小程序",utm_medium:"PC OpenSDK打开小程序"},1325:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的表情包消息角标打开小程序"},1326:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的角标打开小程序"},1327:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息角标打开小程序"},1328:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息超链接打开小程序"},1336:{utm_source:"打开小程序",utm_medium:"小店打开小程序关联会员身份"},1337:{utm_source:"打开小程序",utm_medium:"小店确认订单页跳小程序使用会员权益"},1340:{utm_source:"打开小程序",utm_medium:"小程序profile-热门商品入口打开小程序"},isShare:function(e){return[1096].includes(e)},isCartShare:function(e){return[1007,1008,1036,1044].includes(e)}},Y=new(function(e){i(u,e);var r=c(u);function u(){return t(this,u),r.call(this,V)}return n(u,[{key:"load",value:function(e,t){var r=t||{};if(wx.getAccountInfoSync){var n=wx.getAccountInfoSync();n&&n.miniProgram&&n.miniProgram.appId&&(r.appId=n.miniProgram.appId)}return m(o(u.prototype),"load",this).call(this,e,r)}}]),u}(K));return App.zhuge=Y,Y}));
|
|
1
|
+
var regeneratorRuntime=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),u=new D(n||[]);return o._invoke=function(t,e,r){var n=m;return function(i,o){if(n===l)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var s=S(u,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===m)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var a=h(t,e,r);if("normal"===a.type){if(n=r.done?p:f,a.arg===d)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n=p,r.method="throw",r.arg=a.arg)}}}(t,r,u),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var m="suspendedStart",f="suspendedYield",l="executing",p="completed",d={};function v(){}function g(){}function y(){}var _={};_[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(P([])));b&&b!==r&&n.call(b,o)&&(_=b);var T=y.prototype=v.prototype=Object.create(_);function x(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(i,o,u,s){var a=h(t[i],t,o);if("throw"!==a.type){var c=a.arg,m=c.value;return m&&"object"==typeof m&&n.call(m,"__await")?e.resolve(m.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(m).then((function(t){c.value=t,u(c)}),(function(t){return r("throw",t,u,s)}))}s(a.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function S(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=h(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function P(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return u.next=u}}return{next:O}}function O(){return{value:e,done:!0}}return g.prototype=T.constructor=y,y.constructor=g,g.displayName=a(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,a(t,s,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},x(k.prototype),k.prototype[u]=function(){return this},t.AsyncIterator=k,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new k(c(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},x(T),a(T,s,"Generator"),T[o]=function(){return this},T.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var a=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}({});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).zhuge=e()}(this,(function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function h(t,e,r){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(n=(u=s.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(e,r,n,i){var o,u=arguments.length,s=u<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,n):i;if("object"===("undefined"==typeof Reflect?"undefined":t(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(u<3?o(s):u>3?o(r,n,s):o(r,n))||s);return u>3&&s&&Object.defineProperty(r,n,s),s}function v(t,e,r,n){return new(r||(r=Promise))((function(i,o){function u(t){try{a(n.next(t))}catch(t){o(t)}}function s(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((n=n.apply(t,e||[])).next())}))}var g={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},jsJSON:function(t){try{return JSON.parse(t),!0}catch(t){return!1}},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=Array.from(new Set(e[n].concat(r[n]))):t.isObject(e[n])&&t.isObject(r[n])?e[n]=t.merge(e[n],r[n]):e[n]=r[n]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(e){var r=function(t){var e=t.constructor;switch(n(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return o(t);case"Symbol":return i(t);case"Function":return t;default:return null}},n=function(t){return Object.prototype.toString.call(t).slice(8,-1)},i=function(t){return Object(Symbol.prototype.valueOf.call(t))},o=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},u=function(t,e){for(var r=-1,n=t.length;++r<n;)e(t[r],r);return t},s=function e(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==t(i)||null===i)return i;var s=n(i),a=null;return o.get(i)?o.get(i):(o.set(i,a),"Set"!==s&&"Map"!==s&&"Array"!==s&&"Object"!==s?r(i):"Set"===s?(a=new Set,i.forEach((function(t){a.add(e(t,o))})),a):"Map"===s?(a=new Map,i.forEach((function(t,r){a.set(r,e(t,o))})),a):("Array"===s&&(a=new Array,u(i,(function(t,r){a[r]=e(t,o)}))),"Object"===s&&(a=new Object,u(Object.keys(i),(function(t){a[t]=e(i[t],o)}))),a))};return s(e)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var r in t)e.push("".concat(r,"=").concat(decodeURIComponent(t[r])));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var r in t)e["_"+r]=t[r];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var r=!0;for(var n in t)t[n]!==e[n]&&(r=!1);return r},getUtmByQuery:function(t){var e={};for(var r in t)this.utmKeys.includes(r)&&(e[r]=t[r]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var i in t)e.indexOf(i)>-1&&(r=!0,n[i]=t[i]);return r?n:null},deleteQueryParams:function(t,e){var r=t.split("&"),n=[];return r.forEach((function(t){var r=new RegExp(e+"=.*"),i="";r.test(t)?(i=t.replace(r,""))&&n.push(i):n.push(t)})),n.join("&")},addUrlParam:function(t,e){var r=t,n="";for(var i in e)n&&(n+="&"),r=this.deleteQueryParams(r,i),n+=i+"="+e[i];var o=r.split("?");return o.length>1?o[1]?o[1]=n+"&"+o[1]:o[1]=n:1===o.length&&o.push(n),o.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,r,n,i="";t.data&&t.data.title&&t.data.title.length>0&&(i=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!i.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(i=e.text)})),!i.length)){var o=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];i=o?null===(e=o.window)||void 0===e?void 0:e.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(t){}return i||t.route},randomAesKey:function(){for(var t="",e=0;e<32;e++){var r=Math.floor(16*Math.random());t+="0123456789abcdef".substring(r,r+1)}return t}},y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_={exports:{}};!function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function n(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var u=32767&e,s=e>>15;--o>=0;){var a=32767&this[t],c=this[t++]>>15,h=s*a+c*u;i=((a=u*a+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+s*c+(i>>>30),r[n++]=1073741823&a}return i},e=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var u=e*this[t++]+r[n]+i;i=Math.floor(u/67108864),r[n++]=67108863&u}return i},e=26):(r.prototype.am=function(t,e,r,n,i,o){for(var u=16383&e,s=e>>14;--o>=0;){var a=16383&this[t],c=this[t++]>>14,h=s*a+c*u;i=((a=u*a+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+s*c,r[n++]=268435455&a}return i},e=28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var o,u,s=new Array;for(o="0".charCodeAt(0),u=0;u<=9;++u)s[o++]=u;for(o="a".charCodeAt(0),u=10;u<36;++u)s[o++]=u;for(o="A".charCodeAt(0),u=10;u<36;++u)s[o++]=u;function a(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function c(t,e){var r=s[t.charCodeAt(e)];return null==r?-1:r}function h(t){var e=n();return e.fromInt(t),e}function m(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function f(t){this.m=t}function l(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function p(t,e){return t&e}function d(t,e){return t|e}function v(t,e){return t^e}function g(t,e){return t&~e}function y(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function b(t){return t}function T(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}f.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},f.prototype.revert=function(t){return t},f.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},l.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},l.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},l.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},l.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,u=0;--i>=0;){var s=8==n?255&t[i]:c(t,i);s<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==u?this[this.t++]=s:u+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-u)-1)<<u,this[this.t++]=s>>this.DB-u):this[this.t-1]|=s<<u,(u+=n)>=this.DB&&(u-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,u>0&&(this[this.t-1]|=(1<<this.DB-u)-1<<u)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,u=Math.floor(t/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+u+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=u-1;r>=0;--r)e[r]=0;e[u]=s,e.t=this.t+u+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var u=r+1;u<this.t;++u)e[u-r-1]|=(this[u]&o)<<i,e[u-r]=this[u]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o<i.t;++o)e[o+n.t]=n.am(0,i[o],e,o,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var u=this.abs();if(u.t<o.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var s=n(),a=this.s,c=t.s,h=this.DB-m(o[o.t-1]);h>0?(o.lShiftTo(h,s),u.lShiftTo(h,i)):(o.copyTo(s),u.copyTo(i));var f=s.t,l=s[f-1];if(0!=l){var p=l*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0),d=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,y=i.t,_=y-f,w=null==e?n():e;for(s.dlShiftTo(_,w),i.compareTo(w)>=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(f,w),w.subTo(s,s);s.t<f;)s[s.t++]=0;for(;--_>=0;){var b=i[--y]==l?this.DM:Math.floor(i[y]*d+(i[y-1]+g)*v);if((i[y]+=s.am(0,b,i,_,0,f))<b)for(s.dlShiftTo(_,w),i.subTo(w,i);i[y]<--b;)i.subTo(w,i)}null!=e&&(i.drShiftTo(f,e),a!=c&&r.ZERO.subTo(e,e)),i.t=f,i.clamp(),h>0&&i.rShiftTo(h,i),a<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=n(),o=n(),u=e.convert(this),s=m(t)-1;for(u.copyTo(i);--s>=0;)if(e.sqrTo(i,o),(t&1<<s)>0)e.mulTo(o,u,i);else{var a=i;i=o,o=a}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",u=this.t,s=this.DB-u*this.DB%e;if(u-- >0)for(s<this.DB&&(r=this[u]>>s)>0&&(i=!0,o=a(r));u>=0;)s<e?(r=(this[u]&(1<<s)-1)<<e-s,r|=this[--u]>>(s+=this.DB-e)):(r=this[u]>>(s-=e)&n,s<=0&&(s+=this.DB,--u)),r>0&&(i=!0),i&&(o+=a(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new f(e):new l(e),this.exp(t,r)},r.ZERO=h(0),r.ONE=h(1),w.prototype.convert=b,w.prototype.revert=b,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x,k,S,F=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],E=(1<<26)/F[F.length-1];function D(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=A&&(S-=A)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=h(r),o=n(),u=n(),s="";for(this.divRemTo(i,o,u);o.signum()>0;)s=(r+u.intValue()).toString(t).substr(1)+s,o.divRemTo(i,o,u);return u.intValue().toString(t)+s},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,u=0,s=0,a=0;a<t.length;++a){var h=c(t,a);h<0?"-"==t.charAt(a)&&0==this.signum()&&(o=!0):(s=e*s+h,++u>=n&&(this.dMultiply(i),this.dAddOffset(s,0),u=0,s=0))}u>0&&(this.dMultiply(Math.pow(e,u)),this.dAddOffset(s,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),d,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>F.length&&(t=F.length);for(var u=n(),s=0;s<t;++s){u.fromInt(F[Math.floor(Math.random()*F.length)]);var a=u.modPow(o,this);if(0!=a.compareTo(r.ONE)&&0!=a.compareTo(e)){for(var c=1;c++<i&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,p,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,v,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+y(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=_(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,d)},r.prototype.clearBit=function(t){return this.changeBit(t,g)},r.prototype.flipBit=function(t){return this.changeBit(t,v)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,i,o=t.bitLength(),u=h(1);if(o<=0)return u;r=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new f(e):e.isEven()?new T(e):new l(e);var s=new Array,a=3,c=r-1,p=(1<<r)-1;if(s[1]=i.convert(this),r>1){var d=n();for(i.sqrTo(s[1],d);a<=p;)s[a]=n(),i.mulTo(d,s[a-2],s[a]),a+=2}var v,g,y=t.t-1,_=!0,w=n();for(o=m(t[y])-1;y>=0;){for(o>=c?v=t[y]>>o-c&p:(v=(t[y]&(1<<o+1)-1)<<c-o,y>0&&(v|=t[y-1]>>this.DB+o-c)),a=r;0==(1&v);)v>>=1,--a;if((o-=a)<0&&(o+=this.DB,--y),_)s[v].copyTo(u),_=!1;else{for(;a>1;)i.sqrTo(u,w),i.sqrTo(w,u),a-=2;a>0?i.sqrTo(u,w):(g=u,u=w,w=g),i.mulTo(w,s[v],u)}for(;y>=0&&0==(t[y]&1<<o);)i.sqrTo(u,w),g=u,u=w,w=g,--o<0&&(o=this.DB-1,--y)}return i.revert(u)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),i=this.clone(),o=h(1),u=h(0),s=h(0),a=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&u.isEven()||(o.addTo(this,o),u.subTo(t,u)),o.rShiftTo(1,o)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);for(;i.isEven();)i.rShiftTo(1,i),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);n.compareTo(i)>=0?(n.subTo(i,n),e&&o.subTo(s,o),u.subTo(a,u)):(i.subTo(n,i),e&&s.subTo(o,s),a.subTo(u,a))}return 0!=i.compareTo(r.ONE)?r.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=F[F.length-1]){for(e=0;e<F.length;++e)if(r[0]==F[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<F.length;){for(var n=F[e],i=e+1;i<F.length&&n<E;)n*=F[i++];for(n=r.modInt(n);e<i;)if(n%F[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=T,null==k){var P;if(k=new Array,S=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var O=new Uint8Array(32);for(window.crypto.getRandomValues(O),P=0;P<32;++P)k[S++]=O[P]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var I=window.crypto.random(32);for(P=0;P<I.length;++P)k[S++]=255&I.charCodeAt(P)}for(;S<A;)P=Math.floor(65536*Math.random()),k[S++]=P>>>8,k[S++]=255&P;S=0,D()}function R(){if(null==x){for(D(),(x=new C).init(k),S=0;S<k.length;++S)k[S]=0;S=0}return x.next()}function B(){}function C(){this.i=0,this.j=0,this.S=new Array}B.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=R()},C.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},C.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var A=256;t.exports={default:r,BigInteger:r,SecureRandom:B}}).call(y)}(_);var w=_.exports.BigInteger;var b=function(){function t(){e(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return n(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var t=this.v.length/2,e=t.toString(16);return e.length%2==1&&(e="0"+e),t<128?e:(128+e.length/2).toString(16)+e}},{key:"getValue",value:function(){return""}}]),t}(),T=function(t){o(i,t);var r=c(i);function i(t){var n;return e(this,i),(n=r.call(this)).t="02",t&&(n.v=function(t){var e=t.toString(16);if("-"!==e[0])e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=(e=e.substr(1)).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=(e=(n=new w(n,16)).xor(t).add(w.ONE)).toString(16).replace(/^-/,"")}return e}(t)),n}return n(i,[{key:"getValue",value:function(){return this.v}}]),i}(b),x=function(t){o(i,t);var r=c(i);function i(t){var n;return e(this,i),(n=r.call(this)).t="30",n.asn1Array=t,n}return n(i,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(t){return t.getEncodedHex()})).join(""),this.v}}]),i}(b);function k(t,e){return+t[e+2]<8?1:128&+t.substr(e+2,2)}function S(t,e){var r=k(t,e),n=t.substr(e+2,2*r);return n?(+n[0]<8?new w(n,16):new w(n.substr(2),16)).intValue():-1}function F(t,e){return e+2*(k(t,e)+1)}var E=function(t,e){var r=new T(t),n=new T(e);return new x([r,n]).getEncodedHex()},D=function(t){var e=F(t,0),r=F(t,e),n=S(t,e),i=t.substr(r,2*n),o=r+i.length,u=F(t,o),s=S(t,o),a=t.substr(u,2*s);return{r:new w(i,16),s:new w(a,16)}},P=_.exports.BigInteger,O=new P("2"),I=new P("3"),R=function(){function t(r,n){e(this,t),this.x=n,this.q=r}return n(t,[{key:"equals",value:function(t){return t===this||this.q.equals(t.q)&&this.x.equals(t.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(e){return new t(this.q,this.x.add(e.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(e){return new t(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(e){return new t(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}},{key:"divide",value:function(e){return new t(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t}(),B=function(){function t(r,n,i,o){e(this,t),this.curve=r,this.x=n,this.y=i,this.z=null==o?P.ONE:o,this.zinv=null}return n(t,[{key:"getX",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(P.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(P.ZERO))}},{key:"isInfinity",value:function(){return null===this.x&&null===this.y||this.z.equals(P.ZERO)&&!this.y.toBigInteger().equals(P.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=this.x.toBigInteger(),n=this.y.toBigInteger(),i=this.z,o=e.x.toBigInteger(),u=e.y.toBigInteger(),s=e.z,a=this.curve.q,c=r.multiply(s).mod(a),h=o.multiply(i).mod(a),m=c.subtract(h),f=n.multiply(s).mod(a),l=u.multiply(i).mod(a),p=f.subtract(l);if(P.ZERO.equals(m))return P.ZERO.equals(p)?this.twice():this.curve.infinity;var d=c.add(h),v=i.multiply(s).mod(a),g=m.square().mod(a),y=m.multiply(g).mod(a),_=v.multiply(p.square()).subtract(d.multiply(g)).mod(a),w=m.multiply(_).mod(a),b=p.multiply(g.multiply(c).subtract(_)).subtract(f.multiply(y)).mod(a),T=y.multiply(v).mod(a);return new t(this.curve,this.curve.fromBigInteger(w),this.curve.fromBigInteger(b),T)}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=this.z,i=this.curve.q,o=this.curve.a.toBigInteger(),u=e.square().multiply(I).add(o.multiply(n.square())).mod(i),s=r.shiftLeft(1).multiply(n).mod(i),a=r.square().mod(i),c=a.multiply(e).multiply(n).mod(i),h=s.square().mod(i),m=u.square().subtract(c.shiftLeft(3)).mod(i),f=s.multiply(m).mod(i),l=u.multiply(c.shiftLeft(2).subtract(m)).subtract(h.shiftLeft(1).multiply(a)).mod(i),p=s.multiply(h).mod(i);return new t(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(l),p)}},{key:"multiply",value:function(t){if(this.isInfinity())return this;if(!t.signum())return this.curve.infinity;for(var e=t.multiply(I),r=this.negate(),n=this,i=e.bitLength()-2;i>0;i--){n=n.twice();var o=e.testBit(i);o!==t.testBit(i)&&(n=n.add(o?this:r))}return n}}]),t}(),C=function(){function t(r,n,i){e(this,t),this.q=r,this.a=this.fromBigInteger(n),this.b=this.fromBigInteger(i),this.infinity=new B(this,null,null)}return n(t,[{key:"equals",value:function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}},{key:"fromBigInteger",value:function(t){return new R(this.q,t)}},{key:"decodePointHex",value:function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new P(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new P("4")).add(P.ONE),this.q));return r.toBigInteger().mod(O).equals(new P(t.substr(0,2),16).subtract(O))||(r=r.negate()),new B(this,e,r);case 4:case 6:case 7:var n=(t.length-2)/2,i=t.substr(2,n),o=t.substr(n+2,n);return new B(this,this.fromBigInteger(new P(i,16)),this.fromBigInteger(new P(o,16)));default:return null}}}]),t}(),A={ECPointFp:B,ECCurveFp:C},q=_.exports.BigInteger,j=_.exports.SecureRandom,$=A.ECCurveFp,L=new j,M=H(),N=M.curve,z=M.G,U=M.n;function H(){var t=new q("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new q("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),r=new q("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),n=new $(t,e,r),i=n.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:n,G:i,n:new q("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function V(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}var K={getGlobalCurve:function(){return N},generateEcparam:H,generateKeyPairHex:function(t,e,r){var n=(t?new q(t,e,r):new q(U.bitLength(),L)).mod(U.subtract(q.ONE)).add(q.ONE),i=V(n.toString(16),64),o=z.multiply(n);return{privateKey:i,publicKey:"04"+V(o.getX().toBigInteger().toString(16),64)+V(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");var e=(t.length-2)/2,r=t.substr(2,e),n="03";return new q(t.substr(e+2,e),16).mod(new q("2")).equals(q.ZERO)&&(n="02"),n+r},utf8ToHex:function(t){for(var e=(t=unescape(encodeURIComponent(t))).length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;for(var i=[],o=0;o<e;o++){var u=r[o>>>2]>>>24-o%4*8&255;i.push((u>>>4).toString(16)),i.push((15&u).toString(16))}return i.join("")},leftPad:V,arrayToHex:function(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")},arrayToUtf8:function(t){for(var e=[],r=0,n=0;n<2*t.length;n+=2)e[n>>>3]|=parseInt(t[r],10)<<24-n%8*4,r++;try{for(var i=[],o=0;o<t.length;o++){var u=e[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(u))}return decodeURIComponent(escape(i.join("")))}catch(t){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){var e=[],r=t.length;r%2!=0&&(t=V(t,r+1)),r=t.length;for(var n=0;n<r;n+=2)e.push(parseInt(t.substr(n,2),16));return e},verifyPublicKey:function(t){var e=N.decodePointHex(t);if(!e)return!1;var r=e.getX();return e.getY().square().equals(r.multiply(r.square()).add(r.multiply(N.a)).add(N.b))},comparePublicKeyHex:function(t,e){var r=N.decodePointHex(t);if(!r)return!1;var n=N.decodePointHex(e);return!!n&&r.equals(n)}},Z=new Uint32Array(68),Q=new Uint32Array(64);function G(t,e){var r=31&e;return t<<r|t>>>32-r}function W(t,e){for(var r=[],n=t.length-1;n>=0;n--)r[n]=255&(t[n]^e[n]);return r}function Y(t){return t^G(t,9)^G(t,17)}function J(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var n=new Array((r-7)/8),i=new Array(8),o=0,u=n.length;o<u;o++)n[o]=0;for(var s=0,a=i.length;s<a;s++)i[s]=0;e=e.toString(2);for(var c=7;c>=0;c--)if(e.length>8){var h=e.length-8;i[c]=parseInt(e.substr(h),2),e=e.substr(0,h)}else e.length>0&&(i[c]=parseInt(e,2),e="");for(var m,l=new Uint8Array([].concat(f(t),[128],n,i)),p=new DataView(l.buffer,0),d=l.length/64,v=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),g=0;g<d;g++){Z.fill(0),Q.fill(0);for(var y=16*g,_=0;_<16;_++)Z[_]=p.getUint32(4*(y+_),!1);for(var w=16;w<68;w++)Z[w]=(m=Z[w-16]^Z[w-9]^G(Z[w-3],15))^G(m,15)^G(m,23)^G(Z[w-13],7)^Z[w-6];for(var b=0;b<64;b++)Q[b]=Z[b]^Z[b+4];for(var T=v[0],x=v[1],k=v[2],S=v[3],F=v[4],E=v[5],D=v[6],P=v[7],O=void 0,I=void 0,R=void 0,B=void 0,C=0;C<64;C++)B=C>=0&&C<=15?2043430169:2055708042,I=(C>=0&&C<=15?T^x^k:T&x|T&k|x&k)+S+((O=G(G(T,12)+F+G(B,C),7))^G(T,12))+Q[C],R=(C>=0&&C<=15?F^E^D:F&E|~F&D)+P+O+Z[C],S=k,k=G(x,9),x=T,T=I,P=D,D=G(E,19),E=F,F=Y(R);v[0]^=T,v[1]^=x,v[2]^=k,v[3]^=S,v[4]^=F,v[5]^=E,v[6]^=D,v[7]^=P}for(var A=[],q=0,j=v.length;q<j;q++){var $=v[q];A.push((4278190080&$)>>>24,(16711680&$)>>>16,(65280&$)>>>8,255&$)}return A}for(var X=new Uint8Array(64),tt=new Uint8Array(64),et=0;et<64;et++)X[et]=54,tt[et]=92;var rt=J,nt=function(t,e){for(e.length>64&&(e=J(e));e.length<64;)e.push(0);var r=W(e,X),n=W(e,tt),i=J([].concat(f(r),f(t)));return J([].concat(f(n),f(i)))},it=_.exports.BigInteger,ot=E,ut=D,st=K,at=rt,ct=st.generateEcparam(),ht=ct.G,mt=ct.curve,ft=ct.n;function lt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";r=st.utf8ToHex(r);var n,i,o=st.leftPad(ht.curve.a.toBigInteger().toRadix(16),64),u=st.leftPad(ht.curve.b.toBigInteger().toRadix(16),64),s=st.leftPad(ht.getX().toBigInteger().toRadix(16),64),a=st.leftPad(ht.getY().toBigInteger().toRadix(16),64);if(128===e.length)n=e.substr(0,64),i=e.substr(64,64);else{var c=ht.curve.decodePointHex(e);n=st.leftPad(c.getX().toBigInteger().toRadix(16),64),i=st.leftPad(c.getY().toBigInteger().toRadix(16),64)}var h=st.hexToArray(r+o+u+s+a+n+i),m=4*r.length;h.unshift(255&m),h.unshift(m>>8&255);var f=at(h);return st.arrayToHex(at(f.concat(st.hexToArray(t))))}function pt(t){var e=ht.multiply(new it(t,16));return"04"+st.leftPad(e.getX().toBigInteger().toString(16),64)+st.leftPad(e.getY().toBigInteger().toString(16),64)}function dt(){var t=st.generateKeyPairHex(),e=mt.decodePointHex(t.publicKey);return t.k=new it(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}var vt={generateKeyPairHex:st.generateKeyPairHex,compressPublicKeyHex:st.compressPublicKeyHex,comparePublicKeyHex:st.comparePublicKeyHex,doEncrypt:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t="string"==typeof t?st.hexToArray(st.utf8ToHex(t)):Array.prototype.slice.call(t),e=st.getGlobalCurve().decodePointHex(e);var n=st.generateKeyPairHex(),i=new it(n.privateKey,16),o=n.publicKey;o.length>128&&(o=o.substr(o.length-128));var u=e.multiply(i),s=st.hexToArray(st.leftPad(u.getX().toBigInteger().toRadix(16),64)),a=st.hexToArray(st.leftPad(u.getY().toBigInteger().toRadix(16),64)),c=st.arrayToHex(at([].concat(s,t,a))),h=1,m=0,l=[],p=[].concat(s,a),d=function(){l=at([].concat(f(p),[h>>24&255,h>>16&255,h>>8&255,255&h])),h++,m=0};d();for(var v=0,g=t.length;v<g;v++)m===l.length&&d(),t[v]^=255&l[m++];var y=st.arrayToHex(t);return 0===r?o+y+c:o+c+y},doDecrypt:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.output,o=void 0===i?"string":i;e=new it(e,16);var u=t.substr(128,64),s=t.substr(192);0===r&&(u=t.substr(t.length-64),s=t.substr(128,t.length-128-64));var a=st.hexToArray(s),c=st.getGlobalCurve().decodePointHex("04"+t.substr(0,128));if(!c||!st.verifyPublicKey("04"+t.substr(0,128)))return"array"===o?[]:"";var h=c.multiply(e),m=st.hexToArray(st.leftPad(h.getX().toBigInteger().toRadix(16),64)),l=st.hexToArray(st.leftPad(h.getY().toBigInteger().toRadix(16),64)),p=1,d=0,v=[],g=[].concat(m,l),y=function(){v=at([].concat(f(g),[p>>24&255,p>>16&255,p>>8&255,255&p])),p++,d=0};y();for(var _=0,w=a.length;_<w;_++)d===v.length&&y(),a[_]^=255&v[d++];var b=st.arrayToHex(at([].concat(m,a,l)));return b===u.toLowerCase()?"array"===o?a:st.arrayToUtf8(a):"array"===o?[]:""},doSignature:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.pointPool,i=r.der,o=r.hash,u=void 0===o||o,s=r.publicKey,a=r.userId,c="string"==typeof t?st.utf8ToHex(t):st.arrayToHex(t);u&&(c=lt(c,s=s||pt(e),a));var h=new it(e,16),m=new it(c,16),f=null,l=null,p=null;do{do{var d=void 0;f=(d=n&&n.length?n.pop():dt()).k,l=m.add(d.x1).mod(ft)}while(l.equals(it.ZERO)||l.add(f).equals(ft));p=h.add(it.ONE).modInverse(ft).multiply(f.subtract(l.multiply(h))).mod(ft)}while(p.equals(it.ZERO));return i?ot(l,p):st.leftPad(l.toString(16),64)+st.leftPad(p.toString(16),64)},doVerifySignature:function(t,e,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=o.der,s=o.hash,a=void 0===s||s,c=o.userId,h="string"==typeof t?st.utf8ToHex(t):st.arrayToHex(t);if(a&&(h=lt(h,r,c)),u){var m=ut(e);n=m.r,i=m.s}else n=new it(e.substring(0,64),16),i=new it(e.substring(64),16);var f=ft.subtract(it.ONE);if(n.compareTo(it.ONE)<0||n.compareTo(f)>0)return!1;if(i.compareTo(it.ONE)<0||i.compareTo(f)>0)return!1;var l=mt.decodePointHex(r);if(!l||!st.verifyPublicKey(r))return!1;var p=new it(h,16),d=n.add(i).mod(ft);if(d.equals(it.ZERO))return!1;var v=ht.multiply(i).add(l.multiply(d)),g=p.add(v.getX().toBigInteger()).mod(ft);return n.equals(g)},getPublicKeyFromPrivateKey:pt,getPoint:dt,verifyPublicKey:st.verifyPublicKey},gt=rt,yt=nt;function _t(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")}function wt(t){var e,r,n=[],i=t.length;i%2!=0&&(r=i+1,t=(e=t).length>=r?e:new Array(r-e.length+1).join("0")+e),i=t.length;for(var o=0;o<i;o+=2)n.push(parseInt(t.substr(o,2),16));return n}var bt=16,Tt=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],xt=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function kt(t){for(var e=[],r=0,n=t.length;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return e}function St(t){return t.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t})).join("")}function Ft(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t.codePointAt(r);if(i<=127)e.push(i);else if(i<=2047)e.push(192|i>>>6),e.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)e.push(224|i>>>12),e.push(128|i>>>6&63),e.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw e.push(i),new Error("input is not supported");r++,e.push(240|i>>>18&28),e.push(128|i>>>12&63),e.push(128|i>>>6&63),e.push(128|63&i)}}return e}function Et(t){for(var e=[],r=0,n=t.length;r<n;r++)t[r]>=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function Dt(t,e){var r=31&e;return t<<r|t>>>32-r}function Pt(t){return(255&Tt[t>>>24&255])<<24|(255&Tt[t>>>16&255])<<16|(255&Tt[t>>>8&255])<<8|255&Tt[255&t]}function Ot(t){return t^Dt(t,2)^Dt(t,10)^Dt(t,18)^Dt(t,24)}function It(t){return t^Dt(t,13)^Dt(t,23)}function Rt(t,e,r){for(var n=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&t[4*o],i[1]=255&t[4*o+1],i[2]=255&t[4*o+2],i[3]=255&t[4*o+3],n[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(var u,s=0;s<32;s+=4)u=n[1]^n[2]^n[3]^r[s+0],n[0]^=Ot(Pt(u)),u=n[2]^n[3]^n[0]^r[s+1],n[1]^=Ot(Pt(u)),u=n[3]^n[0]^n[1]^r[s+2],n[2]^=Ot(Pt(u)),u=n[0]^n[1]^n[2]^r[s+3],n[3]^=Ot(Pt(u));for(var a=0;a<16;a+=4)e[a]=n[3-a/4]>>>24&255,e[a+1]=n[3-a/4]>>>16&255,e[a+2]=n[3-a/4]>>>8&255,e[a+3]=255&n[3-a/4]}function Bt(t,e,r){for(var n=new Array(4),i=new Array(4),o=0;o<4;o++)i[0]=255&t[0+4*o],i[1]=255&t[1+4*o],i[2]=255&t[2+4*o],i[3]=255&t[3+4*o],n[o]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];n[0]^=2746333894,n[1]^=1453994832,n[2]^=1736282519,n[3]^=2993693404;for(var u,s=0;s<32;s+=4)u=n[1]^n[2]^n[3]^xt[s+0],e[s+0]=n[0]^=It(Pt(u)),u=n[2]^n[3]^n[0]^xt[s+1],e[s+1]=n[1]^=It(Pt(u)),u=n[3]^n[0]^n[1]^xt[s+2],e[s+2]=n[2]^=It(Pt(u)),u=n[0]^n[1]^n[2]^xt[s+3],e[s+3]=n[3]^=It(Pt(u));if(0===r)for(var a,c=0;c<16;c++)a=e[c],e[c]=e[31-c],e[31-c]=a}function Ct(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.padding,o=void 0===i?"pkcs#7":i,u=n.mode,s=n.iv,a=void 0===s?[]:s,c=n.output,h=void 0===c?"string":c;if("cbc"===u&&("string"==typeof a&&(a=kt(a)),16!==a.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=kt(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==r?Ft(t):kt(t):f(t),("pkcs#5"===o||"pkcs#7"===o)&&0!==r)for(var m=bt-t.length%bt,l=0;l<m;l++)t.push(m);var p=new Array(32);Bt(e,p,r);for(var d=[],v=a,g=t.length,y=0;g>=bt;){var _=t.slice(y,y+16),w=new Array(16);if("cbc"===u)for(var b=0;b<bt;b++)0!==r&&(_[b]^=v[b]);Rt(_,w,p);for(var T=0;T<bt;T++)"cbc"===u&&0===r&&(w[T]^=v[T]),d[y+T]=w[T];"cbc"===u&&(v=0!==r?w:_),g-=bt,y+=bt}if(("pkcs#5"===o||"pkcs#7"===o)&&0===r){for(var x=d.length,k=d[x-1],S=1;S<=k;S++)if(d[x-S]!==k)throw new Error("padding is invalid");d.splice(x-k,k)}return"array"!==h?0!==r?St(d):Et(d):d}var At,qt={sm2:vt,sm3:function(t,e){if(t="string"==typeof t?function(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t.codePointAt(r);if(i<=127)e.push(i);else if(i<=2047)e.push(192|i>>>6),e.push(128|63&i);else if(i<=55295||i>=57344&&i<=65535)e.push(224|i>>>12),e.push(128|i>>>6&63),e.push(128|63&i);else{if(!(i>=65536&&i<=1114111))throw e.push(i),new Error("input is not supported");r++,e.push(240|i>>>18&28),e.push(128|i>>>12&63),e.push(128|i>>>6&63),e.push(128|63&i)}}return e}(t):Array.prototype.slice.call(t),e){if("hmac"!==(e.mode||"hmac"))throw new Error("invalid mode");var r=e.key;if(!r)throw new Error("invalid key");return r="string"==typeof r?wt(r):Array.prototype.slice.call(r),_t(yt(t,r))}return _t(gt(t))},sm4:{encrypt:function(t,e,r){return Ct(t,e,1,r)},decrypt:function(t,e,r){return Ct(t,e,0,r)}}},jt=function(){function t(r,n){e(this,t),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=n,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=r}return n(t,[{key:"generateRequestData",value:function(){var t,e=new Date,r={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(e.getFullYear(),"-").concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()),tz:g.getTimezone(e),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:f(this.catch)}),_:e.getTime()+""};if(null===(t=this.tracker)||void 0===t?void 0:t.config.encrypt)if(this.tracker.config.publicKey){var n=g.randomAesKey();r.event=qt.sm4.encrypt(r.event,n),r.key=qt.sm2.doEncrypt(n,this.tracker.config.publicKey,1),r.type=2,r.encrypt=1}else console.warn("未配置公钥,无法加密数据");return this.catch=[],r}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(t,n){var i,o=!1;i=setTimeout((function(){o=!0,t(null)}),e.timeout),e.requestFunction(e.url,r,{timeout:e.requestTimeout}).then((function(e){o||(clearTimeout(i),t(e))})).catch((function(t){n(t)}))}))}}}]),t}(),$t=function(){function t(r,n,i){e(this,t),this.storageFunction=r,this.allData=i||{},this.allData.did||this.set("did",n.config.did||g.UUID()),this.allData.cuid||this.set("cuid",void 0),g.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return n(t,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(t,e){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.allData[t]=e,r.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return r.stop()}}),r,this)})))}}]),t}();!function(t){var e,r,n,i,o,u;(e=t.EventType||(t.EventType={})).connected="connected",e.disconnected="disconnected",e.error="error",e.offline="offline",e.exist="exist",e.online="online",(r=t.RequestType||(t.RequestType={}))[r.common=0]="common",r[r.ping=1]="ping",r[r.pong=2]="pong",r[r.normal=5]="normal",r[r.img=6]="img",(n=t.ResponseCode||(t.ResponseCode={}))[n.offline=109001]="offline",n[n.exist=109002]="exist",n[n.paramError=109005]="paramError",n[n.online=109006]="online",(i=t.SocketMsgOrigin||(t.SocketMsgOrigin={}))[i.xcx=1]="xcx",i[i.app=2]="app",i[i.web=3]="web",(o=t.VisualEndpointType||(t.VisualEndpointType={}))[o.xcx=1]="xcx",(u=t.SocketMessageType||(t.SocketMessageType={})).update="update",u.xcxLogin="xcxLogin",u.eventInfo="eventInfo"}(At||(At={}));var Lt,Mt,Nt,zt=At,Ut=function(){function t(r,n){e(this,t),this.listeners={},this.catch=[],this.showLog=!1,this.url=r,this.params=n,this.open()}return n(t,[{key:"emit",value:function(t,e){var r;if(this.log("info","emit message",[t,e]),!this.client)return this.log("info","缓存消息",[t,e]),void this.catch.push([t,e]);switch(null===(r=this.client)||void 0===r?void 0:r.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[t,e]),this.catch.push([t,e])}}},{key:"on",value:function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"onConnected",value:function(t){this.on(zt.EventType.connected,t)}},{key:"onDisconnected",value:function(t){this.on(zt.EventType.disconnected,t)}},{key:"onError",value:function(t){this.on(zt.EventType.error,t)}},{key:"send",value:function(t){var e;null===(e=this.client)||void 0===e||e.send({data:JSON.stringify(t)})}},{key:"_onError",value:function(t){var e;this.log("error","socket连接异常",t),null===(e=this.listeners.error)||void 0===e||e.forEach((function(e){e.call(void 0,t)}))}},{key:"_onClose",value:function(t){var e;this.log("error","socket连接已关闭"),null===(e=this.listeners.disconnected)||void 0===e||e.forEach((function(t){t.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(t){var e,r=this;this.log("info","socket连接成功",t),null===(e=this.listeners.connected)||void 0===e||e.forEach((function(t){t.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(t){var e=m(t,2),n=e[0],i=e[1];r.emit(n,i)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(t){var e,r,n;if(""!==t.data){var i=JSON.parse(t.data);if(i.code)switch(Number(i.code)){case zt.ResponseCode.offline:null===(e=this.listeners[zt.EventType.offline])||void 0===e||e.forEach((function(t){t.call(void 0,i)}));break;case zt.ResponseCode.online:null===(r=this.listeners[zt.EventType.online])||void 0===r||r.forEach((function(t){t.call(void 0,i)}));break;case zt.ResponseCode.exist:null===(n=this.listeners[zt.EventType.exist])||void 0===n||n.forEach((function(t){t.call(void 0,i)}));break;case zt.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(i.type===zt.RequestType.pong)return;var o=i.data;this.listeners[o.event]&&this.listeners[o.event].forEach((function(t){t.call(void 0,o.payload)}))}}}},{key:"ping",value:function(){var t=this;this.pingTimer=setInterval((function(){t.send({type:zt.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(t,e){var r=this;e?this.listeners[t].forEach((function(n,i){n===e&&r.listeners[t].splice(i,1)})):this.listeners[t]=[]}},{key:"open",value:function(){var t,e,r=this;this.client&&this.close();var n=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(t=this.params)||void 0===t?void 0:t.socketToken,"&appId=").concat(null===(e=this.params)||void 0===e?void 0:e.appId,"&origin=").concat(zt.SocketMsgOrigin.xcx)});n.onMessage((function(t){r.onMessage(t)})),n.onError((function(t){r._onError(t)})),n.onClose((function(t){r._onClose(t)})),n.onOpen((function(t){r._onOpen(t)})),this.client=n}},{key:"close",value:function(){var t;null===(t=this.client)||void 0===t||t.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.showLog&&(e=console).log.apply(e,["%c【socketClient】:".concat(t),"color: ".concat("error"===t?"red":"#1890ff")].concat(n))}},{key:"openLog",value:function(t){this.showLog=t}}]),t}(),Ht=function(t,e,r){return new Promise((function(n,o){var u;wx.request((i(u={url:t,data:e,method:(null==r?void 0:r.method)||"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":(null==r?void 0:r.contentType)||"application/x-www-form-urlencoded"}),i(u,"dataType","json"),i(u,"responseType",null!=(null==r?void 0:r.responseType)?null==r?void 0:r.responseType:"arraybuffer"),i(u,"success",(function(t){n(t)})),i(u,"fail",(function(t){o(t)})),u))}))},Vt=function(){function t(r){e(this,t),this.pagePathJudge=function(t,e){return-1!==e.pagePath.indexOf("*")?-1!==t.pr.$page_url.indexOf(e.pagePath.split("*")[0]):e.pagePath===t.pr.$page_url.split("?")[0]},this.tracker=r,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return n(t,[{key:"init",value:function(){var t=this;this.socket&&this.socket.destroy(),this.socket=new Ut(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){t.getVisualData()})),this.socket.on("connected",(function(){null===t.socketUserInfo?wx.getSystemInfo({success:function(e){var r=e.model,n=e.system,i=e.version;wx.getUserInfo({success:function(e){var o=e.userInfo.nickName,u=e.userInfo.avatarUrl,s={model:r,system:n,version:i,nickName:o,avatarUrl:u,programId:t.tracker.config.appId};t.socketUserInfo=s,t.sendUserInfo(s)}})}}):t.sendUserInfo(t.socketUserInfo)}))}},{key:"getVisualData",value:function(){var t=this;Ht("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:zt.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(e){e.data&&e.data.data&&(t.visualData=e.data.data)}))}},{key:"sendUserInfo",value:function(t){var e;this.socketState=!0,null===(e=this.socket)||void 0===e||e.send({type:zt.RequestType.normal,data:{event:zt.SocketMessageType.xcxLogin,payload:{userInfo:t}}})}},{key:"send",value:function(t){var e;this.socketState&&(null===(e=this.socket)||void 0===e||e.send({type:zt.RequestType.normal,data:{event:zt.SocketMessageType.eventInfo,payload:t}}))}},{key:"event",value:function(t){var e;return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,u=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===(e=this.tracker)||void 0===e?void 0:e.config.visual){r.next=2;break}return r.abrupt("return");case 2:"abp"!==t.dt||"pv"!==t.pr.$eid&&"click"!==t.pr.$eid?"evt"===t.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},t),{eventType:"evt"})):(n=g.clone(t),i=!1,this.visualData.map((function(e){var r,o;if("click"===t.pr.$eid){var s=[],a=g.jsJSON(e.elementConditions)?JSON.parse(e.elementConditions):{};for(var c in a)s.push(a[c]===t.pr[c]);s.push(u.pagePathJudge(t,e)),-1===s.indexOf(!1)&&"click"===e.eventType&&(n.dt="evt",n.pr.$eid=e.eventName,i=!0,u.vRQC?u.send(Object.assign(Object.assign({},n),{visual:e})):null===(r=u.tracker)||void 0===r||r.send(n))}else"pv"===e.eventType&&u.pagePathJudge(t,e)&&(n.dt="evt",n.pr.$eid=e.eventName,i=!0,u.vRQC?u.send(Object.assign(Object.assign({},n),{visual:e})):null===(o=u.tracker)||void 0===o||o.send(n))})),this.vRQC&&!i&&(o="click"===t.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},t),{eventType:o}))));case 3:case"end":return r.stop()}}),r,this)})))}}]),t}();function Kt(t,e,r){var n=r.value;return r.value=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:e,args:r})},r}var Zt=function(){function t(r,n,i){e(this,t),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,Mt=r,Lt=n,Nt=i,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",encrypt:!1,publicKey:"031e09b445c808d2b97ff01f318f785672fac17f03afc29c259b0548d7f3ad6c66",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new Vt(this)}return n(t,[{key:"load",value:function(t,e){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.appKey=t,this.config=g.merge(this.config,e||{}),r.prev=2,r.next=5,Lt.get();case 5:if((n=r.sent)&&n.did){r.next=10;break}return r.next=9,Lt.getDid();case 9:n.did=r.sent;case 10:this.storage=new $t(Lt,this,n),this.request=new jt(Mt,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(2),console.error("sdk初始化失败,缓存读取失败",r.t0);case 20:case"end":return r.stop()}}),r,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var e=this.buffer.shift();if(e)(t.prototype[e.fnName]||this[e.fnName]).apply(this,e.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var r in e)e[r]&&(t.pr["$".concat(r)]=e[r]);return this.request.send(t)}},{key:"trackBaseData",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Date,e.t0=t,e.t1=r.getTime(),e.t2=this.storage.allData.sid,e.t3=this.storage.allData.cuid,e.t4=this.cn,e.t5=g.getTimezone(r),e.t6=this.currentPage.url,e.t7=this.prevPage.url,e.t8=Nt.os(),e.t9=Nt.ov(),e.t10=Nt.version(),e.next=14,Nt.mnet();case 14:return e.t11=e.sent,e.next=17,Nt.net();case 17:return e.t12=e.sent,e.t13=this.config.vn,e.t14=this.referrerDomain,e.t15=this.config.appId,e.t16={$eid:e.t0,$ct:e.t1,$sid:e.t2,$cuid:e.t3,$cn:e.t4,$tz:e.t5,$url:e.t6,$ref:e.t7,$os:e.t8,$ov:e.t9,$wv:e.t10,$mnet:e.t11,$net:e.t12,$vn:e.t13,$referrer_domain:e.t14,$wxeid:e.t15,$page_url:""},(n={dt:"evt",pr:e.t16}).pr=g.merge(n.pr,g.encode(this.config.superProperty)),e.abrupt("return",n);case 25:case"end":return e.stop()}}),e,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(Nt.windowWidth(),"x").concat(Nt.windowHeight()),$tz:g.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();e.pr.$dv=r.model,e.pr.$br=r.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,r=t.update-t.sid,n={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:g.getTimezone(e),$dru:r,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new Date,r=this.storage.allData,n=r.sid,i=r.cuid,t.t0=n,t.t1=n,t.t2=i,t.t3=this.cn,t.t4=g.getTimezone(e),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=Nt.os(),t.t8=Nt.ov(),t.t9=Nt.version(),t.next=14,Nt.mnet();case 14:return t.t10=t.sent,t.next=17,Nt.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},o={dt:"ss",pr:t.t15},this.config.utm&&!g.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(o),this.environmentInfo();case 26:case"end":return t.stop()}}),t,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,r=Date.now();if(e.sid&&e.update)if(r-e.update>this.config.timeout){var n=g.clone(e);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,i,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.config.click){e.next=2;break}return e.abrupt("return");case 2:return this.updateSession("click"),e.next=5,this.trackBaseData("click");case 5:for(o in r=e.sent,n={},i=["id","content","type","style","selector","link"],t.target.dataset)-1===i.indexOf(o)&&(n["_".concat(o)]=t.target.dataset[o]);return u=t.target,r.dt="abp",r.pr=g.merge(r.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:u.dataset.id||"",$element_content:u.dataset.content||"",$element_type:u.dataset.type||"",$element_style:u.dataset.style||"",$element_selector:u.dataset.selector||"",$element_link:u.dataset.link||""},n,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),e.next=14,this.send(r);case 14:return e.next=16,this.visual.event(r);case 16:case"end":return e.stop()}}),e,this)})))}},{key:"pv",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.config.pv){e.next=2;break}return e.abrupt("return");case 2:return this.updateSession("pv"),e.next=5,this.trackBaseData("pv");case 5:return(r=e.sent).dt="abp",r.pr=g.merge(r.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},t||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),e.next=10,this.send(r);case 10:return e.next=12,this.visual.event(r);case 12:case"end":return e.stop()}}),e,this)})))}},{key:"duration",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),g.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),e=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(r=t.sent).dt="abp",r.pr=g.merge(r.pr,{$dr:e,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(r);case 12:g.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),t,this)})))}},{key:"track",value:function(t,e){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.updateSession("track"),r.next=3,this.trackBaseData(t);case 3:return(n=r.sent).pr=g.merge(n.pr,g.encode(e),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),r.next=7,this.send(n);case 7:return r.next=9,this.visual.event(n);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"identify",value:function(t,e){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.storage.set("cuid",t),this.updateSession("identify"),n=new Date,(i={dt:"usr",pr:{$ct:n.getTime(),$tz:g.getTimezone(n),$cuid:t,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=g.merge(i.pr,g.encode(e)),r.next=7,this.trackBaseData("usr");case 7:return r.next=9,this.send(i);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"setPushClient",value:function(t,e){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=new Date,i={dt:"um",pr:{$ct:n.getTime(),$tz:g.getTimezone(n),$push_ch:e||"getui",$push_id:t}},r.next=4,this.trackBaseData("usr");case 4:return r.next=6,this.send(i);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"trackCount",value:function(t,e){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=g.clone(e)),this.previousCountEvent.name===t&&g.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=g.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(t,e,r){return v(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,u,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.updateSession("track count"),i=Date.now()-this.countStartTime,r&&(i-=this.config.countDuration),o=this.count,this.count=r?0:1,n.next=7,this.trackBaseData(t);case 7:return u=n.sent,s={},g.isObject(e)&&(s=g.clone(e)),u.pr=g.merge(u.pr,g.encode(s),g.encode({count:o,countTime:i})),n.next=13,this.send(u);case 13:case"end":return n.stop()}}),n,this)})))}},{key:"trackRevenue",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,i,o,u,s,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(t,e){var r=0;try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),e.next=4,this.trackBaseData("revenue");case 4:(r=e.sent).dt="abp",(n=g.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},t)).total=i(n.price,n.productQuantity),o=["productID","revenueType"],u=["price","total","productQuantity"],s={},e.t0=regeneratorRuntime.keys(n);case 12:if((e.t1=e.t0()).done){e.next=21;break}if(a=e.t1.value,-1!==o.indexOf(a)||-1!==u.indexOf(a)){e.next=16;break}return e.abrupt("continue",12);case 16:c=n[a],u.indexOf(a)>-1&&((c=Number(c))||(c=0)),s["$"+a]=c,e.next=12;break;case 21:return r.pr=g.merge(r.pr,s),e.next=24,this.send(r);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"setUtm",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==(r=g.filterUtm(t))&&(this.storage.set("utm",r),this.updateSession("setUtm"));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"setSuperProperty",value:function(t){g.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){g.isObject(t)&&(this.config.superProperty=g.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=l(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;delete this.config.superProperty[n]}}catch(t){r.e(t)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),t}();d([Kt],Zt.prototype,"environmentInfo",null),d([Kt],Zt.prototype,"sessionEnd",null),d([Kt],Zt.prototype,"sessionStart",null),d([Kt],Zt.prototype,"updateSession",null),d([Kt],Zt.prototype,"click",null),d([Kt],Zt.prototype,"pv",null),d([Kt],Zt.prototype,"duration",null),d([Kt],Zt.prototype,"track",null),d([Kt],Zt.prototype,"identify",null),d([Kt],Zt.prototype,"setPushClient",null),d([Kt],Zt.prototype,"trackCount",null),d([Kt],Zt.prototype,"trackRevenue",null),d([Kt],Zt.prototype,"setUtm",null);var Qt=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],Gt=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],Wt=function(t){return g.wxGetTitle(t)},Yt={did:void 0,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(r,n){wx.setStorage({key:t,data:e,success:r,fail:n})}))}},Jt=!1,Xt=wx.getSystemInfoSync(),te=Xt.system.split(/\s/),ee={os:te[0],ov:te[1],version:Xt.version,windowHeight:Xt.windowHeight,windowWidth:Xt.windowWidth,net:0,mnet:0};function re(t){var e=t.toLowerCase();"wifi"===e?(ee.net=1,ee.mnet=0):(ee.net=0,ee.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function ne(t){return new Promise((function(e,r){if(Jt)return e(ee[t]);wx.getNetworkType({success:function(r){Jt=!0,re(r.networkType),e(ee[t])}})}))}wx.onNetworkStatusChange((function(t){re(t.networkType)}));var ie,oe,ue={os:function(){return ee.os},ov:function(){return ee.ov},version:function(){return ee.version},net:function(){return ne("net")},mnet:function(){return ne("mnet")},windowWidth:function(){return ee.windowWidth},windowHeight:function(){return ee.windowHeight}},se=App,ae=Page,ce=Component,he=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function me(t,e,r){if(t[r]&&g.isFunction(t[r])){var n=t[r];t[r]=function(){n.apply(this,arguments),e[r].apply(this,arguments)}}else t[r]=function(){e[r].apply(this,arguments)}}function fe(t,e,r){var n=t[e];t[e]=function(){var t=arguments[0];if(ie===t||t&&ie&&ie.timeStamp===t.timeStamp)return n.apply(this,arguments);if(ie=t,t){var e=t.type;"tap"===e&&r.click(t)}return n.apply(this,arguments)}}var le=function(t){o(i,t);var r=c(i);function i(t){var n;return e(this,i),(n=r.call(this,Ht,Yt,ue)).openData={path:"",props:{}},n.shared=!1,n.semiAutoTrackEventCatch={},n.isShareOperation=!1,oe=t,n.initLifeCycleHook(),n}return n(i,[{key:"initLifeCycleHook",value:function(){var t,e=this,r=(t=e,{App:{onLaunch:function(e){t.config.visual&&t.visual.getVisualData()},onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){(null==e?void 0:e.scene)&&-1!==decodeURIComponent(e.scene).indexOf("vRQC")&&t.config.visual&&(t.visual.vRQC=decodeURIComponent(e.scene).split("vRQC=")[1],t.visual.init()),t.currentPage.query=g.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),r=e[e.length-1];t.currentPage.route=r.__route__||r.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var n=Wt;if(t.currentPage.title="function"==typeof n?n(r):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(r),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=g.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=g.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=r;var n=function(t){for(var n in r.App)me(t,r.App,n);for(var i in t)!Qt.includes(i)&&g.isFunction(t[i])&&fe(t,i,e);return se(t)};for(var i in App)n[i]=App[i];App=n;var o=function(t){for(var n in r.Page)me(t,r.Page,n);for(var i in t)!Gt.includes(i)&&g.isFunction(t[i])&&"onShareAppMessage"!==i&&fe(t,i,e);var o=t.onShareAppMessage;return g.isFunction(o)&&(t.onShareAppMessage=e.onShareAppMessage(o)),ae(t)};for(var u in Page)o[u]=Page[u];Page=o,Component=function(t){if(void 0!==t.methods)for(var r in t.methods)fe(t.methods,r,e);return ce(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return h(u(i.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(t){var e=this,r=Object.create(null,{pv:{get:function(){return h(u(i.prototype),"pv",e)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={},n=g.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(e.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(e.$share_level=Number(this.openOptions.query.zg_share_level)),n.data&&n.data.zg_share_data&&(e=g.merge(e,g.encode(n.data.zg_share_data)))),t.next=5,r.pv.call(this,e);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"click",value:function(t){var e=this,r=Object.create(null,{click:{get:function(){return h(u(i.prototype),"click",e)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.click.call(this,t);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=g.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&oe){var r=t.scene;this.cn=r+"";var n=oe[r],i={},o=null,u=oe.isShare(r);if(u&&t.referrerInfo&&(o=t.referrerInfo.appId),n){i={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:o};var s=t.query||{};oe.isCartShare(r)&&s.zg_uid&&s.zg_share_id&&(i.utm_term=s.zg_uid,i.utm_content=s.zg_share_id)}e=g.merge(i,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&g.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(t){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,i,o,u,s,a,c,h,m,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&this.config.forwardShare){e.next=2;break}return e.abrupt("return");case 2:if(!this.shared){e.next=5;break}return this.shared=!1,e.abrupt("return");case 5:if(r=t.query||{},n=this.currentPage.route,!(oe.isCartShare(t.scene)&&r.zg_uid&&r.zg_share_id)){e.next=24;break}for(u in i={$uid:r.zg_uid,$share_id:r.zg_share_id,$title:this.currentPage.title,$path:n,$share_open_type:1008===t.scene?"群聊":"聊天",$share_level:Number(r.zg_share_level)},this.shareId=r.zg_share_id,this.shareLevel=Number(r.zg_share_level),o={},r)s=u.replace(/^zg_/,""),-1===he.indexOf(s)&&/^zg_/.test(u)&&(o[s]=r[u]);if(a=this.config.shareToUtm,g.isObject(a)&&!g.isEmpty(a)){for(h in c={},a)null!==o[h]&&void 0!==o[h]&&(m=a[h],c[m]=o[h]);g.isEmpty(c)||(c.utm_campaign||(c.utm_campaign="分享打开"),this.setUtm(c))}return this.openData={path:n,props:o},i=g.merge(i,g.encode(o)),e.next=19,this.trackBaseData("wxsopen");case 19:return(f=e.sent).dt="abp",f.pr=g.merge(f.pr,i),e.next=24,this.send(f);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var r=t.apply(this,arguments)||{};if(!e.config.forwardShare)return r;r.path=r.path||e.currentPage.url;var n=r.title||e.currentPage.title,i=r.path.split("?")[0],o=this.data.zg_share_data,u=(new Date).getTime(),s=1;!this.data.newShare&&e.openData&&e.openData.path===i&&g.isEqual(o||{},e.openData.props)&&(u=e.shareId,s=e.shareLevel+1);var a={share_id:u,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:s},c={$share_title:n,$title:e.currentPage.title||"",$path:i},h={};for(var m in a)c["$".concat(m)]=h["zg_".concat(m)]=a[m];for(var f in o)-1===he.indexOf(f)&&(c["_".concat(f)]=h["zg_".concat(f)]=o[f]);return r.path=g.addUrlParam(r.path,h),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=g.merge(t.pr,c),e.request.send(t)})),e.shared=!0,r}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var r,n=e.getEventDataFromDataset(t.dataset);(r=h(u(i.prototype),"track",e)).call.apply(r,[e].concat(f(n)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},r="";for(var n in t){if(n.startsWith("expo"))if("expoName"===n)r=t[n];else e[n.replace(/^expo(.*)/,(function(t,e,r,n){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[n]}return[r,e]}}]),i}(Zt);d([Kt],le.prototype,"sceneToUtm",null),d([Kt],le.prototype,"trackOpenShare",null);var pe={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1103:{utm_source:"发现小程序",utm_medium:"发现栏 - 小程序 - 我的小程序"},1104:{utm_source:"任务栏",utm_medium:"任务栏 - 我的小程序"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1200:{utm_source:"打开小程序",utm_medium:"视频号广告打开小程序"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},1217:{utm_source:"打开小程序",utm_medium:"蓝牙设备后台唤醒小程序"},1218:{utm_source:"打开小程序",utm_medium:"微信键盘预览打开小程序"},1219:{utm_source:"打开小游戏",utm_medium:"视频号直播间小游戏一键上车"},1220:{utm_source:"打开小程序",utm_medium:"发现页设备卡片打开小程序"},1223:{utm_source:"打开小程序",utm_medium:"安卓桌面Widget打开小程序"},1224:{utm_source:"打开小程序",utm_medium:"小程序商家助手功能打开小程序"},1225:{utm_source:"打开小程序",utm_medium:"音视频通话打开小程序"},1226:{utm_source:"打开小程序",utm_medium:"聊天消息在设备打开后打开小程序"},1228:{utm_source:"打开小程序",utm_medium:"视频号原生广告组件打开小程序"},1230:{utm_source:"打开小程序",utm_medium:"订阅号H5广告进入小程序"},1231:{utm_source:"打开小程序",utm_medium:"动态消息提醒入口打开小程序"},1232:{utm_source:"打开小程序",utm_medium:"搜一搜竞价广告打开小程序"},1233:{utm_source:"打开小游戏",utm_medium:"小程序搜索页人气游戏模块打开小游戏"},1238:{utm_source:"打开小程序",utm_medium:"看一看信息流广告打开小程序"},1239:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间气泡浮窗打开小游戏"},1242:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块频道页进入小程序"},1243:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送模块商品聚合页进入小程序"},1244:{utm_source:"打开小程序",utm_medium:"#tag搜索结果页打开小程序"},1245:{utm_source:"打开小程序",utm_medium:"小程序发现页门店快送搜索结果页进入小程序"},1248:{utm_source:"打开小程序",utm_medium:"通过小程序账号迁移进入小程序"},1252:{utm_source:"打开小程序",utm_medium:"搜一搜小程序搜索页「小功能」模块进入小程序"},1254:{utm_source:"打开小程序",utm_medium:"发现页「动态」卡片 打开小程序"},1255:{utm_source:"打开小程序",utm_medium:"发现页「我的」卡片 打开小程序"},1256:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「最近使用」列表"},1257:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「我的小程序」列表"},1258:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「为电脑端优化」模块"},1259:{utm_source:"打开小游戏",utm_medium:"pc端小程序面板「小游戏专区」模块"},1260:{utm_source:"打开小程序",utm_medium:"pc端小程序面板「推荐在电脑端使用」列表"},1261:{utm_source:"打开商品卡片",utm_medium:"公众号返佣商品卡片"},1265:{utm_source:"打开小程序",utm_medium:"小程序图片详情页打开小程序"},1266:{utm_source:"打开小程序",utm_medium:"小程序图片长按半屏入口打开小程序"},1267:{utm_source:"打开小程序",utm_medium:"小程序图片会话角标打开小程序"},1271:{utm_source:"打开小程序",utm_medium:"微信聊天主界面下拉,「我的常用小程序」栏"},1272:{utm_source:"打开小程序",utm_medium:"发现页「游戏」服务tab打开小程序"},1273:{utm_source:"打开小程序",utm_medium:"发现页「常用的小程序」列表"},1274:{utm_source:"打开小程序",utm_medium:"优量汇广告打开小程序"},1275:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片打开小程序"},1276:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片二级聚合页打开小程序"},1277:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片搜索结果页打开小程序"},1278:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」列表打开小程序"},1279:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」合集页打开小程序"},1280:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「建议使用」打开小程序"},1281:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开小程序"},1282:{utm_source:"打开小程序",utm_medium:"听一听播放器打开小程序"},1285:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」短剧合集打开小程序"},1286:{utm_source:"打开小程序",utm_medium:"明文scheme打开小程序"},1287:{utm_source:"打开小程序",utm_medium:"公众号短剧贴片打开小程序"},1292:{utm_source:"打开小程序",utm_medium:"发现页「发现小程序」poi 详情页打开小程序"},1293:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片追剧页打开小程序"},1295:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」广告打开小程序"},1296:{utm_source:"打开小程序",utm_medium:"视频号付费短剧气泡打开小程序"},1297:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开小程序"},1298:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」打开的合集访问小程序"},1299:{utm_source:"打开小程序",utm_medium:"下拉任务栏小程序垂搜「发现小程序」poi 详情页打开小程序"},1300:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」打开的合集访问小程序"},1301:{utm_source:"打开小程序",utm_medium:"发现-小程序-搜索「发现小程序」poi 详情页打开小程序"},1302:{utm_source:"打开小程序",utm_medium:"PC端面板「发现小程序」"},1303:{utm_source:"打开小程序",utm_medium:"发现页短剧卡片视频流打开小程序"},1304:{utm_source:"打开小程序",utm_medium:"手机负一屏打开小程序(比如oppo手机)"},1305:{utm_source:"打开小程序",utm_medium:"公众号播放结束页打开小程序"},1306:{utm_source:"打开小程序",utm_medium:"公众号短剧固定选集入口打开小程序"},1307:{utm_source:"打开小程序",utm_medium:"发现页附近服务境外专区打开小程序"},1308:{utm_source:"打开小游戏",utm_medium:"PC端面板小游戏专区页面"},1311:{utm_source:"打开小游戏",utm_medium:"公众号文章打开小游戏CPS卡片"},1313:{utm_source:"打开小程序",utm_medium:"PC OpenSDK打开小程序"},1325:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的表情包消息角标打开小程序"},1326:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的角标打开小程序"},1327:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息角标打开小程序"},1328:{utm_source:"打开小程序",utm_medium:"聊天工具模式分享的文本消息超链接打开小程序"},1336:{utm_source:"打开小程序",utm_medium:"小店打开小程序关联会员身份"},1337:{utm_source:"打开小程序",utm_medium:"小店确认订单页跳小程序使用会员权益"},1340:{utm_source:"打开小程序",utm_medium:"小程序profile-热门商品入口打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},de=new(function(t){o(i,t);var r=c(i);function i(){return e(this,i),r.call(this,pe)}return n(i,[{key:"load",value:function(t,e){var r=e||{};if(wx.getAccountInfoSync){var n=wx.getAccountInfoSync();n&&n.miniProgram&&n.miniProgram.appId&&(r.appId=n.miniProgram.appId)}return h(u(i.prototype),"load",this).call(this,t,r)}}]),i}(le));return App.zhuge=de,de}));
|