@xyz-fe/log 4.0.0 → 4.2.0

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/mp.d.ts CHANGED
@@ -123,6 +123,7 @@ interface THwCommonParams {
123
123
  accid?: string;
124
124
  apptypeid?: string;
125
125
  appcqid?: string;
126
+ srcqid?: string;
126
127
  appver?: string;
127
128
  userinfo?: string;
128
129
  region?: string;
@@ -148,7 +149,7 @@ interface IHwDomain {
148
149
  open?: string;
149
150
  act?: string;
150
151
  ad?: string;
151
- onlineUrl?: string;
152
+ online?: string;
152
153
  }
153
154
  interface HwInitParams {
154
155
  isPro?: boolean;
package/dist/mp.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * @xyz-fe/log v4.0.0
2
+ * @xyz-fe/log v4.2.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r;exports.EGender=void 0,(r=exports.EGender||(exports.EGender={}))[r.Unknown=0]="Unknown",r[r.Male=1]="Male",r[r.Female=2]="Female";var s=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,a=void 0===s||s,p=t.consoleLog,c=void 0===p||p;this.version="4.0.0",this.buildDate="3/7/2025, 6:00:43 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=a,this._consoleLog=c;var u=this._getApis(n),l=u.openUrl,h=u.eventUrl,d=u.actUrl,m=u.adUrl,_=u.onlineUrl;this._openUrl=l,this._eventUrl=h,this._actUrl=d,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var f,y=this._getMp(),g=y.mp,v=y.platform;this._mp=g,this._platform=v,!g||(f=g)&&0===Object.keys(f).length&&f.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:"4.0.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();exports.XLog=s;
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r;exports.EGender=void 0,(r=exports.EGender||(exports.EGender={}))[r.Unknown=0]="Unknown",r[r.Male=1]="Male",r[r.Female=2]="Female";var s=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,a=void 0===s||s,p=t.consoleLog,c=void 0===p||p;this.version="4.2.0",this.buildDate="3/13/2025, 5:16:49 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=a,this._consoleLog=c;var u=this._getApis(n),l=u.openUrl,h=u.eventUrl,d=u.actUrl,m=u.adUrl,_=u.onlineUrl;this._openUrl=l,this._eventUrl=h,this._actUrl=d,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var f,y=this._getMp(),g=y.mp,v=y.platform;this._mp=g,this._platform=v,!g||(f=g)&&0===Object.keys(f).length&&f.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:"4.2.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();exports.XLog=s;
7
7
  //# sourceMappingURL=mp.js.map
package/dist/mp.min.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * @xyz-fe/log v4.0.0
2
+ * @xyz-fe/log v4.2.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function n(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function o(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function i(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function r(t,n){var o=e({},t),i=e({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),e(e({},o),i)}var s,a="4.0.0",p="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female";var c=function(){function t(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,p=void 0===s||s,c=t.consoleLog,u=void 0===c||c;this.version=a,this.buildDate="3/7/2025, 6:00:43 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=p,this._consoleLog=u;var l=this._getApis(n),h=l.openUrl,d=l.eventUrl,f=l.actUrl,m=l.adUrl,_=l.onlineUrl;this._openUrl=h,this._eventUrl=d,this._actUrl=f,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var y,g=this._getMp(),v=g.mp,O=g.platform;this._mp=v,this._platform=O,!v||(y=v)&&0===Object.keys(y).length&&y.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",v);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},t.prototype._updateQuerystring=function(t,n){void 0===t&&(t=null),void 0===n&&(n={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},t.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},t.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},t.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},t.prototype._getApis=function(t){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=e(e({},n),t);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:p,appqid:p+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=e(e({},n),JSON.parse(o))),n=t?r(n,t):n,this._updateCommonParams(e(e({},n),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},t.prototype._getUserInfo=function(t){var n={};if(t)try{n=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(e(e(e({},this._extraInfo),o),n))},t.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=r(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,t.querystring);var o=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==n?void 0:n.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},t.prototype.act=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},t.prototype.ad=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},t.prototype.code2session=function(t){return n(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),n="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(n,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,o.sent().data]}}))}))},t.prototype.getSubsidy=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.getUserProps=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.checkOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.createOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},t}();t.XLog=c,Object.defineProperty(t,"__esModule",{value:!0})}));
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function n(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function o(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function i(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function r(t,n){var o=e({},t),i=e({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),e(e({},o),i)}var s,a="4.2.0",p="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female";var c=function(){function t(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,p=void 0===s||s,c=t.consoleLog,u=void 0===c||c;this.version=a,this.buildDate="3/13/2025, 5:16:49 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=p,this._consoleLog=u;var l=this._getApis(n),h=l.openUrl,d=l.eventUrl,f=l.actUrl,m=l.adUrl,_=l.onlineUrl;this._openUrl=h,this._eventUrl=d,this._actUrl=f,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var y,g=this._getMp(),v=g.mp,O=g.platform;this._mp=v,this._platform=O,!v||(y=v)&&0===Object.keys(y).length&&y.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",v);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},t.prototype._updateQuerystring=function(t,n){void 0===t&&(t=null),void 0===n&&(n={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},t.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},t.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},t.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},t.prototype._getApis=function(t){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=e(e({},n),t);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:p,appqid:p+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=e(e({},n),JSON.parse(o))),n=t?r(n,t):n,this._updateCommonParams(e(e({},n),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},t.prototype._getUserInfo=function(t){var n={};if(t)try{n=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(e(e(e({},this._extraInfo),o),n))},t.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=r(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,t.querystring);var o=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==n?void 0:n.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},t.prototype.act=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},t.prototype.ad=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},t.prototype.code2session=function(t){return n(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),n="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(n,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,o.sent().data]}}))}))},t.prototype.getSubsidy=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.getUserProps=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.checkOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.createOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},t}();t.XLog=c,Object.defineProperty(t,"__esModule",{value:!0})}));
7
7
  //# sourceMappingURL=mp.min.js.map
package/dist/mp.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * @xyz-fe/log v4.0.0
2
+ * @xyz-fe/log v4.2.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r;!function(t){t[t.Unknown=0]="Unknown",t[t.Male=1]="Male",t[t.Female=2]="Female"}(r||(r={}));var s=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,a=void 0===s||s,p=t.consoleLog,c=void 0===p||p;this.version="4.0.0",this.buildDate="3/7/2025, 6:00:43 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=a,this._consoleLog=c;var u=this._getApis(n),l=u.openUrl,h=u.eventUrl,d=u.actUrl,m=u.adUrl,f=u.onlineUrl;this._openUrl=l,this._eventUrl=h,this._actUrl=d,this._adUrl=m,this._onlineUrl=f,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var _,y=this._getMp(),g=y.mp,v=y.platform;this._mp=g,this._platform=v,!g||(_=g)&&0===Object.keys(_).length&&_.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:"4.0.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();export{r as EGender,s as XLog};
6
+ var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r;!function(t){t[t.Unknown=0]="Unknown",t[t.Male=1]="Male",t[t.Female=2]="Female"}(r||(r={}));var s=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,a=void 0===s||s,p=t.consoleLog,c=void 0===p||p;this.version="4.2.0",this.buildDate="3/13/2025, 5:16:49 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=a,this._consoleLog=c;var u=this._getApis(n),l=u.openUrl,h=u.eventUrl,d=u.actUrl,m=u.adUrl,f=u.onlineUrl;this._openUrl=l,this._eventUrl=h,this._actUrl=d,this._adUrl=m,this._onlineUrl=f,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var _,y=this._getMp(),g=y.mp,v=y.platform;this._mp=g,this._platform=v,!g||(_=g)&&0===Object.keys(_).length&&_.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:"4.2.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();export{r as EGender,s as XLog};
7
7
  //# sourceMappingURL=mp.mjs.map
package/dist/web-hw.d.ts CHANGED
@@ -123,6 +123,7 @@ interface THwCommonParams {
123
123
  accid?: string;
124
124
  apptypeid?: string;
125
125
  appcqid?: string;
126
+ srcqid?: string;
126
127
  appver?: string;
127
128
  userinfo?: string;
128
129
  region?: string;
@@ -148,7 +149,7 @@ interface IHwDomain {
148
149
  open?: string;
149
150
  act?: string;
150
151
  ad?: string;
151
- onlineUrl?: string;
152
+ online?: string;
152
153
  }
153
154
  interface HwInitParams {
154
155
  isPro?: boolean;
package/dist/web-hw.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @xyz-fe/log v4.0.0
2
+ * @xyz-fe/log v4.2.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var o,i=1,n=arguments.length;i<n;i++)for(var t in o=arguments[i])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e},e.apply(this,arguments)};function o(e,o){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(i[n[t]]=e[n[t]])}return i}function i(e,o,i){if(i||2===arguments.length)for(var n,t=0,r=o.length;t<r;t++)!n&&t in o||(n||(n=Array.prototype.slice.call(o,0,t)),n[t]=o[t]);return e.concat(n||Array.prototype.slice.call(o))}function n(e){return void 0!==typeof localStorage?localStorage.getItem("XYZ_LOG_"+e):null}function t(e,o){void 0!==typeof localStorage&&localStorage.setItem("XYZ_LOG_"+e,o)}function r(e,o){void 0===e&&(e=18),void 0===o&&(o=0);for(var i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],t=Math.random,r=e,a=o||i.length,s=0;s<r;s++)n[s]=i[0|t()*a];return n.join("")}function a(e){void 0===e&&(e="UID");var o=n(e);return o||t(e,o=r()),o}function s(e,o){void 0===e&&(e=[]),void 0===o&&(o=location.href);var i=new URL(o).search.substring(1),n={};return i&&i.split("&").forEach((function(e){n[e.split("=")[0]]=e.split("=")[1]})),Object.keys(n).forEach((function(o){e.includes(o)&&delete n[o]})),n}function c(o,i){var n=e({},o),t=e({},i);return Object.keys(n).forEach((function(e){t[e]||delete t[e]})),e(e({},n),t)}function l(e){for(var o,n,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!t.length)return e;var a=t.shift();if(a&&"object"==typeof a)for(var s in a)a[s]&&"object"==typeof a[s]?(e[s]||Object.assign(e,((o={})[s]={},o)),l(e[s],a[s])):Object.assign(e,((n={})[s]=a[s],n));return l.apply(void 0,i([e],t,!1))}var u=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(o){return e.includes(o)}))?"h5":"pc");var e};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={exports:{}};!function(e,o){!function(i,n){var t="function",r="undefined",a="object",s="string",c="model",l="name",u="type",p="vendor",d="version",f="architecture",m="console",b="mobile",w="tablet",h="smarttv",g="wearable",v="embedded",y="Amazon",_="Apple",x="ASUS",k="BlackBerry",O="Firefox",P="Google",S="Huawei",U="LG",C="Microsoft",A="Motorola",N="Opera",L="Samsung",T="Sony",E="Xiaomi",I="Zebra",R="Facebook",j=function(e){for(var o={},i=0;i<e.length;i++)o[e[i].toUpperCase()]=e[i];return o},B=function(e,o){return typeof e===s&&-1!==M(o).indexOf(M(e))},M=function(e){return e.toLowerCase()},q=function(e,o){if(typeof e===s)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof o===r?e:e.substring(0,255)},z=function(e,o){for(var i,r,s,c,l,u,p=0;p<o.length&&!l;){var d=o[p],f=o[p+1];for(i=r=0;i<d.length&&!l;)if(l=d[i++].exec(e))for(s=0;s<f.length;s++)u=l[++r],typeof(c=f[s])===a&&c.length>0?2===c.length?typeof c[1]==t?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==t||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):n:this[c[0]]=u?c[1].call(this,u,c[2]):n:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):n):this[c]=u||n;p+=2}},D=function(e,o){for(var i in o)if(typeof o[i]===a&&o[i].length>0){for(var t=0;t<o[i].length;t++)if(B(o[i][t],e))return"?"===i?n:i}else if(B(o[i],e))return"?"===i?n:i;return e},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[l,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,R],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,D,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,M]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",M]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,M]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[p,L],[u,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[p,L],[u,b]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[p,_],[u,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[p,_],[u,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[p,S],[u,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[c,[p,S],[u,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[p,E],[u,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[p,E],[u,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[p,"OPPO"],[u,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[p,"Vivo"],[u,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[p,"Realme"],[u,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[p,A],[u,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[p,A],[u,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[p,U],[u,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[p,U],[u,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[p,"Lenovo"],[u,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[p,"Nokia"],[u,b]],[/(pixel c)\b/i],[c,[p,P],[u,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[p,P],[u,b]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[p,T],[u,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[p,T],[u,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[p,"OnePlus"],[u,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[p,y],[u,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[p,y],[u,b]],[/(playbook);[-\w\),; ]+(rim)/i],[c,p,[u,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[p,k],[u,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[p,x],[u,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[p,x],[u,b]],[/(nexus 9)/i],[c,[p,"HTC"],[u,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[p,[c,/_/g," "],[u,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[p,"Acer"],[u,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[p,"Meizu"],[u,b]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[p,"Sharp"],[u,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,c,[u,b]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,c,[u,w]],[/(surface duo)/i],[c,[p,C],[u,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[p,"Fairphone"],[u,b]],[/(u304aa)/i],[c,[p,"AT&T"],[u,b]],[/\bsie-(\w*)/i],[c,[p,"Siemens"],[u,b]],[/\b(rct\w+) b/i],[c,[p,"RCA"],[u,w]],[/\b(venue[\d ]{2,7}) b/i],[c,[p,"Dell"],[u,w]],[/\b(q(?:mv|ta)\w+) b/i],[c,[p,"Verizon"],[u,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[p,"Barnes & Noble"],[u,w]],[/\b(tm\d{3}\w+) b/i],[c,[p,"NuVision"],[u,w]],[/\b(k88) b/i],[c,[p,"ZTE"],[u,w]],[/\b(nx\d{3}j) b/i],[c,[p,"ZTE"],[u,b]],[/\b(gen\d{3}) b.+49h/i],[c,[p,"Swiss"],[u,b]],[/\b(zur\d{3}) b/i],[c,[p,"Swiss"],[u,w]],[/\b((zeki)?tb.*\b) b/i],[c,[p,"Zeki"],[u,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],c,[u,w]],[/\b(ns-?\w{0,9}) b/i],[c,[p,"Insignia"],[u,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[p,"NextBook"],[u,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],c,[u,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],c,[u,b]],[/\b(ph-1) /i],[c,[p,"Essential"],[u,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[p,"Envizen"],[u,w]],[/\b(trio[-\w\. ]+) b/i],[c,[p,"MachSpeed"],[u,w]],[/\btu_(1491) b/i],[c,[p,"Rotor"],[u,w]],[/(shield[\w ]+) b/i],[c,[p,"Nvidia"],[u,w]],[/(sprint) (\w+)/i],[p,c,[u,b]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[p,C],[u,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[p,I],[u,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[p,I],[u,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,c,[u,m]],[/droid.+; (shield) bui/i],[c,[p,"Nvidia"],[u,m]],[/(playstation [345portablevi]+)/i],[c,[p,T],[u,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[p,C],[u,m]],[/smart-tv.+(samsung)/i],[p,[u,h]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[p,L],[u,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,U],[u,h]],[/(apple) ?tv/i],[p,[c,"Apple TV"],[u,h]],[/crkey/i],[[c,"Chromecast"],[p,P],[u,h]],[/droid.+aft(\w)( bui|\))/i],[c,[p,y],[u,h]],[/\(dtv[\);].+(aquos)/i],[c,[p,"Sharp"],[u,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,q],[c,q],[u,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,h]],[/((pebble))app/i],[p,c,[u,g]],[/droid.+; (glass) \d/i],[c,[p,P],[u,g]],[/droid.+; (wt63?0{2,3})\)/i],[c,[p,I],[u,g]],[/(quest( 2)?)/i],[c,[p,R],[u,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[u,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[u,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,w]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,b]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,D,G]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,D,G]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},J=function(e,o){if(typeof e===a&&(o=e,e=n),!(this instanceof J))return new J(e,o).getResult();var t=e||(typeof i!==r&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),c=o?function(e,o){var i={};for(var n in e)o[n]&&o[n].length%2==0?i[n]=o[n].concat(e[n]):i[n]=e[n];return i}(X,o):X;return this.getBrowser=function(){var e,o={};return o.name=n,o.version=n,z.call(o,t,c.browser),o.major=typeof(e=o.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,o},this.getCPU=function(){var e={};return e.architecture=n,z.call(e,t,c.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,z.call(e,t,c.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,z.call(e,t,c.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,z.call(e,t,c.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return t},this.setUA=function(e){return t=typeof e===s&&e.length>255?q(e,255):e,this},this.setUA(t),this};J.VERSION="1.0.2",J.BROWSER=j([l,d,"major"]),J.CPU=j([f]),J.DEVICE=j([c,p,u,m,b,h,w,g,v]),J.ENGINE=J.OS=j([l,d]),e.exports&&(o=e.exports=J),o.UAParser=J;var F=typeof i!==r&&(i.jQuery||i.Zepto);if(F&&!F.ua){var Z=new J;F.ua=Z.getResult(),F.ua.get=function(){return Z.getUA()},F.ua.set=function(e){Z.setUA(e);var o=Z.getResult();for(var i in o)F.ua[i]=o[i]}}}("object"==typeof window?window:p)}(d,d.exports);var f=new d.exports.UAParser,m=f.getBrowser(),b=m.name,w=m.version,h=f.getEngine(),g=h.name,v=h.version,y=function(){var e=(0,f.getOS)();return{os:e.name,osversion:e.version}}(),_=y.os,x=y.osversion,k=function(){var e=(0,f.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),O=k.device,P=k.devicebrand;_=_||"",x=x||"",O=O||"",P=P||"";var S={exports:{}},U={exports:{}},C=1e3,A=60*C,N=60*A,L=24*N,T=365.25*L,E=function(e,o){o=o||{};var i=typeof e;if("string"===i&&e.length>0)return function(e){if((e=String(e)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!o)return;var i=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*T;case"days":case"day":case"d":return i*L;case"hours":case"hour":case"hrs":case"hr":case"h":return i*N;case"minutes":case"minute":case"mins":case"min":case"m":return i*A;case"seconds":case"second":case"secs":case"sec":case"s":return i*C;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===i&&!1===isNaN(e))return o.long?function(e){return I(e,L,"day")||I(e,N,"hour")||I(e,A,"minute")||I(e,C,"second")||e+" ms"}(e):function(e){if(e>=L)return Math.round(e/L)+"d";if(e>=N)return Math.round(e/N)+"h";if(e>=A)return Math.round(e/A)+"m";if(e>=C)return Math.round(e/C)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function I(e,o,i){if(!(e<o))return e<1.5*o?Math.floor(e/o)+" "+i:Math.ceil(e/o)+" "+i+"s"}!function(e,o){var i;function n(e){function n(){if(n.enabled){var e=n,t=+new Date,r=t-(i||t);e.diff=r,e.prev=i,e.curr=t,i=t;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=o.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(i,n){if("%%"===i)return i;c++;var t=o.formatters[n];if("function"==typeof t){var r=a[c];i=t.call(e,r),a.splice(c,1),c--}return i})),o.formatArgs.call(e,a);var l=n.log||o.log||console.log.bind(console);l.apply(e,a)}}return n.namespace=e,n.enabled=o.enabled(e),n.useColors=o.useColors(),n.color=function(e){var i,n=0;for(i in e)n=(n<<5)-n+e.charCodeAt(i),n|=0;return o.colors[Math.abs(n)%o.colors.length]}(e),"function"==typeof o.init&&o.init(n),n}(o=U.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},o.disable=function(){o.enable("")},o.enable=function(e){o.save(e),o.names=[],o.skips=[];for(var i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length,t=0;t<n;t++)i[t]&&("-"===(e=i[t].replace(/\*/g,".*?"))[0]?o.skips.push(new RegExp("^"+e.substr(1)+"$")):o.names.push(new RegExp("^"+e+"$")))},o.enabled=function(e){var i,n;for(i=0,n=o.skips.length;i<n;i++)if(o.skips[i].test(e))return!1;for(i=0,n=o.names.length;i<n;i++)if(o.names[i].test(e))return!0;return!1},o.humanize=E,o.names=[],o.skips=[],o.formatters={}}(0,U.exports),function(e,o){function i(){var e;try{e=o.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(o=e.exports=U.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},o.formatArgs=function(e){var i=this.useColors;if(e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+o.humanize(this.diff),!i)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(r=t))})),e.splice(r,0,n)},o.save=function(e){try{null==e?o.storage.removeItem("debug"):o.storage.debug=e}catch(e){}},o.load=i,o.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},o.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},o.enable(i())}(S,S.exports);var R=S.exports("jsonp"),j=function(e,o,i){"function"==typeof o&&(i=o,o={});o||(o={});var n,t,r=o.prefix||"__jp",a=o.name||r+B++,s=o.param||"callback",c=null!=o.timeout?o.timeout:6e4,l=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(t=setTimeout((function(){p(),i&&i(new Error("Timeout"))}),c));function p(){n.parentNode&&n.parentNode.removeChild(n),window[a]=M,t&&clearTimeout(t)}return window[a]=function(e){R("jsonp got",e),p(),i&&i(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+l(a)).replace("?&","?"),R('jsonp req "%s"',e),(n=document.createElement("script")).src=e,u.parentNode.insertBefore(n,u),function(){window[a]&&p()}},B=0;function M(){}function q(e,o){return void 0===o&&(o={}),new Promise((function(i,n){var t;j("".concat(e,"?").concat((t=o,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__")},(function(e,o){e?n(e):i(o)}))}))}
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var o,i=1,n=arguments.length;i<n;i++)for(var t in o=arguments[i])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e},e.apply(this,arguments)};function o(e,o){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(i[n[t]]=e[n[t]])}return i}function i(e,o,i){if(i||2===arguments.length)for(var n,t=0,r=o.length;t<r;t++)!n&&t in o||(n||(n=Array.prototype.slice.call(o,0,t)),n[t]=o[t]);return e.concat(n||Array.prototype.slice.call(o))}function n(e){return void 0!==typeof localStorage?localStorage.getItem("XYZ_LOG_"+e):null}function t(e,o){void 0!==typeof localStorage&&localStorage.setItem("XYZ_LOG_"+e,o)}function r(e,o){void 0===e&&(e=18),void 0===o&&(o=0);for(var i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],t=Math.random,r=e,a=o||i.length,s=0;s<r;s++)n[s]=i[0|t()*a];return n.join("")}function a(e){void 0===e&&(e="UID");var o=n(e);return o||t(e,o=r()),o}function s(e,o){void 0===e&&(e=[]),void 0===o&&(o=location.href);var i=new URL(o).search.substring(1),n={};return i&&i.split("&").forEach((function(e){n[e.split("=")[0]]=e.split("=")[1]})),Object.keys(n).forEach((function(o){e.includes(o)&&delete n[o]})),n}function c(o,i){var n=e({},o),t=e({},i);return Object.keys(n).forEach((function(e){t[e]||delete t[e]})),e(e({},n),t)}function l(e){for(var o,n,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!t.length)return e;var a=t.shift();if(a&&"object"==typeof a)for(var s in a)a[s]&&"object"==typeof a[s]?(e[s]||Object.assign(e,((o={})[s]={},o)),l(e[s],a[s])):Object.assign(e,((n={})[s]=a[s],n));return l.apply(void 0,i([e],t,!1))}var u=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(o){return e.includes(o)}))?"h5":"pc");var e};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={exports:{}};!function(e,o){!function(i,n){var t="function",r="undefined",a="object",s="string",c="model",l="name",u="type",p="vendor",d="version",f="architecture",m="console",b="mobile",w="tablet",h="smarttv",g="wearable",v="embedded",y="Amazon",_="Apple",x="ASUS",k="BlackBerry",O="Firefox",P="Google",S="Huawei",U="LG",C="Microsoft",A="Motorola",N="Opera",L="Samsung",T="Sony",E="Xiaomi",I="Zebra",R="Facebook",j=function(e){for(var o={},i=0;i<e.length;i++)o[e[i].toUpperCase()]=e[i];return o},B=function(e,o){return typeof e===s&&-1!==q(o).indexOf(q(e))},q=function(e){return e.toLowerCase()},M=function(e,o){if(typeof e===s)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof o===r?e:e.substring(0,255)},z=function(e,o){for(var i,r,s,c,l,u,p=0;p<o.length&&!l;){var d=o[p],f=o[p+1];for(i=r=0;i<d.length&&!l;)if(l=d[i++].exec(e))for(s=0;s<f.length;s++)u=l[++r],typeof(c=f[s])===a&&c.length>0?2===c.length?typeof c[1]==t?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==t||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):n:this[c[0]]=u?c[1].call(this,u,c[2]):n:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):n):this[c]=u||n;p+=2}},D=function(e,o){for(var i in o)if(typeof o[i]===a&&o[i].length>0){for(var t=0;t<o[i].length;t++)if(B(o[i][t],e))return"?"===i?n:i}else if(B(o[i],e))return"?"===i?n:i;return e},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[l,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,R],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,D,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,q]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[p,L],[u,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[p,L],[u,b]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[p,_],[u,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[p,_],[u,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[p,S],[u,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[c,[p,S],[u,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[p,E],[u,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[p,E],[u,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[p,"OPPO"],[u,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[p,"Vivo"],[u,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[p,"Realme"],[u,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[p,A],[u,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[p,A],[u,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[p,U],[u,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[p,U],[u,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[p,"Lenovo"],[u,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[p,"Nokia"],[u,b]],[/(pixel c)\b/i],[c,[p,P],[u,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[p,P],[u,b]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[p,T],[u,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[p,T],[u,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[p,"OnePlus"],[u,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[p,y],[u,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[p,y],[u,b]],[/(playbook);[-\w\),; ]+(rim)/i],[c,p,[u,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[p,k],[u,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[p,x],[u,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[p,x],[u,b]],[/(nexus 9)/i],[c,[p,"HTC"],[u,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[p,[c,/_/g," "],[u,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[p,"Acer"],[u,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[p,"Meizu"],[u,b]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[p,"Sharp"],[u,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,c,[u,b]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,c,[u,w]],[/(surface duo)/i],[c,[p,C],[u,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[p,"Fairphone"],[u,b]],[/(u304aa)/i],[c,[p,"AT&T"],[u,b]],[/\bsie-(\w*)/i],[c,[p,"Siemens"],[u,b]],[/\b(rct\w+) b/i],[c,[p,"RCA"],[u,w]],[/\b(venue[\d ]{2,7}) b/i],[c,[p,"Dell"],[u,w]],[/\b(q(?:mv|ta)\w+) b/i],[c,[p,"Verizon"],[u,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[p,"Barnes & Noble"],[u,w]],[/\b(tm\d{3}\w+) b/i],[c,[p,"NuVision"],[u,w]],[/\b(k88) b/i],[c,[p,"ZTE"],[u,w]],[/\b(nx\d{3}j) b/i],[c,[p,"ZTE"],[u,b]],[/\b(gen\d{3}) b.+49h/i],[c,[p,"Swiss"],[u,b]],[/\b(zur\d{3}) b/i],[c,[p,"Swiss"],[u,w]],[/\b((zeki)?tb.*\b) b/i],[c,[p,"Zeki"],[u,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],c,[u,w]],[/\b(ns-?\w{0,9}) b/i],[c,[p,"Insignia"],[u,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[p,"NextBook"],[u,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],c,[u,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],c,[u,b]],[/\b(ph-1) /i],[c,[p,"Essential"],[u,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[p,"Envizen"],[u,w]],[/\b(trio[-\w\. ]+) b/i],[c,[p,"MachSpeed"],[u,w]],[/\btu_(1491) b/i],[c,[p,"Rotor"],[u,w]],[/(shield[\w ]+) b/i],[c,[p,"Nvidia"],[u,w]],[/(sprint) (\w+)/i],[p,c,[u,b]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[p,C],[u,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[p,I],[u,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[p,I],[u,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,c,[u,m]],[/droid.+; (shield) bui/i],[c,[p,"Nvidia"],[u,m]],[/(playstation [345portablevi]+)/i],[c,[p,T],[u,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[p,C],[u,m]],[/smart-tv.+(samsung)/i],[p,[u,h]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[p,L],[u,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,U],[u,h]],[/(apple) ?tv/i],[p,[c,"Apple TV"],[u,h]],[/crkey/i],[[c,"Chromecast"],[p,P],[u,h]],[/droid.+aft(\w)( bui|\))/i],[c,[p,y],[u,h]],[/\(dtv[\);].+(aquos)/i],[c,[p,"Sharp"],[u,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,M],[c,M],[u,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,h]],[/((pebble))app/i],[p,c,[u,g]],[/droid.+; (glass) \d/i],[c,[p,P],[u,g]],[/droid.+; (wt63?0{2,3})\)/i],[c,[p,I],[u,g]],[/(quest( 2)?)/i],[c,[p,R],[u,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[u,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[u,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,w]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,b]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,D,G]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,D,G]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},J=function(e,o){if(typeof e===a&&(o=e,e=n),!(this instanceof J))return new J(e,o).getResult();var t=e||(typeof i!==r&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),c=o?function(e,o){var i={};for(var n in e)o[n]&&o[n].length%2==0?i[n]=o[n].concat(e[n]):i[n]=e[n];return i}(X,o):X;return this.getBrowser=function(){var e,o={};return o.name=n,o.version=n,z.call(o,t,c.browser),o.major=typeof(e=o.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,o},this.getCPU=function(){var e={};return e.architecture=n,z.call(e,t,c.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,z.call(e,t,c.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,z.call(e,t,c.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,z.call(e,t,c.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return t},this.setUA=function(e){return t=typeof e===s&&e.length>255?M(e,255):e,this},this.setUA(t),this};J.VERSION="1.0.2",J.BROWSER=j([l,d,"major"]),J.CPU=j([f]),J.DEVICE=j([c,p,u,m,b,h,w,g,v]),J.ENGINE=J.OS=j([l,d]),e.exports&&(o=e.exports=J),o.UAParser=J;var F=typeof i!==r&&(i.jQuery||i.Zepto);if(F&&!F.ua){var Z=new J;F.ua=Z.getResult(),F.ua.get=function(){return Z.getUA()},F.ua.set=function(e){Z.setUA(e);var o=Z.getResult();for(var i in o)F.ua[i]=o[i]}}}("object"==typeof window?window:p)}(d,d.exports);var f=new d.exports.UAParser,m=f.getBrowser(),b=m.name,w=m.version,h=f.getEngine(),g=h.name,v=h.version,y=function(){var e=(0,f.getOS)();return{os:e.name,osversion:e.version}}(),_=y.os,x=y.osversion,k=function(){var e=(0,f.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),O=k.device,P=k.devicebrand;_=_||"",x=x||"",O=O||"",P=P||"";var S={exports:{}},U={exports:{}},C=1e3,A=60*C,N=60*A,L=24*N,T=365.25*L,E=function(e,o){o=o||{};var i=typeof e;if("string"===i&&e.length>0)return function(e){if((e=String(e)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!o)return;var i=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*T;case"days":case"day":case"d":return i*L;case"hours":case"hour":case"hrs":case"hr":case"h":return i*N;case"minutes":case"minute":case"mins":case"min":case"m":return i*A;case"seconds":case"second":case"secs":case"sec":case"s":return i*C;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===i&&!1===isNaN(e))return o.long?function(e){return I(e,L,"day")||I(e,N,"hour")||I(e,A,"minute")||I(e,C,"second")||e+" ms"}(e):function(e){if(e>=L)return Math.round(e/L)+"d";if(e>=N)return Math.round(e/N)+"h";if(e>=A)return Math.round(e/A)+"m";if(e>=C)return Math.round(e/C)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function I(e,o,i){if(!(e<o))return e<1.5*o?Math.floor(e/o)+" "+i:Math.ceil(e/o)+" "+i+"s"}!function(e,o){var i;function n(e){function n(){if(n.enabled){var e=n,t=+new Date,r=t-(i||t);e.diff=r,e.prev=i,e.curr=t,i=t;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=o.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(i,n){if("%%"===i)return i;c++;var t=o.formatters[n];if("function"==typeof t){var r=a[c];i=t.call(e,r),a.splice(c,1),c--}return i})),o.formatArgs.call(e,a);var l=n.log||o.log||console.log.bind(console);l.apply(e,a)}}return n.namespace=e,n.enabled=o.enabled(e),n.useColors=o.useColors(),n.color=function(e){var i,n=0;for(i in e)n=(n<<5)-n+e.charCodeAt(i),n|=0;return o.colors[Math.abs(n)%o.colors.length]}(e),"function"==typeof o.init&&o.init(n),n}(o=U.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},o.disable=function(){o.enable("")},o.enable=function(e){o.save(e),o.names=[],o.skips=[];for(var i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length,t=0;t<n;t++)i[t]&&("-"===(e=i[t].replace(/\*/g,".*?"))[0]?o.skips.push(new RegExp("^"+e.substr(1)+"$")):o.names.push(new RegExp("^"+e+"$")))},o.enabled=function(e){var i,n;for(i=0,n=o.skips.length;i<n;i++)if(o.skips[i].test(e))return!1;for(i=0,n=o.names.length;i<n;i++)if(o.names[i].test(e))return!0;return!1},o.humanize=E,o.names=[],o.skips=[],o.formatters={}}(0,U.exports),function(e,o){function i(){var e;try{e=o.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(o=e.exports=U.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},o.formatArgs=function(e){var i=this.useColors;if(e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+o.humanize(this.diff),!i)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(r=t))})),e.splice(r,0,n)},o.save=function(e){try{null==e?o.storage.removeItem("debug"):o.storage.debug=e}catch(e){}},o.load=i,o.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},o.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},o.enable(i())}(S,S.exports);var R=S.exports("jsonp"),j=function(e,o,i){"function"==typeof o&&(i=o,o={});o||(o={});var n,t,r=o.prefix||"__jp",a=o.name||r+B++,s=o.param||"callback",c=null!=o.timeout?o.timeout:6e4,l=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(t=setTimeout((function(){p(),i&&i(new Error("Timeout"))}),c));function p(){n.parentNode&&n.parentNode.removeChild(n),window[a]=q,t&&clearTimeout(t)}return window[a]=function(e){R("jsonp got",e),p(),i&&i(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+l(a)).replace("?&","?"),R('jsonp req "%s"',e),(n=document.createElement("script")).src=e,u.parentNode.insertBefore(n,u),function(){window[a]&&p()}},B=0;function q(){}function M(e,o){return void 0===o&&(o={}),new Promise((function(i,n){var t;j("".concat(e,"?").concat((t=o,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__")},(function(e,o){e?n(e):i(o)}))}))}
7
7
  /*! js-cookie v3.0.5 | MIT */
8
- function z(e){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var n in i)e[n]=i[n]}return e}var D,G=function e(o,i){function n(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=z({},i,t)).expires&&(t.expires=new Date(Date.now()+864e5*t.expires)),t.expires&&(t.expires=t.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in t)t[a]&&(r+="; "+a,!0!==t[a]&&(r+="="+t[a].split(";")[0]));return document.cookie=e+"="+o.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var i=document.cookie?document.cookie.split("; "):[],n={},t=0;t<i.length;t++){var r=i[t].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(n[s]=o.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,o){n(e,"",z({},o,{expires:-1}))},withAttributes:function(o){return e(this.converter,z({},this.attributes,o))},withConverter:function(o){return e(z({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(o)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});exports.EGender=void 0,(D=exports.EGender||(exports.EGender={}))[D.Unknown=0]="Unknown",D[D.Male=1]="Male",D[D.Female=2]="Female";var X="".concat("XYZ_LOG_HW_","COMMON_PARAMS"),J="".concat("XYZ_LOG_HW_","ONLINE_BACH_DATA"),F=function(){function i(e){var o=e.domain,i=e.commonParams,n=e.isPro,t=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,l=e.ignoreUrlParams,u=void 0===l?[]:l;this.version="4.0.0",this.buildDate="3/7/2025, 6:00:43 PM",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=t,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var p=this._getApis(o),d=p.openUrl,f=p.actUrl,m=p.adUrl,b=p.onlineUrl;this._openUrl=d,this._actUrl=f,this._adUrl=m,this._onlineUrl=b,this._init(i)}return Object.defineProperty(i.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),i.prototype._init=function(o){var i=this;this._updateCommonParams(e(e({},this._filterParams(o)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){i._updateCommonParams({}),i._open(1),i._startTime=Date.now();var e=i._getOnlineBatchData();e&&i._online(e)}),(function(){i._open(5),i._sendOnline()}))},i.prototype._visibilityChange=function(e,o){void 0===e&&(e=function(){}),void 0===o&&(o=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():o()}),!1)},i.prototype._getScreen=function(){var e=window.screen,o=e.width,i=e.height;return"".concat(o,"*").concat(i)},i.prototype._getNetWorkType=function(){var e=window.navigator,o=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==o?void 0:o.type)||(null==o?void 0:o.effectiveType)||"other"},i.prototype._getBatchId=function(){var e,o=(e="BATCH_ID",void 0!==typeof sessionStorage?sessionStorage.getItem("XYZ_LOG_"+e):null);return o||function(e,o){void 0!==typeof sessionStorage&&sessionStorage.setItem("XYZ_LOG_"+e,o)}("BATCH_ID",o=r()),o},i.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},i.prototype._getApis=function(o){var i=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",onlineUrl:"https://wappubog.snake.cc"}:{open:"http://test-wappubog.snake.cc",act:"http://test-wappubog.snake.cc",ad:"http://test-wappubog.snake.cc",onlineUrl:"http://test-wappubog.snake.cc"},n=e(e({},i),o);return{openUrl:"".concat(n.open,"/wappubog/h5/open"),actUrl:"".concat(n.act,"/wappubog/h5/activity"),adUrl:"".concat(n.ad,"/gamefunction_logs/h5/advlog"),onlineUrl:"".concat(n.onlineUrl,"/gamefunction_logs/applet/onlineTime")}},i.prototype._cacheCommonParams=function(i){var r=n(X),a=this._getInitParams(),s=a.userinfo,l=o(a,["userinfo"]),u=JSON.parse(r||"{}"),p=u.userinfo,d=o(u,["userinfo"]),f=i.userinfo,m=o(i,["userinfo"]),b=e(e(e({},JSON.parse(s||"{}")),JSON.parse(p||"{}")),JSON.parse(f||"{}")),w=c(c(l,d),m);this._commonParams=e(e({},w),{userinfo:JSON.stringify(b)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),t(X,JSON.stringify(this._commonParams))},i.prototype._getInitParams=function(){return{osversion:x,device:O,devicebrand:P,os:_,platform:u(),uid:a(),appcqid:"organic",pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),o=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(o)),url:encodeURI(location.href)};var e,o},i.prototype._getUserInfo=function(e){var o={};if(e)try{o=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var i={};if(this._commonParams.userinfo)try{i=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(l({lang:navigator.language,browser:b,browserversion:w,engine:g,engineversion:v,platform:u(),querystring:s(this._ignoreUrlParams),fbc:G.get("_fbc"),fbp:G.get("_fbp"),ttp:G.get("_ttp")},i,o))},i.prototype._filterParams=function(e){var o={};if(e){var i=["openid","accid","apptypeid","appcqid","appver","userinfo","srcinfo","region","province","uid","platform"];for(var n in e){var t=n,r=e[t];i.includes(t)&&r&&(o[t]=r)}}return o},i.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var o=this._commonParams.region,i=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==o||e.province&&e.province!==i)&&this._open(6)}},i.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var o=this._commonParams.region,i=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==o||e.province&&e.province!==i)&&this._open(6)}},i.prototype._updateCommonParams=function(o){var i;this._consoleLog&&console.log("[XLOG] _updateCommonParams",o),o.userinfo?o.userinfo=this._getUserInfo(o.userinfo):o.userinfo=this._getUserInfo();try{i=JSON.parse(o.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(o.userinfo,'" parse error'),e)}o.platform&&(o.userinfo=this._getUserInfo(JSON.stringify(e(e({},i),{platform:o.platform})))),this._cacheCommonParams(e(e({},o),{url:encodeURI(location.href),network:this._getNetWorkType()}))},i.prototype._request=function(e,o){var i=this;return function(e,o){return q(e,o)}(e,o).then((function(n){return i._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),o,n),n})).catch((function(i){return console.error("[XLOG] ERROR: ".concat(e),o,i),Promise.reject(i)}))},i.prototype._open=function(o){if(this._sendOpenLog){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:"4.0.0",url_from:document.referrer,openway:o});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",i),this._request(this._openUrl,i)}},i.prototype.act=function(o){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:o.actentryid||"",subactid:o.subactid||"",type:o.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",i),this._request(this._actUrl,i)},i.prototype.ad=function(o){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:o.type||"",code:o.code||"",codeinfo:o.codeinfo||"",pagetype:o.pagetype||"",gametype:o.gametype||"",adslot:o.adslot||"",adunitid:o.adunitid||"",adbatchid:o.adbatchid||"",ecpm:o.ecpm||"",adfrom:o.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",i),this._request(this._adUrl,i)},i.prototype._sendOnline=function(){var o=Date.now(),i=e(e({},this._commonParams),{onlinetime:"".concat(o-this._startTime),endtime:o.toString(),starttime:this._startTime.toString()});this._online([i])},i.prototype._setOnlineBatchData=function(e){t(J,JSON.stringify(e))},i.prototype._getOnlineBatchData=function(){var e=n(J);return e?JSON.parse(e):""},i.prototype._clearOnlineBatchData=function(){t(J,"")},i.prototype._online=function(e){var o=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(i){console.error(i),o._setOnlineBatchData(e)}))},i}();exports.XLog=F;
8
+ function z(e){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var n in i)e[n]=i[n]}return e}var D,G=function e(o,i){function n(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=z({},i,t)).expires&&(t.expires=new Date(Date.now()+864e5*t.expires)),t.expires&&(t.expires=t.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in t)t[a]&&(r+="; "+a,!0!==t[a]&&(r+="="+t[a].split(";")[0]));return document.cookie=e+"="+o.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var i=document.cookie?document.cookie.split("; "):[],n={},t=0;t<i.length;t++){var r=i[t].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(n[s]=o.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,o){n(e,"",z({},o,{expires:-1}))},withAttributes:function(o){return e(this.converter,z({},this.attributes,o))},withConverter:function(o){return e(z({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(o)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});exports.EGender=void 0,(D=exports.EGender||(exports.EGender={}))[D.Unknown=0]="Unknown",D[D.Male=1]="Male",D[D.Female=2]="Female";var X="".concat("XYZ_LOG_HW_","COMMON_PARAMS"),J="".concat("XYZ_LOG_HW_","ONLINE_BACH_DATA"),F=function(){function i(e){var o=e.domain,i=e.commonParams,n=e.isPro,t=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,l=e.ignoreUrlParams,u=void 0===l?[]:l;this.version="4.2.0",this.buildDate="3/13/2025, 5:16:49 PM",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=t,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var p=this._getApis(o),d=p.openUrl,f=p.actUrl,m=p.adUrl,b=p.online;this._openUrl=d,this._actUrl=f,this._adUrl=m,this._onlineUrl=b,this._init(i)}return Object.defineProperty(i.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),i.prototype._init=function(o){var i=this;this._updateCommonParams(e(e({},this._filterParams(o)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){i._updateCommonParams({}),i._open(1),i._startTime=Date.now();var e=i._getOnlineBatchData();e&&i._online(e)}),(function(){i._open(5),i._sendOnline()}))},i.prototype._visibilityChange=function(e,o){void 0===e&&(e=function(){}),void 0===o&&(o=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():o()}),!1)},i.prototype._getScreen=function(){var e=window.screen,o=e.width,i=e.height;return"".concat(o,"*").concat(i)},i.prototype._getNetWorkType=function(){var e=window.navigator,o=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==o?void 0:o.type)||(null==o?void 0:o.effectiveType)||"other"},i.prototype._getBatchId=function(){var e,o=(e="BATCH_ID",void 0!==typeof sessionStorage?sessionStorage.getItem("XYZ_LOG_"+e):null);return o||function(e,o){void 0!==typeof sessionStorage&&sessionStorage.setItem("XYZ_LOG_"+e,o)}("BATCH_ID",o=r()),o},i.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},i.prototype._getApis=function(o){var i=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",online:"https://wappubog.snake.cc"}:{open:"https://test-wappubog.snake.cc",act:"https://test-wappubog.snake.cc",ad:"https://test-wappubog.snake.cc",online:"https://test-wappubog.snake.cc"},n=e(e({},i),o);return{openUrl:"".concat(n.open,"/wappubog/h5/open"),actUrl:"".concat(n.act,"/wappubog/h5/activity"),adUrl:"".concat(n.ad,"/gamefunction_logs/h5/advlog"),online:"".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},i.prototype._cacheCommonParams=function(i){var r=n(X),a=this._getInitParams(),s=a.userinfo,l=o(a,["userinfo"]),u=JSON.parse(r||"{}"),p=u.userinfo,d=o(u,["userinfo"]),f=i.userinfo,m=o(i,["userinfo"]),b=e(e(e({},JSON.parse(s||"{}")),JSON.parse(p||"{}")),JSON.parse(f||"{}")),w=c(c(l,d),m);this._commonParams=e(e({},w),{userinfo:JSON.stringify(b)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),t(X,JSON.stringify(this._commonParams))},i.prototype._getInitParams=function(){return{osversion:x,device:O,devicebrand:P,os:_,platform:u(),uid:a(),appcqid:"organic",pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),o=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(o)),url:encodeURI(location.href)};var e,o},i.prototype._getUserInfo=function(e){var o={};if(e)try{o=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var i={};if(this._commonParams.userinfo)try{i=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(l({lang:navigator.language,browser:b,browserversion:w,engine:g,engineversion:v,platform:u(),querystring:s(this._ignoreUrlParams),fbc:G.get("_fbc"),fbp:G.get("_fbp"),ttp:G.get("_ttp")},i,o))},i.prototype._filterParams=function(e){var o={};if(e){var i=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var n in e){var t=n,r=e[t];i.includes(t)&&r&&(o[t]=r)}}return o},i.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var o=this._commonParams.region,i=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==o||e.province&&e.province!==i)&&this._open(6)}},i.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var o=this._commonParams.region,i=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==o||e.province&&e.province!==i)&&this._open(6)}},i.prototype._updateCommonParams=function(o){var i;this._consoleLog&&console.log("[XLOG] _updateCommonParams",o),o.userinfo?o.userinfo=this._getUserInfo(o.userinfo):o.userinfo=this._getUserInfo();try{i=JSON.parse(o.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(o.userinfo,'" parse error'),e)}o.platform&&(o.userinfo=this._getUserInfo(JSON.stringify(e(e({},i),{platform:o.platform})))),this._cacheCommonParams(e(e({},o),{url:encodeURI(location.href),network:this._getNetWorkType()}))},i.prototype._request=function(e,o){var i=this;return function(e,o){return M(e,o)}(e,o).then((function(n){return i._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),o,n),n})).catch((function(i){return console.error("[XLOG] ERROR: ".concat(e),o,i),Promise.reject(i)}))},i.prototype._open=function(o){if(this._sendOpenLog){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:"4.2.0",url_from:document.referrer,openway:o});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",i),this._request(this._openUrl,i)}},i.prototype.act=function(o){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:o.actentryid||"",subactid:o.subactid||"",type:o.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",i),this._request(this._actUrl,i)},i.prototype.ad=function(o){var i=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:o.type||"",code:o.code||"",codeinfo:o.codeinfo||"",pagetype:o.pagetype||"",gametype:o.gametype||"",adslot:o.adslot||"",adunitid:o.adunitid||"",adbatchid:o.adbatchid||"",ecpm:o.ecpm||"",adfrom:o.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",i),this._request(this._adUrl,i)},i.prototype._sendOnline=function(){var o=Date.now(),i=e(e({},this._commonParams),{onlinetime:"".concat(o-this._startTime),endtime:o.toString(),starttime:this._startTime.toString()});this._online([i])},i.prototype._setOnlineBatchData=function(e){t(J,JSON.stringify(e))},i.prototype._getOnlineBatchData=function(){var e=n(J);return e?JSON.parse(e):""},i.prototype._clearOnlineBatchData=function(){t(J,"")},i.prototype._online=function(e){var o=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(i){console.error(i),o._setOnlineBatchData(e)}))},i}();exports.XLog=F;
9
9
  //# sourceMappingURL=web-hw.js.map