pages-uni-stat-error-js-js.BZ2-SkmO.js 48 KB

12
  1. import{_ as e,B as t,o as n,c as a,w as r,g as s,z as o,J as i,C as l,D as u,h as c,i as p,k as d,l as h,F as m,j as g,t as f,u as _,aB as y,aG as w,W as b,aH as C,n as S,r as M,a as k,aD as E,A as P,b as x,d as v,e as L,f as T,a5 as O,m as A,S as D,ap as R}from"./index-BAMs4g2N.js";import{_ as U}from"./uni-stat-breadcrumb.BZcF2zJw.js";import{_ as F}from"./uni-data-select.UeW2d6Yw.js";import{_ as $}from"./uni-stat-tabs.SY9F3mAw.js";import{_ as I}from"./uni-stat-panel.X3T1D0jX.js";import{_ as N}from"./qiun-data-charts.D-NEYXGW.js";import{_ as q}from"./uni-tooltip.BDlhxQuq.js";import{_ as B}from"./uni-pagination.7SrZmsZK.js";import{_ as z}from"./uni-load-more.cjLoDhLq.js";import{i as j,s as G,d as V,g as W,j as J,h as Q,p as H,m as X,k as K}from"./util.BXBhmNoy.js";import{f as Y,p as Z}from"./fieldsMap.CvZ24T3N.js";const ee=e({name:"UniDrawer",components:{keypress:{name:"Keypress",props:{disable:{type:Boolean,default:!1}},mounted(){const e={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]};document.addEventListener("keyup",(t=>{if(this.disable)return;const n=Object.keys(e).find((n=>{const a=t.key,r=e[n];return r===a||Array.isArray(r)&&r.includes(a)}));n&&setTimeout((()=>{this.$emit(n,{})}),0)}))},render:()=>{}}},emits:["change"],props:{mode:{type:String,default:""},mask:{type:Boolean,default:!0},maskClick:{type:Boolean,default:!0},width:{type:Number,default:220}},data:()=>({visibleSync:!1,showDrawer:!1,rightMode:!1,watchTimer:null,drawerWidth:220}),created(){this.drawerWidth=this.width,this.rightMode="right"===this.mode},methods:{clear(){},close(e){("mask"!==e||this.maskClick)&&this.visibleSync&&this._change("showDrawer","visibleSync",!1)},open(){this.visibleSync||this._change("visibleSync","showDrawer",!0)},_change(e,t,n){this[e]=n,this.watchTimer&&clearTimeout(this.watchTimer),this.watchTimer=setTimeout((()=>{this[t]=n,this.$emit("change",n)}),n?50:300)}}},[["render",function(e,d,h,m,g,f){const _=p,y=t("keypress");return g.visibleSync?(n(),a(_,{key:0,class:o([{"uni-drawer--visible":g.showDrawer},"uni-drawer"]),onTouchmove:u(f.clear,["stop","prevent"])},{default:r((()=>[s(_,{class:o(["uni-drawer__mask",{"uni-drawer__mask--visible":g.showDrawer&&h.mask}]),onClick:d[0]||(d[0]=e=>f.close("mask"))},null,8,["class"]),s(_,{class:o(["uni-drawer__content",{"uni-drawer--right":g.rightMode,"uni-drawer--left":!g.rightMode,"uni-drawer__content--visible":g.showDrawer}]),style:i({width:g.drawerWidth+"px"})},{default:r((()=>[l(e.$slots,"default",{},void 0,!0)])),_:3},8,["class","style"]),s(y,{onEsc:d[1]||(d[1]=e=>f.close("mask"))})])),_:3},8,["class","onTouchmove"])):c("",!0)}],["__scopeId","data-v-ac0dbaaa"]]);const te=e({props:{uploadTasks:{type:Array,default:function(){return[]}},showProgress:{type:Boolean,default:!0}}},[["render",function(e,t,o,i,l,u){const w=_,b=y,C=p;return n(),a(C,null,{default:r((()=>[(n(!0),d(m,null,h(o.uploadTasks,((e,t)=>(n(),a(C,{key:t,class:"upload-task-body"},{default:r((()=>[s(C,{class:"upload-task-item"},{default:r((()=>[s(w,{class:"upload-task-item-name"},{default:r((()=>[g(f(e.name),1)])),_:2},1024),o.showProgress?(n(),a(b,{key:0,class:"upload-task-item-progress",activeColor:-1!==e.state?"#42b983":"#ff5a5f",percent:100*e.progress,active:"",duration:5},null,8,["activeColor","percent"])):c("",!0),s(C,{class:"flex",style:{"justify-content":"space-between"}},{default:r((()=>[s(w,{class:"upload-task-item-size"},{default:r((()=>[g(f(e.size),1)])),_:2},1024),s(w,{class:"upload-task-item-size"},{default:r((()=>[g(f(-1!==e.state?"":"失败"),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})}],["__scopeId","data-v-5938fce7"]]),ne={},ae=Object,re="undefined"!=typeof window&&window.window===window&&window.navigator,se=re?null:module.require,oe=e=>e[e.length-1],ie=e=>e.replace(/\\/g,"/"),le=re?window.location.href:ie(process.cwd())+"/";class ue{constructor(e,t,n){this.itemsHeader=[],this.isMP=!1;const a=e,r=e&&e instanceof SyntaxError&&!re;if(e||(e=new Error,n=void 0===n?1:n),e instanceof Error&&(e=e.stack||""),"string"==typeof e&&(this.isMP="mp-weixin"===t,e=this.rawParse(e).slice(n).map((e=>this.extractEntryMetadata(e)))),Array.isArray(e)){if(r){const t=se("util").inspect(a).split("\n"),n=t[0].split(":"),r=n.pop(),s=n.join(":");s&&e.unshift({file:ie(s),line:r,column:(t[2]||"").indexOf("^")+1,sourceLine:t[1],callee:"(syntax error)",syntaxError:!0})}this.items=e}else this.items=[]}extractEntryMetadata(e){const t=this.decomposePath(e.file||""),n=t[0],a=t[1];return ae.assign(e,{calleeShort:e.calleeShort||oe((e.callee||"").split(".")),fileRelative:n,fileShort:this.shortenPath(n),fileName:oe((e.file||"").split("/")),thirdParty:this.isThirdParty(n,a)&&!e.index,externalDomain:a})}shortenPath(e){return e.replace(/^node_modules\//,"").replace(/^webpack\/bootstrap\//,"").replace(/^__parcel_source_root\//,"")}decomposePath(e){let t=e;re&&(t=t.replace(le,""));const n=t.match(/^(http|https)\:\/\/?([^\/]+)\/{1,}(.*)/),a=n?n[2]:void 0;return t=n?n[3]:t,[ie(t).replace(/^.*\:\/\/?\/?/,""),a]}isThirdParty(e,t){return this.isMP?void 0!==t&&"usr"!==t:"~"===e[0]||"/"===e[0]||-1!==e.indexOf("@dcloudio")||-1!==e.indexOf("weex-main-jsfm")||0===e.indexOf("webpack/bootstrap")}rawParse(e){return(e||"").split("\n").map(((e,t)=>{let n,a,r,s,o=[];if(-1!==(e=e.trim()).indexOf("file:")&&(e=e.replace(/file:\/\/(.*)www/,"file://")),(r=e.match(/at (.+) \(eval at .+ \((.+)\), .+\)/))||(r=e.match(/at (.+) \((.+)\)/))||"at "!==e.slice(0,3)&&(r=e.match(/(.*)@(.*)/)))this.itemsHeader.push("%StacktraceyItem%"),n=r[1],a="native"===r[2],o=(r[2].match(/(.*):(\d+):(\d+)/)||r[2].match(/(.*):(\d+)/)||r[2].match(/\[(.*)\]/)||[]).slice(1);else{if(!(s=e.match(/^(at\s*)*(.*)\s+(.+):(\d+):(\d+)/)))return void this.itemsHeader.push(e);this.itemsHeader.push("%StacktraceyItem%"),n=s[2].trim(),o=s.slice(3)}if(n&&!o[0]){"Array"===n.split(".")[0]&&(a=!0)}return{beforeParse:e,callee:n||"",index:re&&o[0]===window.location.href,native:a||!1,file:ie(o[0]||""),line:parseInt(o[1]||"",10)||void 0,column:parseInt(o[2]||"",10)||void 0}})).filter((e=>void 0!==e))}maxColumnWidths(){return{callee:30,file:60,sourceLine:80}}asTable(e){const t=e&&e.maxColumnWidths||this.maxColumnWidths(),n=this.filter((e=>!e.thirdParty)).map((e=>pe(e,t,this.isMP))),a=this.filter((e=>e.thirdParty)).map((e=>pe(e,t,this.isMP)));return{items:n.items,thirdPartyItems:a.items}}}const ce=(e,t)=>e&&(e.length>t?e.slice(0,t-1)+"…":e);function pe(e,t,n){if(!e.parsed)return e.beforeParse;const a=(n?e.file&&e.file:e.fileShort&&e.fileShort)+`${e.line?":"+e.line:""}${e.column?":"+e.column:""}`;return["at "+ce(n?e.callee:e.calleeShort,t.callee),(r=a||"",s=t.file,r&&(r.length>s?"…"+r.slice(-(s-1)):r)),ce((e.sourceLine||"").trim()||"",t.sourceLine)];var r,s}["map","filter","slice","concat"].forEach((e=>{ue.prototype[e]=function(){return new ue(this.items[e].apply(this.items,arguments))}}));var de={};!function(e){e.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};const t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function a(e){const n=e.match(t);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function r(e){let t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}e.urlParse=a,e.urlGenerate=r;const s=function(e){const t=[];return function(n){for(let e=0;e<t.length;e++)if(t[e].input===n){const n=t[0];return t[0]=t[e],t[e]=n,t[0].result}const a=e(n);return t.unshift({input:n,result:a}),t.length>32&&t.pop(),a}}((function(t){let n=t;const s=a(t);if(s){if(!s.path)return t;n=s.path}const o=e.isAbsolute(n),i=[];let l=0,u=0;for(;;){if(l=u,u=n.indexOf("/",l),-1===u){i.push(n.slice(l));break}for(i.push(n.slice(l,u));u<n.length&&"/"===n[u];)u++}let c=0;for(u=i.length-1;u>=0;u--){const e=i[u];"."===e?i.splice(u,1):".."===e?c++:c>0&&(""===e?(i.splice(u+1,c),c=0):(i.splice(u,2),c--))}return n=i.join("/"),""===n&&(n=o?"/":"."),s?(s.path=n,r(s)):n}));function o(e,t){""===e&&(e="."),""===t&&(t=".");const o=a(t),i=a(e);if(i&&(e=i.path||"/"),o&&!o.scheme)return i&&(o.scheme=i.scheme),r(o);if(o||t.match(n))return t;if(i&&!i.host&&!i.path)return i.host=t,r(i);const l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=l,r(i)):l}e.normalize=s,e.join=o,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");let n=0;for(;0!==t.indexOf(e+"/");){const a=e.lastIndexOf("/");if(a<0)return t;if((e=e.slice(0,a)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};const i=!("__proto__"in Object.create(null));function l(e){return e}function u(e){if(!e)return!1;const t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(let n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function c(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=i?l:function(e){return u(e)?"$"+e:e},e.fromSetString=i?l:function(e){return u(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,n){let a=c(e.source,t.source);return 0!==a?a:(a=e.originalLine-t.originalLine,0!==a?a:(a=e.originalColumn-t.originalColumn,0!==a||n?a:(a=e.generatedColumn-t.generatedColumn,0!==a?a:(a=e.generatedLine-t.generatedLine,0!==a?a:c(e.name,t.name)))))},e.compareByGeneratedPositionsDeflated=function(e,t,n){let a=e.generatedLine-t.generatedLine;return 0!==a?a:(a=e.generatedColumn-t.generatedColumn,0!==a||n?a:(a=c(e.source,t.source),0!==a?a:(a=e.originalLine-t.originalLine,0!==a?a:(a=e.originalColumn-t.originalColumn,0!==a?a:c(e.name,t.name)))))},e.compareByGeneratedPositionsInflated=function(e,t){let n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=c(e.source,t.source),0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:c(e.name,t.name)))))},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){const e=a(n);if(!e)throw new Error("sourceMapURL could not be parsed");if(e.path){const t=e.path.lastIndexOf("/");t>=0&&(e.path=e.path.substring(0,t+1))}t=o(r(e),t)}return s(t)}}(de);var he={};he.ArraySet=class e{constructor(){this._array=[],this._set=new Map}static fromArray(t,n){const a=new e;for(let e=0,r=t.length;e<r;e++)a.add(t[e],n);return a}size(){return this._set.size}add(e,t){const n=this.has(e),a=this._array.length;n&&!t||this._array.push(e),n||this._set.set(e,a)}has(e){return this._set.has(e)}indexOf(e){const t=this._set.get(e);if(t>=0)return t;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)}toArray(){return this._array.slice()}};var me={},ge={};!function(e){function t(n,a,r,s,o,i){const l=Math.floor((a-n)/2)+n,u=o(r,s[l],!0);return 0===u?l:u>0?a-l>1?t(l,a,r,s,o,i):i==e.LEAST_UPPER_BOUND?a<s.length?a:-1:l:l-n>1?t(n,l,r,s,o,i):i==e.LEAST_UPPER_BOUND?l:n<0?-1:n}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(n,a,r,s){if(0===a.length)return-1;let o=t(-1,a.length,n,a,r,s||e.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===r(a[o],a[o-1],!0);)--o;return o}}(ge);var fe={exports:{}};{let e=null;fe.exports=function(){if("string"==typeof e)return fetch(e).then((e=>e.arrayBuffer()));if(e instanceof ArrayBuffer)return Promise.resolve(e);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},fe.exports.initialize=t=>e=t}var _e=fe.exports;const ye=_e;function we(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}let be=null;const Ce=de,Se=ge,Me=he.ArraySet,ke=_e,Ee=function(){if(be)return be;const e=[];return be=ye().then((t=>WebAssembly.instantiate(t,{env:{mapping_callback(t,n,a,r,s,o,i,l,u,c){const p=new we;p.generatedLine=t+1,p.generatedColumn=n,a&&(p.lastGeneratedColumn=r-1),s&&(p.source=o,p.originalLine=i+1,p.originalColumn=l,u&&(p.name=c)),e[e.length-1](p)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}}))).then((t=>({exports:t.instance.exports,withMappingCallback:(t,n)=>{e.push(t);try{n()}finally{e.pop()}}}))).then(null,(e=>{throw be=null,e})),be},Pe=Symbol("smcInternal");let xe=class e{constructor(e,t){return e==Pe?Promise.resolve(this):function(e,t){let n=e;"string"==typeof e&&(n=Ce.parseSourceMapInput(e));const a=null!=n.sections?new Le(n,t):new ve(n,t);return Promise.resolve(a)}(e,t)}static initialize(e){ke.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,t){return function(e,t){return ve.fromSourceMap(e,t)}(e,t)}static async with(t,n,a){const r=await new e(t,n);try{return await a(r)}finally{r.destroy()}}_parseMappings(e,t){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,t,n){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}};xe.prototype._version=3,xe.GENERATED_ORDER=1,xe.ORIGINAL_ORDER=2,xe.GREATEST_LOWER_BOUND=1,xe.LEAST_UPPER_BOUND=2,me.SourceMapConsumer=xe;class ve extends xe{constructor(e,t){return super(Pe).then((n=>{let a=e;"string"==typeof e&&(a=Ce.parseSourceMapInput(e));const r=Ce.getArg(a,"version");let s=Ce.getArg(a,"sources");const o=Ce.getArg(a,"names",[]);let i=Ce.getArg(a,"sourceRoot",null);const l=Ce.getArg(a,"sourcesContent",null),u=Ce.getArg(a,"mappings"),c=Ce.getArg(a,"file",null);if(r!=n._version)throw new Error("Unsupported version: "+r);return i&&(i=Ce.normalize(i)),s=s.map(String).map(Ce.normalize).map((function(e){return i&&Ce.isAbsolute(i)&&Ce.isAbsolute(e)?Ce.relative(i,e):e})),n._names=Me.fromArray(o.map(String),!0),n._sources=Me.fromArray(s,!0),n._absoluteSources=n._sources.toArray().map((function(e){return Ce.computeSourceURL(i,e,t)})),n.sourceRoot=i,n.sourcesContent=l,n._mappings=u,n._sourceMapURL=t,n.file=c,n._computedColumnSpans=!1,n._mappingsPtr=0,n._wasm=null,Ee().then((e=>(n._wasm=e,n)))}))}_findSourceIndex(e){let t=e;if(null!=this.sourceRoot&&(t=Ce.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);for(let n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1}static fromSourceMap(e,t){return new ve(e.toString())}get sources(){return this._absoluteSources.slice()}_getMappingsPtr(){return 0===this._mappingsPtr&&this._parseMappings(this._mappings,this.sourceRoot),this._mappingsPtr}_parseMappings(e,t){const n=e.length,a=this._wasm.exports.allocate_mappings(n),r=new Uint8Array(this._wasm.exports.memory.buffer,a,n);for(let o=0;o<n;o++)r[o]=e.charCodeAt(o);const s=this._wasm.exports.parse_mappings(a);if(!s){const e=this._wasm.exports.get_last_error();let t=`Error parsing mappings (code ${e}): `;switch(e){case 1:t+="the mappings contained a negative line, column, source index, or name index";break;case 2:t+="the mappings contained a number larger than 2**32";break;case 3:t+="reached EOF while in the middle of parsing a VLQ";break;case 4:t+="invalid base 64 character while parsing a VLQ";break;default:t+="unknown error code"}throw new Error(t)}this._mappingsPtr=s}eachMapping(e,t,n){const a=t||null,r=n||xe.GENERATED_ORDER,s=this.sourceRoot;this._wasm.withMappingCallback((t=>{null!==t.source&&(t.source=this._sources.at(t.source),t.source=Ce.computeSourceURL(s,t.source,this._sourceMapURL),null!==t.name&&(t.name=this._names.at(t.name))),e.call(a,t)}),(()=>{switch(r){case xe.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case xe.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}}))}allGeneratedPositionsFor(e){let t=Ce.getArg(e,"source");const n=Ce.getArg(e,"line"),a=e.column||0;if(t=this._findSourceIndex(t),t<0)return[];if(n<1)throw new Error("Line numbers must be >= 1");if(a<0)throw new Error("Column numbers must be >= 0");const r=[];return this._wasm.withMappingCallback((e=>{let t=e.lastGeneratedColumn;this._computedColumnSpans&&null===t&&(t=1/0),r.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:t})}),(()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),t,n-1,"column"in e,a)})),r}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const t={generatedLine:Ce.getArg(e,"line"),generatedColumn:Ce.getArg(e,"column")};if(t.generatedLine<1)throw new Error("Line numbers must be >= 1");if(t.generatedColumn<0)throw new Error("Column numbers must be >= 0");let n,a=Ce.getArg(e,"bias",xe.GREATEST_LOWER_BOUND);if(null==a&&(a=xe.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback((e=>n=e),(()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),t.generatedLine-1,t.generatedColumn,a)})),n&&n.generatedLine===t.generatedLine){let e=Ce.getArg(n,"source",null);null!==e&&(e=this._sources.at(e),e=Ce.computeSourceURL(this.sourceRoot,e,this._sourceMapURL));let t=Ce.getArg(n,"name",null);return null!==t&&(t=this._names.at(t)),{source:e,line:Ce.getArg(n,"originalLine",null),column:Ce.getArg(n,"originalColumn",null),name:t}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))}sourceContentFor(e,t){if(!this.sourcesContent)return null;const n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];let a,r=e;if(null!=this.sourceRoot&&(r=Ce.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(a=Ce.urlParse(this.sourceRoot))){const e=r.replace(/^file:\/\//,"");if("file"==a.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!a.path||"/"==a.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')}generatedPositionFor(e){let t=Ce.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};const n={source:t,originalLine:Ce.getArg(e,"line"),originalColumn:Ce.getArg(e,"column")};if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");let a,r=Ce.getArg(e,"bias",xe.GREATEST_LOWER_BOUND);if(null==r&&(r=xe.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback((e=>a=e),(()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),n.source,n.originalLine-1,n.originalColumn,r)})),a&&a.source===n.source){let e=a.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:Ce.getArg(a,"generatedLine",null),column:Ce.getArg(a,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}ve.prototype.consumer=xe,me.BasicSourceMapConsumer=ve;class Le extends xe{constructor(e,t){return super(Pe).then((n=>{let a=e;"string"==typeof e&&(a=Ce.parseSourceMapInput(e));const r=Ce.getArg(a,"version"),s=Ce.getArg(a,"sections");if(r!=n._version)throw new Error("Unsupported version: "+r);n._sources=new Me,n._names=new Me,n.__generatedMappings=null,n.__originalMappings=null,n.__generatedMappingsUnsorted=null,n.__originalMappingsUnsorted=null;let o={line:-1,column:0};return Promise.all(s.map((e=>{if(e.url)throw new Error("Support for url field in sections not implemented.");const n=Ce.getArg(e,"offset"),a=Ce.getArg(n,"line"),r=Ce.getArg(n,"column");if(a<o.line||a===o.line&&r<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");o=n;return new xe(Ce.getArg(e,"map"),t).then((e=>({generatedOffset:{generatedLine:a+1,generatedColumn:r+1},consumer:e})))}))).then((e=>(n._sections=e,n)))}))}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(Ce.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(Ce.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let t=0;t<this._sections.length;t++)for(let n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}originalPositionFor(e){const t={generatedLine:Ce.getArg(e,"line"),generatedColumn:Ce.getArg(e,"column")},n=Se.search(t,this._sections,(function(e,t){const n=e.generatedLine-t.generatedOffset.generatedLine;return n||e.generatedColumn-t.generatedOffset.generatedColumn})),a=this._sections[n];return a?a.consumer.originalPositionFor({line:t.generatedLine-(a.generatedOffset.generatedLine-1),column:t.generatedColumn-(a.generatedOffset.generatedLine===t.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))}sourceContentFor(e,t){for(let n=0;n<this._sections.length;n++){const t=this._sections[n].consumer.sourceContentFor(e,!0);if(t)return t}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')}generatedPositionFor(e){for(let t=0;t<this._sections.length;t++){const n=this._sections[t];if(-1===n.consumer._findSourceIndex(Ce.getArg(e,"source")))continue;const a=n.consumer.generatedPositionFor(e);if(a){return{line:a.line+(n.generatedOffset.generatedLine-1),column:a.column+(n.generatedOffset.generatedLine===a.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}}_parseMappings(e,t){const n=this.__generatedMappingsUnsorted=[],a=this.__originalMappingsUnsorted=[];for(let r=0;r<this._sections.length;r++){const e=this._sections[r],t=[];e.consumer.eachMapping((e=>t.push(e)));for(let r=0;r<t.length;r++){const s=t[r];let o=Ce.computeSourceURL(e.consumer.sourceRoot,null,this._sourceMapURL);this._sources.add(o),o=this._sources.indexOf(o);let i=null;s.name&&(this._names.add(s.name),i=this._names.indexOf(s.name));const l={source:o,generatedLine:s.generatedLine+(e.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(e.generatedOffset.generatedLine===s.generatedLine?e.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:i};n.push(l),"number"==typeof l.originalLine&&a.push(l)}}}eachMapping(e,t,n){const a=t||null;let r;switch(n||xe.GENERATED_ORDER){case xe.GENERATED_ORDER:r=this._generatedMappings;break;case xe.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}const s=this.sourceRoot;r.map((function(e){let t=null;return null!==e.source&&(t=this._sources.at(e.source),t=Ce.computeSourceURL(s,t,this._sourceMapURL)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,a)}_findMapping(e,t,n,a,r,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[a]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[a]);return Se.search(e,t,r,s)}allGeneratedPositionsFor(e){const t=Ce.getArg(e,"line"),n={source:Ce.getArg(e,"source"),originalLine:t,originalColumn:Ce.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");const a=[];let r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ce.compareByOriginalPositions,Se.LEAST_UPPER_BOUND);if(r>=0){let n=this._originalMappings[r];if(void 0===e.column){const e=n.originalLine;for(;n&&n.originalLine===e;){let e=n.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),a.push({line:Ce.getArg(n,"generatedLine",null),column:Ce.getArg(n,"generatedColumn",null),lastColumn:e}),n=this._originalMappings[++r]}}else{const e=n.originalColumn;for(;n&&n.originalLine===t&&n.originalColumn==e;){let e=n.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),a.push({line:Ce.getArg(n,"generatedLine",null),column:Ce.getArg(n,"generatedColumn",null),lastColumn:e}),n=this._originalMappings[++r]}}}return a}destroy(){for(let e=0;e<this._sections.length;e++)this._sections[e].consumer.destroy()}}me.IndexedSourceMapConsumer=Le;var Te=me.SourceMapConsumer;let Oe=!1;try{Oe="win32"===ne.platform()}catch(Be){}Te.initialize&&Te.initialize({"lib/mappings.wasm":"https://unpkg.com/source-map@0.7.3/lib/mappings.wasm"});const Ae={};function De(e,t){const n=t.preset.parseStacktrace(e);let a=Promise.resolve();n.items.forEach(((e,r)=>{const s=(e,a)=>{const{line:r=0,column:o=0,file:i,fileName:l,fileRelative:u}=e;if(e.thirdParty)return Promise.resolve();try{return(c=i,p=l,d=u,t.preset.getSourceMapContent(c,p,d).then((e=>{if(e)return function(e){return new Promise(((t,n)=>{try{if(Te.with)Te.with(e,null,(e=>{t(e)}));else{const n=Te(e);t(n)}}catch(Be){n()}}))}(e).then((e=>function(e,t,n){const{source:a,line:r,column:s}=e.originalPositionFor(t);if(a){const t=a.split("/");return{source:a,sourcePath:t.slice(3).join("/"),sourceLine:null===r?0:r,sourceColumn:null===s?0:s,fileName:t.pop(),sourceContent:n&&e.sourceContentFor(a)||""}}}(e,{line:r+(t.preset.lineOffset||0),column:o},!!t.withSourceContent)))}))).then((t=>{if(t){const{source:o,sourcePath:i,sourceLine:l,sourceColumn:u,sourceContent:c,fileName:p=""}=t;n.items[a]=Object.assign({},e,{file:o,line:l,column:u,fileShort:i,fileRelative:o,fileName:p,thirdParty:(r=i,-1!==r.indexOf("@dcloudio")),parsed:!0,sourceContent:c});const d=n.items[a];if(n.isMP&&-1!==d.beforeParse.indexOf("app-service"))return s(d,a)}var r}))}catch(Be){return Promise.resolve()}var c,p,d};a=a.then((()=>new Promise(((t,n)=>{setTimeout((()=>{s(e,r).then(t)}),0)}))))}));return new Promise(((r,s)=>{a.then((()=>{const a=t.preset.asTableStacktrace({stack:n,maxColumnWidths:{callee:999,file:999,sourceLine:999},stacktrace:e});r(a)})).catch((()=>{r(e)}))}))}function Re(e){if("string"==typeof e)return e;return`${e[0]}${e[1]?` ${e[1]}`:""}${e[2]?` ${e[2]}`:""}`}function Ue(e){const{base:t,sourceRoot:n,splitThirdParty:a,uniPlatform:r,lineOffset:s}=e;let o;return{parseSourceMapUrl(e,a,r){if(-1!==r.indexOf("(")&&(r=r.match(/\((.*)/)[1]),!t||!r)return"";if(n)return`${r.replace(n,t+"/")}.map`;let s="";return o.isMP&&(-1!==r.indexOf("app-service.js")&&(s=(t.match(/\w$/)?"/":"")+"__WEIXIN__",r===a&&(s+="/__APP__"),r=r.replace(".js",".map")),s&&r.match(/^\w/)&&(s+="/")),`${t}${s}${r}.map`},getSourceMapContent(e,t,n){if(o.isMP&&-1===n.indexOf(".js"))return Promise.resolve("");const a=this.parseSourceMapUrl(e,t,n);return Promise.resolve(function(e){try{return Ae[e]||(Ae[e]=new Promise(((t,n)=>{try{/^[http|https]+:/i.test(e)?w({url:e,success:n=>{200===n.statusCode?(Ae[e]=n.data,t(Ae[e])):t(Ae[e]="")},fail(){t(Ae[e]="")}}):(Ae[e]=ne.readFileSync(e,"utf-8"),t(Ae[e]))}catch(Be){t("")}})))}catch(Be){return""}}(a))},parseStacktrace:e=>(o=new ue(e,r),o),asTableStacktrace({maxColumnWidths:e,stacktrace:t,stack:n}){const r=t.split("\n")[0],s=n.asTable?n.asTable(e?{maxColumnWidths:e}:void 0):{items:[],thirdPartyItems:[]};if(s.items.length||s.thirdPartyItems.length){const{items:e,thirdPartyItems:t}=s,r=n.itemsHeader.map((t=>{if("%StacktraceyItem%"===t){const t=e.shift();return t?Re(t):""}return t})).filter(Boolean).join("\n"),o=t.length?t.map(Re).join("\n"):"";return a?{userError:r,thirdParty:o}:r+"\n"+o}return a?{userError:r,thirdParty:""}:r},lineOffset:s}}const Fe=[{title:"错误总数",value:0,tooltip:"指应用在某个时间段内出现错误的总数"},{title:"错误率",value:0,tooltip:"时间范围内的总错误数/应用启动次数,如果小于0.01%,默认显示为0"}],$e=b.database(),Ie=$e.command;let Ne={};const qe=e({data:()=>({uniStat:C.uniStat,fieldsMap:Y,popupFieldsMap:Z,query:{dimension:"day",appid:"",platform_id:"",uni_platform:"",version_id:"",start_time:[]},uploadOptions:j({appid:"",uni_platform:""}),uploadMsg:"",options:{pageSize:20,pageCurrent:1,total:0},loading:!1,popupLoading:!1,currentDateTab:0,tableData:[],popupTableData:[],panelData:JSON.parse(JSON.stringify(Fe)),chartData:{},chartTab:"errorCount",chartTabs:[{_id:"errorCount",name:"错误次数"},{_id:"errorRate",name:"错误率"}],errMsg:"",msgLoading:!1,uploadFile:{tempFileTasks:[],tempFiles:[],clear(){this.tempFileTasks.length=this.tempFiles.length=0}},uploadSuccessTaskNames:[],errorItem:"",errorMessage:""}),components:{uploadTask:te},computed:{queryStr(){return G(this.query)},versionQuery(){const{appid:e,uni_platform:t}=this.query;return G(j({appid:e,uni_platform:t}))},uploadVersionQuery(){const{appid:e,uni_platform:t}=this.uploadOptions;return G(j({appid:e,uni_platform:t}))},vaildate(){const e=Object.keys(this.uploadOptions).every((e=>this.uploadOptions[e]));return e&&this.uploadMsg&&(this.uploadMsg=""),e},uploadSuccessTasks(){return this.uploadFile.tempFileTasks.filter((e=>1===e.state))},sortUploadFileTempFileTasks(){return this.uploadFile.tempFileTasks.filter((e=>1!==e.state)).sort(((e,t)=>e.state-t.state))},sourceMapEnabled:()=>!0,channelQuery(){const e=this.query.platform_id;return G({platform_id:e})}},created(){if(this.parsedErrors={},this.sourceMapEnabled)if(this.uniStat.uploadSourceMapCloudSpaceId)if("aliyun"===this.uniStat.uploadSourceMapCloudPlatform){let e=0===this.uniStat.uploadSourceMapCloudSpaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com";this.uploadSourcemapCloud=b.init({provider:"aliyun",spaceId:this.uniStat.uploadSourceMapCloudSpaceId,clientSecret:this.uniStat.uploadSourceMapCloudClientSecret,endpoint:e})}else this.uploadSourcemapCloud=b.init({provider:"tencent",spaceId:this.uniStat.uploadSourceMapCloudSpaceId});else this.uploadSourcemapCloud=b;this.getCloudDataDebounce=V((()=>{this.getAllData(this.queryStr)}),300),this.getCloudDataDebounce()},watch:{query:{deep:!0,handler(e,t){this.options.pageCurrent=1,this.getCloudDataDebounce()}},chartTab(e){this.getChartData(this.queryStr)}},methods:{useDatetimePicker(e){this.currentDateTab=-1},changePlatform(e,t,n,a){this.query.version_id=0,this.uploadOptions.uni_platform=a.code,this.query.uni_platform=a.code},changeTimeRange(e,t){this.currentDateTab=t;const n=W(e),a=W(0)-1;this.query.start_time=[n,a]},changePageCurrent(e){this.options.pageCurrent=e.current,this.getTableData(this.queryStr)},changePageSize(e){this.options.pageSize=e,this.options.pageCurrent=1,this.getTableData(this.queryStr)},getAllData(e){-1!==e.indexOf("appid")?(this.errorMessage="",this.getChartData(e),this.getTableData(e)):this.errorMessage="请先选择应用"},getChartData(e,t="day_count"){let n=G(this.query,!1,["uni_platform"]);this.chartData={},this.options;const a=b.database(),[r,s]=this.query.start_time,o=J(new Date(r),new Date(s));a.collection("uni-stat-error-result").where(n).groupBy("start_time").groupField("sum(count) as total_day_count").orderBy("start_time","desc").get({getCount:!0}).then((async e=>{e.result.count;const a=e.result.data;let r=[];o.forEach((e=>{let t=a.find((t=>t.start_time===e));t?r.push(t):r.push({start_time:e,total_day_count:0})}));const s={categories:[],series:[{name:"暂无数据",data:[]}]};if("errorCount"===this.chartTab){const e=s.series[0]={name:"错误次数",data:[]},n=s.categories;for(const a of r){let r=a.start_time;const s=Q(r,"day"),o=a[`total_${t}`];n.push(s),e.data.push(o)}this.chartData=s}else{let e=await this.getDayLaunch(n);const a=s.series[0]={name:"错误率(%)",data:[],lineStyle:{color:"#EE6666",width:1},itemStyle:{borderWidth:1,borderColor:"#EE6666",color:"#EE6666"},areaStyle:{color:{colorStops:[{offset:0,color:"#EE6666"},{offset:1,color:"#FFFFFF"}]}}},o=s.categories;for(const n of r){let r=n.start_time;const s=Q(r,"day"),i=n[`total_${t}`];if(o.push(s),e.length){const t=e.find((e=>e.start_time===n.start_time)),r=o.indexOf(s);if(t){let e=100*i/t.day_app_launch_count;e=e.toFixed(2),a.data[r]=e}else a.data[r]=0}}this.chartData=s}})).catch((e=>{console.error(e)})).finally((()=>{}))},getTotalCount:e=>b.database().collection("uni-stat-error-result").where(e).groupBy("appid").groupField("sum(count) as total_count").get(),getTotalLaunch:e=>b.database().collection("uni-stat-result").where(e).groupBy("appid").groupField("sum(app_launch_count) as total_app_launch_count").get(),async getDayLaunch(e){const t=b.database();return(await t.collection("uni-stat-result").where(e).groupBy("start_time").groupField("sum(app_launch_count) as day_app_launch_count").orderBy("start_time","asc").get()).result.data||[]},getTableData(e=G(this.query)){let t=G(this.query,!1,["uni_platform"]);const{pageCurrent:n}=this.options;this.loading=!0;const a=b.database(),r=G(j({appid:this.query.appid})),s=a.collection("uni-stat-error-result").where(t).getTemp(),o=a.collection("opendb-app-versions").where(r).getTemp(),i=a.collection("uni-stat-app-platforms").getTemp();a.collection(s,o,i).orderBy("count","desc").skip((n-1)*this.options.pageSize).limit(this.options.pageSize).get({getCount:!0}).then((e=>{const{count:n,data:a}=e.result,r=[];this.panelData=JSON.parse(JSON.stringify(Fe));for(const t of a){t.last_time=H(t.last_time,"dateTime"),t.msgTooltip=t.msg,t.msg=t.msg?t.msg.substring(0,100)+"...":"";const e=t.version_id[0],n=t.platform_id[0];t.version=e&&e.version,t.platform=n&&n.name,t.platform_code=n&&n.code,r.push(t)}this.getTotalCount(t).then((e=>{const n=e.result.data[0],a=n&&n.total_count;a&&(r.forEach((e=>e.total_count=Number(a))),this.panelData[0].value=a);let s="";this.getTotalLaunch(t).then((e=>{const t=e.result.data[0];if(s=t&&t.total_app_launch_count,a&&s){let e=a/s;e=(100*e).toFixed(2)+"%",this.panelData[1].value=e}}))})).finally((()=>{this.tableData=[],this.options.total=n,r.forEach((e=>X(Y,e,e))),this.tableData=r}))})).catch((e=>{console.error(e)})).finally((()=>{this.loading=!1}))},navTo(e,t){e.indexOf("http")>-1?window.open(e):(t&&(e=`${e}?error_hash=${t.hash}&create_time=${t.start_time}`),S({url:e}))},closeErrPopup(){this.$refs.errMsg.close()},errMsgPopupChange(e){if(e.show){const e=this.errorItem.msgTooltip;return this.msgLoading?void this.closeErrPopup():(e||(this.errMsg="暂无错误数据"),this.errMsg="",this.parsedErrors[e],this.msgLoading=!0,void this.parseError(this.errorItem))}this.msgLoading=!1},async parseError(e){let t,{msgTooltip:n,appid:a,platform_code:r,version:s}=e,o=`/${a}/${r}/${s}/`;Ne[o]&&Ne[o].length>0?t=Ne[o]:(t=await this.getSourceMapFileList({base:o}),t&&t.length>0?Ne[o]=t:console.error(`缺少${o}对应的sourceMap,请先上传sourceMap`));try{n=JSON.parse(n)}catch(l){}const i={base:o,uniPlatform:r,splitThirdParty:!0};["ios","android","app"].indexOf(r)>-1&&(i.lineOffset=-1),De(n,{preset:{...Ue(i),parseSourceMapUrl(e,n,a){if(-1!==a.indexOf("(")){let e=a.match(/\((.*)/);a=e&&e[1]}if(!o||!a)return"";if("undefined"!=typeof sourceRoot)return`${a.replace(sourceRoot,o+"/")}.map`;let s="";r.indexOf("mp-")>-1&&-1!==a.indexOf("app-service.js")&&(s=(o.match(/\w$/)?"/":"")+"__WEIXIN__",a===n&&(s+="/__APP__")),s&&a.match(/^\w/)&&(s+="/");let i,l=`__UNI__/uni-stat/sourcemap${`${o}${s}${a}.map`}`;if("web"===r){let e=a.substring(a.indexOf("/")+1);i=`__UNI__/uni-stat/sourcemap${`${o}${s}${e}.map`}`}let u=t.find((e=>[l,i].indexOf(e.cloud_path)>-1));return u?u.url:l}}}).then((e=>{const{userError:t,thirdParty:a}=e,s=t.length&&a.length?`\n\n------------${-1!==r.indexOf("mp-")?r:"uni-app"} runtime error------------\n\n`:"";this.errMsg=`${t}${s}${a}`,this.parsedErrors[n]=this.errMsg})).finally((()=>{this.msgLoading=!1}))},openUploadPopup(){const{appid:e,uni_platform:t}=this.query;this.uploadOptions={appid:e,uni_platform:t},this.$refs.upload.open()},closeUploadPopup(){this.$refs.upload.close()},createUploadFileTask(e,t,n,a){const r=e+t;return this.uploadSourcemapCloud.uploadFile({filePath:n,cloudPath:r,onUploadProgress:a})},async choosefile(){if(!this.vaildate)return void(this.uploadMsg="请先将应用、平台、版本填写完整");const{appid:e,uni_platform:t,version:n}=this.uploadOptions,a=`/${e}/${t}/${n}/`,r=`__UNI__/uni-stat/sourcemap${a}`,s=document.createElement("input");s.type="file",s.directory=!0,s.webkitdirectory=!0,s.click(),s.addEventListener("change",(async()=>{this.uploadFile.clear();const o=s.files;if(!o.length)return;Array.prototype.forEach.call(o,(e=>{const t=K(e);this.uploadFile.tempFileTasks.push({fileDiskPath:e.webkitRelativePath.split("/").slice(1).join("/"),path:t,size:`${(e.size/1024).toFixed(2)}kb`,name:e.name,state:0,progress:0,file:e}),Object.defineProperty(e,"path",{get:()=>t}),this.uploadFile.tempFiles.push(e)}));let i=[];for(let s=0;s<this.uploadFile.tempFileTasks.length;s++){let o=this.uploadFile.tempFileTasks[s],l=await new Promise(((s,i)=>{-1!==this.uploadSuccessTaskNames.indexOf(o.name)?(o.progress=1,setTimeout((()=>{o.state=1,s()}),200)):this.createUploadFileTask(r,o.fileDiskPath,o.path,(e=>{const{loaded:t,total:n}=e;o.progress=t/n})).then((i=>{const l=r+o.fileDiskPath;let u=i.fileID;b.getTempFileURL({fileList:[u]}).then((r=>{let i=r.fileList[0].tempFileURL,c={appid:e,uni_platform:t,version:n,file_id:u,url:i,name:o.name,size:o.file.size,cloud_path:l,base:a};setTimeout((()=>{this.uploadSuccessTaskNames.push(name),o.state=1,s(c)}),100)}))})).catch((e=>{o.state=-1,i(`${o.name} 上传失败:`+JSON.stringify(e))}))}));l&&i.push(l)}i&&i.length>0&&await this.addSourceMapFile(i)}))},createStr(e,t,n="total_"){const a=[];return e.forEach((e=>{if(field.hasOwnProperty("value")){const r=e.field;a.push(`${t}(${r}) as ${n+r}`)}})),a.join()},openErrPopup(e){this.errorItem=e,this.$refs.errMsg.open()},async addSourceMapFile(e){let t=[];e.map(((e,n)=>{t.push(e.cloud_path)})),await $e.collection("uni-stat-error-source-map").where({cloud_path:Ie.in(t)}).remove(),await $e.collection("uni-stat-error-source-map").add(e)},async getSourceMapFileList(e){let{base:t}=e;return(await $e.collection("uni-stat-error-source-map").where({base:t}).limit(1e3).get()).result.data||[]}}},[["render",function(e,i,l,u,y,w){const b=M(k("uni-stat-breadcrumb"),U),C=p,S=M(k("uni-data-select"),F),j=M(k("uni-stat-tabs"),$),G=M(k("uni-datetime-picker"),E),V=M(k("uni-stat-panel"),I),W=M(k("qiun-data-charts"),N),J=A,Q=M(k("uni-icons"),P),H=M(k("uni-tooltip"),q),X=M(k("uni-th"),x),K=M(k("uni-tr"),v),Y=_,Z=M(k("uni-td"),L),te=M(k("uni-table"),T),ne=M(k("uni-pagination"),B),ae=M(k("uni-load-more"),z),re=D,se=M(k("uni-popup"),O),oe=t("uploadTask"),ie=M(k("uni-drawer"),ee);return n(),a(C,{class:"fix-top-window"},{default:r((()=>[s(C,{class:"uni-header"},{default:r((()=>[s(b,{class:"uni-stat-breadcrumb-on-phone"}),s(C,{class:"uni-group hide-on-phone"},{default:r((()=>[s(C,{class:"uni-sub-title"},{default:r((()=>[g("开发者可以在这里快速查询应用最近出现的具体错误内容,了解错误概况信息,以便快速修复问题")])),_:1})])),_:1})])),_:1}),s(C,{class:"uni-container"},{default:r((()=>[s(C,{class:"uni-stat--x flex p-1015"},{default:r((()=>[s(S,{collection:"opendb-app-list",field:"appid as value, name as text",orderby:"text asc",defItem:1,label:"应用选择",modelValue:y.query.appid,"onUpdate:modelValue":i[0]||(i[0]=e=>y.query.appid=e),clear:!1},null,8,["modelValue"]),s(S,{collection:"opendb-app-versions",where:w.versionQuery,class:"ml-m",field:"_id as value, version as text, uni_platform as label, create_date as date",format:"{label} - {text}",orderby:"date desc",label:"版本选择",modelValue:y.query.version_id,"onUpdate:modelValue":i[1]||(i[1]=e=>y.query.version_id=e)},null,8,["where","modelValue"])])),_:1}),s(C,{class:"uni-stat--x flex"},{default:r((()=>[s(j,{label:"日期选择",current:y.currentDateTab,yesterday:!1,mode:"date",onChange:w.changeTimeRange},null,8,["current","onChange"]),s(G,{type:"datetimerange",end:(new Date).getTime(),modelValue:y.query.start_time,"onUpdate:modelValue":i[2]||(i[2]=e=>y.query.start_time=e),returnType:"timestamp",clearIcon:!1,class:o(["uni-stat-datetime-picker",{"uni-stat__actived":y.currentDateTab<0&&!!y.query.start_time.length}]),onChange:w.useDatetimePicker},null,8,["end","modelValue","class","onChange"])])),_:1}),s(C,{class:"uni-stat--x"},{default:r((()=>[s(j,{label:"平台选择",type:"boldLine",mode:"platform",modelValue:y.query.platform_id,"onUpdate:modelValue":i[3]||(i[3]=e=>y.query.platform_id=e),onChange:w.changePlatform},null,8,["modelValue","onChange"]),y.query.platform_id&&-1===y.query.platform_id.indexOf("==")?(n(),a(S,{key:0,ref:"version-select",collection:"uni-stat-app-channels",where:w.channelQuery,class:"p-channel",field:"_id as value, channel_name as text",orderby:"text asc",label:"渠道/场景值选择",modelValue:y.query.channel_id,"onUpdate:modelValue":i[4]||(i[4]=e=>y.query.channel_id=e)},null,8,["where","modelValue"])):c("",!0)])),_:1}),s(C,{class:"uni-stat--x",style:{padding:"15px 0"}},{default:r((()=>[s(V,{items:y.panelData,class:"uni-stat-panel"},null,8,["items"]),s(j,{type:"box",modelValue:y.chartTab,"onUpdate:modelValue":i[5]||(i[5]=e=>y.chartTab=e),tabs:y.chartTabs,class:"mb-l"},null,8,["modelValue","tabs"]),s(C,{class:"uni-charts-box"},{default:r((()=>[s(W,{type:"area",chartData:y.chartData,eopts:{notMerge:!0},echartsH5:"",echartsApp:"",tooltipFormat:"tooltipCustom",errorMessage:y.errorMessage},null,8,["chartData","errorMessage"])])),_:1})])),_:1}),s(C,{class:"uni-stat--x p-m"},{default:r((()=>[s(C,{class:"flex-between"},{default:r((()=>[s(C,{class:"uni-stat-card-header"},{default:r((()=>[g("信息列表")])),_:1}),s(C,{class:"uni-group"},{default:r((()=>[w.sourceMapEnabled?(n(),a(J,{key:0,class:"uni-button",type:"primary",size:"mini",onClick:w.openUploadPopup},{default:r((()=>[g("上传 sourceMap")])),_:1},8,["onClick"])):c("",!0)])),_:1})])),_:1}),s(te,{loading:y.loading,border:"",stripe:"",emptyText:y.errorMessage||e.$t("common.empty")},{default:r((()=>[s(K,null,{default:r((()=>[(n(!0),d(m,null,h(y.fieldsMap,((e,t)=>(n(),d(m,{key:t},[e.title?(n(),a(X,{key:t,align:"center"},{default:r((()=>[s(H,null,R({default:r((()=>[g(f(e.title)+" ",1),e.tooltip?(n(),a(Q,{key:0,type:"help",color:"#666"})):c("",!0)])),_:2},[e.tooltip?{name:"content",fn:r((()=>[s(C,{class:"uni-stat-tooltip-s"},{default:r((()=>[g(f(e.tooltip),1)])),_:2},1024)])),key:"0"}:void 0]),1024)])),_:2},1024)):c("",!0)],64)))),128)),w.sourceMapEnabled?(n(),a(X,{key:0,align:"center"},{default:r((()=>[g(" 操作 ")])),_:1})):c("",!0)])),_:1}),(n(!0),d(m,null,h(y.tableData,((e,t)=>(n(),a(K,{key:t},{default:r((()=>[(n(!0),d(m,null,h(y.fieldsMap,((t,o)=>(n(),d(m,{key:o},["count"===t.field?(n(),a(Z,{key:t.field,align:"center"},{default:r((()=>[s(Y,{class:"link-btn",onClick:t=>w.navTo("detail",e)},{default:r((()=>[g(f(void 0!==e[t.field]?e[t.field]:"-"),1)])),_:2},1032,["onClick"])])),_:2},1024)):(n(),a(Z,{key:t.field,align:"center"},{default:r((()=>[g(f(void 0!==e[t.field]?e[t.field]:"-"),1)])),_:2},1024))],64)))),128)),w.sourceMapEnabled?(n(),a(Z,{key:0},{default:r((()=>[s(J,{size:"mini",type:"primary",style:{"white-space":"nowrap"},onClick:t=>w.openErrPopup(e)},{default:r((()=>[g("详 情")])),_:2},1032,["onClick"])])),_:2},1024)):c("",!0)])),_:2},1024)))),128))])),_:1},8,["loading","emptyText"]),s(C,{class:"uni-pagination-box"},{default:r((()=>[s(ne,{"show-icon":"","show-page-size":"","page-size":y.options.pageSize,current:y.options.pageCurrent,total:y.options.total,onChange:w.changePageCurrent,onPageSizeChange:w.changePageSize},null,8,["page-size","current","total","onChange","onPageSizeChange"])])),_:1})])),_:1})])),_:1}),s(se,{ref:"errMsg",type:"center",animation:!1,maskClick:!0,onChange:w.errMsgPopupChange},{default:r((()=>[s(C,{class:"modal black-theme"},{default:r((()=>[s(C,{class:"modal-header"},{default:r((()=>[g(" 错误详情 ")])),_:1}),s(re,{"scroll-x":"true","scroll-y":"true"},{default:r((()=>[s(C,{class:"modal-content",style:{padding:"20px 30px"}},{default:r((()=>[y.msgLoading?(n(),a(C,{key:0,style:{margin:"150px 0","text-align":"center","font-size":"14px"}},{default:r((()=>[s(ae,{class:"mb-m",showText:!1,status:"loading"}),s(C,null,{default:r((()=>[g("正在解析,请稍等...")])),_:1})])),_:1})):c("",!0),s(Y,null,{default:r((()=>[g(f(y.errMsg),1)])),_:1})])),_:1})])),_:1}),s(C,{class:"dialog-close",onClick:w.closeErrPopup},{default:r((()=>[s(C,{class:"dialog-close-plus","data-id":"close"}),s(C,{class:"dialog-close-plus dialog-close-rotate","data-id":"close"})])),_:1},8,["onClick"])])),_:1})])),_:1},8,["onChange"]),s(ie,{class:"sourcemap-drawser",ref:"upload",mode:"right","mask-click":!0,width:340},{default:r((()=>[s(C,{class:"modal",style:{"max-width":"none","min-width":"auto",padding:"0 10px"}},{default:r((()=>[s(C,{class:"modal-header"},{default:r((()=>[g(" 上传 sourceMap ")])),_:1}),s(C,{class:"modal-content",style:{height:"300px",padding:"0"}},{default:r((()=>[s(C,{style:{"margin-top":"10px"}},{default:r((()=>[s(S,{collection:"opendb-app-list",field:"appid as value, name as text",orderby:"text asc",label:"应用",modelValue:y.uploadOptions.appid,"onUpdate:modelValue":i[6]||(i[6]=e=>y.uploadOptions.appid=e)},null,8,["modelValue"])])),_:1}),s(C,{style:{"margin-top":"10px"}},{default:r((()=>[s(S,{collection:"uni-stat-app-platforms",field:"code as value, name as text",orderby:"text asc",label:"平台",modelValue:y.uploadOptions.uni_platform,"onUpdate:modelValue":i[7]||(i[7]=e=>y.uploadOptions.uni_platform=e)},null,8,["modelValue"])])),_:1}),s(C,{style:{"margin-top":"10px"}},{default:r((()=>[s(S,{collection:"opendb-app-versions",where:w.uploadVersionQuery,field:"version as value, version as text",orderby:"text desc",label:"版本",modelValue:y.uploadOptions.version,"onUpdate:modelValue":i[8]||(i[8]=e=>y.uploadOptions.version=e)},null,8,["where","modelValue"])])),_:1}),s(C,{class:"flex m-m"},{default:r((()=>[s(C,{class:"label-text"},{default:r((()=>[g("选择文件:")])),_:1}),s(J,{class:"uni-button ml-m",type:"primary",onClick:w.choosefile},{default:r((()=>[g("选择文件并上传")])),_:1},8,["onClick"])])),_:1}),w.vaildate?c("",!0):(n(),a(C,{key:0,class:"upload-msg-warning"},{default:r((()=>[g(f(y.uploadMsg),1)])),_:1}))])),_:1}),s(C,{class:"dialog-close",onClick:w.closeUploadPopup},{default:r((()=>[s(C,{class:"dialog-close-plus",style:{"background-color":"#333"},"data-id":"close"}),s(C,{class:"dialog-close-plus dialog-close-rotate",style:{"background-color":"#333"},"data-id":"close"})])),_:1},8,["onClick"])])),_:1}),s(C,{class:"upload-task-header"},{default:r((()=>[s(Y,null,{default:r((()=>[g("上传任务:"+f(w.uploadSuccessTasks.length)+"/"+f(y.uploadFile.tempFileTasks.length),1)])),_:1})])),_:1}),y.uploadFile.tempFileTasks.length?(n(),a(re,{key:0,style:{height:"calc(100vh - 362px)"},"scroll-y":"true"},{default:r((()=>[y.uploadFile.tempFileTasks.length>w.uploadSuccessTasks.length?(n(),a(C,{key:0},{default:r((()=>[s(C,{class:"upload-task-header"},{default:r((()=>[s(Y,null,{default:r((()=>[g("正在上传")])),_:1})])),_:1}),s(oe,{uploadTasks:w.sortUploadFileTempFileTasks},null,8,["uploadTasks"])])),_:1})):c("",!0),w.uploadSuccessTasks.length?(n(),a(C,{key:1},{default:r((()=>[s(C,{class:"upload-task-header"},{default:r((()=>[s(Y,{style:{color:"#42b983"}},{default:r((()=>[g("上传成功")])),_:1})])),_:1}),s(oe,{uploadTasks:w.uploadSuccessTasks,showProgress:!1},null,8,["uploadTasks"])])),_:1})):c("",!0)])),_:1})):c("",!0)])),_:1},512)])),_:1})}],["__scopeId","data-v-7da63268"]]);export{qe as default};