monocart-reporter 2.2.1 → 2.2.3
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 +18 -3
- package/lib/cli.js +114 -37
- package/lib/index.d.ts +30 -6
- package/lib/index.js +2 -2
- package/lib/packages/monocart-common.js +1 -1
- package/lib/packages/monocart-network.js +1 -1
- package/lib/packages/monocart-reporter-app.js +1 -1
- package/lib/packages/monocart-vendor.js +32 -12
- package/lib/plugins/coverage/coverage.js +4 -4
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -174,12 +174,27 @@ Separated metadata file (Already included in the above HTML and compressed, it c
|
|
|
174
174
|
> The [Trace Viewer](https://trace.playwright.dev/) requires that the trace file must be loaded over the http:// or https:// protocols without [CORS](https://developer.mozilla.org/en-US/docs/Glossary/CORS) issue, try following start a local web server:
|
|
175
175
|
```sh
|
|
176
176
|
# serve and open report
|
|
177
|
-
npx monocart show-report <
|
|
177
|
+
npx monocart show-report <path-to-report>
|
|
178
178
|
|
|
179
179
|
# serve report
|
|
180
|
-
npx monocart serve-report <
|
|
180
|
+
npx monocart serve-report <path-to-report>
|
|
181
|
+
```
|
|
182
|
+
It works with `http://localhost:port/` or `http://127.0.0.1:port/`
|
|
183
|
+
But to successfully load from other `IP` or `domain`, you must start web server with `https`:
|
|
184
|
+
```sh
|
|
185
|
+
npx monocart show-report <path-to-report> --ssl <path-to-key,path-to-cert>
|
|
186
|
+
# For local debug, you can create and install local CA with 'mkcert', see: https://mkcert.dev
|
|
187
|
+
```
|
|
188
|
+
Or customize your own trace viewer url with option `traceViewerUrl`
|
|
189
|
+
```js
|
|
190
|
+
// reporter options
|
|
191
|
+
{
|
|
192
|
+
name: "My Test Report",
|
|
193
|
+
outputFile: './test-results/report.html',
|
|
194
|
+
// defaults to 'https://trace.playwright.dev/?trace={traceUrl}'
|
|
195
|
+
traceViewerUrl: 'https://your-own-trace-viewer-url/?trace={traceUrl}'
|
|
196
|
+
}
|
|
181
197
|
```
|
|
182
|
-
Or customize your own trace viewer url with option `traceViewerUrl` defaults to `https://trace.playwright.dev/?trace={traceUrl}`
|
|
183
198
|
|
|
184
199
|
## Custom Fields Report
|
|
185
200
|
You can add custom fields to the report. for example: Owner, JIRA Key etc.
|
package/lib/cli.js
CHANGED
|
@@ -3,12 +3,37 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const http = require('http');
|
|
6
|
+
const https = require('https');
|
|
6
7
|
const net = require('net');
|
|
8
|
+
const os = require('os');
|
|
7
9
|
const EC = require('eight-colors');
|
|
8
10
|
const KSR = require('koa-static-resolver');
|
|
9
11
|
const Koa = require('koa');
|
|
12
|
+
const CG = require('console-grid');
|
|
10
13
|
|
|
14
|
+
const { program } = require('./packages/monocart-vendor.js');
|
|
11
15
|
const defaultOptions = require('./default/options.js');
|
|
16
|
+
const version = require('../package.json').version;
|
|
17
|
+
|
|
18
|
+
const getInternalIps = () => {
|
|
19
|
+
const n = os.networkInterfaces();
|
|
20
|
+
// console.log(n);
|
|
21
|
+
const list = [];
|
|
22
|
+
for (const k in n) {
|
|
23
|
+
const inter = n[k];
|
|
24
|
+
for (const j in inter) {
|
|
25
|
+
const item = inter[j];
|
|
26
|
+
if (item.family === 'IPv4' && !item.internal) {
|
|
27
|
+
const a = item.address;
|
|
28
|
+
if (a.startsWith('192.') || a.startsWith('10.')) {
|
|
29
|
+
list.push(a);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return list;
|
|
35
|
+
};
|
|
36
|
+
|
|
12
37
|
|
|
13
38
|
const generatePort = (startPort) => {
|
|
14
39
|
return new Promise((resolve) => {
|
|
@@ -29,36 +54,71 @@ const generatePort = (startPort) => {
|
|
|
29
54
|
});
|
|
30
55
|
};
|
|
31
56
|
|
|
57
|
+
const showIpInfo = (protocol, port) => {
|
|
58
|
+
const ips = getInternalIps();
|
|
59
|
+
CG({
|
|
60
|
+
options: {
|
|
61
|
+
headerVisible: false
|
|
62
|
+
},
|
|
63
|
+
columns: [{
|
|
64
|
+
id: 'type'
|
|
65
|
+
}, {
|
|
66
|
+
id: 'url',
|
|
67
|
+
formatter: (v) => {
|
|
68
|
+
return EC.green(v);
|
|
69
|
+
}
|
|
70
|
+
}],
|
|
71
|
+
rows: [{
|
|
72
|
+
url: `${protocol}://localhost:${port}`,
|
|
73
|
+
type: 'Local'
|
|
74
|
+
}, ... ips.map((ip) => {
|
|
75
|
+
return {
|
|
76
|
+
url: `${protocol}://${ip}:${port}`,
|
|
77
|
+
type: 'Internal'
|
|
78
|
+
};
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
32
83
|
const openUrl = async (p) => {
|
|
33
84
|
const open = await import('open');
|
|
34
85
|
await open.default(p);
|
|
35
86
|
};
|
|
36
87
|
|
|
88
|
+
const createServer = (app, options) => {
|
|
89
|
+
|
|
90
|
+
if (options.ssl) {
|
|
91
|
+
const [keyPath, certPath] = options.ssl.split(',');
|
|
92
|
+
const serverOptions = {
|
|
93
|
+
key: fs.readFileSync(path.resolve(keyPath)),
|
|
94
|
+
cert: fs.readFileSync(path.resolve(certPath))
|
|
95
|
+
};
|
|
96
|
+
return https.createServer(serverOptions, app.callback());
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return http.createServer(app.callback());
|
|
100
|
+
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const serveReport = async (p, options) => {
|
|
37
104
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
list.push(defaultOptions.outputFile);
|
|
105
|
+
if (!p) {
|
|
106
|
+
p = defaultOptions.outputFile;
|
|
41
107
|
}
|
|
42
108
|
|
|
109
|
+
const dirs = [];
|
|
43
110
|
let filename = '';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
EC.logRed(`the path does not exists: ${item}`);
|
|
49
|
-
return false;
|
|
50
|
-
}).map((item) => {
|
|
51
|
-
const stat = fs.statSync(item);
|
|
111
|
+
if (fs.existsSync(p)) {
|
|
112
|
+
const stat = fs.statSync(p);
|
|
52
113
|
if (stat.isDirectory()) {
|
|
53
|
-
|
|
114
|
+
dirs.push(p);
|
|
115
|
+
} else if (stat.isFile()) {
|
|
116
|
+
filename = path.basename(p);
|
|
117
|
+
dirs.push(path.dirname(p));
|
|
54
118
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return path.dirname(item);
|
|
61
|
-
});
|
|
119
|
+
} else {
|
|
120
|
+
EC.logRed(`The path does not exists: ${p}`);
|
|
121
|
+
}
|
|
62
122
|
|
|
63
123
|
dirs.push('./');
|
|
64
124
|
|
|
@@ -75,36 +135,53 @@ const serveReport = async (list, openReport) => {
|
|
|
75
135
|
maxAge: 1
|
|
76
136
|
}));
|
|
77
137
|
|
|
78
|
-
const server =
|
|
138
|
+
const server = createServer(app, options);
|
|
79
139
|
|
|
80
140
|
const port = await generatePort(8090);
|
|
141
|
+
const protocol = options.ssl ? 'https' : 'http';
|
|
81
142
|
|
|
82
|
-
const url =
|
|
143
|
+
const url = `${protocol}://localhost:${port}/${filename}`;
|
|
83
144
|
|
|
84
145
|
server.listen(port, function() {
|
|
85
146
|
EC.logCyan(`${new Date().toLocaleString()} server listening on ${url}`);
|
|
86
|
-
if (
|
|
147
|
+
if (protocol === 'https') {
|
|
148
|
+
showIpInfo(protocol, port);
|
|
149
|
+
}
|
|
150
|
+
if (options.open) {
|
|
87
151
|
openUrl(url);
|
|
88
152
|
}
|
|
89
153
|
});
|
|
90
154
|
|
|
91
155
|
};
|
|
92
156
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
157
|
+
program
|
|
158
|
+
.name('monocart')
|
|
159
|
+
.description('CLI to serve monocart reporter')
|
|
160
|
+
.version(version);
|
|
161
|
+
|
|
162
|
+
program.command('show-report')
|
|
163
|
+
.alias('show')
|
|
164
|
+
.description('Show report')
|
|
165
|
+
.argument('<path-to-report>', 'Report dir or html path')
|
|
166
|
+
.option('-s, --ssl <path-to-key,path-to-cert>', 'Start https server')
|
|
167
|
+
.action((str, options) => {
|
|
168
|
+
options.open = true;
|
|
169
|
+
serveReport(str, options);
|
|
170
|
+
});
|
|
101
171
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
172
|
+
program.command('serve-report')
|
|
173
|
+
.alias('serve')
|
|
174
|
+
.description('Serve report')
|
|
175
|
+
.argument('<path-to-report>', 'Report dir or html path')
|
|
176
|
+
.option('-s, --ssl <path-to-key,path-to-cert>', 'Start https server')
|
|
177
|
+
.action((str, options) => {
|
|
178
|
+
serveReport(str, options);
|
|
179
|
+
});
|
|
106
180
|
|
|
107
|
-
|
|
108
|
-
}
|
|
181
|
+
program.addHelpText('after', `
|
|
182
|
+
Starts ${EC.cyan('https')} with option --ssl:
|
|
183
|
+
npx monocart show-report <path-to-report> ${EC.cyan('--ssl <path-to-key,path-to-cert>')}
|
|
184
|
+
# Create and install local CA with 'mkcert', see: https://mkcert.dev
|
|
185
|
+
`);
|
|
109
186
|
|
|
110
|
-
|
|
187
|
+
program.parse();
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
import { TestInfo } from "@playwright/test"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { TestInfo } from "@playwright/test"
|
|
2
|
+
import type {
|
|
3
|
+
CoverageReportOptions,
|
|
4
|
+
ReportDescription,
|
|
5
|
+
V8CoverageEntry,
|
|
6
|
+
Watermarks,
|
|
7
|
+
CoverageResults,
|
|
8
|
+
CoverageSummary,
|
|
9
|
+
MetricsSummary,
|
|
10
|
+
CoverageFile,
|
|
11
|
+
CoverageRange,
|
|
12
|
+
AddedResults
|
|
13
|
+
} from "monocart-coverage-reports";
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
TestInfo,
|
|
17
|
+
|
|
18
|
+
CoverageReportOptions,
|
|
19
|
+
ReportDescription,
|
|
20
|
+
V8CoverageEntry,
|
|
21
|
+
Watermarks,
|
|
22
|
+
CoverageResults,
|
|
23
|
+
CoverageSummary,
|
|
24
|
+
MetricsSummary,
|
|
25
|
+
CoverageFile,
|
|
26
|
+
CoverageRange,
|
|
27
|
+
AddedResults
|
|
28
|
+
}
|
|
5
29
|
|
|
6
30
|
export type MonocartReporterOptions = {
|
|
7
31
|
// the report name
|
|
@@ -107,13 +131,13 @@ export function attachAuditReport(
|
|
|
107
131
|
export function addCoverageReport(
|
|
108
132
|
coverageData: any[] | any,
|
|
109
133
|
testInfo: TestInfo
|
|
110
|
-
): Promise<
|
|
134
|
+
): Promise<AddedResults>;
|
|
111
135
|
|
|
112
136
|
export function attachCoverageReport(
|
|
113
137
|
coverageData: any[] | any,
|
|
114
138
|
testInfo: TestInfo,
|
|
115
139
|
options?: CoverageReportOptions
|
|
116
|
-
): Promise<
|
|
140
|
+
): Promise<CoverageResults>;
|
|
117
141
|
|
|
118
142
|
|
|
119
143
|
/**
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const Util = require('./utils/util.js');
|
|
|
15
15
|
|
|
16
16
|
// custom reporter
|
|
17
17
|
// https://playwright.dev/docs/test-reporters#custom-reporters
|
|
18
|
-
class
|
|
18
|
+
class MonocartReporter {
|
|
19
19
|
|
|
20
20
|
static Util = Util;
|
|
21
21
|
|
|
@@ -211,4 +211,4 @@ class Reporter {
|
|
|
211
211
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
module.exports =
|
|
214
|
+
module.exports = MonocartReporter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("turbogrid")):"function"==typeof define&&define.amd?define("monocart-common",["turbogrid"],t):"object"==typeof exports?exports["monocart-common"]=t(require("turbogrid")):e["monocart-common"]=t(e.turbogrid)}(self,(e=>(()=>{var t={162:function(e,t,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){c(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){a(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,i){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),r);else if(o(e))n(e,r,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&c||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){f.revokeObjectURL(d)}),4e4)}});i.saveAs=c.saveAs=c,e.exports=c})?n.apply(t,o):n)||(e.exports=a)},925:e=>{var t,r,n=(t=(e,t)=>{t.exports={data:'(()=>{var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var S=x((V,R)=>{var _=0,p=-3;function b(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function N(e,n){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=n,this.destLen=0,this.ltree=new b,this.dtree=new b}var y=new b,k=new b,w=new Uint8Array(30),h=new Uint16Array(30),L=new Uint8Array(30),T=new Uint16Array(30),O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new b,c=new Uint8Array(288+32);function D(e,n,r,a){var t,i;for(t=0;t<r;++t)e[t]=0;for(t=0;t<30-r;++t)e[t+r]=t/r|0;for(i=a,t=0;t<30;++t)n[t]=i,i+=1<<e[t]}function z(e,n){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[24+144+r]=280+r;for(r=0;r<112;++r)e.trans[24+144+8+r]=144+r;for(r=0;r<5;++r)n.table[r]=0;for(n.table[5]=32,r=0;r<32;++r)n.trans[r]=r}var I=new Uint16Array(16);function l(e,n,r,a){var t,i;for(t=0;t<16;++t)e.table[t]=0;for(t=0;t<a;++t)e.table[n[r+t]]++;for(e.table[0]=0,i=0,t=0;t<16;++t)I[t]=i,i+=e.table[t];for(t=0;t<a;++t)n[r+t]&&(e.trans[I[n[r+t]]++]=t)}function B(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var n=e.tag&1;return e.tag>>>=1,n}function u(e,n,r){if(!n)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var a=e.tag&65535>>>16-n;return e.tag>>>=n,e.bitcount-=n,a+r}function v(e,n){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,a=0,t=0,i=e.tag;do a=2*a+(i&1),i>>>=1,++t,r+=n.table[t],a-=n.table[t];while(a>=0);return e.tag=i,e.bitcount-=t,n.trans[r+a]}function C(e,n,r){var a,t,i,o,s,f;for(a=u(e,5,257),t=u(e,5,1),i=u(e,4,4),o=0;o<19;++o)c[o]=0;for(o=0;o<i;++o){var F=u(e,3,0);c[O[o]]=F}for(l(A,c,0,19),s=0;s<a+t;){var g=v(e,A);switch(g){case 16:var M=c[s-1];for(f=u(e,2,3);f;--f)c[s++]=M;break;case 17:for(f=u(e,3,3);f;--f)c[s++]=0;break;case 18:for(f=u(e,7,11);f;--f)c[s++]=0;break;default:c[s++]=g;break}}l(n,c,0,a),l(r,c,a,t)}function U(e,n,r){for(;;){var a=v(e,n);if(a===256)return _;if(a<256)e.dest[e.destLen++]=a;else{var t,i,o,s;for(a-=257,t=u(e,w[a],h[a]),i=v(e,r),o=e.destLen-u(e,L[i],T[i]),s=o;s<o+t;++s)e.dest[e.destLen++]=e.dest[s]}}}function K(e){for(var n,r,a;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(n=e.source[e.sourceIndex+1],n=256*n+e.source[e.sourceIndex],r=e.source[e.sourceIndex+3],r=256*r+e.source[e.sourceIndex+2],n!==(~r&65535))return p;for(e.sourceIndex+=4,a=n;a;--a)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,_}function j(e,n){var r=new N(e,n),a,t,i;do{switch(a=B(r),t=u(r,2,0),t){case 0:i=K(r);break;case 1:i=U(r,y,k);break;case 2:C(r,r.ltree,r.dtree),i=U(r,r.ltree,r.dtree);break;default:i=p}if(i!==_)throw new Error("Data error")}while(!a);return r.destLen<r.dest.length?typeof r.dest.slice=="function"?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}z(y,k);D(w,h,4,3);D(L,T,2,1);w[28]=0;h[28]=258;R.exports=j});var E=x((W,q)=>{var G=S(),H=e=>Uint8Array.from(atob(e),n=>n.charCodeAt(0)),J=e=>new TextDecoder().decode(e);q.exports=function(e){if(e){let[n,r]=e.split(".");if(n&&r){let a=H(n),t=new Uint8Array(parseInt(r));return G(a,t),J(t)}}}});var P=E();onmessage=function(e){postMessage(P(e.data))};postMessage("workerReady");})();\n'}},()=>(r||t((r={exports:{}}).exports,r),r.exports))();e.exports=e=>new Promise((t=>{let r=new Worker(URL.createObjectURL(new Blob([n.data],{type:"application/javascript"})));r.onmessage=n=>{"workerReady"!==n.data?(t(n.data),r.terminate()):r.postMessage(e)},r.onerror=e=>{t({error:e}),r.terminate()}}))},209:e=>{const t={tagPattern:/(\s*)@([^@\s]+)(\s*)/g,attachments:{audit:{name:"audit",contentType:"text/html",reportFile:"audit-report.json"},coverage:{name:"coverage",contentType:"text/html",reportFile:"coverage-report.json"},network:{name:"network",contentType:"text/html",reportFile:"network-report.json"}},pageTimings:[{key:"onContentLoad",name:"Content Loaded",color:"#1a1aa6"},{key:"onLoad",name:"Page Loaded",color:"#c80000"}],timings:[{key:"blocked",name:"Blocking",color:"#858585"},{key:"dns",name:"DNS Lookup",color:"#009688"},{key:"connect",name:"Connecting",color:"#b52dcd"},{key:"send",name:"Sending",color:"#74979a"},{key:"wait",name:"Waiting",color:"#00a846"},{key:"receive",name:"Receiving",color:"#0299de"}],hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},isNull:function(e){return null==e},uid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t="0123456789abcdefghijklmnopqrstuvwxyz";let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(;e--;)r+=t[36*Math.random()|0];return r},zero:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=`${e}`).padStart(t,"0")},toNum:function(e,t){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),t&&(e=Math.round(e)),e},isList:function(e){return!!(e&&e instanceof Array&&e.length>0)},forEach:function(e,r){const n=e=>"break"===e||!1===e,o=(e,a)=>{if(t.isList(e))for(const t of e){const e=r(t,a);if(n(e))return e;const i=o(t.subs,t);if(n(i))return i}};o(e)},formatPath:function(e){return e&&(e=e.replace(/\\/g,"/")),e},getCurrentTrendInfo:e=>{const{date:t,duration:r,summary:n}=e,o={date:t,duration:r};return Object.keys(n).forEach((e=>{const t=n[e];o[e]=t.value})),o},isTagItem:e=>"case"===e.type||"suite"===e.type&&"describe"===e.suiteType,delay:function(e){return new Promise((t=>{e?setTimeout(t,e):setImmediate(t)}))},generatePercentChart:function(e){return`<div style="--mcr-percent:${e}%;" class="mcr-percent-chart"></div>`},getStatus:(e,t)=>t?e<t[0]?"low":e<t[1]?"medium":"high":"unknown",isJsonType:e=>!(!e||"application/json"!==e&&"json"!==e),isMarkdownType:e=>!(!e||"text/markdown"!==e&&"markdown"!==e),isTextType(e){if(e){if(e.startsWith("text"))return!0;if(t.isMarkdownType(e))return!0;if(t.isJsonType(e))return!0}return!1},dFixed:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isInteger(e)?e:t.toNum(t.toNum(e).toFixed(r))},pxFixed:e=>{const t=Math.floor(e);return e<t+.5?t+.5:t+1.5},point:(e,r)=>`${t.dFixed(e)},${t.dFixed(r)}`,NF:function(e){return"number"==typeof e&&e?e.toLocaleString():e},PF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";e=t.toNum(e),r=t.toNum(r);let i=0;r&&(i=e/r);const s=(100*i).toFixed(n);return o?s+a+o:parseFloat(s)},PSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"%"," ")},PNF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"")},BF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(0===(e=t.toNum(e,!0)))return`0${n}B`;let o="";e<0&&(e=Math.abs(e),o="-");const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];for(let t=0,i=a.length;t<i;t++){const i=Math.pow(1024,t),s=Math.pow(1024,t+1);if(e>i&&e<s){const s=a[t];e=o+(e/i).toFixed(r)+n+s;break}}return e},BSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.BF(e,r," ")},TF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.toNum(e,!0);if(n<1e3)return`${n}${r}ms`;if(n<6e4){const e=Math.floor(n/1e3),t=Math.round((n-1e3*e)/100);return t?`${e}.${t}${r}s`:`${e}${r}s`}const o=Math.round(n/1e3),a=60,i=3600,s=24*i;if(o<i){const e=Math.floor(o/a);return`${e}${r}m ${o-e*a}${r}s`}if(o<s){const e=Math.floor(o/i),t=Math.floor((o-e*i)/a);return`${e}${r}h ${t}${r}m ${o-e*i-t*a}${r}s`}const c=Math.floor(o/s),u=Math.floor((o-c*s)/i),l=Math.floor((o-c*s-u*i)/a);return`${c}${r}d ${u}${r}h ${l}${r}m ${o-c*s-u*i-l*a}${r}s`},TSF:function(e){return t.TF(e," ")}};e.exports=t},46:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{CommonUtil:()=>k,debounce:()=>t,decodeIcons:()=>M,hash:()=>g,inflate:()=>i(),microtask:()=>r,niceTicks:()=>p,saveAs:()=>h.saveAs,setFavicon:()=>A,store:()=>b});class e{start(e){this.callback=e,this.started||(this.started=!0,this.create())}create(){if("function"!=typeof window.queueMicrotask){if("function"!=typeof Promise)throw new Error("Current browser does NOT support queueMicrotask or Promise");Promise.resolve().then((()=>{this.execute()}))}else window.queueMicrotask((()=>{this.execute()}))}execute(){if(!this.started)return;this.started=!1;const e=this.callback;this.callback=null,"function"==typeof e&&e.call(this)}cancel(){this.started=!1,this.callback=null}}const t=function(e,t=100){let r;const n=function(){clearTimeout(r),r=setTimeout((()=>{e.apply(this,arguments)}),t)};return n.cancel=()=>{clearTimeout(r)},n},r=function(t){const r=new e,n=function(){r.start((()=>{t.apply(this,arguments)}))};return n.cancel=()=>{r.cancel()},n};var a=n(925),i=n.n(a);function s(e){return""+e}function c(e){var t=s(e).split(".");return t.length>1?t[1].length:0}function u(e){var t=s(e);return parseInt(t.replace(".",""))}function l(e,t){var r=c(e),n=c(t);if(r+n===0)return e+t;var o=Math.pow(10,Math.max(r,n));return(Math.round(e*o)+Math.round(t*o))/o}function f(e,t){var r=c(e),n=c(t);return r+n===0?e*t:u(e)*u(t)/Math.pow(10,r+n)}function d(e,t){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)}var w=function(e){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),e};function p(e,t,r){if(e=w(e),t=w(t),(r=w(r))||(r=4),e===t)t=e+1;else if(e>t){var n=e;e=t,t=n}for(var o=d(t-e,!1),a=d(o/(r-1),!0),i=f(Math.floor(e/a),a),s=f(Math.ceil(t/a),a),c=[],u=i;u<=s;)c.push(u),u=l(u,a);return c}var h=n(162);const m={get:function(e){let t={};const r=location.hash.slice(1);if(r){const e=new URLSearchParams(r);t=Object.fromEntries(e)}return e?t[e]:t},set:function(e,t){if(!e)return;let r=e;2===arguments.length&&(r={},r[e]=t);const n=m.get();Object.keys(r).forEach((e=>{n[e]=r[e]}));const o=new URLSearchParams(n);location.hash=o.toString()},remove:function(e){if(!e)return void(location.hash="");let t=e;Array.isArray(e)||(t=[e]);const r=m.get();t.forEach((e=>{delete r[e]}));const n=new URLSearchParams(r);location.hash=n.toString()}},g=m,v=e=>`mcr-${e}`,b={get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=window.localStorage.getItem(v(e));return null===r?t:r},set(e,t){window.localStorage.setItem(v(e),t)},remove(e){window.localStorage.removeItem(v(e))}},M=e=>{const t=e.keys(),r={};return t.forEach((t=>{const n=t.toLowerCase().split("/").pop().slice(0,-4),o=e(t),a=o.slice(o.indexOf(",")+1),i=atob(a);r[n]=i})),r};var y=n(46),x=n(209),T=n.n(x);const k={...y.Util,...T(),isTouchDevice:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},A=()=>{const e=document.querySelector('link[rel="icon"]');e&&(e.href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAwIDE2MDAiPg0KICAgIDxwYXRoIGZpbGw9ImNob2NvbGF0ZSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAwLDBMMjU3LDMwMmwxOTIsOThINjAwbDUwLTQ5LDE1MC01MCwxNTAsNTAsNTAsNDloMTQ5bDE5NS05OEwxMzAwLDBsMzAwLDQwMEwxMzAwLDYwMWwyMDEsOTlMMTI0OCw4MDBsMiwxMDEtMTUwLDMwMCw1MCwxOTktMTUwLDIwMEg2MDBMNDUwLDE0MDBsNTEtMTk5TDM1MCw5MDFWODAwTDEwMSw3MDBsMjAwLTk5TDAsNDAwWk01MDAsNTUwSDYwMEw4MDAsNjUwbDIwMC0xMDBoMTAwVjg1MEgxMDAwVjY1MEw4MDAsNzUwLDYwMCw2NTBWODUwSDUwMFY1NTBaIi8+DQo8L3N2Zz4=")}})(),o})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("turbogrid")):"function"==typeof define&&define.amd?define("monocart-common",["turbogrid"],t):"object"==typeof exports?exports["monocart-common"]=t(require("turbogrid")):e["monocart-common"]=t(e.turbogrid)}(self,(e=>(()=>{var t={162:function(e,t,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){c(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){a(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,i){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),r);else if(o(e))n(e,r,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&c||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){f.revokeObjectURL(d)}),4e4)}});i.saveAs=c.saveAs=c,e.exports=c})?n.apply(t,o):n)||(e.exports=a)},925:e=>{var t,r,n=(t=(e,t)=>{t.exports={data:'(()=>{var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var S=x((V,R)=>{var _=0,p=-3;function b(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function N(e,n){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=n,this.destLen=0,this.ltree=new b,this.dtree=new b}var y=new b,k=new b,w=new Uint8Array(30),h=new Uint16Array(30),L=new Uint8Array(30),T=new Uint16Array(30),O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new b,c=new Uint8Array(320);function D(e,n,r,a){var t,i;for(t=0;t<r;++t)e[t]=0;for(t=0;t<30-r;++t)e[t+r]=t/r|0;for(i=a,t=0;t<30;++t)n[t]=i,i+=1<<e[t]}function z(e,n){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)n.table[r]=0;for(n.table[5]=32,r=0;r<32;++r)n.trans[r]=r}var I=new Uint16Array(16);function l(e,n,r,a){var t,i;for(t=0;t<16;++t)e.table[t]=0;for(t=0;t<a;++t)e.table[n[r+t]]++;for(e.table[0]=0,i=0,t=0;t<16;++t)I[t]=i,i+=e.table[t];for(t=0;t<a;++t)n[r+t]&&(e.trans[I[n[r+t]]++]=t)}function B(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var n=e.tag&1;return e.tag>>>=1,n}function u(e,n,r){if(!n)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var a=e.tag&65535>>>16-n;return e.tag>>>=n,e.bitcount-=n,a+r}function v(e,n){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,a=0,t=0,i=e.tag;do a=2*a+(i&1),i>>>=1,++t,r+=n.table[t],a-=n.table[t];while(a>=0);return e.tag=i,e.bitcount-=t,n.trans[r+a]}function C(e,n,r){var a,t,i,o,s,f;for(a=u(e,5,257),t=u(e,5,1),i=u(e,4,4),o=0;o<19;++o)c[o]=0;for(o=0;o<i;++o){var F=u(e,3,0);c[O[o]]=F}for(l(A,c,0,19),s=0;s<a+t;){var g=v(e,A);switch(g){case 16:var M=c[s-1];for(f=u(e,2,3);f;--f)c[s++]=M;break;case 17:for(f=u(e,3,3);f;--f)c[s++]=0;break;case 18:for(f=u(e,7,11);f;--f)c[s++]=0;break;default:c[s++]=g;break}}l(n,c,0,a),l(r,c,a,t)}function U(e,n,r){for(;;){var a=v(e,n);if(a===256)return _;if(a<256)e.dest[e.destLen++]=a;else{var t,i,o,s;for(a-=257,t=u(e,w[a],h[a]),i=v(e,r),o=e.destLen-u(e,L[i],T[i]),s=o;s<o+t;++s)e.dest[e.destLen++]=e.dest[s]}}}function K(e){for(var n,r,a;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(n=e.source[e.sourceIndex+1],n=256*n+e.source[e.sourceIndex],r=e.source[e.sourceIndex+3],r=256*r+e.source[e.sourceIndex+2],n!==(~r&65535))return p;for(e.sourceIndex+=4,a=n;a;--a)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,_}function j(e,n){var r=new N(e,n),a,t,i;do{switch(a=B(r),t=u(r,2,0),t){case 0:i=K(r);break;case 1:i=U(r,y,k);break;case 2:C(r,r.ltree,r.dtree),i=U(r,r.ltree,r.dtree);break;default:i=p}if(i!==_)throw new Error("Data error")}while(!a);return r.destLen<r.dest.length?typeof r.dest.slice=="function"?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}z(y,k);D(w,h,4,3);D(L,T,2,1);w[28]=0;h[28]=258;R.exports=j});var E=x((W,q)=>{var G=S(),H=e=>Uint8Array.from(atob(e),n=>n.charCodeAt(0)),J=e=>new TextDecoder().decode(e);q.exports=function(e){if(e){let[n,r]=e.split(".");if(n&&r){let a=H(n),t=new Uint8Array(parseInt(r));return G(a,t),J(t)}}}});var P=E();onmessage=function(e){postMessage(P(e.data))};postMessage("workerReady");})();\n'}},()=>(r||t((r={exports:{}}).exports,r),r.exports))();e.exports=e=>new Promise((t=>{let r=new Worker(URL.createObjectURL(new Blob([n.data],{type:"application/javascript"})));r.onmessage=n=>{"workerReady"!==n.data?(t(n.data),r.terminate()):r.postMessage(e)},r.onerror=e=>{t({error:e}),r.terminate()}}))},209:e=>{const t={tagPattern:/(\s*)@([^@\s]+)(\s*)/g,attachments:{audit:{name:"audit",contentType:"text/html",reportFile:"audit-report.json"},coverage:{name:"coverage",contentType:"text/html",reportFile:"coverage-report.json"},network:{name:"network",contentType:"text/html",reportFile:"network-report.json"}},pageTimings:[{key:"onContentLoad",name:"Content Loaded",color:"#1a1aa6"},{key:"onLoad",name:"Page Loaded",color:"#c80000"}],timings:[{key:"blocked",name:"Blocking",color:"#858585"},{key:"dns",name:"DNS Lookup",color:"#009688"},{key:"connect",name:"Connecting",color:"#b52dcd"},{key:"send",name:"Sending",color:"#74979a"},{key:"wait",name:"Waiting",color:"#00a846"},{key:"receive",name:"Receiving",color:"#0299de"}],hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},isNull:function(e){return null==e},uid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t="0123456789abcdefghijklmnopqrstuvwxyz";let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(;e--;)r+=t[36*Math.random()|0];return r},zero:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=`${e}`).padStart(t,"0")},toNum:function(e,t){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),t&&(e=Math.round(e)),e},isList:function(e){return!!(e&&e instanceof Array&&e.length>0)},forEach:function(e,r){const n=e=>"break"===e||!1===e,o=(e,a)=>{if(t.isList(e))for(const t of e){const e=r(t,a);if(n(e))return e;const i=o(t.subs,t);if(n(i))return i}};o(e)},formatPath:function(e){return e&&(e=e.replace(/\\/g,"/")),e},getCurrentTrendInfo:e=>{const{date:t,duration:r,summary:n}=e,o={date:t,duration:r};return Object.keys(n).forEach((e=>{const t=n[e];o[e]=t.value})),o},isTagItem:e=>"case"===e.type||"suite"===e.type&&"describe"===e.suiteType,delay:function(e){return new Promise((t=>{e?setTimeout(t,e):setImmediate(t)}))},generatePercentChart:function(e){return`<div style="--mcr-percent:${e}%;" class="mcr-percent-chart"></div>`},getStatus:(e,t)=>t?e<t[0]?"low":e<t[1]?"medium":"high":"unknown",isJsonType:e=>!(!e||"application/json"!==e&&"json"!==e),isMarkdownType:e=>!(!e||"text/markdown"!==e&&"markdown"!==e),isTextType(e){if(e){if(e.startsWith("text"))return!0;if(t.isMarkdownType(e))return!0;if(t.isJsonType(e))return!0}return!1},dFixed:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isInteger(e)?e:t.toNum(t.toNum(e).toFixed(r))},pxFixed:e=>{const t=Math.floor(e);return e<t+.5?t+.5:t+1.5},point:(e,r)=>`${t.dFixed(e)},${t.dFixed(r)}`,NF:function(e){return"number"==typeof e&&e?e.toLocaleString():e},PF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";e=t.toNum(e),r=t.toNum(r);let i=0;r&&(i=e/r);const s=(100*i).toFixed(n);return o?s+a+o:parseFloat(s)},PSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"%"," ")},PNF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"")},BF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(0===(e=t.toNum(e,!0)))return`0${n}B`;let o="";e<0&&(e=Math.abs(e),o="-");const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];for(let t=0,i=a.length;t<i;t++){const i=Math.pow(1024,t),s=Math.pow(1024,t+1);if(e>i&&e<s){const s=a[t];e=o+(e/i).toFixed(r)+n+s;break}}return e},BSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.BF(e,r," ")},TF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.toNum(e,!0);if(n<1e3)return`${n}${r}ms`;if(n<6e4){const e=Math.floor(n/1e3),t=Math.round((n-1e3*e)/100);return t?`${e}.${t}${r}s`:`${e}${r}s`}const o=Math.round(n/1e3),a=60,i=3600,s=24*i;if(o<i){const e=Math.floor(o/a);return`${e}${r}m ${o-e*a}${r}s`}if(o<s){const e=Math.floor(o/i),t=Math.floor((o-e*i)/a);return`${e}${r}h ${t}${r}m ${o-e*i-t*a}${r}s`}const c=Math.floor(o/s),u=Math.floor((o-c*s)/i),l=Math.floor((o-c*s-u*i)/a);return`${c}${r}d ${u}${r}h ${l}${r}m ${o-c*s-u*i-l*a}${r}s`},TSF:function(e){return t.TF(e," ")}};e.exports=t},46:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{CommonUtil:()=>k,debounce:()=>t,decodeIcons:()=>M,hash:()=>g,inflate:()=>i(),microtask:()=>r,niceTicks:()=>p,saveAs:()=>h.saveAs,setFavicon:()=>A,store:()=>b});class e{start(e){this.callback=e,this.started||(this.started=!0,this.create())}create(){if("function"!=typeof window.queueMicrotask){if("function"!=typeof Promise)throw new Error("Current browser does NOT support queueMicrotask or Promise");Promise.resolve().then((()=>{this.execute()}))}else window.queueMicrotask((()=>{this.execute()}))}execute(){if(!this.started)return;this.started=!1;const e=this.callback;this.callback=null,"function"==typeof e&&e.call(this)}cancel(){this.started=!1,this.callback=null}}const t=function(e,t=100){let r;const n=function(){clearTimeout(r),r=setTimeout((()=>{e.apply(this,arguments)}),t)};return n.cancel=()=>{clearTimeout(r)},n},r=function(t){const r=new e,n=function(){r.start((()=>{t.apply(this,arguments)}))};return n.cancel=()=>{r.cancel()},n};var a=n(925),i=n.n(a);function s(e){return""+e}function c(e){var t=s(e).split(".");return t.length>1?t[1].length:0}function u(e){var t=s(e);return parseInt(t.replace(".",""))}function l(e,t){var r=c(e),n=c(t);if(r+n===0)return e+t;var o=Math.pow(10,Math.max(r,n));return(Math.round(e*o)+Math.round(t*o))/o}function f(e,t){var r=c(e),n=c(t);return r+n===0?e*t:u(e)*u(t)/Math.pow(10,r+n)}function d(e,t){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)}var w=function(e){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),e};function p(e,t,r){if(e=w(e),t=w(t),(r=w(r))||(r=4),e===t)t=e+1;else if(e>t){var n=e;e=t,t=n}for(var o=d(t-e,!1),a=d(o/(r-1),!0),i=f(Math.floor(e/a),a),s=f(Math.ceil(t/a),a),c=[],u=i;u<=s;)c.push(u),u=l(u,a);return c}var h=n(162);const m={get:function(e){let t={};const r=location.hash.slice(1);if(r){const e=new URLSearchParams(r);t=Object.fromEntries(e)}return e?t[e]:t},set:function(e,t){if(!e)return;let r=e;2===arguments.length&&(r={},r[e]=t);const n=m.get();Object.keys(r).forEach((e=>{n[e]=r[e]}));const o=new URLSearchParams(n);location.hash=o.toString()},remove:function(e){if(!e)return void(location.hash="");let t=e;Array.isArray(e)||(t=[e]);const r=m.get();t.forEach((e=>{delete r[e]}));const n=new URLSearchParams(r);location.hash=n.toString()}},g=m,v=e=>`mcr-${e}`,b={get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=window.localStorage.getItem(v(e));return null===r?t:r},set(e,t){window.localStorage.setItem(v(e),t)},remove(e){window.localStorage.removeItem(v(e))}},M=e=>{const t=e.keys(),r={};return t.forEach((t=>{const n=t.toLowerCase().split("/").pop().slice(0,-4),o=e(t),a=o.slice(o.indexOf(",")+1),i=atob(a);r[n]=i})),r};var y=n(46),x=n(209),T=n.n(x);const k={...y.Util,...T(),isTouchDevice:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},A=()=>{const e=document.querySelector('link[rel="icon"]');e&&(e.href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAwIDE2MDAiPg0KICAgIDxwYXRoIGZpbGw9ImNob2NvbGF0ZSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAwLDBMMjU3LDMwMmwxOTIsOThINjAwbDUwLTQ5LDE1MC01MCwxNTAsNTAsNTAsNDloMTQ5bDE5NS05OEwxMzAwLDBsMzAwLDQwMEwxMzAwLDYwMWwyMDEsOTlMMTI0OCw4MDBsMiwxMDEtMTUwLDMwMCw1MCwxOTktMTUwLDIwMEg2MDBMNDUwLDE0MDBsNTEtMTk5TDM1MCw5MDFWODAwTDEwMSw3MDBsMjAwLTk5TDAsNDAwWk01MDAsNTUwSDYwMEw4MDAsNjUwbDIwMC0xMDBoMTAwVjg1MEgxMDAwVjY1MEw4MDAsNzUwLDYwMCw2NTBWODUwSDUwMFY1NTBaIi8+DQo8L3N2Zz4=")}})(),o})()));
|