@xyz-fe/log 5.1.0 → 5.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/index.d.ts CHANGED
@@ -201,6 +201,32 @@ interface ICode2sessionResponseData {
201
201
  openid: string;
202
202
  session_key: string;
203
203
  }
204
+ interface IMsgSecCheckParams {
205
+ apptypeid?: string;
206
+ openid?: string;
207
+ scene?: number;
208
+ content: string;
209
+ }
210
+ interface IMsgSecCheckResult {
211
+ suggest?: 'pass' | 'review' | 'risky';
212
+ label?: number;
213
+ replaced_content: string;
214
+ }
215
+ interface IMsgSecCheckDetail {
216
+ strategy?: string;
217
+ errcode?: number;
218
+ suggest?: 'pass' | 'review' | 'risky';
219
+ label?: number;
220
+ keyword?: string;
221
+ prob?: number;
222
+ }
223
+ interface IMsgSecCheckResponseData {
224
+ errcode: number;
225
+ errmsg: string;
226
+ trace_id?: string;
227
+ result?: IMsgSecCheckResult;
228
+ detail?: IMsgSecCheckDetail[];
229
+ }
204
230
  interface IShareParams {
205
231
  apptypeid?: string;
206
232
  }
@@ -375,6 +401,8 @@ declare class XLog$2 {
375
401
  private _getPlatformStr;
376
402
  /** 登录换取 openid/unionid/session_key */
377
403
  code2session(params: ICode2sessionParams): Promise<IRes<ICode2sessionResponseData>>;
404
+ /** 微信文本内容安全识别(小游戏/小程序) */
405
+ msgSecCheck(params: IMsgSecCheckParams): Promise<IRes<IMsgSecCheckResponseData> | undefined>;
378
406
  isLogin(): boolean;
379
407
  /** 快手 - 查询用户补贴 */
380
408
  getSubsidy(params?: ISubsidyParams): Promise<IRes<ISubsidyResponseData> | undefined>;
@@ -508,4 +536,4 @@ declare class XLog {
508
536
  private _online;
509
537
  }
510
538
 
511
- export { EGender, HwInitParams, IAADecryptedData, IAAParams, IAAPlatformResponse, IAAReportData, IAAReportParams, IActiveLogParams, IAdLogParams, ICheckOrderParams, ICheckOrderResponseData, ICode2sessionParams, ICode2sessionResponseData, ICommonParams, ICreateOrderParams, ICreateOrderResponseData, IDomain, IDomainWithEnv, IEventLogParams, IExtraInfo, IHwActiveLogParams, IHwAdLogParams, IHwCommonParams, IHwDomain, IHwOnlineLogParamsWithCommon, IHwOpenLogParams, IOnlineLogParams, IOnlineLogParamsWithCommon, IOpenLogParams, IPayParams, IPayResponseData, IPlatformStr, IRes, IShareParams, ISubsidyParams, ISubsidyResponseData, ISystemInfo, IUserInfo, IUserPropsParams, IUserPropsResponseData, IWxCustomerServiceCardParams, IWxPaymentParams, InitParams, MiniprogramShowOptions, TCommonParams, THwCommonParams, TPlatform, XLog$2 as XLogMp, XLog$1 as XLogWeb, XLog as XLogWebHw };
539
+ export { EGender, HwInitParams, IAADecryptedData, IAAParams, IAAPlatformResponse, IAAReportData, IAAReportParams, IActiveLogParams, IAdLogParams, ICheckOrderParams, ICheckOrderResponseData, ICode2sessionParams, ICode2sessionResponseData, ICommonParams, ICreateOrderParams, ICreateOrderResponseData, IDomain, IDomainWithEnv, IEventLogParams, IExtraInfo, IHwActiveLogParams, IHwAdLogParams, IHwCommonParams, IHwDomain, IHwOnlineLogParamsWithCommon, IHwOpenLogParams, IMsgSecCheckDetail, IMsgSecCheckParams, IMsgSecCheckResponseData, IMsgSecCheckResult, IOnlineLogParams, IOnlineLogParamsWithCommon, IOpenLogParams, IPayParams, IPayResponseData, IPlatformStr, IRes, IShareParams, ISubsidyParams, ISubsidyResponseData, ISystemInfo, IUserInfo, IUserPropsParams, IUserPropsResponseData, IWxCustomerServiceCardParams, IWxPaymentParams, InitParams, MiniprogramShowOptions, TCommonParams, THwCommonParams, TPlatform, XLog$2 as XLogMp, XLog$1 as XLogWeb, XLog as XLogWebHw };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @xyz-fe/log v5.1.0
2
+ * @xyz-fe/log v5.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 t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},e.apply(this,arguments)};function t(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}function o(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function i(e,t){var o,i,n,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(o=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(6===a[0]&&r.label<n[1]){r.label=n[1],n=a;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(a);break}n[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}"function"==typeof SuppressedError&&SuppressedError;var n="XYZ_LOG_";function r(e){return void 0!==typeof localStorage?localStorage.getItem(n+e):null}function s(e,t){void 0!==typeof localStorage&&localStorage.setItem(n+e,t)}function a(e){return void 0!==typeof sessionStorage?sessionStorage.getItem(n+e):null}function c(e,t){void 0!==typeof sessionStorage&&sessionStorage.setItem(n+e,t)}function p(e,t){void 0===e&&(e=18),void 0===t&&(t=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[],n=Math.random,r=e,s=t||o.length,a=0;a<r;a++)i[a]=o[0|n()*s];return i.join("")}function l(e){void 0===e&&(e="UID");var t=r(e);return t||s(e,t=p()),t}function u(e){try{return e&&"string"==typeof e?e.split(".").map((function(e){return 1===e.length?"0"+e:e})).join(""):""}catch(t){return console.error('[transferVersion] ver("'.concat(e,'")格式异常:'),t),""}}function d(){var e=new Date,t=e.getFullYear().toString(),o=(e.getMonth()+1).toString(),i=e.getDate().toString();return(t=t.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(i=Number(i)<10?"0"+i:i)}function m(e,t){void 0===e&&(e=[]),void 0===t&&(t=location.href);var o=new URL(t).search.substring(1),i={};return o&&o.split("&").forEach((function(e){i[e.split("=")[0]]=e.split("=")[1]})),Object.keys(i).forEach((function(t){e.includes(t)&&delete i[t]})),i}function h(t,o){var i=e({},t),n=e({},o);return Object.keys(i).forEach((function(e){n[e]||delete n[e]})),e(e({},i),n)}function f(e){for(var t,o,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return e;var r=i.shift();if(r&&"object"==typeof r)for(var s in r)r[s]&&"object"==typeof r[s]?(e[s]||Object.assign(e,((t={})[s]={},t)),f(e[s],r[s])):Object.assign(e,((o={})[s]=r[s],o));return f.apply(void 0,function(e,t,o){if(o||2===arguments.length)for(var i,n=0,r=t.length;n<r;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}([e],i,!1))}var g=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(t){return e.includes(t)}))?"h5":"pc");var e};var v,_,b="5.1.0",w="2/27/2026, 10:04:29 AM",y="organic";exports.EGender=void 0,(v=exports.EGender||(exports.EGender={}))[v.Unknown=0]="Unknown",v[v.Male=1]="Male",v[v.Female=2]="Female",function(e){e.BATCH_ID="BATCH_ID",e.COMMON_PARAMS="COMMON_PARAMS",e.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",e.ACCUMULATED_TIME="ACCUMULATED_TIME"}(_||(_={}));var O=function(){function t(e){var t,o,i=e.domain,n=e.commonParams,r=e.isPro,s=void 0===r||r,a=e.sendOpenLog,c=void 0===a||a,p=e.consoleLog,l=void 0===p||p,u=e.useIAA,d=void 0!==u&&u,m=e.periodicReportInterval,h=void 0===m?0:m;if(this.version=b,this.buildDate=w,this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=s,this._sendOpenLog=c,this._consoleLog=l,this._useIAA=d,h>0){var f=h>0?h:10;this._periodicReportInterval=Math.max(1e3*f,5e3)}else this._periodicReportInterval=0;var g=this._getApis(i),v=g.openUrl,y=g.eventUrl,O=g.actUrl,P=g.adUrl,A=g.onlineUrl;this._openUrl=v,this._eventUrl=y,this._actUrl=O,this._adUrl=P,this._onlineUrl=A,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var I,S=this._getMp(),L=S.mp,k=S.platform;this._mp=L,this._platform=k,!L||(I=L)&&0===Object.keys(I).length&&I.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",L,"平台类型:",k);try{this._systemInfo=(null===(o=null===(t=this._mp)||void 0===t?void 0:t.getSystemInfoSync)||void 0===o?void 0:o.call(t))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(e){console.error("[XLOG] getSystemInfoSync error",e)}if(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._periodicReportInterval>0){var x=this._getStorage(_.ACCUMULATED_TIME);this._accumulatedTime=x?Number(x):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(n)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._safeJsonParse=function(e,t){try{return e?JSON.parse(e):t}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",e),t}},t.prototype._getLaunchOptions=function(){var e,t,o,i,n,r,s,a,c,p,l,u;try{return 2===this._platform?(null===(t=null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||void 0===t?void 0:t.call(e))||null:3===this._platform?(null===(i=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===i?void 0:i.call(o))||null:1===this._platform?(null===(r=null===(n=this._mp)||void 0===n?void 0:n.getEnterOptionsSync)||void 0===r?void 0:r.call(n))||(null===(a=null===(s=this._mp)||void 0===s?void 0:s.getLaunchOptionsSync)||void 0===a?void 0:a.call(s))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(e){return console.error("[XLOG] 获取启动参数失败",e),null}},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={});var i=(null==t?void 0:t.query)?e(e({},t.query),o):o;this._updateCommonParams({srcqid:i.channel||"",userinfo:JSON.stringify({querystring:i})})},t.prototype._init=function(e){var t=this;this._initCommonParams(this._filterParams(e));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){t._isColdStartUp||t._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:1})})),t._startTime=Date.now(),t._periodicReportInterval>0&&t._startPeriodicTimer();var e=t._getOnlineBatchData();e&&e.length>0&&t._online(e)}),(function(){if(t._isColdStartUp=!1,t._open({openway:5}),t._periodicReportInterval>0){t._stopPeriodicTimer();var e=Date.now()-t._startTime;t._accumulatedTime+=e,t._setStorage(_.ACCUMULATED_TIME,t._accumulatedTime.toString()),t._consoleLog&&console.log("[XLOG] 切后台,累计时长:",t._accumulatedTime,"ms")}else t._sendOnline()}))},t.prototype._startPeriodicTimer=function(){var e=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){e._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},t.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},t.prototype._checkPeriodicReport=function(){var e=Date.now()-this._startTime,t=this._accumulatedTime+e;if(t>=this._periodicReportInterval){var o=Math.floor(t/this._periodicReportInterval),i=o*this._periodicReportInterval;this._sendPeriodicOnline(i,o),this._accumulatedTime=t-i,this._startTime=Date.now(),this._setStorage(_.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(i,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},t.prototype._sendPeriodicOnline=function(t,o){for(var i=Date.now()-t,n=[],r=0;r<o;r++){var s=i+r*this._periodicReportInterval,a=s+this._periodicReportInterval;n.push(e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:s.toString()}))}this._online(n)},t.prototype._getMp=function(){var e={mp:null,platform:7};return"undefined"!=typeof tt&&tt.getSystemInfo?(e.mp=tt,e.platform=2):"undefined"!=typeof ks&&ks.getSystemInfo?(e.mp=ks,e.platform=3):"undefined"!=typeof swan&&swan.getSystemInfo?(e.mp=swan,e.platform=4):"undefined"!=typeof qq&&qq.getSystemInfo?(e.mp=qq,e.platform=5):"undefined"!=typeof wx&&wx.getSystemInfo?(e.mp=wx,e.platform=1):"undefined"!=typeof my&&my.getSystemInfo?e.mp=my:"undefined"!=typeof jd&&jd.getSystemInfo&&(e.mp=jd),e},t.prototype._visibilityChange=function(e,t){var o,i,n,r,s=this;void 0===e&&(e=function(){}),void 0===t&&(t=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(i=this._mp)||void 0===i?void 0:i.onShow),c=(null===(n=this._mp)||void 0===n?void 0:n.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide);a&&a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),e()})),c&&c((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),t()}))}catch(e){console.error("[XLOG] onAppShow or onAppHide error",e)}},t.prototype._getStorage=function(e){var t;try{var o=null===(t=this._mp)||void 0===t?void 0:t.getStorageSync("XYZ_LOG_".concat(e));return null==o?"":o}catch(e){return console.error("[XLOG] getStorageSync error",e),""}},t.prototype._setStorage=function(e,t){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(e),t)}catch(e){console.error("[XLOG] setStorageSync error",e)}},t.prototype._getBatchId=function(){var e=this._getStorage(_.BATCH_ID);return e||(e=p(),this._setStorage(_.BATCH_ID,e)),e},t.prototype._coldStartUp=function(){var e=this;this._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:0}),e._periodicReportInterval>0&&e._startPeriodicTimer()}))},t.prototype._getApis=function(t){var o=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"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(i.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(i.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(e){this._setStorage(_.COMMON_PARAMS,JSON.stringify(e))},t.prototype._getInitParams=function(){var e,t=(null===(e=this._systemInfo.system)||void 0===e?void 0:e.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:y,appqid:y+d(),os:this._systemInfo.platform,osversion:t,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),i=this._getStorage(_.COMMON_PARAMS);i&&(o=e(e({},o),this._safeJsonParse(i,{}))),t&&(o=e(e({},o),t)),this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var e=this;return new Promise((function(t){var o;try{null===(o=e._mp)||void 0===o||o.getNetworkType({success:function(e){var o=((null==e?void 0:e.networkType)||"").toLowerCase();t({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return t("none")}})}catch(e){console.error("[XLOG] getNetworkType error",e),t("none")}}))},t.prototype._getUserInfo=function(t){var o={};t&&(o=this._safeJsonParse(t,{}));var i={};return this.commonParams.userinfo&&(i=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(e(e(e({},this._extraInfo),i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.openid,o=this._commonParams.unionid;e=this._filterParams(e),this._updateCommonParams(e),(e.openid&&e.openid!==t||e.unionid&&e.unionid!==o)&&this._open({isreturn:e.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo){var o=t.appsubid||this._commonParams.appsubid;o&&(t.userinfo=JSON.stringify(e(e({},this._safeJsonParse(t.userinfo,{})),{appsubid:o}))),t.userinfo=this._getUserInfo(t.userinfo)}t.appcqid&&(t.appqid=t.appcqid+d()),t.appver&&(t.appverint=u(t.appver)),this._commonParams=e(e({},this._commonParams),t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._getApptypeid=function(e){var t=e||this._commonParams.apptypeid||"";return t||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),t},t.prototype._request=function(e,t,o){var i=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(n,r){var s;try{null===(s=i._mp)||void 0===s||s.request({url:e,data:t,method:"POST",header:{"content-type":o},success:function(o){i._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,o),n(o)},fail:function(o){i._consoleLog&&console.log("[XLOG] FAIL: ".concat(e),t,o),r(o)}})}catch(e){console.error("[XLOG] request error",e),r(e)}}))},t.prototype.open=function(e){this._open({querystring:e.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var i=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:b});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",i),this._request(this._openUrl,i)}},t.prototype.event=function(t){var o=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)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=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)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=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)",o),this._request(this._adUrl,o,"application/json")},t.prototype._getPlatformPath=function(){var e="";return 1===this._platform?e="wx/":3===this._platform&&(e="ks/"),e},t.prototype._getPlatformStr=function(){var e="DY";return 1===this._platform?e="WX":3===this._platform&&(e="KS"),e},t.prototype.code2session=function(e){var t;return o(this,void 0,void 0,(function(){var o,n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return o=this._getApptypeid(e.apptypeid),n=this._getPlatformPath(),r="".concat(this._businessDomain,"/AppletUtils/").concat(n,"code2session"),[4,this._request(r,{appTypeId:o,code:e.code,testNet:e.testNet},"application/json")];case 1:return s=i.sent(),a=null===(t=s.data)||void 0===t?void 0:t.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,s.data]}}))}))},t.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},t.prototype.getSubsidy=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t,os:this._systemInfo.platform,openId:o},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype.getUserProps=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t,openId:o},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype._sleep=function(e){return void 0===e&&(e=1e3),o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t,o){setTimeout(t,e)}))]}))}))},t.prototype.pay=function(t){var n,r;return o(this,void 0,void 0,(function(){var o,s,a,c,p,l,u,d,m,h,f,g,v,_,b,w,y,O,P,A=this;return i(this,(function(i){switch(i.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),o=this._getPlatformStr(),"WX"===o?[4,this.createOrder(t)]:[3,17];case 1:if(!(null==(s=i.sent())?void 0:s.data))return[3,15];if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),a="ios"===this._systemInfo.platform.toLowerCase(),c=null==s?void 0:s.data,p=c.orderId,l=c.payContent,u=l.offerId,d=l.zone_id,m=l.env,h=l.buy_quantity,f=l.kfMessageTitle,g=l.kfMessageImg,!a)return[3,6];v={sessionFrom:t.sessionFrom,showMessageCard:t.showMessageCard||!0,sendMessageTitle:t.sendMessageTitle||f,sendMessagePath:t.sendMessagePath,sendMessageImg:t.sendMessageImg||g},i.label=2;case 2:return i.trys.push([2,4,,5]),[4,new Promise((function(t,o){A._mp.openCustomerServiceConversation(e(e({},v),{success:t,fail:o}))}))];case 3:return w=i.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",w),[2,{payResult:-1}];case 4:return _=i.sent(),console.error("[XLOG] 取消进入客服会话",_,v),[2,{payResult:0}];case 5:return[3,14];case 6:b={mode:"game",env:m,offerId:u,currencyType:"CNY",platform:"android",buyQuantity:h,zoneId:d,outTradeNo:p},i.label=7;case 7:return i.trys.push([7,9,,10]),[4,new Promise((function(t,o){A._mp.requestMidasPayment(e(e({},b),{success:t,fail:o}))}))];case 8:return w=i.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",w),[3,10];case 9:return y=i.sent(),console.error("[XLOG] 微信虚拟支付 err: ",y,b),[2,{payResult:0}];case 10:return i.trys.push([10,13,,14]),[4,this._sleep()];case 11:return i.sent(),[4,this.checkOrder({orderId:p})];case 12:return O=i.sent(),[2,{payResult:(null===(n=null==O?void 0:O.data)||void 0===n?void 0:n.payResult)&&1==(null===(r=null==O?void 0:O.data)||void 0===r?void 0:r.payResult)?1:0}];case 13:return P=i.sent(),console.error("[XLOG] 订单校验 err: ",P,e({orderId:p},b)),[2,{payResult:0}];case 14:return[3,16];case 15:return console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}];case 16:return[3,18];case 17:return console.error("[XLOG] 支付目前只支持微信平台"),[2,{payResult:0}];case 18:return[2]}}))}))},t.prototype.checkOrder=function(e){return o(this,void 0,void 0,(function(){var t,o,n,r,s;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._getPlatformPath(),n=this._sessionInfo,r=n.openid,s=n.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(o,"chkOrder"),{appTypeId:t,orderId:e.orderId,os:this._systemInfo.platform,openId:r,sessionKey:s},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype.createOrder=function(e){return o(this,void 0,void 0,(function(){var t,o,n;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,n=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t,productId:e.productId,extInfo:e.extInfo,os:this._systemInfo.platform,payPlatform:n,openId:o},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=Math.max(0,t-this._startTime),i=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:t.toString(),starttime:this._startTime.toString()});this._online([i])},t.prototype._setOnlineBatchData=function(e){this._setStorage(_.ONLINE_BATCH_DATA,e)},t.prototype._getOnlineBatchData=function(){try{var e=this._getStorage(_.ONLINE_BATCH_DATA);if(Array.isArray(e))return e;if("string"==typeof e&&e){var t=this._safeJsonParse(e,[]);return Array.isArray(t)?t:[]}return[]}catch(e){return console.error("[XLOG] get online batch data error",e),[]}},t.prototype._clearOnlineBatchData=function(){this._setStorage(_.ONLINE_BATCH_DATA,"")},t.prototype._online=function(e){var t=this;e&&0!==e.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),t._setOnlineBatchData(e)})))},t.prototype._initIAAPlugin=function(){var e;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var t=null===(e=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===e?void 0:e.default;if("function"!=typeof t)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=t(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(e){console.error("[XLOG:IAA] 插件初始化异常",e)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},t.prototype.iaa=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return this._miniGameCommon?[2,new Promise((function(n,r){setTimeout((function(){return o(t,void 0,void 0,(function(){var t,o,s,a;return i(this,(function(i){switch(i.label){case 0:t=null,o=e.sessionKey,s=e.reportData,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(s),labelId:"iaa_feature"})];case 2:return t=i.sent(),[3,4];case 3:return a=i.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),r(a),[2];case 4:return t?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",t),this._sendIAAData({session_key:o,requestReportData:JSON.stringify(s),iv:t.iv,encryptedData:t.encryptedData}),n(t),[2]):(r(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},t.prototype._sendIAAData=function(e){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),e,"application/json")},t}(),P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A={exports:{}};!function(e,t){!function(o,i){var n="function",r="undefined",s="object",a="string",c="major",p="model",l="name",u="type",d="vendor",m="version",h="architecture",f="console",g="mobile",v="tablet",_="smarttv",b="wearable",w="embedded",y="Amazon",O="Apple",P="ASUS",A="BlackBerry",I="Browser",S="Chrome",L="Firefox",k="Google",x="Huawei",U="LG",C="Microsoft",T="Motorola",q="Opera",N="Samsung",G="Sharp",M="Sony",R="Xiaomi",D="Zebra",X="Facebook",E="Chromium OS",j="Mac OS",B=" Browser",J=function(e){for(var t={},o=0;o<e.length;o++)t[e[o].toUpperCase()]=e[o];return t},z=function(e,t){return typeof e===a&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===r?e:e.substring(0,500)},F=function(e,t){for(var o,r,a,c,p,l,u=0;u<t.length&&!p;){var d=t[u],m=t[u+1];for(o=r=0;o<d.length&&!p&&d[o];)if(p=d[o++].exec(e))for(a=0;a<m.length;a++)l=p[++r],typeof(c=m[a])===s&&c.length>0?2===c.length?typeof c[1]==n?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==n||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):i:this[c[0]]=l?c[1].call(this,l,c[2]):i:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):i):this[c]=l||i;u+=2}},V=function(e,t){for(var o in t)if(typeof t[o]===s&&t[o].length>0){for(var n=0;n<t[o].length;n++)if(z(t[o][n],e))return"?"===o?i:o}else if(z(t[o],e))return"?"===o?i:o;return t.hasOwnProperty("*")?t["*"]:e},Z={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"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,m],[/opios[\/ ]+([\w\.]+)/i],[m,[l,q+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[l,q+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[l,q]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[l,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[l,"Smart Lenovo "+I]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+I],m],[/\bfocus\/([\w\.]+)/i],[m,[l,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[l,q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[l,q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[l,"MIUI"+B]],[/fxios\/([\w\.-]+)/i],[m,[l,L]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+B],m],[/samsungbrowser\/([\w\.]+)/i],[m,[l,N+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,m],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,X],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[l,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,S+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[l,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[m,V,{"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,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[l,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\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|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,H]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[d,N],[u,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[d,N],[u,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,O],[u,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,O],[u,v]],[/(macintosh);/i],[p,[d,O]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,G],[u,g]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[d,"Honor"],[u,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[d,x],[u,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,x],[u,g]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[d,R],[u,g]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[d,R],[u,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,"OPPO"],[u,g]],[/\b(opd2\d{3}a?) bui/i],[p,[d,"OPPO"],[u,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,"Vivo"],[u,g]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,"Realme"],[u,g]],[/\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],[p,[d,T],[u,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,T],[u,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,U],[u,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,U],[u,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[d,"Lenovo"],[u,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[d,"Nokia"],[u,g]],[/(pixel c)\b/i],[p,[d,k],[u,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[d,k],[u,g]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[d,M],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[d,M],[u,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[d,"OnePlus"],[u,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,y],[u,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[d,y],[u,g]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[u,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,A],[u,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,P],[u,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,P],[u,g]],[/(nexus 9)/i],[p,[d,"HTC"],[u,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g," "],[u,g]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[d,"TCL"],[u,v]],[/(itel) ((\w+))/i],[[d,H],p,[u,V,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,"Acer"],[u,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,"Meizu"],[u,g]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,"Ulefone"],[u,g]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,"Energizer"],[u,g]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,"Cat"],[u,g]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,"Smartfren"],[u,g]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[d,"Nothing"],[u,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,p,[u,g]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(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],[d,p,[u,v]],[/(surface duo)/i],[p,[d,C],[u,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,"Fairphone"],[u,g]],[/(u304aa)/i],[p,[d,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[p,[d,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[p,[d,"RCA"],[u,v]],[/\b(venue[\d ]{2,7}) b/i],[p,[d,"Dell"],[u,v]],[/\b(q(?:mv|ta)\w+) b/i],[p,[d,"Verizon"],[u,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[d,"Barnes & Noble"],[u,v]],[/\b(tm\d{3}\w+) b/i],[p,[d,"NuVision"],[u,v]],[/\b(k88) b/i],[p,[d,"ZTE"],[u,v]],[/\b(nx\d{3}j) b/i],[p,[d,"ZTE"],[u,g]],[/\b(gen\d{3}) b.+49h/i],[p,[d,"Swiss"],[u,g]],[/\b(zur\d{3}) b/i],[p,[d,"Swiss"],[u,v]],[/\b((zeki)?tb.*\b) b/i],[p,[d,"Zeki"],[u,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],p,[u,v]],[/\b(ns-?\w{0,9}) b/i],[p,[d,"Insignia"],[u,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[d,"NextBook"],[u,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],p,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],p,[u,g]],[/\b(ph-1) /i],[p,[d,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[d,"Envizen"],[u,v]],[/\b(trio[-\w\. ]+) b/i],[p,[d,"MachSpeed"],[u,v]],[/\btu_(1491) b/i],[p,[d,"Rotor"],[u,v]],[/(shield[\w ]+) b/i],[p,[d,"Nvidia"],[u,v]],[/(sprint) (\w+)/i],[d,p,[u,g]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[d,C],[u,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,D],[u,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,D],[u,g]],[/smart-tv.+(samsung)/i],[d,[u,_]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[d,N],[u,_]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,U],[u,_]],[/(apple) ?tv/i],[d,[p,O+" TV"],[u,_]],[/crkey/i],[[p,S+"cast"],[d,k],[u,_]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,y],[u,_]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,G],[u,_]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,M],[u,_]],[/(mitv-\w{5}) bui/i],[p,[d,R],[u,_]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[u,_]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[p,W],[u,_]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,_]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,p,[u,f]],[/droid.+; (shield) bui/i],[p,[d,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[p,[d,M],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,C],[u,f]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[d,N],[u,b]],[/((pebble))app/i],[d,p,[u,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,O],[u,b]],[/droid.+; (glass) \d/i],[p,[d,k],[u,b]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,D],[u,b]],[/droid.+; (glass) \d/i],[p,[d,k],[u,b]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[u,b]],[/; (quest( \d| pro)?)/i],[p,[d,X],[u,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[u,w]],[/(aeobc)\b/i],[p,[d,y],[u,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[u,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[u,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[l,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,m],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[m,V,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,V,Z],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,m],[/\(bb(10);/i],[m,[l,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[l,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[l,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,E],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(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,m],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,m]]},Y=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof Y))return new Y(e,t).getResult();var f=typeof o!==r&&o.navigator?o.navigator:i,_=e||(f&&f.userAgent?f.userAgent:""),b=f&&f.userAgentData?f.userAgentData:i,w=t?function(e,t){var o={};for(var i in e)t[i]&&t[i].length%2==0?o[i]=t[i].concat(e[i]):o[i]=e[i];return o}(K,t):K,y=f&&f.userAgent==_;return this.getBrowser=function(){var e,t={};return t[l]=i,t[m]=i,F.call(t,_,w.browser),t[c]=typeof(e=t[m])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,y&&f&&f.brave&&typeof f.brave.isBrave==n&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[h]=i,F.call(e,_,w.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[p]=i,e[u]=i,F.call(e,_,w.device),y&&!e[u]&&b&&b.mobile&&(e[u]=g),y&&"Macintosh"==e[p]&&f&&typeof f.standalone!==r&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[p]="iPad",e[u]=v),e},this.getEngine=function(){var e={};return e[l]=i,e[m]=i,F.call(e,_,w.engine),e},this.getOS=function(){var e={};return e[l]=i,e[m]=i,F.call(e,_,w.os),y&&!e[l]&&b&&b.platform&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,E).replace(/macos/i,j)),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 _},this.setUA=function(e){return _=typeof e===a&&e.length>500?W(e,500):e,this},this.setUA(_),this};Y.VERSION="1.0.40",Y.BROWSER=J([l,m,c]),Y.CPU=J([h]),Y.DEVICE=J([p,d,u,f,g,_,v,b,w]),Y.ENGINE=Y.OS=J([l,m]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var $=typeof o!==r&&(o.jQuery||o.Zepto);if($&&!$.ua){var Q=new Y;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var o in t)$.ua[o]=t[o]}}}("object"==typeof window?window:P)}(A,A.exports);var I=new A.exports.UAParser,S=I.getBrowser(),L=S.name,k=S.version,x=I.getEngine(),U=x.name,C=x.version,T=function(){var e=(0,I.getOS)();return{os:e.name,osversion:e.version}}(),q=T.os,N=T.osversion,G=function(){var e=(0,I.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),M=G.device,R=G.devicebrand;q=q||"",N=N||"",M=M||"",R=R||"";var D={exports:{}},X={exports:{}},E=1e3,j=60*E,B=60*j,J=24*B,z=365.25*J,H=function(e,t){t=t||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*z;case"days":case"day":case"d":return o*J;case"hours":case"hour":case"hrs":case"hr":case"h":return o*B;case"minutes":case"minute":case"mins":case"min":case"m":return o*j;case"seconds":case"second":case"secs":case"sec":case"s":return o*E;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return t.long?function(e){return W(e,J,"day")||W(e,B,"hour")||W(e,j,"minute")||W(e,E,"second")||e+" ms"}(e):function(e){if(e>=J)return Math.round(e/J)+"d";if(e>=B)return Math.round(e/B)+"h";if(e>=j)return Math.round(e/j)+"m";if(e>=E)return Math.round(e/E)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function W(e,t,o){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+o:Math.ceil(e/t)+" "+o+"s"}!function(e,t){var o;function i(e){function i(){if(i.enabled){var e=i,n=+new Date,r=n-(o||n);e.diff=r,e.prev=o,e.curr=n,o=n;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(o,i){if("%%"===o)return o;c++;var n=t.formatters[i];if("function"==typeof n){var r=s[c];o=n.call(e,r),s.splice(c,1),c--}return o})),t.formatArgs.call(e,s),(i.log||t.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var o,i=0;for(o in e)i=(i<<5)-i+e.charCodeAt(o),i|=0;return t.colors[Math.abs(i)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=X.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length,n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var o,i;for(o=0,i=t.skips.length;o<i;o++)if(t.skips[o].test(e))return!1;for(o=0,i=t.names.length;o<i;o++)if(t.names[o].test(e))return!0;return!1},t.humanize=H,t.names=[],t.skips=[],t.formatters={}}(0,X.exports),function(e,t){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=X.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+t.humanize(this.diff),!o)return;var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.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+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}(D,D.exports);var F=D.exports("jsonp"),V=function(e,t,o){"function"==typeof t&&(o=t,t={});t||(t={});var i,n,r=t.prefix||"__jp",s=t.name||r+Z++,a=t.param||"callback",c=null!=t.timeout?t.timeout:6e4,p=encodeURIComponent,l=document.getElementsByTagName("script")[0]||document.head;c&&(n=setTimeout((function(){u(),o&&o(new Error("Timeout"))}),c));function u(){i.parentNode&&i.parentNode.removeChild(i),window[s]=K,n&&clearTimeout(n)}return window[s]=function(e){F("jsonp got",e),u(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+a+"="+p(s)).replace("?&","?"),F('jsonp req "%s"',e),(i=document.createElement("script")).src=e,l.parentNode.insertBefore(i,l),function(){window[s]&&u()}},Z=0;function K(){}function Y(e,t){return void 0===t&&(t={}),new Promise((function(o,i){var n;V("".concat(e,"?").concat((n=t,Object.keys(n).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__"),timeout:0},(function(e,t){e?i(e):o(t)}))}))}var $=function(e,t){return Y(e,t)},Q=function(){function t(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,s=void 0===r||r,a=e.consoleLog,c=void 0===a||a;this.version=b,this.buildDate=w,this._urlParams=m(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._isPro=n,this._sendOpenLog=s,this._consoleLog=c;var p=this._getApis(t),l=p.openUrl,u=p.eventUrl,d=p.actUrl;this._openUrl=l,this._eventUrl=u,this._actUrl=d,this._updateCommonParams(this._filterParams(o)),this._init()}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._init=function(){var e=this;this._initCommonParams(),this._coldStartUp(),this._visibilityChange((function(){e._updateCommonParams({network:e._getNetWorkType()}),e._open(1)}),(function(){e._open(5)}))},t.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},t.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},t.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},t.prototype._getBatchId=function(){var e=a("BATCH_ID");return e||c("BATCH_ID",e=p()),e},t.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity")}},t.prototype._cacheCommonParams=function(e){s("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){return{os:q,osversion:N,device:M,devicebrand:R,platform:7,openid:l(),appcqid:y,appqid:y+d(),pixel:this._getScreen(),userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(){var t=this._getInitParams(),o=r("COMMON_PARAMS");o&&(t=e(e({},t),JSON.parse(o))),t=h(t,this._commonParams),this._updateCommonParams(e(e({},t),{obatchid:this._getBatchId(),network:this._getNetWorkType()}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}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(e(e({querystring:this._urlParams},i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["accid","apptypeid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){e&&(this._consoleLog&&console.log("[XLOG] setParams",e),e=this._filterParams(e),this._updateCommonParams(e))},t.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+d()),e.appver&&(e.appverint=u(e.appver)),this._commonParams=h(this._commonParams,e),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t){$(e,t)},t.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{openway:t,appqid:this._getAppqid(),xmlog:b});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var o=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)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=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)",o),this._request(this._actUrl,o)},t}();
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},e.apply(this,arguments)};function t(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}function o(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function i(e,t){var o,i,n,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(o=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(6===a[0]&&r.label<n[1]){r.label=n[1],n=a;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(a);break}n[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}"function"==typeof SuppressedError&&SuppressedError;var n="XYZ_LOG_";function r(e){return void 0!==typeof localStorage?localStorage.getItem(n+e):null}function s(e,t){void 0!==typeof localStorage&&localStorage.setItem(n+e,t)}function a(e){return void 0!==typeof sessionStorage?sessionStorage.getItem(n+e):null}function c(e,t){void 0!==typeof sessionStorage&&sessionStorage.setItem(n+e,t)}function p(e,t){void 0===e&&(e=18),void 0===t&&(t=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[],n=Math.random,r=e,s=t||o.length,a=0;a<r;a++)i[a]=o[0|n()*s];return i.join("")}function l(e){void 0===e&&(e="UID");var t=r(e);return t||s(e,t=p()),t}function u(e){try{return e&&"string"==typeof e?e.split(".").map((function(e){return 1===e.length?"0"+e:e})).join(""):""}catch(t){return console.error('[transferVersion] ver("'.concat(e,'")格式异常:'),t),""}}function d(){var e=new Date,t=e.getFullYear().toString(),o=(e.getMonth()+1).toString(),i=e.getDate().toString();return(t=t.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(i=Number(i)<10?"0"+i:i)}function m(e,t){void 0===e&&(e=[]),void 0===t&&(t=location.href);var o=new URL(t).search.substring(1),i={};return o&&o.split("&").forEach((function(e){i[e.split("=")[0]]=e.split("=")[1]})),Object.keys(i).forEach((function(t){e.includes(t)&&delete i[t]})),i}function h(t,o){var i=e({},t),n=e({},o);return Object.keys(i).forEach((function(e){n[e]||delete n[e]})),e(e({},i),n)}function f(e){for(var t,o,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return e;var r=i.shift();if(r&&"object"==typeof r)for(var s in r)r[s]&&"object"==typeof r[s]?(e[s]||Object.assign(e,((t={})[s]={},t)),f(e[s],r[s])):Object.assign(e,((o={})[s]=r[s],o));return f.apply(void 0,function(e,t,o){if(o||2===arguments.length)for(var i,n=0,r=t.length;n<r;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}([e],i,!1))}var g=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(t){return e.includes(t)}))?"h5":"pc");var e};var v,_,b="5.2.0",w="3/10/2026, 3:32:13 PM",y="organic";exports.EGender=void 0,(v=exports.EGender||(exports.EGender={}))[v.Unknown=0]="Unknown",v[v.Male=1]="Male",v[v.Female=2]="Female",function(e){e.BATCH_ID="BATCH_ID",e.COMMON_PARAMS="COMMON_PARAMS",e.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",e.ACCUMULATED_TIME="ACCUMULATED_TIME"}(_||(_={}));var O=function(){function t(e){var t,o,i=e.domain,n=e.commonParams,r=e.isPro,s=void 0===r||r,a=e.sendOpenLog,c=void 0===a||a,p=e.consoleLog,l=void 0===p||p,u=e.useIAA,d=void 0!==u&&u,m=e.periodicReportInterval,h=void 0===m?0:m;if(this.version=b,this.buildDate=w,this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=s,this._sendOpenLog=c,this._consoleLog=l,this._useIAA=d,h>0){var f=h>0?h:10;this._periodicReportInterval=Math.max(1e3*f,5e3)}else this._periodicReportInterval=0;var g=this._getApis(i),v=g.openUrl,y=g.eventUrl,O=g.actUrl,P=g.adUrl,A=g.onlineUrl;this._openUrl=v,this._eventUrl=y,this._actUrl=O,this._adUrl=P,this._onlineUrl=A,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var S,I=this._getMp(),L=I.mp,k=I.platform;this._mp=L,this._platform=k,!L||(S=L)&&0===Object.keys(S).length&&S.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",L,"平台类型:",k);try{this._systemInfo=(null===(o=null===(t=this._mp)||void 0===t?void 0:t.getSystemInfoSync)||void 0===o?void 0:o.call(t))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(e){console.error("[XLOG] getSystemInfoSync error",e)}if(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._periodicReportInterval>0){var x=this._getStorage(_.ACCUMULATED_TIME);this._accumulatedTime=x?Number(x):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(n)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._safeJsonParse=function(e,t){try{return e?JSON.parse(e):t}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",e),t}},t.prototype._getLaunchOptions=function(){var e,t,o,i,n,r,s,a,c,p,l,u;try{return 2===this._platform?(null===(t=null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||void 0===t?void 0:t.call(e))||null:3===this._platform?(null===(i=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===i?void 0:i.call(o))||null:1===this._platform?(null===(r=null===(n=this._mp)||void 0===n?void 0:n.getEnterOptionsSync)||void 0===r?void 0:r.call(n))||(null===(a=null===(s=this._mp)||void 0===s?void 0:s.getLaunchOptionsSync)||void 0===a?void 0:a.call(s))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(e){return console.error("[XLOG] 获取启动参数失败",e),null}},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={});var i=(null==t?void 0:t.query)?e(e({},t.query),o):o;this._updateCommonParams({srcqid:i.channel||"",userinfo:JSON.stringify({querystring:i})})},t.prototype._init=function(e){var t=this;this._initCommonParams(this._filterParams(e));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){t._isColdStartUp||t._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:1})})),t._startTime=Date.now(),t._periodicReportInterval>0&&t._startPeriodicTimer();var e=t._getOnlineBatchData();e&&e.length>0&&t._online(e)}),(function(){if(t._isColdStartUp=!1,t._open({openway:5}),t._periodicReportInterval>0){t._stopPeriodicTimer();var e=Date.now()-t._startTime;t._accumulatedTime+=e,t._setStorage(_.ACCUMULATED_TIME,t._accumulatedTime.toString()),t._consoleLog&&console.log("[XLOG] 切后台,累计时长:",t._accumulatedTime,"ms")}else t._sendOnline()}))},t.prototype._startPeriodicTimer=function(){var e=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){e._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},t.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},t.prototype._checkPeriodicReport=function(){var e=Date.now()-this._startTime,t=this._accumulatedTime+e;if(t>=this._periodicReportInterval){var o=Math.floor(t/this._periodicReportInterval),i=o*this._periodicReportInterval;this._sendPeriodicOnline(i,o),this._accumulatedTime=t-i,this._startTime=Date.now(),this._setStorage(_.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(i,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},t.prototype._sendPeriodicOnline=function(t,o){for(var i=Date.now()-t,n=[],r=0;r<o;r++){var s=i+r*this._periodicReportInterval,a=s+this._periodicReportInterval;n.push(e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:s.toString()}))}this._online(n)},t.prototype._getMp=function(){var e={mp:null,platform:7};return"undefined"!=typeof tt&&tt.getSystemInfo?(e.mp=tt,e.platform=2):"undefined"!=typeof ks&&ks.getSystemInfo?(e.mp=ks,e.platform=3):"undefined"!=typeof swan&&swan.getSystemInfo?(e.mp=swan,e.platform=4):"undefined"!=typeof qq&&qq.getSystemInfo?(e.mp=qq,e.platform=5):"undefined"!=typeof wx&&wx.getSystemInfo?(e.mp=wx,e.platform=1):"undefined"!=typeof my&&my.getSystemInfo?e.mp=my:"undefined"!=typeof jd&&jd.getSystemInfo&&(e.mp=jd),e},t.prototype._visibilityChange=function(e,t){var o,i,n,r,s=this;void 0===e&&(e=function(){}),void 0===t&&(t=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(i=this._mp)||void 0===i?void 0:i.onShow),c=(null===(n=this._mp)||void 0===n?void 0:n.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide);a&&a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),e()})),c&&c((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),t()}))}catch(e){console.error("[XLOG] onAppShow or onAppHide error",e)}},t.prototype._getStorage=function(e){var t;try{var o=null===(t=this._mp)||void 0===t?void 0:t.getStorageSync("XYZ_LOG_".concat(e));return null==o?"":o}catch(e){return console.error("[XLOG] getStorageSync error",e),""}},t.prototype._setStorage=function(e,t){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(e),t)}catch(e){console.error("[XLOG] setStorageSync error",e)}},t.prototype._getBatchId=function(){var e=this._getStorage(_.BATCH_ID);return e||(e=p(),this._setStorage(_.BATCH_ID,e)),e},t.prototype._coldStartUp=function(){var e=this;this._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:0}),e._periodicReportInterval>0&&e._startPeriodicTimer()}))},t.prototype._getApis=function(t){var o=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"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(i.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(i.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(e){this._setStorage(_.COMMON_PARAMS,JSON.stringify(e))},t.prototype._getInitParams=function(){var e,t=(null===(e=this._systemInfo.system)||void 0===e?void 0:e.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:y,appqid:y+d(),os:this._systemInfo.platform,osversion:t,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),i=this._getStorage(_.COMMON_PARAMS);i&&(o=e(e({},o),this._safeJsonParse(i,{}))),t&&(o=e(e({},o),t)),this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var e=this;return new Promise((function(t){var o;try{null===(o=e._mp)||void 0===o||o.getNetworkType({success:function(e){var o=((null==e?void 0:e.networkType)||"").toLowerCase();t({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return t("none")}})}catch(e){console.error("[XLOG] getNetworkType error",e),t("none")}}))},t.prototype._getUserInfo=function(t){var o={};t&&(o=this._safeJsonParse(t,{}));var i={};return this.commonParams.userinfo&&(i=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(e(e(e({},this._extraInfo),i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.openid,o=this._commonParams.unionid;e=this._filterParams(e),this._updateCommonParams(e),(e.openid&&e.openid!==t||e.unionid&&e.unionid!==o)&&this._open({isreturn:e.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo){var o=t.appsubid||this._commonParams.appsubid;o&&(t.userinfo=JSON.stringify(e(e({},this._safeJsonParse(t.userinfo,{})),{appsubid:o}))),t.userinfo=this._getUserInfo(t.userinfo)}t.appcqid&&(t.appqid=t.appcqid+d()),t.appver&&(t.appverint=u(t.appver)),this._commonParams=e(e({},this._commonParams),t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._getApptypeid=function(e){var t=e||this._commonParams.apptypeid||"";return t||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),t},t.prototype._request=function(e,t,o){var i=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(n,r){var s;try{null===(s=i._mp)||void 0===s||s.request({url:e,data:t,method:"POST",header:{"content-type":o},success:function(o){i._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,o),n(o)},fail:function(o){i._consoleLog&&console.log("[XLOG] FAIL: ".concat(e),t,o),r(o)}})}catch(e){console.error("[XLOG] request error",e),r(e)}}))},t.prototype.open=function(e){this._open({querystring:e.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var i=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:b});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",i),this._request(this._openUrl,i)}},t.prototype.event=function(t){var o=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)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=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)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=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)",o),this._request(this._adUrl,o,"application/json")},t.prototype._getPlatformPath=function(){var e="";return 1===this._platform?e="wx/":3===this._platform&&(e="ks/"),e},t.prototype._getPlatformStr=function(){var e="DY";return 1===this._platform?e="WX":3===this._platform&&(e="KS"),e},t.prototype.code2session=function(e){var t;return o(this,void 0,void 0,(function(){var o,n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return o=this._getApptypeid(e.apptypeid),n=this._getPlatformPath(),r="".concat(this._businessDomain,"/AppletUtils/").concat(n,"code2session"),[4,this._request(r,{appTypeId:o,code:e.code,testNet:e.testNet},"application/json")];case 1:return s=i.sent(),a=null===(t=s.data)||void 0===t?void 0:t.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,s.data]}}))}))},t.prototype.msgSecCheck=function(e){return o(this,void 0,void 0,(function(){var t,o,n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return 1!==this._platform?(console.warn("[XLOG] msgSecCheck 仅支持微信小程序/小游戏平台"),[2]):(t=(e.content||"").trim())?(o=this._getApptypeid(e.apptypeid),(n=e.openid||this._sessionInfo.openid||this._commonParams.openid)?((r="number"==typeof e.scene?e.scene:4)!==(s=r>=1&&r<=5?r:4)&&console.warn("[XLOG] msgSecCheck scene超出范围,已回退为4"),a="".concat(this._businessDomain,"/AppletUtils/wx/msgCheck"),this._consoleLog&&console.log("[XLOG] PARAMS(MSG_SEC_CHECK)",{appTypeId:o,openid:n,scene:s,content:t}),[4,this._request(a,{appTypeId:o,openid:n,scene:s,content:t},"application/json")]):(console.warn("[XLOG] msgSecCheck openid不存在,请先登录(调用方法code2session)或手动传入openid",this._sessionInfo),[2])):(console.warn("[XLOG] msgSecCheck content不能为空"),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},t.prototype.getSubsidy=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t,os:this._systemInfo.platform,openId:o},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype.getUserProps=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t,openId:o},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype._sleep=function(e){return void 0===e&&(e=1e3),o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t,o){setTimeout(t,e)}))]}))}))},t.prototype.pay=function(t){var n,r;return o(this,void 0,void 0,(function(){var o,s,a,c,p,l,u,d,m,h,f,g,v,_,b,w,y,O,P,A=this;return i(this,(function(i){switch(i.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),o=this._getPlatformStr(),"WX"===o?[4,this.createOrder(t)]:[3,17];case 1:if(!(null==(s=i.sent())?void 0:s.data))return[3,15];if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),a="ios"===this._systemInfo.platform.toLowerCase(),c=null==s?void 0:s.data,p=c.orderId,l=c.payContent,u=l.offerId,d=l.zone_id,m=l.env,h=l.buy_quantity,f=l.kfMessageTitle,g=l.kfMessageImg,!a)return[3,6];v={sessionFrom:t.sessionFrom,showMessageCard:t.showMessageCard||!0,sendMessageTitle:t.sendMessageTitle||f,sendMessagePath:t.sendMessagePath,sendMessageImg:t.sendMessageImg||g},i.label=2;case 2:return i.trys.push([2,4,,5]),[4,new Promise((function(t,o){A._mp.openCustomerServiceConversation(e(e({},v),{success:t,fail:o}))}))];case 3:return w=i.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",w),[2,{payResult:-1}];case 4:return _=i.sent(),console.error("[XLOG] 取消进入客服会话",_,v),[2,{payResult:0}];case 5:return[3,14];case 6:b={mode:"game",env:m,offerId:u,currencyType:"CNY",platform:"android",buyQuantity:h,zoneId:d,outTradeNo:p},i.label=7;case 7:return i.trys.push([7,9,,10]),[4,new Promise((function(t,o){A._mp.requestMidasPayment(e(e({},b),{success:t,fail:o}))}))];case 8:return w=i.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",w),[3,10];case 9:return y=i.sent(),console.error("[XLOG] 微信虚拟支付 err: ",y,b),[2,{payResult:0}];case 10:return i.trys.push([10,13,,14]),[4,this._sleep()];case 11:return i.sent(),[4,this.checkOrder({orderId:p})];case 12:return O=i.sent(),[2,{payResult:(null===(n=null==O?void 0:O.data)||void 0===n?void 0:n.payResult)&&1==(null===(r=null==O?void 0:O.data)||void 0===r?void 0:r.payResult)?1:0}];case 13:return P=i.sent(),console.error("[XLOG] 订单校验 err: ",P,e({orderId:p},b)),[2,{payResult:0}];case 14:return[3,16];case 15:return console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}];case 16:return[3,18];case 17:return console.error("[XLOG] 支付目前只支持微信平台"),[2,{payResult:0}];case 18:return[2]}}))}))},t.prototype.checkOrder=function(e){return o(this,void 0,void 0,(function(){var t,o,n,r,s;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._getPlatformPath(),n=this._sessionInfo,r=n.openid,s=n.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(o,"chkOrder"),{appTypeId:t,orderId:e.orderId,os:this._systemInfo.platform,openId:r,sessionKey:s},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype.createOrder=function(e){return o(this,void 0,void 0,(function(){var t,o,n;return i(this,(function(i){switch(i.label){case 0:return this.isLogin()?(t=this._getApptypeid(e.apptypeid),o=this._sessionInfo.openid,n=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t,productId:e.productId,extInfo:e.extInfo,os:this._systemInfo.platform,payPlatform:n,openId:o},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,i.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=Math.max(0,t-this._startTime),i=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:t.toString(),starttime:this._startTime.toString()});this._online([i])},t.prototype._setOnlineBatchData=function(e){this._setStorage(_.ONLINE_BATCH_DATA,e)},t.prototype._getOnlineBatchData=function(){try{var e=this._getStorage(_.ONLINE_BATCH_DATA);if(Array.isArray(e))return e;if("string"==typeof e&&e){var t=this._safeJsonParse(e,[]);return Array.isArray(t)?t:[]}return[]}catch(e){return console.error("[XLOG] get online batch data error",e),[]}},t.prototype._clearOnlineBatchData=function(){this._setStorage(_.ONLINE_BATCH_DATA,"")},t.prototype._online=function(e){var t=this;e&&0!==e.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),t._setOnlineBatchData(e)})))},t.prototype._initIAAPlugin=function(){var e;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var t=null===(e=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===e?void 0:e.default;if("function"!=typeof t)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=t(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(e){console.error("[XLOG:IAA] 插件初始化异常",e)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},t.prototype.iaa=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return this._miniGameCommon?[2,new Promise((function(n,r){setTimeout((function(){return o(t,void 0,void 0,(function(){var t,o,s,a;return i(this,(function(i){switch(i.label){case 0:t=null,o=e.sessionKey,s=e.reportData,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(s),labelId:"iaa_feature"})];case 2:return t=i.sent(),[3,4];case 3:return a=i.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),r(a),[2];case 4:return t?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",t),this._sendIAAData({session_key:o,requestReportData:JSON.stringify(s),iv:t.iv,encryptedData:t.encryptedData}),n(t),[2]):(r(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},t.prototype._sendIAAData=function(e){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),e,"application/json")},t}(),P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A={exports:{}};!function(e,t){!function(o,i){var n="function",r="undefined",s="object",a="string",c="major",p="model",l="name",u="type",d="vendor",m="version",h="architecture",f="console",g="mobile",v="tablet",_="smarttv",b="wearable",w="embedded",y="Amazon",O="Apple",P="ASUS",A="BlackBerry",S="Browser",I="Chrome",L="Firefox",k="Google",x="Huawei",C="LG",U="Microsoft",T="Motorola",q="Opera",G="Samsung",N="Sharp",M="Sony",R="Xiaomi",X="Zebra",D="Facebook",E="Chromium OS",j="Mac OS",B=" Browser",J=function(e){for(var t={},o=0;o<e.length;o++)t[e[o].toUpperCase()]=e[o];return t},z=function(e,t){return typeof e===a&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===r?e:e.substring(0,500)},F=function(e,t){for(var o,r,a,c,p,l,u=0;u<t.length&&!p;){var d=t[u],m=t[u+1];for(o=r=0;o<d.length&&!p&&d[o];)if(p=d[o++].exec(e))for(a=0;a<m.length;a++)l=p[++r],typeof(c=m[a])===s&&c.length>0?2===c.length?typeof c[1]==n?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==n||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):i:this[c[0]]=l?c[1].call(this,l,c[2]):i:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):i):this[c]=l||i;u+=2}},V=function(e,t){for(var o in t)if(typeof t[o]===s&&t[o].length>0){for(var n=0;n<t[o].length;n++)if(z(t[o][n],e))return"?"===o?i:o}else if(z(t[o],e))return"?"===o?i:o;return t.hasOwnProperty("*")?t["*"]:e},Z={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"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,m],[/opios[\/ ]+([\w\.]+)/i],[m,[l,q+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[l,q+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[l,q]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[l,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[l,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+S],m],[/\bfocus\/([\w\.]+)/i],[m,[l,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[l,q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[l,q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[l,"MIUI"+B]],[/fxios\/([\w\.-]+)/i],[m,[l,L]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+B],m],[/samsungbrowser\/([\w\.]+)/i],[m,[l,G+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,m],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,D],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[l,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,I+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[l,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[m,V,{"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,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[l,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\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|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,H]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[d,G],[u,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[d,G],[u,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,O],[u,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,O],[u,v]],[/(macintosh);/i],[p,[d,O]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,N],[u,g]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[d,"Honor"],[u,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[d,x],[u,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,x],[u,g]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[d,R],[u,g]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[d,R],[u,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,"OPPO"],[u,g]],[/\b(opd2\d{3}a?) bui/i],[p,[d,"OPPO"],[u,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,"Vivo"],[u,g]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,"Realme"],[u,g]],[/\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],[p,[d,T],[u,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,T],[u,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,C],[u,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,C],[u,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[d,"Lenovo"],[u,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[d,"Nokia"],[u,g]],[/(pixel c)\b/i],[p,[d,k],[u,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[d,k],[u,g]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[d,M],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[d,M],[u,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[d,"OnePlus"],[u,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,y],[u,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[d,y],[u,g]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[u,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,A],[u,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,P],[u,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,P],[u,g]],[/(nexus 9)/i],[p,[d,"HTC"],[u,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g," "],[u,g]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[d,"TCL"],[u,v]],[/(itel) ((\w+))/i],[[d,H],p,[u,V,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,"Acer"],[u,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,"Meizu"],[u,g]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,"Ulefone"],[u,g]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,"Energizer"],[u,g]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,"Cat"],[u,g]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,"Smartfren"],[u,g]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[d,"Nothing"],[u,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,p,[u,g]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(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],[d,p,[u,v]],[/(surface duo)/i],[p,[d,U],[u,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,"Fairphone"],[u,g]],[/(u304aa)/i],[p,[d,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[p,[d,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[p,[d,"RCA"],[u,v]],[/\b(venue[\d ]{2,7}) b/i],[p,[d,"Dell"],[u,v]],[/\b(q(?:mv|ta)\w+) b/i],[p,[d,"Verizon"],[u,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[d,"Barnes & Noble"],[u,v]],[/\b(tm\d{3}\w+) b/i],[p,[d,"NuVision"],[u,v]],[/\b(k88) b/i],[p,[d,"ZTE"],[u,v]],[/\b(nx\d{3}j) b/i],[p,[d,"ZTE"],[u,g]],[/\b(gen\d{3}) b.+49h/i],[p,[d,"Swiss"],[u,g]],[/\b(zur\d{3}) b/i],[p,[d,"Swiss"],[u,v]],[/\b((zeki)?tb.*\b) b/i],[p,[d,"Zeki"],[u,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],p,[u,v]],[/\b(ns-?\w{0,9}) b/i],[p,[d,"Insignia"],[u,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[d,"NextBook"],[u,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],p,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],p,[u,g]],[/\b(ph-1) /i],[p,[d,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[d,"Envizen"],[u,v]],[/\b(trio[-\w\. ]+) b/i],[p,[d,"MachSpeed"],[u,v]],[/\btu_(1491) b/i],[p,[d,"Rotor"],[u,v]],[/(shield[\w ]+) b/i],[p,[d,"Nvidia"],[u,v]],[/(sprint) (\w+)/i],[d,p,[u,g]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[d,U],[u,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,X],[u,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,X],[u,g]],[/smart-tv.+(samsung)/i],[d,[u,_]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[d,G],[u,_]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[u,_]],[/(apple) ?tv/i],[d,[p,O+" TV"],[u,_]],[/crkey/i],[[p,I+"cast"],[d,k],[u,_]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,y],[u,_]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,N],[u,_]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,M],[u,_]],[/(mitv-\w{5}) bui/i],[p,[d,R],[u,_]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[u,_]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[p,W],[u,_]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,_]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,p,[u,f]],[/droid.+; (shield) bui/i],[p,[d,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[p,[d,M],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,U],[u,f]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[d,G],[u,b]],[/((pebble))app/i],[d,p,[u,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,O],[u,b]],[/droid.+; (glass) \d/i],[p,[d,k],[u,b]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,X],[u,b]],[/droid.+; (glass) \d/i],[p,[d,k],[u,b]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[u,b]],[/; (quest( \d| pro)?)/i],[p,[d,D],[u,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[u,w]],[/(aeobc)\b/i],[p,[d,y],[u,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[u,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[u,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[l,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,m],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[m,V,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,V,Z],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,m],[/\(bb(10);/i],[m,[l,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[l,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[l,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,E],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(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,m],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,m]]},Y=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof Y))return new Y(e,t).getResult();var f=typeof o!==r&&o.navigator?o.navigator:i,_=e||(f&&f.userAgent?f.userAgent:""),b=f&&f.userAgentData?f.userAgentData:i,w=t?function(e,t){var o={};for(var i in e)t[i]&&t[i].length%2==0?o[i]=t[i].concat(e[i]):o[i]=e[i];return o}(K,t):K,y=f&&f.userAgent==_;return this.getBrowser=function(){var e,t={};return t[l]=i,t[m]=i,F.call(t,_,w.browser),t[c]=typeof(e=t[m])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,y&&f&&f.brave&&typeof f.brave.isBrave==n&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[h]=i,F.call(e,_,w.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[p]=i,e[u]=i,F.call(e,_,w.device),y&&!e[u]&&b&&b.mobile&&(e[u]=g),y&&"Macintosh"==e[p]&&f&&typeof f.standalone!==r&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[p]="iPad",e[u]=v),e},this.getEngine=function(){var e={};return e[l]=i,e[m]=i,F.call(e,_,w.engine),e},this.getOS=function(){var e={};return e[l]=i,e[m]=i,F.call(e,_,w.os),y&&!e[l]&&b&&b.platform&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,E).replace(/macos/i,j)),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 _},this.setUA=function(e){return _=typeof e===a&&e.length>500?W(e,500):e,this},this.setUA(_),this};Y.VERSION="1.0.40",Y.BROWSER=J([l,m,c]),Y.CPU=J([h]),Y.DEVICE=J([p,d,u,f,g,_,v,b,w]),Y.ENGINE=Y.OS=J([l,m]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var $=typeof o!==r&&(o.jQuery||o.Zepto);if($&&!$.ua){var Q=new Y;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var o in t)$.ua[o]=t[o]}}}("object"==typeof window?window:P)}(A,A.exports);var S=new A.exports.UAParser,I=S.getBrowser(),L=I.name,k=I.version,x=S.getEngine(),C=x.name,U=x.version,T=function(){var e=(0,S.getOS)();return{os:e.name,osversion:e.version}}(),q=T.os,G=T.osversion,N=function(){var e=(0,S.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),M=N.device,R=N.devicebrand;q=q||"",G=G||"",M=M||"",R=R||"";var X={exports:{}},D={exports:{}},E=1e3,j=60*E,B=60*j,J=24*B,z=365.25*J,H=function(e,t){t=t||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*z;case"days":case"day":case"d":return o*J;case"hours":case"hour":case"hrs":case"hr":case"h":return o*B;case"minutes":case"minute":case"mins":case"min":case"m":return o*j;case"seconds":case"second":case"secs":case"sec":case"s":return o*E;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return t.long?function(e){return W(e,J,"day")||W(e,B,"hour")||W(e,j,"minute")||W(e,E,"second")||e+" ms"}(e):function(e){if(e>=J)return Math.round(e/J)+"d";if(e>=B)return Math.round(e/B)+"h";if(e>=j)return Math.round(e/j)+"m";if(e>=E)return Math.round(e/E)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function W(e,t,o){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+o:Math.ceil(e/t)+" "+o+"s"}!function(e,t){var o;function i(e){function i(){if(i.enabled){var e=i,n=+new Date,r=n-(o||n);e.diff=r,e.prev=o,e.curr=n,o=n;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(o,i){if("%%"===o)return o;c++;var n=t.formatters[i];if("function"==typeof n){var r=s[c];o=n.call(e,r),s.splice(c,1),c--}return o})),t.formatArgs.call(e,s),(i.log||t.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var o,i=0;for(o in e)i=(i<<5)-i+e.charCodeAt(o),i|=0;return t.colors[Math.abs(i)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=D.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length,n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var o,i;for(o=0,i=t.skips.length;o<i;o++)if(t.skips[o].test(e))return!1;for(o=0,i=t.names.length;o<i;o++)if(t.names[o].test(e))return!0;return!1},t.humanize=H,t.names=[],t.skips=[],t.formatters={}}(0,D.exports),function(e,t){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=D.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+t.humanize(this.diff),!o)return;var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.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+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}(X,X.exports);var F=X.exports("jsonp"),V=function(e,t,o){"function"==typeof t&&(o=t,t={});t||(t={});var i,n,r=t.prefix||"__jp",s=t.name||r+Z++,a=t.param||"callback",c=null!=t.timeout?t.timeout:6e4,p=encodeURIComponent,l=document.getElementsByTagName("script")[0]||document.head;c&&(n=setTimeout((function(){u(),o&&o(new Error("Timeout"))}),c));function u(){i.parentNode&&i.parentNode.removeChild(i),window[s]=K,n&&clearTimeout(n)}return window[s]=function(e){F("jsonp got",e),u(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+a+"="+p(s)).replace("?&","?"),F('jsonp req "%s"',e),(i=document.createElement("script")).src=e,l.parentNode.insertBefore(i,l),function(){window[s]&&u()}},Z=0;function K(){}function Y(e,t){return void 0===t&&(t={}),new Promise((function(o,i){var n;V("".concat(e,"?").concat((n=t,Object.keys(n).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__"),timeout:0},(function(e,t){e?i(e):o(t)}))}))}var $=function(e,t){return Y(e,t)},Q=function(){function t(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,s=void 0===r||r,a=e.consoleLog,c=void 0===a||a;this.version=b,this.buildDate=w,this._urlParams=m(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._isPro=n,this._sendOpenLog=s,this._consoleLog=c;var p=this._getApis(t),l=p.openUrl,u=p.eventUrl,d=p.actUrl;this._openUrl=l,this._eventUrl=u,this._actUrl=d,this._updateCommonParams(this._filterParams(o)),this._init()}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._init=function(){var e=this;this._initCommonParams(),this._coldStartUp(),this._visibilityChange((function(){e._updateCommonParams({network:e._getNetWorkType()}),e._open(1)}),(function(){e._open(5)}))},t.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},t.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},t.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},t.prototype._getBatchId=function(){var e=a("BATCH_ID");return e||c("BATCH_ID",e=p()),e},t.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity")}},t.prototype._cacheCommonParams=function(e){s("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){return{os:q,osversion:G,device:M,devicebrand:R,platform:7,openid:l(),appcqid:y,appqid:y+d(),pixel:this._getScreen(),userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(){var t=this._getInitParams(),o=r("COMMON_PARAMS");o&&(t=e(e({},t),JSON.parse(o))),t=h(t,this._commonParams),this._updateCommonParams(e(e({},t),{obatchid:this._getBatchId(),network:this._getNetWorkType()}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}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(e(e({querystring:this._urlParams},i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["accid","apptypeid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){e&&(this._consoleLog&&console.log("[XLOG] setParams",e),e=this._filterParams(e),this._updateCommonParams(e))},t.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+d()),e.appver&&(e.appverint=u(e.appver)),this._commonParams=h(this._commonParams,e),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t){$(e,t)},t.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{openway:t,appqid:this._getAppqid(),xmlog:b});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var o=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)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=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)",o),this._request(this._actUrl,o)},t}();
7
7
  /*! js-cookie v3.0.5 | MIT */
8
- function ee(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)e[i]=o[i]}return e}var te=function e(t,o){function i(e,i,n){if("undefined"!=typeof document){"number"==typeof(n=ee({},o,n)).expires&&(n.expires=new Date(Date.now()+864e5*n.expires)),n.expires&&(n.expires=n.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var s in n)n[s]&&(r+="; "+s,!0!==n[s]&&(r+="="+n[s].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+r}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],i={},n=0;n<o.length;n++){var r=o[n].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(i[a]=t.read(s,a),e===a)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){i(e,"",ee({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,ee({},this.attributes,t))},withConverter:function(t){return e(ee({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(t)}})}({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:"/"}),oe="XYZ_LOG_HW_",ie="".concat(oe,"COMMON_PARAMS"),ne="".concat(oe,"ONLINE_BACH_DATA"),re=function(){function o(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,s=void 0===r||r,a=e.consoleLog,c=void 0===a||a,p=e.ignoreUrlParams,l=void 0===p?[]:p;this.version=b,this.buildDate=w,this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=n,this._ignoreUrlParams=l,this._sendOpenLog=s,this._consoleLog=c;var u=this._getApis(t),d=u.openUrl,m=u.actUrl,h=u.adUrl,f=u.online;this._openUrl=d,this._actUrl=m,this._adUrl=h,this._onlineUrl=f,this._init(o)}return Object.defineProperty(o.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),o.prototype._init=function(t){var o=this;this._updateCommonParams(e(e({},this._filterParams(t)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},o.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},o.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},o.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},o.prototype._getBatchId=function(){var e=a("BATCH_ID");return e||c("BATCH_ID",e=p()),e},o.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},o.prototype._getApis=function(t){var o=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"},i=e(e({},o),t);return{openUrl:"".concat(i.open,"/out-comm-logs/client/h5/open"),actUrl:"".concat(i.act,"/out-comm-logs/client/h5/activity"),adUrl:"".concat(i.ad,"/out-comm-logs/server/h5/advlog"),online:"".concat(i.online,"/out-comm-logs/server/h5/onlineTime")}},o.prototype._cacheCommonParams=function(o){var i=r(ie),n=this._getInitParams(),a=n.userinfo,c=t(n,["userinfo"]),p=JSON.parse(i||"{}"),l=p.userinfo,u=t(p,["userinfo"]),d=o.userinfo,m=t(o,["userinfo"]),f=e(e(e({},JSON.parse(a||"{}")),JSON.parse(l||"{}")),JSON.parse(d||"{}")),g=h(h(c,u),m);this._commonParams=e(e({},g),{userinfo:JSON.stringify(f)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),s(ie,JSON.stringify(this._commonParams))},o.prototype._getInitParams=function(){return{osversion:N,device:M,devicebrand:R,os:q,platform:g(),uid:l(),appcqid:y,pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(t)),url:encodeURI(location.href)};var e,t},o.prototype._getUserInfo=function(e){var t={};if(e)try{t=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(f({lang:navigator.language,browser:L,browserversion:k,engine:U,engineversion:C,platform:g(),querystring:m(this._ignoreUrlParams),fbc:te.get("_fbc"),fbp:te.get("_fbp"),ttp:te.get("_ttp")},o,t))},o.prototype._filterParams=function(e){var t={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var i in e){var n=i,r=e[n];o.includes(n)&&r&&(t[n]=r)}}return t},o.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var t=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype._updateCommonParams=function(t){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo?t.userinfo=this._getUserInfo(t.userinfo):t.userinfo=this._getUserInfo();try{o=JSON.parse(t.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(t.userinfo,'" parse error'),e)}t.platform&&(t.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:t.platform})))),this._cacheCommonParams(e(e({},t),{url:encodeURI(location.href),network:this._getNetWorkType()}))},o.prototype._request=function(e,t){var o=this;return $(e,t).then((function(i){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,i),i})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),t,o),Promise.reject(o)}))},o.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:b,url_from:document.referrer,openway:t});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},o.prototype.act=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},o.prototype.ad=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),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||"",adfrom:t.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},o.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},o.prototype._setOnlineBatchData=function(e){s(ne,JSON.stringify(e))},o.prototype._getOnlineBatchData=function(){var e=r(ne);return e?JSON.parse(e):""},o.prototype._clearOnlineBatchData=function(){s(ne,"")},o.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),t._setOnlineBatchData(e)}))},o}();exports.XLogMp=O,exports.XLogWeb=Q,exports.XLogWebHw=re;
8
+ function ee(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)e[i]=o[i]}return e}var te=function e(t,o){function i(e,i,n){if("undefined"!=typeof document){"number"==typeof(n=ee({},o,n)).expires&&(n.expires=new Date(Date.now()+864e5*n.expires)),n.expires&&(n.expires=n.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var s in n)n[s]&&(r+="; "+s,!0!==n[s]&&(r+="="+n[s].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+r}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],i={},n=0;n<o.length;n++){var r=o[n].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(i[a]=t.read(s,a),e===a)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){i(e,"",ee({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,ee({},this.attributes,t))},withConverter:function(t){return e(ee({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(t)}})}({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:"/"}),oe="XYZ_LOG_HW_",ie="".concat(oe,"COMMON_PARAMS"),ne="".concat(oe,"ONLINE_BACH_DATA"),re=function(){function o(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,s=void 0===r||r,a=e.consoleLog,c=void 0===a||a,p=e.ignoreUrlParams,l=void 0===p?[]:p;this.version=b,this.buildDate=w,this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=n,this._ignoreUrlParams=l,this._sendOpenLog=s,this._consoleLog=c;var u=this._getApis(t),d=u.openUrl,m=u.actUrl,h=u.adUrl,f=u.online;this._openUrl=d,this._actUrl=m,this._adUrl=h,this._onlineUrl=f,this._init(o)}return Object.defineProperty(o.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),o.prototype._init=function(t){var o=this;this._updateCommonParams(e(e({},this._filterParams(t)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},o.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},o.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},o.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},o.prototype._getBatchId=function(){var e=a("BATCH_ID");return e||c("BATCH_ID",e=p()),e},o.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},o.prototype._getApis=function(t){var o=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"},i=e(e({},o),t);return{openUrl:"".concat(i.open,"/out-comm-logs/client/h5/open"),actUrl:"".concat(i.act,"/out-comm-logs/client/h5/activity"),adUrl:"".concat(i.ad,"/out-comm-logs/server/h5/advlog"),online:"".concat(i.online,"/out-comm-logs/server/h5/onlineTime")}},o.prototype._cacheCommonParams=function(o){var i=r(ie),n=this._getInitParams(),a=n.userinfo,c=t(n,["userinfo"]),p=JSON.parse(i||"{}"),l=p.userinfo,u=t(p,["userinfo"]),d=o.userinfo,m=t(o,["userinfo"]),f=e(e(e({},JSON.parse(a||"{}")),JSON.parse(l||"{}")),JSON.parse(d||"{}")),g=h(h(c,u),m);this._commonParams=e(e({},g),{userinfo:JSON.stringify(f)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),s(ie,JSON.stringify(this._commonParams))},o.prototype._getInitParams=function(){return{osversion:G,device:M,devicebrand:R,os:q,platform:g(),uid:l(),appcqid:y,pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(t)),url:encodeURI(location.href)};var e,t},o.prototype._getUserInfo=function(e){var t={};if(e)try{t=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(f({lang:navigator.language,browser:L,browserversion:k,engine:C,engineversion:U,platform:g(),querystring:m(this._ignoreUrlParams),fbc:te.get("_fbc"),fbp:te.get("_fbp"),ttp:te.get("_ttp")},o,t))},o.prototype._filterParams=function(e){var t={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var i in e){var n=i,r=e[n];o.includes(n)&&r&&(t[n]=r)}}return t},o.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var t=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype._updateCommonParams=function(t){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo?t.userinfo=this._getUserInfo(t.userinfo):t.userinfo=this._getUserInfo();try{o=JSON.parse(t.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(t.userinfo,'" parse error'),e)}t.platform&&(t.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:t.platform})))),this._cacheCommonParams(e(e({},t),{url:encodeURI(location.href),network:this._getNetWorkType()}))},o.prototype._request=function(e,t){var o=this;return $(e,t).then((function(i){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,i),i})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),t,o),Promise.reject(o)}))},o.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:b,url_from:document.referrer,openway:t});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},o.prototype.act=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},o.prototype.ad=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),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||"",adfrom:t.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},o.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},o.prototype._setOnlineBatchData=function(e){s(ne,JSON.stringify(e))},o.prototype._getOnlineBatchData=function(){var e=r(ne);return e?JSON.parse(e):""},o.prototype._clearOnlineBatchData=function(){s(ne,"")},o.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),t._setOnlineBatchData(e)}))},o}();exports.XLogMp=O,exports.XLogWeb=Q,exports.XLogWebHw=re;