@smart100/spu-web-plugin 0.0.34 → 0.0.36
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/README.md +0 -11
- package/dist/index.d.ts +2 -2
- package/dist/spu-web-plugin.mjs +3818 -3382
- package/package.json +1 -1
- package/src/apaasSpuTrack.ts +17 -21
- package/src/axios.ts +49 -17
- package/src/core.js +158 -4
- package/src/index.ts +16 -10
- package/src/login.ts +83 -22
- package/src/nativeApi.ts +60 -0
- package/src/package/ali-oss/aliyun-oss-sdk.js +25121 -25121
- package/src/package/ali-oss/aliyun-oss-sdk.min.js +14 -14
- package/src/package/ali-oss/package.json +162 -162
- package/src/package/apaas-track/apaas-spu/index.js +6 -6
- package/src/package/apaas-track/apaas-spu/index.mjs +1586 -1564
- package/src/package/apaas-track/apaas-spu/index.umd.js +6 -6
- package/src/types/index.d.ts +2 -2
- package/src/urlquery.ts +4 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(X,mt){typeof exports=="object"&&typeof module<"u"?mt(exports):typeof define=="function"&&define.amd?define(["exports"],mt):(X=typeof globalThis<"u"?globalThis:X||self,mt(X.ApaasSpuTrack={}))})(this,function(X){"use strict";function mt(){return((1+Math.random())*65536|0).toString(16).substring(1)}function ae(){return mt()+mt()+"-"+mt()+"-"+mt()+"-"+mt()+"-"+mt()+mt()+mt()}function
|
|
2
|
-
`}let l="{",w="}";Pt(n)&&(l="[",w="]"),e.ret+=l+u;const p=Wr(n);for(let f=0;f<p.length;f++){const v=p[f];e.ret+=a;try{Pt(n)||(Gt(v)||Pt(v)||yn(v)?e.ret+=Object.prototype.toString.call(v):Pe(v)&&e.standardJSON?e.ret+='"'+v+'"':e.ret+=v,e.ret+=": ")}catch{continue}try{const h=n[v];Pt(h)?e.maxDepth>-1&&s>=e.maxDepth?e.ret+="Array("+h.length+")":kn(h,e,s+1):Gt(h)?e.maxDepth>-1&&s>=e.maxDepth?e.ret+=(((i=h.constructor)==null?void 0:i.name)||"Object")+" {}":kn(h,e,s+1):e.ret+=us(h,e.keyMaxLen)}catch{e.ret+=e.standardJSON?'"(PARSE_ERROR)"':"(PARSE_ERROR)"}if(e.keyMaxLen>0&&e.ret.length>=e.keyMaxLen*10){e.ret+=", (...)";break}f<p.length-1&&(e.ret+=", "),e.ret+=u}e.ret+=a.substring(0,a.length-2)+w};function hs(n,e={maxDepth:-1,keyMaxLen:-1,pretty:!1,standardJSON:!1}){const s=Object.assign({ret:"",maxDepth:-1,keyMaxLen:-1,pretty:!1,standardJSON:!1,circularFinder:Gr()},e);return kn(n,s),s.ret}function Xr(n){try{return self.Blob?new self.Blob([n],{type:"text/plain"}).size:encodeURI(n).split(/%(?:u[0-9A-F]{2})?[0-9A-F]{2}|./).length-1}catch{return 0}}function Le(n){return n<=0?"":n>=1e3*1e3?(n/1e3/1e3).toFixed(1)+" MB":n>=1e3*1?(n/1e3).toFixed(1)+" KB":n+" B"}function ls(n,e){return n.length>e&&(n=n.substring(0,e)+`...(${Le(Xr(n))})`),n}function Wr(n){return!Gt(n)&&!Pt(n)?[]:Object.keys(n)}function Qr(n=[],e=1024*1024){if(!n.length)return[];if(JSON.stringify(n).length<=e)return[n];let s=[],r=[],i=0;for(let a=0;a<n.length;a++){const u=n[a],l=JSON.stringify(u).length;i+l<e?(r.push(u),i+=l):r.length?(s.push(r),r=[u],i=l):(s.push([u]),i=0)}return s}const Vr=n=>typeof n=="object"?(n.config&&n.request&&(n.config=void 0,n.request=void 0),n.status!==void 0?n.data?(n.detail=typeof n.data=="object"?JSON.stringify(n.data):n.data,n=new Error(n.detail)):n.body?(n.detail=typeof n.body=="object"?JSON.stringify(n.body):n.body,n=new Error(n.detail)):(n.message=`${n.statusText||n.bodyText||""}`,n=new Error(n.message)):n=new Error(JSON.stringify(n)),n):new Error(n),Tn=n=>{var e;let s=null;n?n&&n instanceof Error?s=n:s=Vr(n):(n=new Error("error"),s=n);const r={message:"",detail:"",name:"",stack:[]};if(r.message=s.message,r.name=s.name,r.detail=((e=s.stack)==null?void 0:e.toString())||s.message,s.stack){let i=s.stack.split(/\n\s+at/);i.length&&(i=i.slice(1)),r.stack=i}return r},Sn=n=>new Promise(e=>{setTimeout(()=>{e(void 0),n&&n()},0)}),oe=()=>{if(typeof wx<"u"&&!window){const n=getCurrentPages();return n.length?n[n.length-1].route:"applaunch"}else return window.location.href};var Kr=Object.defineProperty,Zr=(n,e,s)=>e in n?Kr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,I=(n,e,s)=>(Zr(n,typeof e!="symbol"?e+"":e,s),s);class ps{constructor(e){I(this,"limit"),I(this,"runningSize"),I(this,"taskList"),this.limit=e,this.taskList=[],this.runningSize=0}addTask(e){this.taskList.push(e),this.run()}async run(){for(;this.taskList.length&&this.runningSize<this.limit;){const e=this.taskList.shift();e&&(this.runningSize++,await e(),this.runningSize--,this.run())}}}var Pn=(n=>(n[n.NORMAL=0]="NORMAL",n[n.HIGH=1]="HIGH",n[n.EMERGEN=2]="EMERGEN",n))(Pn||{});class rt{constructor(e,s,r){I(this,"_level",0),this.apaasTrack=e,this.type=s,r&&(this._level=r)}getProperties(){return{}}setProperties(e){}getEventLog(e){const s=e||Date.now();return{...this.apaasTrack.baseLog,types:this.type,logtime:String(s),epochnanos:String(s)+"000000",event:this.type,properties:this.getProperties(),url:oe()}}}I(rt,"eventOptions"),I(rt,"initApaasTrackHook"),I(rt,"startApaasTrackHook"),I(rt,"destroyApaasTrackHook");class ds extends rt{constructor(e){super(e,"init")}getProperties(){const e=this.apaasTrack.baseLog;return{system:e.system||"",systemver:e.systemver||"",manufacturer:e.manufacturer||"",browser:e.browser||"",browserver:e.browserver||"",terminalid:e.terminalid||"",client:e.client||"",clientver:e.clientver||""}}}class ms extends rt{constructor(e){super(e,"custom"),I(this,"info",{})}setCustomType(e){this.type=e}getProperties(){return{...this.info}}setProperties(e){this.info=e}}const Xt={init:ds,custom:ms},Lt=(n,e)=>{const s=Xt[e];return new s(n)},fs=(n,e,s)=>{const r=s||Date.now(),i=Lt(n,e);return{...n.baseLog,types:e,logtime:String(r),epochnanos:String(r)+"000000",event:e,properties:i.getProperties(),url:oe()}},Ln=(n,e,s)=>{const r=s||Date.now();return{...n.baseLog,types:e.type,logtime:String(r),epochnanos:String(r)+"000000",event:e.type,properties:e.getProperties(),url:oe()}},En=(n,e)=>{if(Xt[n])throw Error(`\u8BE5\u4E8B\u4EF6${n} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);Xt[n]=e};class gs{constructor(e,s){I(this,"name",""),I(this,"time",0),I(this,"info",{}),e&&(this.name=e),s&&(this.info=s),this.time=Date.now()}get epochnanos(){return this.time*1e6}get attributes(){return this.getAttributes()}getAttributes(){return{}}getJson(){return{name:this.name,epochnanos:this.time*1e6,attributes:this.getAttributes(),...this.info}}setInfo(e){this.info=e||{}}}class _s extends gs{constructor(){super(...arguments),I(this,"name","exception"),I(this,"exceptionType",""),I(this,"exceptionMessage",""),I(this,"exceptionStackTrace","")}getAttributes(){return{"exception.type":this.exceptionType,"exception.message":this.exceptionMessage,"exception.stacktrace":this.exceptionStackTrace}}setInfo(e){this.exceptionMessage=e.exceptionMessage,this.exceptionType=e.exceptionType,this.exceptionStackTrace=e.exceptionStackTrace}}class We extends rt{constructor(e,s,r){super(e,"span"),I(this,"spanid",""),I(this,"traceid",""),I(this,"parentspanid",""),I(this,"name",""),I(this,"attributes",{}),I(this,"events",[]),I(this,"statuscode","OK"),I(this,"statusmessage",""),I(this,"startTime",0),I(this,"endTime",0),this.name=s,this.traceid=ae(),this.spanid=rs(),this.parentspanid=r||"",this.start()}trackLog(){this.apaasTrack.addLogByEvent(this)}createSpanEvent(e,s){return new We(this.apaasTrack,e,s)}setAttribute(e){const s=e.getAttributes();this.attributes=s}addEvent(e){this.events.push(e)}exception(e){const s=new _s;let r="",i="",a="";if(e instanceof Error){const u=Tn(e);r=u.detail,i=u.name,a=u.stack.join(",")}else r=e.exceptionMessage,i=e.exceptionType,a=e.exceptionStackTrace;s.setInfo({exceptionMessage:r,exceptionType:i,exceptionStackTrace:a}),this.events.push(s)}start(){this.startTime=Date.now()}end(e,s){e&&(this.statusmessage=e),s&&(this.statuscode=s),this.endTime=Date.now()}getProperties(){return{traceid:this.traceid,spanid:this.spanid,parentspanid:this.parentspanid,name:this.name,attributes:this.attributes,events:this.events.map(e=>e.getJson()),statuscode:this.statuscode,statusmessage:this.statusmessage,startepochnanos:this.startTime*1e6,endepochnanos:this.endTime*1e6,duration:(this.endTime-this.startTime)*1e6}}}const Bn="1.0.17";class Ee{constructor(e){I(this,"_version",Bn),I(this,"commonLog",null),I(this,"browserLog",null),I(this,"options"),this.options=e,typeof window<"u"&&(window.__apaasTrackVersion__=Bn),typeof wx<"u"&&!window&&(wx.__apaasTrackVersion__=Bn),e.commonLog&&this.initCommonLog(e.commonLog),this.runEventInitHooks()}registerEvent(e,s){En(e,s),s.initApaasTrackHook&&s.initApaasTrackHook(this),s.startApaasTrackHook&&s.startApaasTrackHook(this)}get groupid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}runEventInitHooks(){Object.values(Xt).forEach(e=>{e.initApaasTrackHook&&e.initApaasTrackHook(this)})}runEventStartHooks(){Object.values(Xt).forEach(e=>{e.startApaasTrackHook&&e.startApaasTrackHook(this)})}runEventDestroyHooks(){Object.values(Xt).forEach(e=>{e.destroyApaasTrackHook&&e.destroyApaasTrackHook(this)})}get anonymousid(){var e;return(e=this.browserLog)==null?void 0:e.anonymousid}get distinctid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}get baseLog(){return{...this.browserLog,...this.commonLog}}initCommonLog(e){this.commonLog=e}createEventLog(e,s){return fs(this,e,s)}addLogByType(e,s){const r=this.createEventLog(e,s);this.addLogToQueue(r)}addLogByEvent(e,s){const r=Ln(this,e,s);this.addLogToQueue(r)}createCustomEvent(e){const s=Lt(this,"custom");return s.setCustomType(e),s}createSpanEvent(e,s){return new We(this,e,s)}addLogByCustomEvent(e,s={},r){const i=this.createCustomEvent(e);i.setProperties(s);const a=Ln(this,i,r);this.addLogToQueue(a)}executeInitEvent(){const e=Lt(this,"init");e.setProperties({groupid:this.groupid}),this.addLogByEvent(e)}updateCommonLog(e){this.commonLog={...this.commonLog,...e}}trackEvent(e,s={},r){const i=Lt(this,e);i.setProperties(s),this.addLogByEvent(i,r)}start(...e){this.executeInitEvent(),this.runEventStartHooks()}destroy(){this.runEventDestroyHooks()}transformLog(e){return e}async addLogToQueue(e,s=!1,r=!0){r&&(e=this.transformLog(e)),await this.sendLog(e,s)}}I(Ee,"registerEvent",En);class Yr{constructor(e){I(this,"name",""),I(this,"groupid",""),this.name=e.name,this.groupid=e.groupid}getJson(){return{name:this.name,attributes:this.getAttributes()}}}var ti=Object.defineProperty,ei=(n,e,s)=>e in n?ti(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,b=(n,e,s)=>(ei(n,typeof e!="symbol"?e+"":e,s),s),ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xn={exports:{}};(function(n,e){(function(s,r){var i="1.0.32",a="",u="?",l="function",w="undefined",p="object",f="string",v="major",h="model",_="name",y="type",k="vendor",T="version",R="architecture",et="console",M="mobile",C="tablet",K="smarttv",J="wearable",lt="embedded",bt=350,Nt="Amazon",ge="Apple",ze="ASUS",pn="BlackBerry",jt="Browser",Zt="Chrome",Kn="Edge",_e="Firefox",Yt="Google",dn="Huawei",tt="LG",xt="Microsoft",Ut="Motorola",ve="Opera",Fe="Samsung",He="Sharp",te="Sony",qt="Xiaomi",Ie="Zebra",mn="Facebook",Zn=function(z,q){var A={};for(var Q in z)q[Q]&&q[Q].length%2===0?A[Q]=q[Q].concat(z[Q]):A[Q]=z[Q];return A},At=function(z){for(var q={},A=0;A<z.length;A++)q[z[A].toUpperCase()]=z[A];return q},Ne=function(z,q){return typeof z===f?ee(q).indexOf(ee(z))!==-1:!1},ee=function(z){return z.toLowerCase()},Yn=function(z){return typeof z===f?z.replace(/[^\d\.]/g,a).split(".")[0]:r},ne=function(z,q){if(typeof z===f)return z=z.replace(/^\s\s*/,a).replace(/\s\s*$/,a),typeof q===w?z:z.substring(0,bt)},pt=function(z,q){for(var A=0,Q,O,we,G,_t,wt;A<q.length&&!_t;){var _n=q[A],Ue=q[A+1];for(Q=O=0;Q<_n.length&&!_t;)if(_t=_n[Q++].exec(z),_t)for(we=0;we<Ue.length;we++)wt=_t[++O],G=Ue[we],typeof G===p&&G.length>0?G.length===2?typeof G[1]==l?this[G[0]]=G[1].call(this,wt):this[G[0]]=G[1]:G.length===3?typeof G[1]===l&&!(G[1].exec&&G[1].test)?this[G[0]]=wt?G[1].call(this,wt,G[2]):r:this[G[0]]=wt?wt.replace(G[1],G[2]):r:G.length===4&&(this[G[0]]=wt?G[3].call(this,wt.replace(G[1],G[2])):r):this[G]=wt||r;A+=2}},je=function(z,q){for(var A in q)if(typeof q[A]===p&&q[A].length>0){for(var Q=0;Q<q[A].length;Q++)if(Ne(q[A][Q],z))return A===u?r:A}else if(Ne(q[A],z))return A===u?r:A;return z},fn={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},gn={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"},Ot={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[T,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,T],[/opios[\/ ]+([\w\.]+)/i],[T,[_,ve+" Mini"]],[/\bopr\/([\w\.]+)/i],[T,[_,ve]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[_,T],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[_,"UC"+jt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[T,[_,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[T,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[_,"IE"]],[/yabrowser\/([\w\.]+)/i],[T,[_,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+jt],T],[/\bfocus\/([\w\.]+)/i],[T,[_,_e+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[_,ve+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[_,ve+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[_,"MIUI "+jt]],[/fxios\/([-\w\.]+)/i],[T,[_,_e]],[/\bqihu|(qi?ho?o?|360)browser/i],[[_,"360 "+jt]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1 "+jt],T],[/(comodo_dragon)\/([\w\.]+)/i],[[_,/_/g," "],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[_,T],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,mn],T],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[_,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[_,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[_,Zt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,Zt+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[_,"Android "+jt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[T,je,fn]],[/(webkit|khtml)\/([\w\.]+)/i],[_,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[_,_e+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[_,T]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[R,"amd64"]],[/(ia32(?=;))/i],[[R,ee]],[/((?:i[346]|x)86)[;\)]/i],[[R,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[R,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[R,"armhf"]],[/windows (ce|mobile); ppc;/i],[[R,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[R,/ower/,a,ee]],[/(sun4\w)[;\)]/i],[[R,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[R,ee]]],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],[h,[k,Fe],[y,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[h,[k,Fe],[y,M]],[/\((ip(?:hone|od)[\w ]*);/i],[h,[k,ge],[y,M]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[k,ge],[y,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[h,[k,dn],[y,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[k,dn],[y,M]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[h,/_/g," "],[k,qt],[y,M]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[h,/_/g," "],[k,qt],[y,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[k,"OPPO"],[y,M]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[k,"Vivo"],[y,M]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[h,[k,"Realme"],[y,M]],[/\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],[h,[k,Ut],[y,M]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[k,Ut],[y,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[k,tt],[y,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[k,tt],[y,M]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[h,[k,"Lenovo"],[y,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[h,/_/g," "],[k,"Nokia"],[y,M]],[/(pixel c)\b/i],[h,[k,Yt],[y,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[k,Yt],[y,M]],[/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],[h,[k,te],[y,M]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[k,te],[y,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[k,"OnePlus"],[y,M]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[k,Nt],[y,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[k,Nt],[y,M]],[/(playbook);[-\w\),; ]+(rim)/i],[h,k,[y,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[k,pn],[y,M]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[k,ze],[y,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[k,ze],[y,M]],[/(nexus 9)/i],[h,[k,"HTC"],[y,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[k,[h,/_/g," "],[y,M]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[k,"Acer"],[y,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[k,"Meizu"],[y,M]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[k,He],[y,M]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[k,h,[y,M]],[/(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],[k,h,[y,C]],[/(surface duo)/i],[h,[k,xt],[y,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[k,"Fairphone"],[y,M]],[/(u304aa)/i],[h,[k,"AT&T"],[y,M]],[/\bsie-(\w*)/i],[h,[k,"Siemens"],[y,M]],[/\b(rct\w+) b/i],[h,[k,"RCA"],[y,C]],[/\b(venue[\d ]{2,7}) b/i],[h,[k,"Dell"],[y,C]],[/\b(q(?:mv|ta)\w+) b/i],[h,[k,"Verizon"],[y,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[k,"Barnes & Noble"],[y,C]],[/\b(tm\d{3}\w+) b/i],[h,[k,"NuVision"],[y,C]],[/\b(k88) b/i],[h,[k,"ZTE"],[y,C]],[/\b(nx\d{3}j) b/i],[h,[k,"ZTE"],[y,M]],[/\b(gen\d{3}) b.+49h/i],[h,[k,"Swiss"],[y,M]],[/\b(zur\d{3}) b/i],[h,[k,"Swiss"],[y,C]],[/\b((zeki)?tb.*\b) b/i],[h,[k,"Zeki"],[y,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[k,"Dragon Touch"],h,[y,C]],[/\b(ns-?\w{0,9}) b/i],[h,[k,"Insignia"],[y,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[k,"NextBook"],[y,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[k,"Voice"],h,[y,M]],[/\b(lvtel\-)?(v1[12]) b/i],[[k,"LvTel"],h,[y,M]],[/\b(ph-1) /i],[h,[k,"Essential"],[y,M]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[k,"Envizen"],[y,C]],[/\b(trio[-\w\. ]+) b/i],[h,[k,"MachSpeed"],[y,C]],[/\btu_(1491) b/i],[h,[k,"Rotor"],[y,C]],[/(shield[\w ]+) b/i],[h,[k,"Nvidia"],[y,C]],[/(sprint) (\w+)/i],[k,h,[y,M]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[k,xt],[y,M]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[k,Ie],[y,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[k,Ie],[y,M]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[k,h,[y,et]],[/droid.+; (shield) bui/i],[h,[k,"Nvidia"],[y,et]],[/(playstation [345portablevi]+)/i],[h,[k,te],[y,et]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[k,xt],[y,et]],[/smart-tv.+(samsung)/i],[k,[y,K]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[k,Fe],[y,K]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[k,tt],[y,K]],[/(apple) ?tv/i],[k,[h,ge+" TV"],[y,K]],[/crkey/i],[[h,Zt+"cast"],[k,Yt],[y,K]],[/droid.+aft(\w)( bui|\))/i],[h,[k,Nt],[y,K]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[k,He],[y,K]],[/(bravia[\w ]+)( bui|\))/i],[h,[k,te],[y,K]],[/(mitv-\w{5}) bui/i],[h,[k,qt],[y,K]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[k,ne],[h,ne],[y,K]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[y,K]],[/((pebble))app/i],[k,h,[y,J]],[/droid.+; (glass) \d/i],[h,[k,Yt],[y,J]],[/droid.+; (wt63?0{2,3})\)/i],[h,[k,Ie],[y,J]],[/(quest( 2)?)/i],[h,[k,mn],[y,J]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[k,[y,lt]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[h,[y,M]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[y,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[y,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[y,M]],[/(android[-\w\. ]{0,9});.+buil/i],[h,[k,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[_,Kn+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[_,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,T],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[_,[T,je,gn]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[_,"Windows"],[T,je,gn]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,"Mac OS"],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,T],[/\(bb(10);/i],[T,[_,pn]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[_,_e+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[_,"webOS"]],[/crkey\/([\d\.]+)/i],[T,[_,Zt+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[_,"Chromium OS"],T],[/(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],[_,T],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[_,T]]},ct=function(z,q){if(typeof z===p&&(q=z,z=r),!(this instanceof ct))return new ct(z,q).getResult();var A=z||(typeof s!==w&&s.navigator&&s.navigator.userAgent?s.navigator.userAgent:a),Q=q?Zn(Ot,q):Ot;return this.getBrowser=function(){var O={};return O[_]=r,O[T]=r,pt.call(O,A,Q.browser),O.major=Yn(O.version),O},this.getCPU=function(){var O={};return O[R]=r,pt.call(O,A,Q.cpu),O},this.getDevice=function(){var O={};return O[k]=r,O[h]=r,O[y]=r,pt.call(O,A,Q.device),O},this.getEngine=function(){var O={};return O[_]=r,O[T]=r,pt.call(O,A,Q.engine),O},this.getOS=function(){var O={};return O[_]=r,O[T]=r,pt.call(O,A,Q.os),O},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 A},this.setUA=function(O){return A=typeof O===f&&O.length>bt?ne(O,bt):O,this},this.setUA(A),this};ct.VERSION=i,ct.BROWSER=At([_,T,v]),ct.CPU=At([R]),ct.DEVICE=At([h,k,y,et,M,K,C,J,lt]),ct.ENGINE=ct.OS=At([_,T]),n.exports&&(e=n.exports=ct),e.UAParser=ct;var $t=typeof s!==w&&(s.jQuery||s.Zepto);if($t&&!$t.ua){var be=new ct;$t.ua=be.getResult(),$t.ua.get=function(){return be.getUA()},$t.ua.set=function(z){be.setUA(z);var q=be.getResult();for(var A in q)$t.ua[A]=q[A]}}})(typeof window=="object"?window:ni)})(xn,xn.exports);var vs={exports:{}},bs={exports:{}};(function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(s,r){return s<<r|s>>>32-r},rotr:function(s,r){return s<<32-r|s>>>r},endian:function(s){if(s.constructor==Number)return e.rotl(s,8)&16711935|e.rotl(s,24)&4278255360;for(var r=0;r<s.length;r++)s[r]=e.endian(s[r]);return s},randomBytes:function(s){for(var r=[];s>0;s--)r.push(Math.floor(Math.random()*256));return r},bytesToWords:function(s){for(var r=[],i=0,a=0;i<s.length;i++,a+=8)r[a>>>5]|=s[i]<<24-a%32;return r},wordsToBytes:function(s){for(var r=[],i=0;i<s.length*32;i+=8)r.push(s[i>>>5]>>>24-i%32&255);return r},bytesToHex:function(s){for(var r=[],i=0;i<s.length;i++)r.push((s[i]>>>4).toString(16)),r.push((s[i]&15).toString(16));return r.join("")},hexToBytes:function(s){for(var r=[],i=0;i<s.length;i+=2)r.push(parseInt(s.substr(i,2),16));return r},bytesToBase64:function(s){for(var r=[],i=0;i<s.length;i+=3)for(var a=s[i]<<16|s[i+1]<<8|s[i+2],u=0;u<4;u++)i*8+u*6<=s.length*8?r.push(n.charAt(a>>>6*(3-u)&63)):r.push("=");return r.join("")},base64ToBytes:function(s){s=s.replace(/[^A-Z0-9+\/]/ig,"");for(var r=[],i=0,a=0;i<s.length;a=++i%4)a!=0&&r.push((n.indexOf(s.charAt(i-1))&Math.pow(2,-2*a+8)-1)<<a*2|n.indexOf(s.charAt(i))>>>6-a*2);return r}};bs.exports=e})();var Cn={utf8:{stringToBytes:function(n){return Cn.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(Cn.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var e=[],s=0;s<n.length;s++)e.push(n.charCodeAt(s)&255);return e},bytesToString:function(n){for(var e=[],s=0;s<n.length;s++)e.push(String.fromCharCode(n[s]));return e.join("")}}},ws=Cn;/*!
|
|
1
|
+
(function(X,mt){typeof exports=="object"&&typeof module<"u"?mt(exports):typeof define=="function"&&define.amd?define(["exports"],mt):(X=typeof globalThis<"u"?globalThis:X||self,mt(X.ApaasSpuTrack={}))})(this,function(X){"use strict";function mt(){return((1+Math.random())*65536|0).toString(16).substring(1)}function ae(){return mt()+mt()+"-"+mt()+"-"+mt()+"-"+mt()+"-"+mt()+mt()+mt()}function nn(){return ae().replace(/-/g,"").slice(0,16)}function sn(r){let e=r>0?new Date(r):new Date,n=e.getDate()<10?"0"+e.getDate():e.getDate(),s=e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1,i=e.getFullYear(),a=e.getHours()<10?"0"+e.getHours():e.getHours(),u=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),h=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds(),_=e.getMilliseconds()<10?"0"+e.getMilliseconds():e.getMilliseconds();return _<100&&(_="0"+_),{time:+e,year:i,month:s,day:n,hour:a,minute:u,second:h,millisecond:_}}function an(r){return Object.prototype.toString.call(r)==="[object Number]"}function on(r){return typeof r=="bigint"}function Pe(r){return typeof r=="string"}function Pt(r){return Object.prototype.toString.call(r)==="[object Array]"}function zs(r){return typeof r=="boolean"}function Fs(r){return r===void 0}function Hs(r){return r===null}function yr(r){return typeof r=="symbol"}function Gt(r){return Object.prototype.toString.call(r)==="[object Object]"||!an(r)&&!on(r)&&!Pe(r)&&!zs(r)&&!Pt(r)&&!Hs(r)&&!cn(r)&&!Fs(r)&&!yr(r)}function cn(r){return typeof r=="function"}function Is(r){const e=Object.prototype.toString.call(r);return e==="[object Window]"||e==="[object DOMWindow]"||e==="[object global]"}function Ns(r){return r==null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||typeof r=="function"||typeof r=="symbol"||typeof r=="bigint"?!1:typeof Symbol<"u"&&typeof r[Symbol.iterator]=="function"}function js(r){return Object.prototype.toString.call(r).replace(/\[object (.*)\]/,"$1")}function Us(r){let e=Object.prototype.hasOwnProperty;if(!r||typeof r!="object"||r.nodeType||Is(r))return!1;try{if(r.constructor&&!e.call(r,"constructor")&&!e.call(r.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}let n;for(n in r);return n===void 0||e.call(r,n)}const qs=/[\n\t]/g,$s=r=>({"\n":"\\n"," ":"\\t"})[r];function Js(r){return typeof r!="string"?r:String(r).replace(qs,$s)}const Gs=()=>{const r=new WeakSet;return e=>{if(typeof e=="object"&&e!==null){if(r.has(e))return!0;r.add(e)}return!1}},un=(r,e=0)=>{let n="";return Pe(r)?(e>0&&(r=ln(r,e)),n+='"'+Js(r)+'"'):yr(r)?n+=String(r).replace(/^Symbol\((.*)\)$/i,'Symbol("$1")'):cn(r)?n+=(r.name||"function")+"()":on(r)?n+=String(r)+"n":n+=String(r),n},br=(r,e,n=0)=>{var s,i;if(!Gt(r)&&!Pt(r)){e.ret+=un(r,e.keyMaxLen);return}if(e.circularFinder(r)){let f="";Pt(r)?f="(Circular Array)":Gt(r)&&(f=`(Circular ${((s=r.constructor)==null?void 0:s.name)||"Object"})`),e.ret+=e.standardJSON?`"${f}"`:f;return}let a="",u="";if(e.pretty){for(let f=0;f<=n;f++)a+=" ";u=`
|
|
2
|
+
`}let h="{",_="}";Pt(r)&&(h="[",_="]"),e.ret+=h+u;const p=Ws(r);for(let f=0;f<p.length;f++){const w=p[f];e.ret+=a;try{Pt(r)||(Gt(w)||Pt(w)||yr(w)?e.ret+=Object.prototype.toString.call(w):Pe(w)&&e.standardJSON?e.ret+='"'+w+'"':e.ret+=w,e.ret+=": ")}catch{continue}try{const l=r[w];Pt(l)?e.maxDepth>-1&&n>=e.maxDepth?e.ret+="Array("+l.length+")":br(l,e,n+1):Gt(l)?e.maxDepth>-1&&n>=e.maxDepth?e.ret+=(((i=l.constructor)==null?void 0:i.name)||"Object")+" {}":br(l,e,n+1):e.ret+=un(l,e.keyMaxLen)}catch{e.ret+=e.standardJSON?'"(PARSE_ERROR)"':"(PARSE_ERROR)"}if(e.keyMaxLen>0&&e.ret.length>=e.keyMaxLen*10){e.ret+=", (...)";break}f<p.length-1&&(e.ret+=", "),e.ret+=u}e.ret+=a.substring(0,a.length-2)+_};function hn(r,e={maxDepth:-1,keyMaxLen:-1,pretty:!1,standardJSON:!1}){const n=Object.assign({ret:"",maxDepth:-1,keyMaxLen:-1,pretty:!1,standardJSON:!1,circularFinder:Gs()},e);return br(r,n),n.ret}function Xs(r){try{return self.Blob?new self.Blob([r],{type:"text/plain"}).size:encodeURI(r).split(/%(?:u[0-9A-F]{2})?[0-9A-F]{2}|./).length-1}catch{return 0}}function Le(r){return r<=0?"":r>=1e3*1e3?(r/1e3/1e3).toFixed(1)+" MB":r>=1e3*1?(r/1e3).toFixed(1)+" KB":r+" B"}function ln(r,e){return r.length>e&&(r=r.substring(0,e)+`...(${Le(Xs(r))})`),r}function Ws(r){return!Gt(r)&&!Pt(r)?[]:Object.keys(r)}function Qs(r=[],e=1024*1024){if(!r.length)return[];if(JSON.stringify(r).length<=e)return[r];let n=[],s=[],i=0;for(let a=0;a<r.length;a++){const u=r[a],h=JSON.stringify(u).length;i+h<e?(s.push(u),i+=h):s.length?(n.push(s),s=[u],i=h):(n.push([u]),i=0)}return n}const Vs=r=>typeof r=="object"?(r.config&&r.request&&(r.config=void 0,r.request=void 0),r.status!==void 0?r.data?(r.detail=typeof r.data=="object"?JSON.stringify(r.data):r.data,r=new Error(r.detail)):r.body?(r.detail=typeof r.body=="object"?JSON.stringify(r.body):r.body,r=new Error(r.detail)):(r.message=`${r.statusText||r.bodyText||""}`,r=new Error(r.message)):r=new Error(JSON.stringify(r)),r):new Error(r),kr=r=>{var e;let n=null;r?r&&r instanceof Error?n=r:n=Vs(r):(r=new Error("error"),n=r);const s={message:"",detail:"",name:"",stack:[]};if(s.message=n.message,s.name=n.name,s.detail=((e=n.stack)==null?void 0:e.toString())||n.message,n.stack){let i=n.stack.split(/\n\s+at/);i.length&&(i=i.slice(1)),s.stack=i}return s},Tr=r=>new Promise(e=>{setTimeout(()=>{e(void 0),r&&r()},0)}),oe=()=>{if(typeof wx<"u"&&!window){const r=getCurrentPages();return r.length?r[r.length-1].route:"applaunch"}else return window.location.href};var Ks=Object.defineProperty,Zs=(r,e,n)=>e in r?Ks(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,I=(r,e,n)=>(Zs(r,typeof e!="symbol"?e+"":e,n),n);class pn{constructor(e){I(this,"limit"),I(this,"runningSize"),I(this,"taskList"),this.limit=e,this.taskList=[],this.runningSize=0}addTask(e){this.taskList.push(e),this.run()}async run(){for(;this.taskList.length&&this.runningSize<this.limit;){const e=this.taskList.shift();e&&(this.runningSize++,await e(),this.runningSize--,this.run())}}}var Sr=(r=>(r[r.NORMAL=0]="NORMAL",r[r.HIGH=1]="HIGH",r[r.EMERGEN=2]="EMERGEN",r))(Sr||{});class st{constructor(e,n,s){I(this,"_level",0),this.apaasTrack=e,this.type=n,s&&(this._level=s)}getProperties(){return{}}setProperties(e){}getEventLog(e){const n=e||Date.now();return{...this.apaasTrack.baseLog,types:this.type,logtime:String(n),epochnanos:String(n)+"000000",event:this.type,properties:this.getProperties(),url:oe()}}}I(st,"eventOptions"),I(st,"initApaasTrackHook"),I(st,"startApaasTrackHook"),I(st,"destroyApaasTrackHook");class dn extends st{constructor(e){super(e,"init")}getProperties(){const e=this.apaasTrack.baseLog;return{system:e.system||"",systemver:e.systemver||"",manufacturer:e.manufacturer||"",browser:e.browser||"",browserver:e.browserver||"",terminalid:e.terminalid||"",client:e.client||"",clientver:e.clientver||""}}}class mn extends st{constructor(e){super(e,"custom"),I(this,"info",{})}setCustomType(e){this.type=e}getProperties(){return{...this.info}}setProperties(e){this.info=e}}const Xt={init:dn,custom:mn},Lt=(r,e)=>{const n=Xt[e];return new n(r)},fn=(r,e,n)=>{const s=n||Date.now(),i=Lt(r,e);return{...r.baseLog,types:e,logtime:String(s),epochnanos:String(s)+"000000",event:e,properties:i.getProperties(),url:oe()}},Pr=(r,e,n)=>{const s=n||Date.now();return{...r.baseLog,types:e.type,logtime:String(s),epochnanos:String(s)+"000000",event:e.type,properties:e.getProperties(),url:oe()}},Lr=(r,e)=>{if(Xt[r])throw Error(`\u8BE5\u4E8B\u4EF6${r} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);Xt[r]=e};class gn{constructor(e,n){I(this,"name",""),I(this,"time",0),I(this,"info",{}),e&&(this.name=e),n&&(this.info=n),this.time=Date.now()}get epochnanos(){return this.time*1e6}get attributes(){return this.getAttributes()}getAttributes(){return{}}getJson(){return{name:this.name,epochnanos:this.time*1e6,attributes:this.getAttributes(),...this.info}}setInfo(e){this.info=e||{}}}class vn extends gn{constructor(){super(...arguments),I(this,"name","exception"),I(this,"exceptionType",""),I(this,"exceptionMessage",""),I(this,"exceptionStackTrace","")}getAttributes(){return{"exception.type":this.exceptionType,"exception.message":this.exceptionMessage,"exception.stacktrace":this.exceptionStackTrace}}setInfo(e){this.exceptionMessage=e.exceptionMessage,this.exceptionType=e.exceptionType,this.exceptionStackTrace=e.exceptionStackTrace}}class We extends st{constructor(e,n,s){super(e,"span"),I(this,"spanid",""),I(this,"traceid",""),I(this,"parentspanid",""),I(this,"name",""),I(this,"attributes",{}),I(this,"events",[]),I(this,"statuscode","OK"),I(this,"statusmessage",""),I(this,"startTime",0),I(this,"endTime",0),this.name=n,this.traceid=ae(),this.spanid=nn(),this.parentspanid=s||"",this.start()}trackLog(){this.apaasTrack.addLogByEvent(this)}createSpanEvent(e,n){return new We(this.apaasTrack,e,n)}setAttribute(e){const n=e.getAttributes();this.attributes=n}addEvent(e){this.events.push(e)}exception(e){const n=new vn;let s="",i="",a="";if(e instanceof Error){const u=kr(e);s=u.detail,i=u.name,a=u.stack.join(",")}else s=e.exceptionMessage,i=e.exceptionType,a=e.exceptionStackTrace;n.setInfo({exceptionMessage:s,exceptionType:i,exceptionStackTrace:a}),this.events.push(n)}start(){this.startTime=Date.now()}end(e,n){e&&(this.statusmessage=e),n&&(this.statuscode=n),this.endTime=Date.now()}getProperties(){return{traceid:this.traceid,spanid:this.spanid,parentspanid:this.parentspanid,name:this.name,attributes:this.attributes,events:this.events.map(e=>e.getJson()),statuscode:this.statuscode,statusmessage:this.statusmessage,startepochnanos:this.startTime*1e6,endepochnanos:this.endTime*1e6,duration:(this.endTime-this.startTime)*1e6}}}const Er="1.0.22";class Ee{constructor(e){I(this,"_version",Er),I(this,"commonLog",null),I(this,"browserLog",null),I(this,"options"),this.options=e,typeof window<"u"&&(window.__apaasTrackVersion__=Er),typeof wx<"u"&&!window&&(wx.__apaasTrackVersion__=Er),e.commonLog&&this.initCommonLog(e.commonLog),this.runEventInitHooks()}registerEvent(e,n){Lr(e,n),n.initApaasTrackHook&&n.initApaasTrackHook(this),n.startApaasTrackHook&&n.startApaasTrackHook(this)}get groupid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}runEventInitHooks(){Object.values(Xt).forEach(e=>{e.initApaasTrackHook&&e.initApaasTrackHook(this)})}runEventStartHooks(){Object.values(Xt).forEach(e=>{e.startApaasTrackHook&&e.startApaasTrackHook(this)})}runEventDestroyHooks(){Object.values(Xt).forEach(e=>{e.destroyApaasTrackHook&&e.destroyApaasTrackHook(this)})}get anonymousid(){var e;return(e=this.browserLog)==null?void 0:e.anonymousid}get distinctid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}get baseLog(){return{...this.browserLog,...this.commonLog}}initCommonLog(e){this.commonLog=e}createEventLog(e,n){return fn(this,e,n)}addLogByType(e,n){const s=this.createEventLog(e,n);this.addLogToQueue(s)}addLogByEvent(e,n){const s=Pr(this,e,n);this.addLogToQueue(s)}createCustomEvent(e){const n=Lt(this,"custom");return n.setCustomType(e),n}createSpanEvent(e,n){return new We(this,e,n)}addLogByCustomEvent(e,n={},s){const i=this.createCustomEvent(e);i.setProperties(n);const a=Pr(this,i,s);this.addLogToQueue(a)}executeInitEvent(){const e=Lt(this,"init");e.setProperties({groupid:this.groupid}),this.addLogByEvent(e)}updateCommonLog(e){this.commonLog={...this.commonLog,...e}}trackEvent(e,n={},s){const i=Lt(this,e);i.setProperties(n),this.addLogByEvent(i,s)}start(...e){this.executeInitEvent(),this.runEventStartHooks()}destroy(){this.runEventDestroyHooks()}transformLog(e){return e}async addLogToQueue(e,n=!1,s=!0){s&&(e=this.transformLog(e)),await this.sendLog(e,n)}}I(Ee,"registerEvent",Lr);class Ys{constructor(e){I(this,"name",""),I(this,"groupid",""),this.name=e.name,this.groupid=e.groupid}getJson(){return{name:this.name,attributes:this.getAttributes()}}}var ti=Object.defineProperty,ei=(r,e,n)=>e in r?ti(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,y=(r,e,n)=>(ei(r,typeof e!="symbol"?e+"":e,n),n),ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Br={exports:{}};(function(r,e){(function(n,s){var i="1.0.32",a="",u="?",h="function",_="undefined",p="object",f="string",w="major",l="model",v="name",b="type",k="vendor",T="version",R="architecture",et="console",M="mobile",C="tablet",K="smarttv",J="wearable",lt="embedded",wt=350,Nt="Amazon",ge="Apple",ze="ASUS",lr="BlackBerry",jt="Browser",Zt="Chrome",Vr="Edge",ve="Firefox",Yt="Google",pr="Huawei",tt="LG",xt="Microsoft",Ut="Motorola",_e="Opera",Fe="Samsung",He="Sharp",te="Sony",qt="Xiaomi",Ie="Zebra",dr="Facebook",Kr=function(z,q){var A={};for(var Q in z)q[Q]&&q[Q].length%2===0?A[Q]=q[Q].concat(z[Q]):A[Q]=z[Q];return A},At=function(z){for(var q={},A=0;A<z.length;A++)q[z[A].toUpperCase()]=z[A];return q},Ne=function(z,q){return typeof z===f?ee(q).indexOf(ee(z))!==-1:!1},ee=function(z){return z.toLowerCase()},Zr=function(z){return typeof z===f?z.replace(/[^\d\.]/g,a).split(".")[0]:s},re=function(z,q){if(typeof z===f)return z=z.replace(/^\s\s*/,a).replace(/\s\s*$/,a),typeof q===_?z:z.substring(0,wt)},pt=function(z,q){for(var A=0,Q,O,ye,G,vt,yt;A<q.length&&!vt;){var gr=q[A],Ue=q[A+1];for(Q=O=0;Q<gr.length&&!vt;)if(vt=gr[Q++].exec(z),vt)for(ye=0;ye<Ue.length;ye++)yt=vt[++O],G=Ue[ye],typeof G===p&&G.length>0?G.length===2?typeof G[1]==h?this[G[0]]=G[1].call(this,yt):this[G[0]]=G[1]:G.length===3?typeof G[1]===h&&!(G[1].exec&&G[1].test)?this[G[0]]=yt?G[1].call(this,yt,G[2]):s:this[G[0]]=yt?yt.replace(G[1],G[2]):s:G.length===4&&(this[G[0]]=yt?G[3].call(this,yt.replace(G[1],G[2])):s):this[G]=yt||s;A+=2}},je=function(z,q){for(var A in q)if(typeof q[A]===p&&q[A].length>0){for(var Q=0;Q<q[A].length;Q++)if(Ne(q[A][Q],z))return A===u?s:A}else if(Ne(q[A],z))return A===u?s:A;return z},mr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},fr={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"},Ot={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[T,[v,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[v,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[v,T],[/opios[\/ ]+([\w\.]+)/i],[T,[v,_e+" Mini"]],[/\bopr\/([\w\.]+)/i],[T,[v,_e]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[v,T],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[v,"UC"+jt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[T,[v,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[T,[v,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[v,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[v,"IE"]],[/yabrowser\/([\w\.]+)/i],[T,[v,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[v,/(.+)/,"$1 Secure "+jt],T],[/\bfocus\/([\w\.]+)/i],[T,[v,ve+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[v,_e+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[v,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[v,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[v,_e+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[v,"MIUI "+jt]],[/fxios\/([-\w\.]+)/i],[T,[v,ve]],[/\bqihu|(qi?ho?o?|360)browser/i],[[v,"360 "+jt]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[v,/(.+)/,"$1 "+jt],T],[/(comodo_dragon)\/([\w\.]+)/i],[[v,/_/g," "],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[v,T],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[v],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[v,dr],T],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[v,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[v,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[v,Zt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[v,Zt+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[v,"Android "+jt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[v,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[v,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,v],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[v,[T,je,mr]],[/(webkit|khtml)\/([\w\.]+)/i],[v,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[v,"Netscape"],T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[v,ve+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[v,T]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[R,"amd64"]],[/(ia32(?=;))/i],[[R,ee]],[/((?:i[346]|x)86)[;\)]/i],[[R,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[R,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[R,"armhf"]],[/windows (ce|mobile); ppc;/i],[[R,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[R,/ower/,a,ee]],[/(sun4\w)[;\)]/i],[[R,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[R,ee]]],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],[l,[k,Fe],[b,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[k,Fe],[b,M]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[k,ge],[b,M]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[k,ge],[b,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[k,pr],[b,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[k,pr],[b,M]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[k,qt],[b,M]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[k,qt],[b,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[k,"OPPO"],[b,M]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[k,"Vivo"],[b,M]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[k,"Realme"],[b,M]],[/\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],[l,[k,Ut],[b,M]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[k,Ut],[b,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[k,tt],[b,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[k,tt],[b,M]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[k,"Lenovo"],[b,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[k,"Nokia"],[b,M]],[/(pixel c)\b/i],[l,[k,Yt],[b,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[k,Yt],[b,M]],[/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],[l,[k,te],[b,M]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[k,te],[b,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[k,"OnePlus"],[b,M]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[k,Nt],[b,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[k,Nt],[b,M]],[/(playbook);[-\w\),; ]+(rim)/i],[l,k,[b,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[k,lr],[b,M]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[k,ze],[b,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[k,ze],[b,M]],[/(nexus 9)/i],[l,[k,"HTC"],[b,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[k,[l,/_/g," "],[b,M]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[k,"Acer"],[b,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[k,"Meizu"],[b,M]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[k,He],[b,M]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[k,l,[b,M]],[/(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],[k,l,[b,C]],[/(surface duo)/i],[l,[k,xt],[b,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[k,"Fairphone"],[b,M]],[/(u304aa)/i],[l,[k,"AT&T"],[b,M]],[/\bsie-(\w*)/i],[l,[k,"Siemens"],[b,M]],[/\b(rct\w+) b/i],[l,[k,"RCA"],[b,C]],[/\b(venue[\d ]{2,7}) b/i],[l,[k,"Dell"],[b,C]],[/\b(q(?:mv|ta)\w+) b/i],[l,[k,"Verizon"],[b,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[k,"Barnes & Noble"],[b,C]],[/\b(tm\d{3}\w+) b/i],[l,[k,"NuVision"],[b,C]],[/\b(k88) b/i],[l,[k,"ZTE"],[b,C]],[/\b(nx\d{3}j) b/i],[l,[k,"ZTE"],[b,M]],[/\b(gen\d{3}) b.+49h/i],[l,[k,"Swiss"],[b,M]],[/\b(zur\d{3}) b/i],[l,[k,"Swiss"],[b,C]],[/\b((zeki)?tb.*\b) b/i],[l,[k,"Zeki"],[b,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[k,"Dragon Touch"],l,[b,C]],[/\b(ns-?\w{0,9}) b/i],[l,[k,"Insignia"],[b,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[k,"NextBook"],[b,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[k,"Voice"],l,[b,M]],[/\b(lvtel\-)?(v1[12]) b/i],[[k,"LvTel"],l,[b,M]],[/\b(ph-1) /i],[l,[k,"Essential"],[b,M]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[k,"Envizen"],[b,C]],[/\b(trio[-\w\. ]+) b/i],[l,[k,"MachSpeed"],[b,C]],[/\btu_(1491) b/i],[l,[k,"Rotor"],[b,C]],[/(shield[\w ]+) b/i],[l,[k,"Nvidia"],[b,C]],[/(sprint) (\w+)/i],[k,l,[b,M]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[k,xt],[b,M]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[k,Ie],[b,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[k,Ie],[b,M]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[k,l,[b,et]],[/droid.+; (shield) bui/i],[l,[k,"Nvidia"],[b,et]],[/(playstation [345portablevi]+)/i],[l,[k,te],[b,et]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[k,xt],[b,et]],[/smart-tv.+(samsung)/i],[k,[b,K]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[k,Fe],[b,K]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[k,tt],[b,K]],[/(apple) ?tv/i],[k,[l,ge+" TV"],[b,K]],[/crkey/i],[[l,Zt+"cast"],[k,Yt],[b,K]],[/droid.+aft(\w)( bui|\))/i],[l,[k,Nt],[b,K]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[k,He],[b,K]],[/(bravia[\w ]+)( bui|\))/i],[l,[k,te],[b,K]],[/(mitv-\w{5}) bui/i],[l,[k,qt],[b,K]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[k,re],[l,re],[b,K]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[b,K]],[/((pebble))app/i],[k,l,[b,J]],[/droid.+; (glass) \d/i],[l,[k,Yt],[b,J]],[/droid.+; (wt63?0{2,3})\)/i],[l,[k,Ie],[b,J]],[/(quest( 2)?)/i],[l,[k,dr],[b,J]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[k,[b,lt]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[b,M]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[b,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,M]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[k,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[v,Vr+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[v,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[v,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,v]],os:[[/microsoft (windows) (vista|xp)/i],[v,T],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[v,[T,je,fr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[v,"Windows"],[T,je,fr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[v,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[v,"Mac OS"],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,v],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[v,T],[/\(bb(10);/i],[T,[v,lr]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[v,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[v,ve+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[v,"webOS"]],[/crkey\/([\d\.]+)/i],[T,[v,Zt+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[v,"Chromium OS"],T],[/(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],[v,T],[/(sunos) ?([\w\.\d]*)/i],[[v,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[v,T]]},ct=function(z,q){if(typeof z===p&&(q=z,z=s),!(this instanceof ct))return new ct(z,q).getResult();var A=z||(typeof n!==_&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:a),Q=q?Kr(Ot,q):Ot;return this.getBrowser=function(){var O={};return O[v]=s,O[T]=s,pt.call(O,A,Q.browser),O.major=Zr(O.version),O},this.getCPU=function(){var O={};return O[R]=s,pt.call(O,A,Q.cpu),O},this.getDevice=function(){var O={};return O[k]=s,O[l]=s,O[b]=s,pt.call(O,A,Q.device),O},this.getEngine=function(){var O={};return O[v]=s,O[T]=s,pt.call(O,A,Q.engine),O},this.getOS=function(){var O={};return O[v]=s,O[T]=s,pt.call(O,A,Q.os),O},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 A},this.setUA=function(O){return A=typeof O===f&&O.length>wt?re(O,wt):O,this},this.setUA(A),this};ct.VERSION=i,ct.BROWSER=At([v,T,w]),ct.CPU=At([R]),ct.DEVICE=At([l,k,b,et,M,K,C,J,lt]),ct.ENGINE=ct.OS=At([v,T]),r.exports&&(e=r.exports=ct),e.UAParser=ct;var $t=typeof n!==_&&(n.jQuery||n.Zepto);if($t&&!$t.ua){var we=new ct;$t.ua=we.getResult(),$t.ua.get=function(){return we.getUA()},$t.ua.set=function(z){we.setUA(z);var q=we.getResult();for(var A in q)$t.ua[A]=q[A]}}})(typeof window=="object"?window:ri)})(Br,Br.exports);var _n={exports:{}},wn={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(n,s){return n<<s|n>>>32-s},rotr:function(n,s){return n<<32-s|n>>>s},endian:function(n){if(n.constructor==Number)return e.rotl(n,8)&16711935|e.rotl(n,24)&4278255360;for(var s=0;s<n.length;s++)n[s]=e.endian(n[s]);return n},randomBytes:function(n){for(var s=[];n>0;n--)s.push(Math.floor(Math.random()*256));return s},bytesToWords:function(n){for(var s=[],i=0,a=0;i<n.length;i++,a+=8)s[a>>>5]|=n[i]<<24-a%32;return s},wordsToBytes:function(n){for(var s=[],i=0;i<n.length*32;i+=8)s.push(n[i>>>5]>>>24-i%32&255);return s},bytesToHex:function(n){for(var s=[],i=0;i<n.length;i++)s.push((n[i]>>>4).toString(16)),s.push((n[i]&15).toString(16));return s.join("")},hexToBytes:function(n){for(var s=[],i=0;i<n.length;i+=2)s.push(parseInt(n.substr(i,2),16));return s},bytesToBase64:function(n){for(var s=[],i=0;i<n.length;i+=3)for(var a=n[i]<<16|n[i+1]<<8|n[i+2],u=0;u<4;u++)i*8+u*6<=n.length*8?s.push(r.charAt(a>>>6*(3-u)&63)):s.push("=");return s.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var s=[],i=0,a=0;i<n.length;a=++i%4)a!=0&&s.push((r.indexOf(n.charAt(i-1))&Math.pow(2,-2*a+8)-1)<<a*2|r.indexOf(n.charAt(i))>>>6-a*2);return s}};wn.exports=e})();var xr={utf8:{stringToBytes:function(r){return xr.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(xr.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var e=[],n=0;n<r.length;n++)e.push(r.charCodeAt(n)&255);return e},bytesToString:function(r){for(var e=[],n=0;n<r.length;n++)e.push(String.fromCharCode(r[n]));return e.join("")}}},yn=xr;/*!
|
|
3
3
|
* Determine if an object is a Buffer
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/var
|
|
8
|
-
function ii(n){var e=1,s=2,r=3,i={},a=new Worker(n||"./lzma_worker-min.js");return a.onmessage=function(u){u.data.action===r?i[u.data.cbn]&&typeof i[u.data.cbn].on_progress=="function"&&i[u.data.cbn].on_progress(u.data.result):i[u.data.cbn]&&typeof i[u.data.cbn].on_finish=="function"&&(i[u.data.cbn].on_finish(u.data.result,u.data.error),delete i[u.data.cbn])},a.onerror=function(u){var l=new Error(u.message+" ("+u.filename+":"+u.lineno+")");for(var w in i)i[w].on_finish(null,l);console.error("Uncaught error in lzma_worker",l)},function(){function u(l,w,p,f,v){var h;do h=Math.floor(Math.random()*1e7);while(typeof i[h]<"u");i[h]={on_finish:f,on_progress:v},a.postMessage({action:l,cbn:h,data:w,mode:p})}return{compress:function(l,w,p,f){u(e,l,w,p,f)},decompress:function(l,w,p){u(s,l,!1,w,p)},worker:function(){return a}}}()}var Mn=function(){var n=1,e=3,s=typeof setImmediate=="function"?setImmediate:setTimeout,r=4294967296,i=[4294967295,-r],a=[0,-9223372036854776e3],u=[0,0],l=[1,0];function w(t,o){postMessage({action:e,cbn:o,result:t})}function p(t){var o=[];return o[t-1]=void 0,o}function f(t,o){return _(t[0]+o[0],t[1]+o[1])}function v(t,o){return R(~~Math.max(Math.min(t[1]/r,2147483647),-2147483648)&~~Math.max(Math.min(o[1]/r,2147483647),-2147483648),T(t)&T(o))}function h(t,o){var c,d;return t[0]==o[0]&&t[1]==o[1]?0:(c=t[1]<0,d=o[1]<0,c&&!d?-1:!c&&d?1:J(t,o)[1]<0?-1:1)}function _(t,o){var c,d;for(o%=18446744073709552e3,t%=18446744073709552e3,c=o%r,d=Math.floor(t/r)*r,o=o-c+d,t=t-d+c;t<0;)t+=r,o-=r;for(;t>4294967295;)t-=r,o+=r;for(o=o%18446744073709552e3;o>9223372032559809e3;)o-=18446744073709552e3;for(;o<-9223372036854776e3;)o+=18446744073709552e3;return[t,o]}function y(t,o){return t[0]==o[0]&&t[1]==o[1]}function k(t){return t>=0?[t,0]:[t+r,-r]}function T(t){return t[0]>=2147483648?~~Math.max(Math.min(t[0]-r,2147483647),-2147483648):~~Math.max(Math.min(t[0],2147483647),-2147483648)}function R(t,o){var c,d;return c=t*r,d=o,o<0&&(d+=r),[d,c]}function et(t){return t<=30?1<<t:et(30)*et(t-30)}function M(t,o){var c,d,m,g;if(o&=63,y(t,a))return o?u:t;if(t[1]<0)throw new Error("Neg");return g=et(o),d=t[1]*g%18446744073709552e3,m=t[0]*g,c=m-m%r,d+=c,m-=c,d>=9223372036854776e3&&(d-=18446744073709552e3),[m,d]}function C(t,o){var c;return o&=63,c=et(o),_(Math.floor(t[0]/c),t[1]/c)}function K(t,o){var c;return o&=63,c=C(t,o),t[1]<0&&(c=f(c,M([2,0],63-o))),c}function J(t,o){return _(t[0]-o[0],t[1]-o[1])}function lt(t,o){return t.buf=o,t.pos=0,t.count=o.length,t}function bt(t,o,c,d){return t.pos>=t.count?-1:(d=Math.min(d,t.count-t.pos),Zt(t.buf,t.pos,o,c,d),t.pos+=d,d)}function Nt(t){return t.buf=p(32),t.count=0,t}function ge(t){var o=t.buf;return o.length=t.count,o}function ze(t,o){t.buf[t.count++]=o<<24>>24}function pn(t,o,c,d){Zt(o,c,t.buf,t.count,d),t.count+=d}function jt(t,o,c,d,m){var g;for(g=o;g<c;++g)d[m++]=t.charCodeAt(g)}function Zt(t,o,c,d,m){for(var g=0;g<m;++g)c[d+g]=t[o+g]}function Kn(t,o){Tc(o,1<<t.s),o._numFastBytes=t.f,Sc(o,t.m),o._numLiteralPosStateBits=0,o._numLiteralContextBits=3,o._posStateBits=2,o._posStateMask=3}function _e(t,o,c,d,m){var g,S;if(h(d,i)<0)throw new Error("invalid length "+d);for(t.length_0=d,g=q({}),Kn(m,g),g._writeEndMark=typeof Mn.disableEndMark>"u",Pc(g,c),S=0;S<64;S+=8)ze(c,T(C(d,S))&255);t.chunker=(g._needReleaseMFStream=0,g._inStream=o,g._finished=0,z(g),g._rangeEncoder.Stream=c,_n(g),Q(g),A(g),g._lenEncoder._tableSize=g._numFastBytes+1-2,kr(g._lenEncoder,1<<g._posStateBits),g._repMatchLenEncoder._tableSize=g._numFastBytes+1-2,kr(g._repMatchLenEncoder,1<<g._posStateBits),g.nowPos64=u,je({},g))}function Yt(t,o,c){return t.output=Nt({}),_e(t,lt({},o),t.output,k(o.length),c),t}function dn(t,o,c,d){var m;t._keepSizeBefore=o,t._keepSizeAfter=c,m=o+c+d,(t._bufferBase==null||t._blockSize!=m)&&(t._bufferBase=null,t._blockSize=m,t._bufferBase=p(t._blockSize)),t._pointerToLastSafePosition=t._blockSize-c}function tt(t,o){return t._bufferBase[t._bufferOffset+t._pos+o]}function xt(t,o,c,d){var m,g;for(t._streamEndWasReached&&t._pos+o+d>t._streamPos&&(d=t._streamPos-(t._pos+o)),++c,g=t._bufferOffset+t._pos+o,m=0;m<d&&t._bufferBase[g+m]==t._bufferBase[g+m-c];++m);return m}function Ut(t){return t._streamPos-t._pos}function ve(t){var o,c,d;for(d=t._bufferOffset+t._pos-t._keepSizeBefore,d>0&&--d,c=t._bufferOffset+t._streamPos-d,o=0;o<c;++o)t._bufferBase[o]=t._bufferBase[d+o];t._bufferOffset-=d}function Fe(t){var o;++t._pos,t._pos>t._posLimit&&(o=t._bufferOffset+t._pos,o>t._pointerToLastSafePosition&&ve(t),He(t))}function He(t){var o,c,d;if(!t._streamEndWasReached)for(;;){if(d=-t._bufferOffset+t._blockSize-t._streamPos,!d)return;if(o=bt(t._stream,t._bufferBase,t._bufferOffset+t._streamPos,d),o==-1){t._posLimit=t._streamPos,c=t._bufferOffset+t._posLimit,c>t._pointerToLastSafePosition&&(t._posLimit=t._pointerToLastSafePosition-t._bufferOffset),t._streamEndWasReached=1;return}t._streamPos+=o,t._streamPos>=t._pos+t._keepSizeAfter&&(t._posLimit=t._streamPos-t._keepSizeAfter)}}function te(t,o){t._bufferOffset+=o,t._posLimit-=o,t._pos-=o,t._streamPos-=o}var qt=function(){var t,o,c,d=[];for(t=0;t<256;++t){for(c=t,o=0;o<8;++o)(c&1)!=0?c=c>>>1^-306674912:c>>>=1;d[t]=c}return d}();function Ie(t,o,c,d,m){var g,S,x;o<1073741567&&(t._cutValue=16+(d>>1),x=~~((o+c+d+m)/2)+256,dn(t,o+c,d+m,x),t._matchMaxLen=d,g=o+1,t._cyclicBufferSize!=g&&(t._son=p((t._cyclicBufferSize=g)*2)),S=65536,t.HASH_ARRAY&&(S=o-1,S|=S>>1,S|=S>>2,S|=S>>4,S|=S>>8,S>>=1,S|=65535,S>16777216&&(S>>=1),t._hashMask=S,++S,S+=t.kFixHashSize),S!=t._hashSizeSum&&(t._hash=p(t._hashSizeSum=S)))}function mn(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,nt,P,N,Z,j,yt,it,kt,Ct;if(t._pos+t._matchMaxLen<=t._streamPos)P=t._matchMaxLen;else if(P=t._streamPos-t._pos,P<t.kMinMatchCheck)return At(t),0;for(j=0,N=t._pos>t._cyclicBufferSize?t._pos-t._cyclicBufferSize:0,d=t._bufferOffset+t._pos,Z=1,L=0,B=0,t.HASH_ARRAY?(Ct=qt[t._bufferBase[d]&255]^t._bufferBase[d+1]&255,L=Ct&1023,Ct^=(t._bufferBase[d+2]&255)<<8,B=Ct&65535,W=(Ct^qt[t._bufferBase[d+3]&255]<<5)&t._hashMask):W=t._bufferBase[d]&255^(t._bufferBase[d+1]&255)<<8,m=t._hash[t.kFixHashSize+W]||0,t.HASH_ARRAY&&(g=t._hash[L]||0,S=t._hash[1024+B]||0,t._hash[L]=t._pos,t._hash[1024+B]=t._pos,g>N&&t._bufferBase[t._bufferOffset+g]==t._bufferBase[d]&&(o[j++]=Z=2,o[j++]=t._pos-g-1),S>N&&t._bufferBase[t._bufferOffset+S]==t._bufferBase[d]&&(S==g&&(j-=2),o[j++]=Z=3,o[j++]=t._pos-S-1,g=S),j!=0&&g==m&&(j-=2,Z=1)),t._hash[t.kFixHashSize+W]=t._pos,it=(t._cyclicBufferPos<<1)+1,kt=t._cyclicBufferPos<<1,H=nt=t.kNumHashDirectBytes,t.kNumHashDirectBytes!=0&&m>N&&t._bufferBase[t._bufferOffset+m+t.kNumHashDirectBytes]!=t._bufferBase[d+t.kNumHashDirectBytes]&&(o[j++]=Z=t.kNumHashDirectBytes,o[j++]=t._pos-m-1),c=t._cutValue;;){if(m<=N||c--==0){t._son[it]=t._son[kt]=0;break}if(D=t._pos-m,x=(D<=t._cyclicBufferPos?t._cyclicBufferPos-D:t._cyclicBufferPos-D+t._cyclicBufferSize)<<1,yt=t._bufferOffset+m,F=H<nt?H:nt,t._bufferBase[yt+F]==t._bufferBase[d+F]){for(;++F!=P&&t._bufferBase[yt+F]==t._bufferBase[d+F];);if(Z<F&&(o[j++]=Z=F,o[j++]=D-1,F==P)){t._son[kt]=t._son[x],t._son[it]=t._son[x+1];break}}(t._bufferBase[yt+F]&255)<(t._bufferBase[d+F]&255)?(t._son[kt]=m,kt=x+1,m=t._son[kt],nt=F):(t._son[it]=m,it=x,m=t._son[it],H=F)}return At(t),j}function Zn(t){t._bufferOffset=0,t._pos=0,t._streamPos=0,t._streamEndWasReached=0,He(t),t._cyclicBufferPos=0,te(t,-1)}function At(t){var o;++t._cyclicBufferPos>=t._cyclicBufferSize&&(t._cyclicBufferPos=0),Fe(t),t._pos==1073741823&&(o=t._pos-t._cyclicBufferSize,Ne(t._son,t._cyclicBufferSize*2,o),Ne(t._hash,t._hashSizeSum,o),te(t,o))}function Ne(t,o,c){var d,m;for(d=0;d<o;++d)m=t[d]||0,m<=c?m=0:m-=c,t[d]=m}function ee(t,o){t.HASH_ARRAY=o>2,t.HASH_ARRAY?(t.kNumHashDirectBytes=0,t.kMinMatchCheck=4,t.kFixHashSize=66560):(t.kNumHashDirectBytes=2,t.kMinMatchCheck=3,t.kFixHashSize=0)}function Yn(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,nt,P,N,Z,j;do{if(t._pos+t._matchMaxLen<=t._streamPos)H=t._matchMaxLen;else if(H=t._streamPos-t._pos,H<t.kMinMatchCheck){At(t);continue}for(nt=t._pos>t._cyclicBufferSize?t._pos-t._cyclicBufferSize:0,d=t._bufferOffset+t._pos,t.HASH_ARRAY?(j=qt[t._bufferBase[d]&255]^t._bufferBase[d+1]&255,x=j&1023,t._hash[x]=t._pos,j^=(t._bufferBase[d+2]&255)<<8,D=j&65535,t._hash[1024+D]=t._pos,L=(j^qt[t._bufferBase[d+3]&255]<<5)&t._hashMask):L=t._bufferBase[d]&255^(t._bufferBase[d+1]&255)<<8,m=t._hash[t.kFixHashSize+L],t._hash[t.kFixHashSize+L]=t._pos,N=(t._cyclicBufferPos<<1)+1,Z=t._cyclicBufferPos<<1,W=F=t.kNumHashDirectBytes,c=t._cutValue;;){if(m<=nt||c--==0){t._son[N]=t._son[Z]=0;break}if(S=t._pos-m,g=(S<=t._cyclicBufferPos?t._cyclicBufferPos-S:t._cyclicBufferPos-S+t._cyclicBufferSize)<<1,P=t._bufferOffset+m,B=W<F?W:F,t._bufferBase[P+B]==t._bufferBase[d+B]){for(;++B!=H&&t._bufferBase[P+B]==t._bufferBase[d+B];);if(B==H){t._son[Z]=t._son[g],t._son[N]=t._son[g+1];break}}(t._bufferBase[P+B]&255)<(t._bufferBase[d+B]&255)?(t._son[Z]=m,Z=g+1,m=t._son[Z],F=B):(t._son[N]=m,N=g,m=t._son[N],W=B)}At(t)}while(--o!=0)}function ne(t){return t-=2,t<4?t:3}function pt(t){return t<4?0:t<10?t-3:t-6}function je(t,o){return t.encoder=o,t.decoder=null,t.alive=1,t}function fn(t){if(!t.alive)throw new Error("bad state");if(t.encoder)gn(t);else throw new Error("No decoding");return t.alive}function gn(t){be(t.encoder,t.encoder.processedInSize,t.encoder.processedOutSize,t.encoder.finished),t.inBytesProcessed=t.encoder.processedInSize[0],t.encoder.finished[0]&&(kc(t.encoder),t.alive=0)}var Ot=function(){var t,o,c,d=2,m=[0,1];for(c=2;c<22;++c)for(o=1<<(c>>1)-1,t=0;t<o;++t,++d)m[d]=c<<24>>24;return m}();function ct(t,o){var c,d,m,g;t._optimumEndIndex=o,m=t._optimum[o].PosPrev,d=t._optimum[o].BackPrev;do t._optimum[o].Prev1IsChar&&(Sr(t._optimum[m]),t._optimum[m].PosPrev=m-1,t._optimum[o].Prev2&&(t._optimum[m-1].Prev1IsChar=0,t._optimum[m-1].PosPrev=t._optimum[o].PosPrev2,t._optimum[m-1].BackPrev=t._optimum[o].BackPrev2)),g=m,c=d,d=t._optimum[g].BackPrev,m=t._optimum[g].PosPrev,t._optimum[g].BackPrev=c,t._optimum[g].PosPrev=o,o=g;while(o>0);return t.backRes=t._optimum[0].BackPrev,t._optimumCurrentIndex=t._optimum[0].PosPrev,t._optimumCurrentIndex}function $t(t){t._state=0,t._previousByte=0;for(var o=0;o<4;++o)t._repDistances[o]=0}function be(t,o,c,d){var m,g,S,x,D,L,B,W,F,H,nt,P,N,Z,j;if(o[0]=u,c[0]=u,d[0]=1,t._inStream&&(t._matchFinder._stream=t._inStream,Zn(t._matchFinder),t._needReleaseMFStream=1,t._inStream=null),!t._finished){if(t._finished=1,Z=t.nowPos64,y(t.nowPos64,u)){if(!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}ts(t),N=T(t.nowPos64)&t._posStateMask,V(t._rangeEncoder,t._isMatch,(t._state<<4)+N,0),t._state=pt(t._state),S=tt(t._matchFinder,-t._additionalOffset),Tr(ye(t._literalEncoder,T(t.nowPos64),t._previousByte),t._rangeEncoder,S),t._previousByte=S,--t._additionalOffset,t.nowPos64=f(t.nowPos64,l)}if(!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}for(;;){if(B=we(t,T(t.nowPos64)),H=t.backRes,N=T(t.nowPos64)&t._posStateMask,g=(t._state<<4)+N,B==1&&H==-1)V(t._rangeEncoder,t._isMatch,g,0),S=tt(t._matchFinder,-t._additionalOffset),j=ye(t._literalEncoder,T(t.nowPos64),t._previousByte),t._state<7?Tr(j,t._rangeEncoder,S):(F=tt(t._matchFinder,-t._repDistances[0]-1-t._additionalOffset),Rc(j,t._rangeEncoder,F,S)),t._previousByte=S,t._state=pt(t._state);else{if(V(t._rangeEncoder,t._isMatch,g,1),H<4){if(V(t._rangeEncoder,t._isRep,t._state,1),H?(V(t._rangeEncoder,t._isRepG0,t._state,1),H==1?V(t._rangeEncoder,t._isRepG1,t._state,0):(V(t._rangeEncoder,t._isRepG1,t._state,1),V(t._rangeEncoder,t._isRepG2,t._state,H-2))):(V(t._rangeEncoder,t._isRepG0,t._state,0),B==1?V(t._rangeEncoder,t._isRep0Long,g,0):V(t._rangeEncoder,t._isRep0Long,g,1)),B==1?t._state=t._state<7?9:11:(ns(t._repMatchLenEncoder,t._rangeEncoder,B-2,N),t._state=t._state<7?8:11),x=t._repDistances[H],H!=0){for(L=H;L>=1;--L)t._repDistances[L]=t._repDistances[L-1];t._repDistances[0]=x}}else{for(V(t._rangeEncoder,t._isRep,t._state,0),t._state=t._state<7?7:10,ns(t._lenEncoder,t._rangeEncoder,B-2,N),H-=4,P=es(H),W=ne(B),$e(t._posSlotEncoder[W],t._rangeEncoder,P),P>=4&&(D=(P>>1)-1,m=(2|P&1)<<D,nt=H-m,P<14?zc(t._posEncoders,m-P-1,t._rangeEncoder,D,nt):(Lr(t._rangeEncoder,nt>>4,D-4),Pr(t._posAlignEncoder,t._rangeEncoder,nt&15),++t._alignPriceCount)),x=H,L=3;L>=1;--L)t._repDistances[L]=t._repDistances[L-1];t._repDistances[0]=x,++t._matchPriceCount}t._previousByte=tt(t._matchFinder,B-1-t._additionalOffset)}if(t._additionalOffset-=B,t.nowPos64=f(t.nowPos64,k(B)),!t._additionalOffset){if(t._matchPriceCount>=128&&Q(t),t._alignPriceCount>=16&&A(t),o[0]=t.nowPos64,c[0]=Hc(t._rangeEncoder),!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}if(h(J(t.nowPos64,Z),[4096,0])>=0){t._finished=0,d[0]=0;return}}}}}function z(t){var o,c;t._matchFinder||(o={},c=4,t._matchFinderType||(c=2),ee(o,c),t._matchFinder=o),Cc(t._literalEncoder,t._numLiteralPosStateBits,t._numLiteralContextBits),!(t._dictionarySize==t._dictionarySizePrev&&t._numFastBytesPrev==t._numFastBytes)&&(Ie(t._matchFinder,t._dictionarySize,4096,t._numFastBytes,274),t._dictionarySizePrev=t._dictionarySize,t._numFastBytesPrev=t._numFastBytes)}function q(t){var o;for(t._repDistances=p(4),t._optimum=[],t._rangeEncoder={},t._isMatch=p(192),t._isRep=p(12),t._isRepG0=p(12),t._isRepG1=p(12),t._isRepG2=p(12),t._isRep0Long=p(192),t._posSlotEncoder=[],t._posEncoders=p(114),t._posAlignEncoder=qe({},4),t._lenEncoder=yr({}),t._repMatchLenEncoder=yr({}),t._literalEncoder={},t._matchDistances=[],t._posSlotPrices=[],t._distancesPrices=[],t._alignPrices=p(16),t.reps=p(4),t.repLens=p(4),t.processedInSize=[u],t.processedOutSize=[u],t.finished=[0],t.properties=p(5),t.tempPrices=p(128),t._longestMatchLength=0,t._matchFinderType=1,t._numDistancePairs=0,t._numFastBytesPrev=-1,t.backRes=0,o=0;o<4096;++o)t._optimum[o]={};for(o=0;o<4;++o)t._posSlotEncoder[o]=qe({},6);return t}function A(t){for(var o=0;o<16;++o)t._alignPrices[o]=Oc(t._posAlignEncoder,o);t._alignPriceCount=0}function Q(t){var o,c,d,m,g,S,x,D;for(m=4;m<128;++m)S=es(m),d=(S>>1)-1,o=(2|S&1)<<d,t.tempPrices[m]=Fc(t._posEncoders,o-S-1,d,m-o);for(g=0;g<4;++g){for(c=t._posSlotEncoder[g],x=g<<6,S=0;S<t._distTableSize;++S)t._posSlotPrices[x+S]=bn(c,S);for(S=14;S<t._distTableSize;++S)t._posSlotPrices[x+S]+=(S>>1)-1-4<<6;for(D=g*128,m=0;m<4;++m)t._distancesPrices[D+m]=t._posSlotPrices[x+m];for(;m<128;++m)t._distancesPrices[D+m]=t._posSlotPrices[x+es(m)]+t.tempPrices[m]}t._matchPriceCount=0}function O(t,o){vr(t),Lc(t,o&t._posStateMask);for(var c=0;c<5;++c)ss(t._rangeEncoder)}function we(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,nt,P,N,Z,j,yt,it,kt,Ct,dt,ke,wn,Tt,Mt,Rt,ht,zt,Y,E,Jt,re,at,ot,Cr,St,Ge,ie,Ft,Te,Xe,U,st,Se,Mr,Rr,Dr,Ar,Or;if(t._optimumEndIndex!=t._optimumCurrentIndex)return nt=t._optimum[t._optimumCurrentIndex].PosPrev-t._optimumCurrentIndex,t.backRes=t._optimum[t._optimumCurrentIndex].BackPrev,t._optimumCurrentIndex=t._optimum[t._optimumCurrentIndex].PosPrev,nt;if(t._optimumCurrentIndex=t._optimumEndIndex=0,t._longestMatchWasFound?(H=t._longestMatchLength,t._longestMatchWasFound=0):H=ts(t),Rt=t._numDistancePairs,Tt=Ut(t._matchFinder)+1,Tt<2)return t.backRes=-1,1;for(Tt>273&&(Tt=273),Ft=0,B=0;B<4;++B)t.reps[B]=t._repDistances[B],t.repLens[B]=xt(t._matchFinder,-1,t.reps[B],273),t.repLens[B]>t.repLens[Ft]&&(Ft=B);if(t.repLens[Ft]>=t._numFastBytes)return t.backRes=Ft,nt=t.repLens[Ft],Ue(t,nt-1),nt;if(H>=t._numFastBytes)return t.backRes=t._matchDistances[Rt-1]+4,Ue(t,H-1),H;if(D=tt(t._matchFinder,-1),j=tt(t._matchFinder,-t._repDistances[0]-1-1),H<2&&D!=j&&t.repLens[Ft]<2)return t.backRes=-1,1;if(t._optimum[0].State=t._state,at=o&t._posStateMask,t._optimum[1].Price=$[t._isMatch[(t._state<<4)+at]>>>2]+vn(ye(t._literalEncoder,o,t._previousByte),t._state>=7,j,D),Sr(t._optimum[1]),yt=$[2048-t._isMatch[(t._state<<4)+at]>>>2],ie=yt+$[2048-t._isRep[t._state]>>>2],j==D&&(Te=ie+wt(t,t._state,at),Te<t._optimum[1].Price&&(t._optimum[1].Price=Te,Ac(t._optimum[1]))),F=H>=t.repLens[Ft]?H:t.repLens[Ft],F<2)return t.backRes=t._optimum[1].BackPrev,1;t._optimum[1].PosPrev=0,t._optimum[0].Backs0=t.reps[0],t._optimum[0].Backs1=t.reps[1],t._optimum[0].Backs2=t.reps[2],t._optimum[0].Backs3=t.reps[3],W=F;do t._optimum[W--].Price=268435455;while(W>=2);for(B=0;B<4;++B)if(Ge=t.repLens[B],!(Ge<2)){Cr=ie+_t(t,B,t._state,at);do g=Cr+se(t._repMatchLenEncoder,Ge-2,at),E=t._optimum[Ge],g<E.Price&&(E.Price=g,E.PosPrev=0,E.BackPrev=B,E.Prev1IsChar=0);while(--Ge>=2)}if(wn=yt+$[t._isRep[t._state]>>>2],W=t.repLens[0]>=2?t.repLens[0]+1:2,W<=H){for(ht=0;W>t._matchDistances[ht];)ht+=2;for(;L=t._matchDistances[ht+1],g=wn+G(t,L,W,at),E=t._optimum[W],g<E.Price&&(E.Price=g,E.PosPrev=0,E.BackPrev=L+4,E.Prev1IsChar=0),!(W==t._matchDistances[ht]&&(ht+=2,ht==Rt));++W);}for(c=0;;){if(++c,c==F)return ct(t,c);if(it=ts(t),Rt=t._numDistancePairs,it>=t._numFastBytes)return t._longestMatchLength=it,t._longestMatchWasFound=1,ct(t,c);if(++o,re=t._optimum[c].PosPrev,t._optimum[c].Prev1IsChar?(--re,t._optimum[c].Prev2?(U=t._optimum[t._optimum[c].PosPrev2].State,t._optimum[c].BackPrev2<4?U=U<7?8:11:U=U<7?7:10):U=t._optimum[re].State,U=pt(U)):U=t._optimum[re].State,re==c-1?t._optimum[c].BackPrev?U=pt(U):U=U<7?9:11:(t._optimum[c].Prev1IsChar&&t._optimum[c].Prev2?(re=t._optimum[c].PosPrev2,Jt=t._optimum[c].BackPrev2,U=U<7?8:11):(Jt=t._optimum[c].BackPrev,Jt<4?U=U<7?8:11:U=U<7?7:10),Y=t._optimum[re],Jt<4?Jt?Jt==1?(t.reps[0]=Y.Backs1,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs2,t.reps[3]=Y.Backs3):Jt==2?(t.reps[0]=Y.Backs2,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs3):(t.reps[0]=Y.Backs3,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs2):(t.reps[0]=Y.Backs0,t.reps[1]=Y.Backs1,t.reps[2]=Y.Backs2,t.reps[3]=Y.Backs3):(t.reps[0]=Jt-4,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs2)),t._optimum[c].State=U,t._optimum[c].Backs0=t.reps[0],t._optimum[c].Backs1=t.reps[1],t._optimum[c].Backs2=t.reps[2],t._optimum[c].Backs3=t.reps[3],x=t._optimum[c].Price,D=tt(t._matchFinder,-1),j=tt(t._matchFinder,-t.reps[0]-1-1),at=o&t._posStateMask,d=x+$[t._isMatch[(U<<4)+at]>>>2]+vn(ye(t._literalEncoder,o,tt(t._matchFinder,-2)),U>=7,j,D),dt=t._optimum[c+1],kt=0,d<dt.Price&&(dt.Price=d,dt.PosPrev=c,dt.BackPrev=-1,dt.Prev1IsChar=0,kt=1),yt=x+$[2048-t._isMatch[(U<<4)+at]>>>2],ie=yt+$[2048-t._isRep[U]>>>2],j==D&&!(dt.PosPrev<c&&!dt.BackPrev)&&(Te=ie+($[t._isRepG0[U]>>>2]+$[t._isRep0Long[(U<<4)+at]>>>2]),Te<=dt.Price&&(dt.Price=Te,dt.PosPrev=c,dt.BackPrev=0,dt.Prev1IsChar=0,kt=1)),Mt=Ut(t._matchFinder)+1,Mt=4095-c<Mt?4095-c:Mt,Tt=Mt,!(Tt<2)){if(Tt>t._numFastBytes&&(Tt=t._numFastBytes),!kt&&j!=D&&(Se=Math.min(Mt-1,t._numFastBytes),N=xt(t._matchFinder,0,t.reps[0],Se),N>=2)){for(st=pt(U),ot=o+1&t._posStateMask,ke=d+$[2048-t._isMatch[(st<<4)+ot]>>>2]+$[2048-t._isRep[st]>>>2],zt=c+1+N;F<zt;)t._optimum[++F].Price=268435455;g=ke+(Mr=se(t._repMatchLenEncoder,N-2,ot),Mr+_t(t,0,st,ot)),E=t._optimum[zt],g<E.Price&&(E.Price=g,E.PosPrev=c+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=0)}for(Xe=2,St=0;St<4;++St)if(P=xt(t._matchFinder,-1,t.reps[St],Tt),!(P<2)){Z=P;do{for(;F<c+P;)t._optimum[++F].Price=268435455;g=ie+(Rr=se(t._repMatchLenEncoder,P-2,at),Rr+_t(t,St,U,at)),E=t._optimum[c+P],g<E.Price&&(E.Price=g,E.PosPrev=c,E.BackPrev=St,E.Prev1IsChar=0)}while(--P>=2);if(P=Z,St||(Xe=P+1),P<Mt&&(Se=Math.min(Mt-1-P,t._numFastBytes),N=xt(t._matchFinder,P,t.reps[St],Se),N>=2)){for(st=U<7?8:11,ot=o+P&t._posStateMask,m=ie+(Dr=se(t._repMatchLenEncoder,P-2,at),Dr+_t(t,St,U,at))+$[t._isMatch[(st<<4)+ot]>>>2]+vn(ye(t._literalEncoder,o+P,tt(t._matchFinder,P-1-1)),1,tt(t._matchFinder,P-1-(t.reps[St]+1)),tt(t._matchFinder,P-1)),st=pt(st),ot=o+P+1&t._posStateMask,Ct=m+$[2048-t._isMatch[(st<<4)+ot]>>>2],ke=Ct+$[2048-t._isRep[st]>>>2],zt=P+1+N;F<c+zt;)t._optimum[++F].Price=268435455;g=ke+(Ar=se(t._repMatchLenEncoder,N-2,ot),Ar+_t(t,0,st,ot)),E=t._optimum[c+zt],g<E.Price&&(E.Price=g,E.PosPrev=c+P+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=1,E.PosPrev2=c,E.BackPrev2=St)}}if(it>Tt){for(it=Tt,Rt=0;it>t._matchDistances[Rt];Rt+=2);t._matchDistances[Rt]=it,Rt+=2}if(it>=Xe){for(wn=yt+$[t._isRep[U]>>>2];F<c+it;)t._optimum[++F].Price=268435455;for(ht=0;Xe>t._matchDistances[ht];)ht+=2;for(P=Xe;;++P)if(S=t._matchDistances[ht+1],g=wn+G(t,S,P,at),E=t._optimum[c+P],g<E.Price&&(E.Price=g,E.PosPrev=c,E.BackPrev=S+4,E.Prev1IsChar=0),P==t._matchDistances[ht]){if(P<Mt&&(Se=Math.min(Mt-1-P,t._numFastBytes),N=xt(t._matchFinder,P,S,Se),N>=2)){for(st=U<7?7:10,ot=o+P&t._posStateMask,m=g+$[t._isMatch[(st<<4)+ot]>>>2]+vn(ye(t._literalEncoder,o+P,tt(t._matchFinder,P-1-1)),1,tt(t._matchFinder,P-(S+1)-1),tt(t._matchFinder,P-1)),st=pt(st),ot=o+P+1&t._posStateMask,Ct=m+$[2048-t._isMatch[(st<<4)+ot]>>>2],ke=Ct+$[2048-t._isRep[st]>>>2],zt=P+1+N;F<c+zt;)t._optimum[++F].Price=268435455;g=ke+(Or=se(t._repMatchLenEncoder,N-2,ot),Or+_t(t,0,st,ot)),E=t._optimum[c+zt],g<E.Price&&(E.Price=g,E.PosPrev=c+P+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=1,E.PosPrev2=c,E.BackPrev2=S+4)}if(ht+=2,ht==Rt)break}}}}}function G(t,o,c,d){var m,g=ne(c);return o<128?m=t._distancesPrices[g*128+o]:m=t._posSlotPrices[(g<<6)+Ec(o)]+t._alignPrices[o&15],m+se(t._lenEncoder,c-2,d)}function _t(t,o,c,d){var m;return o?(m=$[2048-t._isRepG0[c]>>>2],o==1?m+=$[t._isRepG1[c]>>>2]:(m+=$[2048-t._isRepG1[c]>>>2],m+=Je(t._isRepG2[c],o-2))):(m=$[t._isRepG0[c]>>>2],m+=$[2048-t._isRep0Long[(c<<4)+d]>>>2]),m}function wt(t,o,c){return $[t._isRepG0[o]>>>2]+$[t._isRep0Long[(o<<4)+c]>>>2]}function _n(t){$t(t),Ic(t._rangeEncoder),ut(t._isMatch),ut(t._isRep0Long),ut(t._isRep),ut(t._isRepG0),ut(t._isRepG1),ut(t._isRepG2),ut(t._posEncoders),Mc(t._literalEncoder);for(var o=0;o<4;++o)ut(t._posSlotEncoder[o].Models);br(t._lenEncoder,1<<t._posStateBits),br(t._repMatchLenEncoder,1<<t._posStateBits),ut(t._posAlignEncoder.Models),t._longestMatchWasFound=0,t._optimumEndIndex=0,t._optimumCurrentIndex=0,t._additionalOffset=0}function Ue(t,o){o>0&&(Yn(t._matchFinder,o),t._additionalOffset+=o)}function ts(t){var o=0;return t._numDistancePairs=mn(t._matchFinder,t._matchDistances),t._numDistancePairs>0&&(o=t._matchDistances[t._numDistancePairs-2],o==t._numFastBytes&&(o+=xt(t._matchFinder,o-1,t._matchDistances[t._numDistancePairs-1],273-o))),++t._additionalOffset,o}function vr(t){t._matchFinder&&t._needReleaseMFStream&&(t._matchFinder._stream=null,t._needReleaseMFStream=0)}function kc(t){vr(t),t._rangeEncoder.Stream=null}function Tc(t,o){t._dictionarySize=o;for(var c=0;o>1<<c;++c);t._distTableSize=c*2}function Sc(t,o){var c=t._matchFinderType;t._matchFinderType=o,t._matchFinder&&c!=t._matchFinderType&&(t._dictionarySizePrev=-1,t._matchFinder=null)}function Pc(t,o){t.properties[0]=(t._posStateBits*5+t._numLiteralPosStateBits)*9+t._numLiteralContextBits<<24>>24;for(var c=0;c<4;++c)t.properties[1+c]=t._dictionarySize>>8*c<<24>>24;pn(o,t.properties,0,5)}function Lc(t,o){if(t._writeEndMark){V(t._rangeEncoder,t._isMatch,(t._state<<4)+o,1),V(t._rangeEncoder,t._isRep,t._state,0),t._state=t._state<7?7:10,ns(t._lenEncoder,t._rangeEncoder,0,o);var c=ne(2);$e(t._posSlotEncoder[c],t._rangeEncoder,63),Lr(t._rangeEncoder,67108863,26),Pr(t._posAlignEncoder,t._rangeEncoder,15)}}function es(t){return t<2048?Ot[t]:t<2097152?Ot[t>>10]+20:Ot[t>>20]+40}function Ec(t){return t<131072?Ot[t>>6]+12:t<134217728?Ot[t>>16]+32:Ot[t>>26]+52}function Bc(t,o,c,d){c<8?(V(o,t._choice,0,0),$e(t._lowCoder[d],o,c)):(c-=8,V(o,t._choice,0,1),c<8?(V(o,t._choice,1,0),$e(t._midCoder[d],o,c)):(V(o,t._choice,1,1),$e(t._highCoder,o,c-8)))}function xc(t){t._choice=p(2),t._lowCoder=p(16),t._midCoder=p(16),t._highCoder=qe({},8);for(var o=0;o<16;++o)t._lowCoder[o]=qe({},3),t._midCoder[o]=qe({},3);return t}function br(t,o){ut(t._choice);for(var c=0;c<o;++c)ut(t._lowCoder[c].Models),ut(t._midCoder[c].Models);ut(t._highCoder.Models)}function wr(t,o,c,d,m){var g,S,x,D,L;for(g=$[t._choice[0]>>>2],S=$[2048-t._choice[0]>>>2],x=S+$[t._choice[1]>>>2],D=S+$[2048-t._choice[1]>>>2],L=0,L=0;L<8;++L){if(L>=c)return;d[m+L]=g+bn(t._lowCoder[o],L)}for(;L<16;++L){if(L>=c)return;d[m+L]=x+bn(t._midCoder[o],L-8)}for(;L<c;++L)d[m+L]=D+bn(t._highCoder,L-8-8)}function ns(t,o,c,d){Bc(t,o,c,d),--t._counters[d]==0&&(wr(t,d,t._tableSize,t._prices,d*272),t._counters[d]=t._tableSize)}function yr(t){return xc(t),t._prices=[],t._counters=[],t}function se(t,o,c){return t._prices[c*272+o]}function kr(t,o){for(var c=0;c<o;++c)wr(t,c,t._tableSize,t._prices,c*272),t._counters[c]=t._tableSize}function Cc(t,o,c){var d,m;if(!(t.m_Coders!=null&&t.m_NumPrevBits==c&&t.m_NumPosBits==o))for(t.m_NumPosBits=o,t.m_PosMask=(1<<o)-1,t.m_NumPrevBits=c,m=1<<t.m_NumPrevBits+t.m_NumPosBits,t.m_Coders=p(m),d=0;d<m;++d)t.m_Coders[d]=Dc({})}function ye(t,o,c){return t.m_Coders[((o&t.m_PosMask)<<t.m_NumPrevBits)+((c&255)>>>8-t.m_NumPrevBits)]}function Mc(t){var o,c=1<<t.m_NumPrevBits+t.m_NumPosBits;for(o=0;o<c;++o)ut(t.m_Coders[o].m_Encoders)}function Tr(t,o,c){var d,m,g=1;for(m=7;m>=0;--m)d=c>>m&1,V(o,t.m_Encoders,g,d),g=g<<1|d}function Rc(t,o,c,d){var m,g,S,x,D=1,L=1;for(g=7;g>=0;--g)m=d>>g&1,x=L,D&&(S=c>>g&1,x+=1+S<<8,D=S==m),V(o,t.m_Encoders,x,m),L=L<<1|m}function Dc(t){return t.m_Encoders=p(768),t}function vn(t,o,c,d){var m,g=1,S=7,x,D=0;if(o){for(;S>=0;--S)if(x=c>>S&1,m=d>>S&1,D+=Je(t.m_Encoders[(1+x<<8)+g],m),g=g<<1|m,x!=m){--S;break}}for(;S>=0;--S)m=d>>S&1,D+=Je(t.m_Encoders[g],m),g=g<<1|m;return D}function Sr(t){t.BackPrev=-1,t.Prev1IsChar=0}function Ac(t){t.BackPrev=0,t.Prev1IsChar=0}function qe(t,o){return t.NumBitLevels=o,t.Models=p(1<<o),t}function $e(t,o,c){var d,m,g=1;for(m=t.NumBitLevels;m!=0;)--m,d=c>>>m&1,V(o,t.Models,g,d),g=g<<1|d}function bn(t,o){var c,d,m=1,g=0;for(d=t.NumBitLevels;d!=0;)--d,c=o>>>d&1,g+=Je(t.Models[m],c),m=(m<<1)+c;return g}function Pr(t,o,c){var d,m,g=1;for(m=0;m<t.NumBitLevels;++m)d=c&1,V(o,t.Models,g,d),g=g<<1|d,c>>=1}function Oc(t,o){var c,d,m=1,g=0;for(d=t.NumBitLevels;d!=0;--d)c=o&1,o>>>=1,g+=Je(t.Models[m],c),m=m<<1|c;return g}function zc(t,o,c,d,m){var g,S,x=1;for(S=0;S<d;++S)g=m&1,V(c,t,o+x,g),x=x<<1|g,m>>=1}function Fc(t,o,c,d){var m,g,S=1,x=0;for(g=c;g!=0;--g)m=d&1,d>>>=1,x+=$[((t[o+S]-m^-m)&2047)>>>2],S=S<<1|m;return x}function ut(t){for(var o=t.length-1;o>=0;--o)t[o]=1024}var $=function(){var t,o,c,d,m=[];for(o=8;o>=0;--o)for(d=1<<9-o-1,t=1<<9-o,c=d;c<t;++c)m[c]=(o<<6)+(t-c<<6>>>9-o-1);return m}();function V(t,o,c,d){var m,g=o[c];m=(t.Range>>>11)*g,d?(t.Low=f(t.Low,v(k(m),[4294967295,0])),t.Range-=m,o[c]=g-(g>>>5)<<16>>16):(t.Range=m,o[c]=g+(2048-g>>>5)<<16>>16),t.Range&-16777216||(t.Range<<=8,ss(t))}function Lr(t,o,c){for(var d=c-1;d>=0;--d)t.Range>>>=1,(o>>>d&1)==1&&(t.Low=f(t.Low,k(t.Range))),t.Range&-16777216||(t.Range<<=8,ss(t))}function Hc(t){return f(f(k(t._cacheSize),t._position),[4,0])}function Ic(t){t._position=u,t.Low=u,t.Range=-1,t._cacheSize=1,t._cache=0}function ss(t){var o,c=T(K(t.Low,32));if(c!=0||h(t.Low,[4278190080,0])<0){t._position=f(t._position,k(t._cacheSize)),o=t._cache;do ze(t.Stream,o+c),o=255;while(--t._cacheSize!=0);t._cache=T(t.Low)>>>24}++t._cacheSize,t.Low=M(v(t.Low,[16777215,0]),8)}function Je(t,o){return $[((t-o^-o)&2047)>>>2]}function Er(t){var o,c=[],d,m=0,g,S=t.length;if(typeof t=="object")return t;for(jt(t,0,S,c,0),g=0;g<S;++g)o=c[g],o>=1&&o<=127?++m:!o||o>=128&&o<=2047?m+=2:m+=3;for(d=[],m=0,g=0;g<S;++g)o=c[g],o>=1&&o<=127?d[m++]=o<<24>>24:!o||o>=128&&o<=2047?(d[m++]=(192|o>>6&31)<<24>>24,d[m++]=(128|o&63)<<24>>24):(d[m++]=(224|o>>12&15)<<24>>24,d[m++]=(128|o>>6&63)<<24>>24,d[m++]=(128|o&63)<<24>>24);return d}function Br(t){return t[1]+t[0]}function Nc(t,o,c,d){var m={},g,S,x=typeof c>"u"&&typeof d>"u";if(typeof c!="function"&&(S=c,c=d=0),d=d||function(L){if(!(typeof S>"u"))return w(L,S)},c=c||function(L,B){if(!(typeof S>"u"))return postMessage({action:n,cbn:S,result:L,error:B})},x){for(m.c=Yt({},Er(t),xr(o));fn(m.c.chunker););return ge(m.c.output)}try{m.c=Yt({},Er(t),xr(o)),d(0)}catch(L){return c(null,L)}function D(){try{for(var L,B=new Date().getTime();fn(m.c.chunker);)if(g=Br(m.c.chunker.inBytesProcessed)/Br(m.c.length_0),new Date().getTime()-B>200)return d(g),s(D,0),0;d(1),L=ge(m.c.output),s(c.bind(null,L),0)}catch(W){c(null,W)}}s(D,0)}var xr=function(){var t=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(o){return t[o-1]||t[6]}}();return typeof onmessage<"u"&&(typeof window>"u"||typeof window.document>"u")&&function(){onmessage=function(t){t&&t.data&&t.data.action==n&&Mn.compress(t.data.data,t.data.mode,t.data.cbn)}}(),{compress:Nc}}();const ai=async n=>await ci(n);let Ve=null;const oi=async n=>(n=n||'"./lzma_worker-min.js"',Ve||(await ai(n)?Ve=ii(n):(console.error("lzma\u65E0\u6CD5\u627E\u5230"+n+": \u65E0\u6CD5\u542F\u52A8worker\u6A21\u5F0F\uFF0C\u5C06\u542F\u7528\u6D4F\u89C8\u5668\u8BA1\u7B97\u6A21\u5F0F\uFF0C\u6027\u80FD\u53D7\u5F71\u54CD"),Ve=Mn),Ve)),ci=n=>new Promise((e,s)=>{const r=new XMLHttpRequest;r.open("get",n,!0),r.addEventListener("error",i=>{e(!1)}),r.addEventListener("load",i=>{r.status===200&&e(!0),e(!1)}),r.send()}),ui=new ps(5);let ks="";const hi=n=>{ks=n};let Ts=null;const Ss=n=>{const e=typeof n=="string"?n:JSON.stringify(n);let s=location.pathname;s=s.replace(/[^\/\/.]+\.(html|html)$/,"").replace("//","/");const r=ks||location.origin+s+"static/lzma_worker.js";return console.log("lzma_worker",r),new Promise(async i=>{let a=Date.now();window.requestIdleCallback(async()=>{Ts=await oi(r),Ts.compress(e,5,(u,l)=>{if(!u)throw Error("static/lzma_worker.js \u65E0\u6CD5\u52A0\u8F7D\uFF0C\u8BF7\u68C0\u67E5\u8BE5\u6587\u4EF6");console.log("compress finish",Date.now()-a);const w=[...u],p=new Int8Array(w.length);for(let f=0;f<w.length;f++)p[f]=w[f];console.log("compress success",Date.now()-a),i(p)})})})},Ke=async(n,e,s)=>new Promise((r,i)=>{const a=new XMLHttpRequest;a.open("POST",n,!0),s?(a.setRequestHeader("xw-body-encoding","v1"),ui.addTask(()=>new Promise((u,l)=>{Ss(e).then(w=>{a.send(w.buffer)}).finally(()=>{u()})}))):a.send(JSON.stringify(e)),a.onreadystatechange=()=>{},a.addEventListener("readystatechange",u=>{a.readyState===4&&a.status===200?r(void 0):a.status===500&&i(a.statusText)}),a.addEventListener("error",u=>{console.error("\u957F\u5EA6",JSON.stringify(e).length),i(u)})}),li=(n,e,s)=>{window.navigator.sendBeacon!==void 0?s?Ss(e).then(r=>{window.navigator.sendBeacon(n,r.buffer)}):window.navigator.sendBeacon(n,JSON.stringify(e)):Ke(n,e,s)};class pi{constructor(){b(this,"logs",[])}get length(){return this.logs.length}async init(){}async push(e){try{this.logs.push(e)}catch(s){console.error(s)}}async compulsionSave(){}clearArray(){this.logs.length=0}async shift(e=1){let s=[[...this.logs]];return this.clearArray(),s}}async function di(n){const e=new pi;return await e.init(),e}var mi=typeof global=="object"&&global&&global.Object===Object&&global;const fi=mi;var gi=typeof self=="object"&&self&&self.Object===Object&&self,_i=fi||gi||Function("return this")();const Ze=_i;var vi=Ze.Symbol;const Ht=vi;var Ps=Object.prototype,bi=Ps.hasOwnProperty,wi=Ps.toString,Be=Ht?Ht.toStringTag:void 0;function yi(n){var e=bi.call(n,Be),s=n[Be];try{n[Be]=void 0;var r=!0}catch{}var i=wi.call(n);return r&&(e?n[Be]=s:delete n[Be]),i}var ki=Object.prototype,Ti=ki.toString;function Si(n){return Ti.call(n)}var Pi="[object Null]",Li="[object Undefined]",Ls=Ht?Ht.toStringTag:void 0;function Rn(n){return n==null?n===void 0?Li:Pi:Ls&&Ls in Object(n)?yi(n):Si(n)}function Dn(n){return n!=null&&typeof n=="object"}var Ei="[object Symbol]";function Ye(n){return typeof n=="symbol"||Dn(n)&&Rn(n)==Ei}function Bi(n,e){for(var s=-1,r=n==null?0:n.length,i=Array(r);++s<r;)i[s]=e(n[s],s,n);return i}var xi=Array.isArray;const tn=xi;var Ci=1/0,Es=Ht?Ht.prototype:void 0,Bs=Es?Es.toString:void 0;function xs(n){if(typeof n=="string")return n;if(tn(n))return Bi(n,xs)+"";if(Ye(n))return Bs?Bs.call(n):"";var e=n+"";return e=="0"&&1/n==-Ci?"-0":e}var Mi=/\s/;function Ri(n){for(var e=n.length;e--&&Mi.test(n.charAt(e)););return e}var Di=/^\s+/;function Ai(n){return n&&n.slice(0,Ri(n)+1).replace(Di,"")}function xe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Cs=0/0,Oi=/^[-+]0x[0-9a-f]+$/i,zi=/^0b[01]+$/i,Fi=/^0o[0-7]+$/i,Hi=parseInt;function Ms(n){if(typeof n=="number")return n;if(Ye(n))return Cs;if(xe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=xe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Ai(n);var s=zi.test(n);return s||Fi.test(n)?Hi(n.slice(2),s?2:8):Oi.test(n)?Cs:+n}var Ii="[object AsyncFunction]",Ni="[object Function]",ji="[object GeneratorFunction]",Ui="[object Proxy]";function qi(n){if(!xe(n))return!1;var e=Rn(n);return e==Ni||e==ji||e==Ii||e==Ui}var $i=Ze["__core-js_shared__"];const An=$i;var Rs=function(){var n=/[^.]+$/.exec(An&&An.keys&&An.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Ji(n){return!!Rs&&Rs in n}var Gi=Function.prototype,Xi=Gi.toString;function Wi(n){if(n!=null){try{return Xi.call(n)}catch{}try{return n+""}catch{}}return""}var Qi=/[\\^$.*+?()[\]{}|]/g,Vi=/^\[object .+?Constructor\]$/,Ki=Function.prototype,Zi=Object.prototype,Yi=Ki.toString,ta=Zi.hasOwnProperty,ea=RegExp("^"+Yi.call(ta).replace(Qi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(n){if(!xe(n)||Ji(n))return!1;var e=qi(n)?ea:Vi;return e.test(Wi(n))}function sa(n,e){return n==null?void 0:n[e]}function Ds(n,e){var s=sa(n,e);return na(s)?s:void 0}function ra(n,e){return n===e||n!==n&&e!==e}var ia="[object Arguments]";function As(n){return Dn(n)&&Rn(n)==ia}var Os=Object.prototype,aa=Os.hasOwnProperty,oa=Os.propertyIsEnumerable,ca=As(function(){return arguments}())?As:function(n){return Dn(n)&&aa.call(n,"callee")&&!oa.call(n,"callee")};const ua=ca;var ha=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,la=/^\w*$/;function pa(n,e){if(tn(n))return!1;var s=typeof n;return s=="number"||s=="symbol"||s=="boolean"||n==null||Ye(n)?!0:la.test(n)||!ha.test(n)||e!=null&&n in Object(e)}var da=Ds(Object,"create");const Ce=da;function ma(){this.__data__=Ce?Ce(null):{},this.size=0}function fa(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var ga="__lodash_hash_undefined__",_a=Object.prototype,va=_a.hasOwnProperty;function ba(n){var e=this.__data__;if(Ce){var s=e[n];return s===ga?void 0:s}return va.call(e,n)?e[n]:void 0}var wa=Object.prototype,ya=wa.hasOwnProperty;function ka(n){var e=this.__data__;return Ce?e[n]!==void 0:ya.call(e,n)}var Ta="__lodash_hash_undefined__";function Sa(n,e){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=Ce&&e===void 0?Ta:e,this}function Wt(n){var e=-1,s=n==null?0:n.length;for(this.clear();++e<s;){var r=n[e];this.set(r[0],r[1])}}Wt.prototype.clear=ma,Wt.prototype.delete=fa,Wt.prototype.get=ba,Wt.prototype.has=ka,Wt.prototype.set=Sa;function Pa(){this.__data__=[],this.size=0}function en(n,e){for(var s=n.length;s--;)if(ra(n[s][0],e))return s;return-1}var La=Array.prototype,Ea=La.splice;function Ba(n){var e=this.__data__,s=en(e,n);if(s<0)return!1;var r=e.length-1;return s==r?e.pop():Ea.call(e,s,1),--this.size,!0}function xa(n){var e=this.__data__,s=en(e,n);return s<0?void 0:e[s][1]}function Ca(n){return en(this.__data__,n)>-1}function Ma(n,e){var s=this.__data__,r=en(s,n);return r<0?(++this.size,s.push([n,e])):s[r][1]=e,this}function ce(n){var e=-1,s=n==null?0:n.length;for(this.clear();++e<s;){var r=n[e];this.set(r[0],r[1])}}ce.prototype.clear=Pa,ce.prototype.delete=Ba,ce.prototype.get=xa,ce.prototype.has=Ca,ce.prototype.set=Ma;var Ra=Ds(Ze,"Map");const Da=Ra;function Aa(){this.size=0,this.__data__={hash:new Wt,map:new(Da||ce),string:new Wt}}function Oa(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function nn(n,e){var s=n.__data__;return Oa(e)?s[typeof e=="string"?"string":"hash"]:s.map}function za(n){var e=nn(this,n).delete(n);return this.size-=e?1:0,e}function Fa(n){return nn(this,n).get(n)}function Ha(n){return nn(this,n).has(n)}function Ia(n,e){var s=nn(this,n),r=s.size;return s.set(n,e),this.size+=s.size==r?0:1,this}function Qt(n){var e=-1,s=n==null?0:n.length;for(this.clear();++e<s;){var r=n[e];this.set(r[0],r[1])}}Qt.prototype.clear=Aa,Qt.prototype.delete=za,Qt.prototype.get=Fa,Qt.prototype.has=Ha,Qt.prototype.set=Ia;var Na="Expected a function";function On(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(Na);var s=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=s.cache;if(a.has(i))return a.get(i);var u=n.apply(this,r);return s.cache=a.set(i,u)||a,u};return s.cache=new(On.Cache||Qt),s}On.Cache=Qt;var ja=500;function Ua(n){var e=On(n,function(r){return s.size===ja&&s.clear(),r}),s=e.cache;return e}var qa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$a=/\\(\\)?/g,Ja=Ua(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(qa,function(s,r,i,a){e.push(i?a.replace($a,"$1"):r||s)}),e});const Ga=Ja;function Xa(n){return n==null?"":xs(n)}function Wa(n,e){return tn(n)?n:pa(n,e)?[n]:Ga(Xa(n))}var Qa=1/0;function Va(n){if(typeof n=="string"||Ye(n))return n;var e=n+"";return e=="0"&&1/n==-Qa?"-0":e}function Ka(n,e){e=Wa(e,n);for(var s=0,r=e.length;n!=null&&s<r;)n=n[Va(e[s++])];return s&&s==r?n:void 0}function zs(n,e,s){var r=n==null?void 0:Ka(n,e);return r===void 0?s:r}function Za(n,e){for(var s=-1,r=e.length,i=n.length;++s<r;)n[i+s]=e[s];return n}var Fs=Ht?Ht.isConcatSpreadable:void 0;function Ya(n){return tn(n)||ua(n)||!!(Fs&&n&&n[Fs])}function Hs(n,e,s,r,i){var a=-1,u=n.length;for(s||(s=Ya),i||(i=[]);++a<u;){var l=n[a];e>0&&s(l)?e>1?Hs(l,e-1,s,r,i):Za(i,l):r||(i[i.length]=l)}return i}function Is(n){var e=n==null?0:n.length;return e?Hs(n,1):[]}var to=function(){return Ze.Date.now()};const zn=to;var eo="Expected a function",no=Math.max,so=Math.min;function ro(n,e,s){var r,i,a,u,l,w,p=0,f=!1,v=!1,h=!0;if(typeof n!="function")throw new TypeError(eo);e=Ms(e)||0,xe(s)&&(f=!!s.leading,v="maxWait"in s,a=v?no(Ms(s.maxWait)||0,e):a,h="trailing"in s?!!s.trailing:h);function _(J){var lt=r,bt=i;return r=i=void 0,p=J,u=n.apply(bt,lt),u}function y(J){return p=J,l=setTimeout(R,e),f?_(J):u}function k(J){var lt=J-w,bt=J-p,Nt=e-lt;return v?so(Nt,a-bt):Nt}function T(J){var lt=J-w,bt=J-p;return w===void 0||lt>=e||lt<0||v&&bt>=a}function R(){var J=zn();if(T(J))return et(J);l=setTimeout(R,k(J))}function et(J){return l=void 0,h&&r?_(J):(r=i=void 0,u)}function M(){l!==void 0&&clearTimeout(l),p=0,r=w=i=l=void 0}function C(){return l===void 0?u:et(zn())}function K(){var J=zn(),lt=T(J);if(r=arguments,i=this,w=J,lt){if(l===void 0)return y(w);if(v)return clearTimeout(l),l=setTimeout(R,e),_(w)}return l===void 0&&(l=setTimeout(R,e)),u}return K.cancel=M,K.flush=C,K}class io{constructor(){b(this,"logsObj"),b(this,"initPromise"),this.initPromise=this.init()}async init(){return this.logsObj=await di(),this.logsObj}get length(){var e,s;return(s=(e=this.logsObj)==null?void 0:e.length)!=null?s:0}getLogs(){var e;return((e=this.logsObj)==null?void 0:e.logs)||[]}async cacheLog(e){var s;await this.initPromise,await((s=this.logsObj)==null?void 0:s.push(e))}async send(e){var s;await this.initPromise;const r=await((s=this.logsObj)==null?void 0:s.shift());r!=null&&r.length&&await e(Is(r))}async sendByBeacon(e){var s;await this.initPromise;const r=await((s=this.logsObj)==null?void 0:s.shift());r!=null&&r.length&&await e(r)}}function ao(n){return sn(n,"String")}function oo(n){return sn(n,"Array")}function co(n){return sn(n,"Object")}function uo(n){return typeof n=="function"}function Ns(n,e="Object"){return oo(n)?n.every(s=>sn(s,e)):!1}function sn(n,e="Object"){return Object.prototype.toString.call(n)===`[object ${e}]`}const ho=window.indexedDB,lo=new Set(["add","clear","count","delete","get","getAll","getAllKeys","getKey","openCursor","openKeyCursor","put"]);function po(n,e,...s){return new Promise(async(r,i)=>{try{const a=(await this.createTransaction(n)).objectStore(n);let u=a[e].call(a,...s);u?(u.onsuccess=function(l){r(zs(l,"target.result"))},u.onerror=function(l){console.log("---storeOperate onerror",n,e,l),i(l)}):r(void 0)}catch(a){i(a)}})}function mo(n){const e=this;let s={};return lo.forEach(r=>{s[r]=function(...i){var a;return(a=e==null?void 0:e.manager)==null?void 0:a.pushTask(()=>po.call(e,n,r,...i))}}),s}class fo{constructor(){b(this,"dbManagerMap",new Map)}getOrCreateDBManager(e){if(this.dbManagerMap.has(e))return this.dbManagerMap.get(e);const s=new go(e);return this.dbManagerMap.set(e,s),s}get(e){return this.getOrCreateDBManager(e)}clear(e){const s=this.dbManagerMap.get(e);!s||(s.close(),this.dbManagerMap.delete(e))}}class go{constructor(e){b(this,"initPromise",Promise.resolve()),b(this,"openStatus",""),b(this,"version",0),b(this,"dbName"),b(this,"db",null),b(this,"isClose",!0),b(this,"task",Promise.resolve()),this.dbName=e,this.init()}pushTask(e){if(this.isClose){console.log("----task error, IndexDB is close");return}let s=this.task.then(()=>{try{return uo(e)?e():e}catch(r){console.log("----task error",r)}});return this.task=s,s}close(){const e=()=>{this.openStatus="",this.version=0,this.db&&(this.db.close(),this.db=null)};if(this.isClose)e();else{let s=this.pushTask(e);return this.isClose=!0,s}}transTransactionParam(e){return ao(e)?[{storeName:e}]:Ns(e,"String")?e.map(s=>({storeName:s})):co(e)?[e]:Ns(e)?e:(console.warn("[transTransactionParam]\u5165\u53C2\u683C\u5F0F\u4E0D\u6B63\u786E",e),[])}async transaction(e,s="readonly"){await this.initPromise;const r=this.transTransactionParam(e);if(!r.length)return;const i=[];return r.forEach(a=>{!this.db||this.db.objectStoreNames.contains(a.storeName)||i.push(u=>{u.createObjectStore(a.storeName,a.option)})}),i.length>0&&await this.upgradeneeded(i),mo.bind({manager:this,createTransaction:async a=>{if(await this.initPromise,!!this.db)return this.db.transaction(a,s)}})}init(e,s){let r=this.initPromise;this.initPromise=new Promise(async(i,a)=>{await r,await this.close();const u=ho.open(this.dbName,e);let l=setTimeout(()=>{a(new Error("[IndexDB\u8FDE\u63A5\u8D85\u65F6] name: "+this.dbName+" \u8BF7\u5C1D\u8BD5\u5237\u65B0\u6216\u91CD\u542F\u6D4F\u89C8\u5668"))},1e4);u.onsuccess=()=>{clearTimeout(l),this.openStatus="success",this.db=u.result;const w=this.db;this.isClose=!1;const p=w.version;this.version=w.version,w.onclose=()=>{this.isClose=!0,console.log("[indexDB\u5173\u95ED]",p)},console.log(`[indexDB\u521D\u59CB\u5316]
|
|
7
|
+
*/var ni=function(r){return r!=null&&(bn(r)||si(r)||!!r._isBuffer)};function bn(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function si(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&bn(r.slice(0,0))}(function(){var r=wn.exports,e=yn.utf8,n=ni,s=yn.bin,i=function(a,u){a.constructor==String?u&&u.encoding==="binary"?a=s.stringToBytes(a):a=e.stringToBytes(a):n(a)?a=Array.prototype.slice.call(a,0):!Array.isArray(a)&&a.constructor!==Uint8Array&&(a=a.toString());for(var h=r.bytesToWords(a),_=a.length*8,p=1732584193,f=-271733879,w=-1732584194,l=271733878,v=0;v<h.length;v++)h[v]=(h[v]<<8|h[v]>>>24)&16711935|(h[v]<<24|h[v]>>>8)&4278255360;h[_>>>5]|=128<<_%32,h[(_+64>>>9<<4)+14]=_;for(var b=i._ff,k=i._gg,T=i._hh,R=i._ii,v=0;v<h.length;v+=16){var et=p,M=f,C=w,K=l;p=b(p,f,w,l,h[v+0],7,-680876936),l=b(l,p,f,w,h[v+1],12,-389564586),w=b(w,l,p,f,h[v+2],17,606105819),f=b(f,w,l,p,h[v+3],22,-1044525330),p=b(p,f,w,l,h[v+4],7,-176418897),l=b(l,p,f,w,h[v+5],12,1200080426),w=b(w,l,p,f,h[v+6],17,-1473231341),f=b(f,w,l,p,h[v+7],22,-45705983),p=b(p,f,w,l,h[v+8],7,1770035416),l=b(l,p,f,w,h[v+9],12,-1958414417),w=b(w,l,p,f,h[v+10],17,-42063),f=b(f,w,l,p,h[v+11],22,-1990404162),p=b(p,f,w,l,h[v+12],7,1804603682),l=b(l,p,f,w,h[v+13],12,-40341101),w=b(w,l,p,f,h[v+14],17,-1502002290),f=b(f,w,l,p,h[v+15],22,1236535329),p=k(p,f,w,l,h[v+1],5,-165796510),l=k(l,p,f,w,h[v+6],9,-1069501632),w=k(w,l,p,f,h[v+11],14,643717713),f=k(f,w,l,p,h[v+0],20,-373897302),p=k(p,f,w,l,h[v+5],5,-701558691),l=k(l,p,f,w,h[v+10],9,38016083),w=k(w,l,p,f,h[v+15],14,-660478335),f=k(f,w,l,p,h[v+4],20,-405537848),p=k(p,f,w,l,h[v+9],5,568446438),l=k(l,p,f,w,h[v+14],9,-1019803690),w=k(w,l,p,f,h[v+3],14,-187363961),f=k(f,w,l,p,h[v+8],20,1163531501),p=k(p,f,w,l,h[v+13],5,-1444681467),l=k(l,p,f,w,h[v+2],9,-51403784),w=k(w,l,p,f,h[v+7],14,1735328473),f=k(f,w,l,p,h[v+12],20,-1926607734),p=T(p,f,w,l,h[v+5],4,-378558),l=T(l,p,f,w,h[v+8],11,-2022574463),w=T(w,l,p,f,h[v+11],16,1839030562),f=T(f,w,l,p,h[v+14],23,-35309556),p=T(p,f,w,l,h[v+1],4,-1530992060),l=T(l,p,f,w,h[v+4],11,1272893353),w=T(w,l,p,f,h[v+7],16,-155497632),f=T(f,w,l,p,h[v+10],23,-1094730640),p=T(p,f,w,l,h[v+13],4,681279174),l=T(l,p,f,w,h[v+0],11,-358537222),w=T(w,l,p,f,h[v+3],16,-722521979),f=T(f,w,l,p,h[v+6],23,76029189),p=T(p,f,w,l,h[v+9],4,-640364487),l=T(l,p,f,w,h[v+12],11,-421815835),w=T(w,l,p,f,h[v+15],16,530742520),f=T(f,w,l,p,h[v+2],23,-995338651),p=R(p,f,w,l,h[v+0],6,-198630844),l=R(l,p,f,w,h[v+7],10,1126891415),w=R(w,l,p,f,h[v+14],15,-1416354905),f=R(f,w,l,p,h[v+5],21,-57434055),p=R(p,f,w,l,h[v+12],6,1700485571),l=R(l,p,f,w,h[v+3],10,-1894986606),w=R(w,l,p,f,h[v+10],15,-1051523),f=R(f,w,l,p,h[v+1],21,-2054922799),p=R(p,f,w,l,h[v+8],6,1873313359),l=R(l,p,f,w,h[v+15],10,-30611744),w=R(w,l,p,f,h[v+6],15,-1560198380),f=R(f,w,l,p,h[v+13],21,1309151649),p=R(p,f,w,l,h[v+4],6,-145523070),l=R(l,p,f,w,h[v+11],10,-1120210379),w=R(w,l,p,f,h[v+2],15,718787259),f=R(f,w,l,p,h[v+9],21,-343485551),p=p+et>>>0,f=f+M>>>0,w=w+C>>>0,l=l+K>>>0}return r.endian([p,f,w,l])};i._ff=function(a,u,h,_,p,f,w){var l=a+(u&h|~u&_)+(p>>>0)+w;return(l<<f|l>>>32-f)+u},i._gg=function(a,u,h,_,p,f,w){var l=a+(u&_|h&~_)+(p>>>0)+w;return(l<<f|l>>>32-f)+u},i._hh=function(a,u,h,_,p,f,w){var l=a+(u^h^_)+(p>>>0)+w;return(l<<f|l>>>32-f)+u},i._ii=function(a,u,h,_,p,f,w){var l=a+(h^(u|~_))+(p>>>0)+w;return(l<<f|l>>>32-f)+u},i._blocksize=16,i._digestsize=16,_n.exports=function(a,u){if(a==null)throw new Error("Illegal argument "+a);var h=r.wordsToBytes(i(a,u));return u&&u.asBytes?h:u&&u.asString?s.bytesToString(h):r.bytesToHex(h)}})();const Qe="1.0.22";//! © 2015 Nathan Rugg <nmrugg@gmail.com> | MIT
|
|
8
|
+
function ii(r){var e=1,n=2,s=3,i={},a=new Worker(r||"./lzma_worker-min.js");return a.onmessage=function(u){u.data.action===s?i[u.data.cbn]&&typeof i[u.data.cbn].on_progress=="function"&&i[u.data.cbn].on_progress(u.data.result):i[u.data.cbn]&&typeof i[u.data.cbn].on_finish=="function"&&(i[u.data.cbn].on_finish(u.data.result,u.data.error),delete i[u.data.cbn])},a.onerror=function(u){var h=new Error(u.message+" ("+u.filename+":"+u.lineno+")");for(var _ in i)i[_].on_finish(null,h);console.error("Uncaught error in lzma_worker",h)},function(){function u(h,_,p,f,w){var l;do l=Math.floor(Math.random()*1e7);while(typeof i[l]<"u");i[l]={on_finish:f,on_progress:w},a.postMessage({action:h,cbn:l,data:_,mode:p})}return{compress:function(h,_,p,f){u(e,h,_,p,f)},decompress:function(h,_,p){u(n,h,!1,_,p)},worker:function(){return a}}}()}var Cr=function(){var r=1,e=3,n=typeof setImmediate=="function"?setImmediate:setTimeout,s=4294967296,i=[4294967295,-s],a=[0,-9223372036854776e3],u=[0,0],h=[1,0];function _(t,o){postMessage({action:e,cbn:o,result:t})}function p(t){var o=[];return o[t-1]=void 0,o}function f(t,o){return v(t[0]+o[0],t[1]+o[1])}function w(t,o){return R(~~Math.max(Math.min(t[1]/s,2147483647),-2147483648)&~~Math.max(Math.min(o[1]/s,2147483647),-2147483648),T(t)&T(o))}function l(t,o){var c,d;return t[0]==o[0]&&t[1]==o[1]?0:(c=t[1]<0,d=o[1]<0,c&&!d?-1:!c&&d?1:J(t,o)[1]<0?-1:1)}function v(t,o){var c,d;for(o%=18446744073709552e3,t%=18446744073709552e3,c=o%s,d=Math.floor(t/s)*s,o=o-c+d,t=t-d+c;t<0;)t+=s,o-=s;for(;t>4294967295;)t-=s,o+=s;for(o=o%18446744073709552e3;o>9223372032559809e3;)o-=18446744073709552e3;for(;o<-9223372036854776e3;)o+=18446744073709552e3;return[t,o]}function b(t,o){return t[0]==o[0]&&t[1]==o[1]}function k(t){return t>=0?[t,0]:[t+s,-s]}function T(t){return t[0]>=2147483648?~~Math.max(Math.min(t[0]-s,2147483647),-2147483648):~~Math.max(Math.min(t[0],2147483647),-2147483648)}function R(t,o){var c,d;return c=t*s,d=o,o<0&&(d+=s),[d,c]}function et(t){return t<=30?1<<t:et(30)*et(t-30)}function M(t,o){var c,d,m,g;if(o&=63,b(t,a))return o?u:t;if(t[1]<0)throw new Error("Neg");return g=et(o),d=t[1]*g%18446744073709552e3,m=t[0]*g,c=m-m%s,d+=c,m-=c,d>=9223372036854776e3&&(d-=18446744073709552e3),[m,d]}function C(t,o){var c;return o&=63,c=et(o),v(Math.floor(t[0]/c),t[1]/c)}function K(t,o){var c;return o&=63,c=C(t,o),t[1]<0&&(c=f(c,M([2,0],63-o))),c}function J(t,o){return v(t[0]-o[0],t[1]-o[1])}function lt(t,o){return t.buf=o,t.pos=0,t.count=o.length,t}function wt(t,o,c,d){return t.pos>=t.count?-1:(d=Math.min(d,t.count-t.pos),Zt(t.buf,t.pos,o,c,d),t.pos+=d,d)}function Nt(t){return t.buf=p(32),t.count=0,t}function ge(t){var o=t.buf;return o.length=t.count,o}function ze(t,o){t.buf[t.count++]=o<<24>>24}function lr(t,o,c,d){Zt(o,c,t.buf,t.count,d),t.count+=d}function jt(t,o,c,d,m){var g;for(g=o;g<c;++g)d[m++]=t.charCodeAt(g)}function Zt(t,o,c,d,m){for(var g=0;g<m;++g)c[d+g]=t[o+g]}function Vr(t,o){Tc(o,1<<t.s),o._numFastBytes=t.f,Sc(o,t.m),o._numLiteralPosStateBits=0,o._numLiteralContextBits=3,o._posStateBits=2,o._posStateMask=3}function ve(t,o,c,d,m){var g,S;if(l(d,i)<0)throw new Error("invalid length "+d);for(t.length_0=d,g=q({}),Vr(m,g),g._writeEndMark=typeof Cr.disableEndMark>"u",Pc(g,c),S=0;S<64;S+=8)ze(c,T(C(d,S))&255);t.chunker=(g._needReleaseMFStream=0,g._inStream=o,g._finished=0,z(g),g._rangeEncoder.Stream=c,gr(g),Q(g),A(g),g._lenEncoder._tableSize=g._numFastBytes+1-2,ks(g._lenEncoder,1<<g._posStateBits),g._repMatchLenEncoder._tableSize=g._numFastBytes+1-2,ks(g._repMatchLenEncoder,1<<g._posStateBits),g.nowPos64=u,je({},g))}function Yt(t,o,c){return t.output=Nt({}),ve(t,lt({},o),t.output,k(o.length),c),t}function pr(t,o,c,d){var m;t._keepSizeBefore=o,t._keepSizeAfter=c,m=o+c+d,(t._bufferBase==null||t._blockSize!=m)&&(t._bufferBase=null,t._blockSize=m,t._bufferBase=p(t._blockSize)),t._pointerToLastSafePosition=t._blockSize-c}function tt(t,o){return t._bufferBase[t._bufferOffset+t._pos+o]}function xt(t,o,c,d){var m,g;for(t._streamEndWasReached&&t._pos+o+d>t._streamPos&&(d=t._streamPos-(t._pos+o)),++c,g=t._bufferOffset+t._pos+o,m=0;m<d&&t._bufferBase[g+m]==t._bufferBase[g+m-c];++m);return m}function Ut(t){return t._streamPos-t._pos}function _e(t){var o,c,d;for(d=t._bufferOffset+t._pos-t._keepSizeBefore,d>0&&--d,c=t._bufferOffset+t._streamPos-d,o=0;o<c;++o)t._bufferBase[o]=t._bufferBase[d+o];t._bufferOffset-=d}function Fe(t){var o;++t._pos,t._pos>t._posLimit&&(o=t._bufferOffset+t._pos,o>t._pointerToLastSafePosition&&_e(t),He(t))}function He(t){var o,c,d;if(!t._streamEndWasReached)for(;;){if(d=-t._bufferOffset+t._blockSize-t._streamPos,!d)return;if(o=wt(t._stream,t._bufferBase,t._bufferOffset+t._streamPos,d),o==-1){t._posLimit=t._streamPos,c=t._bufferOffset+t._posLimit,c>t._pointerToLastSafePosition&&(t._posLimit=t._pointerToLastSafePosition-t._bufferOffset),t._streamEndWasReached=1;return}t._streamPos+=o,t._streamPos>=t._pos+t._keepSizeAfter&&(t._posLimit=t._streamPos-t._keepSizeAfter)}}function te(t,o){t._bufferOffset+=o,t._posLimit-=o,t._pos-=o,t._streamPos-=o}var qt=function(){var t,o,c,d=[];for(t=0;t<256;++t){for(c=t,o=0;o<8;++o)(c&1)!=0?c=c>>>1^-306674912:c>>>=1;d[t]=c}return d}();function Ie(t,o,c,d,m){var g,S,x;o<1073741567&&(t._cutValue=16+(d>>1),x=~~((o+c+d+m)/2)+256,pr(t,o+c,d+m,x),t._matchMaxLen=d,g=o+1,t._cyclicBufferSize!=g&&(t._son=p((t._cyclicBufferSize=g)*2)),S=65536,t.HASH_ARRAY&&(S=o-1,S|=S>>1,S|=S>>2,S|=S>>4,S|=S>>8,S>>=1,S|=65535,S>16777216&&(S>>=1),t._hashMask=S,++S,S+=t.kFixHashSize),S!=t._hashSizeSum&&(t._hash=p(t._hashSizeSum=S)))}function dr(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,rt,P,N,Z,j,bt,it,kt,Ct;if(t._pos+t._matchMaxLen<=t._streamPos)P=t._matchMaxLen;else if(P=t._streamPos-t._pos,P<t.kMinMatchCheck)return At(t),0;for(j=0,N=t._pos>t._cyclicBufferSize?t._pos-t._cyclicBufferSize:0,d=t._bufferOffset+t._pos,Z=1,L=0,B=0,t.HASH_ARRAY?(Ct=qt[t._bufferBase[d]&255]^t._bufferBase[d+1]&255,L=Ct&1023,Ct^=(t._bufferBase[d+2]&255)<<8,B=Ct&65535,W=(Ct^qt[t._bufferBase[d+3]&255]<<5)&t._hashMask):W=t._bufferBase[d]&255^(t._bufferBase[d+1]&255)<<8,m=t._hash[t.kFixHashSize+W]||0,t.HASH_ARRAY&&(g=t._hash[L]||0,S=t._hash[1024+B]||0,t._hash[L]=t._pos,t._hash[1024+B]=t._pos,g>N&&t._bufferBase[t._bufferOffset+g]==t._bufferBase[d]&&(o[j++]=Z=2,o[j++]=t._pos-g-1),S>N&&t._bufferBase[t._bufferOffset+S]==t._bufferBase[d]&&(S==g&&(j-=2),o[j++]=Z=3,o[j++]=t._pos-S-1,g=S),j!=0&&g==m&&(j-=2,Z=1)),t._hash[t.kFixHashSize+W]=t._pos,it=(t._cyclicBufferPos<<1)+1,kt=t._cyclicBufferPos<<1,H=rt=t.kNumHashDirectBytes,t.kNumHashDirectBytes!=0&&m>N&&t._bufferBase[t._bufferOffset+m+t.kNumHashDirectBytes]!=t._bufferBase[d+t.kNumHashDirectBytes]&&(o[j++]=Z=t.kNumHashDirectBytes,o[j++]=t._pos-m-1),c=t._cutValue;;){if(m<=N||c--==0){t._son[it]=t._son[kt]=0;break}if(D=t._pos-m,x=(D<=t._cyclicBufferPos?t._cyclicBufferPos-D:t._cyclicBufferPos-D+t._cyclicBufferSize)<<1,bt=t._bufferOffset+m,F=H<rt?H:rt,t._bufferBase[bt+F]==t._bufferBase[d+F]){for(;++F!=P&&t._bufferBase[bt+F]==t._bufferBase[d+F];);if(Z<F&&(o[j++]=Z=F,o[j++]=D-1,F==P)){t._son[kt]=t._son[x],t._son[it]=t._son[x+1];break}}(t._bufferBase[bt+F]&255)<(t._bufferBase[d+F]&255)?(t._son[kt]=m,kt=x+1,m=t._son[kt],rt=F):(t._son[it]=m,it=x,m=t._son[it],H=F)}return At(t),j}function Kr(t){t._bufferOffset=0,t._pos=0,t._streamPos=0,t._streamEndWasReached=0,He(t),t._cyclicBufferPos=0,te(t,-1)}function At(t){var o;++t._cyclicBufferPos>=t._cyclicBufferSize&&(t._cyclicBufferPos=0),Fe(t),t._pos==1073741823&&(o=t._pos-t._cyclicBufferSize,Ne(t._son,t._cyclicBufferSize*2,o),Ne(t._hash,t._hashSizeSum,o),te(t,o))}function Ne(t,o,c){var d,m;for(d=0;d<o;++d)m=t[d]||0,m<=c?m=0:m-=c,t[d]=m}function ee(t,o){t.HASH_ARRAY=o>2,t.HASH_ARRAY?(t.kNumHashDirectBytes=0,t.kMinMatchCheck=4,t.kFixHashSize=66560):(t.kNumHashDirectBytes=2,t.kMinMatchCheck=3,t.kFixHashSize=0)}function Zr(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,rt,P,N,Z,j;do{if(t._pos+t._matchMaxLen<=t._streamPos)H=t._matchMaxLen;else if(H=t._streamPos-t._pos,H<t.kMinMatchCheck){At(t);continue}for(rt=t._pos>t._cyclicBufferSize?t._pos-t._cyclicBufferSize:0,d=t._bufferOffset+t._pos,t.HASH_ARRAY?(j=qt[t._bufferBase[d]&255]^t._bufferBase[d+1]&255,x=j&1023,t._hash[x]=t._pos,j^=(t._bufferBase[d+2]&255)<<8,D=j&65535,t._hash[1024+D]=t._pos,L=(j^qt[t._bufferBase[d+3]&255]<<5)&t._hashMask):L=t._bufferBase[d]&255^(t._bufferBase[d+1]&255)<<8,m=t._hash[t.kFixHashSize+L],t._hash[t.kFixHashSize+L]=t._pos,N=(t._cyclicBufferPos<<1)+1,Z=t._cyclicBufferPos<<1,W=F=t.kNumHashDirectBytes,c=t._cutValue;;){if(m<=rt||c--==0){t._son[N]=t._son[Z]=0;break}if(S=t._pos-m,g=(S<=t._cyclicBufferPos?t._cyclicBufferPos-S:t._cyclicBufferPos-S+t._cyclicBufferSize)<<1,P=t._bufferOffset+m,B=W<F?W:F,t._bufferBase[P+B]==t._bufferBase[d+B]){for(;++B!=H&&t._bufferBase[P+B]==t._bufferBase[d+B];);if(B==H){t._son[Z]=t._son[g],t._son[N]=t._son[g+1];break}}(t._bufferBase[P+B]&255)<(t._bufferBase[d+B]&255)?(t._son[Z]=m,Z=g+1,m=t._son[Z],F=B):(t._son[N]=m,N=g,m=t._son[N],W=B)}At(t)}while(--o!=0)}function re(t){return t-=2,t<4?t:3}function pt(t){return t<4?0:t<10?t-3:t-6}function je(t,o){return t.encoder=o,t.decoder=null,t.alive=1,t}function mr(t){if(!t.alive)throw new Error("bad state");if(t.encoder)fr(t);else throw new Error("No decoding");return t.alive}function fr(t){we(t.encoder,t.encoder.processedInSize,t.encoder.processedOutSize,t.encoder.finished),t.inBytesProcessed=t.encoder.processedInSize[0],t.encoder.finished[0]&&(kc(t.encoder),t.alive=0)}var Ot=function(){var t,o,c,d=2,m=[0,1];for(c=2;c<22;++c)for(o=1<<(c>>1)-1,t=0;t<o;++t,++d)m[d]=c<<24>>24;return m}();function ct(t,o){var c,d,m,g;t._optimumEndIndex=o,m=t._optimum[o].PosPrev,d=t._optimum[o].BackPrev;do t._optimum[o].Prev1IsChar&&(Ss(t._optimum[m]),t._optimum[m].PosPrev=m-1,t._optimum[o].Prev2&&(t._optimum[m-1].Prev1IsChar=0,t._optimum[m-1].PosPrev=t._optimum[o].PosPrev2,t._optimum[m-1].BackPrev=t._optimum[o].BackPrev2)),g=m,c=d,d=t._optimum[g].BackPrev,m=t._optimum[g].PosPrev,t._optimum[g].BackPrev=c,t._optimum[g].PosPrev=o,o=g;while(o>0);return t.backRes=t._optimum[0].BackPrev,t._optimumCurrentIndex=t._optimum[0].PosPrev,t._optimumCurrentIndex}function $t(t){t._state=0,t._previousByte=0;for(var o=0;o<4;++o)t._repDistances[o]=0}function we(t,o,c,d){var m,g,S,x,D,L,B,W,F,H,rt,P,N,Z,j;if(o[0]=u,c[0]=u,d[0]=1,t._inStream&&(t._matchFinder._stream=t._inStream,Kr(t._matchFinder),t._needReleaseMFStream=1,t._inStream=null),!t._finished){if(t._finished=1,Z=t.nowPos64,b(t.nowPos64,u)){if(!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}Yr(t),N=T(t.nowPos64)&t._posStateMask,V(t._rangeEncoder,t._isMatch,(t._state<<4)+N,0),t._state=pt(t._state),S=tt(t._matchFinder,-t._additionalOffset),Ts(be(t._literalEncoder,T(t.nowPos64),t._previousByte),t._rangeEncoder,S),t._previousByte=S,--t._additionalOffset,t.nowPos64=f(t.nowPos64,h)}if(!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}for(;;){if(B=ye(t,T(t.nowPos64)),H=t.backRes,N=T(t.nowPos64)&t._posStateMask,g=(t._state<<4)+N,B==1&&H==-1)V(t._rangeEncoder,t._isMatch,g,0),S=tt(t._matchFinder,-t._additionalOffset),j=be(t._literalEncoder,T(t.nowPos64),t._previousByte),t._state<7?Ts(j,t._rangeEncoder,S):(F=tt(t._matchFinder,-t._repDistances[0]-1-t._additionalOffset),Rc(j,t._rangeEncoder,F,S)),t._previousByte=S,t._state=pt(t._state);else{if(V(t._rangeEncoder,t._isMatch,g,1),H<4){if(V(t._rangeEncoder,t._isRep,t._state,1),H?(V(t._rangeEncoder,t._isRepG0,t._state,1),H==1?V(t._rangeEncoder,t._isRepG1,t._state,0):(V(t._rangeEncoder,t._isRepG1,t._state,1),V(t._rangeEncoder,t._isRepG2,t._state,H-2))):(V(t._rangeEncoder,t._isRepG0,t._state,0),B==1?V(t._rangeEncoder,t._isRep0Long,g,0):V(t._rangeEncoder,t._isRep0Long,g,1)),B==1?t._state=t._state<7?9:11:(en(t._repMatchLenEncoder,t._rangeEncoder,B-2,N),t._state=t._state<7?8:11),x=t._repDistances[H],H!=0){for(L=H;L>=1;--L)t._repDistances[L]=t._repDistances[L-1];t._repDistances[0]=x}}else{for(V(t._rangeEncoder,t._isRep,t._state,0),t._state=t._state<7?7:10,en(t._lenEncoder,t._rangeEncoder,B-2,N),H-=4,P=tn(H),W=re(B),$e(t._posSlotEncoder[W],t._rangeEncoder,P),P>=4&&(D=(P>>1)-1,m=(2|P&1)<<D,rt=H-m,P<14?zc(t._posEncoders,m-P-1,t._rangeEncoder,D,rt):(Ls(t._rangeEncoder,rt>>4,D-4),Ps(t._posAlignEncoder,t._rangeEncoder,rt&15),++t._alignPriceCount)),x=H,L=3;L>=1;--L)t._repDistances[L]=t._repDistances[L-1];t._repDistances[0]=x,++t._matchPriceCount}t._previousByte=tt(t._matchFinder,B-1-t._additionalOffset)}if(t._additionalOffset-=B,t.nowPos64=f(t.nowPos64,k(B)),!t._additionalOffset){if(t._matchPriceCount>=128&&Q(t),t._alignPriceCount>=16&&A(t),o[0]=t.nowPos64,c[0]=Hc(t._rangeEncoder),!Ut(t._matchFinder)){O(t,T(t.nowPos64));return}if(l(J(t.nowPos64,Z),[4096,0])>=0){t._finished=0,d[0]=0;return}}}}}function z(t){var o,c;t._matchFinder||(o={},c=4,t._matchFinderType||(c=2),ee(o,c),t._matchFinder=o),Cc(t._literalEncoder,t._numLiteralPosStateBits,t._numLiteralContextBits),!(t._dictionarySize==t._dictionarySizePrev&&t._numFastBytesPrev==t._numFastBytes)&&(Ie(t._matchFinder,t._dictionarySize,4096,t._numFastBytes,274),t._dictionarySizePrev=t._dictionarySize,t._numFastBytesPrev=t._numFastBytes)}function q(t){var o;for(t._repDistances=p(4),t._optimum=[],t._rangeEncoder={},t._isMatch=p(192),t._isRep=p(12),t._isRepG0=p(12),t._isRepG1=p(12),t._isRepG2=p(12),t._isRep0Long=p(192),t._posSlotEncoder=[],t._posEncoders=p(114),t._posAlignEncoder=qe({},4),t._lenEncoder=bs({}),t._repMatchLenEncoder=bs({}),t._literalEncoder={},t._matchDistances=[],t._posSlotPrices=[],t._distancesPrices=[],t._alignPrices=p(16),t.reps=p(4),t.repLens=p(4),t.processedInSize=[u],t.processedOutSize=[u],t.finished=[0],t.properties=p(5),t.tempPrices=p(128),t._longestMatchLength=0,t._matchFinderType=1,t._numDistancePairs=0,t._numFastBytesPrev=-1,t.backRes=0,o=0;o<4096;++o)t._optimum[o]={};for(o=0;o<4;++o)t._posSlotEncoder[o]=qe({},6);return t}function A(t){for(var o=0;o<16;++o)t._alignPrices[o]=Oc(t._posAlignEncoder,o);t._alignPriceCount=0}function Q(t){var o,c,d,m,g,S,x,D;for(m=4;m<128;++m)S=tn(m),d=(S>>1)-1,o=(2|S&1)<<d,t.tempPrices[m]=Fc(t._posEncoders,o-S-1,d,m-o);for(g=0;g<4;++g){for(c=t._posSlotEncoder[g],x=g<<6,S=0;S<t._distTableSize;++S)t._posSlotPrices[x+S]=_r(c,S);for(S=14;S<t._distTableSize;++S)t._posSlotPrices[x+S]+=(S>>1)-1-4<<6;for(D=g*128,m=0;m<4;++m)t._distancesPrices[D+m]=t._posSlotPrices[x+m];for(;m<128;++m)t._distancesPrices[D+m]=t._posSlotPrices[x+tn(m)]+t.tempPrices[m]}t._matchPriceCount=0}function O(t,o){_s(t),Lc(t,o&t._posStateMask);for(var c=0;c<5;++c)rn(t._rangeEncoder)}function ye(t,o){var c,d,m,g,S,x,D,L,B,W,F,H,rt,P,N,Z,j,bt,it,kt,Ct,dt,ke,wr,Tt,Mt,Rt,ht,zt,Y,E,Jt,se,at,ot,Cs,St,Ge,ie,Ft,Te,Xe,U,nt,Se,Ms,Rs,Ds,As,Os;if(t._optimumEndIndex!=t._optimumCurrentIndex)return rt=t._optimum[t._optimumCurrentIndex].PosPrev-t._optimumCurrentIndex,t.backRes=t._optimum[t._optimumCurrentIndex].BackPrev,t._optimumCurrentIndex=t._optimum[t._optimumCurrentIndex].PosPrev,rt;if(t._optimumCurrentIndex=t._optimumEndIndex=0,t._longestMatchWasFound?(H=t._longestMatchLength,t._longestMatchWasFound=0):H=Yr(t),Rt=t._numDistancePairs,Tt=Ut(t._matchFinder)+1,Tt<2)return t.backRes=-1,1;for(Tt>273&&(Tt=273),Ft=0,B=0;B<4;++B)t.reps[B]=t._repDistances[B],t.repLens[B]=xt(t._matchFinder,-1,t.reps[B],273),t.repLens[B]>t.repLens[Ft]&&(Ft=B);if(t.repLens[Ft]>=t._numFastBytes)return t.backRes=Ft,rt=t.repLens[Ft],Ue(t,rt-1),rt;if(H>=t._numFastBytes)return t.backRes=t._matchDistances[Rt-1]+4,Ue(t,H-1),H;if(D=tt(t._matchFinder,-1),j=tt(t._matchFinder,-t._repDistances[0]-1-1),H<2&&D!=j&&t.repLens[Ft]<2)return t.backRes=-1,1;if(t._optimum[0].State=t._state,at=o&t._posStateMask,t._optimum[1].Price=$[t._isMatch[(t._state<<4)+at]>>>2]+vr(be(t._literalEncoder,o,t._previousByte),t._state>=7,j,D),Ss(t._optimum[1]),bt=$[2048-t._isMatch[(t._state<<4)+at]>>>2],ie=bt+$[2048-t._isRep[t._state]>>>2],j==D&&(Te=ie+yt(t,t._state,at),Te<t._optimum[1].Price&&(t._optimum[1].Price=Te,Ac(t._optimum[1]))),F=H>=t.repLens[Ft]?H:t.repLens[Ft],F<2)return t.backRes=t._optimum[1].BackPrev,1;t._optimum[1].PosPrev=0,t._optimum[0].Backs0=t.reps[0],t._optimum[0].Backs1=t.reps[1],t._optimum[0].Backs2=t.reps[2],t._optimum[0].Backs3=t.reps[3],W=F;do t._optimum[W--].Price=268435455;while(W>=2);for(B=0;B<4;++B)if(Ge=t.repLens[B],!(Ge<2)){Cs=ie+vt(t,B,t._state,at);do g=Cs+ne(t._repMatchLenEncoder,Ge-2,at),E=t._optimum[Ge],g<E.Price&&(E.Price=g,E.PosPrev=0,E.BackPrev=B,E.Prev1IsChar=0);while(--Ge>=2)}if(wr=bt+$[t._isRep[t._state]>>>2],W=t.repLens[0]>=2?t.repLens[0]+1:2,W<=H){for(ht=0;W>t._matchDistances[ht];)ht+=2;for(;L=t._matchDistances[ht+1],g=wr+G(t,L,W,at),E=t._optimum[W],g<E.Price&&(E.Price=g,E.PosPrev=0,E.BackPrev=L+4,E.Prev1IsChar=0),!(W==t._matchDistances[ht]&&(ht+=2,ht==Rt));++W);}for(c=0;;){if(++c,c==F)return ct(t,c);if(it=Yr(t),Rt=t._numDistancePairs,it>=t._numFastBytes)return t._longestMatchLength=it,t._longestMatchWasFound=1,ct(t,c);if(++o,se=t._optimum[c].PosPrev,t._optimum[c].Prev1IsChar?(--se,t._optimum[c].Prev2?(U=t._optimum[t._optimum[c].PosPrev2].State,t._optimum[c].BackPrev2<4?U=U<7?8:11:U=U<7?7:10):U=t._optimum[se].State,U=pt(U)):U=t._optimum[se].State,se==c-1?t._optimum[c].BackPrev?U=pt(U):U=U<7?9:11:(t._optimum[c].Prev1IsChar&&t._optimum[c].Prev2?(se=t._optimum[c].PosPrev2,Jt=t._optimum[c].BackPrev2,U=U<7?8:11):(Jt=t._optimum[c].BackPrev,Jt<4?U=U<7?8:11:U=U<7?7:10),Y=t._optimum[se],Jt<4?Jt?Jt==1?(t.reps[0]=Y.Backs1,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs2,t.reps[3]=Y.Backs3):Jt==2?(t.reps[0]=Y.Backs2,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs3):(t.reps[0]=Y.Backs3,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs2):(t.reps[0]=Y.Backs0,t.reps[1]=Y.Backs1,t.reps[2]=Y.Backs2,t.reps[3]=Y.Backs3):(t.reps[0]=Jt-4,t.reps[1]=Y.Backs0,t.reps[2]=Y.Backs1,t.reps[3]=Y.Backs2)),t._optimum[c].State=U,t._optimum[c].Backs0=t.reps[0],t._optimum[c].Backs1=t.reps[1],t._optimum[c].Backs2=t.reps[2],t._optimum[c].Backs3=t.reps[3],x=t._optimum[c].Price,D=tt(t._matchFinder,-1),j=tt(t._matchFinder,-t.reps[0]-1-1),at=o&t._posStateMask,d=x+$[t._isMatch[(U<<4)+at]>>>2]+vr(be(t._literalEncoder,o,tt(t._matchFinder,-2)),U>=7,j,D),dt=t._optimum[c+1],kt=0,d<dt.Price&&(dt.Price=d,dt.PosPrev=c,dt.BackPrev=-1,dt.Prev1IsChar=0,kt=1),bt=x+$[2048-t._isMatch[(U<<4)+at]>>>2],ie=bt+$[2048-t._isRep[U]>>>2],j==D&&!(dt.PosPrev<c&&!dt.BackPrev)&&(Te=ie+($[t._isRepG0[U]>>>2]+$[t._isRep0Long[(U<<4)+at]>>>2]),Te<=dt.Price&&(dt.Price=Te,dt.PosPrev=c,dt.BackPrev=0,dt.Prev1IsChar=0,kt=1)),Mt=Ut(t._matchFinder)+1,Mt=4095-c<Mt?4095-c:Mt,Tt=Mt,!(Tt<2)){if(Tt>t._numFastBytes&&(Tt=t._numFastBytes),!kt&&j!=D&&(Se=Math.min(Mt-1,t._numFastBytes),N=xt(t._matchFinder,0,t.reps[0],Se),N>=2)){for(nt=pt(U),ot=o+1&t._posStateMask,ke=d+$[2048-t._isMatch[(nt<<4)+ot]>>>2]+$[2048-t._isRep[nt]>>>2],zt=c+1+N;F<zt;)t._optimum[++F].Price=268435455;g=ke+(Ms=ne(t._repMatchLenEncoder,N-2,ot),Ms+vt(t,0,nt,ot)),E=t._optimum[zt],g<E.Price&&(E.Price=g,E.PosPrev=c+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=0)}for(Xe=2,St=0;St<4;++St)if(P=xt(t._matchFinder,-1,t.reps[St],Tt),!(P<2)){Z=P;do{for(;F<c+P;)t._optimum[++F].Price=268435455;g=ie+(Rs=ne(t._repMatchLenEncoder,P-2,at),Rs+vt(t,St,U,at)),E=t._optimum[c+P],g<E.Price&&(E.Price=g,E.PosPrev=c,E.BackPrev=St,E.Prev1IsChar=0)}while(--P>=2);if(P=Z,St||(Xe=P+1),P<Mt&&(Se=Math.min(Mt-1-P,t._numFastBytes),N=xt(t._matchFinder,P,t.reps[St],Se),N>=2)){for(nt=U<7?8:11,ot=o+P&t._posStateMask,m=ie+(Ds=ne(t._repMatchLenEncoder,P-2,at),Ds+vt(t,St,U,at))+$[t._isMatch[(nt<<4)+ot]>>>2]+vr(be(t._literalEncoder,o+P,tt(t._matchFinder,P-1-1)),1,tt(t._matchFinder,P-1-(t.reps[St]+1)),tt(t._matchFinder,P-1)),nt=pt(nt),ot=o+P+1&t._posStateMask,Ct=m+$[2048-t._isMatch[(nt<<4)+ot]>>>2],ke=Ct+$[2048-t._isRep[nt]>>>2],zt=P+1+N;F<c+zt;)t._optimum[++F].Price=268435455;g=ke+(As=ne(t._repMatchLenEncoder,N-2,ot),As+vt(t,0,nt,ot)),E=t._optimum[c+zt],g<E.Price&&(E.Price=g,E.PosPrev=c+P+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=1,E.PosPrev2=c,E.BackPrev2=St)}}if(it>Tt){for(it=Tt,Rt=0;it>t._matchDistances[Rt];Rt+=2);t._matchDistances[Rt]=it,Rt+=2}if(it>=Xe){for(wr=bt+$[t._isRep[U]>>>2];F<c+it;)t._optimum[++F].Price=268435455;for(ht=0;Xe>t._matchDistances[ht];)ht+=2;for(P=Xe;;++P)if(S=t._matchDistances[ht+1],g=wr+G(t,S,P,at),E=t._optimum[c+P],g<E.Price&&(E.Price=g,E.PosPrev=c,E.BackPrev=S+4,E.Prev1IsChar=0),P==t._matchDistances[ht]){if(P<Mt&&(Se=Math.min(Mt-1-P,t._numFastBytes),N=xt(t._matchFinder,P,S,Se),N>=2)){for(nt=U<7?7:10,ot=o+P&t._posStateMask,m=g+$[t._isMatch[(nt<<4)+ot]>>>2]+vr(be(t._literalEncoder,o+P,tt(t._matchFinder,P-1-1)),1,tt(t._matchFinder,P-(S+1)-1),tt(t._matchFinder,P-1)),nt=pt(nt),ot=o+P+1&t._posStateMask,Ct=m+$[2048-t._isMatch[(nt<<4)+ot]>>>2],ke=Ct+$[2048-t._isRep[nt]>>>2],zt=P+1+N;F<c+zt;)t._optimum[++F].Price=268435455;g=ke+(Os=ne(t._repMatchLenEncoder,N-2,ot),Os+vt(t,0,nt,ot)),E=t._optimum[c+zt],g<E.Price&&(E.Price=g,E.PosPrev=c+P+1,E.BackPrev=0,E.Prev1IsChar=1,E.Prev2=1,E.PosPrev2=c,E.BackPrev2=S+4)}if(ht+=2,ht==Rt)break}}}}}function G(t,o,c,d){var m,g=re(c);return o<128?m=t._distancesPrices[g*128+o]:m=t._posSlotPrices[(g<<6)+Ec(o)]+t._alignPrices[o&15],m+ne(t._lenEncoder,c-2,d)}function vt(t,o,c,d){var m;return o?(m=$[2048-t._isRepG0[c]>>>2],o==1?m+=$[t._isRepG1[c]>>>2]:(m+=$[2048-t._isRepG1[c]>>>2],m+=Je(t._isRepG2[c],o-2))):(m=$[t._isRepG0[c]>>>2],m+=$[2048-t._isRep0Long[(c<<4)+d]>>>2]),m}function yt(t,o,c){return $[t._isRepG0[o]>>>2]+$[t._isRep0Long[(o<<4)+c]>>>2]}function gr(t){$t(t),Ic(t._rangeEncoder),ut(t._isMatch),ut(t._isRep0Long),ut(t._isRep),ut(t._isRepG0),ut(t._isRepG1),ut(t._isRepG2),ut(t._posEncoders),Mc(t._literalEncoder);for(var o=0;o<4;++o)ut(t._posSlotEncoder[o].Models);ws(t._lenEncoder,1<<t._posStateBits),ws(t._repMatchLenEncoder,1<<t._posStateBits),ut(t._posAlignEncoder.Models),t._longestMatchWasFound=0,t._optimumEndIndex=0,t._optimumCurrentIndex=0,t._additionalOffset=0}function Ue(t,o){o>0&&(Zr(t._matchFinder,o),t._additionalOffset+=o)}function Yr(t){var o=0;return t._numDistancePairs=dr(t._matchFinder,t._matchDistances),t._numDistancePairs>0&&(o=t._matchDistances[t._numDistancePairs-2],o==t._numFastBytes&&(o+=xt(t._matchFinder,o-1,t._matchDistances[t._numDistancePairs-1],273-o))),++t._additionalOffset,o}function _s(t){t._matchFinder&&t._needReleaseMFStream&&(t._matchFinder._stream=null,t._needReleaseMFStream=0)}function kc(t){_s(t),t._rangeEncoder.Stream=null}function Tc(t,o){t._dictionarySize=o;for(var c=0;o>1<<c;++c);t._distTableSize=c*2}function Sc(t,o){var c=t._matchFinderType;t._matchFinderType=o,t._matchFinder&&c!=t._matchFinderType&&(t._dictionarySizePrev=-1,t._matchFinder=null)}function Pc(t,o){t.properties[0]=(t._posStateBits*5+t._numLiteralPosStateBits)*9+t._numLiteralContextBits<<24>>24;for(var c=0;c<4;++c)t.properties[1+c]=t._dictionarySize>>8*c<<24>>24;lr(o,t.properties,0,5)}function Lc(t,o){if(t._writeEndMark){V(t._rangeEncoder,t._isMatch,(t._state<<4)+o,1),V(t._rangeEncoder,t._isRep,t._state,0),t._state=t._state<7?7:10,en(t._lenEncoder,t._rangeEncoder,0,o);var c=re(2);$e(t._posSlotEncoder[c],t._rangeEncoder,63),Ls(t._rangeEncoder,67108863,26),Ps(t._posAlignEncoder,t._rangeEncoder,15)}}function tn(t){return t<2048?Ot[t]:t<2097152?Ot[t>>10]+20:Ot[t>>20]+40}function Ec(t){return t<131072?Ot[t>>6]+12:t<134217728?Ot[t>>16]+32:Ot[t>>26]+52}function Bc(t,o,c,d){c<8?(V(o,t._choice,0,0),$e(t._lowCoder[d],o,c)):(c-=8,V(o,t._choice,0,1),c<8?(V(o,t._choice,1,0),$e(t._midCoder[d],o,c)):(V(o,t._choice,1,1),$e(t._highCoder,o,c-8)))}function xc(t){t._choice=p(2),t._lowCoder=p(16),t._midCoder=p(16),t._highCoder=qe({},8);for(var o=0;o<16;++o)t._lowCoder[o]=qe({},3),t._midCoder[o]=qe({},3);return t}function ws(t,o){ut(t._choice);for(var c=0;c<o;++c)ut(t._lowCoder[c].Models),ut(t._midCoder[c].Models);ut(t._highCoder.Models)}function ys(t,o,c,d,m){var g,S,x,D,L;for(g=$[t._choice[0]>>>2],S=$[2048-t._choice[0]>>>2],x=S+$[t._choice[1]>>>2],D=S+$[2048-t._choice[1]>>>2],L=0,L=0;L<8;++L){if(L>=c)return;d[m+L]=g+_r(t._lowCoder[o],L)}for(;L<16;++L){if(L>=c)return;d[m+L]=x+_r(t._midCoder[o],L-8)}for(;L<c;++L)d[m+L]=D+_r(t._highCoder,L-8-8)}function en(t,o,c,d){Bc(t,o,c,d),--t._counters[d]==0&&(ys(t,d,t._tableSize,t._prices,d*272),t._counters[d]=t._tableSize)}function bs(t){return xc(t),t._prices=[],t._counters=[],t}function ne(t,o,c){return t._prices[c*272+o]}function ks(t,o){for(var c=0;c<o;++c)ys(t,c,t._tableSize,t._prices,c*272),t._counters[c]=t._tableSize}function Cc(t,o,c){var d,m;if(!(t.m_Coders!=null&&t.m_NumPrevBits==c&&t.m_NumPosBits==o))for(t.m_NumPosBits=o,t.m_PosMask=(1<<o)-1,t.m_NumPrevBits=c,m=1<<t.m_NumPrevBits+t.m_NumPosBits,t.m_Coders=p(m),d=0;d<m;++d)t.m_Coders[d]=Dc({})}function be(t,o,c){return t.m_Coders[((o&t.m_PosMask)<<t.m_NumPrevBits)+((c&255)>>>8-t.m_NumPrevBits)]}function Mc(t){var o,c=1<<t.m_NumPrevBits+t.m_NumPosBits;for(o=0;o<c;++o)ut(t.m_Coders[o].m_Encoders)}function Ts(t,o,c){var d,m,g=1;for(m=7;m>=0;--m)d=c>>m&1,V(o,t.m_Encoders,g,d),g=g<<1|d}function Rc(t,o,c,d){var m,g,S,x,D=1,L=1;for(g=7;g>=0;--g)m=d>>g&1,x=L,D&&(S=c>>g&1,x+=1+S<<8,D=S==m),V(o,t.m_Encoders,x,m),L=L<<1|m}function Dc(t){return t.m_Encoders=p(768),t}function vr(t,o,c,d){var m,g=1,S=7,x,D=0;if(o){for(;S>=0;--S)if(x=c>>S&1,m=d>>S&1,D+=Je(t.m_Encoders[(1+x<<8)+g],m),g=g<<1|m,x!=m){--S;break}}for(;S>=0;--S)m=d>>S&1,D+=Je(t.m_Encoders[g],m),g=g<<1|m;return D}function Ss(t){t.BackPrev=-1,t.Prev1IsChar=0}function Ac(t){t.BackPrev=0,t.Prev1IsChar=0}function qe(t,o){return t.NumBitLevels=o,t.Models=p(1<<o),t}function $e(t,o,c){var d,m,g=1;for(m=t.NumBitLevels;m!=0;)--m,d=c>>>m&1,V(o,t.Models,g,d),g=g<<1|d}function _r(t,o){var c,d,m=1,g=0;for(d=t.NumBitLevels;d!=0;)--d,c=o>>>d&1,g+=Je(t.Models[m],c),m=(m<<1)+c;return g}function Ps(t,o,c){var d,m,g=1;for(m=0;m<t.NumBitLevels;++m)d=c&1,V(o,t.Models,g,d),g=g<<1|d,c>>=1}function Oc(t,o){var c,d,m=1,g=0;for(d=t.NumBitLevels;d!=0;--d)c=o&1,o>>>=1,g+=Je(t.Models[m],c),m=m<<1|c;return g}function zc(t,o,c,d,m){var g,S,x=1;for(S=0;S<d;++S)g=m&1,V(c,t,o+x,g),x=x<<1|g,m>>=1}function Fc(t,o,c,d){var m,g,S=1,x=0;for(g=c;g!=0;--g)m=d&1,d>>>=1,x+=$[((t[o+S]-m^-m)&2047)>>>2],S=S<<1|m;return x}function ut(t){for(var o=t.length-1;o>=0;--o)t[o]=1024}var $=function(){var t,o,c,d,m=[];for(o=8;o>=0;--o)for(d=1<<9-o-1,t=1<<9-o,c=d;c<t;++c)m[c]=(o<<6)+(t-c<<6>>>9-o-1);return m}();function V(t,o,c,d){var m,g=o[c];m=(t.Range>>>11)*g,d?(t.Low=f(t.Low,w(k(m),[4294967295,0])),t.Range-=m,o[c]=g-(g>>>5)<<16>>16):(t.Range=m,o[c]=g+(2048-g>>>5)<<16>>16),t.Range&-16777216||(t.Range<<=8,rn(t))}function Ls(t,o,c){for(var d=c-1;d>=0;--d)t.Range>>>=1,(o>>>d&1)==1&&(t.Low=f(t.Low,k(t.Range))),t.Range&-16777216||(t.Range<<=8,rn(t))}function Hc(t){return f(f(k(t._cacheSize),t._position),[4,0])}function Ic(t){t._position=u,t.Low=u,t.Range=-1,t._cacheSize=1,t._cache=0}function rn(t){var o,c=T(K(t.Low,32));if(c!=0||l(t.Low,[4278190080,0])<0){t._position=f(t._position,k(t._cacheSize)),o=t._cache;do ze(t.Stream,o+c),o=255;while(--t._cacheSize!=0);t._cache=T(t.Low)>>>24}++t._cacheSize,t.Low=M(w(t.Low,[16777215,0]),8)}function Je(t,o){return $[((t-o^-o)&2047)>>>2]}function Es(t){var o,c=[],d,m=0,g,S=t.length;if(typeof t=="object")return t;for(jt(t,0,S,c,0),g=0;g<S;++g)o=c[g],o>=1&&o<=127?++m:!o||o>=128&&o<=2047?m+=2:m+=3;for(d=[],m=0,g=0;g<S;++g)o=c[g],o>=1&&o<=127?d[m++]=o<<24>>24:!o||o>=128&&o<=2047?(d[m++]=(192|o>>6&31)<<24>>24,d[m++]=(128|o&63)<<24>>24):(d[m++]=(224|o>>12&15)<<24>>24,d[m++]=(128|o>>6&63)<<24>>24,d[m++]=(128|o&63)<<24>>24);return d}function Bs(t){return t[1]+t[0]}function Nc(t,o,c,d){var m={},g,S,x=typeof c>"u"&&typeof d>"u";if(typeof c!="function"&&(S=c,c=d=0),d=d||function(L){if(!(typeof S>"u"))return _(L,S)},c=c||function(L,B){if(!(typeof S>"u"))return postMessage({action:r,cbn:S,result:L,error:B})},x){for(m.c=Yt({},Es(t),xs(o));mr(m.c.chunker););return ge(m.c.output)}try{m.c=Yt({},Es(t),xs(o)),d(0)}catch(L){return c(null,L)}function D(){try{for(var L,B=new Date().getTime();mr(m.c.chunker);)if(g=Bs(m.c.chunker.inBytesProcessed)/Bs(m.c.length_0),new Date().getTime()-B>200)return d(g),n(D,0),0;d(1),L=ge(m.c.output),n(c.bind(null,L),0)}catch(W){c(null,W)}}n(D,0)}var xs=function(){var t=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(o){return t[o-1]||t[6]}}();return typeof onmessage<"u"&&(typeof window>"u"||typeof window.document>"u")&&function(){onmessage=function(t){t&&t.data&&t.data.action==r&&Cr.compress(t.data.data,t.data.mode,t.data.cbn)}}(),{compress:Nc}}();const ai=async r=>await ci(r);let Ve=null;const oi=async r=>(r=r||'"./lzma_worker-min.js"',Ve||(await ai(r)?Ve=ii(r):(console.error("lzma\u65E0\u6CD5\u627E\u5230"+r+": \u65E0\u6CD5\u542F\u52A8worker\u6A21\u5F0F\uFF0C\u5C06\u542F\u7528\u6D4F\u89C8\u5668\u8BA1\u7B97\u6A21\u5F0F\uFF0C\u6027\u80FD\u53D7\u5F71\u54CD"),Ve=Cr),Ve)),ci=r=>new Promise((e,n)=>{const s=new XMLHttpRequest;s.open("get",r,!0),s.addEventListener("error",i=>{e(!1)}),s.addEventListener("load",i=>{s.status===200&&e(!0),e(!1)}),s.send()}),ui=new pn(5);let kn="";const hi=r=>{kn=r};let Tn=null;const Sn=r=>{const e=typeof r=="string"?r:JSON.stringify(r);let n=location.pathname;n=n.replace(/[^\/\/.]+\.(html|html)$/,"").replace("//","/");const s=kn||location.origin+n+"static/lzma_worker.js";return console.log("lzma_worker",s),new Promise(async i=>{let a=Date.now();window.requestIdleCallback(async()=>{Tn=await oi(s),Tn.compress(e,5,(u,h)=>{if(!u)throw Error("static/lzma_worker.js \u65E0\u6CD5\u52A0\u8F7D\uFF0C\u8BF7\u68C0\u67E5\u8BE5\u6587\u4EF6");console.log("compress finish",Date.now()-a);const _=[...u],p=new Int8Array(_.length);for(let f=0;f<_.length;f++)p[f]=_[f];console.log("compress success",Date.now()-a),i(p)})})})},Ke=async(r,e,n)=>new Promise((s,i)=>{const a=new XMLHttpRequest;a.open("POST",r,!0),n?(a.setRequestHeader("xw-body-encoding","v1"),ui.addTask(()=>new Promise((u,h)=>{Sn(e).then(_=>{a.send(_.buffer)}).finally(()=>{u()})}))):a.send(JSON.stringify(e)),a.onreadystatechange=()=>{},a.addEventListener("readystatechange",u=>{a.readyState===4&&a.status===200?s(void 0):a.status===500&&i(a.statusText)}),a.addEventListener("error",u=>{console.error("\u957F\u5EA6",JSON.stringify(e).length),i(u)})}),li=(r,e,n)=>{window.navigator.sendBeacon!==void 0?n?Sn(e).then(s=>{window.navigator.sendBeacon(r,s.buffer)}):window.navigator.sendBeacon(r,JSON.stringify(e)):Ke(r,e,n)};class pi{constructor(){y(this,"logs",[])}get length(){return this.logs.length}async init(){}async push(e){try{this.logs.push(e)}catch(n){console.error(n)}}async compulsionSave(){}clearArray(){this.logs.length=0}async shift(e=1){let n=[[...this.logs]];return this.clearArray(),n}}async function di(r){const e=new pi;return await e.init(),e}var mi=typeof global=="object"&&global&&global.Object===Object&&global;const fi=mi;var gi=typeof self=="object"&&self&&self.Object===Object&&self,vi=fi||gi||Function("return this")();const Ze=vi;var _i=Ze.Symbol;const Ht=_i;var Pn=Object.prototype,wi=Pn.hasOwnProperty,yi=Pn.toString,Be=Ht?Ht.toStringTag:void 0;function bi(r){var e=wi.call(r,Be),n=r[Be];try{r[Be]=void 0;var s=!0}catch{}var i=yi.call(r);return s&&(e?r[Be]=n:delete r[Be]),i}var ki=Object.prototype,Ti=ki.toString;function Si(r){return Ti.call(r)}var Pi="[object Null]",Li="[object Undefined]",Ln=Ht?Ht.toStringTag:void 0;function Mr(r){return r==null?r===void 0?Li:Pi:Ln&&Ln in Object(r)?bi(r):Si(r)}function Rr(r){return r!=null&&typeof r=="object"}var Ei="[object Symbol]";function Ye(r){return typeof r=="symbol"||Rr(r)&&Mr(r)==Ei}function Bi(r,e){for(var n=-1,s=r==null?0:r.length,i=Array(s);++n<s;)i[n]=e(r[n],n,r);return i}var xi=Array.isArray;const tr=xi;var Ci=1/0,En=Ht?Ht.prototype:void 0,Bn=En?En.toString:void 0;function xn(r){if(typeof r=="string")return r;if(tr(r))return Bi(r,xn)+"";if(Ye(r))return Bn?Bn.call(r):"";var e=r+"";return e=="0"&&1/r==-Ci?"-0":e}var Mi=/\s/;function Ri(r){for(var e=r.length;e--&&Mi.test(r.charAt(e)););return e}var Di=/^\s+/;function Ai(r){return r&&r.slice(0,Ri(r)+1).replace(Di,"")}function xe(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Cn=0/0,Oi=/^[-+]0x[0-9a-f]+$/i,zi=/^0b[01]+$/i,Fi=/^0o[0-7]+$/i,Hi=parseInt;function Mn(r){if(typeof r=="number")return r;if(Ye(r))return Cn;if(xe(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=xe(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Ai(r);var n=zi.test(r);return n||Fi.test(r)?Hi(r.slice(2),n?2:8):Oi.test(r)?Cn:+r}var Ii="[object AsyncFunction]",Ni="[object Function]",ji="[object GeneratorFunction]",Ui="[object Proxy]";function qi(r){if(!xe(r))return!1;var e=Mr(r);return e==Ni||e==ji||e==Ii||e==Ui}var $i=Ze["__core-js_shared__"];const Dr=$i;var Rn=function(){var r=/[^.]+$/.exec(Dr&&Dr.keys&&Dr.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Ji(r){return!!Rn&&Rn in r}var Gi=Function.prototype,Xi=Gi.toString;function Wi(r){if(r!=null){try{return Xi.call(r)}catch{}try{return r+""}catch{}}return""}var Qi=/[\\^$.*+?()[\]{}|]/g,Vi=/^\[object .+?Constructor\]$/,Ki=Function.prototype,Zi=Object.prototype,Yi=Ki.toString,ta=Zi.hasOwnProperty,ea=RegExp("^"+Yi.call(ta).replace(Qi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ra(r){if(!xe(r)||Ji(r))return!1;var e=qi(r)?ea:Vi;return e.test(Wi(r))}function na(r,e){return r==null?void 0:r[e]}function Dn(r,e){var n=na(r,e);return ra(n)?n:void 0}function sa(r,e){return r===e||r!==r&&e!==e}var ia="[object Arguments]";function An(r){return Rr(r)&&Mr(r)==ia}var On=Object.prototype,aa=On.hasOwnProperty,oa=On.propertyIsEnumerable,ca=An(function(){return arguments}())?An:function(r){return Rr(r)&&aa.call(r,"callee")&&!oa.call(r,"callee")};const ua=ca;var ha=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,la=/^\w*$/;function pa(r,e){if(tr(r))return!1;var n=typeof r;return n=="number"||n=="symbol"||n=="boolean"||r==null||Ye(r)?!0:la.test(r)||!ha.test(r)||e!=null&&r in Object(e)}var da=Dn(Object,"create");const Ce=da;function ma(){this.__data__=Ce?Ce(null):{},this.size=0}function fa(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ga="__lodash_hash_undefined__",va=Object.prototype,_a=va.hasOwnProperty;function wa(r){var e=this.__data__;if(Ce){var n=e[r];return n===ga?void 0:n}return _a.call(e,r)?e[r]:void 0}var ya=Object.prototype,ba=ya.hasOwnProperty;function ka(r){var e=this.__data__;return Ce?e[r]!==void 0:ba.call(e,r)}var Ta="__lodash_hash_undefined__";function Sa(r,e){var n=this.__data__;return this.size+=this.has(r)?0:1,n[r]=Ce&&e===void 0?Ta:e,this}function Wt(r){var e=-1,n=r==null?0:r.length;for(this.clear();++e<n;){var s=r[e];this.set(s[0],s[1])}}Wt.prototype.clear=ma,Wt.prototype.delete=fa,Wt.prototype.get=wa,Wt.prototype.has=ka,Wt.prototype.set=Sa;function Pa(){this.__data__=[],this.size=0}function er(r,e){for(var n=r.length;n--;)if(sa(r[n][0],e))return n;return-1}var La=Array.prototype,Ea=La.splice;function Ba(r){var e=this.__data__,n=er(e,r);if(n<0)return!1;var s=e.length-1;return n==s?e.pop():Ea.call(e,n,1),--this.size,!0}function xa(r){var e=this.__data__,n=er(e,r);return n<0?void 0:e[n][1]}function Ca(r){return er(this.__data__,r)>-1}function Ma(r,e){var n=this.__data__,s=er(n,r);return s<0?(++this.size,n.push([r,e])):n[s][1]=e,this}function ce(r){var e=-1,n=r==null?0:r.length;for(this.clear();++e<n;){var s=r[e];this.set(s[0],s[1])}}ce.prototype.clear=Pa,ce.prototype.delete=Ba,ce.prototype.get=xa,ce.prototype.has=Ca,ce.prototype.set=Ma;var Ra=Dn(Ze,"Map");const Da=Ra;function Aa(){this.size=0,this.__data__={hash:new Wt,map:new(Da||ce),string:new Wt}}function Oa(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function rr(r,e){var n=r.__data__;return Oa(e)?n[typeof e=="string"?"string":"hash"]:n.map}function za(r){var e=rr(this,r).delete(r);return this.size-=e?1:0,e}function Fa(r){return rr(this,r).get(r)}function Ha(r){return rr(this,r).has(r)}function Ia(r,e){var n=rr(this,r),s=n.size;return n.set(r,e),this.size+=n.size==s?0:1,this}function Qt(r){var e=-1,n=r==null?0:r.length;for(this.clear();++e<n;){var s=r[e];this.set(s[0],s[1])}}Qt.prototype.clear=Aa,Qt.prototype.delete=za,Qt.prototype.get=Fa,Qt.prototype.has=Ha,Qt.prototype.set=Ia;var Na="Expected a function";function Ar(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Na);var n=function(){var s=arguments,i=e?e.apply(this,s):s[0],a=n.cache;if(a.has(i))return a.get(i);var u=r.apply(this,s);return n.cache=a.set(i,u)||a,u};return n.cache=new(Ar.Cache||Qt),n}Ar.Cache=Qt;var ja=500;function Ua(r){var e=Ar(r,function(s){return n.size===ja&&n.clear(),s}),n=e.cache;return e}var qa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$a=/\\(\\)?/g,Ja=Ua(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(qa,function(n,s,i,a){e.push(i?a.replace($a,"$1"):s||n)}),e});const Ga=Ja;function Xa(r){return r==null?"":xn(r)}function Wa(r,e){return tr(r)?r:pa(r,e)?[r]:Ga(Xa(r))}var Qa=1/0;function Va(r){if(typeof r=="string"||Ye(r))return r;var e=r+"";return e=="0"&&1/r==-Qa?"-0":e}function Ka(r,e){e=Wa(e,r);for(var n=0,s=e.length;r!=null&&n<s;)r=r[Va(e[n++])];return n&&n==s?r:void 0}function zn(r,e,n){var s=r==null?void 0:Ka(r,e);return s===void 0?n:s}function Za(r,e){for(var n=-1,s=e.length,i=r.length;++n<s;)r[i+n]=e[n];return r}var Fn=Ht?Ht.isConcatSpreadable:void 0;function Ya(r){return tr(r)||ua(r)||!!(Fn&&r&&r[Fn])}function Hn(r,e,n,s,i){var a=-1,u=r.length;for(n||(n=Ya),i||(i=[]);++a<u;){var h=r[a];e>0&&n(h)?e>1?Hn(h,e-1,n,s,i):Za(i,h):s||(i[i.length]=h)}return i}function In(r){var e=r==null?0:r.length;return e?Hn(r,1):[]}var to=function(){return Ze.Date.now()};const Or=to;var eo="Expected a function",ro=Math.max,no=Math.min;function so(r,e,n){var s,i,a,u,h,_,p=0,f=!1,w=!1,l=!0;if(typeof r!="function")throw new TypeError(eo);e=Mn(e)||0,xe(n)&&(f=!!n.leading,w="maxWait"in n,a=w?ro(Mn(n.maxWait)||0,e):a,l="trailing"in n?!!n.trailing:l);function v(J){var lt=s,wt=i;return s=i=void 0,p=J,u=r.apply(wt,lt),u}function b(J){return p=J,h=setTimeout(R,e),f?v(J):u}function k(J){var lt=J-_,wt=J-p,Nt=e-lt;return w?no(Nt,a-wt):Nt}function T(J){var lt=J-_,wt=J-p;return _===void 0||lt>=e||lt<0||w&&wt>=a}function R(){var J=Or();if(T(J))return et(J);h=setTimeout(R,k(J))}function et(J){return h=void 0,l&&s?v(J):(s=i=void 0,u)}function M(){h!==void 0&&clearTimeout(h),p=0,s=_=i=h=void 0}function C(){return h===void 0?u:et(Or())}function K(){var J=Or(),lt=T(J);if(s=arguments,i=this,_=J,lt){if(h===void 0)return b(_);if(w)return clearTimeout(h),h=setTimeout(R,e),v(_)}return h===void 0&&(h=setTimeout(R,e)),u}return K.cancel=M,K.flush=C,K}class io{constructor(){y(this,"logsObj"),y(this,"initPromise"),this.initPromise=this.init()}async init(){return this.logsObj=await di(),this.logsObj}get length(){var e,n;return(n=(e=this.logsObj)==null?void 0:e.length)!=null?n:0}getLogs(){var e;return((e=this.logsObj)==null?void 0:e.logs)||[]}async cacheLog(e){var n;await this.initPromise,await((n=this.logsObj)==null?void 0:n.push(e))}async send(e){var n;await this.initPromise;const s=await((n=this.logsObj)==null?void 0:n.shift());s!=null&&s.length&&await e(In(s))}async sendByBeacon(e){var n;await this.initPromise;const s=await((n=this.logsObj)==null?void 0:n.shift());s!=null&&s.length&&await e(s)}}function ao(r){return nr(r,"String")}function oo(r){return nr(r,"Array")}function co(r){return nr(r,"Object")}function uo(r){return typeof r=="function"}function Nn(r,e="Object"){return oo(r)?r.every(n=>nr(n,e)):!1}function nr(r,e="Object"){return Object.prototype.toString.call(r)===`[object ${e}]`}const ho=window.indexedDB,lo=new Set(["add","clear","count","delete","get","getAll","getAllKeys","getKey","openCursor","openKeyCursor","put"]);function po(r,e,...n){return new Promise(async(s,i)=>{try{const a=(await this.createTransaction(r)).objectStore(r);let u=a[e].call(a,...n);u?(u.onsuccess=function(h){s(zn(h,"target.result"))},u.onerror=function(h){console.log("---storeOperate onerror",r,e,h),i(h)}):s(void 0)}catch(a){i(a)}})}function mo(r){const e=this;let n={};return lo.forEach(s=>{n[s]=function(...i){var a;return(a=e==null?void 0:e.manager)==null?void 0:a.pushTask(()=>po.call(e,r,s,...i))}}),n}class fo{constructor(){y(this,"dbManagerMap",new Map)}getOrCreateDBManager(e){if(this.dbManagerMap.has(e))return this.dbManagerMap.get(e);const n=new go(e);return this.dbManagerMap.set(e,n),n}get(e){return this.getOrCreateDBManager(e)}clear(e){const n=this.dbManagerMap.get(e);!n||(n.close(),this.dbManagerMap.delete(e))}}class go{constructor(e){y(this,"initPromise",Promise.resolve()),y(this,"openStatus",""),y(this,"version",0),y(this,"dbName"),y(this,"db",null),y(this,"isClose",!0),y(this,"task",Promise.resolve()),this.dbName=e,this.init()}pushTask(e){if(this.isClose){console.log("----task error, IndexDB is close");return}let n=this.task.then(()=>{try{return uo(e)?e():e}catch(s){console.log("----task error",s)}});return this.task=n,n}close(){const e=()=>{this.openStatus="",this.version=0,this.db&&(this.db.close(),this.db=null)};if(this.isClose)e();else{let n=this.pushTask(e);return this.isClose=!0,n}}transTransactionParam(e){return ao(e)?[{storeName:e}]:Nn(e,"String")?e.map(n=>({storeName:n})):co(e)?[e]:Nn(e)?e:(console.warn("[transTransactionParam]\u5165\u53C2\u683C\u5F0F\u4E0D\u6B63\u786E",e),[])}async transaction(e,n="readonly"){await this.initPromise;const s=this.transTransactionParam(e);if(!s.length)return;const i=[];return s.forEach(a=>{!this.db||this.db.objectStoreNames.contains(a.storeName)||i.push(u=>{u.createObjectStore(a.storeName,a.option)})}),i.length>0&&await this.upgradeneeded(i),mo.bind({manager:this,createTransaction:async a=>{if(await this.initPromise,!!this.db)return this.db.transaction(a,n)}})}init(e,n){let s=this.initPromise;this.initPromise=new Promise(async(i,a)=>{await s,await this.close();const u=ho.open(this.dbName,e);let h=setTimeout(()=>{a(new Error("[IndexDB\u8FDE\u63A5\u8D85\u65F6] name: "+this.dbName+" \u8BF7\u5C1D\u8BD5\u5237\u65B0\u6216\u91CD\u542F\u6D4F\u89C8\u5668"))},1e4);u.onsuccess=()=>{clearTimeout(h),this.openStatus="success",this.db=u.result;const _=this.db;this.isClose=!1;const p=_.version;this.version=_.version,_.onclose=()=>{this.isClose=!0,console.log("[indexDB\u5173\u95ED]",p)},console.log(`[indexDB\u521D\u59CB\u5316]
|
|
9
9
|
onsuccess name: `+this.dbName+`
|
|
10
|
-
version: `+p),i()},u.onupgradeneeded=w=>{this.openStatus="upgradeneeded";const p=zs(w,"target.result");p?(s&&s(p),console.log("[indexDB\u521D\u59CB\u5316] onupgradeneeded name: "+this.dbName)):console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] onupgradeneeded name: "+this.dbName)},u.onerror=w=>{clearTimeout(l),console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] name: "+this.dbName,w),i()}})}async upgradeneeded(e){try{this.init(this.version+1,function(s){let r=e.length;for(;r--;)e[r](s)}),await this.initPromise}catch(s){console.error("[DBManager.upgradeneeded\u5931\u8D25]",s)}}}const Fn=new fo;class _o{constructor(e="logs"){b(this,"logs",[]),b(this,"thisSize",0),b(this,"dbLength",0),b(this,"dbName","apaas-track"),b(this,"storeName","logs"),b(this,"maxSize",1024*1024),this.storeName=e}get length(){return this.dbLength+this.logs.length}async init(){let e=[];const s=await(await Fn.get(this.dbName)).transaction(this.storeName,"readonly");s&&(e=await s(this.storeName).getAllKeys()),this.dbLength=e.length}async push(e){try{const s=JSON.stringify(e).length;this.thisSize+s>=this.maxSize?(await this.save(),this.logs.push(e),this.thisSize=s,s>=this.maxSize&&await this.save()):(this.logs.push(e),this.thisSize+=JSON.stringify(e).length)}catch(s){console.error(s)}}async compulsionSave(){this.logs.length!==0&&await this.save()}clearArray(){this.logs.length=0,this.thisSize=0}async save(){try{const e=this.logs;if(e.length===0)return;const s=await(await Fn.get(this.dbName)).transaction(this.storeName,"readwrite");s&&(await s(this.storeName).add(e,Date.now()),this.dbLength++,this.clearArray())}catch(e){console.error(e)}}async shift(e=1){let s=[];if(this.dbLength!==0&&(s=await this.shiftDB(e)),e-s.length>0&&this.logs.length>0){let r=[...this.logs];this.clearArray(),s.push(r)}return s}async shiftDB(e){try{let s=[];const r=await(await Fn.get(this.dbName)).transaction(this.storeName,"readwrite");if(r){const i=r(this.storeName);let a=await i.getAllKeys();if(a.length===0)return[];const u=this.getRange(e,a),l=[];u.forEach(p=>{l.push(i.get(p))}),s=await Promise.all(l);const w=[];u.forEach(p=>{w.push(i.delete(p))}),await Promise.all(w),a=await i.getAllKeys(),this.dbLength=a.length}return s}catch(s){return console.error(s),[]}}getRange(e,s){const r=[];for(let i=0;i<e&&i<s.length;i++)r.push(s[i]);return r}}async function vo(n){const e=new _o(n);return await e.init(),e}class bo{constructor(){b(this,"logsDB"),b(this,"initPromise"),this.initPromise=this.init()}async init(){return this.logsDB=await vo(),this.logsDB}get length(){var e,s;return(s=(e=this.logsDB)==null?void 0:e.length)!=null?s:0}getLogs(){var e;return((e=this.logsDB)==null?void 0:e.logs)||[]}async cacheLog(e){var s;await this.initPromise,await((s=this.logsDB)==null?void 0:s.push(e))}async send(e){var s;await this.initPromise;const r=await((s=this.logsDB)==null?void 0:s.shift(5));r!=null&&r.length&&e(Is(r))}async sendByBeacon(e){var s;await this.initPromise,await((s=this.logsDB)==null?void 0:s.compulsionSave())}}class Et extends Ee{constructor(e){super(e),b(this,"options"),b(this,"logsSender"),b(this,"nextTickLogs",[]),b(this,"isStart",!1),b(this,"listenPostMessageHandler"),this.options=e,this.initStorageData(),this.initBrowserLog(),e.commonLog&&this.initCommonLog(e.commonLog),console.log("this.options.useIndexDB",this.options.useIndexDB),this.options.useIndexDB?this.logsSender=new bo:this.logsSender=new io}initStorageData(){const e=JSON.parse(localStorage.getItem("apaas-track")||"{}");e.anonymousid||(e.anonymousid=ae()),e.logs||(e.logs=[]),e.distinctid=ae(),localStorage.setItem("apaas-track",JSON.stringify(e))}getStorageData(){return JSON.parse(localStorage.getItem("apaas-track")||"{}")}updateStorageData(e){localStorage.setItem("apaas-track",JSON.stringify(e))}get anonymousid(){var e;return((e=this.browserLog)==null?void 0:e.anonymousid)||this.getStorageData().anonymousid}get distinctid(){var e;return((e=this.browserLog)==null?void 0:e.distinctid)||this.getStorageData().distinctid}initBrowserLog(){const e=new xn.exports.UAParser;e.setUA(navigator.userAgent);const s=e.getResult(),r=s.os.version||"",i=s.os.name||"",a=s.browser.name||"",u=s.browser.version||"",l=navigator.vendor,w=vs.exports(`${i}${r}${l}${a}${u}`),p=location.href;this.browserLog={system:i,systemver:r,manufacturer:l,browser:a,browserver:u,terminalid:w,anonymousid:this.anonymousid,distinctid:this.distinctid,url:p,logsdkver:Qe}}start(...e){if(this.isStart)return;let s=0,r=60*5*1e3,i=null,a=window.setInterval(()=>{u()},this.options.timer||1e4);setTimeout(()=>{u()},2e3);const u=()=>{this.send().then(()=>{s&&(s=0),i&&(clearInterval(i),i=null),a||(a=window.setInterval(()=>{u()},this.options.timer||1e4))}).catch(l=>{console.error("track send error",l),s++,s>=5&&(a&&clearInterval(a),a=null,i||(i=window.setInterval(()=>{u()},r)))})};super.start(),this.sendLegancyLogs(),this.isStart=!0,this.listenPostMessage()}getLegancyLogs(){return this.getStorageData().logs||[]}clearLegancyLogs(){const e=this.getStorageData();delete e.logs,this.updateStorageData(e)}sendLegancyLogs(){this.getLegancyLogs().forEach(e=>{this.addLogToQueue(e,!1,!1)}),this.clearLegancyLogs()}addToLegancyLog(e){e=this.transformLog(e);const s=[...this.getLegancyLogs()||[],e],r=this.getStorageData();r.logs=s,this.updateStorageData(r)}listenPostMessage(){this.listenPostMessageHandler=e=>{var s;const r=(e==null?void 0:e.data)||{};if(r.type==="getWebCommonParams"){const i=Array.from(document.querySelectorAll("iframe"));for(let a of i)(s=a==null?void 0:a.contentWindow)==null||s.postMessage({type:"receiveWebCommonParams",data:{url:this.options.url,timer:this.options.timer||1e4,zip:this.options.zip,commonLog:this.commonLog}},"*")}else if(r.type==="sendApaasLog"){const i=r.data,{log:a,isImmediate:u}=i;this.sendLog(a,u)}},window.addEventListener("message",this.listenPostMessageHandler)}divideLogsSend(e){return this.options.useIndexDB?Ke(this.options.url,e,this.getZip()):wo(e,{url:this.options.url,zip:this.getZip(),maxSize:this.getMaxSize()})}async sendByNextTick(e){if(this.nextTickLogs.push(e),await Sn(),!this.nextTickLogs.length)return;const s=JSON.parse(JSON.stringify(this.nextTickLogs));this.divideLogsSend(this.nextTickLogs).catch(r=>{this.nextTickLogs=[...s,this.nextTickLogs]}),this.nextTickLogs.length=0}async send(){if(this.logsSender.length)try{await this.logsSender.send(this.divideLogsSend.bind(this))}catch{}}async sendLog(e,s=!1){try{e=JSON.parse(JSON.stringify(e))}catch{}s?this.sendByNextTick(e):await this.logsSender.cacheLog(e)}getZip(){return this.options.zip!==void 0?this.options.zip:!0}getMaxSize(){const e=this.options.zip!==void 0?this.options.zip:!0;return 1024*1024/(e?2:1)}async sendByBeacon(e){const s=async r=>li(`${this.options.url}`,r,e!==void 0?e:this.getZip());this.logsSender.length&&await this.logsSender.sendByBeacon(s.bind(this))}}function wo(n,e){const{url:s,zip:r,maxSize:i}=e;if(JSON.stringify(n).length<=i||n.length===1)return Ke(s,n,r);{const a=Qr(n,i),u=[];return a.forEach(l=>{u.push(Ke(s,l,r))}),Promise.all(u)}}class ue extends rt{constructor(e){super(e,"click"),b(this,"paths",""),b(this,"customProperties",{}),b(this,"name","")}getProperties(){return{name:this.name,paths:this.paths,customProperties:this.customProperties}}setProperties(e){e.paths&&(this.paths=e.paths),e.name&&(this.name=e.name),this.customProperties=e.customProperties}}const yo=n=>!n||n===document||n.tagName==="HTML"||!n.hasAttribute?!1:n.hasAttribute("apaas-track-click")&&n.getAttribute("apaas-track-click")!=="false",js=n=>{n.target;const e=n.composedPath();if(!e.length)return!1;for(let s=0;s<e.length;s++){const r=e[s];if(r===window)return!1;if(yo(r))return r}return!1},Hn=n=>{const e=n.tagName,s=n.id,r=n.className,i=(l,w,p)=>`${l}${w?"#"+w:""}${p?"."+p:""}`;let a=i(e,s,r)+" > ",u=n.parentElement;for(;u;){const l=u.tagName,w=u.id,p=u.className;a+=i(l,w,p)+" > ",u=u.parentElement}return a=a.replace(/\s>\s$/,""),a&&(a=a.split(" > ").reverse().join(" > ")),a},ko=(n,e)=>{const s=(r,i)=>r===i;if(n===document)return!0;{const r=e.target;if(s(n,r))return!0;let i=r.parentElement;if(!i)return!1;for(;i;){if(s(n,i))return!0;i=i.parentElement}return!1}},To=(n,e)=>{const s=()=>!0,r=a=>js(a),i=a=>{a.target;const u=(e==null?void 0:e.collectSelectors)||[];if(!u.length)return null;let l=[];for(let p=0;p<u.length;p++){const{selector:f,name:v}=u[p],h=document.querySelectorAll(f);!h||!h.length||h.forEach(_=>{l.push({name:v,selector:f,element:_})})}if(!l.length)return null;let w=[];for(let p=0;p<l.length;p++){const{element:f,name:v,selector:h}=l[p];f&&ko(f,a)&&w.push({name:v,selector:h,element:f})}return w};e&&document.addEventListener("click",a=>{if(!((e==null?void 0:e.collectUrl)||s)(location))return;const u=((e==null?void 0:e.collectElement)||r)(a),l=i(a);if(!u&&(!l||!l.length))return;const w=js(a);if(w){let p={};const f=(e==null?void 0:e.customProperty)||[],v=w.attributes;let h="";const _=v.getNamedItem("apaas-track-click");if(_&&_.nodeName==="apaas-track-click"){const T=_.nodeValue;T&&T!=="false"&&T!=="true"&&(h=T)}for(let T of v){let R=T.nodeName;const et=T.nodeValue;R.startsWith("data-apaastrack-")?p[R.replace("data-apaastrack-","")]=et||"":f.length&&f.forEach(M=>{if(R===M){const C=R.replace(/-[A-Za-z]/,K=>K[1].toUpperCase());p[C]=et||""}})}let y="";e!=null&&e.trackElementPath&&(y=Hn(w));const k=new ue(n);k.setProperties({name:p.name||h,paths:y,customProperties:p}),n.addLogByEvent(k)}if(l&&l.length)for(let p of l){let f="";e!=null&&e.trackElementPath&&(f=Hn(p.element));const v=new ue(n);v.setProperties({name:p.name,paths:f,customProperties:{selector:p.selector,name:p.name}}),n.addLogByEvent(v)}},!0)},So=(n,e,s,r)=>{const i={paths:"",customProperties:{}};"customProperties"in e?i.customProperties=e.customProperties:i.customProperties=e;const a=Lt(n,"click");let u=e.paths||"";r&&!u&&(s==null?void 0:s.trackElementPath)&&(u=Hn(r.target),i.paths=u),a.setProperties(i),n.addLogByEvent(a)},Po=n=>{n||(n={}),ue.eventOptions=n,ue.initApaasTrackHook=e=>{e.executeClickEvent=(s,r)=>{So(e,s,n,r)}},ue.startApaasTrackHook=e=>{To(e,n)},Et.registerEvent("click",ue)},he=[],Us=n=>{he.length||window.addEventListener("pagehide",(...e)=>{he.forEach(s=>{s(...e)})}),he.push(n)},Lo=n=>{for(let e=0;e<he.length;e++){const s=he[e];n===s&&he.splice(e,1)}},Dt=[],Eo=n=>{Dt.length||(document.addEventListener("click",(...e)=>{Dt.forEach(s=>{s(...e)})}),document.addEventListener("mouseover",(...e)=>{Dt.forEach(s=>{s(...e)})}),document.addEventListener("scroll",(...e)=>{Dt.forEach(s=>{s(...e)})}),document.addEventListener("keydown",(...e)=>{Dt.forEach(s=>{s(...e)})})),Dt.push(n)},Bo=n=>{for(let e=0;e<Dt.length;e++){const s=Dt[e];n===s&&Dt.splice(e,1)}};class qs extends rt{constructor(e){super(e,"close")}}const xo=n=>{Us(e=>{if(n){n.sendByBeacon();const s=Lt(n,"close").getEventLog();n.addToLegancyLog(s)}})},Co=()=>{qs.startApaasTrackHook=n=>{xo(n)},Et.registerEvent("close",qs)};class $s extends rt{constructor(e){super(e,"entermain"),b(this,"groupid",""),b(this,"localtime",""),b(this,"cheatinfo",{})}getProperties(){return{groupid:this.groupid,localtime:this.localtime,cheatinfo:this.cheatinfo}}setProperties(e){this.groupid=e.groupid,this.localtime=Date.now().toString()}}const Mo=()=>{$s.initApaasTrackHook=n=>{n.executeEnterMainEvent=()=>{const e=Lt(n,"entermain");e.setProperties({groupid:n.groupid}),n.addLogByEvent(e)}},Ee.registerEvent("entermain",$s)},Ro=(n,e={})=>{Gt(e)||(e={});let s=n?n.split("?"):[];if(s.shift(),s.length>0){s=s.join("?").split("&");for(const r of s){const i=r.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e},Me=(n,e)=>{let s="";switch(n){case"":case"text":case"json":if(Pe(e))try{s=JSON.parse(e),s=hs(s,{maxDepth:10,keyMaxLen:1e4,pretty:!0,standardJSON:!0})}catch{s=ls(String(e),1e4)}else Gt(e)||Pt(e)?s=hs(e,{maxDepth:10,keyMaxLen:1e4,pretty:!0,standardJSON:!0}):typeof e<"u"&&(s=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":case"formdata":default:typeof e<"u"&&(s=Object.prototype.toString.call(e));break}return s},Js=n=>{if(!n)return null;let e=null;if(typeof n=="string")try{e=JSON.parse(n)}catch{const s=n.split("&");if(s.length===1)e=n;else{e={};for(let r of s){const i=r.split("=");e[i[0]]=i[1]===void 0?"undefined":i[1]}}}else if(Nr(n))if(e={},Pt(n)&&as(n[0]))e=n;else for(const[s,r]of n)e[s]=typeof r=="string"?r:"[object Object]";else Ur(n)?e=n:e=`[object ${jr(n)}]`;return e},Gs=(n="")=>(n.startsWith("//")&&(n=`${new URL(window.location.href).protocol}${n}`),n.startsWith("http")?new URL(n):new URL(n,window.location.href));class Xs{constructor(){b(this,"id",""),b(this,"name",""),b(this,"method",""),b(this,"url",""),b(this,"status",0),b(this,"statusText",""),b(this,"cancelState",0),b(this,"readyState",0),b(this,"header",null),b(this,"responseType",""),b(this,"requestType","xhr"),b(this,"requestHeader",null),b(this,"response"),b(this,"responseSize",0),b(this,"responseSizeText",""),b(this,"startTime",0),b(this,"startTimeText",""),b(this,"endTime",0),b(this,"costTime",0),b(this,"getData",null),b(this,"postData",null),b(this,"postLength",0),b(this,"actived",!1),b(this,"noVConsole",!1),b(this,"_XMLReq",null),this.id=ae()}}class Do{constructor(e,s,r){b(this,"resp"),b(this,"item"),b(this,"onUpdateCallback"),this.resp=e,this.item=s,this.onUpdateCallback=r,this.mockReader()}set(e,s,r){return Reflect.set(e,s,r)}get(e,s){const r=Reflect.get(e,s);switch(s){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=s.toLowerCase(),r.apply(e).then(i=>(this.item.response=Me(this.item.responseType,i),this.onUpdateCallback(this.item),i)))}return typeof r=="function"?r.bind(e):r}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const s=this.resp.body.getReader;this.resp.body.getReader=()=>{const r=s.apply(this.resp.body);if(this.item.readyState===4)return r;const i=r.read,a=r.cancel;return this.item.responseType="arraybuffer",r.read=()=>i.apply(r).then(u=>{if(!e)e=new Uint8Array(u.value);else{const l=new Uint8Array(e.length+u.value.length);l.set(e),l.set(u.value,e.length),e=l}return this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=u.done?4:3,this.item.statusText=u.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Le(this.item.responseSize),u.done&&(this.item.response=Me(this.item.responseType,e)),this.onUpdateCallback(this.item),u}),r.cancel=(...u)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=Me(this.item.responseType,e),this.onUpdateCallback(this.item),a.apply(r,u)),r}}}class Ao{constructor(e){b(this,"onUpdateCallback"),this.onUpdateCallback=e}apply(e,s,r){const i=r[0],a=r[1],u=new Xs;return this.beforeFetch(u,i,a),e.apply(window,r).then(this.afterFetch(u)).catch(l=>{throw u.endTime=Date.now(),u.costTime=u.endTime-(u.startTime||u.endTime),this.onUpdateCallback(u),l})}beforeFetch(e,s,r){let i,a="GET",u=null;if(Pe(s)?(a=(r==null?void 0:r.method)||"GET",i=Gs(s),u=(r==null?void 0:r.headers)||null):(a=s.method||"GET",i=Gs(s.url),u=s.headers),e.method=a,e.requestType="fetch",e.requestHeader=u,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,!e.startTime){e.startTime=Date.now();const l=is(e.startTime);e.startTimeText=`${l.year}-${l.month}-${l.day} ${l.hour}:${l.minute}:${l.second}.${l.millisecond}`}if(Object.prototype.toString.call(u)==="[object Headers]"){e.requestHeader={};for(const[l,w]of u)e.requestHeader[l]=w}else e.requestHeader=u;if(i.search&&i.searchParams){e.getData={};for(const[l,w]of i.searchParams)e.getData[l]=w}r!=null&&r.body&&(e.postData=Js(r.body)),this.onUpdateCallback(e)}afterFetch(e){return s=>{e.endTime=Date.now(),e.costTime=e.endTime-(e.startTime||e.endTime),e.status=s.status,e.statusText=String(s.status);let r=!1;e.header={};for(const[i,a]of s.headers)e.header[i]=a,r=a.toLowerCase().indexOf("chunked")>-1?!0:r;return r?e.readyState=3:(e.readyState=4,this.handleResponseBody(s.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Le(e.responseSize),e.response=Me(e.responseType,i),this.onUpdateCallback(e)})),this.onUpdateCallback(e),new Proxy(s,new Do(s,e,this.onUpdateCallback))}}handleResponseBody(e,s){const r=e.headers.get("content-type");return r&&r.includes("application/json")?(s.responseType="json",e.text()):r&&(r.includes("text/html")||r.includes("text/plain"))?(s.responseType="text",e.text()):(s.responseType="arraybuffer",e.arrayBuffer())}}class Ws{static create(e){return new Proxy(window.fetch,new Ao(e))}}b(Ws,"origFetch",window.fetch);class Oo{constructor(e,s){b(this,"XMLReq"),b(this,"item"),b(this,"onUpdateCallback"),this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new Xs,this.item._XMLReq=e,this.item.requestType="xhr",this.onUpdateCallback=s}get(e,s){switch(s){case"_noVConsole":return this.item.noVConsole;case"open":return this.getOpen(e);case"send":return this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const r=Reflect.get(e,s);return typeof r=="function"?r.bind(e):r}}set(e,s,r){switch(s){case"_noVConsole":return this.item.noVConsole=!!r,!1;case"onreadystatechange":return this.setOnReadyStateChange(e,s,r);case"onabort":return this.setOnAbort(e,s,r);case"ontimeout":return this.setOnTimeout(e,s,r)}return Reflect.set(e,s,r)}onReadyStateChange(){this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),this.item.response=Me(this.item.responseType,this.item.response),this.triggerUpdate()}onAbort(){this.item.cancelState=1,this.item.statusText="Abort",this.triggerUpdate()}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout",this.triggerUpdate()}triggerUpdate(){this.item.noVConsole||this.onUpdateCallback(this.item)}getOpen(e){const s=Reflect.get(e,"open");return(...r)=>{const i=r[0],a=r[1];return this.item.method=i?i.toUpperCase():"GET",this.item.url=a||"",this.item.name=this.item.url.replace(new RegExp("[/]*$"),"").split("/").pop()||"",this.item.getData=Ro(this.item.url,{}),this.triggerUpdate(),s.apply(e,r)}}getSend(e){const s=Reflect.get(e,"send");return(...r)=>{const i=r[0];return i&&Object.prototype.hasOwnProperty.call(i,"length")&&(this.item.postLength=i.length),this.item.postData=Js(i),this.triggerUpdate(),s.apply(e,r)}}getSetRequestHeader(e){const s=Reflect.get(e,"setRequestHeader");return(...r)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[r[0]]=r[1],this.triggerUpdate(),s.apply(e,r))}setOnReadyStateChange(e,s,r){return Reflect.set(e,s,(...i)=>{this.onReadyStateChange(),r.apply(e,i)})}setOnAbort(e,s,r){return Reflect.set(e,s,(...i)=>{this.onAbort(),r.apply(e,i)})}setOnTimeout(e,s,r){return Reflect.set(e,s,(...i)=>{this.onTimeout(),r.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case 0:case 1:if(this.item.status=0,this.item.statusText="Pending",!this.item.startTime){this.item.startTime=Date.now();const r=is(this.item.startTime);this.item.startTimeText=`${r.year}-${r.month}-${r.day} ${r.hour}:${r.minute}:${r.second}.${r.millisecond}`}break;case 2:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",s=e.split(`
|
|
11
|
-
`);for(let r=0;r<s.length;r++){const i=s[r];if(!i)continue;const a=i.split(": "),u=a[0],l=a.slice(1).join(": ");this.item.header[u]=l}break;case 3:this.item.status=this.XMLReq.status,this.item.statusText="Loading",!!this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Le(this.item.responseSize));break;case 4:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,!!this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Le(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Qs{static create(e){return new Proxy(XMLHttpRequest,{construct(s){const r=new s;return new Proxy(r,new Oo(r,e))}})}}b(Qs,"origXMLHttpRequest",XMLHttpRequest);class rn extends rt{constructor(e){super(e,"http"),b(this,"url",""),b(this,"method",""),b(this,"startTime",0),b(this,"endTime",0),b(this,"requestContentLength",0),b(this,"responseContentLength",0),b(this,"statusCode",0),b(this,"headers",{}),b(this,"trackOptions",{trackHeaders:!0})}setTrackOptions(e){this.trackOptions=e}getProperties(){return{url:this.url,method:this.method,header:this.trackOptions.trackHeaders?this.headers:void 0,code:this.statusCode,duration:(this.endTime-this.startTime)*1e6,reqcontentlength:this.requestContentLength,respcontentlength:this.responseContentLength,start:this.startTime*1e6,end:this.endTime*1e6}}start(e,s,r,i){this.startTime=Date.now(),this.url=e,this.method=s,this.headers=i,this.requestContentLength=r}end(e,s){this.endTime=Date.now(),this.responseContentLength=e,this.statusCode=s}setProperties(e){this.url=e.url,this.method=e.method,this.startTime=e.startTime,this.endTime=e.endTime,this.requestContentLength=e.requestContentLength,this.responseContentLength=e.responseContentLength,this.statusCode=e.statusCode;let s=e.headers;s&&(s={...s,token:""}),this.headers=s}}const zo=(n,e)=>{const s=(r,i)=>{if(i.readyState===4&&i.url!==r.options.url){const a=new rn(r);a.setTrackOptions(e),a.setProperties({url:i.url,method:i.method,startTime:i.startTime,endTime:i.endTime,requestContentLength:i.postLength,responseContentLength:i.responseSize,statusCode:i.status,headers:i.header||{}}),r.addLogByEvent(a)}};window.XMLHttpRequest=Qs.create(r=>{s(n,r)}),window.fetch=Ws.create(r=>{s(n,r)})},Fo=n=>{n||(n={trackHeaders:!0}),rn.eventOptions=n,rn.startApaasTrackHook=e=>{zo(e,n)},Ee.registerEvent("http",rn)},vt=(n,e=!1)=>{let s=location.href.replace(/#\/.+$/,n);return e&&(s=s.replace(/\?\S+$/,"")),s},Vs=(n,e)=>{let s=history.pushState,r=history.replaceState,i=vt(location.hash),a=null;history.pushState=function(...u){const l=vt(location.hash),w=vt(u[2]||"");return i=w,n&&(a={newURL:w,oldURL:l,type:"push"},Sn(()=>{a&&(e(a),a=null)})),s.apply(this,u)},history.replaceState=function(...u){if(n){const l=vt(location.hash),w=vt(u[2]||"");a={newURL:w,oldURL:l,type:"replace"},i=w,Sn(()=>{if(a&&a.oldURL===l&&a.newURL===w){let p=vt(location.hash);l===w?w!==p?(a.newURL=p,a.type="push"):a.type="onload":a.type="replace",e(a),a=null}})}return r.apply(this,u)},window.addEventListener("popstate",u=>{if(n){const l=vt(location.hash);u.state&&(a={newURL:l,oldURL:i,type:u.state.forward?"back":"forward"},i=l,e(a),a=null)}})};var Ho=function(n,e){e===!0&&(e=0);var s="";if(typeof n=="string")try{s=new URL(n).protocol}catch{}else n&&n.constructor===URL&&(s=n.protocol);var r=s.split(/\:|\+/).filter(Boolean);return typeof e=="number"?r[e]:r},Io=Ho;function No(n){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:n,query:{},parse_failed:!1};try{var s=new URL(n);e.protocols=Io(s),e.protocol=e.protocols[0],e.port=s.port,e.resource=s.hostname,e.host=s.host,e.user=s.username||"",e.password=s.password||"",e.pathname=s.pathname,e.hash=s.hash.slice(1),e.search=s.search.slice(1),e.href=s.href,e.query=Object.fromEntries(s.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=n,e.query={},e.parse_failed=!0}return e}var jo=No;const Uo="text/plain",qo="us-ascii",Ks=(n,e)=>e.some(s=>s instanceof RegExp?s.test(n):s===n),$o=(n,{stripHash:e})=>{const s=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(n);if(!s)throw new Error(`Invalid URL: ${n}`);let{type:r,data:i,hash:a}=s.groups;const u=r.split(";");a=e?"":a;let l=!1;u[u.length-1]==="base64"&&(u.pop(),l=!0);const w=(u.shift()||"").toLowerCase(),p=[...u.map(f=>{let[v,h=""]=f.split("=").map(_=>_.trim());return v==="charset"&&(h=h.toLowerCase(),h===qo)?"":`${v}${h?`=${h}`:""}`}).filter(Boolean)];return l&&p.push("base64"),(p.length>0||w&&w!==Uo)&&p.unshift(w),`data:${p.join(";")},${l?i.trim():i}${a?`#${a}`:""}`};function Jo(n,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},n=n.trim(),/^data:/i.test(n))return $o(n,e);if(/^view-source:/i.test(n))throw new Error("`view-source:` is not supported as it is a non-standard protocol");const s=n.startsWith("//");!s&&/^\.*\//.test(n)||(n=n.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));const r=new URL(n);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&r.protocol==="https:"&&(r.protocol="http:"),e.forceHttps&&r.protocol==="http:"&&(r.protocol="https:"),e.stripAuthentication&&(r.username="",r.password=""),e.stripHash?r.hash="":e.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){const a=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let u=0,l="";for(;;){const w=a.exec(r.pathname);if(!w)break;const p=w[0],f=w.index;l+=r.pathname.slice(u,f).replace(/\/{2,}/g,"/"),l+=p,u=f+p.length}l+=r.pathname.slice(u,r.pathname.length).replace(/\/{2,}/g,"/"),r.pathname=l}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let a=r.pathname.split("/");const u=a[a.length-1];Ks(u,e.removeDirectoryIndex)&&(a=a.slice(0,-1),r.pathname=a.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(const a of[...r.searchParams.keys()])Ks(a,e.removeQueryParameters)&&r.searchParams.delete(a);if(e.removeQueryParameters===!0&&(r.search=""),e.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}e.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,""));const i=n;return n=r.toString(),!e.removeSingleSlash&&r.pathname==="/"&&!i.endsWith("/")&&r.hash===""&&(n=n.replace(/\/$/,"")),(e.removeTrailingSlash||r.pathname==="/")&&r.hash===""&&e.removeSingleSlash&&(n=n.replace(/\/$/,"")),s&&!e.normalizeProtocol&&(n=n.replace(/^http:\/\//,"//")),e.stripProtocol&&(n=n.replace(/^(?:https?:)?\/\//,"")),n}const Re=(n,e=!1)=>{const s=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,r=a=>{const u=new Error(a);throw u.subject_url=n,u};(typeof n!="string"||!n.trim())&&r("Invalid url."),n.length>Re.MAX_INPUT_LENGTH&&r("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),e&&(typeof e!="object"&&(e={stripHash:!1}),n=Jo(n,e));const i=jo(n);if(i.parse_failed){const a=i.href.match(s);a?(i.protocols=["ssh"],i.protocol="ssh",i.resource=a[2],i.host=a[2],i.user=a[1],i.pathname=`/${a[3]}`,i.parse_failed=!1):r("URL parsing failed.")}return i};Re.MAX_INPUT_LENGTH=2048,Re.MAX_INPUT_LENGTH=2048*1024;class le extends rt{constructor(e){super(e,"online"),b(this,"url",""),b(this,"duration",0),b(this,"startTime",0),b(this,"endTime",0),b(this,"views",[])}getProperties(){return{url:this.url,duration:this.duration,startTime:this.startTime,endTime:this.endTime}}setProperties(e){this.duration=e.duration,this.url=e.url,this.startTime=e.startTime,this.endTime=e.endTime,e.views&&(this.views=e.views)}}let De=null;const Zs=(n,e)=>{const s=()=>!0;let r=typeof e=="object"&&e.collectUrl?e.collectUrl:s;return i=>{let a=Re(i.newURL),u=Re(i.oldURL),l=vt(`#${a.hash}`,!0);i.oldURL&&vt(`#${u.hash}`,!0),De&&(De.stop(),De.destroy(),De=null),r(location)&&(De=new Go(n,l))}};class Go{constructor(e,s,r){b(this,"url",""),b(this,"duration",0),b(this,"startTime",0),b(this,"onlineOptions"),b(this,"apaasTrack"),b(this,"visibleChangeHandler"),b(this,"beforeUnLoadHandler"),b(this,"userActionHandler"),b(this,"onlineTimer",null),b(this,"stopTimeout",null),this.url=s,this.apaasTrack=e,this.onlineOptions=r||{collectUrl:void 0},this.visibleChangeHandler=i=>{const a=i.target.visibilityState;this.stopUserActionMonitor(),a==="visible"?this.start():this.startUserActionMonitor()},this.beforeUnLoadHandler=i=>{if(this.apaasTrack){const a=Date.now()-this.startTime;this.saveOnlineData(a);const u=this.apaasTrack.getStorageData();if(u.onlineData)for(let l in u.onlineData){const w=u.onlineData[l],p=new le(this.apaasTrack);p.setProperties({duration:w.duration,url:l,startTime:w.startTime,endTime:w.lastTime,views:w.views});const f=p.getEventLog();e.addToLegancyLog(f)}this.cleanOnlineData()}},this.userActionHandler=ro(i=>{console.log("\u6709\u7528\u6237\u884C\u4E3A"),this.stopUserActionMonitor(),this.start(),this.startUserActionMonitor()},60*1e3,{leading:!0,trailing:!1}),Us(this.beforeUnLoadHandler),Eo(this.userActionHandler),this.init()}startUserActionMonitor(){console.log("startUserActionMonitor"),!this.stopTimeout&&(this.stopTimeout=window.setTimeout(()=>{this.onlineTimer&&(console.log("\u65E0\u6548\u64CD\u4F5C\u65F6\u957F\uFF0C\u7528\u6237\u5DF2\u4E0B\u7EBF..."),clearInterval(this.onlineTimer),this.onlineTimer=null,this.saveOnlineData(this.duration),this.sendRecord(!1,this.url))},1e3*60))}stopUserActionMonitor(){console.log("stopUserActionMonitor"),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}init(){let e=this.apaasTrack.getStorageData();e||(this.apaasTrack.initStorageData(),e=this.apaasTrack.getStorageData()),e.onlineData?this.cleanOnlineData():e.onlineData={},localStorage.setItem("apaas-track",JSON.stringify(e)),document.addEventListener("visibilitychange",this.visibleChangeHandler),this.start();const s=window.document.createEvent("MouseEvent");this.userActionHandler(s)}saveOnlineData(e,s){const r=this.apaasTrack.getStorageData();let i=r.onlineData,a=i[this.url]||(i[this.url]={duration:0,lastTime:Date.now()});a.duration=e,a.lastTime=Date.now(),a.startTime=this.startTime,s&&(a.views||(a.views=[]),a.views.push({name:s.name,duration:s.duration})),r.onlineData[this.url]=a,localStorage.setItem("apaas-track",JSON.stringify(r))}getStorageOnlineData(){return this.apaasTrack.getStorageData().onlineData}cleanOnlineData(e){const s=this.apaasTrack.getStorageData();!s.onlineData||(e?delete s.onlineData[e]:s.onlineData={},localStorage.setItem("apaas-track",JSON.stringify(s)))}start(){if(this.onlineTimer)return;this.startTime=Date.now(),this.duration=0;let e=10*1e3;this.onlineTimer=window.setInterval(()=>{console.log("onlineTimer---"),this.duration+=e,this.saveOnlineData(this.duration)},e)}stop(){if(this.onlineTimer){clearInterval(this.onlineTimer),this.onlineTimer=null;const e=Date.now()-this.startTime;this.duration=e,this.saveOnlineData(e),this.sendRecord(!1,this.url)}}destroy(){this.stopUserActionMonitor(),document.removeEventListener("visibilitychange",this.visibleChangeHandler),this.beforeUnLoadHandler&&Lo(this.beforeUnLoadHandler),this.userActionHandler&&Bo(this.userActionHandler)}sendRecord(e=!1,s){const r=this.getStorageOnlineData();if(r)if(s){const i=r[s];if(i!=null&&i.duration){const a=new le(this.apaasTrack);a.setProperties({duration:i.duration,url:s,startTime:i.startTime,endTime:i.lastTime,views:i.views}),this.apaasTrack.addLogByEvent(a),e&&this.apaasTrack.sendByBeacon()}this.cleanOnlineData(s)}else{for(let i in r){const a=r[i];if(a.duration){const u=new le(this.apaasTrack);u.setProperties({duration:a.duration,url:i,startTime:a.startTime,endTime:a.lastTime,views:a.views}),this.apaasTrack.addLogByEvent(u),e&&this.apaasTrack.sendByBeacon()}}this.cleanOnlineData()}this.duration=0,this.startTime=0}}const Xo=n=>{console.log("registerOnlineEvent"),n||(n={}),le.eventOptions=n,le.startApaasTrackHook=e=>{console.log("registerOnlineEvent startApaasTrackHook");let s=null;Vs(e,a=>{console.log("online listenHistoryChange"),s||(s=Zs(e)),s(a)});const r=()=>{i&&clearTimeout(i),s||(s=Zs(e));const a={newURL:vt(location.hash),oldURL:vt(location.hash),type:"onload"};s(a),window.removeEventListener("load",r)};let i=null;window.self!==window.top&&(window.addEventListener("load",r),i=setTimeout(()=>{r(),clearTimeout(i)},3e3))},Et.registerEvent("online",le)};class In extends rt{constructor(e){super(e,"pageview",Pn.HIGH),b(this,"oldURL",""),b(this,"newURL",""),b(this,"entertype","")}getProperties(){return{from:this.oldURL,to:this.newURL,entertype:this.entertype}}setProperties(e){this.oldURL=e.oldURL,this.newURL=e.newURL,this.entertype=e.type}}const Wo=(n,e)=>{const s=new In(n);s.setProperties(e);const r=s.getEventLog();n.addLogToQueue(r,!0)},Qo=()=>{In.startApaasTrackHook=n=>{Vs(n,e=>{Wo(n,e)})},Et.registerEvent("pageview",In)};var It,Ae,Ys,an,Nn,tr=-1,Vt=function(n){addEventListener("pageshow",function(e){e.persisted&&(tr=e.timeStamp,n(e))},!0)},jn=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},on=function(){var n=jn();return n&&n.activationStart||0},ft=function(n,e){var s=jn(),r="navigate";return tr>=0?r="back-forward-cache":s&&(r=document.prerendering||on()>0?"prerender":document.wasDiscarded?"restore":s.type.replace(/_/g,"-")),{name:n,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},pe=function(n,e,s){try{if(PerformanceObserver.supportedEntryTypes.includes(n)){var r=new PerformanceObserver(function(i){Promise.resolve().then(function(){e(i.getEntries())})});return r.observe(Object.assign({type:n,buffered:!0},s||{})),r}}catch{}},cn=function(n,e){var s=function r(i){i.type!=="pagehide"&&document.visibilityState!=="hidden"||(n(i),e&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",s,!0),addEventListener("pagehide",s,!0)},gt=function(n,e,s,r){var i,a;return function(u){e.value>=0&&(u||r)&&((a=e.value-(i||0))||i===void 0)&&(i=e.value,e.delta=a,e.rating=function(l,w){return l>w[1]?"poor":l>w[0]?"needs-improvement":"good"}(e.value,s),n(e))}},Un=function(n){requestAnimationFrame(function(){return requestAnimationFrame(function(){return n()})})},de=function(n){document.prerendering?addEventListener("prerenderingchange",function(){return n()},!0):n()},me=-1,er=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},un=function(n){document.visibilityState==="hidden"&&me>-1&&(me=n.type==="visibilitychange"?n.timeStamp:0,Vo())},nr=function(){addEventListener("visibilitychange",un,!0),addEventListener("prerenderingchange",un,!0)},Vo=function(){removeEventListener("visibilitychange",un,!0),removeEventListener("prerenderingchange",un,!0)},qn=function(){return me<0&&(me=er(),nr(),Vt(function(){setTimeout(function(){me=er(),nr()},0)})),{get firstHiddenTime(){return me}}},sr=function(n,e){e=e||{},de(function(){var s,r=[1800,3e3],i=qn(),a=ft("FCP"),u=pe("paint",function(l){l.forEach(function(w){w.name==="first-contentful-paint"&&(u.disconnect(),w.startTime<i.firstHiddenTime&&(a.value=Math.max(w.startTime-on(),0),a.entries.push(w),s(!0)))})});u&&(s=gt(n,a,r,e.reportAllChanges),Vt(function(l){a=ft("FCP"),s=gt(n,a,r,e.reportAllChanges),Un(function(){a.value=performance.now()-l.timeStamp,s(!0)})}))})},Ko=function(n,e){e=e||{},de(function(){var s,r=[.1,.25],i=ft("CLS"),a=-1,u=0,l=[],w=function(v){a>-1&&n(v)},p=function(v){v.forEach(function(h){if(!h.hadRecentInput){var _=l[0],y=l[l.length-1];u&&h.startTime-y.startTime<1e3&&h.startTime-_.startTime<5e3?(u+=h.value,l.push(h)):(u=h.value,l=[h]),u>i.value&&(i.value=u,i.entries=l,s())}})},f=pe("layout-shift",p);f&&(s=gt(w,i,r,e.reportAllChanges),sr(function(v){a=v.value,i.value<0&&(i.value=0,s())}),cn(function(){p(f.takeRecords()),s(!0)}),Vt(function(){u=0,a=-1,i=ft("CLS",0),s=gt(w,i,r,e.reportAllChanges),Un(function(){return s()})}))})},Oe={passive:!0,capture:!0},Zo=new Date,rr=function(n,e){It||(It=e,Ae=n,Ys=new Date,ar(removeEventListener),ir())},ir=function(){if(Ae>=0&&Ae<Ys-Zo){var n={entryType:"first-input",name:It.type,target:It.target,cancelable:It.cancelable,startTime:It.timeStamp,processingStart:It.timeStamp+Ae};an.forEach(function(e){e(n)}),an=[]}},Yo=function(n){if(n.cancelable){var e=(n.timeStamp>1e12?new Date:performance.now())-n.timeStamp;n.type=="pointerdown"?function(s,r){var i=function(){rr(s,r),u()},a=function(){u()},u=function(){removeEventListener("pointerup",i,Oe),removeEventListener("pointercancel",a,Oe)};addEventListener("pointerup",i,Oe),addEventListener("pointercancel",a,Oe)}(e,n):rr(e,n)}},ar=function(n){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return n(e,Yo,Oe)})},tc=function(n,e){e=e||{},de(function(){var s,r=[100,300],i=qn(),a=ft("FID"),u=function(p){p.startTime<i.firstHiddenTime&&(a.value=p.processingStart-p.startTime,a.entries.push(p),s(!0))},l=function(p){p.forEach(u)},w=pe("first-input",l);s=gt(n,a,r,e.reportAllChanges),w&&cn(function(){l(w.takeRecords()),w.disconnect()},!0),w&&Vt(function(){var p;a=ft("FID"),s=gt(n,a,r,e.reportAllChanges),an=[],Ae=-1,It=null,ar(addEventListener),p=u,an.push(p),ir()})})},or=0,$n=1/0,hn=0,ec=function(n){n.forEach(function(e){e.interactionId&&($n=Math.min($n,e.interactionId),hn=Math.max(hn,e.interactionId),or=hn?(hn-$n)/7+1:0)})},cr=function(){return Nn?or:performance.interactionCount||0},nc=function(){"interactionCount"in performance||Nn||(Nn=pe("event",ec,{type:"event",buffered:!0,durationThreshold:0}))},ur=0,hr=function(){return cr()-ur},Bt=[],Jn={},lr=function(n){var e=Bt[Bt.length-1],s=Jn[n.interactionId];if(s||Bt.length<10||n.duration>e.latency){if(s)s.entries.push(n),s.latency=Math.max(s.latency,n.duration);else{var r={id:n.interactionId,latency:n.duration,entries:[n]};Jn[r.id]=r,Bt.push(r)}Bt.sort(function(i,a){return a.latency-i.latency}),Bt.splice(10).forEach(function(i){delete Jn[i.id]})}},sc=function(n,e){e=e||{},de(function(){var s=[200,500];nc();var r,i=ft("INP"),a=function(l){l.forEach(function(f){f.interactionId&&lr(f),f.entryType==="first-input"&&!Bt.some(function(v){return v.entries.some(function(h){return f.duration===h.duration&&f.startTime===h.startTime})})&&lr(f)});var w,p=(w=Math.min(Bt.length-1,Math.floor(hr()/50)),Bt[w]);p&&p.latency!==i.value&&(i.value=p.latency,i.entries=p.entries,r())},u=pe("event",a,{durationThreshold:e.durationThreshold||40});r=gt(n,i,s,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),cn(function(){a(u.takeRecords()),i.value<0&&hr()>0&&(i.value=0,i.entries=[]),r(!0)}),Vt(function(){Bt=[],ur=cr(),i=ft("INP"),r=gt(n,i,s,e.reportAllChanges)}))})},Gn={},rc=function(n,e){e=e||{},de(function(){var s,r=[2500,4e3],i=qn(),a=ft("LCP"),u=function(p){var f=p[p.length-1];if(f){var v=Math.max(f.startTime-on(),0);v<i.firstHiddenTime&&(a.value=v,a.entries=[f],s())}},l=pe("largest-contentful-paint",u);if(l){s=gt(n,a,r,e.reportAllChanges);var w=function(){Gn[a.id]||(u(l.takeRecords()),l.disconnect(),Gn[a.id]=!0,s(!0))};["keydown","click"].forEach(function(p){addEventListener(p,w,{once:!0,capture:!0})}),cn(w,!0),Vt(function(p){a=ft("LCP"),s=gt(n,a,r,e.reportAllChanges),Un(function(){a.value=performance.now()-p.timeStamp,Gn[a.id]=!0,s(!0)})})}})},ic=function n(e){document.prerendering?de(function(){return n(e)}):document.readyState!=="complete"?addEventListener("load",function(){return n(e)},!0):setTimeout(e,0)},ac=function(n,e){e=e||{};var s=[800,1800],r=ft("TTFB"),i=gt(n,r,s,e.reportAllChanges);ic(function(){var a=jn();if(a){var u=a.responseStart;if(u<=0||u>performance.now())return;r.value=Math.max(u-on(),0),r.entries=[a],i(!0),Vt(function(){r=ft("TTFB",0),(i=gt(n,r,s,e.reportAllChanges))(!0)})}})};class Xn extends rt{constructor(e){super(e,"performance"),b(this,"performanceData",null)}getProperties(){return{...this.performanceData}}setProperties(e){this.performanceData=e}track(){return new Promise((e,s)=>{let r={cls:null,lcp:null,ttfb:null,fcp:null,fid:null,inp:null};setTimeout(()=>{const a=performance.timing,u={...r,connectEnd:a.connectEnd,connectStart:a.connectStart,domComplete:a.domComplete,domContentLoadedEventEnd:a.domContentLoadedEventEnd,domContentLoadedEventStart:a.domContentLoadedEventStart,domInteractive:a.domInteractive,domLoading:a.domLoading,domainLookupEnd:a.domainLookupEnd,domainLookupStart:a.domainLookupStart,fetchStart:a.fetchStart,loadEventEnd:a.loadEventEnd,loadEventStart:a.loadEventStart,navigationStart:a.navigationStart,redirectEnd:a.redirectEnd,redirectStart:a.redirectStart,requestStart:a.requestStart,responseEnd:a.responseEnd,responseStart:a.responseStart,secureConnectionStart:a.secureConnectionStart,unloadEventEnd:a.unloadEventEnd,unloadEventStart:a.unloadEventStart};this.setProperties(u),e(u)},1e4),rc(a=>{i(a)}),Ko(a=>{i(a)}),ac(a=>{i(a)}),sr(a=>{i(a)}),tc(a=>{i(a)}),sc(a=>{i(a)});const i=a=>{a.name==="FID"?r.fid=a.value:a.name==="CLS"?r.cls=a.value:a.name==="FCP"?r.fcp=a.value:a.name==="TTFB"?r.ttfb=a.value:a.name==="LCP"?r.lcp=a.value:a.name==="INP"&&(r.inp=a.value)}})}}const oc=async n=>{const e=new Xn(n);await e.track(),n.addLogByEvent(e)},cc=()=>{Xn.startApaasTrackHook=n=>{oc(n)},Et.registerEvent("performance",Xn)};class pr extends rt{constructor(e){super(e,"throw"),b(this,"message",""),b(this,"detailmessage",""),b(this,"name",""),b(this,"stack",[]),b(this,"cause",{})}getProperties(){return{message:this.message,detailmessage:this.detailmessage,name:this.name,stack:this.stack,cause:this.cause}}setError(e){const s=Tn(e);this.message=s.message,this.detailmessage=s.detail,this.name=s.name,this.stack=s.stack}}const uc=n=>{window.addEventListener("error",e=>{const s=Lt(n,"throw");s.setError(e.error),n.addLogByEvent(s)}),window.addEventListener("unhandledrejection",e=>{const s=Lt(n,"throw");s.setError(e.reason),n.addLogByEvent(s)})},hc=()=>{pr.startApaasTrackHook=n=>{uc(n)},Et.registerEvent("throw",pr)},lc=()=>{cc(),hc(),Mo()},pc=n=>{lc(),Qo(),Co(),(n==null?void 0:n.http)!==!1&&Fo(),n!=null&&n.click&&Po(typeof n.click=="object"?n.click:void 0),n!=null&&n.online&&Xo(typeof n.online=="object"?n.online:void 0)},dc=n=>(pc(n),mc(n)),mc=n=>new Et(n);class Kt{constructor(e,s,r){b(this,"_level",0),this.apaasTrack=e,this.type=s,r&&(this._level=r)}getProperties(){return{}}setProperties(e){}getEventLog(e){const s=e||Date.now();return{...this.apaasTrack.baseLog,types:this.type,logtime:String(s),epochnanos:String(s)+"000000",event:this.type,properties:this.getProperties(),url:oe()}}}b(Kt,"eventOptions"),b(Kt,"initApaasTrackHook"),b(Kt,"startApaasTrackHook"),b(Kt,"destroyApaasTrackHook");class fc extends Kt{constructor(e){super(e,"init")}getProperties(){const e=this.apaasTrack.baseLog;return{system:e.system||"",systemver:e.systemver||"",manufacturer:e.manufacturer||"",browser:e.browser||"",browserver:e.browserver||"",terminalid:e.terminalid||"",client:e.client||"",clientver:e.clientver||""}}}class gc extends Kt{constructor(e){super(e,"custom"),b(this,"info",{})}setCustomType(e){this.type=e}getProperties(){return{...this.info}}setProperties(e){this.info=e}}const fe={init:fc,custom:gc},ln=(n,e)=>{const s=fe[e];return new s(n)},_c=(n,e,s)=>{const r=s||Date.now(),i=ln(n,e);return{...n.baseLog,types:e,logtime:String(r),epochnanos:String(r)+"000000",event:e,properties:i.getProperties(),url:oe()}},dr=(n,e,s)=>{const r=s||Date.now();return{...n.baseLog,types:e.type,logtime:String(r),epochnanos:String(r)+"000000",event:e.type,properties:e.getProperties(),url:oe()}},mr=(n,e)=>{if(fe[n])throw Error(`\u8BE5\u4E8B\u4EF6${n} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);fe[n]=e};class vc{constructor(e,s){b(this,"name",""),b(this,"time",0),b(this,"info",{}),e&&(this.name=e),s&&(this.info=s),this.time=Date.now()}get epochnanos(){return this.time*1e6}get attributes(){return this.getAttributes()}getAttributes(){return{}}getJson(){return{name:this.name,epochnanos:this.time*1e6,attributes:this.getAttributes(),...this.info}}setInfo(e){this.info=e||{}}}class bc extends vc{constructor(){super(...arguments),b(this,"name","exception"),b(this,"exceptionType",""),b(this,"exceptionMessage",""),b(this,"exceptionStackTrace","")}getAttributes(){return{"exception.type":this.exceptionType,"exception.message":this.exceptionMessage,"exception.stacktrace":this.exceptionStackTrace}}setInfo(e){this.exceptionMessage=e.exceptionMessage,this.exceptionType=e.exceptionType,this.exceptionStackTrace=e.exceptionStackTrace}}class Wn extends Kt{constructor(e,s,r){super(e,"span"),b(this,"spanid",""),b(this,"traceid",""),b(this,"parentspanid",""),b(this,"name",""),b(this,"attributes",{}),b(this,"events",[]),b(this,"statuscode","OK"),b(this,"statusmessage",""),b(this,"startTime",0),b(this,"endTime",0),this.name=s,this.traceid=ae(),this.spanid=rs(),this.parentspanid=r||"",this.start()}trackLog(){this.apaasTrack.addLogByEvent(this)}createSpanEvent(e,s){return new Wn(this.apaasTrack,e,s)}setAttribute(e){const s=e.getAttributes();this.attributes=s}addEvent(e){this.events.push(e)}exception(e){const s=new bc;let r="",i="",a="";if(e instanceof Error){const u=Tn(e);r=u.detail,i=u.name,a=u.stack.join(",")}else r=e.exceptionMessage,i=e.exceptionType,a=e.exceptionStackTrace;s.setInfo({exceptionMessage:r,exceptionType:i,exceptionStackTrace:a}),this.events.push(s)}start(){this.startTime=Date.now()}end(e,s){e&&(this.statusmessage=e),s&&(this.statuscode=s),this.endTime=Date.now()}getProperties(){return{traceid:this.traceid,spanid:this.spanid,parentspanid:this.parentspanid,name:this.name,attributes:this.attributes,events:this.events.map(e=>e.getJson()),statuscode:this.statuscode,statusmessage:this.statusmessage,startepochnanos:this.startTime*1e6,endepochnanos:this.endTime*1e6,duration:(this.endTime-this.startTime)*1e6}}}class fr{constructor(e){b(this,"_version",Qe),b(this,"commonLog",null),b(this,"browserLog",null),b(this,"options"),this.options=e,typeof window<"u"&&(window.__apaasTrackVersion__=Qe),typeof wx<"u"&&!window&&(wx.__apaasTrackVersion__=Qe),e.commonLog&&this.initCommonLog(e.commonLog),this.runEventInitHooks()}registerEvent(e,s){mr(e,s),s.initApaasTrackHook&&s.initApaasTrackHook(this),s.startApaasTrackHook&&s.startApaasTrackHook(this)}get groupid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}runEventInitHooks(){Object.values(fe).forEach(e=>{e.initApaasTrackHook&&e.initApaasTrackHook(this)})}runEventStartHooks(){Object.values(fe).forEach(e=>{e.startApaasTrackHook&&e.startApaasTrackHook(this)})}runEventDestroyHooks(){Object.values(fe).forEach(e=>{e.destroyApaasTrackHook&&e.destroyApaasTrackHook(this)})}get anonymousid(){var e;return(e=this.browserLog)==null?void 0:e.anonymousid}get distinctid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}get baseLog(){return{...this.browserLog,...this.commonLog}}initCommonLog(e){this.commonLog=e}createEventLog(e,s){return _c(this,e,s)}addLogByType(e,s){const r=this.createEventLog(e,s);this.addLogToQueue(r)}addLogByEvent(e,s){const r=dr(this,e,s);this.addLogToQueue(r)}createCustomEvent(e){const s=ln(this,"custom");return s.setCustomType(e),s}createSpanEvent(e,s){return new Wn(this,e,s)}addLogByCustomEvent(e,s={},r){const i=this.createCustomEvent(e);i.setProperties(s);const a=dr(this,i,r);this.addLogToQueue(a)}executeInitEvent(){const e=ln(this,"init");e.setProperties({groupid:this.groupid}),this.addLogByEvent(e)}updateCommonLog(e){this.commonLog={...this.commonLog,...e}}trackEvent(e,s={},r){const i=ln(this,e);i.setProperties(s),this.addLogByEvent(i,r)}start(...e){this.executeInitEvent(),this.runEventStartHooks()}destroy(){this.runEventDestroyHooks()}transformLog(e){return e}async addLogToQueue(e,s=!1,r=!0){r&&(e=this.transformLog(e)),await this.sendLog(e,s)}}b(fr,"registerEvent",mr);const gr=async n=>{var i;let e=await n.getWebInitParams();const s=location.origin+"/static/apaas-track/apaas-spu/lzma_worker.js";console.log("createApaasTrack lzma_worker",s),hi(s);const r=dc({url:n.url||"",click:{trackElementPath:!0},commonLog:{client:"Web",...e},online:(n==null?void 0:n.online)||!1,pageview:!0,http:!0,zip:n.zip!==void 0?n.zip:!0,useIndexDB:(i=n==null?void 0:n.useIndexDB)!=null?i:!1});return r.sendLog=n.sendLog,r.start=function(...a){return fr.prototype.start.call(this,...a)},n.sendLog===Vn&&(r.start=function(...a){return Et.prototype.start.call(this,...a)}),n.startFn&&(r.start=n.startFn),r};let Qn=null;const wc=async n=>{var s,r;if(Qn)return Qn;const e=await gr({url:(n==null?void 0:n.url)||"",sendLog:(n==null?void 0:n.sendLog)||Vn,startFn:(n==null?void 0:n.startFn)||null,online:(n==null?void 0:n.online)||!1,getWebInitParams:(n==null?void 0:n.getWebInitParams)||_r,zip:(s=n==null?void 0:n.zip)!=null?s:!0,useIndexDB:(r=n==null?void 0:n.useIndexDB)!=null?r:!1});return Qn=e,e},_r=()=>new Promise((n,e)=>{if(window.aPaaS&&window.aPaaS.getWebInitParams){const s=window.aPaaS.getWebInitParams(r=>{n(r)});s&&s.then&&s.then(r=>{n(r)})}else{window.parent.postMessage({type:"getWebInitParams"},"*");const s=i=>{const a=(i==null?void 0:i.data)||{};if(a.type==="receiveWebInitParams")if(a.data){const u=a.data;n(u),r&&(clearTimeout(r),r=null),window.removeEventListener("message",s)}else e(Error("receiveWebInitParams response null"))};window.addEventListener("message",s);let r=window.setTimeout(()=>{e(Error("postMessage getWebInitParams timeout"))},2e3)}});function yc(...n){return Et.prototype.start.call(this,n)}function Vn(n,e){var s;return(s=window.aPaaS)!=null&&s.sendLog?window.aPaaS.sendLog(n,e):Et.prototype.sendLog.call(this,n,e)}X.BaseEvent=rt,X.BaseSpanAttribute=Yr,X.BaseTrack=Ee,X.CustomEvent=ms,X.EventLevel=Pn,X.EventMap=Xt,X.ExceptionSpanEvent=_s,X.InitEvent=ds,X.SpanEvent=We,X.SpanPropertyEvent=gs,X.TaskQueue=ps,X.createApaasTrack=gr,X.createEvent=Lt,X.defaultGetWebInitParams=_r,X.defaultWebSendFunction=Vn,X.defaultWebStartFunction=yc,X.getApaasSpuTrack=wc,X.getEventLog=Ln,X.getEventLogByType=fs,X.registerEvent=En,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
version: `+p),i()},u.onupgradeneeded=_=>{this.openStatus="upgradeneeded";const p=zn(_,"target.result");p?(n&&n(p),console.log("[indexDB\u521D\u59CB\u5316] onupgradeneeded name: "+this.dbName)):console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] onupgradeneeded name: "+this.dbName)},u.onerror=_=>{clearTimeout(h),console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] name: "+this.dbName,_),i()}})}async upgradeneeded(e){try{this.init(this.version+1,function(n){let s=e.length;for(;s--;)e[s](n)}),await this.initPromise}catch(n){console.error("[DBManager.upgradeneeded\u5931\u8D25]",n)}}}const zr=new fo;class vo{constructor(e="logs"){y(this,"logs",[]),y(this,"thisSize",0),y(this,"dbLength",0),y(this,"dbName","apaas-track"),y(this,"storeName","logs"),y(this,"maxSize",1024*1024),this.storeName=e}get length(){return this.dbLength+this.logs.length}async init(){let e=[];const n=await(await zr.get(this.dbName)).transaction(this.storeName,"readonly");n&&(e=await n(this.storeName).getAllKeys()),this.dbLength=e.length}async push(e){try{const n=JSON.stringify(e).length;this.thisSize+n>=this.maxSize?(await this.save(),this.logs.push(e),this.thisSize=n,n>=this.maxSize&&await this.save()):(this.logs.push(e),this.thisSize+=JSON.stringify(e).length)}catch(n){console.error(n)}}async compulsionSave(){this.logs.length!==0&&await this.save()}clearArray(){this.logs.length=0,this.thisSize=0}async save(){try{const e=this.logs;if(e.length===0)return;const n=await(await zr.get(this.dbName)).transaction(this.storeName,"readwrite");n&&(await n(this.storeName).add(e,Date.now()),this.dbLength++,this.clearArray())}catch(e){console.error(e)}}async shift(e=1){let n=[];if(this.dbLength!==0&&(n=await this.shiftDB(e)),e-n.length>0&&this.logs.length>0){let s=[...this.logs];this.clearArray(),n.push(s)}return n}async shiftDB(e){try{let n=[];const s=await(await zr.get(this.dbName)).transaction(this.storeName,"readwrite");if(s){const i=s(this.storeName);let a=await i.getAllKeys();if(a.length===0)return[];const u=this.getRange(e,a),h=[];u.forEach(p=>{h.push(i.get(p))}),n=await Promise.all(h);const _=[];u.forEach(p=>{_.push(i.delete(p))}),await Promise.all(_),a=await i.getAllKeys(),this.dbLength=a.length}return n}catch(n){return console.error(n),[]}}getRange(e,n){const s=[];for(let i=0;i<e&&i<n.length;i++)s.push(n[i]);return s}}async function _o(r){const e=new vo(r);return await e.init(),e}class wo{constructor(){y(this,"logsDB"),y(this,"initPromise"),this.initPromise=this.init()}async init(){return this.logsDB=await _o(),this.logsDB}get length(){var e,n;return(n=(e=this.logsDB)==null?void 0:e.length)!=null?n:0}getLogs(){var e;return((e=this.logsDB)==null?void 0:e.logs)||[]}async cacheLog(e){var n;await this.initPromise,await((n=this.logsDB)==null?void 0:n.push(e))}async send(e){var n;await this.initPromise;const s=await((n=this.logsDB)==null?void 0:n.shift(5));s!=null&&s.length&&e(In(s))}async sendByBeacon(e){var n;await this.initPromise,await((n=this.logsDB)==null?void 0:n.compulsionSave())}}class Et extends Ee{constructor(e){super(e),y(this,"options"),y(this,"logsSender"),y(this,"nextTickLogs",[]),y(this,"isStart",!1),y(this,"listenPostMessageHandler"),this.options=e,this.initStorageData(),this.initBrowserLog(),e.commonLog&&this.initCommonLog(e.commonLog),console.log("this.options.useIndexDB",this.options.useIndexDB),this.options.useIndexDB?this.logsSender=new wo:this.logsSender=new io}initStorageData(){const e=JSON.parse(localStorage.getItem("apaas-track")||"{}");e.anonymousid||(e.anonymousid=ae()),e.logs||(e.logs=[]),e.distinctid=ae(),localStorage.setItem("apaas-track",JSON.stringify(e))}getStorageData(){return JSON.parse(localStorage.getItem("apaas-track")||"{}")}updateStorageData(e){localStorage.setItem("apaas-track",JSON.stringify(e))}get anonymousid(){var e;return((e=this.browserLog)==null?void 0:e.anonymousid)||this.getStorageData().anonymousid}get distinctid(){var e;return((e=this.browserLog)==null?void 0:e.distinctid)||this.getStorageData().distinctid}initBrowserLog(){const e=new Br.exports.UAParser;e.setUA(navigator.userAgent);const n=e.getResult(),s=n.os.version||"",i=n.os.name||"",a=n.browser.name||"",u=n.browser.version||"",h=navigator.vendor,_=_n.exports(`${i}${s}${h}${a}${u}`),p=location.href;this.browserLog={system:i,systemver:s,manufacturer:h,browser:a,browserver:u,terminalid:_,anonymousid:this.anonymousid,distinctid:this.distinctid,url:p,logsdkver:Qe}}start(...e){if(this.isStart)return;let n=0,s=60*5*1e3,i=null,a=window.setInterval(()=>{u()},this.options.timer||1e4);setTimeout(()=>{u()},2e3);const u=()=>{this.send().then(()=>{n&&(n=0),i&&(clearInterval(i),i=null),a||(a=window.setInterval(()=>{u()},this.options.timer||1e4))}).catch(h=>{console.error("track send error",h),n++,n>=5&&(a&&clearInterval(a),a=null,i||(i=window.setInterval(()=>{u()},s)))})};super.start(),this.sendLegancyLogs(),this.isStart=!0,this.listenPostMessage()}getLegancyLogs(){return this.getStorageData().logs||[]}clearLegancyLogs(){const e=this.getStorageData();delete e.logs,this.updateStorageData(e)}sendLegancyLogs(){this.getLegancyLogs().forEach(e=>{this.addLogToQueue(e,!1,!1)}),this.clearLegancyLogs()}addToLegancyLog(e){e=this.transformLog(e);const n=[...this.getLegancyLogs()||[],e],s=this.getStorageData();s.logs=n,this.updateStorageData(s)}listenPostMessage(){this.listenPostMessageHandler=e=>{var n;const s=(e==null?void 0:e.data)||{};if(s.type==="getWebCommonParams"){const i=Array.from(document.querySelectorAll("iframe"));for(let a of i)(n=a==null?void 0:a.contentWindow)==null||n.postMessage({type:"receiveWebCommonParams",data:{url:this.options.url,timer:this.options.timer||1e4,zip:this.options.zip,commonLog:this.commonLog}},"*")}else if(s.type==="sendApaasLog"){const i=s.data,{log:a,isImmediate:u}=i;this.sendLog(a,u)}},window.addEventListener("message",this.listenPostMessageHandler)}divideLogsSend(e){return this.options.useIndexDB?Ke(this.options.url,e,this.getZip()):yo(e,{url:this.options.url,zip:this.getZip(),maxSize:this.getMaxSize()})}async sendByNextTick(e){if(this.nextTickLogs.push(e),await Tr(),!this.nextTickLogs.length)return;const n=JSON.parse(JSON.stringify(this.nextTickLogs));this.divideLogsSend(this.nextTickLogs).catch(s=>{this.nextTickLogs=[...n,this.nextTickLogs]}),this.nextTickLogs.length=0}async send(){if(this.logsSender.length)try{await this.logsSender.send(this.divideLogsSend.bind(this))}catch{}}async sendLog(e,n=!1){try{e=JSON.parse(JSON.stringify(e))}catch{}n?this.sendByNextTick(e):await this.logsSender.cacheLog(e)}getZip(){return this.options.zip!==void 0?this.options.zip:!0}getMaxSize(){const e=this.options.zip!==void 0?this.options.zip:!0;return 1024*1024/(e?2:1)}async sendByBeacon(e){const n=async s=>li(`${this.options.url}`,s,e!==void 0?e:this.getZip());this.logsSender.length&&await this.logsSender.sendByBeacon(n.bind(this))}}function yo(r,e){const{url:n,zip:s,maxSize:i}=e;if(JSON.stringify(r).length<=i||r.length===1)return Ke(n,r,s);{const a=Qs(r,i),u=[];return a.forEach(h=>{u.push(Ke(n,h,s))}),Promise.all(u)}}class ue extends st{constructor(e){super(e,"click"),y(this,"paths",""),y(this,"customProperties",{}),y(this,"name","")}getProperties(){return{name:this.name,paths:this.paths,customProperties:this.customProperties}}setProperties(e){e.paths&&(this.paths=e.paths),e.name&&(this.name=e.name),this.customProperties=e.customProperties}}const bo=r=>!r||r===document||r.tagName==="HTML"||!r.hasAttribute?!1:r.hasAttribute("apaas-track-click")&&r.getAttribute("apaas-track-click")!=="false",jn=r=>{r.target;const e=r.composedPath();if(!e.length)return!1;for(let n=0;n<e.length;n++){const s=e[n];if(s===window)return!1;if(bo(s))return s}return!1},Fr=r=>{const e=r.tagName,n=r.id,s=r.className,i=(h,_,p)=>`${h}${_?"#"+_:""}${p?"."+p:""}`;let a=i(e,n,s)+" > ",u=r.parentElement;for(;u;){const h=u.tagName,_=u.id,p=u.className;a+=i(h,_,p)+" > ",u=u.parentElement}return a=a.replace(/\s>\s$/,""),a&&(a=a.split(" > ").reverse().join(" > ")),a},ko=(r,e)=>{const n=(s,i)=>s===i;if(r===document)return!0;{const s=e.target;if(n(r,s))return!0;let i=s.parentElement;if(!i)return!1;for(;i;){if(n(r,i))return!0;i=i.parentElement}return!1}},To=(r,e)=>{const n=()=>!0,s=a=>jn(a),i=a=>{a.target;const u=(e==null?void 0:e.collectSelectors)||[];if(!u.length)return null;let h=[];for(let p=0;p<u.length;p++){const{selector:f,name:w}=u[p],l=document.querySelectorAll(f);!l||!l.length||l.forEach(v=>{h.push({name:w,selector:f,element:v})})}if(!h.length)return null;let _=[];for(let p=0;p<h.length;p++){const{element:f,name:w,selector:l}=h[p];f&&ko(f,a)&&_.push({name:w,selector:l,element:f})}return _};e&&document.addEventListener("click",a=>{if(!((e==null?void 0:e.collectUrl)||n)(location))return;const u=((e==null?void 0:e.collectElement)||s)(a),h=i(a);if(!u&&(!h||!h.length))return;const _=jn(a);if(_){let p={};const f=(e==null?void 0:e.customProperty)||[],w=_.attributes;let l="";const v=w.getNamedItem("apaas-track-click");if(v&&v.nodeName==="apaas-track-click"){const T=v.nodeValue;T&&T!=="false"&&T!=="true"&&(l=T)}for(let T of w){let R=T.nodeName;const et=T.nodeValue;R.startsWith("data-apaastrack-")?p[R.replace("data-apaastrack-","")]=et||"":f.length&&f.forEach(M=>{if(R===M){const C=R.replace(/-[A-Za-z]/,K=>K[1].toUpperCase());p[C]=et||""}})}let b="";e!=null&&e.trackElementPath&&(b=Fr(_));const k=new ue(r);k.setProperties({name:p.name||l,paths:b,customProperties:p}),r.addLogByEvent(k)}if(h&&h.length)for(let p of h){let f="";e!=null&&e.trackElementPath&&(f=Fr(p.element));const w=new ue(r);w.setProperties({name:p.name,paths:f,customProperties:{selector:p.selector,name:p.name}}),r.addLogByEvent(w)}},!0)},So=(r,e,n,s)=>{const i={paths:"",customProperties:{}};"customProperties"in e?i.customProperties=e.customProperties:i.customProperties=e;const a=Lt(r,"click");let u=e.paths||"";s&&!u&&(n==null?void 0:n.trackElementPath)&&(u=Fr(s.target),i.paths=u),a.setProperties(i),r.addLogByEvent(a)},Po=r=>{r||(r={}),ue.eventOptions=r,ue.initApaasTrackHook=e=>{e.executeClickEvent=(n,s)=>{So(e,n,r,s)}},ue.startApaasTrackHook=e=>{To(e,r)},Et.registerEvent("click",ue)},he=[],Un=r=>{he.length||window.addEventListener("pagehide",(...e)=>{he.forEach(n=>{n(...e)})}),he.push(r)},Lo=r=>{for(let e=0;e<he.length;e++){const n=he[e];r===n&&he.splice(e,1)}},Dt=[],Eo=r=>{Dt.length||(document.addEventListener("click",(...e)=>{Dt.forEach(n=>{n(...e)})}),document.addEventListener("mouseover",(...e)=>{Dt.forEach(n=>{n(...e)})}),document.addEventListener("scroll",(...e)=>{Dt.forEach(n=>{n(...e)})}),document.addEventListener("keydown",(...e)=>{Dt.forEach(n=>{n(...e)})})),Dt.push(r)},Bo=r=>{for(let e=0;e<Dt.length;e++){const n=Dt[e];r===n&&Dt.splice(e,1)}};class qn extends st{constructor(e){super(e,"close")}}const xo=r=>{Un(e=>{if(r){r.sendByBeacon();const n=Lt(r,"close").getEventLog();r.addToLegancyLog(n)}})},Co=()=>{qn.startApaasTrackHook=r=>{xo(r)},Et.registerEvent("close",qn)};class $n extends st{constructor(e){super(e,"entermain"),y(this,"groupid",""),y(this,"localtime",""),y(this,"cheatinfo",{})}getProperties(){return{groupid:this.groupid,localtime:this.localtime,cheatinfo:this.cheatinfo}}setProperties(e){this.groupid=e.groupid,this.localtime=Date.now().toString()}}const Mo=()=>{$n.initApaasTrackHook=r=>{r.executeEnterMainEvent=()=>{const e=Lt(r,"entermain");e.setProperties({groupid:r.groupid}),r.addLogByEvent(e)}},Ee.registerEvent("entermain",$n)},Ro=(r,e={})=>{Gt(e)||(e={});let n=r?r.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e},Me=(r,e)=>{let n="";switch(r){case"":case"text":case"json":if(Pe(e))try{n=JSON.parse(e),n=hn(n,{maxDepth:10,keyMaxLen:1e4,pretty:!0,standardJSON:!0})}catch{n=ln(String(e),1e4)}else Gt(e)||Pt(e)?n=hn(e,{maxDepth:10,keyMaxLen:1e4,pretty:!0,standardJSON:!0}):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":case"formdata":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},Jn=r=>{if(!r)return null;let e=null;if(typeof r=="string")try{e=JSON.parse(r)}catch{const n=r.split("&");if(n.length===1)e=r;else{e={};for(let s of n){const i=s.split("=");e[i[0]]=i[1]===void 0?"undefined":i[1]}}}else if(Ns(r))if(e={},Pt(r)&&an(r[0]))e=r;else for(const[n,s]of r)e[n]=typeof s=="string"?s:"[object Object]";else Us(r)?e=r:e=`[object ${js(r)}]`;return e},Gn=(r="")=>(r.startsWith("//")&&(r=`${new URL(window.location.href).protocol}${r}`),r.startsWith("http")?new URL(r):new URL(r,window.location.href));class Xn{constructor(){y(this,"id",""),y(this,"name",""),y(this,"method",""),y(this,"url",""),y(this,"status",0),y(this,"statusText",""),y(this,"cancelState",0),y(this,"readyState",0),y(this,"header",null),y(this,"responseType",""),y(this,"requestType","xhr"),y(this,"requestHeader",null),y(this,"response"),y(this,"responseSize",0),y(this,"responseSizeText",""),y(this,"startTime",0),y(this,"startTimeText",""),y(this,"endTime",0),y(this,"costTime",0),y(this,"getData",null),y(this,"postData",null),y(this,"postLength",0),y(this,"actived",!1),y(this,"noVConsole",!1),y(this,"_XMLReq",null),this.id=ae()}}class Do{constructor(e,n,s){y(this,"resp"),y(this,"item"),y(this,"onUpdateCallback"),this.resp=e,this.item=n,this.onUpdateCallback=s,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=Me(this.item.responseType,i),this.onUpdateCallback(this.item),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===4)return s;const i=s.read,a=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(u=>{if(!e)e=new Uint8Array(u.value);else{const h=new Uint8Array(e.length+u.value.length);h.set(e),h.set(u.value,e.length),e=h}return this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=u.done?4:3,this.item.statusText=u.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Le(this.item.responseSize),u.done&&(this.item.response=Me(this.item.responseType,e)),this.onUpdateCallback(this.item),u}),s.cancel=(...u)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=Me(this.item.responseType,e),this.onUpdateCallback(this.item),a.apply(s,u)),s}}}class Ao{constructor(e){y(this,"onUpdateCallback"),this.onUpdateCallback=e}apply(e,n,s){const i=s[0],a=s[1],u=new Xn;return this.beforeFetch(u,i,a),e.apply(window,s).then(this.afterFetch(u)).catch(h=>{throw u.endTime=Date.now(),u.costTime=u.endTime-(u.startTime||u.endTime),this.onUpdateCallback(u),h})}beforeFetch(e,n,s){let i,a="GET",u=null;if(Pe(n)?(a=(s==null?void 0:s.method)||"GET",i=Gn(n),u=(s==null?void 0:s.headers)||null):(a=n.method||"GET",i=Gn(n.url),u=n.headers),e.method=a,e.requestType="fetch",e.requestHeader=u,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,!e.startTime){e.startTime=Date.now();const h=sn(e.startTime);e.startTimeText=`${h.year}-${h.month}-${h.day} ${h.hour}:${h.minute}:${h.second}.${h.millisecond}`}if(Object.prototype.toString.call(u)==="[object Headers]"){e.requestHeader={};for(const[h,_]of u)e.requestHeader[h]=_}else e.requestHeader=u;if(i.search&&i.searchParams){e.getData={};for(const[h,_]of i.searchParams)e.getData[h]=_}s!=null&&s.body&&(e.postData=Jn(s.body)),this.onUpdateCallback(e)}afterFetch(e){return n=>{e.endTime=Date.now(),e.costTime=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,a]of n.headers)e.header[i]=a,s=a.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Le(e.responseSize),e.response=Me(e.responseType,i),this.onUpdateCallback(e)})),this.onUpdateCallback(e),new Proxy(n,new Do(n,e,this.onUpdateCallback))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Wn{static create(e){return new Proxy(window.fetch,new Ao(e))}}y(Wn,"origFetch",window.fetch);class Oo{constructor(e,n){y(this,"XMLReq"),y(this,"item"),y(this,"onUpdateCallback"),this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new Xn,this.item._XMLReq=e,this.item.requestType="xhr",this.onUpdateCallback=n}get(e,n){switch(n){case"_noVConsole":return this.item.noVConsole;case"open":return this.getOpen(e);case"send":return this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"_noVConsole":return this.item.noVConsole=!!s,!1;case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),this.item.response=Me(this.item.responseType,this.item.response),this.triggerUpdate()}onAbort(){this.item.cancelState=1,this.item.statusText="Abort",this.triggerUpdate()}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout",this.triggerUpdate()}triggerUpdate(){this.item.noVConsole||this.onUpdateCallback(this.item)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{const i=s[0],a=s[1];return this.item.method=i?i.toUpperCase():"GET",this.item.url=a||"",this.item.name=this.item.url.replace(new RegExp("[/]*$"),"").split("/").pop()||"",this.item.getData=Ro(this.item.url,{}),this.triggerUpdate(),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return i&&Object.prototype.hasOwnProperty.call(i,"length")&&(this.item.postLength=i.length),this.item.postData=Jn(i),this.triggerUpdate(),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],this.triggerUpdate(),n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case 0:case 1:if(this.item.status=0,this.item.statusText="Pending",!this.item.startTime){this.item.startTime=Date.now();const s=sn(this.item.startTime);this.item.startTimeText=`${s.year}-${s.month}-${s.day} ${s.hour}:${s.minute}:${s.second}.${s.millisecond}`}break;case 2:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
|
|
11
|
+
`);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const a=i.split(": "),u=a[0],h=a.slice(1).join(": ");this.item.header[u]=h}break;case 3:this.item.status=this.XMLReq.status,this.item.statusText="Loading",!!this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Le(this.item.responseSize));break;case 4:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=Date.now(),this.item.costTime=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,!!this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Le(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Qn{static create(e){return new Proxy(XMLHttpRequest,{construct(n){const s=new n;return new Proxy(s,new Oo(s,e))}})}}y(Qn,"origXMLHttpRequest",XMLHttpRequest);class sr extends st{constructor(e){super(e,"http"),y(this,"url",""),y(this,"method",""),y(this,"startTime",0),y(this,"endTime",0),y(this,"requestContentLength",0),y(this,"responseContentLength",0),y(this,"responseContent",null),y(this,"requestContent",null),y(this,"statusCode",0),y(this,"headers",{}),y(this,"trackOptions",{trackHeaders:!0,trackRequesetData:!1,trackResponseData:!1,trackFilter:void 0})}setTrackOptions(e){this.trackOptions={...this.trackOptions,...e}}getProperties(){return{url:this.url,method:this.method,header:this.trackOptions.trackHeaders?this.headers:void 0,code:this.statusCode,duration:(this.endTime-this.startTime)*1e6,reqcontentlength:this.requestContentLength,respcontentlength:this.responseContentLength,requestContent:this.trackOptions.trackRequesetData?this.requestContent:void 0,responseContent:this.trackOptions.trackResponseData?this.responseContent:void 0,start:this.startTime*1e6,end:this.endTime*1e6}}start(e,n,s,i){this.startTime=Date.now(),this.url=e,this.method=n,this.headers=i,this.requestContentLength=s}end(e,n){this.endTime=Date.now(),this.responseContentLength=e,this.statusCode=n}setProperties(e){this.url=e.url,this.method=e.method,this.startTime=e.startTime,this.endTime=e.endTime,this.requestContentLength=e.requestContentLength,this.responseContentLength=e.responseContentLength,this.statusCode=e.statusCode,this.trackOptions.trackResponseData&&(this.responseContent=e.responseContent),this.trackOptions.trackRequesetData&&(this.requestContent=e.requestContent);let n=e.headers;n&&(n={...n,token:""}),this.headers=n}}const zo=(r,e)=>{const n=(s,i)=>{var a,u,h;if(i.readyState===4&&i.url!==s.options.url){let _={url:i.url,method:i.method,startTime:i.startTime,endTime:i.endTime,requestContentLength:i.postLength,responseContentLength:i.responseSize,responseContent:i.response,requestContent:i.postData||i.getData,statusCode:i.status,headers:i.header||{}};if(e.trackFilter){const f=e.trackFilter(_,i);if(f===!1)return;typeof f=="object"?_=f:f===!0&&(e.trackResponseData&&_.responseContent&&((a=_.responseContent)==null?void 0:a.length)>1048576&&(_.responseContent=void 0),e.trackRequesetData&&_.requestContent&&((u=_.requestContent)==null?void 0:u.length)>1048576&&(_.requestContent=void 0))}else e.trackResponseData&&_.responseContent&&_.responseContent.length>1048576&&(_.responseContent=void 0),e.trackRequesetData&&_.requestContent&&((h=_.requestContent)==null?void 0:h.length)>1048576&&(_.requestContent=void 0);const p=new sr(s);p.setTrackOptions(e),p.setProperties(_),s.addLogByEvent(p)}};window.XMLHttpRequest=Qn.create(s=>{n(r,s)}),window.fetch=Wn.create(s=>{n(r,s)})},Fo=r=>{r||(r={trackHeaders:!0,trackResponseData:!1,trackRequesetData:!1}),sr.eventOptions=r,sr.startApaasTrackHook=e=>{zo(e,r)},Ee.registerEvent("http",sr)},_t=(r,e=!1)=>{let n=location.href.replace(/#\/.+$/,r);return e&&(n=n.replace(/\?\S+$/,"")),n},Vn=(r,e)=>{let n=history.pushState,s=history.replaceState,i=_t(location.hash),a=null;history.pushState=function(...u){const h=_t(location.hash),_=_t(u[2]||"");return i=_,r&&(a={newURL:_,oldURL:h,type:"push"},Tr(()=>{a&&(e(a),a=null)})),n.apply(this,u)},history.replaceState=function(...u){if(r){const h=_t(location.hash),_=_t(u[2]||"");a={newURL:_,oldURL:h,type:"replace"},i=_,Tr(()=>{if(a&&a.oldURL===h&&a.newURL===_){let p=_t(location.hash);h===_?_!==p?(a.newURL=p,a.type="push"):a.type="onload":a.type="replace",e(a),a=null}})}return s.apply(this,u)},window.addEventListener("popstate",u=>{if(r){const h=_t(location.hash);u.state&&(a={newURL:h,oldURL:i,type:u.state.forward?"back":"forward"},i=h,e(a),a=null)}})};var Ho=function(r,e){e===!0&&(e=0);var n="";if(typeof r=="string")try{n=new URL(r).protocol}catch{}else r&&r.constructor===URL&&(n=r.protocol);var s=n.split(/\:|\+/).filter(Boolean);return typeof e=="number"?s[e]:s},Io=Ho;function No(r){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:r,query:{},parse_failed:!1};try{var n=new URL(r);e.protocols=Io(n),e.protocol=e.protocols[0],e.port=n.port,e.resource=n.hostname,e.host=n.host,e.user=n.username||"",e.password=n.password||"",e.pathname=n.pathname,e.hash=n.hash.slice(1),e.search=n.search.slice(1),e.href=n.href,e.query=Object.fromEntries(n.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=r,e.query={},e.parse_failed=!0}return e}var jo=No;const Uo="text/plain",qo="us-ascii",Kn=(r,e)=>e.some(n=>n instanceof RegExp?n.test(r):n===r),$o=(r,{stripHash:e})=>{const n=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(r);if(!n)throw new Error(`Invalid URL: ${r}`);let{type:s,data:i,hash:a}=n.groups;const u=s.split(";");a=e?"":a;let h=!1;u[u.length-1]==="base64"&&(u.pop(),h=!0);const _=(u.shift()||"").toLowerCase(),p=[...u.map(f=>{let[w,l=""]=f.split("=").map(v=>v.trim());return w==="charset"&&(l=l.toLowerCase(),l===qo)?"":`${w}${l?`=${l}`:""}`}).filter(Boolean)];return h&&p.push("base64"),(p.length>0||_&&_!==Uo)&&p.unshift(_),`data:${p.join(";")},${h?i.trim():i}${a?`#${a}`:""}`};function Jo(r,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},r=r.trim(),/^data:/i.test(r))return $o(r,e);if(/^view-source:/i.test(r))throw new Error("`view-source:` is not supported as it is a non-standard protocol");const n=r.startsWith("//");!n&&/^\.*\//.test(r)||(r=r.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));const s=new URL(r);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&s.protocol==="https:"&&(s.protocol="http:"),e.forceHttps&&s.protocol==="http:"&&(s.protocol="https:"),e.stripAuthentication&&(s.username="",s.password=""),e.stripHash?s.hash="":e.stripTextFragment&&(s.hash=s.hash.replace(/#?:~:text.*?$/i,"")),s.pathname){const a=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let u=0,h="";for(;;){const _=a.exec(s.pathname);if(!_)break;const p=_[0],f=_.index;h+=s.pathname.slice(u,f).replace(/\/{2,}/g,"/"),h+=p,u=f+p.length}h+=s.pathname.slice(u,s.pathname.length).replace(/\/{2,}/g,"/"),s.pathname=h}if(s.pathname)try{s.pathname=decodeURI(s.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let a=s.pathname.split("/");const u=a[a.length-1];Kn(u,e.removeDirectoryIndex)&&(a=a.slice(0,-1),s.pathname=a.slice(1).join("/")+"/")}if(s.hostname&&(s.hostname=s.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(s.hostname)&&(s.hostname=s.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(const a of[...s.searchParams.keys()])Kn(a,e.removeQueryParameters)&&s.searchParams.delete(a);if(e.removeQueryParameters===!0&&(s.search=""),e.sortQueryParameters){s.searchParams.sort();try{s.search=decodeURIComponent(s.search)}catch{}}e.removeTrailingSlash&&(s.pathname=s.pathname.replace(/\/$/,""));const i=r;return r=s.toString(),!e.removeSingleSlash&&s.pathname==="/"&&!i.endsWith("/")&&s.hash===""&&(r=r.replace(/\/$/,"")),(e.removeTrailingSlash||s.pathname==="/")&&s.hash===""&&e.removeSingleSlash&&(r=r.replace(/\/$/,"")),n&&!e.normalizeProtocol&&(r=r.replace(/^http:\/\//,"//")),e.stripProtocol&&(r=r.replace(/^(?:https?:)?\/\//,"")),r}const Re=(r,e=!1)=>{const n=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,s=a=>{const u=new Error(a);throw u.subject_url=r,u};(typeof r!="string"||!r.trim())&&s("Invalid url."),r.length>Re.MAX_INPUT_LENGTH&&s("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),e&&(typeof e!="object"&&(e={stripHash:!1}),r=Jo(r,e));const i=jo(r);if(i.parse_failed){const a=i.href.match(n);a?(i.protocols=["ssh"],i.protocol="ssh",i.resource=a[2],i.host=a[2],i.user=a[1],i.pathname=`/${a[3]}`,i.parse_failed=!1):s("URL parsing failed.")}return i};Re.MAX_INPUT_LENGTH=2048,Re.MAX_INPUT_LENGTH=2048*1024;class le extends st{constructor(e){super(e,"online"),y(this,"url",""),y(this,"duration",0),y(this,"startTime",0),y(this,"endTime",0),y(this,"views",[])}getProperties(){return{url:this.url,duration:this.duration,startTime:this.startTime,endTime:this.endTime}}setProperties(e){this.duration=e.duration,this.url=e.url,this.startTime=e.startTime,this.endTime=e.endTime,e.views&&(this.views=e.views)}}let De=null;const Zn=(r,e)=>{const n=()=>!0;let s=typeof e=="object"&&e.collectUrl?e.collectUrl:n;return i=>{let a=Re(i.newURL),u=Re(i.oldURL),h=_t(`#${a.hash}`,!0);i.oldURL&&_t(`#${u.hash}`,!0),De&&(De.stop(),De.destroy(),De=null),s(location)&&(De=new Go(r,h))}};class Go{constructor(e,n,s){y(this,"url",""),y(this,"duration",0),y(this,"startTime",0),y(this,"onlineOptions"),y(this,"apaasTrack"),y(this,"visibleChangeHandler"),y(this,"beforeUnLoadHandler"),y(this,"userActionHandler"),y(this,"onlineTimer",null),y(this,"stopTimeout",null),this.url=n,this.apaasTrack=e,this.onlineOptions=s||{collectUrl:void 0},this.visibleChangeHandler=i=>{const a=i.target.visibilityState;this.stopUserActionMonitor(),a==="visible"?this.start():this.startUserActionMonitor()},this.beforeUnLoadHandler=i=>{if(this.apaasTrack){const a=Date.now()-this.startTime;this.saveOnlineData(a);const u=this.apaasTrack.getStorageData();if(u.onlineData)for(let h in u.onlineData){const _=u.onlineData[h],p=new le(this.apaasTrack);p.setProperties({duration:_.duration,url:h,startTime:_.startTime,endTime:_.lastTime,views:_.views});const f=p.getEventLog();e.addToLegancyLog(f)}this.cleanOnlineData()}},this.userActionHandler=so(i=>{console.log("\u6709\u7528\u6237\u884C\u4E3A"),this.stopUserActionMonitor(),this.start(),this.startUserActionMonitor()},60*1e3,{leading:!0,trailing:!1}),Un(this.beforeUnLoadHandler),Eo(this.userActionHandler),this.init()}startUserActionMonitor(){console.log("startUserActionMonitor"),!this.stopTimeout&&(this.stopTimeout=window.setTimeout(()=>{this.onlineTimer&&(console.log("\u65E0\u6548\u64CD\u4F5C\u65F6\u957F\uFF0C\u7528\u6237\u5DF2\u4E0B\u7EBF..."),clearInterval(this.onlineTimer),this.onlineTimer=null,this.saveOnlineData(this.duration),this.sendRecord(!1,this.url))},1e3*60))}stopUserActionMonitor(){console.log("stopUserActionMonitor"),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}init(){let e=this.apaasTrack.getStorageData();e||(this.apaasTrack.initStorageData(),e=this.apaasTrack.getStorageData()),e.onlineData?this.cleanOnlineData():e.onlineData={},localStorage.setItem("apaas-track",JSON.stringify(e)),document.addEventListener("visibilitychange",this.visibleChangeHandler),this.start();const n=window.document.createEvent("MouseEvent");this.userActionHandler(n)}saveOnlineData(e,n){const s=this.apaasTrack.getStorageData();let i=s.onlineData,a=i[this.url]||(i[this.url]={duration:0,lastTime:Date.now()});a.duration=e,a.lastTime=Date.now(),a.startTime=this.startTime,n&&(a.views||(a.views=[]),a.views.push({name:n.name,duration:n.duration})),s.onlineData[this.url]=a,localStorage.setItem("apaas-track",JSON.stringify(s))}getStorageOnlineData(){return this.apaasTrack.getStorageData().onlineData}cleanOnlineData(e){const n=this.apaasTrack.getStorageData();!n.onlineData||(e?delete n.onlineData[e]:n.onlineData={},localStorage.setItem("apaas-track",JSON.stringify(n)))}start(){if(this.onlineTimer)return;this.startTime=Date.now(),this.duration=0;let e=10*1e3;this.onlineTimer=window.setInterval(()=>{console.log("onlineTimer---"),this.duration+=e,this.saveOnlineData(this.duration)},e)}stop(){if(this.onlineTimer){clearInterval(this.onlineTimer),this.onlineTimer=null;const e=Date.now()-this.startTime;this.duration=e,this.saveOnlineData(e),this.sendRecord(!1,this.url)}}destroy(){this.stopUserActionMonitor(),document.removeEventListener("visibilitychange",this.visibleChangeHandler),this.beforeUnLoadHandler&&Lo(this.beforeUnLoadHandler),this.userActionHandler&&Bo(this.userActionHandler)}sendRecord(e=!1,n){const s=this.getStorageOnlineData();if(s)if(n){const i=s[n];if(i!=null&&i.duration){const a=new le(this.apaasTrack);a.setProperties({duration:i.duration,url:n,startTime:i.startTime,endTime:i.lastTime,views:i.views}),this.apaasTrack.addLogByEvent(a),e&&this.apaasTrack.sendByBeacon()}this.cleanOnlineData(n)}else{for(let i in s){const a=s[i];if(a.duration){const u=new le(this.apaasTrack);u.setProperties({duration:a.duration,url:i,startTime:a.startTime,endTime:a.lastTime,views:a.views}),this.apaasTrack.addLogByEvent(u),e&&this.apaasTrack.sendByBeacon()}}this.cleanOnlineData()}this.duration=0,this.startTime=0}}const Xo=r=>{console.log("registerOnlineEvent"),r||(r={}),le.eventOptions=r,le.startApaasTrackHook=e=>{console.log("registerOnlineEvent startApaasTrackHook");let n=null;Vn(e,a=>{console.log("online listenHistoryChange"),n||(n=Zn(e)),n(a)});const s=()=>{i&&clearTimeout(i),n||(n=Zn(e));const a={newURL:_t(location.hash),oldURL:_t(location.hash),type:"onload"};n(a),window.removeEventListener("load",s)};let i=null;window.self!==window.top&&(window.addEventListener("load",s),i=setTimeout(()=>{s(),clearTimeout(i)},3e3))},Et.registerEvent("online",le)};class Hr extends st{constructor(e){super(e,"pageview",Sr.HIGH),y(this,"oldURL",""),y(this,"newURL",""),y(this,"entertype","")}getProperties(){return{from:this.oldURL,to:this.newURL,entertype:this.entertype}}setProperties(e){this.oldURL=e.oldURL,this.newURL=e.newURL,this.entertype=e.type}}const Wo=(r,e)=>{const n=new Hr(r);n.setProperties(e);const s=n.getEventLog();r.addLogToQueue(s,!0)},Qo=()=>{Hr.startApaasTrackHook=r=>{Vn(r,e=>{Wo(r,e)})},Et.registerEvent("pageview",Hr)};var It,Ae,Yn,ir,Ir,ts=-1,Vt=function(r){addEventListener("pageshow",function(e){e.persisted&&(ts=e.timeStamp,r(e))},!0)},Nr=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},ar=function(){var r=Nr();return r&&r.activationStart||0},ft=function(r,e){var n=Nr(),s="navigate";return ts>=0?s="back-forward-cache":n&&(s=document.prerendering||ar()>0?"prerender":document.wasDiscarded?"restore":n.type.replace(/_/g,"-")),{name:r,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:s}},pe=function(r,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var s=new PerformanceObserver(function(i){Promise.resolve().then(function(){e(i.getEntries())})});return s.observe(Object.assign({type:r,buffered:!0},n||{})),s}}catch{}},or=function(r,e){var n=function s(i){i.type!=="pagehide"&&document.visibilityState!=="hidden"||(r(i),e&&(removeEventListener("visibilitychange",s,!0),removeEventListener("pagehide",s,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},gt=function(r,e,n,s){var i,a;return function(u){e.value>=0&&(u||s)&&((a=e.value-(i||0))||i===void 0)&&(i=e.value,e.delta=a,e.rating=function(h,_){return h>_[1]?"poor":h>_[0]?"needs-improvement":"good"}(e.value,n),r(e))}},jr=function(r){requestAnimationFrame(function(){return requestAnimationFrame(function(){return r()})})},de=function(r){document.prerendering?addEventListener("prerenderingchange",function(){return r()},!0):r()},me=-1,es=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},cr=function(r){document.visibilityState==="hidden"&&me>-1&&(me=r.type==="visibilitychange"?r.timeStamp:0,Vo())},rs=function(){addEventListener("visibilitychange",cr,!0),addEventListener("prerenderingchange",cr,!0)},Vo=function(){removeEventListener("visibilitychange",cr,!0),removeEventListener("prerenderingchange",cr,!0)},Ur=function(){return me<0&&(me=es(),rs(),Vt(function(){setTimeout(function(){me=es(),rs()},0)})),{get firstHiddenTime(){return me}}},ns=function(r,e){e=e||{},de(function(){var n,s=[1800,3e3],i=Ur(),a=ft("FCP"),u=pe("paint",function(h){h.forEach(function(_){_.name==="first-contentful-paint"&&(u.disconnect(),_.startTime<i.firstHiddenTime&&(a.value=Math.max(_.startTime-ar(),0),a.entries.push(_),n(!0)))})});u&&(n=gt(r,a,s,e.reportAllChanges),Vt(function(h){a=ft("FCP"),n=gt(r,a,s,e.reportAllChanges),jr(function(){a.value=performance.now()-h.timeStamp,n(!0)})}))})},Ko=function(r,e){e=e||{},de(function(){var n,s=[.1,.25],i=ft("CLS"),a=-1,u=0,h=[],_=function(w){a>-1&&r(w)},p=function(w){w.forEach(function(l){if(!l.hadRecentInput){var v=h[0],b=h[h.length-1];u&&l.startTime-b.startTime<1e3&&l.startTime-v.startTime<5e3?(u+=l.value,h.push(l)):(u=l.value,h=[l]),u>i.value&&(i.value=u,i.entries=h,n())}})},f=pe("layout-shift",p);f&&(n=gt(_,i,s,e.reportAllChanges),ns(function(w){a=w.value,i.value<0&&(i.value=0,n())}),or(function(){p(f.takeRecords()),n(!0)}),Vt(function(){u=0,a=-1,i=ft("CLS",0),n=gt(_,i,s,e.reportAllChanges),jr(function(){return n()})}))})},Oe={passive:!0,capture:!0},Zo=new Date,ss=function(r,e){It||(It=e,Ae=r,Yn=new Date,as(removeEventListener),is())},is=function(){if(Ae>=0&&Ae<Yn-Zo){var r={entryType:"first-input",name:It.type,target:It.target,cancelable:It.cancelable,startTime:It.timeStamp,processingStart:It.timeStamp+Ae};ir.forEach(function(e){e(r)}),ir=[]}},Yo=function(r){if(r.cancelable){var e=(r.timeStamp>1e12?new Date:performance.now())-r.timeStamp;r.type=="pointerdown"?function(n,s){var i=function(){ss(n,s),u()},a=function(){u()},u=function(){removeEventListener("pointerup",i,Oe),removeEventListener("pointercancel",a,Oe)};addEventListener("pointerup",i,Oe),addEventListener("pointercancel",a,Oe)}(e,r):ss(e,r)}},as=function(r){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return r(e,Yo,Oe)})},tc=function(r,e){e=e||{},de(function(){var n,s=[100,300],i=Ur(),a=ft("FID"),u=function(p){p.startTime<i.firstHiddenTime&&(a.value=p.processingStart-p.startTime,a.entries.push(p),n(!0))},h=function(p){p.forEach(u)},_=pe("first-input",h);n=gt(r,a,s,e.reportAllChanges),_&&or(function(){h(_.takeRecords()),_.disconnect()},!0),_&&Vt(function(){var p;a=ft("FID"),n=gt(r,a,s,e.reportAllChanges),ir=[],Ae=-1,It=null,as(addEventListener),p=u,ir.push(p),is()})})},os=0,qr=1/0,ur=0,ec=function(r){r.forEach(function(e){e.interactionId&&(qr=Math.min(qr,e.interactionId),ur=Math.max(ur,e.interactionId),os=ur?(ur-qr)/7+1:0)})},cs=function(){return Ir?os:performance.interactionCount||0},rc=function(){"interactionCount"in performance||Ir||(Ir=pe("event",ec,{type:"event",buffered:!0,durationThreshold:0}))},us=0,hs=function(){return cs()-us},Bt=[],$r={},ls=function(r){var e=Bt[Bt.length-1],n=$r[r.interactionId];if(n||Bt.length<10||r.duration>e.latency){if(n)n.entries.push(r),n.latency=Math.max(n.latency,r.duration);else{var s={id:r.interactionId,latency:r.duration,entries:[r]};$r[s.id]=s,Bt.push(s)}Bt.sort(function(i,a){return a.latency-i.latency}),Bt.splice(10).forEach(function(i){delete $r[i.id]})}},nc=function(r,e){e=e||{},de(function(){var n=[200,500];rc();var s,i=ft("INP"),a=function(h){h.forEach(function(f){f.interactionId&&ls(f),f.entryType==="first-input"&&!Bt.some(function(w){return w.entries.some(function(l){return f.duration===l.duration&&f.startTime===l.startTime})})&&ls(f)});var _,p=(_=Math.min(Bt.length-1,Math.floor(hs()/50)),Bt[_]);p&&p.latency!==i.value&&(i.value=p.latency,i.entries=p.entries,s())},u=pe("event",a,{durationThreshold:e.durationThreshold||40});s=gt(r,i,n,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),or(function(){a(u.takeRecords()),i.value<0&&hs()>0&&(i.value=0,i.entries=[]),s(!0)}),Vt(function(){Bt=[],us=cs(),i=ft("INP"),s=gt(r,i,n,e.reportAllChanges)}))})},Jr={},sc=function(r,e){e=e||{},de(function(){var n,s=[2500,4e3],i=Ur(),a=ft("LCP"),u=function(p){var f=p[p.length-1];if(f){var w=Math.max(f.startTime-ar(),0);w<i.firstHiddenTime&&(a.value=w,a.entries=[f],n())}},h=pe("largest-contentful-paint",u);if(h){n=gt(r,a,s,e.reportAllChanges);var _=function(){Jr[a.id]||(u(h.takeRecords()),h.disconnect(),Jr[a.id]=!0,n(!0))};["keydown","click"].forEach(function(p){addEventListener(p,_,{once:!0,capture:!0})}),or(_,!0),Vt(function(p){a=ft("LCP"),n=gt(r,a,s,e.reportAllChanges),jr(function(){a.value=performance.now()-p.timeStamp,Jr[a.id]=!0,n(!0)})})}})},ic=function r(e){document.prerendering?de(function(){return r(e)}):document.readyState!=="complete"?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)},ac=function(r,e){e=e||{};var n=[800,1800],s=ft("TTFB"),i=gt(r,s,n,e.reportAllChanges);ic(function(){var a=Nr();if(a){var u=a.responseStart;if(u<=0||u>performance.now())return;s.value=Math.max(u-ar(),0),s.entries=[a],i(!0),Vt(function(){s=ft("TTFB",0),(i=gt(r,s,n,e.reportAllChanges))(!0)})}})};class Gr extends st{constructor(e){super(e,"performance"),y(this,"performanceData",null)}getProperties(){return{...this.performanceData}}setProperties(e){this.performanceData=e}track(){return new Promise((e,n)=>{let s={cls:null,lcp:null,ttfb:null,fcp:null,fid:null,inp:null};setTimeout(()=>{const a=performance.timing,u={...s,connectEnd:a.connectEnd,connectStart:a.connectStart,domComplete:a.domComplete,domContentLoadedEventEnd:a.domContentLoadedEventEnd,domContentLoadedEventStart:a.domContentLoadedEventStart,domInteractive:a.domInteractive,domLoading:a.domLoading,domainLookupEnd:a.domainLookupEnd,domainLookupStart:a.domainLookupStart,fetchStart:a.fetchStart,loadEventEnd:a.loadEventEnd,loadEventStart:a.loadEventStart,navigationStart:a.navigationStart,redirectEnd:a.redirectEnd,redirectStart:a.redirectStart,requestStart:a.requestStart,responseEnd:a.responseEnd,responseStart:a.responseStart,secureConnectionStart:a.secureConnectionStart,unloadEventEnd:a.unloadEventEnd,unloadEventStart:a.unloadEventStart};this.setProperties(u),e(u)},1e4),sc(a=>{i(a)}),Ko(a=>{i(a)}),ac(a=>{i(a)}),ns(a=>{i(a)}),tc(a=>{i(a)}),nc(a=>{i(a)});const i=a=>{a.name==="FID"?s.fid=a.value:a.name==="CLS"?s.cls=a.value:a.name==="FCP"?s.fcp=a.value:a.name==="TTFB"?s.ttfb=a.value:a.name==="LCP"?s.lcp=a.value:a.name==="INP"&&(s.inp=a.value)}})}}const oc=async r=>{const e=new Gr(r);await e.track(),r.addLogByEvent(e)},cc=()=>{Gr.startApaasTrackHook=r=>{oc(r)},Et.registerEvent("performance",Gr)};class ps extends st{constructor(e){super(e,"throw"),y(this,"message",""),y(this,"detailmessage",""),y(this,"name",""),y(this,"stack",[]),y(this,"cause",{})}getProperties(){return{message:this.message,detailmessage:this.detailmessage,name:this.name,stack:this.stack,cause:this.cause}}setError(e){const n=kr(e);this.message=n.message,this.detailmessage=n.detail,this.name=n.name,this.stack=n.stack}}const uc=r=>{window.addEventListener("error",e=>{const n=Lt(r,"throw");n.setError(e.error),r.addLogByEvent(n)}),window.addEventListener("unhandledrejection",e=>{const n=Lt(r,"throw");n.setError(e.reason),r.addLogByEvent(n)})},hc=()=>{ps.startApaasTrackHook=r=>{uc(r)},Et.registerEvent("throw",ps)},lc=()=>{cc(),hc(),Mo()},pc=r=>{lc(),Qo(),Co(),(r==null?void 0:r.http)!==!1&&Fo(typeof(r==null?void 0:r.http)=="object"?r.http:void 0),r!=null&&r.click&&Po(typeof r.click=="object"?r.click:void 0),r!=null&&r.online&&Xo(typeof r.online=="object"?r.online:void 0)},dc=r=>(pc(r),mc(r)),mc=r=>new Et(r);class Kt{constructor(e,n,s){y(this,"_level",0),this.apaasTrack=e,this.type=n,s&&(this._level=s)}getProperties(){return{}}setProperties(e){}getEventLog(e){const n=e||Date.now();return{...this.apaasTrack.baseLog,types:this.type,logtime:String(n),epochnanos:String(n)+"000000",event:this.type,properties:this.getProperties(),url:oe()}}}y(Kt,"eventOptions"),y(Kt,"initApaasTrackHook"),y(Kt,"startApaasTrackHook"),y(Kt,"destroyApaasTrackHook");class fc extends Kt{constructor(e){super(e,"init")}getProperties(){const e=this.apaasTrack.baseLog;return{system:e.system||"",systemver:e.systemver||"",manufacturer:e.manufacturer||"",browser:e.browser||"",browserver:e.browserver||"",terminalid:e.terminalid||"",client:e.client||"",clientver:e.clientver||""}}}class gc extends Kt{constructor(e){super(e,"custom"),y(this,"info",{})}setCustomType(e){this.type=e}getProperties(){return{...this.info}}setProperties(e){this.info=e}}const fe={init:fc,custom:gc},hr=(r,e)=>{const n=fe[e];return new n(r)},vc=(r,e,n)=>{const s=n||Date.now(),i=hr(r,e);return{...r.baseLog,types:e,logtime:String(s),epochnanos:String(s)+"000000",event:e,properties:i.getProperties(),url:oe()}},ds=(r,e,n)=>{const s=n||Date.now();return{...r.baseLog,types:e.type,logtime:String(s),epochnanos:String(s)+"000000",event:e.type,properties:e.getProperties(),url:oe()}},ms=(r,e)=>{if(fe[r])throw Error(`\u8BE5\u4E8B\u4EF6${r} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);fe[r]=e};class _c{constructor(e,n){y(this,"name",""),y(this,"time",0),y(this,"info",{}),e&&(this.name=e),n&&(this.info=n),this.time=Date.now()}get epochnanos(){return this.time*1e6}get attributes(){return this.getAttributes()}getAttributes(){return{}}getJson(){return{name:this.name,epochnanos:this.time*1e6,attributes:this.getAttributes(),...this.info}}setInfo(e){this.info=e||{}}}class wc extends _c{constructor(){super(...arguments),y(this,"name","exception"),y(this,"exceptionType",""),y(this,"exceptionMessage",""),y(this,"exceptionStackTrace","")}getAttributes(){return{"exception.type":this.exceptionType,"exception.message":this.exceptionMessage,"exception.stacktrace":this.exceptionStackTrace}}setInfo(e){this.exceptionMessage=e.exceptionMessage,this.exceptionType=e.exceptionType,this.exceptionStackTrace=e.exceptionStackTrace}}class Xr extends Kt{constructor(e,n,s){super(e,"span"),y(this,"spanid",""),y(this,"traceid",""),y(this,"parentspanid",""),y(this,"name",""),y(this,"attributes",{}),y(this,"events",[]),y(this,"statuscode","OK"),y(this,"statusmessage",""),y(this,"startTime",0),y(this,"endTime",0),this.name=n,this.traceid=ae(),this.spanid=nn(),this.parentspanid=s||"",this.start()}trackLog(){this.apaasTrack.addLogByEvent(this)}createSpanEvent(e,n){return new Xr(this.apaasTrack,e,n)}setAttribute(e){const n=e.getAttributes();this.attributes=n}addEvent(e){this.events.push(e)}exception(e){const n=new wc;let s="",i="",a="";if(e instanceof Error){const u=kr(e);s=u.detail,i=u.name,a=u.stack.join(",")}else s=e.exceptionMessage,i=e.exceptionType,a=e.exceptionStackTrace;n.setInfo({exceptionMessage:s,exceptionType:i,exceptionStackTrace:a}),this.events.push(n)}start(){this.startTime=Date.now()}end(e,n){e&&(this.statusmessage=e),n&&(this.statuscode=n),this.endTime=Date.now()}getProperties(){return{traceid:this.traceid,spanid:this.spanid,parentspanid:this.parentspanid,name:this.name,attributes:this.attributes,events:this.events.map(e=>e.getJson()),statuscode:this.statuscode,statusmessage:this.statusmessage,startepochnanos:this.startTime*1e6,endepochnanos:this.endTime*1e6,duration:(this.endTime-this.startTime)*1e6}}}class fs{constructor(e){y(this,"_version",Qe),y(this,"commonLog",null),y(this,"browserLog",null),y(this,"options"),this.options=e,typeof window<"u"&&(window.__apaasTrackVersion__=Qe),typeof wx<"u"&&!window&&(wx.__apaasTrackVersion__=Qe),e.commonLog&&this.initCommonLog(e.commonLog),this.runEventInitHooks()}registerEvent(e,n){ms(e,n),n.initApaasTrackHook&&n.initApaasTrackHook(this),n.startApaasTrackHook&&n.startApaasTrackHook(this)}get groupid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}runEventInitHooks(){Object.values(fe).forEach(e=>{e.initApaasTrackHook&&e.initApaasTrackHook(this)})}runEventStartHooks(){Object.values(fe).forEach(e=>{e.startApaasTrackHook&&e.startApaasTrackHook(this)})}runEventDestroyHooks(){Object.values(fe).forEach(e=>{e.destroyApaasTrackHook&&e.destroyApaasTrackHook(this)})}get anonymousid(){var e;return(e=this.browserLog)==null?void 0:e.anonymousid}get distinctid(){var e;return(e=this.browserLog)==null?void 0:e.distinctid}get baseLog(){return{...this.browserLog,...this.commonLog}}initCommonLog(e){this.commonLog=e}createEventLog(e,n){return vc(this,e,n)}addLogByType(e,n){const s=this.createEventLog(e,n);this.addLogToQueue(s)}addLogByEvent(e,n){const s=ds(this,e,n);this.addLogToQueue(s)}createCustomEvent(e){const n=hr(this,"custom");return n.setCustomType(e),n}createSpanEvent(e,n){return new Xr(this,e,n)}addLogByCustomEvent(e,n={},s){const i=this.createCustomEvent(e);i.setProperties(n);const a=ds(this,i,s);this.addLogToQueue(a)}executeInitEvent(){const e=hr(this,"init");e.setProperties({groupid:this.groupid}),this.addLogByEvent(e)}updateCommonLog(e){this.commonLog={...this.commonLog,...e}}trackEvent(e,n={},s){const i=hr(this,e);i.setProperties(n),this.addLogByEvent(i,s)}start(...e){this.executeInitEvent(),this.runEventStartHooks()}destroy(){this.runEventDestroyHooks()}transformLog(e){return e}async addLogToQueue(e,n=!1,s=!0){s&&(e=this.transformLog(e)),await this.sendLog(e,n)}}y(fs,"registerEvent",ms);const gs=async r=>{var i,a;let e=await r.getWebInitParams();const n=location.origin+"/static/apaas-track/apaas-spu/lzma_worker.js";console.log("createApaasTrack lzma_worker",n),hi(n);const s=dc({url:r.url||"",click:{trackElementPath:!0},commonLog:{client:"Web",...e},online:(r==null?void 0:r.online)||!1,pageview:!0,http:(i=r.http)!=null?i:!0,zip:r.zip!==void 0?r.zip:!0,useIndexDB:(a=r==null?void 0:r.useIndexDB)!=null?a:!1});return s.sendLog=r.sendLog,s.start=function(...u){return fs.prototype.start.call(this,...u)},r.sendLog===Qr&&(s.start=function(...u){return Et.prototype.start.call(this,...u)}),r.startFn&&(s.start=r.startFn),s};let Wr=null;const yc=async r=>{var n,s,i;if(Wr)return Wr;const e=await gs({url:(r==null?void 0:r.url)||"",sendLog:(r==null?void 0:r.sendLog)||Qr,startFn:(r==null?void 0:r.startFn)||null,online:(r==null?void 0:r.online)||!1,getWebInitParams:(r==null?void 0:r.getWebInitParams)||vs,zip:(n=r==null?void 0:r.zip)!=null?n:!0,useIndexDB:(s=r==null?void 0:r.useIndexDB)!=null?s:!1,http:(i=r==null?void 0:r.http)!=null?i:!0});return Wr=e,e},vs=()=>new Promise((r,e)=>{if(window.aPaaS&&window.aPaaS.getWebInitParams){const n=window.aPaaS.getWebInitParams(s=>{r(s)});n&&n.then&&n.then(s=>{r(s)})}else{window.parent.postMessage({type:"getWebInitParams"},"*");const n=i=>{const a=(i==null?void 0:i.data)||{};if(a.type==="receiveWebInitParams")if(a.data){const u=a.data;r(u),s&&(clearTimeout(s),s=null),window.removeEventListener("message",n)}else e(Error("receiveWebInitParams response null"))};window.addEventListener("message",n);let s=window.setTimeout(()=>{e(Error("postMessage getWebInitParams timeout"))},2e3)}});function bc(...r){return Et.prototype.start.call(this,r)}function Qr(r,e){var n;return(n=window.aPaaS)!=null&&n.sendLog?window.aPaaS.sendLog(r,e):Et.prototype.sendLog.call(this,r,e)}X.BaseEvent=st,X.BaseSpanAttribute=Ys,X.BaseTrack=Ee,X.CustomEvent=mn,X.EventLevel=Sr,X.EventMap=Xt,X.ExceptionSpanEvent=vn,X.InitEvent=dn,X.SpanEvent=We,X.SpanPropertyEvent=gn,X.TaskQueue=pn,X.createApaasTrack=gs,X.createEvent=Lt,X.defaultGetWebInitParams=vs,X.defaultWebSendFunction=Qr,X.defaultWebStartFunction=bc,X.getApaasSpuTrack=yc,X.getEventLog=Pr,X.getEventLogByType=fn,X.registerEvent=Lr,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|