/*! pacakge version: 3.11.3 */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Logger=t():e.Logger=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./build",n(n.s=5)}([function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var r=n(2),o={};function i(){return Object(r.a)()?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:o}}).call(this,n(6))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=i)throw new Error("lowerIndex should be less than upperIndex");o&&i&&u.paramChecker(a,u.ParamCheckerEnum.Boolean,"indexRange's lowerExclusive",!0),u.paramChecker(s,u.ParamCheckerEnum.Boolean,"indexRange's upperExclusive",!0)}}function l(){try{return a.default(),!0}catch(e){return!1}}t.idbIsSupported=l;var f=function(){function e(e){a.default(),function(e){u.paramChecker(e,u.ParamCheckerEnum.NotNullObject,"dbConfig",!1),u.paramChecker(e.dbName,u.ParamCheckerEnum.String,"dbName",!1),u.paramChecker(e.dbVersion,u.ParamCheckerEnum.NonNegativeInteger,"dbVersion",!0),u.paramChecker(e.itemDuration,u.ParamCheckerEnum.NonNegativeInteger,"itemDuration of dbConfig",!0),u.paramChecker(e.tables,u.ParamCheckerEnum.NotNullObject,"tables",!0),Object.keys(e.tables||{}).forEach((function(t){var n=e.tables[t];u.paramChecker(n.primaryKey,u.ParamCheckerEnum.String,"primaryKey",!0),u.paramChecker(n.itemDuration,u.ParamCheckerEnum.NonNegativeInteger,"itemDuration of table",!0),u.paramChecker(n.indexList,u.ParamCheckerEnum.Array,"indexList",!0),(n.indexList||[]).forEach((function(e){u.paramChecker(e.indexName,u.ParamCheckerEnum.String,"indexName",!1),u.paramChecker(e.unique,u.ParamCheckerEnum.Boolean,"unique",!0)}))}))}(e),this.name=e.dbName,this.version=u.optionWithBackup(e.dbVersion,1),this.tableList=Object.keys(e.tables||{}).map((function(t){return r({tableName:t},e.tables[t])})),this.itemDuration=e.itemDuration}return e.prototype.addItems=function(e){return o(this,void 0,void 0,(function(){var t,n,o=this;return i(this,(function(i){switch(i.label){case 0:return t=function(e,t,n){return void 0!==n?n:void 0!==t?t:e},a=e,c=this.tableList,u.paramChecker(a,u.ParamCheckerEnum.Array,"items",!1),a.forEach((function(e){u.paramChecker(e.tableName,u.ParamCheckerEnum.String,"item's tableName",!1),u.paramChecker(e.itemDuration,u.ParamCheckerEnum.NonNegativeInteger,"item's itemDuration",!0);var t=c.filter((function(t){return t.tableName===e.tableName}))[0];if(!t)throw new Error("Table "+e.tableName+" does not exist");if(void 0!==t.primaryKey&&Object.getOwnPropertyNames(e.item).indexOf(t.primaryKey)<0)throw new Error("primaryKey is needed for item in table "+e.tableName)})),n=e.map((function(e){var n=o.tableList.filter((function(t){return t.tableName===e.tableName}))[0];return r({itemDuration:t(o.itemDuration,n.itemDuration,e.itemDuration)},e)})),[4,s.default.addItems({name:this.name,tableList:this.tableList,version:this.version},n)];case 1:return i.sent(),[2]}var a,c}))}))},e.prototype.getItem=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,d(this.name,e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getItemsInRange=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,h(this.name,e)];case 1:return[2,t.sent()]}}))}))},e.prototype.deleteItemsInRange=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return u.paramChecker(e,u.ParamCheckerEnum.Array,"tableIndexRanges",!1),e.forEach((function(e){c(e)})),[4,s.default.deleteItems(this.name,e)];case 1:return t.sent(),[2]}}))}))},e}();function p(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return a.default(),u.paramChecker(e,u.ParamCheckerEnum.String,"dbName",!1),[4,s.default.deleteDB(e)];case 1:return t.sent(),[2]}}))}))}function d(e,t,n){return o(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return u.paramChecker(e,u.ParamCheckerEnum.String,"dbName",!1),u.paramChecker(t,u.ParamCheckerEnum.String,"tableName",!1),[4,s.default.getItem(e,t,n)];case 1:return[2,r.sent()]}}))}))}function h(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return u.paramChecker(e,u.ParamCheckerEnum.String,"dbName",!1),c(t),[4,s.default.getItemsInRange(e,t)];case 1:return[2,n.sent()]}}))}))}t.CustomDB=f,t.deleteDB=p,t.getItemFromDB=d,t.getItemsInRangeFromDB=h,t.default={idbIsSupported:l,CustomDB:f,deleteDB:p,getItemFromDB:d,getItemsInRangeFromDB:h}},function(e,t,n){"use strict";(function(e){function r(){return"[object process]"===Object.prototype.toString.call(void 0!==e?e:0)}n.d(t,"a",(function(){return r}))}).call(this,n(7))},function(e,t,n){"use strict";function r(e){return!isNaN(e)&&e>=0}Object.defineProperty(t,"__esModule",{value:!0}),t.ParamCheckerEnum={NonNegativeInteger:{rule:r,desc:"needs to be a non-negative integer"},NotNullObject:{rule:function(e){return e&&"object"==typeof e},desc:"needs to be a not-null object"},String:{rule:function(e){return"string"==typeof e},desc:"needs to be a string"},Array:{rule:function(e){return e instanceof Array},desc:"needs to be an Array"},Boolean:{rule:function(e){return"boolean"==typeof e},desc:"needs to be a boolean"}},t.isNonNegativeInteger=r,t.optionWithBackup=function(e,t){return void 0!==e?e:t},t.paramChecker=function(e,t,n,r){var o=n+" "+t.desc;if(r){if(void 0!==e&&!t.rule(e))throw new Error(o+" if defined")}else if(!t.rule(e))throw new Error(o)},t.deduplicateList=function(e){return e.reduce((function(e,t){return e.indexOf(t)<0?e.concat(t):e}),[])}},function(e){e.exports=JSON.parse('{"a":"3.11.3"}')},function(e,t,n){e.exports=n(11)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&e.expireTimen.version?(r=t.transaction("IDB_MANAGER_STORE","readwrite"),o=r.objectStore("IDB_MANAGER_STORE"),a={dbName:e.name,tableList:e.tableList,version:e.version},o.put(c({item:a,tableName:"IDB_MANAGER_STORE"})),[4,r.complete]):[3,4];case 3:i.sent(),t.close(),i.label=4;case 4:return[2]}}))}))}function p(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,h()];case 1:return t=r.sent(),n=t.transaction("IDB_MANAGER_STORE","readwrite"),n.objectStore("IDB_MANAGER_STORE").delete(e),[4,n.complete];case 2:return r.sent(),t.close(),[2]}}))}))}function d(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,f(e)];case 1:return t.sent(),[4,s.open(e.name,e.version,(function(t){m(t,e.tableList)}))];case 2:return[2,t.sent()]}}))}))}function h(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,s.open("IDB_MANAGER_DB",1,(function(e){!function(e){e.createObjectStore("IDB_MANAGER_STORE",{keyPath:"dbName"})}(e)}))];case 1:return[2,e.sent()]}}))}))}function y(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,h()];case 1:return[4,g(t=r.sent(),"IDB_MANAGER_STORE",e)];case 2:return n=r.sent(),t.close(),n?[4,s.open(n.dbName,n.version,(function(e){m(e,n.tableList||[])}))]:[3,4];case 3:return[2,r.sent()];case 4:return[2,null]}}))}))}function g(e,t,n){return o(this,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return e.objectStoreNames.contains(t)?(r=e.transaction(t,"readonly"),[4,r.objectStore(t).get(n)]):[3,2];case 1:return[2,l(o.sent())];case 2:return[2,null]}}))}))}function m(e,t){try{t.forEach((function(t){if(e.objectStoreNames.contains(t.tableName)){var n=e.transaction(t.tableName).objectStore(t.tableName);(t.indexList||[]).forEach((function(e){n.indexNames.contains(e.indexName)||n.createIndex(e.indexName,e.indexName,{unique:e.unique})}))}else{var o=t.primaryKey||"id",i=e.createObjectStore(t.tableName,r({keyPath:o},"id"===o?{autoIncrement:!0}:{}));i.createIndex(o,o,{unique:!0}),(t.indexList||[]).forEach((function(e){i.createIndex(e.indexName,e.indexName,{unique:e.unique})})),i.createIndex("updateTime","updateTime",{unique:!1}),i.createIndex("expireTime","expireTime",{unique:!1})}}))}catch(t){e.close()}}function v(e,t,n){return o(this,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,8,9]),[4,n()];case 1:return o.sent(),[4,e.complete];case 2:return o.sent(),[3,9];case 3:r=o.sent();try{e.abort()}catch(e){}o.label=4;case 4:return o.trys.push([4,6,,7]),[4,e.complete];case 5:return o.sent(),[3,7];case 6:return o.sent(),[3,7];case 7:throw r;case 8:return t.close(),[7];case 9:return[2]}}))}))}function b(e,t){return o(this,void 0,void 0,(function(){var n,r,s,c=this;return i(this,(function(l){switch(l.label){case 0:return n=t.filter((function(t){return e.objectStoreNames.contains(t.tableName)})),r=a.deduplicateList(n.map((function(e){return e.tableName}))),[4,v(s=e.transaction(r,"readwrite"),e,(function(){return o(c,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,Promise.all(n.map((function(e){var t=e.tableName,n=e.indexRange,r=s.objectStore(t);return n?new Promise((function(e){r.index(n.indexName).iterateCursor(u(n),(function(t){t?(r.delete(t.primaryKey),t.continue()):e()}))})):r.clear()})))];case 1:return e.sent(),[2]}}))}))}))];case 1:return l.sent(),[2]}}))}))}function _(e,t){return o(this,void 0,void 0,(function(){var n,r,s,u=this;return i(this,(function(l){switch(l.label){case 0:return n=a.deduplicateList(t.map((function(e){return e.tableName}))),[4,N(e.name,n.map((function(e){return{tableName:e,indexRange:{indexName:"expireTime",upperIndex:+new Date,upperExclusive:!1}}})))];case 1:return l.sent(),[4,d(e)];case 2:return r=l.sent(),[4,v(s=r.transaction(n,"readwrite"),r,(function(){return o(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,Promise.all(t.map((function(e){return s.objectStore(e.tableName).put(c(e))})))];case 1:return e.sent(),[2]}}))}))}))];case 3:return l.sent(),[2]}}))}))}function w(e,t,n){return o(this,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,y(e)];case 1:if(!(r=o.sent()))return[3,7];o.label=2;case 2:return o.trys.push([2,4,5,6]),[4,g(r,t,n)];case 3:return[2,o.sent()];case 4:throw o.sent();case 5:return r.close(),[7];case 6:return[3,8];case 7:return[2,null];case 8:return[2]}}))}))}function I(e,t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,c,f;return i(this,(function(i){switch(i.label){case 0:return n=t.tableName,r=t.indexRange,[4,y(e)];case 1:if(!(o=i.sent()))return[3,11];i.label=2;case 2:return i.trys.push([2,8,9,10]),a=[],o.objectStoreNames.contains(n)?[3,3]:[3,7];case 3:return s=o.transaction(n,"readonly"),c=s.objectStore(n),r?[3,5]:[4,c.getAll()];case 4:return f=i.sent(),a=(f||[]).map(l).filter((function(e){return null!==e})),[3,7];case 5:return[4,new Promise((function(e){c.index(r.indexName).iterateCursor(u(r),(function(t){if(t){var n=l(t.value);n&&a.push(n),t.continue()}else e()}))}))];case 6:i.sent(),i.label=7;case 7:return[2,a];case 8:throw i.sent();case 9:return o.close(),[7];case 10:return[3,12];case 11:return[2,[]];case 12:return[2]}}))}))}function T(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,p(e)];case 1:return t.sent(),[4,s.delete(e)];case 2:return t.sent(),[2]}}))}))}function N(e,t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,y(e)];case 1:return(n=r.sent())?[4,b(n,t)]:[3,3];case 2:return r.sent(),[3,4];case 3:case 4:return[2]}}))}))}t.addItems=_,t.getItem=w,t.getItemsInRange=I,t.deleteDB=T,t.deleteItems=N,t.default={addItems:_,getItem:w,getItemsInRange:I,deleteDB:T,deleteItems:N}},function(e,t){function n(e){return Array.prototype.slice.call(e)}function r(e){return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function o(e,t,n){var o,i=new Promise((function(i,a){r(o=e[t].apply(e,n)).then(i,a)}));return i.request=o,i}function i(e,t,n){var r=o(e,t,n);return r.then((function(e){if(e)return new f(e,r.request)}))}function a(e,t,n){n.forEach((function(n){Object.defineProperty(e.prototype,n,{get:function(){return this[t][n]},set:function(e){this[t][n]=e}})}))}function s(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return o(this[t],r,arguments)})}))}function u(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})}))}function c(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return i(this[t],r,arguments)})}))}function l(e){this._index=e}function f(e,t){this._cursor=e,this._request=t}function p(e){this._store=e}function d(e){this._tx=e,this.complete=new Promise((function(t,n){e.oncomplete=function(){t()},e.onerror=function(){n(e.error)},e.onabort=function(){n(e.error)}}))}function h(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new d(n)}function y(e){this._db=e}var g;if(p.prototype.createIndex=function(){return new l(this._store.createIndex.apply(this._store,arguments))},p.prototype.index=function(){return new l(this._store.index.apply(this._store,arguments))},d.prototype.objectStore=function(){return new p(this._tx.objectStore.apply(this._tx,arguments))},h.prototype.createObjectStore=function(){return new p(this._db.createObjectStore.apply(this._db,arguments))},y.prototype.transaction=function(){return new d(this._db.transaction.apply(this._db,arguments))},function(){try{return["IDBIndex","IDBCursor","IDBObjectStore","IDBTransaction","IDBDatabase"].forEach((function(e){if(window&&(!window[e]||!window.hasOwnProperty(e)))throw new Error(e)})),!0}catch(e){return!1}}())a(l,"_index",["name","keyPath","multiEntry","unique"]),s(l,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),c(l,"_index",IDBIndex,["openCursor","openKeyCursor"]),a(f,"_cursor",["direction","key","primaryKey","value"]),s(f,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(e){e in IDBCursor.prototype&&(f.prototype[e]=function(){var t=this,n=arguments;return Promise.resolve().then((function(){return t._cursor[e].apply(t._cursor,n),r(t._request).then((function(e){if(e)return new f(e,t._request)}))}))})})),a(p,"_store",["name","keyPath","indexNames","autoIncrement"]),s(p,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),c(p,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),u(p,"_store",IDBObjectStore,["deleteIndex"]),a(d,"_tx",["objectStoreNames","mode"]),u(d,"_tx",IDBTransaction,["abort"]),a(h,"_db",["name","version","objectStoreNames"]),u(h,"_db",IDBDatabase,["deleteObjectStore","close"]),a(y,"_db",["name","version","objectStoreNames"]),u(y,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(e){[p,l].forEach((function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t=n(arguments),r=t[t.length-1],o=this._store||this._index,i=o[e].apply(o,t.slice(0,-1));i.onsuccess=function(){r(i.result)}})}))})),[l,p].forEach((function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var n=this,r=[];return new Promise((function(o){n.iterateCursor(e,(function(e){e?(r.push(e.value),void 0===t||r.length!=t?e.continue():o(r)):o(r)}))}))})})),g={open:function(e,t,n){var r=o(indexedDB,"open",[e,t]),i=r.request;return i&&(i.onupgradeneeded=function(e){n&&n(new h(i.result,e.oldVersion,i.transaction))}),r.then((function(e){return new y(e)}))},delete:function(e){return o(indexedDB,"deleteDatabase",[e])}};else{var m="indexedDB is not supported";g={open:function(){return Promise.reject(new Error(m))},delete:function(){return Promise.reject(new Error(m))}}}e.exports=g},function(e,t,n){"use strict";var r,o,i,a,s,u;n.r(t),function(e){e.DB_NOT_SUPPORT="IndexedDB is not supported",e.NO_LOG="No log exists",e.REPORT_LOG_SUCC="Report succ",e.REPORT_LOG_FAIL="Report fail",e.DELETE_LOG_FAIL="delete log fail",e.EXCEED_TRY_TIMES="Exceed try times",e.EXCEED_LOG_SIZE_LIMIT="Exceed log size day limit",e.EXCEED_SINGLE_LOG_SIZE_LIMIT="Single log is too large"}(r||(r={})),function(e){e[e.PLAIN=0]="PLAIN",e[e.RSA=1]="RSA"}(o||(o={})),function(e){e[e.LEVEL1=1]="LEVEL1",e[e.LEVEL2=2]="LEVEL2",e[e.LEVEL3=3]="LEVEL3",e[e.LEVEL4=4]="LEVEL4",e[e.LEVEL5=5]="LEVEL5",e[e.TRACK=6]="TRACK",e[e.XHR=7]="XHR",e[e.FETCH=8]="FETCH",e[e.HISTORY=9]="HISTORY",e[e.DOM=10]="DOM",e[e.INIT=11]="INIT",e[e.CONSOLE=12]="CONSOLE",e[e.CRASH=13]="CRASH",e[e.NATIVEAPI=14]="NATIVEAPI",e[e.UNHANDLEDREJECTION=15]="UNHANDLEDREJECTION",e[e.ERROR=16]="ERROR"}(i||(i={})),function(e){e.likee="likee",e.pay="pay",e.helloyo="helloyo",e.hello="hello",e.imo="imo",e.bigolive="bigolive",e.tiki="tiki"}(a||(a={})),function(e){e["^likee"]="likee",e["^(pay|casher)"]="pay",e["^helloyo"]="helloyo",e["^hello"]="hello",e["^imo"]="imo",e["^(bigolive|funkie|agent-oss)"]="bigolive",e["^tiki"]="tiki"}(s||(s={})),function(e){e.likee="//support-json.like.video/json",e.pay="//support-json.bdesk.tech/json",e.helloyo="//support-json.helloyo.sg/json",e.hello="//support-json.ppx520.com/json",e.imo="//support-json.imoim.net/json",e.bigolive="//support-json.ukyuh.tech/json",e.tiki="//bflow.tiki.video/json"}(u||(u={}));var c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n<=12&&r>0&&r<=31&&"Invalid Date"!==new Date(e).toString()}function b(e){var t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return"".concat(t,"-").concat(n<10?"0"+n:n,"-").concat(r<10?"0"+r:r)}function _(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function w(e){var t=(e.match(/(\d+)/g)||[]).map((function(e){return parseInt(e)})),n=t[0],r=t[1],o=t[2];if(n<1e3)throw new Error("Invalid dayString: ".concat(e));return new Date(n,r-1,o)}function I(e,t){return{t:t,c:e,d:Date.now()}}function T(e){if(0===e.length)return Promise.resolve([]);var t=e.map((function(e){return e instanceof Promise?e:Promise.resolve(e)}));return new Promise((function(e,n){var r=[],o=t.length;t.forEach((function(t,n){t.then((function(t){r[n]={status:"fulfilled",value:t},0===(o-=1)&&e(r)}),(function(t){r[n]={status:"rejected",reason:t},0===(o-=1)&&e(r)}))}))}))}function N(e){return Number(Math.random().toString().substr(2,e)+Date.now()).toString(36)}function S(e){if(e instanceof Error){var t={};return Object.getOwnPropertyNames(e).forEach((function(n){return t[n]=e[n]})),JSON.stringify(m({name:"error"},t))}return"string"==typeof e?e:JSON.stringify(e)}var R={counter:1,addCounter:function(){return this.counter++},initCounter:function(){this.counter=1}},E=g("logTryTimes");var x={errorTrigger:function(){E>0&&E--},canSave:function(){return E>0},resetQuota:function(){E=g("logTryTimes")}};function O(e){return"[object String]"===Object.prototype.toString.call(e)}function C(e,t){try{return e instanceof t}catch(e){return!1}}function D(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=k(n,t))||o>1&&i+r.length*a+s.length>=80);)r.push(s),i+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return""}}function k(e,t){var n,r,o,i,a,s=e,u=[];if(!s||!s.tagName)return"";u.push(s.tagName.toLowerCase());var c=t&&t.length?t.filter((function(e){return s.getAttribute(e)})).map((function(e){return[e,s.getAttribute(e)]})):null;if(c&&c.length)c.forEach((function(e){u.push("[".concat(e[0],'="').concat(e[1],'"]'))}));else if(s.id&&u.push("#".concat(s.id)),(n=s.className)&&O(n))for(r=n.split(/\s+/),a=0;a"}catch(e){return""}}var G=function(){return(G=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2?t[2]:void 0;if(r){var o=X,i=String(r);X=i,F("history",{from:o,to:i})}return e.apply(this,t)}}A.onpopstate=function(){for(var e=[],t=0;t0}var oe=function(){return(oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"}0!==n.length&&this._options.logHandler("target: ".concat(n,", category: ").concat(e.name,", "),i.DOM)}},e.prototype._historyHandler=function(e){g("stop")||this._options.logHandler("".concat(e.from," -> ").concat(e.to),i.HISTORY)},e.prototype._consoleHandler=function(e){g("stop")||this._options.logHandler({content:e.args,level:e.level},i.CONSOLE)},e.prototype._nativeapiHandler=function(e){g("stop")||this._options.logHandler(e,i.NATIVEAPI)},e.prototype._unhandledrejectionHandler=function(e){var t=e;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}this._options.errorHandler(t,i.UNHANDLEDREJECTION)},e.prototype._errorHandler=function(e){this._options.errorHandler(JSON.stringify(e),i.ERROR)},e.id="GlobalHandlers",e}(),le=n(1),fe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},pe=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)||he)return[3,5];t=de.shift(),he=!0,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.asyncF()];case 2:return n=o.sent(),t.resolution(n),[3,4];case 3:return r=o.sent(),t.rejection(r),[3,4];case 4:return he=!1,e(),[3,0];case 5:return[2]}}))}))}()}))}var ge,me=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ve=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]30720?[4,g("errorHandler")(new Error(r.EXCEED_SINGLE_LOG_SIZE_LIMIT))]:[3,2];case 1:return S.sent(),[2];case 2:return n=new Date,o=b(n),[4,this.getLogDayInfo(o)];case 3:if((i=S.sent()||((I={}).logDay=o,I.totalSize=0,I.reportPagesInfo={pageSizes:[0],pageIds:[Ne],failTimes:[0]},I)).totalSize+t>7340032)throw new Error(r.EXCEED_LOG_SIZE_LIMIT);return i.reportPagesInfo&&i.reportPagesInfo.pageSizes||(i.reportPagesInfo={pageSizes:[0],pageIds:[Ne],failTimes:[0]}),a=i.reportPagesInfo.pageSizes,s=i.reportPagesInfo.pageIds,u=i.reportPagesInfo.failTimes||[],c=a.length-1,l=s[s.length-1],f=a[c],p=l!==Ne||f>0&&f+t>30720,R=a.slice(),p?R.push(t):R[c]+=t,d=R,h=function(){var e=s.slice();return p&&e.push(Ne),e}(),y=function(){var e=u.slice();return p&&e.push(0),e}(),(T={}).logReportName=this.logReportNameFormatter(o,p?c+1:c),T.logCreateTime=+n,T.logSize=t,T.logString=e,m=T,(N={}).logDay=o,N.totalSize=i.totalSize+t,N.reportPagesInfo={pageSizes:d,pageIds:h,failTimes:y},v=N,w=6048e5-(+new Date-_(new Date)),[4,this.DB.addItems([{tableName:"log_day_table",item:v,itemDuration:w},{tableName:"log_detail_table",item:m,itemDuration:w}])];case 4:return S.sent(),[2]}var R}))}))},e.prototype.incrementalDelete=function(e,t){return Ie(this,void 0,void 0,(function(){var n,r,i,a,s,u,c,l,f,p,d,h,y,g;return Te(this,(function(m){switch(m.label){case 0:return[4,this.getLogDayInfo(e)];case 1:return(n=m.sent())&&n.reportPagesInfo&&n.reportPagesInfo.pageSizes instanceof Array?(r=n.reportPagesInfo.pageIds,i=n.reportPagesInfo.pageSizes,a=n.reportPagesInfo.failTimes||[],s=n.totalSize,u=i.reduce((function(e,n,r){return t.indexOf(r)>=0?e+n:e}),0),c=[],l=[],f=i.reduce((function(e,n,i){return t.indexOf(i)>=0?(l.push(i),e.concat([0])):a[i]>=2?(l.push(i),_e({pid:Ne,logContent:I("[bigo-log]: reported fail, currentpageId: ".concat(r[i],", currentSize: ").concat(n),2),encryptVersion:o.PLAIN}),e.concat([0])):(n>0&&c.push(i),e.concat([n]))}),[]),p={},p=c.length>0?we(we({},n),{reportPagesInfo:{pageSizes:f,pageIds:r,failTimes:f.map((function(e,t){var n=a[t]||0;return c.includes(t)?n+1:n}))},totalSize:Math.max(s-u,0)}):we(we({},n),{reportPagesInfo:{pageSizes:[],pageIds:[],failTimes:[]},totalSize:Math.max(s-u,0)}),d=6048e5-(+new Date-_(new Date))-(_(new Date)-w(e).getTime()),[4,this.DB.addItems([{tableName:"log_day_table",item:p,itemDuration:d}])]):[3,6];case 2:m.sent(),h=0,y=l,m.label=3;case 3:return h-1)return null;var o={},i=n;if(Ue){var a=window.performance.getEntriesByName(r);a.length&&(i=(o=Pe(a[a.length-1])).duration)}return{url:r,success:t,cost_time:i,resource_type:ke(e),page_url:window.location.href,success_performance:De(o||{})}}(e,t,n);if(s){if(s.resource_type===Re&&s.url.includes("data:image/png;base64"))return;if(s.resource_type!==Oe&&Me.includes(s.url))return;Me.push(s.url),s.resource_type===Oe&&(s.error_type=r||0,s.error_msg=o||"",s.status_code=i||"",s=Le(Le({},s),a||{})),Fe.push(s)}}catch(e){console.error(e)}}function Ke(){if(He){var e={attributes:!1,childList:!0,subtree:!1},t=new MutationObserver((function(e){Array.from(e).forEach((function(e){"childList"===e.type&&Array.from(e.addedNodes).forEach((function(e){var t=e.tagName;t&&Ce.includes(t.toLowerCase())&&function(e){e.addEventListener("load",(function(){return Ve(e,Ae)})),e.addEventListener("error",(function(){return Ve(e,Be)}))}(e)}))}))}));t.observe(document.head,e),document.onreadystatechange=function(){"interactive"===document.readyState&&t.observe(document.body,e)}}}function ze(){if(!Ue)return{};var e=Array.from(performance.getEntriesByType("paint")),t=e.length?e:[{},{}],n=t[0],r=t[1],o={FP:n?parseInt(n.duration+n.startTime,10):null,FCP:r?parseInt(r.duration+r.startTime,10):null},i={},a=performance.getEntriesByType("navigation");if(a&&a.length)i=Pe(a[0]);else{var s=window.performance.timing;for(var u in s)i[u]=Math.max(+s[u]-s.navigationStart,0)}var c,l=i.connectEnd-i.domainLookupStart,f=i.responseEnd-i.requestStart,p=i.loadEventEnd||i.loadEventStart||i.domComplete||i.domInteractive;return{dns_cost_time:l,html_cost_time:f,js_cost_time:(c=Fe.map((function(e){return e.resource_type===Ee?e.cost_time:0})),Math.max.apply(Math,Ge(Ge([],c,!1),[0],!1))),load_cost_time:p,paint_time:o,performance:i}}function Je(e){try{Ue&&Ke();var t=function(){setTimeout((function(){(function e(t){var n=1;if(n>=10)return 0;if(t.hasChildNodes())for(var r=t.childNodes,o=0;o=10);o++)1===r.item(o).nodeType&&(n+=e(r.item(o)));return n})(document.body)<10&&Kt({type:2,log_type:i.CRASH})}),3e3);setTimeout((function(){var t={};Ue&&(document.body&&Array.from(document.body.childNodes).forEach((function(e){var t=e.tagName;if(t&&Ce.includes(t.toLowerCase())){var n=je(e);Ue&&Ve(e,!!window.performance.getEntriesByName(n)[0])}})),t=ze()),Kt(Le(Le({},e),{type:2,log_type:i.INIT,extra:{performaceDataObj:De(t)}}))}))};!document.readyState||document.readyState&&"complete"===document.readyState?t():window.addEventListener("load",t),window.addEventListener("beforeunload",Ft)}catch(e){console.error(e)}}var Xe,Ye,Qe,Ze=function(){},We=(Xe=function(e,t){return(Xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Xe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$e=function(e){function t(t){var n=e.call(this,t)||this;return n._bigo_ignore_error=!0,n}return We(t,e),t}(Error),et=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},tt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=200?e.success&&e.success(n.responseText):e.fail&&e.fail("Request failed, status: ".concat(t,", responseText: ").concat(n.responseText))}},"POST"===e.type){if(e.headers&&!t)for(var r in e.headers)n.setRequestHeader(r,e.headers[r]);n.send(e.data)}else n.send()}({url:e,type:r||"GET",data:t,withCredentials:!!n,headers:o,success:function(e){i(e)},fail:function(e){a(new $e(e||"Request failed"))}})}))]}))}))};function rt(e){return"[object Array]"===Object.prototype.toString.call(e)}!function(e){e[e.UINT8=1]="UINT8",e[e.UINT16=2]="UINT16",e[e.UINT32=3]="UINT32",e[e.UINT64=4]="UINT64",e[e.STRING=5]="STRING",e[e.VECTOR_STRING=6]="VECTOR_STRING",e[e.MAP_STRING=7]="MAP_STRING",e[e.VECTOR_STRUCT=8]="VECTOR_STRUCT"}(Qe||(Qe={}));var ot,it=((Ye={})[Qe.UINT8]=0,Ye[Qe.UINT16]=0,Ye[Qe.UINT32]=0,Ye[Qe.UINT64]=0,Ye[Qe.STRING]="",Ye[Qe.VECTOR_STRING]="",Ye[Qe.MAP_STRING]="",Ye[Qe.VECTOR_STRUCT]=[],Ye),at=function(){function e(e,t){var n=e.uri,r=e.aid,o=e.model;this.reportUrl="",this.params={},this.uri=String(n),this.aid=String(r),this.model=o,this.setUrl(t)}return e.prototype.processVal=function(e,t,n){var r=this;switch(t){case Qe.UINT8:case Qe.UINT16:case Qe.UINT32:case Qe.UINT64:e=parseInt(e,10);break;case Qe.STRING:e=""+e;break;case Qe.VECTOR_STRING:var o=[];if(!rt(e))throw new Error("invalid data type of array");for(var i=0,a=e.length;i0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0?(s=wt.logReportNameParser(e).pageIndex,u=i.map((function(e){return e.logString})),c=wt.logReportNameParser(e),l="function"==typeof t.xhrOptsFormatter?t.xhrOptsFormatter(u,c.pageIndex+1,c.logDay):{},f=(null===(n=i[0])||void 0===n?void 0:n.logString)&&JSON.parse(i[0].logString).p,p=function(e){var t=g("app")===a.hello;return e.map((function(e){var n=JSON.parse(e.logString);return{log_type:n.l.t,log_content:n.l.c instanceof Object?JSON.stringify(n.l.c):n.l.c,time:t?Math.floor(n.l.d/1e3):n.l.d,extra:{counter:n.c}}}))}(i),d=_t(),[4,nt(l.reportUrl||g("reportUrl")||d.getUrl(),JSON.stringify(d.format(l.data||Tt(Tt({os:navigator.platform,country_code:navigator.language},t),{events:p,pid:f,url:window.location.href,extra:Tt(Tt({},t.extra),{version:Rt}),time:(new Date).getTime()}))),null!==(o=l.withCredentials)&&void 0!==o&&o,"POST",l.headers||{"Content-Type":"application/json",Accept:"application/json,text/javascript"}).then((function(e){if("function"==typeof l.responseDealer){var t=l.responseDealer(e);if(t.resultMsg===r.REPORT_LOG_SUCC)return s;throw new $e(t.desc)}var n=void 0;try{n=JSON.parse(e)}catch(t){throw new $e("Try to parse response failed, responseText: ".concat(e))}if(console.log("response",n),void 0===(null==n?void 0:n.code)||200===(null==n?void 0:n.code))return s;throw new $e("Server error, code: ".concat(null==n?void 0:n.code))}))]):[3,3];case 2:return[2,h.sent()];case 3:return[2,Promise.resolve(null)]}}))}))}function Ot(e){return Nt(this,void 0,void 0,(function(){var t=this;return St(this,(function(n){switch(n.label){case 0:if(Se.idbIsSupported())return[3,1];throw new Error(r.DB_NOT_SUPPORT);case 1:return wt||(wt=new Se(g("dbName"))),[4,ye((function(){return Nt(t,void 0,void 0,(function(){var t,n,o,i,a,s,u,c,l,f,p,d;return St(this,(function(h){switch(h.label){case 0:return[4,wt.getLogDaysInfo(e.fromDayString,e.toDayString)];case 1:t=h.sent(),n=t.reduce((function(e,t){var n;return Tt(((n={})[t.logDay]=t.reportPagesInfo?t.reportPagesInfo.pageSizes.map((function(e,n){return wt.logReportNameFormatter(t.logDay,n)+"_".concat(t.reportPagesInfo.pageIds[n])})):[],n),e)}),{}),o={},i=w(e.fromDayString),a=w(e.toDayString),s=+i,h.label=2;case 2:if(!(s<=+a))return[3,14];if(u=b(new Date(s)),!(n[u]&&n[u].length>0))return[3,12];h.label=3;case 3:return h.trys.push([3,10,,11]),[4,T(n[u].map((function(t){var n=t.split("_");return xt(wt.logReportNameFormatter(n[0],+n[1]),e)})))];case 4:c=h.sent(),(l=c.filter((function(e){return"rejected"===e.status}))).length>0?o[u]={msg:r.REPORT_LOG_FAIL,desc:S(l[0].reason)}:o[u]={msg:r.REPORT_LOG_SUCC},h.label=5;case 5:return h.trys.push([5,8,,9]),(f=c.filter((function(e){return null!==e.value})).map((function(e){return e.value}))).length>0&&g("incrementalReport")?[4,wt.incrementalDelete(u,f)]:[3,7];case 6:h.sent(),h.label=7;case 7:return[3,9];case 8:return p=h.sent(),o[u]={msg:r.DELETE_LOG_FAIL,desc:p.message||p.stack||JSON.stringify(p)},[3,9];case 9:return[3,11];case 10:return d=h.sent(),o[u]={msg:r.REPORT_LOG_FAIL,desc:d.message||d.stack||JSON.stringify(d)},[3,11];case 11:return[3,13];case 12:o[u]={msg:r.NO_LOG},h.label=13;case 13:return s+=864e5,[3,2];case 14:return[2,o]}}))}))}))];case 2:return[2,n.sent()]}}))}))}n.d(t,"pid",(function(){return Gt})),n.d(t,"initConfig",(function(){return At})),n.d(t,"setConfig",(function(){return Bt})),n.d(t,"setConfigByKey",(function(){return Ut})),n.d(t,"log",(function(){return Ht})),n.d(t,"track",(function(){return Mt})),n.d(t,"reportAll",(function(){return Ft})),n.d(t,"report",(function(){return Vt})),n.d(t,"immediateSend",(function(){return Kt})),n.d(t,"stop",(function(){return zt})),n.d(t,"resume",(function(){return Jt})),n.d(t,"destroy",(function(){return Xt})),n.d(t,"ResultMsg",(function(){return r})),n.d(t,"LogEncryptMode",(function(){return o})),n.d(t,"LogType",(function(){return i})),n.d(t,"APP_KEY",(function(){return a})),n.d(t,"SOURCE_TO_APP_KEY",(function(){return s})),n.d(t,"BAINA_API",(function(){return u}));var Ct=function(){return(Ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=g("autoReportCount")?[4,Ft()]:[3,5];case 4:n.sent(),n.label=5;case 5:return[3,8];case 6:return t=n.sent(),x.errorTrigger(),[4,g("errorHandler")(t)];case 7:return n.sent(),[3,8];case 8:return[3,11];case 9:return[4,g("errorHandler")(new Error(r.EXCEED_TRY_TIMES))];case 10:n.sent(),n.label=11;case 11:return[2]}}))}))}function Lt(e,t,n){if(!g("stop")){var r;g("_devSend");0,r={logContent:I(e,t),pid:Se.pageId,encryptVersion:n},(!document.readyState||document.readyState&&"complete"===document.readyState)&&Pt?qt(r):jt.push(r)}}R.initCounter(),window.addEventListener("load",(function e(){jt.forEach((function(e){qt(e)})),jt=[],window.removeEventListener("load",e)}));var Gt=Se.pageId;function At(e){e.globalReportConfig&&(e.globalReportConfig=Object.assign({langCode:navigator.language,environment:navigator&&navigator.userAgent},e.globalReportConfig),e.globalReportConfig.userId||("string"==typeof e.globalReportConfig.uid?(e.globalReportConfig.userId=e.globalReportConfig.uid,e.globalReportConfig.uid=0):e.globalReportConfig.userId=String(e.globalReportConfig.uid))),h(e);var t=g("hooks");new ce({onxhr:t.xhr,onfetch:t.fetch,ondom:t.dom,onconsole:t.console,onhistory:t.history,onnativeapi:t.nativeapi,onerror:t.error,onunhandledrejection:t.unhandledrejection,logHandler:Ht,errorHandler:function(e,t){g("_devSend");Kt({log_type:t,log_content:S(e),type:2}),Ft()}}).setupOnce(),Ft();var n=g("globalReportConfig");if((null==n?void 0:n.device_id)||(null==n?void 0:n.userId)){g("_devSend");0,Je(n)}Pt=!0}function Bt(e){h(e)}function Ut(e,t,n){y(e,t,n)}function Ht(e,t){void 0===t&&(t=1),g("stop")||Lt(e,t,o.PLAIN)}function Mt(e){return Dt(this,void 0,void 0,(function(){return kt(this,(function(t){switch(t.label){case 0:return g("stop")?[2]:g("globalReportConfig").act_id||e.act_id?(e.isCN&&y("isCN",e.isCN),"number"==typeof e.log_action&&(e.log_action=String(e.log_action)),g("_devSend"),[4,Kt(Ct({log_type:i.TRACK,type:2},e))]):(console.error("%cbigo-log","border:1px solid #aaa;padding: 10px 5px;color: #f99418;font-weight: 500;","请在initConfig的globalReportConfig中传入act_id 或 track中传入act_id"),[2]);case 1:return[2,t.sent()]}}))}))}function Ft(){return Dt(this,void 0,void 0,(function(){var e;return kt(this,(function(t){switch(t.label){case 0:return e=new Date,[4,Vt({fromDayString:b(new Date(+e-5184e5)),toDayString:b(e)})];case 1:return[2,t.sent()]}}))}))}function Vt(e){return Dt(this,void 0,void 0,(function(){var t;return kt(this,(function(n){switch(n.label){case 0:if(g("stop"))return[2];!function(e){if(!e)throw new Error("reportConfig needs to be an object");var t="is not valid, needs to be YYYY-MM-DD format";if(!v(e.fromDayString))throw new Error("fromDayString ".concat(t));if(!v(e.toDayString))throw new Error("toDayString ".concat(t));if(e.fromDayString>e.toDayString)throw new Error("fromDayString needs to be no bigger than toDayString")}(e),n.label=1;case 1:return n.trys.push([1,3,,5]),[4,Ot(Ct(Ct({},g("globalReportConfig")),e))];case 2:return[2,n.sent()];case 3:return t=n.sent(),[4,g("errorHandler")(t)];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))}function Kt(e){return Dt(this,void 0,void 0,(function(){var t;return kt(this,(function(n){switch(n.label){case 0:return t=g("globalReportConfig"),[4,Et(Ct(Ct({},t),e))];case 1:return[2,n.sent()]}}))}))}function zt(){Ut("stop",!0)}function Jt(){Ut("stop",!1)}function Xt(){return Dt(this,void 0,void 0,(function(){return kt(this,(function(e){switch(e.label){case 0:return zt(),[4,Se.deleteAll()];case 1:return e.sent(),[2]}}))}))}}])}));