/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/log-jzx@1.0.0/build/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},__assign.apply(this,arguments)};import LogRegister from"./log_register";import{Method,RET}from"./interface";import{timestampToDateTime}from"./lib/utils";var url="http://47.101.37.38:38080/app/mock/22/kxd/hera/user/add",wrongUrl="http://47.101.37.38:38080/app/mock/22",metaData={userId:"",token:"",clientTime:"",networkStatus:"",appSessionId:"",pageSessionId:"",pageId:"",pageTitle:""},useWorker=!1,logBatchNum=100;function testBatchLogOprate(){var e=document.createElement("button");e.innerText="测试batch处理log存储",e.addEventListener("click",(function(){logRegist({type:"NO.__",content:"NO.__"+timestampToDateTime()},useWorker)})),document.body.append(e)}function testStoreLog(e){var t=document.createElement("button");t.innerText="批量发送log",t.addEventListener("click",(function(){startLog(e)})),document.body.append(t)}function startLog(e){void 0===e&&(e=!1),console.info("开始计时：",Date.now());var t=1,n=setInterval((function(){t<=logBatchNum?(console.log("send No."+t+" LOG"),logRegist({type:"NO."+t+"__",content:"NO."+t+"__"+timestampToDateTime(),isImmediate:Math.ceil(10*Math.random())%2==1},e),t++):clearInterval(n)}))}function addImediateLog(){var e=document.createElement("input");e.style.width="300px",e.style.height="60px",e.placeholder="请输入立即待上报的日志内容";var t=document.createElement("div");t.innerText="\n",document.body.append(t),e.onkeypress=function(t){13===t.keyCode&&logRegist({type:"test_immediate_table",content:e.value,isImmediate:!0})},document.body.append(e)}testBatchLogOprate(),testStoreLog(useWorker),addImediateLog();export function logRegist(e,t){void 0===t&&(t=!1);var n={userId:"userId",token:"",networkStatus:"",appSessionId:"",pageSessionId:"",pageId:"",pageTitle:""},o=LogRegister.getInstance({useWorker:t,url:url,method:Method.POST,headers:{"jzx-appid":"",ACCESS_TOKEN:""},repeat:0,duration:1e3,handleResponse:function(e){var t=JSON.parse(e);return{ret:t.isOk?RET.SUCCESS:RET.FAILED,error:t.errMsg}},handleRequest:function(e){return{data:e.reduce((function(e,t){return e.push(__assign(__assign({},t),n)),e}),[])}}});o.report(e)}
//# sourceMappingURL=/sm/9ab48865664cd6b0476af1baa5fd487e950b7fb140313e459b51908ba11840c5.map